;==============================================================
; 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,  16
         ; Let Tu4_22 = 
         ; Unit
         ; Let x_16 = 
         ; Apply direct f_10
         CALL  f_10
         ADD   ESP,  0
         MOV   [EBP-4],  EAX
         ; Let Ti5_19 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-8],  EAX
         ; Let Ti8_18 = 
         ; If x_16 <= Ti5_19
         MOV   EAX,  [EBP-4]
         CMP   EAX,  [EBP-8]
         JG    else_23
         ; Let Tu6_21 = 
         ; Unit
         ; Apply direct g_12
         CALL  g_12
         ADD   ESP,  0
         MOV   [EBP-12],  EAX
         JMP   cont_24
else_23:
         ; Let Tu7_20 = 
         ; Unit
         ; Apply direct h_14
         CALL  h_14
         ADD   ESP,  0
         MOV   [EBP-12],  EAX
cont_24:
         ; Let Ti9_17 = 
         ; Add Ti8_18 + x_16
         MOV   EAX,  [EBP-12]
         ADD   EAX,  [EBP-4]
         MOV   [EBP-16],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-16]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function f_10:

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

;==============================================================
; Function g_12:

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

;==============================================================
; Function h_14:

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

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

END start

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

