Function at 0x408290
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
shr eax, 0x10
cmp r8d, 1
movzx esi, cx
mov dword [rsp + 0xc], eax
je 0x4085f6
test rdx, rdx
je 0x408628
cmp dword [rsp + 0x80], 0xf
ja 0x408348
mov eax, dword [rsp + 0x80]
mov edx, dword [rsp + 0x80]
sub eax, 1
test edx, edx
je 0x408307
lea rdx, [rbx + rax + 1]
mov eax, dword [rsp + 0xc]
add rbx, 1
movzx ecx, byte [rbx - 1]
add esi, ecx
add eax, esi
cmp rbx, rdx
jne 0x4082f2
mov dword [rsp + 0xc], eax
lea eax, [rsi - 0xfff1]
cmp esi, 0xfff1
mov edx, 0x80078071
mov ecx, dword [rsp + 0xc]
cmovae esi, eax
mov eax, dword [rsp + 0xc]
mul edx
shr edx, 0xf
imul eax, edx, 0xfff1
sub ecx, eax
mov eax, ecx
shl eax, 0x10
or eax, esi
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
mov r15d, esi
jbe 0x408632
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 + rax]
movzx r14d, byte [rbx]
movzx r13d, byte [rbx + 1]
add rbx, 0x10
movzx r12d, byte [rbx - 0xe]
movzx ebp, byte [rbx - 0xd]
movzx edi, byte [rbx - 0xc]
movzx esi, byte [rbx - 0xb]
movzx r11d, byte [rbx - 0xa]
movzx r10d, byte [rbx - 9]
add r14d, r15d
movzx r9d, byte [rbx - 6]
movzx r8d, byte [rbx - 5]
add r13d, r14d
movzx ecx, byte [rbx - 4]
movzx edx, byte [rbx - 3]
add r12d, r13d
add r13d, r14d
movzx r15d, byte [rbx - 1]
add ebp, r12d
add r13d, r12d
add edi, ebp
add r13d, ebp
add esi, edi
add r13d, edi
add r11d, esi
add esi, r13d
lea eax, [r10 + r11]
movzx r10d, byte [rbx - 8]
add r11d, esi
mov dword [rsp + 4], eax
add r11d, dword [rsp + 4]
add r10d, eax
mov eax, r10d
movzx r10d, byte [rbx - 7]
mov dword [rsp + 8], eax
add r11d, dword [rsp + 8]
add r10d, eax
movzx eax, byte [rbx - 2]
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 eax, edx
add edx, ecx
add r15d, eax
add eax, edx
add eax, r15d
add dword [rsp + 0xc], eax
cmp rbx, qword [rsp + 0x10]
jne 0x408380
mov eax, 0x80078071
mov ecx, dword [rsp + 0xc]
mul r15d
shr edx, 0xf
imul eax, edx, 0xfff1
sub r15d, eax
mov eax, 0x80078071
mul ecx
shr edx, 0xf
imul eax, edx, 0xfff1
sub ecx, eax
cmp dword [rsp + 0x18], 0x15af
mov dword [rsp + 0xc], ecx
jbe 0x40848b
mov eax, dword [rsp + 0x18]
mov dword [rsp + 0x80], eax
jmp 0x40835c
mov eax, dword [rsp + 0x18]
mov esi, r15d
test eax, eax
je 0x4085e8
cmp eax, 0xf
jbe 0x408647
mov eax, dword [rsp + 0x18]
mov rcx, qword [rsp + 0x10]
sub eax, 0x10
shr eax, 4
mov dword [rsp + 0x1c], eax
add rax, 1
shl rax, 4
lea r15, [rcx + rax]
mov rax, rcx
mov qword [rsp + 0x10], r15
movzx r15d, byte [rax]
movzx r14d, byte [rax + 1]
add rax, 0x10
movzx r13d, byte [rax - 0xe]
movzx r12d, byte [rax - 0xd]
movzx ebp, byte [rax - 0xc]
movzx edi, byte [rax - 0xb]
movzx ebx, byte [rax - 0xa]
movzx r11d, byte [rax - 9]
add r15d, esi
movzx r10d, byte [rax - 8]
movzx r9d, byte [rax - 7]
add r14d, r15d
movzx r8d, byte [rax - 6]
movzx edx, byte [rax - 5]
add r13d, r14d
add r14d, r15d
movzx esi, byte [rax - 1]
add r12d, r13d
add r14d, r13d
add ebp, r12d
add r14d, r12d
add edi, ebp
add r14d, ebp
add ebx, edi
add edi, r14d
add r11d, ebx
add ebx, edi
add r10d, r11d
add r11d, ebx
add r9d, r10d
add r10d, r11d
add r8d, r9d
add r9d, r10d
lea ecx, [rdx + r8]
movzx edx, byte [rax - 4]
add r8d, r9d
mov dword [rsp + 4], ecx
add r8d, dword [rsp + 4]
add edx, ecx
movzx ecx, byte [rax - 3]
mov dword [rsp + 8], edx
add r8d, dword [rsp + 8]
add ecx, edx
movzx edx, byte [rax - 2]
add edx, ecx
add ecx, r8d
add esi, edx
add edx, ecx
add edx, esi
add dword [rsp + 0xc], edx
cmp rax, qword [rsp + 0x10]
jne 0x4084ca
mov eax, dword [rsp + 0x1c]
mov ecx, dword [rsp + 0x18]
mov r15, qword [rsp + 0x10]
neg eax
shl eax, 4
lea eax, [rcx + rax - 0x11]
and ecx, 0xf
je 0x4085bf
lea rdx, [r15 + rax + 1]
mov eax, dword [rsp + 0xc]
add r15, 1
movzx ecx, byte [r15 - 1]
add esi, ecx
add eax, esi
cmp r15, rdx
jne 0x4085a9
mov dword [rsp + 0xc], eax
mov eax, esi
mov ecx, 0x80078071
mul ecx
mov eax, edx
shr eax, 0xf
imul eax, eax, 0xfff1
sub esi, 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, esi
jmp 0x408337
movzx eax, byte [rdx]
add eax, esi
lea edx, [rax - 0xfff1]
cmp eax, 0xfff1
cmovae eax, edx
mov edx, dword [rsp + 0xc]
add edx, eax
lea ecx, [rdx - 0xfff1]
cmp edx, 0xfff1
cmovae edx, ecx
shl edx, 0x10
or eax, edx
jmp 0x408337
mov eax, 1
jmp 0x408337
mov eax, dword [rsp + 0x80]
mov qword [rsp + 0x10], rdx
mov dword [rsp + 0x18], eax
jmp 0x4084a3
mov eax, dword [rsp + 0x80]
mov r15, rbx
sub eax, 0x15b1
jmp 0x4085a0