// File: /workspace/github_c_makefile_star2_O3/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 $0x198, %rsp            # imm = 0x198
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)
xorl %ebp, %ebp
movq %r14, %rdi
movl %ebp, %esi
callq 0x55c2
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0x35c0
cmpl $0x1, %eax
jne 0x51d4
movq %rbx, %rdi
callq 0x3410
movl %ebp, %eax
jmp 0x55a1
movq %r15, 0x8(%rsp)
leaq 0x5f0(%r14), %r15
leaq 0xf0(%r14), %rax
movq %rax, 0x28(%rsp)
addq $0x570, %r14            # imm = 0x570
movq %r14, 0x20(%rsp)
movl $0x1, %ebp
leaq 0x780c(%rip), %r12      # 0xca10
movq %rbx, %rdi
movl %ebp, %esi
callq 0x55c2
movl %eax, %r14d
movq %rbx, %rdi
movl $0x2, %esi
callq 0x55c2
cmpl $0x3, %eax
ja 0x558b
movl %eax, %eax
leaq 0x5ebc(%rip), %rcx      # 0xb0ec
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq %r12, %r13
movl %r14d, %r12d
movl 0x4(%rbx), %esi
andl $0x7, %esi
movq %rbx, %rdi
callq 0x55c2
movq %rbx, %rdi
movl $0x10, %esi
callq 0x55c2
movl (%rbx), %ecx
xorl %eax, %ecx
cmpw $-0x1, %cx
jne 0x55b3
movq 0x8(%rbx), %rsi
movslq %eax, %r14
leaq (%rsi,%r14), %rax
cmpq 0x10(%rbx), %rax
ja 0x55b3
movl %r14d, %edx
movq %rbx, %rdi
callq 0x8076
addq %r14, 0x8(%rbx)
movq %rbx, %rdi
movl $0x10, %esi
callq 0x55c2
movl %r12d, %r14d
movq %r13, %r12
jmp 0x558b
leaq 0x50(%rsp), %r12
movq %r12, %rdi
movl $0x8, %esi
movl $0x90, %edx
callq 0x31d0
leaq 0xe0(%rsp), %rax
movaps 0x5d96(%rip), %xmm0     # 0xb060
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 0x5d84(%rip), %xmm0     # 0xb070
movaps %xmm0, 0x70(%rax)
movabsq $0x707070707070707, %rcx # imm = 0x707070707070707
movq %rcx, 0x80(%rax)
movabsq $0x808080808080808, %rax # imm = 0x808080808080808
movq %rax, 0x168(%rsp)
movl %r14d, %r13d
leaq 0x170(%rsp), %r14
movaps 0x5d5b(%rip), %xmm0     # 0xb080
movaps %xmm0, 0x10(%r14)
movaps %xmm0, (%r14)
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
movq %r12, %rdx
leaq 0x76d0(%rip), %r12      # 0xca10
movl $0x120, %ecx            # imm = 0x120
callq 0x80b2
movl %eax, 0x63c(%rbx)
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movq %r14, %rdx
movl %r13d, %r14d
movl $0x20, %ecx
callq 0x80b2
movl %eax, 0x640(%rbx)
movq %rbx, %rdi
callq 0x5631
jmp 0x558b
movl %r14d, 0x1c(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
movl $0x0, 0x3f(%rsp)
movq %rbx, %rdi
movl $0x5, %r14d
movl %r14d, %esi
callq 0x55c2
movl %eax, 0x14(%rsp)
movq %rbx, %rdi
movl %r14d, %esi
callq 0x55c2
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movl $0x4, %esi
callq 0x55c2
cmpl $-0x3, %eax
movl $0x3, %ebp
jl 0x5404
movq %r12, %r14
addl $0x3, %eax
testl %eax, %eax
movl $0x0, %ecx
cmovlel %ecx, %eax
incl %eax
movl %eax, %r12d
movl %ecx, %eax
movq %rax, %r13
movq %rbx, %rdi
movl %ebp, %esi
callq 0x55c2
movsbq (%r13,%r14), %rcx
movb %al, 0x30(%rsp,%rcx)
incq %r13
movq %r13, %rax
cmpq %r13, %r12
jne 0x53e2
movl 0x14(%rsp), %ebp
addl $0x101, %ebp            # imm = 0x101
movl 0x10(%rsp), %r14d
incl %r14d
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
movl $0x13, %ecx
callq 0x80b2
movl %eax, 0x644(%rbx)
movl %r14d, 0x18(%rsp)
addl %ebp, %r14d
jle 0x5536
xorl %r12d, %r12d
movl 0x644(%rbx), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x81a3
cmpl $0x12, %eax
je 0x54e8
cmpl $0x11, %eax
je 0x54ad
cmpl $0x10, %eax
jne 0x5523
movq %rbx, %rdi
movl $0x2, %esi
callq 0x55c2
movl %eax, %edx
addl $0x3, %edx
je 0x552d
movslq %r12d, %rax
addq %rsp, %rax
addq $0x50, %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 0x5495
addl %esi, %r12d
jmp 0x552d
movq %rbx, %rdi
movl $0x3, %esi
callq 0x55c2
movl %eax, %r13d
addl $0x3, %eax
je 0x552d
movslq %r12d, %rcx
leaq (%rsp,%rcx), %rdi
addq $0x50, %rdi
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x31d0
movl %r13d, %eax
movl %r12d, %ecx
leal (%rcx,%rax), %r12d
addl $0x3, %r12d
jmp 0x552d
movq %rbx, %rdi
movl $0x7, %esi
callq 0x55c2
movl %eax, %r13d
addl $0xb, %eax
je 0x552d
movslq %r12d, %r12
leaq (%rsp,%r12), %rdi
addq $0x50, %rdi
movl %eax, %eax
movl %eax, %edx
xorl %esi, %esi
callq 0x31d0
movl %r13d, %eax
movl %r12d, %ecx
leal (%rcx,%rax), %r12d
addl $0xb, %r12d
jmp 0x552d
movslq %r12d, %rcx
incl %r12d
movb %al, 0x50(%rsp,%rcx)
cmpl %r14d, %r12d
jl 0x5442
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movl %ebp, %ecx
callq 0x80b2
movl %eax, 0x63c(%rbx)
movslq %ebp, %rax
leaq (%rsp,%rax), %rdx
addq $0x50, %rdx
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
movl 0x18(%rsp), %ecx
callq 0x80b2
movl %eax, 0x640(%rbx)
movq %rbx, %rdi
callq 0x5631
movl $0x1, %ebp
leaq 0x748a(%rip), %r12      # 0xca10
movl 0x1c(%rsp), %r14d
testl %r14d, %r14d
je 0x5204
movq %rbx, %rdi
callq 0x3410
movl $0x1, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x8(%rsp), %rdi
movl $0x1, %esi
callq 0x3100