// File: /workspace/github_c_makefile_star2_O0/genometools[P]genometools/src/external/bzip2-1.0.6/bzlib.c
// Function: handle_compress
static
Bool handle_compress ( bz_stream* strm )
{
   Bool progress_in  = False;
   Bool progress_out = False;
   EState* s = strm->state;
   
   while (True) {

      if (s->state == BZ_S_OUTPUT) {
         progress_out |= copy_output_until_stop ( s );
         if (s->state_out_pos < s->numZ) break;
         if (s->mode == BZ_M_FINISHING && 
             s->avail_in_expect == 0 &&
             isempty_RL(s)) break;
         prepare_new_block ( s );
         s->state = BZ_S_INPUT;
         if (s->mode == BZ_M_FLUSHING && 
             s->avail_in_expect == 0 &&
             isempty_RL(s)) break;
      }

      if (s->state == BZ_S_INPUT) {
         progress_in |= copy_input_until_stop ( s );
         if (s->mode != BZ_M_RUNNING && s->avail_in_expect == 0) {
            flush_RL ( s );
            BZ2_compressBlock ( s, (Bool)(s->mode == BZ_M_FINISHING) );
            s->state = BZ_S_OUTPUT;
         }
         else
         if (s->nblock >= s->nblockMAX) {
            BZ2_compressBlock ( s, False );
            s->state = BZ_S_OUTPUT;
         }
         else
         if (s->strm->avail_in == 0) {
            break;
         }
      }

   }

   return progress_in || progress_out;
}

// Assembly:
subq $0x28, %rsp
movq %rdi, 0x20(%rsp)
movb $0x0, 0x1f(%rsp)
movb $0x0, 0x1e(%rsp)
movq 0x20(%rsp), %rax
movq 0x30(%rax), %rax
movq %rax, 0x10(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x1, 0xc(%rax)
jne 0xc8381
movq 0x10(%rsp), %rdi
callq 0xcbfd0
movzbl %al, %ecx
movzbl 0x1e(%rsp), %eax
orl %ecx, %eax
movb %al, 0x1e(%rsp)
movq 0x10(%rsp), %rax
movl 0x78(%rax), %eax
movq 0x10(%rsp), %rcx
cmpl 0x74(%rcx), %eax
jge 0xc830f
jmp 0xc843b
movq 0x10(%rsp), %rax
cmpl $0x4, 0x8(%rax)
jne 0xc833c
movq 0x10(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0xc833c
movq 0x10(%rsp), %rdi
callq 0xc8470
movzbl %al, %eax
cmpl $0x0, %eax
je 0xc833c
jmp 0xc843b
movq 0x10(%rsp), %rdi
callq 0xc7fc0
movq 0x10(%rsp), %rax
movl $0x2, 0xc(%rax)
movq 0x10(%rsp), %rax
cmpl $0x3, 0x8(%rax)
jne 0xc837f
movq 0x10(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0xc837f
movq 0x10(%rsp), %rdi
callq 0xc8470
movzbl %al, %eax
cmpl $0x0, %eax
je 0xc837f
jmp 0xc843b
jmp 0xc8381
movq 0x10(%rsp), %rax
cmpl $0x2, 0xc(%rax)
jne 0xc8436
movq 0x10(%rsp), %rdi
callq 0xcc0a0
movzbl %al, %ecx
movzbl 0x1f(%rsp), %eax
orl %ecx, %eax
movb %al, 0x1f(%rsp)
movq 0x10(%rsp), %rax
cmpl $0x2, 0x8(%rax)
je 0xc83f4
movq 0x10(%rsp), %rax
cmpl $0x0, 0x10(%rax)
jne 0xc83f4
movq 0x10(%rsp), %rdi
callq 0xcc450
movq 0x10(%rsp), %rdi
movq 0x10(%rsp), %rax
cmpl $0x4, 0x8(%rax)
sete %al
andb $0x1, %al
movzbl %al, %eax
movzbl %al, %esi
callq 0xfc440
movq 0x10(%rsp), %rax
movl $0x1, 0xc(%rax)
jmp 0xc8434
movq 0x10(%rsp), %rax
movl 0x6c(%rax), %eax
movq 0x10(%rsp), %rcx
cmpl 0x70(%rcx), %eax
jl 0xc8420
movq 0x10(%rsp), %rdi
xorl %esi, %esi
callq 0xfc440
movq 0x10(%rsp), %rax
movl $0x1, 0xc(%rax)
jmp 0xc8432
movq 0x10(%rsp), %rax
movq (%rax), %rax
cmpl $0x0, 0x8(%rax)
jne 0xc8430
jmp 0xc843b
jmp 0xc8432
jmp 0xc8434
jmp 0xc8436
jmp 0xc82d1
movzbl 0x1f(%rsp), %ecx
movb $0x1, %al
cmpl $0x0, %ecx
movb %al, 0xf(%rsp)
jne 0xc845a
movzbl 0x1e(%rsp), %eax
cmpl $0x0, %eax
setne %al
movb %al, 0xf(%rsp)
movb 0xf(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
addq $0x28, %rsp
retq
nopl (%rax,%rax)