;==============================================================
; Intel Asm
;==============================================================
         .486
         .model flat, stdcall
         option casemap :none
         include \masm32\include\windows.inc
         include \masm32\include\masm32.inc
         include \masm32\include\kernel32.inc
         include \masm32\macros\macros.asm

         includelib \masm32\lib\masm32.lib
         includelib \masm32\lib\kernel32.lib

;==============================================================
         .data
Txt db ?, 0

;==============================================================
; Entry point:
         .code
start:
         FINIT
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  48
         ; Let Ti2_26 = 
         ; Integer 10
         MOV   EAX,  10
         MOV   [EBP-4],  EAX
         ; Let Ti3_27 = 
         ; Integer 3
         MOV   EAX,  3
         MOV   [EBP-8],  EAX
         ; Let y_15 = 
         ; Apply direct min_caml_create_array
         PUSH  dword ptr [EBP-8]
         PUSH  dword ptr [EBP-4]
         CALL  min_caml_create_array
         ADD   ESP,  8
         MOV   [EBP-12],  EAX
         ; Let x_16 = 
         ; Integer 67890
         MOV   EAX,  67890
         MOV   [EBP-16],  EAX
         ; Let Ti4_25 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-20],  EAX
         ; Let Ti5_18 = 
         ; Array y_15[Ti4_25]
         MOV   EBX,  [EBP-20]
         SHL   EBX,  2
         ADD   EBX,  [EBP-12]
         MOV   EAX,  [EBX]
         MOV   [EBP-24],  EAX
         ; Let Ti6_19 = 
         ; Integer 3
         MOV   EAX,  3
         MOV   [EBP-28],  EAX
         ; Let Ti12_17 = 
         ; If Ti5_18 == Ti6_19
         MOV   EAX,  [EBP-24]
         CMP   EAX,  [EBP-28]
         JNE   else_28
         ; Let Tu7_24 = 
         ; Unit
         ; Let Ti8_21 = 
         ; Apply direct f_13
         CALL  f_13
         ADD   ESP,  0
         MOV   [EBP-36],  EAX
         ; Let Ti9_23 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-40],  EAX
         ; Let Ti10_22 = 
         ; Array y_15[Ti9_23]
         MOV   EBX,  [EBP-40]
         SHL   EBX,  2
         ADD   EBX,  [EBP-12]
         MOV   EAX,  [EBX]
         MOV   [EBP-44],  EAX
         ; Let Ti11_20 = 
         ; Add Ti8_21 + Ti10_22
         MOV   EAX,  [EBP-36]
         ADD   EAX,  [EBP-44]
         MOV   [EBP-48],  EAX
         ; Add Ti11_20 + x_16
         MOV   EAX,  [EBP-48]
         ADD   EAX,  [EBP-16]
         MOV   [EBP-32],  EAX
         JMP   cont_29
else_28:
         ; Integer 7
         MOV   EAX,  7
         MOV   [EBP-32],  EAX
cont_29:
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-32]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function f_13:

f_13 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  0
         ; Integer 12345
         MOV   EAX,  12345
         MOV   ESP,  EBP
         POP   EBP
         RET
f_13 endp

;==============================================================
; need to copy min_caml_intel.asm from min-caml directory to output directoty
include min_caml_intel.asm

END start

;==============================================================

