// File: /workspace/github_c_makefile_star2_O1/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
movq %rdi, 0x18(%rsp)
movslq %esi, %rax
addq %rdi, %rax
movq %rax, 0x20(%rsp)
movabsq $0xa1a0a0d474e5089, %rax # imm = 0xA1A0A0D474E5089
cmpq %rax, (%rdi)
je 0x4781
xorl %r14d, %r14d
xorl %ebx, %ebx
callq 0x3050
movl $0x16, (%rax)
testq %r14, %r14
je 0x4760
movq %r14, %rdi
callq 0x3410
testq %rbx, %rbx
je 0x476d
movq %rbx, %rdi
callq 0x5937
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 0x18(%rsp), %rdi
movq %r15, (%rdi)
leaq 0x840f(%rip), %rsi      # 0xcba6
movl $0xd, %edx
callq 0x7838
testq %rax, %rax
je 0x4743
movq %rax, %r13
movzbl 0x9(%rax), %edx
xorl %r14d, %r14d
cmpq $0x6, %rdx
ja 0x4746
movzbl 0x8(%r13), %ebp
leaq 0x685e(%rip), %rax      # 0xb020
movslq (%rax,%rdx,4), %rcx
addq %rax, %rcx
movl %ebp, %r12d
xorl %ebx, %ebx
jmpq *%rcx
leal (%rbp,%rbp,2), %r12d
jmp 0x47e9
leal (,%rbp,2), %r12d
jmp 0x47e9
leal (,%rbp,4), %r12d
movq %rdx, 0x30(%rsp)
movl (%r13), %edi
movl 0x4(%r13), %esi
bswapl %edi
incl %edi
bswapl %esi
xorl %r14d, %r14d
xorl %edx, %edx
callq 0x38ec
testq %rax, %rax
je 0x4746
movq %rax, %rbx
movl %r12d, 0xc(%rsp)
movslq (%rax), %r12
decq %r12
movl %r12d, (%rax)
cmpl $0x10, %ebp
je 0x483a
cmpb $0x0, 0xa(%r13)
jne 0x483a
cmpb $0x0, 0xb(%r13)
jne 0x483a
cmpb $0x0, 0xc(%r13)
je 0x4842
xorl %r14d, %r14d
jmp 0x4748
leaq 0x8362(%rip), %rsi      # 0xcbab
leaq 0x18(%rsp), %rdi
xorl %edx, %edx
callq 0x7838
testq %rax, %rax
je 0x48c6
movq %rax, %r13
xorl %r14d, %r14d
movq $0x0, (%rsp)
movl -0x8(%r13), %ebp
bswapl %ebp
movq (%rsp), %rax
leal (%rax,%rbp), %esi
movq %r14, %rdi
movq %rsi, 0x10(%rsp)
callq 0x3680
movq %rax, %r14
testq %rax, %rax
je 0x48a4
movslq (%rsp), %rdi
addq %r14, %rdi
movl %ebp, %edx
movq %r13, %rsi
callq 0x32d0
movq 0x10(%rsp), %rax
movq %rax, (%rsp)
testq %r14, %r14
je 0x48d1
leaq 0x18(%rsp), %rdi
leaq 0x82f6(%rip), %rsi      # 0xcbab
xorl %edx, %edx
callq 0x7838
movq %rax, %r13
testq %rax, %rax
jne 0x4868
jmp 0x48d1
movq $0x0, (%rsp)
xorl %r14d, %r14d
leaq 0x18(%rsp), %r13
movq %r15, (%r13)
leaq 0x82cf(%rip), %rsi      # 0xcbb0
xorl %ebp, %ebp
movq %r13, %rdi
xorl %edx, %edx
callq 0x7838
movq %rax, 0x10(%rsp)
movq %r15, (%r13)
leaq 0x82b8(%rip), %rsi      # 0xcbb5
movq %r13, %rdi
xorl %edx, %edx
callq 0x7838
movq %rax, %r15
testq %rax, %rax
je 0x4915
movl -0x8(%r15), %ebp
bswapl %ebp
testq %r14, %r14
sete %al
cmpl $0x6, (%rsp)
setl %cl
orb %al, %cl
jne 0x4748
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 0x4748
testb $0x20, 0x1(%r14)
jne 0x4748
movq %rbp, 0x28(%rsp)
leaq 0x1(,%r12,4), %r13
movslq 0x4(%rbx), %rax
imulq %rax, %r13
addq 0x18(%rbx), %r13
movl 0xc(%rsp), %ebp
imull %ebp, %r12d
leal 0x7(%r12), %ecx
testl %r12d, %r12d
cmovnsl %r12d, %ecx
sarl $0x3, %ecx
andl $0x7, %r12d
cmpl $0x1, %r12d
sbbl $-0x1, %ecx
incl %ecx
movslq %ecx, %rsi
imulq %rax, %rsi
subq %rsi, %r13
leaq 0x2(%r14), %rdx
movq (%rsp), %rcx
addl $-0x6, %ecx
movq %r13, %rdi
callq 0x5059
testl %eax, %eax
je 0x4748
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movl %ebp, %edx
movq %r13, %rcx
callq 0x7894
testl %eax, %eax
je 0x4748
cmpb $0x3, 0x30(%rsp)
jne 0x4a03
movq 0x10(%rsp), %r9
testq %r9, %r9
je 0x4748
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movq 0x18(%rbx), %rcx
movq %r13, %rdx
movl %ebp, %r8d
pushq 0x28(%rsp)
pushq %r15
callq 0x7b0a
addq $0x10, %rsp
jmp 0x4a28
testb $0x7, %bpl
jne 0x4748
movl 0xc(%rsp), %edi
shrl $0x3, %edi
movl (%rbx), %esi
movl 0x4(%rbx), %edx
movq 0x18(%rbx), %r8
movq %r13, %rcx
movq %r15, %r9
callq 0x7c00
movq %r14, %rdi
callq 0x3410
jmp 0x476f