Function at 0x408240
Capabilities:
Compute adler32 checksum

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x28
mov eax, ecx
mov rbx, rdx
mov dword [rsp + 0x80], r8d
movzx r15d, cx
shr eax, 0x10
cmp r8d, 1
mov dword [rsp + 0xc], eax
je 0x40858f
test rdx, rdx
je 0x4085c7
cmp dword [rsp + 0x80], 0xf
ja 0x4082ff
mov eax, dword [rsp + 0x80]
mov edx, dword [rsp + 0x80]
sub eax, 1
test edx, edx
je 0x4082ba
lea rdx, [rbx + rax + 1]
mov eax, dword [rsp + 0xc]
add rbx, 1
movzx ecx, byte [rbx - 1]
add r15d, ecx
add eax, r15d
cmp rbx, rdx
jne 0x4082a3
mov dword [rsp + 0xc], eax
cmp r15d, 0xfff1
mov edx, 0x80078071
mov edi, dword [rsp + 0xc]
lea eax, [r15 - 0xfff1]
cmovae r15d, eax
mov eax, dword [rsp + 0xc]
mul edx
shr edx, 0xf
imul eax, edx, 0xfff1
sub edi, eax
mov eax, edi
shl eax, 0x10
or eax, r15d
add rsp, 0x28
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
cmp dword [rsp + 0x80], 0x15af
jbe 0x4085d1
mov eax, dword [rsp + 0x80]
sub eax, 0x15b0
mov dword [rsp + 0x18], eax
lea rax, [rbx + 0x15b0]
mov qword [rsp + 0x10], rax
nop dword [rax]
movzx eax, byte [rbx]
add rbx, 0x10
movzx r14d, byte [rbx - 0xf]
movzx r13d, byte [rbx - 0xe]
movzx r12d, byte [rbx - 0xd]
add eax, r15d
movzx ebp, byte [rbx - 0xc]
add r14d, eax
movzx edi, byte [rbx - 0xb]
add r13d, r14d
movzx esi, byte [rbx - 0xa]
add eax, r14d
movzx r11d, byte [rbx - 9]
add r12d, r13d
add eax, r13d
add ebp, r12d
add eax, r12d
movzx r10d, byte [rbx - 6]
add edi, ebp
add eax, ebp
movzx r9d, byte [rbx - 5]
add esi, edi
add edi, eax
movzx r8d, byte [rbx - 4]
lea edx, [r11 + rsi]
movzx r11d, byte [rbx - 8]
add esi, edi
mov dword [rsp + 4], edx
add esi, dword [rsp + 4]
movzx r15d, byte [rbx - 1]
add r11d, edx
movzx edx, byte [rbx - 2]
mov ecx, r11d
movzx r11d, byte [rbx - 7]
mov dword [rsp + 8], ecx
add esi, dword [rsp + 8]
add r11d, ecx
movzx ecx, byte [rbx - 3]
add r10d, r11d
add r11d, esi
add r9d, r10d
add r10d, r11d
add r8d, r9d
add r9d, r10d
add ecx, r8d
add r8d, r9d
add edx, ecx
add ecx, r8d
add r15d, edx
add edx, ecx
add edx, r15d
add dword [rsp + 0xc], edx
cmp rbx, qword [rsp + 0x10]
jne 0x408330
mov eax, 0x80078071
mov edi, dword [rsp + 0xc]
mul r15d
shr edx, 0xf
imul eax, edx, 0xfff1
sub r15d, eax
mov eax, 0x80078071
mul edi
shr edx, 0xf
imul eax, edx, 0xfff1
sub edi, eax
cmp dword [rsp + 0x18], 0x15af
mov dword [rsp + 0xc], edi
mov eax, dword [rsp + 0x18]
jbe 0x408438
mov dword [rsp + 0x80], eax
jmp 0x408310
test eax, eax
je 0x408580
cmp eax, 0xf
jbe 0x4085e1
mov eax, dword [rsp + 0x18]
sub eax, 0x10
shr eax, 4
mov dword [rsp + 0x1c], eax
add rax, 1
shl rax, 4
add rax, rbx
mov qword [rsp + 0x10], rax
movzx eax, byte [rbx]
add rbx, 0x10
movzx r14d, byte [rbx - 0xf]
movzx r13d, byte [rbx - 0xe]
movzx r12d, byte [rbx - 0xd]
add eax, r15d
movzx ebp, byte [rbx - 0xc]
add r14d, eax
movzx edi, byte [rbx - 0xb]
add r13d, r14d
movzx esi, byte [rbx - 0xa]
add eax, r14d
add r12d, r13d
movzx r11d, byte [rbx - 9]
add eax, r13d
add ebp, r12d
movzx r10d, byte [rbx - 8]
add eax, r12d
add edi, ebp
movzx r9d, byte [rbx - 7]
add eax, ebp
add esi, edi
movzx r8d, byte [rbx - 6]
add eax, edi
movzx edx, byte [rbx - 5]
add r11d, esi
add eax, esi
add r10d, r11d
add eax, r11d
movzx r15d, byte [rbx - 1]
add r9d, r10d
add eax, r10d
add r8d, r9d
add eax, r9d
lea ecx, [rdx + r8]
movzx edx, byte [rbx - 4]
add eax, r8d
mov dword [rsp + 4], ecx
add eax, dword [rsp + 4]
add edx, ecx
movzx ecx, byte [rbx - 3]
mov dword [rsp + 8], edx
add eax, dword [rsp + 8]
add ecx, edx
movzx edx, byte [rbx - 2]
add eax, ecx
add edx, ecx
add r15d, edx
add eax, edx
add eax, r15d
add dword [rsp + 0xc], eax
cmp rbx, qword [rsp + 0x10]
jne 0x408467
mov eax, dword [rsp + 0x1c]
mov edi, dword [rsp + 0x18]
neg eax
shl eax, 4
lea eax, [rdi + rax - 0x11]
and edi, 0xf
je 0x408555
lea rdx, [rbx + rax + 1]
mov eax, dword [rsp + 0xc]
add rbx, 1
movzx ecx, byte [rbx - 1]
add r15d, ecx
add eax, r15d
cmp rbx, rdx
jne 0x40853e
mov dword [rsp + 0xc], eax
mov eax, r15d
mov ecx, 0x80078071
mul ecx
mov eax, edx
shr eax, 0xf
imul eax, eax, 0xfff1
sub r15d, eax
mov eax, dword [rsp + 0xc]
mul ecx
shr edx, 0xf
imul eax, edx, 0xfff1
sub dword [rsp + 0xc], eax
mov eax, dword [rsp + 0xc]
shl eax, 0x10
or eax, r15d
jmp 0x4082ee
movzx eax, byte [rdx]
add r15d, eax
lea eax, [r15 - 0xfff1]
cmp r15d, 0xfff1
cmovae r15d, eax
mov eax, dword [rsp + 0xc]
add eax, r15d
lea edx, [rax - 0xfff1]
cmp eax, 0xfff1
cmovae eax, edx
shl eax, 0x10
or eax, r15d
jmp 0x4082ee
mov eax, 1
jmp 0x4082ee
mov eax, dword [rsp + 0x80]
mov dword [rsp + 0x18], eax
jmp 0x408449
mov eax, dword [rsp + 0x80]
sub eax, 0x15b1
jmp 0x408535