Function at 0x512770
Capabilities:
Access peb ldr_data
Resolve function by parsing pe exports

Disassembly:
push 0xffffffffffffffff
push 0x53bb70
mov eax, dword fs:[0]
push eax
sub esp, 0xd0
mov eax, dword [0x598c90]
xor eax, esp
mov dword [esp + 0xcc], eax
push ebx
push ebp
push esi
push edi
mov eax, dword [0x598c90]
xor eax, esp
push eax
lea eax, [esp + 0xe4]
mov dword fs:[0], eax
mov ebx, dword [esp + 0xf4]
push 0x20
push 0xe
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x30], ebx
call fcn.00509530
mov edi, dword [ebx + 0x10]
mov esi, eax
cmp dword [ebx + 0xc], edi
jbe 0x5127d2
call fcn.0051e9d3
mov eax, dword [ebx + 0xc]
mov ebp, dword [ebx]
mov dword [esp + 0x18], eax
cmp eax, dword [ebx + 0x10]
jbe 0x5127e5
call fcn.0051e9d3
mov eax, dword [ebx]
test ebp, ebp
je 0x5127ef
cmp ebp, eax
je 0x5127f4
call fcn.0051e9d3
sub edi, dword [esp + 0x18]
sar edi, 2
mov dword [esi + 8], edi
mov edi, dword [ebx + 0x28]
cmp dword [ebx + 0x24], edi
jbe 0x51280b
call fcn.0051e9d3
mov eax, dword [ebx + 0x24]
mov ebp, dword [ebx + 0x18]
mov dword [esp + 0x18], eax
cmp eax, dword [ebx + 0x28]
jbe 0x51281f
call fcn.0051e9d3
mov eax, dword [ebx + 0x18]
test ebp, ebp
je 0x51282a
cmp ebp, eax
je 0x51282f
call fcn.0051e9d3
sub edi, dword [esp + 0x18]
sar edi, 2
shr edi, 1
mov dword [esi + 0xc], edi
mov edi, dword [ebx + 0x50]
cmp dword [ebx + 0x4c], edi
jbe 0x512848
call fcn.0051e9d3
mov ecx, ebx
mov ebp, dword [ecx + 0x4c]
mov ebx, dword [ecx + 0x40]
cmp ebp, dword [ecx + 0x50]
jbe 0x51285e
call fcn.0051e9d3
mov ecx, dword [esp + 0x28]
mov eax, dword [ecx + 0x40]
test ebx, ebx
je 0x512869
cmp ebx, eax
je 0x512872
call fcn.0051e9d3
mov ecx, dword [esp + 0x28]
mov edx, dword [esp + 0x14]
sub edi, ebp
sar edi, 2
mov dword [esi + 0x10], edi
mov eax, dword [ecx + 0x34]
mov dword [esi + 0x14], eax
mov ecx, dword [ecx + 0x38]
mov dword [esi + 0x18], ecx
mov edx, dword [edx]
test dword [edx + 0x24], 0x100000
je 0x5128d5
mov edi, dword [esp + 0x14]
mov edx, dword [edi + 0x34]
mov ebx, eax
and ebx, edx
cmp ebx, edx
je 0x5128af
mov edx, dword [edi + 0x38]
mov ebx, eax
and ebx, edx
cmp ebx, edx
jne 0x5128b7
mov edx, dword [edi + 0x3c]
or edx, eax
mov dword [esi + 0x14], edx
mov eax, dword [edi + 0x34]
mov edx, ecx
and edx, eax
cmp edx, eax
je 0x5128cd
mov eax, dword [edi + 0x38]
mov edx, ecx
and edx, eax
cmp edx, eax
jne 0x5128d5
mov eax, dword [edi + 0x3c]
or eax, ecx
mov dword [esi + 0x18], eax
mov edi, dword [esp + 0x28]
mov al, byte [edi + 0x30]
mov edx, dword [esp + 0x14]
mov byte [esi + 0x1c], al
cmp byte [edi + 0x31], 0
sete cl
mov byte [esi + 0x1d], cl
mov eax, dword [edx]
sub esi, dword [eax + 0x148]
mov dword [esp + 0x40], esi
mov esi, dword [edi + 0xc]
cmp esi, dword [edi + 0x10]
jbe 0x512906
call fcn.0051e9d3
mov ebx, dword [edi]
mov ebp, esi
mov esi, dword [edi + 0x10]
mov dword [esp + 0x2c], esi
cmp dword [edi + 0xc], esi
jbe 0x51291b
call fcn.0051e9d3
mov ecx, dword [edi]
mov dword [esp + 0x20], ecx
test ebx, ebx
je 0x51292b
cmp ebx, dword [esp + 0x20]
je 0x512930
call fcn.0051e9d3
cmp ebp, esi
je 0x512a7e
test ebx, ebx
jne 0x5129cd
call fcn.0051e9d3
xor eax, eax
cmp ebp, dword [eax + 0x10]
jb 0x512951
call fcn.0051e9d3
mov eax, dword [esp + 0x14]
mov esi, dword [eax]
mov eax, dword [esi + 0x14c]
mov ecx, dword [esi + 0x144]
xor edx, edx
cmp word [ebp + 2], dx
setne dl
add esi, 0x144
sub ecx, eax
add edx, 2
add edx, edx
mov edi, edx
cmp ecx, edi
jae 0x51298b
sub edx, dword [esi + 4]
mov ecx, esi
add edx, eax
call fcn.0051cc20
mov eax, dword [esi + 8]
add edi, eax
mov dword [esp + 0x18], eax
mov dword [esi + 8], edi
test ebx, ebx
jne 0x5129d4
call fcn.0051e9d3
xor eax, eax
cmp ebp, dword [eax + 0x10]
jb 0x5129ac
call fcn.0051e9d3
mov edx, dword [esp + 0x14]
cmp byte [edx + 0xc], 0
movzx ecx, word [ebp]
mov esi, edx
je 0x5129d8
mov eax, dword [esi + 4]
mov eax, dword [eax]
mov edx, dword [eax]
call fcn.0051d920
movzx eax, ax
jmp 0x5129db
mov eax, dword [ebx]
jmp 0x512947
mov eax, dword [ebx]
jmp 0x5129a2
movzx eax, cx
mov edi, dword [esp + 0x18]
mov word [edi], ax
test ebx, ebx
jne 0x512a38
call fcn.0051e9d3
xor eax, eax
cmp ebp, dword [eax + 0x10]
jb 0x5129f7
call fcn.0051e9d3
cmp word [ebp + 2], 0
je 0x512a4f
test ebx, ebx
jne 0x512a3c
call fcn.0051e9d3
xor eax, eax
cmp ebp, dword [eax + 0x10]
jb 0x512a13
call fcn.0051e9d3
cmp byte [esi + 0xc], 0
movzx ecx, word [ebp + 2]
je 0x512a40
mov edx, dword [esi + 4]
mov eax, dword [edx]
mov edx, dword [eax]
call fcn.0051d920
movzx eax, ax
mov word [edi + 2], ax
xor eax, eax
mov word [edi + 4], ax
jmp 0x512a55
mov eax, dword [ebx]
jmp 0x5129ed
mov eax, dword [ebx]
jmp 0x512a09
movzx eax, cx
mov word [edi + 2], ax
xor eax, eax
mov word [edi + 4], ax
jmp 0x512a55
xor ecx, ecx
mov word [edi + 2], cx
test ebx, ebx
jne 0x512a7a
call fcn.0051e9d3
xor eax, eax
cmp ebp, dword [eax + 0x10]
jb 0x512a6a
call fcn.0051e9d3
mov esi, dword [esp + 0x2c]
mov edi, dword [esp + 0x28]
add ebp, 4
jmp 0x512921
mov eax, dword [ebx]
jmp 0x512a60
mov esi, dword [edi + 0x24]
cmp esi, dword [edi + 0x28]
jbe 0x512a8b
call fcn.0051e9d3
mov eax, dword [edi + 0x28]
mov edx, dword [edi + 0x18]
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], esi
mov dword [esp + 0x2c], eax
cmp dword [edi + 0x24], eax
jbe 0x512aa7
call fcn.0051e9d3
mov eax, dword [edi + 0x18]
mov dword [esp + 0x38], eax
mov edi, edi
mov esi, dword [esp + 0x20]
test esi, esi
je 0x512abe
cmp esi, dword [esp + 0x38]
je 0x512ac3
call fcn.0051e9d3
mov edi, dword [esp + 0x24]
cmp edi, dword [esp + 0x2c]
je 0x5133cd
test esi, esi
jne 0x512e53
call fcn.0051e9d3
xor eax, eax
cmp edi, dword [eax + 0x10]
jb 0x512aea
call fcn.0051e9d3
mov edi, dword [esp + 0x14]
mov esi, dword [esp + 0x24]
mov al, byte [edi + 0xc]
mov bx, word [esi]
mov bp, word [esi + 2]
mov ecx, dword [edi + 4]
mov word [esp + 0x30], bx
mov word [esp + 0x32], bp
test al, al
je 0x512b22
mov ecx, dword [ecx]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x30]
call fcn.0051d920
mov bx, ax
mov word [esp + 0x30], bx
mov al, byte [edi + 0xc]
mov ecx, dword [edi + 4]
test al, al
je 0x512b41
mov ecx, dword [ecx]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x32]
call fcn.0051d920
mov bp, ax
mov word [esp + 0x32], bp
mov ecx, dword [esp + 0x20]
test ecx, ecx
jne 0x512e5a
call fcn.0051e9d3
mov ecx, dword [esp + 0x20]
xor eax, eax
cmp esi, dword [eax + 0x10]
jb 0x512b66
call fcn.0051e9d3
mov ecx, dword [esp + 0x20]
add esi, 4
mov dword [esp + 0x24], esi
test ecx, ecx
jne 0x512e61
call fcn.0051e9d3
xor eax, eax
cmp esi, dword [eax + 0x10]
jb 0x512b86
call fcn.0051e9d3
mov eax, dword [esp + 0x24]
mov cx, word [eax + 2]
mov si, word [eax]
mov al, byte [edi + 0xc]
mov word [esp + 0x1a], cx
mov ecx, dword [edi + 4]
mov word [esp + 0x18], si
test al, al
je 0x512bba
mov ecx, dword [ecx]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x18]
call fcn.0051d920
mov si, ax
mov word [esp + 0x18], si
mov al, byte [edi + 0xc]
mov ecx, dword [edi + 4]
test al, al
je 0x512bd6
mov ecx, dword [ecx]
mov edx, dword [ecx]
mov ecx, dword [esp + 0x1a]
call fcn.0051d920
mov word [esp + 0x1a], ax
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x512e68
call fcn.0051e9d3
xor eax, eax
mov edx, dword [esp + 0x24]
cmp edx, dword [eax + 0x10]
jb 0x512bf7
call fcn.0051e9d3
add dword [esp + 0x24], 4
mov eax, 7
xor ecx, ecx
xor edx, edx
mov dword [esp + 0xcc], eax
mov dword [esp + 0xc8], ecx
mov word [esp + 0xb8], dx
mov dword [esp + 0x94], eax
xor eax, eax
mov dword [esp + 0xec], ecx
mov dword [esp + 0x90], ecx
mov word [esp + 0x80], ax
mov edx, dword [edi]
test dword [edx + 0x24], 0x200000
mov byte [esp + 0xec], 1
je 0x512e6f
mov dx, word [esp + 0x1a]
mov word [esp + 0xd4], ax
mov word [esp + 0xdc], ax
mov word [esp + 0xd0], bx
mov word [esp + 0xd2], bp
mov word [esp + 0xd8], si
mov word [esp + 0xda], dx
lea eax, [esp + 0xd4]
cmp bp, cx
jne 0x512c99
lea eax, [esp + 0xd2]
push eax
lea ecx, [esp + 0xd4]
push ecx
mov ecx, dword [edi + 4]
lea edx, [esp + 0xa0]
push edx
call fcn.0050a0b0
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0xc0]
mov byte [esp + 0xf8], 2
call fcn.00402570
mov ebx, 8
mov byte [esp + 0xec], 1
cmp dword [esp + 0xb0], ebx
jb 0x512cf1
mov eax, dword [esp + 0x9c]
push eax
call fcn.0051e446
add esp, 4
cmp word [esp + 0xda], 0
lea eax, [esp + 0xdc]
jne 0x512d0a
lea eax, [esp + 0xda]
push eax
lea ecx, [esp + 0xdc]
push ecx
mov ecx, dword [edi + 4]
lea edx, [esp + 0xa0]
push edx
call fcn.0050a0b0
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0x88]
mov byte [esp + 0xf8], 3
call fcn.00402570
mov byte [esp + 0xec], 1
cmp dword [esp + 0xb0], ebx
jb 0x512d5d
mov eax, dword [esp + 0x9c]
push eax
call fcn.0051e446
add esp, 4
cmp dword [esp + 0xc8], 0
jne 0x512dd1
xor ecx, ecx
xor edx, edx
mov dword [esp + 0xb0], 7
mov word [esp + 0x9c], cx
mov dword [esp + 0xac], 1
mov word [esp + 0x9e], dx
push 0xffffffffffffffff
push edx
lea eax, [esp + 0xa0]
push eax
lea ecx, [esp + 0xc0]
mov byte [esp + 0xf8], 4
call fcn.00402570
mov byte [esp + 0xec], 1
cmp dword [esp + 0xb0], ebx
jb 0x512dd1
mov ecx, dword [esp + 0x9c]
push ecx
call fcn.0051e446
add esp, 4
mov esi, dword [esp + 0x90]
test esi, esi
jne 0x5130dd
xor edx, edx
xor eax, eax
mov dword [esp + 0xb0], 7
mov word [esp + 0x9c], dx
mov dword [esp + 0xac], 1
mov word [esp + 0x9e], ax
push 0xffffffffffffffff
push eax
lea ecx, [esp + 0xa0]
push ecx
lea ecx, [esp + 0x88]
mov byte [esp + 0xf8], 5
call fcn.00402570
mov byte [esp + 0xec], 1
cmp dword [esp + 0xb0], ebx
jb 0x5130d6
mov edx, dword [esp + 0x9c]
push edx
call fcn.0051e446
add esp, 4
jmp 0x5130d6
mov eax, dword [esi]
jmp 0x512ae0
mov eax, dword [ecx]
jmp 0x512b58
mov eax, dword [ecx]
jmp 0x512b7c
mov eax, dword [eax]
jmp 0x512be9
cmp bp, cx
je 0x512f15
mov edx, dword [esp + 0x30]
push edx
lea ecx, [esp + 0xbc]
push ecx
lea eax, [esp + 0xbc]
push eax
lea eax, [esp + 0x70]
push eax
lea ecx, [esp + 0xc4]
call fcn.0050b850
mov ecx, dword [esp + 0xcc]
mov edi, dword [esp + 0xb8]
mov eax, edi
cmp ecx, 8
jae 0x512eba
lea eax, [esp + 0xb8]
mov edx, dword [esp + 0xc8]
lea esi, [eax + edx*2]
test esi, esi
je 0x512eef
mov eax, edi
cmp ecx, 8
jae 0x512ed6
lea eax, [esp + 0xb8]
cmp eax, esi
ja 0x512eef
mov eax, edi
cmp ecx, 8
jae 0x512ee8
lea eax, [esp + 0xb8]
lea ecx, [eax + edx*2]
cmp esi, ecx
jbe 0x512ef4
call fcn.0051e9d3
mov edx, dword [esp + 0x32]
push edx
push esi
lea eax, [esp + 0xbc]
push eax
lea eax, [esp + 0x60]
push eax
lea ecx, [esp + 0xc4]
call fcn.0050b850
jmp 0x512f7e
xor ecx, ecx
mov dword [esp + 0xb0], 7
mov word [esp + 0x9c], bx
mov dword [esp + 0xac], 1
mov word [esp + 0x9e], cx
push 0xffffffffffffffff
push ecx
lea edx, [esp + 0xa0]
push edx
lea ecx, [esp + 0xc0]
mov byte [esp + 0xf8], 6
call fcn.00402570
cmp dword [esp + 0xb0], 8
mov byte [esp + 0xec], 1
jb 0x512f7e
mov eax, dword [esp + 0x9c]
push eax
call fcn.0051e446
add esp, 4
cmp word [esp + 0x1a], 0
mov edi, dword [esp + 0x80]
mov edx, dword [esp + 0x94]
mov eax, edi
je 0x513069
cmp edx, 8
jae 0x512fa6
lea eax, [esp + 0x80]
mov ecx, dword [esp + 0x90]
lea esi, [eax + ecx*2]
test esi, esi
je 0x512fdb
mov eax, edi
cmp edx, 8
jae 0x512fc2
lea eax, [esp + 0x80]
cmp eax, esi
ja 0x512fdb
mov eax, edi
cmp edx, 8
jae 0x512fd4
lea eax, [esp + 0x80]
lea ecx, [eax + ecx*2]
cmp esi, ecx
jbe 0x512fe0
call fcn.0051e9d3
mov edx, dword [esp + 0x18]
push edx
push esi
lea eax, [esp + 0x84]
push eax
lea eax, [esp + 0x78]
push eax
lea ecx, [esp + 0x8c]
call fcn.0050b850
mov ecx, dword [esp + 0x94]
mov edi, dword [esp + 0x80]
mov eax, edi
cmp ecx, 8
jae 0x51301b
lea eax, [esp + 0x80]
mov edx, dword [esp + 0x90]
lea esi, [eax + edx*2]
test esi, esi
je 0x513050
mov eax, edi
cmp ecx, 8
jae 0x513037
lea eax, [esp + 0x80]
cmp eax, esi
ja 0x513050
mov eax, edi
cmp ecx, 8
jae 0x513049
lea eax, [esp + 0x80]
lea ecx, [eax + edx*2]
cmp esi, ecx
jbe 0x513055
call fcn.0051e9d3
mov edx, dword [esp + 0x1a]
push edx
lea eax, [esp + 0x80]
push esi
push eax
lea eax, [esp + 0x68]
jmp 0x5130c4
cmp edx, 8
jae 0x513075
lea eax, [esp + 0x80]
mov ecx, dword [esp + 0x90]
lea esi, [eax + ecx*2]
test esi, esi
je 0x5130aa
mov eax, edi
cmp edx, 8
jae 0x513091
lea eax, [esp + 0x80]
cmp eax, esi
ja 0x5130aa
mov eax, edi
cmp edx, 8
jae 0x5130a3
lea eax, [esp + 0x80]
lea ecx, [eax + ecx*2]
cmp esi, ecx
jbe 0x5130af
call fcn.0051e9d3
mov edx, dword [esp + 0x18]
push edx
lea eax, [esp + 0x80]
push esi
push eax
lea eax, [esp + 0x80]
push eax
lea ecx, [esp + 0x8c]
call fcn.0050b850
mov ebx, 8
mov esi, dword [esp + 0x90]
mov eax, dword [esp + 0xb8]
cmp dword [esp + 0xcc], ebx
jae 0x5130f4
lea eax, [esp + 0xb8]
mov edx, dword [esp + 0xc8]
cmp esi, edx
jae 0x513101
mov edx, esi
mov edi, dword [esp + 0x94]
mov ebp, dword [esp + 0x80]
mov ecx, ebp
cmp edi, ebx
jae 0x51311c
lea ecx, [esp + 0x80]
test edx, edx
jbe 0x51313c
mov bx, word [ecx]
cmp bx, word [eax]
jne 0x513356
add ecx, 2
add eax, 2
sub edx, 1
jne 0x513120
mov ebx, 8
mov eax, dword [esp + 0xc8]
cmp esi, eax
jb 0x513380
xor edx, edx
cmp esi, eax
setne dl
mov eax, edx
test eax, eax
jl 0x513380
mov eax, dword [esp + 0xc8]
mov ecx, dword [esp + 0x14]
lea edi, [esi + eax]
mov esi, dword [ecx]
mov eax, dword [esi + 0x14c]
mov edx, dword [esi + 0x144]
add esi, 0x144
lea edi, [edi + edi + 4]
sub edx, eax
cmp edx, edi
jae 0x513196
mov edx, edi
sub edx, dword [esi + 4]
mov ecx, esi
add edx, eax
call fcn.0051cc20
mov ebp, dword [esi + 8]
add edi, ebp
mov dword [esi + 8], edi
mov ecx, dword [esp + 0xcc]
mov edx, dword [esp + 0xb8]
mov eax, edx
cmp ecx, ebx
jae 0x5131b9
lea eax, [esp + 0xb8]
mov edi, dword [esp + 0xc8]
lea esi, [eax + edi*2]
test esi, esi
je 0x5131ec
mov eax, edx
cmp ecx, ebx
jae 0x5131d4
lea eax, [esp + 0xb8]
cmp eax, esi
ja 0x5131ec
mov eax, edx
cmp ecx, ebx
jae 0x5131e5
lea eax, [esp + 0xb8]
lea eax, [eax + edi*2]
cmp esi, eax
jbe 0x5131ff
call fcn.0051e9d3
mov ecx, dword [esp + 0xcc]
mov edx, dword [esp + 0xb8]
cmp ecx, ebx
jb 0x513374
mov edi, edx
test edx, edx
je 0x513239
mov eax, edx
cmp ecx, ebx
jae 0x51321a
lea eax, [esp + 0xb8]
cmp eax, edi
ja 0x513239
mov eax, edx
cmp ecx, ebx
jae 0x51322b
lea eax, [esp + 0xb8]
mov ecx, dword [esp + 0xc8]
lea edx, [eax + ecx*2]
cmp edi, edx
jbe 0x51323e
call fcn.0051e9d3
sub esi, edi
sar esi, 1
mov eax, esi
test eax, eax
jle 0x513256
add eax, eax
push eax
push edi
push eax
push ebp
call fcn.0051e522
add esp, 0x10
mov ecx, dword [esp + 0xc8]
xor eax, eax
mov word [ebp + ecx*2], ax
mov edx, dword [esp + 0xc8]
mov eax, dword [esp + 0x80]
lea esi, [ebp + edx*2 + 2]
cmp dword [esp + 0x94], ebx
jae 0x513286
lea eax, [esp + 0x80]
mov ecx, dword [esp + 0x90]
lea edx, [esp + 0x7c]
lea eax, [eax + ecx*2]
push edx
push eax
lea ecx, [esp + 0x54]
call fcn.00402c70
mov eax, dword [esp + 0x80]
cmp dword [esp + 0x94], ebx
jae 0x5132b6
lea eax, [esp + 0x80]
lea ecx, [esp + 0x7c]
push ecx
push eax
lea ecx, [esp + 0x4c]
call fcn.00402c70
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x48]
sub eax, ecx
sar eax, 1
test eax, eax
jle 0x5132e3
add eax, eax
push eax
push ecx
push eax
push esi
call fcn.0051e522
add esp, 0x10
mov eax, dword [esp + 0x90]
xor edx, edx
mov word [esi + eax*2], dx
cmp dword [esp + 0x94], ebx
jb 0x513309
mov ecx, dword [esp + 0x80]
push ecx
call fcn.0051e446
add esp, 4
xor edx, edx
mov dword [esp + 0x94], 7
mov dword [esp + 0x90], 0
mov word [esp + 0x80], dx
mov dword [esp + 0xec], 0xffffffff
cmp dword [esp + 0xcc], ebx
jb 0x512ab0
mov eax, dword [esp + 0xb8]
push eax
call fcn.0051e446
add esp, 4
jmp 0x512ab0
mov cx, bx
cmp cx, word [eax]
sbb eax, eax
and eax, 0xfffffffe
add eax, 1
je 0x513137
mov ebx, 8
jmp 0x513154
lea edi, [esp + 0xb8]
jmp 0x51320d
cmp edi, ebx
jb 0x51338d
push ebp
call fcn.0051e446
add esp, 4
xor ecx, ecx
mov dword [esp + 0x94], 7
mov dword [esp + 0x90], 0
mov word [esp + 0x80], cx
cmp dword [esp + 0xcc], ebx
jb 0x5133c6
mov edx, dword [esp + 0xb8]
push edx
call fcn.0051e446
add esp, 4
xor eax, eax
jmp 0x5136f6
mov edi, dword [esp + 0x28]
mov esi, dword [edi + 0x4c]
cmp esi, dword [edi + 0x50]
jbe 0x5133de
call fcn.0051e9d3
mov ebp, dword [edi + 0x40]
mov ebx, esi
mov esi, dword [edi + 0x50]
mov dword [esp + 0x20], ebp
mov dword [esp + 0x2c], esi
cmp dword [edi + 0x4c], esi
jbe 0x5133f8
call fcn.0051e9d3
mov eax, dword [edi + 0x40]
mov dword [esp + 0x44], eax
nop
test ebp, ebp
je 0x51340a
cmp ebp, dword [esp + 0x44]
je 0x51340f
call fcn.0051e9d3
cmp ebx, esi
je 0x5136e3
mov eax, 7
xor ecx, ecx
mov dword [esp + 0xb0], eax
mov dword [esp + 0xac], 0
mov word [esp + 0x9c], cx
mov dword [esp + 0xec], eax
test ebp, ebp
jne 0x5134e2
call fcn.0051e9d3
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x513458
call fcn.0051e9d3
cmp word [ebx + 2], 0
lea esi, [ebx + 2]
je 0x5134f4
test ebp, ebp
jne 0x5134ea
call fcn.0051e9d3
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x51347f
call fcn.0051e9d3
mov dx, word [ebx]
mov word [esp + 0xd0], dx
test ebp, ebp
jne 0x5134ef
call fcn.0051e9d3
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x51349f
call fcn.0051e9d3
mov ax, word [esi]
xor ecx, ecx
lea edx, [esp + 0xd4]
push edx
mov edx, dword [esp + 0x18]
mov word [esp + 0xd6], ax
mov word [esp + 0xd8], cx
lea eax, [esp + 0xd4]
push eax
lea ecx, [esp + 0xbc]
push ecx
mov ecx, dword [edx + 4]
call fcn.00510f00
mov byte [esp + 0xec], 8
jmp 0x513544
mov eax, dword [ebp]
jmp 0x51344e
mov eax, dword [ebp]
jmp 0x513475
mov eax, dword [ebp]
jmp 0x513495
test ebp, ebp
jne 0x5136b4
call fcn.0051e9d3
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x51350d
call fcn.0051e9d3
test ebp, ebp
jne 0x5136bc
call fcn.0051e9d3
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x513526
call fcn.0051e9d3
mov edx, dword [esp + 0x14]
push esi
push ebx
lea ecx, [esp + 0xbc]
push ecx
mov ecx, dword [edx + 4]
call fcn.00510f00
mov byte [esp + 0xec], 9
push 0xffffffffffffffff
push 0
push eax
lea ecx, [esp + 0xa4]
call fcn.00402570
cmp dword [esp + 0xcc], 8
mov byte [esp + 0xec], 7
jb 0x513577
mov eax, dword [esp + 0xb8]
push eax
call fcn.0051e446
add esp, 4
mov eax, dword [esp + 0xac]
test eax, eax
je 0x5136c8
mov ecx, dword [esp + 0x14]
mov esi, dword [ecx]
mov edx, dword [esi + 0x14c]
add esi, 0x144
lea edi, [eax + eax + 2]
mov eax, dword [esi]
sub eax, edx
cmp eax, edi
jae 0x5135b0
sub edx, dword [esi + 4]
mov ecx, esi
add edx, edi
call fcn.0051cc20
mov ebp, dword [esi + 8]
lea ecx, [edi + ebp]
mov dword [esi + 8], ecx
cmp dword [esp + 0xb0], 8
mov eax, dword [esp + 0x9c]
jae 0x5135d1
lea eax, [esp + 0x9c]
mov edx, dword [esp + 0xac]
lea ecx, [esp + 0x98]
push ecx
lea eax, [eax + edx*2]
push eax
lea ecx, [esp + 0x54]
call fcn.00402c70
mov eax, dword [esp + 0x9c]
mov esi, 8
cmp dword [esp + 0xb0], esi
jae 0x513609
lea eax, [esp + 0x9c]
lea edx, [esp + 0x98]
push edx
push eax
lea ecx, [esp + 0x40]
call fcn.00402c70
mov eax, dword [esp + 0x50]
mov ecx, dword [esp + 0x3c]
sub eax, ecx
sar eax, 1
test eax, eax
jle 0x513639
add eax, eax
push eax
push ecx
push eax
push ebp
call fcn.0051e522
add esp, 0x10
mov ecx, dword [esp + 0xac]
xor eax, eax
mov word [ebp + ecx*2], ax
mov eax, dword [esp + 0x20]
test eax, eax
jne 0x5136c4
call fcn.0051e9d3
xor eax, eax
cmp ebx, dword [eax + 0x10]
jb 0x513660
call fcn.0051e9d3
add ebx, 4
mov dword [esp + 0xec], 0xffffffff
cmp dword [esp + 0xb0], esi
jb 0x513687
mov edx, dword [esp + 0x9c]
push edx
call fcn.0051e446
add esp, 4
mov esi, dword [esp + 0x2c]
mov ebp, dword [esp + 0x20]
xor eax, eax
mov dword [esp + 0xb0], 7
mov dword [esp + 0xac], 0
mov word [esp + 0x9c], ax
jmp 0x513400
mov eax, dword [ebp]
jmp 0x513503
mov eax, dword [ebp]
jmp 0x51351c
mov eax, dword [eax]
jmp 0x513656
lea ecx, [esp + 0x98]
mov dword [esp + 0xec], 0xffffffff
call fcn.00401f00
xor eax, eax
jmp 0x5136f6
mov ecx, dword [esp + 0x14]
mov edx, dword [ecx]
mov eax, dword [edx + 0x148]
add eax, dword [esp + 0x40]
mov dword [ecx + 8], eax
mov ecx, dword [esp + 0xe4]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
mov ecx, dword [esp + 0xcc]
xor ecx, esp
call fcn.0051e437
add esp, 0xdc
ret 8