;==============================================================
; 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
         ; Let Ti1_13 = 
         ; Integer 10
         MOV   EAX,  10
         MOV   [EBP-4],  EAX
         ; Let Ti2_12 = 
         ; Apply direct fib_10
         PUSH  dword ptr [EBP-4]
         CALL  fib_10
         ADD   ESP,  4
         MOV   [EBP-8],  EAX
         ; Apply direct min_caml_print_int
         PUSH  dword ptr [EBP-8]
         CALL  min_caml_print_int
         ADD   ESP,  4
         MOV   ESP,  EBP
         POP   EBP
         PUSH  0
         CALL  ExitProcess

;==============================================================
; Function fib_10:

fib_10 proc
         PUSH  EBP
         MOV   EBP,  ESP
         SUB   ESP,  28
         ; Let Ti3_14 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-4],  EAX
         ; If n_11 <= Ti3_14
         MOV   EAX,  [EBP+8]
         CMP   EAX,  [EBP-4]
         JG    else_21
         ; Var n_11
         MOV   EAX,  [EBP+8]
         MOV   ESP,  EBP
         POP   EBP
         RET
else_21:
         ; Let Ti4_20 = 
         ; Integer 1
         MOV   EAX,  1
         MOV   [EBP-8],  EAX
         ; Let Ti5_19 = 
         ; Sub n_11 - Ti4_20
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP-8]
         MOV   [EBP-12],  EAX
         ; Let Ti6_15 = 
         ; Apply direct fib_10
         PUSH  dword ptr [EBP-12]
         CALL  fib_10
         ADD   ESP,  4
         MOV   [EBP-16],  EAX
         ; Let Ti7_18 = 
         ; Integer 2
         MOV   EAX,  2
         MOV   [EBP-20],  EAX
         ; Let Ti8_17 = 
         ; Sub n_11 - Ti7_18
         MOV   EAX,  [EBP+8]
         SUB   EAX,  [EBP-20]
         MOV   [EBP-24],  EAX
         ; Let Ti9_16 = 
         ; Apply direct fib_10
         PUSH  dword ptr [EBP-24]
         CALL  fib_10
         ADD   ESP,  4
         MOV   [EBP-28],  EAX
         ; Add Ti6_15 + Ti9_16
         MOV   EAX,  [EBP-16]
         ADD   EAX,  [EBP-28]
         MOV   ESP,  EBP
         POP   EBP
         RET
fib_10 endp

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

END start

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

