// File: /workspace/github_c_makefile_star2_O3/nkanaev[P]tipsy/src/tigr.c
// Function: tigrLoadImageMem
Tigr* tigrLoadImageMem(const void* data, int length) {
    PNG png;
    png.p = (unsigned char*)data;
    png.end = (unsigned char*)data + length;
    return tigrLoadPng(&png);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movslq %esi, %rax
addq %rdi, %rax
movq %rax, 0x28(%rsp)
movabsq $0xa1a0a0d474e5089, %rax # imm = 0xA1A0A0D474E5089
cmpq %rax, (%rdi)
je 0x4865
callq 0x3050
movl $0x16, (%rax)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdi, %r15
addq $0x8, %r15
leaq 0x20(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x8373(%rip), %rsi      # 0xcbee
movl $0xd, %edx
callq 0x7973
testq %rax, %rax
je 0x4846
movq %rax, %r14
movzbl 0x9(%rax), %ebp
cmpq $0x6, %rbp
ja 0x4846
movzbl 0x8(%r14), %r13d
leaq 0x682d(%rip), %rax      # 0xb0d0
movslq (%rax,%rbp,4), %rcx
addq %rax, %rcx
movl %r13d, %r12d
jmpq *%rcx
leal (%r13,%r13,2), %r12d
jmp 0x48c8
leal (,%r13,2), %r12d
jmp 0x48c8
leal (,%r13,4), %r12d
movl (%r14), %edi
movl 0x4(%r14), %esi
bswapl %edi
incl %edi
bswapl %esi
xorl %edx, %edx
callq 0x38dc
testq %rax, %rax
je 0x4846
movq %rax, %rbx
movq %rbp, 0x30(%rsp)
movslq (%rax), %rax
decq %rax
movl %eax, (%rbx)
cmpl $0x10, %r13d
je 0x4910
cmpb $0x0, 0xa(%r14)
jne 0x4910
cmpb $0x0, 0xb(%r14)
jne 0x4910
cmpb $0x0, 0xc(%r14)
je 0x4928
callq 0x3050
movl $0x16, (%rax)
movq %rbx, %rdi
callq 0x5a5d
jmp 0x4851
movq %rax, (%rsp)
movl %r12d, 0x14(%rsp)
leaq 0x82bb(%rip), %rsi      # 0xcbf3
leaq 0x20(%rsp), %rdi
movq $0x0, 0x18(%rsp)
xorl %edx, %edx
callq 0x7973
testq %rax, %rax
je 0x49af
movq %rax, %r13
xorl %edi, %edi
xorl %ebp, %ebp
movl -0x8(%r13), %r12d
bswapl %r12d
leal (%r12,%rbp), %r14d
movq %r14, %rsi
callq 0x3680
testq %rax, %rax
je 0x49b4
movslq %ebp, %rdi
addq %rax, %rdi
movq %rax, 0x8(%rsp)
movl %r12d, %edx
movq %r13, %rsi
callq 0x32d0
leaq 0x20(%rsp), %rdi
leaq 0x8260(%rip), %rsi      # 0xcbf3
xorl %edx, %edx
callq 0x7973
movq 0x8(%rsp), %rdi
movq %rax, %r13
movl %r14d, %ebp
testq %rax, %rax
movq %r14, %r12
jne 0x4959
jmp 0x49b9
xorl %r12d, %r12d
jmp 0x49b7
movl %ebp, %r12d
xorl %edi, %edi
movq %rdi, %r14
leaq 0x20(%rsp), %r13
movq %r15, (%r13)
leaq 0x822c(%rip), %rsi      # 0xcbf8
movq %r13, %rdi
xorl %edx, %edx
callq 0x7973
movq %rax, %rbp
movq %r15, (%r13)
leaq 0x8219(%rip), %rsi      # 0xcbfd
movq %r13, %rdi
xorl %edx, %edx
callq 0x7973
movq %rax, %r15
testq %rax, %rax
je 0x4a01
movl -0x8(%r15), %eax
bswapl %eax
movq %rax, 0x18(%rsp)
testq %r14, %r14
sete %al
movq %r12, %rdi
cmpl $0x6, %r12d
setl %cl
orb %al, %cl
movl 0x14(%rsp), %r12d
jne 0x4ae9
movq %r14, %rdx
movzbl (%r14), %eax
movl %eax, %ecx
andl $0xf, %ecx
cmpl $0x8, %ecx
setne %cl
andl $-0x10, %eax
cmpl $0x71, %eax
setae %al
orb %cl, %al
jne 0x4b04
testb $0x20, 0x1(%rdx)
jne 0x4b04
movslq 0x4(%rbx), %rax
movq (%rsp), %rdx
leaq 0x1(,%rdx,4), %r13
imulq %rax, %r13
addq 0x18(%rbx), %r13
imull %r12d, %edx
leal 0x7(%rdx), %ecx
testl %edx, %edx
cmovnsl %edx, %ecx
sarl $0x3, %ecx
andl $0x7, %edx
cmpl $0x1, %edx
sbbl $-0x1, %ecx
incl %ecx
movslq %ecx, %rsi
imulq %rax, %rsi
subq %rsi, %r13
leaq 0x2(%r14), %rdx
movq %rdi, %rcx
addl $-0x6, %ecx
movq %r13, %rdi
callq 0x5155
testl %eax, %eax
je 0x4b04
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movl %edi, (%rsp)
movl %esi, 0x8(%rsp)
movl %r12d, %edx
movq %r13, %rcx
callq 0x79bd
testl %eax, %eax
je 0x4b04
cmpb $0x3, 0x30(%rsp)
jne 0x4afe
testq %rbp, %rbp
je 0x4b04
movq 0x18(%rbx), %rcx
movl (%rsp), %edi
movl 0x8(%rsp), %esi
movq %r13, %rdx
movl %r12d, %r8d
movq %rbp, %r9
pushq 0x18(%rsp)
pushq %r15
callq 0x7c79
addq $0x10, %rsp
jmp 0x4b39
callq 0x3050
movl $0x16, (%rax)
testq %r14, %r14
jne 0x4b0f
jmp 0x491b
testb $0x7, %r12b
je 0x4b1c
callq 0x3050
movl $0x16, (%rax)
movq %r14, %rdi
callq 0x3410
jmp 0x491b
shrl $0x3, %r12d
movq 0x18(%rbx), %r8
movl %r12d, %edi
movl (%rsp), %esi
movl 0x8(%rsp), %edx
movq %r13, %rcx
movq %r15, %r9
callq 0x7d6f
movq %r14, %rdi
callq 0x3410
jmp 0x4853