// File: /workspace/github_c_makefile_star2_O1/nkanaev[P]tipsy/src/tigr.c
// Function: tigrInflate
int tigrInflate(void* out, unsigned outlen, const void* in, unsigned inlen) {
    int last;
    State* s = (State*)calloc(1, sizeof(State));

    // We assume we can buffer 2 extra bytes from off the end of 'in'.
    s->in = (unsigned char*)in;
    s->inend = s->in + inlen + 2;
    s->out = (unsigned char*)out;
    s->outend = s->out + outlen;
    s->bits = 0;
    s->count = 0;
    bits(s, 0);

    if (setjmp(s->jmp) == 1) {
        free(s);
        return 0;
    }

    do {
        last = bits(s, 1);
        switch (bits(s, 2)) {
            case 0:
                stored(s);
                break;
            case 1:
                fixed(s);
                block(s);
                break;
            case 2:
                dynamic(s);
                block(s);
                break;
            case 3:
                FAIL();
        }
    } while (!last);

    free(s);
    return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1a8, %rsp            # imm = 0x1A8
movl %ecx, %ebp
movq %rdx, %r15
movl %esi, %r12d
movq %rdi, %r13
movl $0x1, %edi
movl $0x648, %esi            # imm = 0x648
callq 0x3270
movq %rax, %r14
movq %rax, %rbx
movq %r15, 0x8(%rax)
movl %ebp, %ebp
movl %ebp, %eax
leaq 0x2(%r15,%rax), %rax
movq %rax, 0x10(%r14)
movq %r13, 0x18(%r14)
movl %r12d, %r12d
movl %r12d, %eax
addq %r13, %rax
movq %rax, 0x20(%r14)
movq $0x0, (%r14)
xorl %ebp, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x54af
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0x35c0
cmpl $0x1, %eax
je 0x5484
movq %r15, 0x8(%rsp)
leaq 0x5f0(%r14), %r15
leaq 0xf0(%r14), %rax
movq %rax, 0x38(%rsp)
movq %rax, 0x30(%rsp)
addq $0x570, %r14            # imm = 0x570
movq %r14, 0x28(%rsp)
movq %r14, 0x20(%rsp)
movl $0x1, %ebp
leaq 0x5f2e(%rip), %r12      # 0xb03c
leaq 0x784b(%rip), %r13      # 0xc960
movq %rbx, %rdi
movl %ebp, %esi
callq 0x54af
movl %eax, 0x1c(%rsp)
movq %rbx, %rdi
movl $0x2, %esi
callq 0x54af
cmpl $0x3, %eax
ja 0x5474
movl %eax, %eax
movslq (%r12,%rax,4), %rax
addq %r12, %rax
jmpq *%rax
movl 0x4(%rbx), %esi
andl $0x7, %esi
movq %rbx, %rdi
callq 0x54af
movq %rbx, %rdi
movl $0x10, %esi
callq 0x54af
movl (%rbx), %ecx
xorl %eax, %ecx
cmpw $-0x1, %cx
jne 0x54a0
movq 0x8(%rbx), %rsi
movslq %eax, %r14
leaq (%rsi,%r14), %rax
cmpq 0x10(%rbx), %rax
ja 0x54a0
movl %r14d, %edx
movq %rbx, %rdi
callq 0x7f09
addq %r14, 0x8(%rbx)
movq %rbx, %rdi
movl $0x10, %esi
callq 0x54af
jmp 0x5474
leaq 0x60(%rsp), %r13
movq %r13, %rdi
movl $0x8, %esi
movl $0x90, %edx
callq 0x31d0
leaq 0xf0(%rsp), %rax
movaps 0x77c7(%rip), %xmm0     # 0xc990
movaps %xmm0, (%rax)
movaps %xmm0, 0x10(%rax)
movaps %xmm0, 0x20(%rax)
movaps %xmm0, 0x30(%rax)
movaps %xmm0, 0x40(%rax)
movaps %xmm0, 0x50(%rax)
movaps %xmm0, 0x60(%rax)
movaps 0x77b5(%rip), %xmm0     # 0xc9a0
movaps %xmm0, 0x70(%rax)
movabsq $0x707070707070707, %rcx # imm = 0x707070707070707
movq %rcx, 0x80(%rax)
movabsq $0x808080808080808, %rax # imm = 0x808080808080808
movq %rax, 0x178(%rsp)
leaq 0x180(%rsp), %r14
movaps 0x778f(%rip), %xmm0     # 0xc9b0
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq %rbx, %rdi
movq 0x38(%rsp), %rsi
movq %r13, %rdx
leaq 0x7724(%rip), %r13      # 0xc960
movl $0x120, %ecx            # imm = 0x120
callq 0x7f45
movl %eax, 0x63c(%rbx)
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
movq %r14, %rdx
movl $0x20, %ecx
callq 0x7f45
movl %eax, 0x640(%rbx)
movq %rbx, %rdi
callq 0x551b
jmp 0x5474
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movl $0x0, 0x4f(%rsp)
movq %rbx, %rdi
movl $0x5, %ebp
movl %ebp, %esi
callq 0x54af
movl $0x3, %r12d
movl %eax, 0x14(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x54af
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movl $0x4, %esi
callq 0x54af
cmpl $-0x3, %eax
jl 0x52f4
addl $0x3, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
incl %eax
movl %eax, %r14d
movl %ecx, %eax
movq %rax, %rbp
movq %rbx, %rdi
movl %r12d, %esi
callq 0x54af
movsbq (%rbp,%r13), %rcx
movb %al, 0x40(%rsp,%rcx)
incq %rbp
movq %rbp, %rax
cmpq %rbp, %r14
jne 0x52d1
movl 0x14(%rsp), %r13d
addl $0x101, %r13d           # imm = 0x101
movl 0x10(%rsp), %r12d
incl %r12d
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x40(%rsp), %rdx
movl $0x13, %ecx
callq 0x7f45
movl %eax, 0x644(%rbx)
movl %r12d, 0x18(%rsp)
addl %r13d, %r12d
jle 0x541c
xorl %ebp, %ebp
movl 0x644(%rbx), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x8043
cmpl $0x12, %eax
je 0x53d2
cmpl $0x11, %eax
je 0x539a
cmpl $0x10, %eax
jne 0x540a
movq %rbx, %rdi
movl $0x2, %esi
callq 0x54af
movl %eax, %edx
addl $0x3, %edx
je 0x5413
movslq %ebp, %rax
addq %rsp, %rax
addq $0x60, %rax
movb -0x1(%rax), %cl
movl %edx, %edx
xorl %esi, %esi
movl %esi, %edi
movq %rdi, %rsi
movb %cl, (%rax,%rdi)
incq %rsi
movq %rsi, %rdi
cmpl %esi, %edx
jne 0x5386
addl %esi, %ebp
jmp 0x5413
movq %rbx, %rdi
movl $0x3, %esi
callq 0x54af
movl %eax, %r14d
addl $0x3, %eax
je 0x5413
movslq %ebp, %rcx
leaq (%rsp,%rcx), %rdi
addq $0x60, %rdi
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x31d0
movl %r14d, %eax
movl %ebp, %ecx
leal (%rcx,%rax), %ebp
addl $0x3, %ebp
jmp 0x5413
movq %rbx, %rdi
movl $0x7, %esi
callq 0x54af
movl %eax, %r14d
addl $0xb, %eax
je 0x5413
movslq %ebp, %rbp
leaq (%rsp,%rbp), %rdi
addq $0x60, %rdi
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x31d0
movl %r14d, %eax
movl %ebp, %ecx
leal (%rcx,%rax), %ebp
addl $0xb, %ebp
jmp 0x5413
movslq %ebp, %rcx
incl %ebp
movb %al, 0x60(%rsp,%rcx)
cmpl %r12d, %ebp
jl 0x5333
movq %rbx, %rdi
movq 0x30(%rsp), %rsi
leaq 0x60(%rsp), %rdx
movl %r13d, %ecx
callq 0x7f45
movl %eax, 0x63c(%rbx)
movslq %r13d, %rax
leaq (%rsp,%rax), %rdx
addq $0x60, %rdx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movl 0x18(%rsp), %ecx
callq 0x7f45
movl %eax, 0x640(%rbx)
movq %rbx, %rdi
callq 0x551b
movl $0x1, %ebp
leaq 0x5bcf(%rip), %r12      # 0xb03c
leaq 0x74ec(%rip), %r13      # 0xc960
cmpl $0x0, 0x1c(%rsp)
je 0x5115
movl $0x1, %ebp
movq %rbx, %rdi
callq 0x3410
movl %ebp, %eax
addq $0x1a8, %rsp            # imm = 0x1A8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x3100