// File: /workspace/github_c_makefile_star2_O2/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
pushq $0x1
popq %rdi
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 0x56d8
leaq 0x28(%r14), %r15
movq %r15, %rdi
callq 0x35e0
cmpl $0x1, %eax
je 0x56af
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)
pushq $0x1
popq %rbp
pushq $0x3
popq %r12
movq %rbx, %rdi
movl %ebp, %esi
callq 0x56d8
movl %eax, %r14d
movq %rbx, %rdi
pushq $0x2
popq %rsi
callq 0x56d8
cmpl $0x3, %eax
ja 0x56a6
movl %eax, %eax
leaq 0x4ca1(%rip), %rcx      # 0xa060
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl %r14d, %r13d
movl 0x4(%rbx), %esi
andl $0x7, %esi
movq %rbx, %rdi
callq 0x56d8
movq %rbx, %rdi
pushq $0x10
popq %rsi
callq 0x56d8
movl (%rbx), %ecx
xorl %eax, %ecx
cmpw $-0x1, %cx
jne 0x56cb
movq 0x8(%rbx), %rsi
movslq %eax, %r14
leaq (%rsi,%r14), %rax
cmpq 0x10(%rbx), %rax
ja 0x56cb
movl %r14d, %edx
movq %rbx, %rdi
callq 0x7878
addq %r14, 0x8(%rbx)
movq %rbx, %rdi
pushq $0x10
popq %rsi
callq 0x56d8
movl %r13d, %r14d
jmp 0x56a6
xorl %eax, %eax
cmpq $0x90, %rax
je 0x543d
movb $0x8, 0x50(%rsp,%rax)
incq %rax
jmp 0x542b
movl $0x90, %eax
cmpq $0x100, %rax            # imm = 0x100
je 0x5454
movb $0x9, 0x50(%rsp,%rax)
incq %rax
jmp 0x5442
movl $0x100, %eax            # imm = 0x100
cmpq $0x118, %rax            # imm = 0x118
je 0x546b
movb $0x7, 0x50(%rsp,%rax)
incq %rax
jmp 0x5459
movl $0x118, %eax            # imm = 0x118
cmpq $0x120, %rax            # imm = 0x120
je 0x5482
movb $0x8, 0x50(%rsp,%rax)
incq %rax
jmp 0x5470
movl $0x120, %eax            # imm = 0x120
cmpq $0x140, %rax            # imm = 0x140
je 0x5499
movb $0x5, 0x50(%rsp,%rax)
incq %rax
jmp 0x5487
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movl $0x120, %ecx            # imm = 0x120
callq 0x78c5
movl %eax, 0x63c(%rbx)
movq %rbx, %rdi
movq 0x20(%rsp), %rsi
leaq 0x170(%rsp), %rdx
pushq $0x20
popq %rcx
callq 0x78c5
movl %eax, 0x640(%rbx)
movq %rbx, %rdi
callq 0x572c
jmp 0x56a6
movl %r14d, 0x1c(%rsp)
xorps %xmm0, %xmm0
movaps %xmm0, 0x30(%rsp)
andl $0x0, 0x3f(%rsp)
movq %rbx, %rdi
pushq $0x5
popq %rbp
movl %ebp, %esi
callq 0x56d8
movl %eax, 0x10(%rsp)
movq %rbx, %rdi
movl %ebp, %esi
callq 0x56d8
movl %eax, %ebp
movq %rbx, %rdi
pushq $0x4
popq %rsi
callq 0x56d8
cmpl $-0x3, %eax
pushq $-0x4
popq %rcx
cmovll %ecx, %eax
addl $0x4, %eax
movl %eax, %r13d
xorl %eax, %eax
movl %eax, %r14d
cmpq %r14, %r13
je 0x5554
movq %rbx, %rdi
movl %r12d, %esi
callq 0x56d8
leaq 0x641a(%rip), %rcx      # 0xb960
movsbq (%r14,%rcx), %rcx
movb %al, 0x30(%rsp,%rcx)
incq %r14
jmp 0x552f
movl 0x10(%rsp), %r14d
movl %r14d, %eax
addl $0x101, %eax            # imm = 0x101
movl %eax, 0x14(%rsp)
movl %ebp, %eax
incl %eax
movl %eax, 0x18(%rsp)
movq %rbx, %rdi
movq %r15, %rsi
leaq 0x30(%rsp), %rdx
pushq $0x13
popq %rcx
callq 0x78c5
movl %eax, 0x644(%rbx)
movl %r14d, %eax
movl %ebp, %ecx
leal (%rcx,%rax), %ebp
addl $0x102, %ebp            # imm = 0x102
xorl %r14d, %r14d
cmpl %ebp, %r14d
jge 0x5656
movl 0x644(%rbx), %edx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x79b8
movslq %r14d, %r13
cmpl $0x12, %eax
je 0x561a
cmpl $0x11, %eax
je 0x55f3
cmpl $0x10, %eax
jne 0x5649
movq %rbx, %rdi
pushq $0x2
popq %rsi
callq 0x56d8
movl %eax, %ecx
addl $0x3, %ecx
leaq (%rsp,%r13), %rax
addq $0x50, %rax
xorl %edx, %edx
cmpl %edx, %ecx
je 0x5641
movb -0x1(%rax,%rdx), %sil
movb %sil, (%rax,%rdx)
incq %rdx
jmp 0x55e1
movq %rbx, %rdi
movl %r12d, %esi
callq 0x56d8
movl %eax, %ecx
addl $0x3, %ecx
leaq (%rsp,%r13), %rax
addq $0x50, %rax
xorl %edx, %edx
cmpl %edx, %ecx
je 0x5641
movb $0x0, (%rax,%rdx)
incq %rdx
jmp 0x560d
movq %rbx, %rdi
pushq $0x7
popq %rsi
callq 0x56d8
movl %eax, %ecx
addl $0xb, %ecx
leaq (%rsp,%r13), %rax
addq $0x50, %rax
xorl %edx, %edx
cmpl %edx, %ecx
je 0x5641
movb $0x0, (%rax,%rdx)
incq %rdx
jmp 0x5634
addl %edx, %r14d
jmp 0x5597
incl %r14d
movb %al, 0x50(%rsp,%r13)
jmp 0x5597
movq %rbx, %rdi
movq 0x28(%rsp), %rsi
leaq 0x50(%rsp), %rdx
movl 0x14(%rsp), %ebp
movl %ebp, %ecx
callq 0x78c5
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 0x78c5
movl %eax, 0x640(%rbx)
movq %rbx, %rdi
callq 0x572c
pushq $0x1
popq %rbp
movl 0x1c(%rsp), %r14d
testl %r14d, %r14d
je 0x5395
movq %rbx, %rdi
callq 0x3430
movl %ebp, %eax
addq $0x198, %rsp            # imm = 0x198
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x1
popq %rsi
movq 0x8(%rsp), %rdi
callq 0x3100