;==============================================================
; 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,  24
         ; Let Tu4_26 = 
         ; Unit
         ; Let x_18 = 
         ; Apply direct f_12
         CALL  f_12
         ADD   ESP,  0
         MOV   [EBP-4],  EAX
         ; Let Ti5_21 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-8],  EAX
         ; Let Ti10_20 = 
         ; If x_18 <= Ti5_21
         MOV   EAX,  [EBP-4]
         CMP   EAX,  [EBP-8]
         JG    else_27
         ; Let Tu6_25 = 
         ; Unit
         ; Let Ti7_24 = 
         ; Apply direct g_14
         CALL  g_14
         ADD   ESP,  0
         MOV   [EBP-16],  EAX
         ; Add Ti7_24 + x_18
         MOV   EAX,  [EBP-16]
         ADD   EAX,  [EBP-4]
         MOV   [EBP-12],  EAX
         JMP   cont_28
else_27:
         ; Let Tu8_23 = 
         ; Unit
         ; Let Ti9_22 = 
         ; Apply direct h_16
         CALL  h_16
         ADD   ESP,  0
         MOV   [EBP-20],  EAX
         ; Sub Ti9_22 - x_18
         MOV   EAX,  [EBP-20]
         SUB   EAX,  [EBP-4]
         MOV   [EBP-12],  EAX
cont_28:
         ; Let Ti11_19 = 
         ; Add Ti10_20 + x_18
         MOV   EAX,  [EBP-12]
         ADD   EAX,  [EBP-4]
         MOV   [EBP-24],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-24]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function f_12:

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

;==============================================================
; Function g_14:

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

;==============================================================
; Function h_16:

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

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

END start

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

