;==============================================================
; 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,  36
         ; Let Tu4_31 = 
         ; Unit
         ; Let x_20 = 
         ; Apply direct f_14
         CALL  f_14
         ADD   ESP,  0
         MOV   [EBP-4],  EAX
         ; Let Tu5_30 = 
         ; Unit
         ; Let y_21 = 
         ; Apply direct g_16
         CALL  g_16
         ADD   ESP,  0
         MOV   [EBP-8],  EAX
         ; Let Tu6_29 = 
         ; Unit
         ; Let Ti7_25 = 
         ; Apply direct h_18
         CALL  h_18
         ADD   ESP,  0
         MOV   [EBP-12],  EAX
         ; Let Ti8_26 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-16],  EAX
         ; Let Ti11_24 = 
         ; If Ti7_25 == Ti8_26
         MOV   EAX,  [EBP-12]
         CMP   EAX,  [EBP-16]
         JNE   else_32
         ; Let Ti9_28 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-24],  EAX
         ; Add x_20 + Ti9_28
         MOV   EAX,  [EBP-4]
         ADD   EAX,  [EBP-24]
         MOV   [EBP-20],  EAX
         JMP   cont_33
else_32:
         ; Let Ti10_27 = 
         ; Integer 2
         MOV   EAX,  2
         MOV   [EBP-28],  EAX
         ; Add y_21 + Ti10_27
         MOV   EAX,  [EBP-8]
         ADD   EAX,  [EBP-28]
         MOV   [EBP-20],  EAX
cont_33:
         ; Let Ti12_23 = 
         ; Add Ti11_24 + x_20
         MOV   EAX,  [EBP-20]
         ADD   EAX,  [EBP-4]
         MOV   [EBP-32],  EAX
         ; Let Ti13_22 = 
         ; Add Ti12_23 + y_21
         MOV   EAX,  [EBP-32]
         ADD   EAX,  [EBP-8]
         MOV   [EBP-36],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-36]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function f_14:

f_14 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  0
         ; Integer 123
         MOV   EAX,  123
         MOV   ESP,  EBP
         POP   EBP
         RET
f_14 endp

;==============================================================
; Function g_16:

g_16 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  0
         ; Integer 456
         MOV   EAX,  456
         MOV   ESP,  EBP
         POP   EBP
         RET
g_16 endp

;==============================================================
; Function h_18:

h_18 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  0
         ; Integer 789
         MOV   EAX,  789
         MOV   ESP,  EBP
         POP   EBP
         RET
h_18 endp

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

END start

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

