// File: /workspace/github_c_makefile_star2_O0/coapp-packages[P]bzip2/bzip2.c
// Function: testStream
static 
Bool testStream ( FILE *zStream )
{
   BZFILE* bzf = NULL;
   Int32   bzerr, bzerr_dummy, ret, nread, streamNo, i;
   UChar   obuf[5000];
   UChar   unused[BZ_MAX_UNUSED];
   Int32   nUnused;
   void*   unusedTmpV;
   UChar*  unusedTmp;

   nUnused = 0;
   streamNo = 0;

   SET_BINARY_MODE(zStream);
   if (ferror(zStream)) goto errhandler_io;

   while (True) {

      bzf = BZ2_bzReadOpen ( 
               &bzerr, zStream, verbosity, 
               (int)smallMode, unused, nUnused
            );
      if (bzf == NULL || bzerr != BZ_OK) goto errhandler;
      streamNo++;

      while (bzerr == BZ_OK) {
         nread = BZ2_bzRead ( &bzerr, bzf, obuf, 5000 );
         if (bzerr == BZ_DATA_ERROR_MAGIC) goto errhandler;
      }
      if (bzerr != BZ_STREAM_END) goto errhandler;

      BZ2_bzReadGetUnused ( &bzerr, bzf, &unusedTmpV, &nUnused );
      if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );

      unusedTmp = (UChar*)unusedTmpV;
      for (i = 0; i < nUnused; i++) unused[i] = unusedTmp[i];

      BZ2_bzReadClose ( &bzerr, bzf );
      if (bzerr != BZ_OK) panic ( "test:bzReadGetUnused" );
      if (nUnused == 0 && myfeof(zStream)) break;

   }

   if (ferror(zStream)) goto errhandler_io;
   ret = fclose ( zStream );
   if (ret == EOF) goto errhandler_io;

   if (verbosity >= 2) fprintf ( stderr, "\n    " );
   return True;

   errhandler:
   BZ2_bzReadClose ( &bzerr_dummy, bzf );
   if (verbosity == 0) 
      fprintf ( stderr, "%s: %s: ", progName, inName );
   switch (bzerr) {
      case BZ_CONFIG_ERROR:
         configError(); break;
      case BZ_IO_ERROR:
         errhandler_io:
         ioError(); break;
      case BZ_DATA_ERROR:
         fprintf ( stderr,
                   "data integrity (CRC) error in data\n" );
         return False;
      case BZ_MEM_ERROR:
         outOfMemory();
      case BZ_UNEXPECTED_EOF:
         fprintf ( stderr,
                   "file ends unexpectedly\n" );
         return False;
      case BZ_DATA_ERROR_MAGIC:
         if (zStream != stdin) fclose(zStream);
         if (streamNo == 1) {
          fprintf ( stderr, 
                    "bad magic number (file not created by bzip2)\n" );
            return False;
         } else {
            if (noisy)
            fprintf ( stderr, 
                      "trailing garbage after EOF ignored\n" );
            return True;       
         }
      default:
         panic ( "test:unexpected error" );
   }

   panic ( "test:end" );
   return True; /*notreached*/
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2770, %rsp           # imm = 0x2770
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x2754(%rbp)
movl $0x0, -0x2c(%rbp)
movq -0x10(%rbp), %rdi
callq 0x20b0
cmpl $0x0, %eax
je 0x5b0b
jmp 0x5d05
jmp 0x5b0d
movq -0x10(%rbp), %rsi
movl 0x18365(%rip), %edx     # 0x1de7c
movzbl 0x1835a(%rip), %ecx     # 0x1de78
leaq -0x2750(%rbp), %r8
movl -0x2754(%rbp), %r9d
leaq -0x1c(%rbp), %rdi
callq 0x8d20
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x5b46
cmpl $0x0, -0x1c(%rbp)
je 0x5b4b
jmp 0x5c93
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x5b83
movq -0x18(%rbp), %rsi
leaq -0x13c0(%rbp), %rdx
leaq -0x1c(%rbp), %rdi
movl $0x1388, %ecx           # imm = 0x1388
callq 0x90a0
movl %eax, -0x28(%rbp)
cmpl $-0x5, -0x1c(%rbp)
jne 0x5b81
jmp 0x5c93
jmp 0x5b54
cmpl $0x4, -0x1c(%rbp)
je 0x5b8e
jmp 0x5c93
movq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdi
leaq -0x2760(%rbp), %rdx
leaq -0x2754(%rbp), %rcx
callq 0x9440
cmpl $0x0, -0x1c(%rbp)
je 0x5bbb
leaq 0x13e89(%rip), %rdi     # 0x19a3f
callq 0x4ad0
movq -0x2760(%rbp), %rax
movq %rax, -0x2768(%rbp)
movl $0x0, -0x30(%rbp)
movl -0x30(%rbp), %eax
cmpl -0x2754(%rbp), %eax
jge 0x5bff
movq -0x2768(%rbp), %rax
movslq -0x30(%rbp), %rcx
movb (%rax,%rcx), %cl
movslq -0x30(%rbp), %rax
movb %cl, -0x2750(%rbp,%rax)
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x5bd0
movq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdi
callq 0x8fd0
cmpl $0x0, -0x1c(%rbp)
je 0x5c1e
leaq 0x13e26(%rip), %rdi     # 0x19a3f
callq 0x4ad0
cmpl $0x0, -0x2754(%rbp)
jne 0x5c3a
movq -0x10(%rbp), %rdi
callq 0x5220
movzbl %al, %eax
cmpl $0x0, %eax
je 0x5c3a
jmp 0x5c3f
jmp 0x5b0d
movq -0x10(%rbp), %rdi
callq 0x20b0
cmpl $0x0, %eax
je 0x5c52
jmp 0x5d05
movq -0x10(%rbp), %rdi
callq 0x20e0
movl %eax, -0x24(%rbp)
cmpl $-0x1, -0x24(%rbp)
jne 0x5c69
jmp 0x5d05
cmpl $0x2, 0x1820c(%rip)     # 0x1de7c
jl 0x5c8a
movq 0x1737f(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x13c98(%rip), %rsi     # 0x1991b
movb $0x0, %al
callq 0x2170
movb $0x1, -0x1(%rbp)
jmp 0x5dbe
movq -0x18(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x8fd0
cmpl $0x0, 0x181d5(%rip)     # 0x1de7c
jne 0x5ccf
movq 0x17348(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x18e16(%rip), %rdx     # 0x1ead0
leaq 0x13d93(%rip), %rsi     # 0x19a54
leaq 0x181d8(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl -0x1c(%rbp), %eax
addl $0x9, %eax
movl %eax, %ecx
movq %rcx, -0x2770(%rbp)
subl $0x6, %eax
ja 0x5db2
movq -0x2770(%rbp), %rax
leaq 0x12453(%rip), %rcx     # 0x18148
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
callq 0x5490
jmp 0x5d05
callq 0x51e0
movq 0x172e7(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x13d42(%rip), %rsi     # 0x19a5d
movb $0x0, %al
callq 0x2170
movb $0x0, -0x1(%rbp)
jmp 0x5dbe
callq 0x4a90
movq 0x172c1(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x13d40(%rip), %rsi     # 0x19a81
movb $0x0, %al
callq 0x2170
movb $0x0, -0x1(%rbp)
jmp 0x5dbe
movq -0x10(%rbp), %rax
movq 0x1727f(%rip), %rcx     # 0x1cfd8
cmpq (%rcx), %rax
je 0x5d67
movq -0x10(%rbp), %rdi
callq 0x20e0
cmpl $0x1, -0x2c(%rbp)
jne 0x5d8b
movq 0x17284(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x13d1b(%rip), %rsi     # 0x19a99
movb $0x0, %al
callq 0x2170
movb $0x0, -0x1(%rbp)
jmp 0x5dbe
cmpb $0x0, 0x180e9(%rip)     # 0x1de7b
je 0x5dac
movq 0x1725d(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x13b85(%rip), %rsi     # 0x1992a
movb $0x0, %al
callq 0x2170
movb $0x1, -0x1(%rbp)
jmp 0x5dbe
leaq 0x13d0e(%rip), %rdi     # 0x19ac7
callq 0x4ad0
movb -0x1(%rbp), %al
addq $0x2770, %rsp           # imm = 0x2770
popq %rbp
retq
nopw (%rax,%rax)