Function at 0x513210
Capabilities:
Enumerate pe sections
Resolve function by parsing pe exports

Disassembly:
sub esp, 0x80
mov eax, dword [0x7be9b8]
xor eax, esp
mov dword [esp + 0x7c], eax
mov ecx, dword [esp + 0x84]
xor edx, edx
push ebx
push ebp
push esi
mov eax, dword [ecx + 0x40]
xor esi, esi
push edi
xor edi, edi
mov dword [esp + 0x1c], ecx
mov ebp, 3
mov dword [esp + 0x10], edi
movzx ebx, word [eax + 0x16]
mov eax, dword [ecx + 0x10]
add ebx, 8
mov dword [esp + 0x28], ebp
mov dword [esp + 0x18], ebx
mov dword [esp + 0x40], edi
mov dword [esp + 0x24], edx
mov dword [esp + 0x4c], edx
mov dword [esp + 0x30], edx
mov dword [esp + 0x2c], esi
mov dword [esp + 0x20], 8
test eax, eax
jle 0x51327b
dec eax
mov dword [esp + 0x3c], eax
jmp 0x513295
cmp dword [ecx + 4], 0xffffffff
mov ebp, 2
mov dword [esp + 0x3c], edx
cmovne esi, dword [esp + 0x20]
mov dword [esp + 0x28], ebp
mov dword [esp + 0x2c], esi
mov eax, dword [ecx + 0xc]
sub eax, dword [esp + 0x3c]
cmp ebp, eax
jle 0x5132b3
cmp dword [ecx + 8], 0xffffffff
mov ebp, eax
mov dword [esp + 0x28], ebp
cmovne esi, dword [esp + 0x20]
mov dword [esp + 0x2c], esi
mov eax, dword [esp + 0x98]
mov ecx, eax
and ecx, 6
mov dword [esp + 0x20], eax
mov dword [esp + 0x48], ecx
jne 0x5132da
cmp ebp, 2
jl 0x5134e7
test al, 8
je 0x5134e7
xor esi, esi
test ebp, ebp
jle 0x51345b
mov ecx, dword [esp + 0x3c]
mov eax, ecx
not eax
mov dword [esp + 0x38], eax
mov eax, 1
sub eax, ecx
mov dword [esp + 0x34], eax
nop dword [eax + eax]
mov edi, dword [esp + 0x1c]
lea ebx, [esi + ecx]
test ebx, ebx
js 0x513310
cmp ebx, dword [edi + 0xc]
jl 0x513326
push 0
push 0
push str.hb_cdxPageGetKeyPage:_wrong_iKey_index.
push 0x23f1
call fcn.00448c10
add esp, 0x10
test byte [edi + 0x20], 2
je 0x513342
push 0
push 0
push str.hb_cdxPageGetKeyPage:_page_is_a_leaf.
push 0x23f1
call fcn.00448c10
add esp, 0x10
mov edx, dword [edi + 0x40]
lea eax, [ebx + 1]
movzx ecx, word [edx + 0x16]
add ecx, 8
imul ecx, eax
mov eax, dword [ecx + edi + 0x54]
mov ecx, dword [edi + 0x3c]
bswap eax
test ecx, ecx
je 0x51336c
cmp dword [ecx], eax
jne 0x51336c
mov dword [edi + 0x3c], 0
jmp 0x513379
push eax
push edi
push edx
call fcn.005147d0
add esp, 0xc
mov ecx, eax
mov dword [esp + esi*4 + 0x50], ecx
test esi, esi
jle 0x5133d2
mov edx, dword [esp + esi*4 + 0x4c]
mov edi, dword [edx + 8]
cmp dword [ecx], edi
jne 0x513393
mov eax, dword [ecx + 4]
cmp eax, dword [edx]
je 0x5133d2
push dword [ecx + 4]
mov eax, dword [esp + 0x3c]
push esi
push dword [ecx]
add eax, ebx
push esi
push edi
push eax
push dword [edx]
push eax
push str._r_nchilds__d___Page_lx__childs__d___Right_lx__childs__d___Page_lx__childs__d___Left_lx
call fcn.00419640
push 1
call fcn.004e03e0
push eax
call fcn.004ec5db
push 0
push 0
push str.hb_cdxPageKeyLeafBalance:_index_corrupted.
push 0x23f1
call fcn.00448c10
add esp, 0x3c
mov edi, dword [esp + esi*4 + 0x50]
mov eax, dword [edi + 0xc]
movzx edx, word [edi + 0x32]
mov dword [esp + esi*4 + 0x64], eax
movzx eax, byte [edi + 0x1f]
movsx ecx, dx
mov dword [esp + esi*4 + 0x78], ecx
cmp ecx, eax
jl 0x5133f6
add dword [esp + 0x40], ecx
jmp 0x513427
test dx, dx
js 0x513427
mov edx, dword [esp + 0x24]
cmp esi, edx
jne 0x51340a
inc edx
mov dword [esp + 0x24], edx
jmp 0x51342b
mov eax, dword [esp + 0x34]
add eax, ebx
cmp eax, ebp
jne 0x51342b
test byte [esp + 0x20], 2
jne 0x51342b
push 0
push edi
dec ebp
call fcn.00512230
add esp, 8
mov edx, dword [esp + 0x24]
cmp esi, edx
jl 0x51343e
cmp esi, ebp
jge 0x51343e
mov eax, dword [esp + 0x10]
add eax, dword [edi + 0xc]
mov dword [esp + 0x10], eax
mov ecx, dword [esp + 0x3c]
inc esi
cmp esi, ebp
jl 0x513300
mov edi, dword [esp + 0x10]
mov ebx, dword [esp + 0x18]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x28], ebp
test al, 2
jne 0x5134a4
lea esi, [ebp - 1]
cmp esi, edx
jle 0x5134a4
nop word [eax + eax]
mov ecx, dword [esp + esi*4 + 0x50]
movzx edx, word [ecx + 0x32]
test dx, dx
js 0x51349c
movzx eax, byte [ecx + 0x1f]
cmp dx, ax
jge 0x51349c
sub edi, dword [ecx + 0xc]
push 0
push ecx
call fcn.00512230
dec esi
add esp, 8
dec ebp
cmp esi, dword [esp + 0x24]
jg 0x513470
mov dword [esp + 0x10], edi
mov dword [esp + 0x28], ebp
cmp dword [esp + 0x48], 0
jne 0x5134ee
cmp ebp, 2
jl 0x5134c7
mov eax, dword [esp + 0x1c]
mov eax, dword [eax + 0x40]
mov eax, dword [eax + 0x7c]
movzx eax, word [eax + 0x2e]
sub eax, 0x18
cmp dword [esp + 0x40], eax
jge 0x5134ee
xor esi, esi
test ebp, ebp
jle 0x5134e3
nop dword [eax]
push 0
push dword [esp + esi*4 + 0x54]
call fcn.00512230
inc esi
add esp, 8
cmp esi, ebp
jl 0x5134d0
mov esi, dword [esp + 0x2c]
mov eax, esi
jmp 0x513d81
test edi, edi
jle 0x513617
mov eax, edi
mov dword [esp + 0x4c], edi
imul eax, ebx
push eax
call fcn.00470460
mov edx, dword [esp + 0x28]
add esp, 4
mov dword [esp + 0x30], eax
mov esi, eax
mov dword [esp + 0x20], edx
mov ebx, edx
cmp edx, ebp
jge 0x513617
test edi, edi
jle 0x513617
mov ecx, dword [esp + ebx*4 + 0x50]
mov dword [esp + 0x14], ecx
mov eax, dword [ecx + 0xc]
test eax, eax
jle 0x51360a
mov edx, dword [ecx + 0x34]
test edx, edx
je 0x513556
mov edi, dword [esp + 0x18]
imul eax, edi
push eax
push edx
push esi
call fcn.004dbc20
add esp, 0xc
jmp 0x513564
push esi
push ecx
call fcn.005140b0
mov edi, dword [esp + 0x20]
add esp, 8
cmp esi, dword [esp + 0x30]
jbe 0x5135f8
movzx eax, word [esi + edi - 2]
xor edx, edx
sub edi, eax
lea ebx, [edi - 8]
test ebx, ebx
jle 0x513591
mov ecx, esi
sub ecx, dword [esp + 0x18]
mov al, byte [edx + esi]
cmp al, byte [ecx + edx]
jne 0x513591
inc edx
cmp edx, ebx
jl 0x513584
mov eax, dword [esp + 0x18]
mov ebx, dword [esp + 0x20]
mov ecx, dword [esp + 0x24]
mov word [esi + eax - 4], dx
lea eax, [ebx - 1]
cmp ecx, eax
jne 0x5135f8
mov eax, dword [esp + ecx*4 + 0x50]
movzx ecx, word [eax + 0x32]
test cx, cx
js 0x5135f8
movzx eax, byte [eax + 0x1f]
sub edi, edx
movsx ecx, cx
sub edi, 8
sub ecx, eax
cmp edi, ecx
mov edi, dword [esp + 0x14]
jle 0x5135fc
mov eax, dword [edi + 0xc]
imul eax, dword [esp + 0x18]
push eax
push esi
mov esi, dword [esp + 0x38]
push esi
call fcn.004dbc20
mov eax, dword [esp + ebx*4 + 0x58]
add esp, 0xc
mov ecx, dword [esp + 0x10]
sub ecx, dword [eax + 0xc]
inc dword [esp + 0x24]
mov dword [esp + 0x10], ecx
jmp 0x5135fc
mov edi, dword [esp + 0x14]
mov eax, dword [edi + 0xc]
imul eax, dword [esp + 0x18]
mov edi, dword [esp + 0x10]
add esi, eax
inc ebx
mov dword [esp + 0x20], ebx
cmp ebx, ebp
jl 0x513520
mov edx, dword [esp + 0x30]
xor ecx, ecx
mov ebx, dword [esp + 0x24]
mov dword [esp + 0x14], edx
mov dword [esp + 0x40], ecx
mov dword [esp + 0x48], ebx
test edi, edi
jle 0x513b70
cmp ebx, ebp
jne 0x513976
lea eax, [ebx*4]
mov dword [esp + 0x38], eax
mov eax, dword [esp + eax + 0x4c]
mov eax, dword [eax + 8]
cmp eax, 0xffffffff
je 0x513675
push eax
mov eax, dword [esp + 0x20]
push eax
push dword [eax + 0x40]
call fcn.005147d0
mov edx, dword [esp + 0x20]
add esp, 0xc
mov ecx, dword [esp + 0x40]
mov edi, eax
mov dword [esp + 0x34], eax
jmp 0x51367b
xor edi, edi
mov dword [esp + 0x34], edi
test ecx, ecx
jne 0x513894
test edi, edi
je 0x513894
xor esi, esi
mov dword [esp + 0x20], ecx
cmp dword [esp + 0x10], ecx
jle 0x5136ed
mov edi, dword [esp + 0x10]
nop dword [eax + eax]
lea ebp, [ecx + 1]
mov eax, ebp
imul eax, dword [esp + 0x18]
add edx, eax
mov eax, dword [edx - 8]
cmp esi, eax
cmovae eax, esi
mov esi, eax
test ecx, ecx
jne 0x5136be
xor ebx, ebx
jmp 0x5136c2
movzx ebx, word [edx - 4]
movzx eax, word [edx - 2]
mov ecx, dword [esp + 0x18]
mov edx, dword [esp + 0x14]
sub ecx, eax
sub ecx, ebx
mov ebx, dword [esp + 0x20]
add ebx, 0xfffffff8
add ebx, ecx
mov ecx, ebp
mov dword [esp + 0x20], ebx
cmp ecx, edi
jl 0x5136a0
mov edi, dword [esp + 0x34]
mov ebp, dword [esp + 0x28]
push 0
push edi
call fcn.00512470
mov dword [esp + 0x3c], eax
add esp, 8
mov eax, dword [edi + 0x34]
test eax, eax
je 0x513711
mov ecx, dword [edi + 0x40]
movzx ecx, word [ecx + 0x16]
movzx ebx, word [ecx + eax + 6]
jmp 0x51372c
movzx eax, byte [edi + 0x1e]
mov ecx, 0x20
sub ecx, eax
movzx eax, byte [edi + 0x1f]
mov ebx, dword [eax + edi + 0x60]
movzx eax, word [edi + 0x1a]
shr ebx, cl
and ebx, eax
mov edx, dword [esp + 0x18]
xor ecx, ecx
sub edx, ebx
sub edx, 8
test edx, edx
jle 0x513761
mov eax, dword [esp + 0x10]
mov ebx, dword [esp + 0x14]
dec eax
imul eax, dword [esp + 0x18]
mov ebp, dword [esp + 0x34]
add ebx, eax
nop
mov al, byte [ebx + ecx]
cmp al, byte [ecx + ebp]
jne 0x51375d
inc ecx
cmp ecx, edx
jl 0x513750
mov ebp, dword [esp + 0x28]
mov ebx, dword [esp + 0x20]
mov eax, dword [edi + 0x14]
sub ebx, ecx
movzx ecx, byte [edi + 0x1f]
mov edx, ecx
cmp esi, eax
jbe 0x513781
shl eax, 8
inc edx
or eax, 0xff
cmp esi, eax
ja 0x513774
mov esi, dword [edi + 0xc]
mov eax, edx
imul edx, dword [esp + 0x10]
sub eax, ecx
movsx ecx, word [edi + 0x32]
imul eax, esi
sub ecx, eax
sub ecx, edx
sub ecx, ebx
js 0x513894
mov ebp, dword [esp + 0x10]
mov ebx, ebp
mov ecx, dword [esp + 0x18]
imul ebx, ecx
lea eax, [esi + ebp]
cmp dword [esp + 0x4c], eax
jl 0x5137cd
push ebx
push dword [esp + 0x18]
push dword [esp + 0x38]
call fcn.004dbc20
mov ecx, dword [esp + 0x3c]
add esp, 0xc
jmp 0x5137f9
mov dword [esp + 0x4c], eax
imul eax, ecx
push eax
call fcn.00470460
push ebx
push dword [esp + 0x1c]
mov esi, eax
push esi
call fcn.004dbc20
push dword [esp + 0x40]
call fcn.00470430
mov ecx, esi
add esp, 0x14
mov dword [esp + 0x30], ecx
mov eax, dword [edi + 0xc]
test eax, eax
jle 0x51385f
lea esi, [ebx + ecx]
mov ecx, dword [edi + 0x34]
test ecx, ecx
je 0x51381c
imul eax, dword [esp + 0x18]
push eax
push ecx
push esi
call fcn.004dbc20
add esp, 0xc
jmp 0x513826
push esi
push edi
call fcn.005140b0
add esp, 8
mov ecx, dword [esp + 0x18]
mov edx, ecx
movzx eax, word [esi + ecx - 2]
xor ecx, ecx
sub edx, eax
sub edx, 8
test edx, edx
jle 0x51384f
mov ebx, esi
sub ebx, dword [esp + 0x18]
mov al, byte [ecx + esi]
cmp al, byte [ebx + ecx]
jne 0x51384f
inc ecx
cmp ecx, edx
jl 0x513842
mov eax, dword [esp + 0x18]
mov word [esi + eax - 4], cx
add ebp, dword [edi + 0xc]
mov dword [esp + 0x10], ebp
mov eax, dword [esp + 0x30]
mov ecx, dword [esp + 0x1c]
mov ebx, dword [esp + 0x48]
mov dword [esp + 0x14], eax
mov eax, dword [esp + 0x38]
mov dword [esp + eax + 0x50], edi
mov eax, dword [esp + 0x3c]
mov edi, dword [esp + 0x10]
add eax, ebx
cmp eax, dword [ecx + 0xc]
jl 0x513976
or dword [esp + 0x2c], 1
jmp 0x513976
mov eax, dword [esp + 0x1c]
mov esi, dword [eax + 0x40]
mov eax, dword [esi + 0x7c]
movzx ecx, word [eax + 0x2e]
movzx eax, word [esi + 0x16]
add eax, 0x54
add eax, ecx
push eax
push 0
push eax
call fcn.00470460
add esp, 4
push eax
call fcn.004dc1a0
mov ebx, eax
push 0
mov byte [ebx + 0x20], 0xff
mov dword [ebx + 8], 0xffffffff
mov dword [ebx + 4], 0xffffffff
mov dword [ebx + 0x40], esi
push dword [esi + 0x7c]
call fcn.00510950
mov dword [ebx], eax
add esp, 0x14
mov dword [ebx + 0x24], 1
mov dword [ebx + 0x44], 0
mov eax, dword [esi + 0xa4]
mov dword [ebx + 0x48], eax
mov dword [esi + 0xa4], ebx
mov eax, dword [ebx + 0x48]
test eax, eax
je 0x51390a
mov dword [eax + 0x44], ebx
mov eax, dword [esp + 0x1c]
mov dword [ebx + 0x38], eax
mov eax, dword [esp + 0x38]
mov dword [ebx + 0x10], 0xffffffff
mov word [ebx + 0x20], 0x102
mov ecx, dword [esp + eax + 0x4c]
mov dword [esp + eax + 0x50], ebx
mov eax, dword [ecx]
mov dword [ebx + 4], eax
mov eax, dword [ecx + 8]
mov dword [ebx + 8], eax
mov eax, dword [ebx]
mov dword [ecx + 8], eax
mov dword [ecx + 0x24], 1
test edi, edi
je 0x51395c
mov eax, dword [ebx]
push 0
push edi
mov dword [edi + 4], eax
mov dword [edi + 0x24], 1
call fcn.00512230
add esp, 8
mov edi, dword [esp + 0x10]
inc ebp
or dword [esp + 0x2c], 8
mov ebx, dword [esp + 0x48]
mov dword [esp + 0x28], ebp
mov dword [esp + 0x40], 1
mov esi, dword [esp + ebx*4 + 0x50]
mov dword [esi + 0xc], 0
mov eax, dword [esi + 0x34]
test eax, eax
je 0x51399f
push eax
call fcn.00470430
mov dword [esi + 0x34], 0
add esp, 4
mov dword [esi + 0x28], 0
mov ebp, dword [esi + 0x40]
xor cl, cl
movzx edx, word [ebp + 0x16]
mov dword [esp + 0x38], edx
lea eax, [edx + 8]
mov dword [esp + 0x34], eax
mov eax, edx
test edx, edx
je 0x5139d2
nop dword [eax]
inc cl
sar eax, 1
jne 0x5139c0
cmp cl, 0xc
jbe 0x5139d2
mov ebx, 5
jmp 0x5139dd
mov al, 8
cmp al, cl
sbb ebx, ebx
neg ebx
add ebx, 3
mov al, cl
mov byte [esi + 0x1e], cl
add al, al
mov byte [esi + 0x1d], cl
mov dl, bl
mov byte [esi + 0x1f], bl
shl dl, 3
sub dl, al
mov eax, 1
shl ax, cl
mov cl, dl
dec ax
mov byte [esi + 0x1c], dl
mov edx, dword [esp + 0x14]
mov word [esi + 0x1a], ax
mov word [esi + 0x18], ax
mov eax, 1
shl eax, cl
dec eax
mov dword [esi + 0x14], eax
mov ecx, dword [ebp + 0x7c]
xor ebp, ebp
mov cx, word [ecx + 0x2e]
sub cx, 0x18
mov dword [esi + 0xc], 0
mov word [esi + 0x32], cx
mov ecx, dword [esp + 0x38]
add ecx, 4
add ecx, edx
mov dword [esp + 0x20], ecx
mov word [ecx], bp
test edi, edi
jle 0x513ad7
nop word [eax + eax]
mov edi, dword [ecx - 4]
movzx ecx, word [ecx + 2]
movzx edx, bl
sub edx, ecx
mov ecx, dword [esp + 0x20]
movzx ecx, word [ecx]
sub edx, ecx
add edx, dword [esp + 0x38]
cmp edi, eax
jbe 0x513aa2
mov cl, byte [esi + 0x1c]
shl eax, 8
inc edx
or eax, 0xff
inc bl
add cl, 8
add edx, ebp
cmp edi, eax
ja 0x513a70
movzx edi, word [esi + 0x32]
mov byte [esp + 0x47], cl
movsx ecx, di
cmp edx, ecx
jg 0x513acf
mov cl, byte [esp + 0x47]
mov dword [esi + 0x14], eax
mov byte [esi + 0x1c], cl
mov byte [esi + 0x1f], bl
jmp 0x513aad
movzx edi, word [esi + 0x32]
movsx ecx, di
cmp edx, ecx
jg 0x513acf
inc dword [esi + 0xc]
mov ecx, edi
mov edi, dword [esp + 0x10]
sub ecx, edx
mov word [esi + 0x32], cx
inc ebp
mov ecx, dword [esp + 0x20]
add ecx, dword [esp + 0x34]
mov dword [esp + 0x20], ecx
cmp ebp, edi
jl 0x513a50
jmp 0x513ad3
mov edi, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
mov ebx, dword [esp + 0x48]
mov ecx, dword [esp + 0x24]
mov ebp, dword [esp + 0x28]
cmp ebx, ecx
jne 0x513b0b
cmp ebx, ebp
jge 0x513b0b
cmp dword [esi + 0x24], 0
jne 0x513b0b
mov eax, dword [esi + 0xc]
cmp eax, dword [esp + ebx*4 + 0x64]
jne 0x513b0b
movsx eax, word [esi + 0x32]
cmp eax, dword [esp + ebx*4 + 0x78]
jne 0x513b0b
inc ecx
mov dword [esp + 0x24], ecx
jmp 0x513b18
push dword [esi + 0xc]
push edx
push esi
call fcn.00514410
add esp, 0xc
mov eax, dword [esi + 0xc]
mov edx, dword [esp + 0x18]
sub edi, dword [esi + 0xc]
imul eax, edx
mov dword [esp + 0x10], edi
add dword [esp + 0x14], eax
cmp ebx, ebp
jge 0x513b56
push dword [esi]
mov eax, dword [esp + 0x18]
push dword [eax - 8]
sub eax, edx
push eax
push dword [esp + 0x4c]
mov eax, dword [esp + 0x4c]
add eax, ebx
push eax
push dword [esp + 0x30]
call fcn.005126f0
add esp, 0x18
jmp 0x513b5b
inc ebp
mov dword [esp + 0x28], ebp
mov edx, dword [esp + 0x14]
inc ebx
mov ecx, dword [esp + 0x40]
mov dword [esp + 0x48], ebx
test edi, edi
jg 0x513635
cmp ebx, ebp
jge 0x513d31
mov edi, dword [esp + ebp*4 + 0x4c]
mov eax, dword [esp + 0x50]
mov esi, dword [edi + 8]
cmp esi, 0xffffffff
je 0x513c59
cmp ebx, 1
jg 0x513ba1
jne 0x513c59
cmp dword [eax + 4], 0xffffffff
jne 0x513c59
mov esi, dword [esp + ebx*4 + 0x4c]
mov ecx, dword [edi]
mov edx, dword [esp + 0x1c]
add ebx, dword [esp + 0x3c]
mov eax, dword [esi]
mov dword [edi], eax
mov dword [esi], ecx
mov eax, dword [edx + 0x40]
mov dword [esp + 0x38], ecx
lea ecx, [ebx - 1]
movzx eax, word [eax + 0x16]
mov dword [esp + 0x34], eax
add eax, 8
imul ecx, eax
test byte [edx + 0x20], 2
mov dword [esp + 0x4c], ecx
je 0x513bf1
push 0
push 0
push str.hb_cdxPageIntSetKey:_page_is_a_leaf_
push 0x23f1
call fcn.00448c10
mov edx, dword [esp + 0x2c]
add esp, 0x10
test ebx, ebx
jle 0x513bfa
cmp ebx, dword [edx + 0xc]
jle 0x513c10
push 0
push 0
push str.hb_cdxPageIntSetKey:_wrong_iKey_index.
push 0x23f1
call fcn.00448c10
add esp, 0x10
mov eax, dword [esp + 0x34]
add eax, dword [esp + 0x1c]
mov ebx, dword [esp + 0x4c]
mov edx, dword [esp + 0x38]
mov ecx, edx
bswap ecx
mov dword [eax + ebx + 0x5c], ecx
mov eax, dword [esp + 0x1c]
mov ebx, dword [esp + 0x48]
mov dword [eax + 0x24], 1
mov eax, dword [edi + 8]
mov dword [esi + 8], eax
mov dword [esi + 0x24], 1
cmp ebx, 1
jle 0x513cc2
mov eax, dword [esp + ebx*4 + 0x48]
mov dword [eax + 8], edx
mov dword [eax + 0x24], 1
jmp 0x513cc2
test ebx, ebx
jle 0x513c6f
mov eax, dword [esp + ebx*4 + 0x4c]
mov edi, dword [eax]
mov dword [eax + 8], esi
mov dword [eax + 0x24], 1
jmp 0x513c9a
mov edi, dword [eax + 4]
cmp edi, 0xffffffff
je 0x513c9a
mov eax, dword [esp + 0x1c]
push edi
push eax
push dword [eax + 0x40]
call fcn.005147d0
push 0
push eax
mov dword [eax + 8], esi
mov dword [eax + 0x24], 1
call fcn.00512230
add esp, 0x14
cmp esi, 0xffffffff
je 0x513cc2
mov eax, dword [esp + 0x1c]
push esi
push eax
push dword [eax + 0x40]
call fcn.005147d0
push 0
push eax
mov dword [eax + 4], edi
mov dword [eax + 0x24], 1
call fcn.00512230
add esp, 0x14
cmp ebp, ebx
jle 0x513d28
mov esi, dword [esp + ebp*4 + 0x4c]
dec ebp
mov eax, dword [esi + 0x34]
test eax, eax
je 0x513ce9
push eax
call fcn.00470430
mov dword [esi + 0x34], 0
add esp, 4
mov dword [esi + 0x28], 0
mov eax, dword [esp + 0x3c]
add eax, ebp
push eax
push dword [esp + 0x20]
call fcn.00512650
mov dword [esi + 0x38], 0
mov dword [esi + 0x24], 0
mov byte [esi + 0x20], 0xff
push 0
mov dword [esi + 4], 0xffffffff
push esi
mov dword [esi + 8], 0xffffffff
call fcn.00512230
add esp, 0x10
cmp ebp, ebx
jg 0x513cc6
mov edi, dword [esp + 0x2c]
or edi, 8
jmp 0x513d35
mov edi, dword [esp + 0x2c]
xor esi, esi
test ebp, ebp
jle 0x513d53
nop dword [eax + eax]
push 0
push dword [esp + esi*4 + 0x54]
call fcn.00512230
inc esi
add esp, 8
cmp esi, ebp
jl 0x513d40
mov eax, dword [esp + 0x30]
test eax, eax
je 0x513d64
push eax
call fcn.00470430
add esp, 4
mov edx, dword [esp + 0x1c]
mov eax, dword [edx + 0x40]
mov dword [edx + 0x24], 1
movzx ecx, word [eax + 0x78]
mov eax, edi
or eax, 2
cmp dword [edx + 0xc], ecx
cmovle eax, edi
mov ecx, dword [esp + 0x8c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004daa4c
add esp, 0x80
ret