Function at 0x426640
Capabilities:
Terminate process

Disassembly:
push ebp
mov ebp, esp
push ebx
push esi
push edi
mov edi, dword [ebp + 0xc]
cmp edi, 4
ja 0x42669e
mov esi, dword [ebp + 8]
xor eax, eax
xor edx, edx
push 0xa
mov ecx, dword [esi + 0x1c]
mov ax, word [ecx + edi*2 - 2]
mov dx, word [ecx + edi*2]
sub edx, eax
push eax
push edx
call fcn.00425920
mov eax, dword [esi + 4]
add esp, 0xc
test eax, eax
jg 0x42667f
push esi
call fcn.00426510
add esp, 4
mov eax, dword [esi + 0x20]
mov ebx, dword [esi + 4]
mov cx, word [esi + 0x14]
dec ebx
lea eax, [eax + edi*2 - 2]
mov dword [esi + 4], ebx
add word [eax], cx
mov eax, edi
shr eax, 1
pop edi
pop esi
inc eax
pop ebx
pop ebp
ret
cmp edi, 8
ja 0x4266f9
mov esi, dword [ebp + 8]
xor eax, eax
xor edx, edx
push 0xa
mov ecx, dword [esi + 0x1c]
mov ax, word [ecx + 8]
mov dx, word [ecx + 0xa]
sub edx, eax
push eax
push edx
call fcn.00425920
add edi, 0xfffffffb
push 2
push edi
push 1
call fcn.00425920
mov eax, dword [esi + 4]
add esp, 0x18
test eax, eax
jg 0x4266e0
push esi
call fcn.00426510
add esp, 4
mov edi, dword [esi + 4]
mov eax, dword [esi + 0x20]
mov cx, word [esi + 0x14]
dec edi
mov dword [esi + 4], edi
add word [eax + 8], cx
pop edi
pop esi
mov al, 3
pop ebx
pop ebp
ret
mov esi, dword [ebp + 8]
cmp edi, 0x10
mov ecx, dword [esi + 0x1c]
ja 0x426754
xor eax, eax
xor edx, edx
mov ax, word [ecx + 0xa]
mov dx, word [ecx + 0xc]
push 0xa
sub edx, eax
push eax
push edx
call fcn.00425920
add edi, 0xfffffff7
push 3
push edi
push 1
call fcn.00425920
mov eax, dword [esi + 4]
add esp, 0x18
test eax, eax
jg 0x42673b
push esi
call fcn.00426510
add esp, 4
mov edi, dword [esi + 4]
mov eax, dword [esi + 0x20]
mov cx, word [esi + 0x14]
dec edi
mov dword [esi + 4], edi
add word [eax + 0xa], cx
pop edi
pop esi
mov al, 4
pop ebx
pop ebp
ret
xor eax, eax
xor edx, edx
mov ax, word [ecx + 0xc]
mov dx, word [ecx + 0xe]
push 0xa
sub edx, eax
push eax
push edx
call fcn.00425920
add esp, 0xc
cmp edi, 0x20
jae 0x426782
push 5
push edi
push 1
call fcn.00425920
add esp, 0xc
jmp 0x4267c0
mov eax, edi
mov ebx, 5
and al, 0xe0
cmp eax, 0x20
jbe 0x42679c
inc ebx
mov edx, edi
mov ecx, ebx
shr edx, cl
cmp edx, 1
ja 0x426790
lea eax, [ebx - 5]
push 5
push eax
push 1
call fcn.00425920
mov edx, 1
mov ecx, ebx
shl edx, cl
push ebx
sub edi, edx
push edi
push 1
call fcn.00425920
add esp, 0x18
mov eax, dword [esi + 4]
test eax, eax
jg 0x4268ed
mov eax, dword [esi + 8]
test eax, eax
je 0x4267e8
mov ecx, dword [esi + 0x14]
mov dword [esi + 4], eax
inc ecx
mov dword [esi + 8], 0
mov dword [esi + 0x14], ecx
jmp 0x4268ed
mov eax, dword [esi + 0xc]
mov ecx, dword [esi + 0x10]
cmp eax, ecx
jge 0x4267fe
add eax, eax
cmp eax, ecx
mov dword [esi + 0xc], eax
jle 0x4267fe
mov dword [esi + 0xc], ecx
mov ecx, dword [esi]
mov eax, dword [esi + 0x1c]
xor edi, edi
mov di, word [eax + ecx*2]
dec ecx
test ecx, ecx
mov edx, edi
je 0x426832
mov ebx, dword [esi + 0x20]
xor eax, eax
mov ax, word [ebx + ecx*2]
mov ebx, dword [esi + 0x1c]
sub edx, eax
or al, 2
mov word [ebx + ecx*2], dx
mov ebx, dword [esi + 0x20]
sar eax, 1
sub edi, eax
mov word [ebx + ecx*2], ax
dec ecx
jne 0x426810
mov ecx, dword [esi + 0x20]
mov ax, word [ecx]
mov ebx, eax
and ebx, 0xffff
cmp edx, ebx
je 0x426884
mov ecx, dword [sym.imp.MSVCRT.dll__iob]
push edx
add ecx, 0x40
push str.BUG:_rescaling_left__d_total_frequency_n
push ecx
call dword [sym.imp.MSVCRT.dll_fprintf]
mov edx, dword [esi + 0x1c]
mov edi, dword [sym.imp.MSVCRT.dll_free]
push edx
call edi
mov eax, dword [esi + 0x20]
push eax
call edi
mov esi, dword [esi + 0x24]
add esp, 0x14
test esi, esi
je 0x42687c
push esi
call edi
add esp, 4
push 1
call dword [sym.imp.MSVCRT.dll_exit]
or al, 2
xor edx, edx
shr ax, 1
mov word [ecx], ax
mov ecx, dword [esi + 0x20]
mov dx, word [ecx]
mov ecx, dword [esi + 0xc]
sub edi, edx
mov eax, edi
cdq
idiv ecx
mov dword [esi + 0x14], eax
mov eax, edi
cdq
idiv ecx
mov eax, dword [esi + 0x24]
sub ecx, edx
mov dword [esi + 8], edx
test eax, eax
mov dword [esi + 4], ecx
je 0x4268ed
mov edi, dword [esi]
test edi, edi
je 0x4268ed
mov eax, dword [esi + 0x1c]
mov ecx, dword [esi + 0x18]
xor edx, edx
mov dx, word [eax + edi*2]
dec edx
sar edx, cl
dec edi
xor ecx, ecx
mov cx, word [eax + edi*2]
mov eax, ecx
mov cl, byte [esi + 0x18]
shr eax, cl
cmp eax, edx
jg 0x4268e9
mov ecx, dword [esi + 0x24]
inc eax
cmp eax, edx
mov word [ecx + eax*2 - 2], di
jle 0x4268dc
test edi, edi
jne 0x4268bb
mov edx, dword [esi + 4]
mov eax, dword [esi + 0x20]
dec edx
pop edi
mov dword [esi + 4], edx
mov dx, word [esi + 0x14]
add word [eax + 0xc], dx
pop esi
mov al, 4
pop ebx
pop ebp
ret