;==============================================================
; 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,  8
         ; Make closure f_9
         PUSH  4
         CALL  min_caml_malloc
         ADD   ESP,  4
         MOV   [EBP-4],  EAX
         MOV   EDI,  EAX
         MOV   [EDI],  f_9
         ; Let Ti2_11 = 
         ; Integer 9
         MOV   EAX,  9
         MOV   [EBP-8],  EAX
         ; Apply closure f_9
         PUSH  ESI
         MOV   ESI,  [EBP-4]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP-8]
         CALL  EAX
         ADD   ESP,  4
         POP   ESI
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

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

f_9 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  28
         ; Let Ti3_12 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-4],  EAX
         ; If Ti3_12 <= n_10
         MOV   EAX,  [EBP-4]
         CMP   EAX,  [EBP+8]
         JG    else_20
         ; Let Tu1_13 = 
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP+8]
         CALL  min_caml_print_int
         ADD   ESP,  4
         ; Let Ti4_19 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-8],  EAX
         ; Let a_14 = 
         ; Apply direct min_caml_create_array
         PUSH  dword ptr ESI
         PUSH  dword ptr [EBP-8]
         CALL  min_caml_create_array
         ADD   ESP,  8
         MOV   [EBP-12],  EAX
         ; Let Ti5_18 = 
         ; Integer 0
         MOV   EAX,  0
         MOV   [EBP-16],  EAX
         ; Let Tf6_15 = 
         ; Array a_14[Ti5_18]
         MOV   EBX,  [EBP-16]
         SHL   EBX,  2
         ADD   EBX,  [EBP-12]
         MOV   EAX,  [EBX]
         MOV   [EBP-20],  EAX
         ; Let Ti7_17 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-24],  EAX
         ; Let Ti8_16 = 
         ; Sub n_10 - Ti7_17
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP-24]
         MOV   [EBP-28],  EAX
         ; Apply closure Tf6_15
         MOV   ESI,  [EBP-20]
         MOV   EAX, [ESI]
         PUSH  dword ptr [EBP-28]
         CALL  EAX
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         RET
else_20:
         ; Unit
         MOV   ESP,  EBP
         POP   EBP
         RET
f_9 endp

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

END start

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

