Disassembly: 
  L1: 8b ff ?? mov edi, edi
   55 ?? push ebp
   8b ec ?? mov ebp, esp
   83 ec 0c ?? sub esp, 12
   53 ?? push ebx
   56 ?? push esi
   57 ?? push edi
   33 ff ?? xor edi, edi
   39 7d 0c ?? cmp dword ss:[ebp + 12], edi
   74 24 ?? je basic block L7
  
  L2: 39 7d 10 ?? cmp dword ss:[ebp + 0x10<16>], edi
   74 1f ?? je basic block L7
  
  L3: 8b 75 14 ?? mov esi, dword ss:[ebp + 0x14<20>]
   3b f7 ?? cmp esi, edi
   75 1f ?? jne basic block L9
  
  L4: e8 7e 54 00 00 ?? call function 0x0040c7ec
  
  L5: 57 ?? push edi
   57 ?? push edi
   57 ?? push edi
   57 ?? push edi
   57 ?? push edi
   c7 00 16 00 00 00 ?? mov dword ds:[eax], 0x00000016<22>
   e8 62 f5 ff ff ?? call function 0x004068e0
  
  L6: 83 c4 14 ?? add esp, 0x14<20>
  
  L7: 33 c0 ?? xor eax, eax
  
  L8: 5f ?? pop edi
   5e ?? pop esi
   5b ?? pop ebx
   c9 ?? leave
   c3 ?? ret
  
  L9: 8b 4d 08 ?? mov ecx, dword ss:[ebp + 8]
   3b cf ?? cmp ecx, edi
   74 da ?? je basic block L4
  
  L10: 83 c8 ff ?? or eax, 0xff<255,-1>
   33 d2 ?? xor edx, edx
   f7 75 0c ?? div dword ss:[ebp + 12]
   39 45 10 ?? cmp dword ss:[ebp + 0x10<16>], eax
   77 cd ?? ja basic block L4
  
  L11: 8b 7d 0c ?? mov edi, dword ss:[ebp + 12]
   0f af 7d 10 ?? imul edi, dword ss:[ebp + 0x10<16>]
   f7 46 0c 0c 01 00 00 ?? test dword ds:[esi + 12], 0x0000010c<268>
   89 4d fc ?? mov dword ss:[ebp + 0xfc<252,-4>], ecx
   89 7d f4 ?? mov dword ss:[ebp + 0xf4<244,-12>], edi
   8b df ?? mov ebx, edi
   74 08 ?? je basic block L13
  
  L12: 8b 46 18 ?? mov eax, dword ds:[esi + 0x18<24>]
   89 45 f8 ?? mov dword ss:[ebp + 0xf8<248,-8>], eax
   eb 07 ?? jmp basic block L14
  
  L13: c7 45 f8 00 10 00 00 ?? mov dword ss:[ebp + 0xf8<248,-8>], 0x00001000<4096>
  
  L14: 85 ff ?? test edi, edi
   0f 84 bf 00 00 00 ?? je basic block L40
  
  L15: 8b 4e 0c ?? mov ecx, dword ds:[esi + 12]
   81 e1 08 01 00 00 ?? and ecx, 0x00000108<264>
   74 2f ?? je basic block L22
  
  L16: 8b 46 04 ?? mov eax, dword ds:[esi + 4]
   85 c0 ?? test eax, eax
   74 28 ?? je basic block L22
  
  L17: 0f 8c af 00 00 00 ?? jl basic block L41
  
  L18: 8b fb ?? mov edi, ebx
   3b d8 ?? cmp ebx, eax
   72 02 ?? jb basic block L20
  
  L19: 8b f8 ?? mov edi, eax
  
  L20: 57 ?? push edi
   ff 75 fc ?? push dword ss:[ebp + 0xfc<252,-4>]
   ff 36 ?? push dword ds:[esi]
   e8 6a 28 00 00 ?? call function 0x00409c60
  
  L21: 29 7e 04 ?? sub dword ds:[esi + 4], edi
   01 3e ?? add dword ds:[esi], edi
   83 c4 0c ?? add esp, 12
   2b df ?? sub ebx, edi
   01 7d fc ?? add dword ss:[ebp + 0xfc<252,-4>], edi
   eb 4f ?? jmp basic block L34
  
  L22: 3b 5d f8 ?? cmp ebx, dword ss:[ebp + 0xf8<248,-8>]
   72 4f ?? jb basic block L35
  
  L23: 85 c9 ?? test ecx, ecx
   74 0b ?? je basic block L26
  
  L24: 56 ?? push esi
   e8 53 fc ff ff ?? call function 0x00407067
  
  L25: 59 ?? pop ecx
   85 c0 ?? test eax, eax
   75 7d ?? jne basic block L42
  
  L26: 83 7d f8 00 ?? cmp dword ss:[ebp + 0xf8<248,-8>], 0
   8b fb ?? mov edi, ebx
   74 09 ?? je basic block L28
  
  L27: 33 d2 ?? xor edx, edx
   8b c3 ?? mov eax, ebx
   f7 75 f8 ?? div dword ss:[ebp + 0xf8<248,-8>]
   2b fa ?? sub edi, edx
  
  L28: 57 ?? push edi
   ff 75 fc ?? push dword ss:[ebp + 0xfc<252,-4>]
   56 ?? push esi
   e8 4c 7d 00 00 ?? call function 0x0040f180
  
  L29: 59 ?? pop ecx
   50 ?? push eax
   e8 57 86 00 00 ?? call function 0x0040fa92
  
  L30: 83 c4 0c ?? add esp, 12
   83 f8 ff ?? cmp eax, 0xff<255,-1>
   74 61 ?? je basic block L44
  
  L31: 8b cf ?? mov ecx, edi
   3b c7 ?? cmp eax, edi
   77 02 ?? ja basic block L33
  
  L32: 8b c8 ?? mov ecx, eax
  
  L33: 01 4d fc ?? add dword ss:[ebp + 0xfc<252,-4>], ecx
   2b d9 ?? sub ebx, ecx
   3b c7 ?? cmp eax, edi
   72 50 ?? jb basic block L44
  
  L34: 8b 7d f4 ?? mov edi, dword ss:[ebp + 0xf4<244,-12>]
   eb 29 ?? jmp basic block L39
  
  L35: 8b 45 fc ?? mov eax, dword ss:[ebp + 0xfc<252,-4>]
   0f be 00 ?? movsx eax, byte ds:[eax]
   56 ?? push esi
   50 ?? push eax
   e8 4c 7d 00 00 ?? call function 0x0040f1b2
  
  L36: 59 ?? pop ecx
   59 ?? pop ecx
   83 f8 ff ?? cmp eax, 0xff<255,-1>
   74 29 ?? je basic block L42
  
  L37: ff 45 fc ?? inc dword ss:[ebp + 0xfc<252,-4>]
   8b 46 18 ?? mov eax, dword ds:[esi + 0x18<24>]
   4b ?? dec ebx
   89 45 f8 ?? mov dword ss:[ebp + 0xf8<248,-8>], eax
   85 c0 ?? test eax, eax
   7f 07 ?? jg basic block L39
  
  L38: c7 45 f8 01 00 00 00 ?? mov dword ss:[ebp + 0xf8<248,-8>], 1
  
  L39: 85 db ?? test ebx, ebx
   0f 85 41 ff ff ff ?? jne basic block L15
  
  L40: 8b 45 10 ?? mov eax, dword ss:[ebp + 0x10<16>]
   e9 f1 fe ff ff ?? jmp basic block L8
  
  L41: 83 4e 0c 20 ?? or dword ds:[esi + 12], 0x20<32>
  
  L42: 8b c7 ?? mov eax, edi
  
  L43: 2b c3 ?? sub eax, ebx
   33 d2 ?? xor edx, edx
   f7 75 0c ?? div dword ss:[ebp + 12]
   e9 df fe ff ff ?? jmp basic block L8
  
  L44: 83 4e 0c 20 ?? or dword ds:[esi + 12], 0x20<32>
   8b 45 f4 ?? mov eax, dword ss:[ebp + 0xf4<244,-12>]
   eb eb ?? jmp basic block L43
  
  