Function at 0x40bed0
Capabilities:
Compress data via zlib inflate or deflate

Disassembly:
mov edx, dword [esp + 4]
sub esp, 0x28
push edi
test edx, edx
je 0x40cd12
mov edi, dword [edx + 0x1c]
test edi, edi
je 0x40cd12
cmp dword [edx + 0xc], 0
je 0x40cd12
cmp dword [edx], 0
jne 0x40bf04
cmp dword [edx + 4], 0
jne 0x40cd12
cmp dword [edi], 0xb
jne 0x40bf0f
mov dword [edi], 0xc
mov ecx, dword [edx + 0x10]
mov eax, dword [edx + 0xc]
push ebx
mov ebx, dword [edi + 0x38]
push ebp
mov ebp, dword [edx]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x1c], ecx
mov ecx, dword [edi]
mov dword [esp + 0x18], eax
mov eax, dword [edx + 4]
push esi
mov esi, dword [edi + 0x3c]
mov dword [esp + 0x10], eax
mov dword [esp + 0x34], eax
mov dword [esp + 0x2c], 0
cmp ecx, 0x1c
jbe switch.0x0040bf57
pop esi
pop ebp
pop ebx
mov eax, 0xfffffffe
pop edi
add esp, 0x28
ret
mov edx, dword [esp + 0x3c]
jmp dword [ecx*4 + 0x40cd1c]
cmp dword [edi + 8], 0
jne 0x40bf6f
mov dword [edi], 0xc
jmp 0x40cbff
cmp esi, 0x10
jae 0x40bf94
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, 0x10
jb 0x40bf74
movzx eax, bl
shl eax, 8
mov ecx, ebx
shr ecx, 8
add eax, ecx
xor edx, edx
mov ecx, 0x1f
div ecx
test edx, edx
je 0x40bfc2
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
mov dword [edx + 0x18], str.incorrect_header_check
jmp 0x40cbf9
mov eax, ebx
and al, 0xf
cmp al, 8
je 0x40bfde
mov ecx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
mov dword [ecx + 0x18], str.unknown_compression_method
jmp 0x40cbf9
shr ebx, 4
mov ecx, ebx
and ecx, 0xf
add ecx, 8
sub esi, 4
cmp ecx, dword [edi + 0x24]
jbe 0x40c005
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
mov dword [edx + 0x18], str.invalid_window_size
jmp 0x40cbf9
mov eax, 1
shl eax, cl
xor edx, edx
xor ecx, ecx
mov dword [edi + 0x14], eax
xor eax, eax
call fcn.00411a80
mov ecx, dword [esp + 0x3c]
shr ebx, 8
not ebx
and ebx, 2
or ebx, 9
mov dword [edi + 0x18], eax
mov dword [ecx + 0x30], eax
mov eax, dword [esp + 0x10]
mov dword [edi], ebx
xor ebx, ebx
xor esi, esi
jmp 0x40cbff
cmp esi, 0x20
jae 0x40c063
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, 0x20
jb 0x40c043
mov ecx, ebx
and ecx, 0xff00
mov edx, ebx
shl edx, 0x10
add ecx, edx
mov edx, ebx
shr edx, 8
shl ecx, 8
and edx, 0xff00
add ecx, edx
mov edx, dword [esp + 0x3c]
shr ebx, 0x18
add ecx, ebx
mov dword [edi + 0x18], ecx
mov dword [edx + 0x30], ecx
xor ebx, ebx
xor esi, esi
mov dword [edi], 0xa
cmp dword [edi + 0xc], 0
je 0x40cc17
xor eax, eax
xor edx, edx
xor ecx, ecx
call fcn.00411a80
mov ecx, dword [esp + 0x3c]
mov dword [edi + 0x18], eax
mov dword [ecx + 0x30], eax
mov eax, dword [esp + 0x10]
mov dword [edi], 0xb
cmp dword [edi + 4], 0
je 0x40c0de
mov ecx, esi
and ecx, 7
shr ebx, cl
sub esi, ecx
mov dword [edi], 0x18
jmp 0x40cbff
cmp esi, 3
jae 0x40c103
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, 3
jb 0x40c0e3
mov ecx, ebx
and ecx, 1
shr ebx, 1
mov dword [edi + 4], ecx
mov ecx, ebx
and ecx, 3
dec esi
cmp ecx, 3
ja case.default.0x40c118
jmp dword [ecx*4 + 0x40cd90]
shr ebx, 2
mov dword [edi], 0xd
sub esi, 2
jmp 0x40cbff
shr ebx, 2
mov dword [edi + 0x4c], 0x4c96c8
mov dword [edi + 0x54], 9
mov dword [edi + 0x50], 0x4c9ec8
mov dword [edi + 0x58], 5
mov dword [edi], 0x12
sub esi, 2
jmp 0x40cbff
shr ebx, 2
mov dword [edi], 0xf
sub esi, 2
jmp 0x40cbff
mov edx, dword [esp + 0x3c]
mov dword [edx + 0x18], str.invalid_block_type
mov dword [edi], 0x1b
shr ebx, 2
sub esi, 2
jmp 0x40cbff
mov ecx, esi
and ecx, 7
sub esi, ecx
shr ebx, cl
cmp esi, 0x20
jae 0x40c1b8
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, 0x20
jb 0x40c198
mov edx, ebx
mov ecx, ebx
not edx
and ecx, 0xffff
shr edx, 0x10
cmp ecx, edx
je 0x40c1db
mov ecx, dword [esp + 0x3c]
mov dword [ecx + 0x18], str.invalid_stored_block_lengths
jmp 0x40cbf9
xor ebx, ebx
mov dword [edi + 0x40], ecx
xor esi, esi
mov dword [edi], 0xe
mov ecx, dword [edi + 0x40]
mov dword [esp + 0x18], ecx
test ecx, ecx
je 0x40c835
cmp ecx, eax
jbe 0x40c201
mov ecx, eax
mov dword [esp + 0x18], eax
mov edx, dword [esp + 0x14]
cmp ecx, edx
jbe 0x40c20f
mov ecx, edx
mov dword [esp + 0x18], ecx
test ecx, ecx
je 0x40cc59
mov edx, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
push edx
push ebp
push eax
call fcn.004335c0
mov eax, dword [esp + 0x24]
sub dword [esp + 0x1c], eax
sub dword [esp + 0x20], eax
add dword [esp + 0x28], eax
add ebp, eax
add esp, 0xc
sub dword [edi + 0x40], eax
mov eax, dword [esp + 0x10]
jmp 0x40cbff
cmp esi, 0xe
jae 0x40c270
lea ecx, [ecx]
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, 0xe
jb 0x40c250
mov ecx, ebx
and ecx, 0x1f
shr ebx, 5
add ecx, 0x101
mov edx, ebx
mov dword [edi + 0x60], ecx
shr ebx, 5
mov ecx, ebx
and edx, 0x1f
and ecx, 0xf
inc edx
add ecx, 4
shr ebx, 4
sub esi, 0xe
cmp dword [edi + 0x60], 0x11e
mov dword [edi + 0x64], edx
mov dword [edi + 0x5c], ecx
ja 0x40c394
cmp edx, 0x1e
ja 0x40c394
mov dword [edi + 0x68], 0
mov dword [edi], 0x10
mov ecx, dword [edi + 0x68]
cmp ecx, dword [edi + 0x5c]
jae 0x40c31b
lea esp, [esp]
cmp esi, 3
jae 0x40c2f5
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, 3
jb 0x40c2d5
mov edx, dword [edi + 0x68]
movzx edx, word [edx*2 + 0x4c9f48]
mov ecx, ebx
and ecx, 7
mov word [edi + edx*2 + 0x70], cx
inc dword [edi + 0x68]
mov ecx, dword [edi + 0x68]
shr ebx, 3
sub esi, 3
cmp ecx, dword [edi + 0x5c]
jb 0x40c2d0
mov eax, 0x13
cmp dword [edi + 0x68], eax
jae 0x40c34a
jmp 0x40c330
mov edx, dword [edi + 0x68]
movzx ecx, word [edx*2 + 0x4c9f48]
xor edx, edx
mov word [edi + ecx*2 + 0x70], dx
inc dword [edi + 0x68]
cmp dword [edi + 0x68], eax
jb 0x40c330
lea eax, [edi + 0x530]
lea ecx, [edi + 0x6c]
mov dword [ecx], eax
mov dword [edi + 0x4c], eax
lea eax, [edi + 0x2f0]
push eax
push ecx
lea edx, [edi + 0x54]
push 0x13
lea ecx, [edi + 0x70]
push 0
mov dword [edx], 7
call fcn.00412170
add esp, 0x10
mov dword [esp + 0x2c], eax
test eax, eax
mov eax, dword [esp + 0x10]
je 0x40c3a4
mov ecx, dword [esp + 0x3c]
mov dword [ecx + 0x18], str.invalid_code_lengths_set
jmp 0x40cbf9
mov edx, dword [esp + 0x3c]
mov dword [edx + 0x18], str.too_many_length_or_distance_symbols
jmp 0x40cbf9
mov dword [edi + 0x68], 0
mov dword [edi], 0x11
mov edx, dword [edi + 0x64]
add edx, dword [edi + 0x60]
cmp dword [edi + 0x68], edx
jae 0x40c5b3
mov ecx, dword [edi + 0x54]
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x4c]
dec edx
and edx, ebx
mov ecx, dword [ecx + edx*4]
mov edx, ecx
shr edx, 8
movzx edx, dl
mov dword [esp + 0x18], ecx
cmp edx, esi
jbe 0x40c421
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x54]
dec eax
add esi, 8
add ebx, edx
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x4c]
inc ebp
mov dword [esp + 0x10], eax
dec edx
and edx, ebx
mov ecx, dword [ecx + edx*4]
mov edx, ecx
shr edx, 8
movzx edx, dl
mov dword [esp + 0x18], ecx
cmp edx, esi
ja 0x40c3e3
mov edx, ecx
shr edx, 0x10
cmp edx, 0x10
jae 0x40c479
mov edx, ecx
shr edx, 8
movzx edx, dl
cmp esi, edx
jae 0x40c45d
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [esp + 0x18]
dec eax
add esi, 8
add ebx, edx
movzx edx, ch
inc ebp
mov dword [esp + 0x10], eax
cmp esi, edx
jb 0x40c437
mov dx, word [esp + 0x1a]
movzx ecx, ch
shr ebx, cl
sub esi, ecx
mov ecx, dword [edi + 0x68]
mov word [edi + ecx*2 + 0x70], dx
inc dword [edi + 0x68]
jmp 0x40c5a4
mov dx, word [esp + 0x1a]
movzx ecx, ch
mov dword [esp + 0x28], ecx
cmp dx, 0x10
jne 0x40c4e3
lea edx, [ecx + 2]
cmp esi, edx
jae 0x40c4b8
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [esp + 0x28]
dec eax
add esi, 8
add ebx, edx
lea edx, [ecx + 2]
inc ebp
mov dword [esp + 0x10], eax
cmp esi, edx
jb 0x40c492
shr ebx, cl
sub esi, ecx
mov ecx, dword [edi + 0x68]
test ecx, ecx
je 0x40c608
movzx eax, word [edi + ecx*2 + 0x6e]
mov dword [esp + 0x28], eax
mov eax, ebx
and eax, 3
add eax, 3
shr ebx, 2
sub esi, 2
jmp 0x40c575
cmp dx, 0x11
jne 0x40c52a
lea edx, [ecx + 3]
cmp esi, edx
jae 0x40c516
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [esp + 0x28]
dec eax
add esi, 8
add ebx, edx
lea edx, [ecx + 3]
inc ebp
mov dword [esp + 0x10], eax
cmp esi, edx
jb 0x40c4f0
shr ebx, cl
mov edx, 0xfffffffd
mov eax, ebx
and eax, 7
add eax, 3
shr ebx, 3
jmp 0x40c569
lea edx, [ecx + 7]
cmp esi, edx
jae 0x40c557
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [esp + 0x28]
dec eax
add esi, 8
add ebx, edx
lea edx, [ecx + 7]
inc ebp
mov dword [esp + 0x10], eax
cmp esi, edx
jb 0x40c531
shr ebx, cl
mov edx, 0xfffffff9
mov eax, ebx
and eax, 0x7f
add eax, 0xb
shr ebx, 7
sub edx, ecx
add esi, edx
mov dword [esp + 0x28], 0
mov ecx, dword [edi + 0x64]
mov edx, dword [edi + 0x68]
add ecx, dword [edi + 0x60]
add edx, eax
cmp edx, ecx
ja 0x40c618
test eax, eax
je 0x40c5a0
mov ecx, dword [esp + 0x28]
mov edx, dword [edi + 0x68]
dec eax
mov word [edi + edx*2 + 0x70], cx
inc dword [edi + 0x68]
test eax, eax
jne 0x40c590
mov eax, dword [esp + 0x10]
mov ecx, dword [edi + 0x64]
add ecx, dword [edi + 0x60]
cmp dword [edi + 0x68], ecx
jb 0x40c3c0
cmp dword [edi], 0x1b
je 0x40cbff
lea eax, [edi + 0x530]
lea ecx, [edi + 0x6c]
mov dword [ecx], eax
mov dword [edi + 0x4c], eax
lea eax, [edi + 0x2f0]
push eax
push ecx
mov ecx, dword [edi + 0x60]
push ecx
lea edx, [edi + 0x54]
lea ecx, [edi + 0x70]
push 1
mov dword [edx], 9
call fcn.00412170
add esp, 0x10
mov dword [esp + 0x2c], eax
test eax, eax
je 0x40c62c
mov edx, dword [esp + 0x3c]
mov eax, dword [esp + 0x10]
mov dword [edx + 0x18], str.invalid_literal_lengths_set
jmp 0x40cbf9
mov edx, dword [esp + 0x3c]
mov dword [edx + 0x18], str.invalid_bit_length_repeat
jmp 0x40cbf9
mov eax, dword [esp + 0x3c]
mov dword [eax + 0x18], str.invalid_bit_length_repeat
mov eax, dword [esp + 0x10]
jmp 0x40cbf9
mov ecx, dword [edi + 0x6c]
lea eax, [edi + 0x6c]
mov dword [edi + 0x50], ecx
lea ecx, [edi + 0x2f0]
push ecx
mov ecx, dword [edi + 0x60]
push eax
mov eax, dword [edi + 0x64]
push eax
lea edx, [edi + 0x58]
lea ecx, [edi + ecx*2 + 0x70]
push 2
mov dword [edx], 6
call fcn.00412170
add esp, 0x10
mov dword [esp + 0x2c], eax
test eax, eax
mov eax, dword [esp + 0x10]
je 0x40c677
mov edx, dword [esp + 0x3c]
mov dword [edx + 0x18], str.invalid_distances_set
jmp 0x40cbf9
mov dword [edi], 0x12
cmp eax, 6
jb 0x40c6e1
cmp dword [esp + 0x14], 0x102
jb 0x40c6e1
mov eax, dword [esp + 0x3c]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x1c]
mov dword [eax + 0x10], edx
mov edx, dword [esp + 0x20]
mov dword [eax + 0xc], ecx
mov ecx, dword [esp + 0x10]
push edx
mov dword [eax], ebp
mov dword [eax + 4], ecx
push eax
mov dword [edi + 0x38], ebx
mov dword [edi + 0x3c], esi
call fcn.00411ce0
mov eax, dword [esp + 0x44]
mov ecx, dword [eax + 0xc]
mov edx, dword [eax + 0x10]
mov ebp, dword [eax]
mov eax, dword [eax + 4]
mov ebx, dword [edi + 0x38]
mov esi, dword [edi + 0x3c]
add esp, 8
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], eax
jmp 0x40cbff
mov ecx, dword [edi + 0x54]
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x4c]
dec edx
and edx, ebx
mov edx, dword [ecx + edx*4]
mov ecx, edx
shr ecx, 8
movzx ecx, cl
mov dword [esp + 0x18], edx
cmp ecx, esi
jbe 0x40c742
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x54]
dec eax
add esi, 8
add ebx, edx
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x4c]
inc ebp
mov dword [esp + 0x10], eax
dec edx
and edx, ebx
mov edx, dword [ecx + edx*4]
mov ecx, edx
shr ecx, 8
movzx ecx, cl
mov dword [esp + 0x18], edx
cmp ecx, esi
ja 0x40c704
test dl, dl
je 0x40c809
test dl, 0xf0
jne 0x40c809
mov ecx, edx
shr ecx, 8
mov dword [esp + 0x30], ecx
movzx ecx, cl
mov dword [esp + 0x24], ecx
movzx ecx, dl
add ecx, dword [esp + 0x24]
mov dword [esp + 0x28], edx
mov edx, 1
shl edx, cl
mov ecx, dword [esp + 0x24]
dec edx
and edx, ebx
shr edx, cl
mov ecx, dword [esp + 0x18]
shr ecx, 0x10
add edx, ecx
mov ecx, dword [edi + 0x4c]
mov ecx, dword [ecx + edx*4]
mov dword [esp + 0x18], ecx
shr ecx, 8
movzx edx, cl
movzx ecx, byte [esp + 0x30]
add edx, ecx
cmp edx, esi
jbe 0x40c7fc
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [esp + 0x28]
dec eax
add esi, 8
add ebx, edx
movzx edx, ch
movzx ecx, cl
add ecx, edx
mov dword [esp + 0x24], edx
mov edx, 1
shl edx, cl
mov ecx, dword [esp + 0x24]
inc ebp
mov dword [esp + 0x10], eax
dec edx
and edx, ebx
shr edx, cl
movzx ecx, word [esp + 0x2a]
add edx, ecx
mov ecx, dword [edi + 0x4c]
mov ecx, dword [ecx + edx*4]
mov dword [esp + 0x18], ecx
shr ecx, 8
movzx edx, cl
add edx, dword [esp + 0x24]
cmp edx, esi
ja 0x40c7a2
movzx ecx, byte [esp + 0x29]
mov edx, dword [esp + 0x18]
shr ebx, cl
sub esi, ecx
mov ecx, edx
shr ecx, 8
movzx ecx, cl
shr ebx, cl
sub esi, ecx
mov dword [esp + 0x24], ecx
mov ecx, edx
shr ecx, 0x10
mov dword [edi + 0x40], ecx
test dl, dl
jne 0x40c830
mov dword [edi], 0x17
jmp 0x40cbff
test dl, 0x20
je 0x40c840
mov dword [edi], 0xb
jmp 0x40cbff
test dl, 0x40
je 0x40c855
mov edx, dword [esp + 0x3c]
mov dword [edx + 0x18], str.invalid_literal_length_code
jmp 0x40cbf9
movzx ecx, dl
and ecx, 0xf
mov dword [edi + 0x48], ecx
mov dword [edi], 0x13
mov ecx, dword [edi + 0x48]
test ecx, ecx
je 0x40c8a4
cmp esi, ecx
jae 0x40c890
nop
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, dword [edi + 0x48]
jb 0x40c870
mov ecx, dword [edi + 0x48]
mov edx, 1
shl edx, cl
dec edx
and edx, ebx
add dword [edi + 0x40], edx
shr ebx, cl
sub esi, ecx
mov dword [edi], 0x14
mov ecx, dword [edi + 0x58]
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x50]
dec edx
and edx, ebx
mov edx, dword [ecx + edx*4]
mov ecx, edx
shr ecx, 8
movzx ecx, cl
mov dword [esp + 0x18], edx
cmp ecx, esi
jbe 0x40c90e
lea ecx, [ecx]
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [edi + 0x58]
dec eax
add esi, 8
add ebx, edx
mov edx, 1
shl edx, cl
mov ecx, dword [edi + 0x50]
inc ebp
mov dword [esp + 0x10], eax
dec edx
and edx, ebx
mov edx, dword [ecx + edx*4]
mov ecx, edx
shr ecx, 8
movzx ecx, cl
mov dword [esp + 0x18], edx
cmp ecx, esi
ja 0x40c8d0
test dl, 0xf0
jne 0x40c9cd
mov ecx, edx
shr ecx, 8
mov dword [esp + 0x30], ecx
movzx ecx, cl
mov dword [esp + 0x24], ecx
movzx ecx, dl
add ecx, dword [esp + 0x24]
mov dword [esp + 0x28], edx
mov edx, 1
shl edx, cl
mov ecx, dword [esp + 0x24]
dec edx
and edx, ebx
shr edx, cl
mov ecx, dword [esp + 0x18]
shr ecx, 0x10
add edx, ecx
mov ecx, dword [edi + 0x50]
mov ecx, dword [ecx + edx*4]
mov dword [esp + 0x18], ecx
shr ecx, 8
movzx edx, cl
movzx ecx, byte [esp + 0x30]
add edx, ecx
cmp edx, esi
jbe 0x40c9c0
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
mov ecx, dword [esp + 0x28]
dec eax
add esi, 8
add ebx, edx
movzx edx, ch
movzx ecx, cl
add ecx, edx
mov dword [esp + 0x24], edx
mov edx, 1
shl edx, cl
mov ecx, dword [esp + 0x24]
inc ebp
mov dword [esp + 0x10], eax
dec edx
and edx, ebx
shr edx, cl
movzx ecx, word [esp + 0x2a]
add edx, ecx
mov ecx, dword [edi + 0x50]
mov ecx, dword [ecx + edx*4]
mov dword [esp + 0x18], ecx
shr ecx, 8
movzx edx, cl
add edx, dword [esp + 0x24]
cmp edx, esi
ja 0x40c966
movzx ecx, byte [esp + 0x29]
mov edx, dword [esp + 0x18]
shr ebx, cl
sub esi, ecx
mov ecx, edx
shr ecx, 8
movzx ecx, cl
shr ebx, cl
sub esi, ecx
mov dword [esp + 0x24], ecx
test dl, 0x40
je 0x40c9f2
mov edx, dword [esp + 0x3c]
mov dword [edx + 0x18], str.invalid_distance_code
jmp 0x40cbf9
mov ecx, edx
movzx edx, dl
shr ecx, 0x10
and edx, 0xf
mov dword [edi + 0x44], ecx
mov dword [edi + 0x48], edx
mov dword [edi], 0x15
mov ecx, dword [edi + 0x48]
test ecx, ecx
je 0x40ca48
cmp esi, ecx
jae 0x40ca34
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, dword [edi + 0x48]
jb 0x40ca14
mov ecx, dword [edi + 0x48]
mov edx, 1
shl edx, cl
dec edx
and edx, ebx
add dword [edi + 0x44], edx
shr ebx, cl
sub esi, ecx
mov ecx, dword [edi + 0x2c]
sub ecx, dword [esp + 0x14]
add ecx, dword [esp + 0x20]
cmp dword [edi + 0x44], ecx
jbe 0x40ca68
mov edx, dword [esp + 0x3c]
mov dword [edx + 0x18], str.invalid_distance_too_far_back
jmp 0x40cbf9
mov dword [edi], 0x16
cmp dword [esp + 0x14], 0
je 0x40cc59
mov edx, dword [esp + 0x20]
sub edx, dword [esp + 0x14]
mov ecx, dword [edi + 0x44]
cmp ecx, edx
jbe 0x40cac4
sub ecx, edx
mov edx, dword [edi + 0x30]
mov dword [esp + 0x18], ecx
cmp ecx, edx
jbe 0x40caa5
sub ecx, edx
mov edx, dword [edi + 0x34]
add edx, dword [edi + 0x28]
mov dword [esp + 0x18], ecx
sub edx, ecx
jmp 0x40cab1
mov edx, dword [edi + 0x34]
sub edx, ecx
add edx, dword [edi + 0x30]
mov ecx, dword [esp + 0x18]
mov dword [esp + 0x28], edx
mov edx, dword [edi + 0x40]
mov dword [esp + 0x30], edx
cmp ecx, edx
jbe 0x40cad9
mov ecx, edx
jmp 0x40cad5
mov edx, dword [esp + 0x1c]
sub edx, ecx
mov ecx, dword [edi + 0x40]
mov dword [esp + 0x28], edx
mov dword [esp + 0x30], ecx
mov dword [esp + 0x18], ecx
mov edx, dword [esp + 0x14]
cmp ecx, edx
jbe 0x40cae7
mov ecx, edx
mov dword [esp + 0x18], ecx
sub edx, ecx
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x30]
sub edx, ecx
mov dword [edi + 0x40], edx
mov ecx, dword [esp + 0x28]
mov dl, byte [ecx]
mov ecx, dword [esp + 0x1c]
mov byte [ecx], dl
mov edx, 1
add dword [esp + 0x28], edx
add ecx, edx
sub dword [esp + 0x18], edx
mov dword [esp + 0x1c], ecx
jne 0x40caf6
cmp dword [edi + 0x40], 0
jne 0x40cbff
mov dword [edi], 0x12
jmp 0x40cbff
cmp dword [esp + 0x14], 0
je 0x40cc59
mov ecx, dword [esp + 0x1c]
mov dl, byte [edi + 0x40]
mov byte [ecx], dl
inc ecx
dec dword [esp + 0x14]
mov dword [esp + 0x1c], ecx
mov dword [edi], 0x12
jmp 0x40cbff
cmp dword [edi + 8], 0
je 0x40cc41
cmp esi, 0x20
jae 0x40cb83
test eax, eax
je 0x40cc59
movzx edx, byte [ebp]
mov ecx, esi
shl edx, cl
dec eax
add esi, 8
inc ebp
add ebx, edx
mov dword [esp + 0x10], eax
cmp esi, 0x20
jb 0x40cb63
mov ecx, dword [esp + 0x20]
sub ecx, dword [esp + 0x14]
mov edx, dword [esp + 0x3c]
add dword [edx + 0x14], ecx
add dword [edi + 0x1c], ecx
mov dword [esp + 0x20], ecx
test ecx, ecx
je 0x40cbbb
mov edx, dword [esp + 0x1c]
mov eax, ecx
mov ecx, dword [edi + 0x18]
sub edx, eax
call fcn.00411a80
mov ecx, dword [esp + 0x3c]
mov dword [edi + 0x18], eax
mov dword [ecx + 0x30], eax
mov eax, dword [esp + 0x10]
mov edx, dword [esp + 0x14]
mov dword [esp + 0x20], edx
mov ecx, ebx
and ecx, 0xff00
mov edx, ebx
shl edx, 0x10
add ecx, edx
mov edx, ebx
shr edx, 8
and edx, 0xff00
shl ecx, 8
add ecx, edx
mov edx, ebx
shr edx, 0x18
add ecx, edx
cmp ecx, dword [edi + 0x18]
je 0x40cc3d
mov ecx, dword [esp + 0x3c]
mov dword [ecx + 0x18], str.incorrect_data_check
mov dword [edi], 0x1b
mov ecx, dword [edi]
cmp ecx, 0x1c
jbe 0x40bf53
pop esi
pop ebp
pop ebx
mov eax, 0xfffffffe
pop edi
add esp, 0x28
ret
mov ecx, dword [esp + 0x1c]
mov dword [edx + 0xc], ecx
mov ecx, dword [esp + 0x14]
mov dword [edx], ebp
mov dword [edx + 4], eax
mov dword [edx + 0x10], ecx
mov dword [edi + 0x3c], esi
pop esi
pop ebp
mov dword [edi + 0x38], ebx
pop ebx
mov eax, 2
pop edi
add esp, 0x28
ret
xor ebx, ebx
xor esi, esi
mov dword [edi], 0x1a
mov dword [esp + 0x2c], 1
jmp 0x40cc59
mov dword [esp + 0x2c], 0xfffffffd
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x1c]
mov dword [ecx + 0xc], edx
mov edx, dword [esp + 0x14]
mov dword [ecx + 0x10], edx
mov dword [ecx], ebp
mov dword [ecx + 4], eax
cmp dword [edi + 0x28], 0
mov dword [edi + 0x38], ebx
mov dword [edi + 0x3c], esi
jne 0x40cc8a
cmp dword [edi], 0x18
jge 0x40ccae
mov eax, dword [esp + 0x20]
cmp eax, dword [ecx + 0x10]
je 0x40ccae
mov eax, dword [esp + 0x20]
mov ebx, dword [esp + 0x3c]
call fcn.0040bde0
test eax, eax
je 0x40ccae
mov dword [edi], 0x1c
pop esi
pop ebp
pop ebx
mov eax, 0xfffffffc
pop edi
add esp, 0x28
ret
mov esi, dword [esp + 0x3c]
mov eax, dword [esp + 0x20]
sub eax, dword [esi + 0x10]
mov ecx, dword [esp + 0x34]
sub ecx, dword [esi + 4]
add dword [esi + 0x14], eax
add dword [esi + 8], ecx
add dword [edi + 0x1c], eax
cmp dword [edi + 8], 0
je 0x40cce6
test eax, eax
je 0x40cce6
mov edx, dword [esi + 0xc]
mov ecx, dword [edi + 0x18]
sub edx, eax
call fcn.00411a80
mov dword [edi + 0x18], eax
mov dword [esi + 0x30], eax
mov edx, dword [edi + 4]
neg edx
sbb edx, edx
xor eax, eax
and edx, 0x40
cmp dword [edi], 0xb
setne al
dec eax
and eax, 0x80
add edx, eax
add edx, dword [edi + 0x3c]
mov eax, dword [esp + 0x2c]
mov dword [esi + 0x2c], edx
pop esi
pop ebp
pop ebx
pop edi
add esp, 0x28
ret
mov eax, 0xfffffffe
pop edi
add esp, 0x28
ret