;==============================================================
; 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,  20
         ; Let Tu3_19 = 
         ; Unit
         ; Let x_13 = 
         ; Apply direct f_9
         CALL  f_9
         ADD   ESP,  0
         MOV   [EBP-4],  EAX
         ; Let Ti4_16 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-8],  EAX
         ; Let Ti7_15 = 
         ; If x_13 <= Ti4_16
         MOV   EAX,  [EBP-4]
         CMP   EAX,  [EBP-8]
         JG    else_20
         ; Let Tu5_18 = 
         ; Unit
         ; Let Ti6_17 = 
         ; Apply direct g_11
         CALL  g_11
         ADD   ESP,  0
         MOV   [EBP-16],  EAX
         ; Add Ti6_17 + x_13
         MOV   EAX,  [EBP-16]
         ADD   EAX,  [EBP-4]
         MOV   [EBP-12],  EAX
         JMP   cont_21
else_20:
         ; Var x_13
         MOV   EAX,  [EBP-4]
         MOV   [EBP-12],  EAX
cont_21:
         ; Let Ti8_14 = 
         ; Add Ti7_15 + x_13
         MOV   EAX,  [EBP-12]
         ADD   EAX,  [EBP-4]
         MOV   [EBP-20],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-20]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function f_9:

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

;==============================================================
; Function g_11:

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

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

END start

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

