Function at 0x401060
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x40348a
mov eax, dword fs:[0]
push eax
sub esp, 0xb8
push ebx
push esi
push edi
mov eax, dword [0x406018]
xor eax, esp
push eax
lea eax, [esp + 0xc8]
mov dword fs:[0], eax
mov esi, dword [ebp + 0xc]
mov eax, dword [esi + 8]
push eax
lea ecx, [esp + 0x20]
push ecx
call fcn.004012f0
mov dword [esp + 0xd0], 0
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 4]
test byte [esp + eax + 0x28], 6
je 0x4010e8
mov ecx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
mov edx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char___std::cerr]
push ecx
push ecx
push str.open_error_
push edx
call fcn.00402490
add esp, 0xc
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
push 1
call dword [sym.imp.MSVCR100.dll_exit]
mov eax, dword [esi + 4]
push eax
call dword [sym.imp.MSVCR100.dll_atoi]
add esp, 4
mov dword [esp + 0x18], eax
mov dword [esp + 0x14], 4
cmp eax, 4
jl 0x4011d7
mov edi, dword [esp + 0x14]
mov esi, 2
add edi, 0xfffffffe
jmp 0x401120
mov ecx, 2
mov byte [esp + 0x13], 1
cmp esi, ecx
jle 0x401145
mov edi, edi
mov eax, esi
cdq
idiv ecx
test edx, edx
je 0x401140
inc ecx
cmp ecx, esi
jl 0x401130
jmp 0x401145
mov byte [esp + 0x13], 0
mov ecx, 2
mov bl, 1
cmp edi, ecx
jle 0x401162
mov eax, edi
cdq
idiv ecx
test edx, edx
je 0x401160
inc ecx
cmp ecx, edi
jl 0x401150
jmp 0x401162
xor bl, bl
cmp byte [esp + 0x13], 0
je 0x40116e
cmp bl, 1
je 0x401172
inc esi
dec edi
jmp 0x401120
mov ecx, dword [esp + 0x14]
mov edx, dword [sym.imp.MSVCP100.dll_class_std::basic_ostream_char__struct_std::char_traits_char______cdecl_std::endl_class_std::basic_ostream_char__struct_std::char_traits_char____]
push edx
mov eax, ecx
sub eax, esi
push eax
push 0x404208
push esi
push 0x40420c
push ecx
lea ecx, [esp + 0x34]
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
push eax
call fcn.00402490
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
push eax
call fcn.00402490
add esp, 8
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___int_]
mov ecx, eax
call dword [sym.imp.MSVCP100.dll_public:_class_std::basic_ostream_char__struct_std::char_traits_char______thiscall_std::basic_ostream_char__struct_std::char_traits_char__::operator___class_std::basic_ostream_char__struct_std::char_traits_char_______cdecl___class_std::basic_ostream_char__struct_std::char_traits_char_____]
mov eax, dword [esp + 0x14]
add eax, 2
mov dword [esp + 0x14], eax
cmp eax, dword [esp + 0x18]
jle 0x40110a
mov ecx, dword [esp + 0x1c]
mov edx, dword [ecx + 4]
lea eax, [esp + 0x7c]
mov dword [esp + 0x18], eax
mov dword [esp + edx + 0x1c], vtable.std::basic_ofstream_char__struct_std::char_traits_char__.0
lea ecx, [esp + 0x20]
mov dword [esp + 0xd0], 1
call fcn.004013e0
mov dword [esp + 0xd0], 0xffffffff
mov eax, dword [esp + 0x1c]
mov ecx, dword [eax + 4]
mov edx, dword [sym.imp.MSVCP100.dll_const_std::basic_ostream_char__struct_std::char_traits_char__::vftable]
mov dword [esp + ecx + 0x1c], edx
lea ecx, [esp + 0x7c]
call dword [sym.imp.MSVCP100.dll_public_virtual:_void___thiscall_std::basic_ios_char__struct_std::char_traits_char__::destructor_void_]
xor eax, eax
mov ecx, dword [esp + 0xc8]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret