// File: /workspace/github_c_makefile_star2_O0/coapp-packages[P]bzip2/bzip2.c
// Function: uncompress
static 
void uncompress ( Char *name )
{
   FILE  *inStr;
   FILE  *outStr;
   Int32 n, i;
   Bool  magicNumberOK;
   Bool  cantGuess;
   struct MY_STAT statBuf;

   deleteOutputOnInterrupt = False;

   if (name == NULL && srcMode != SM_I2O)
      panic ( "uncompress: bad modes\n" );

   cantGuess = False;
   switch (srcMode) {
      case SM_I2O: 
         copyFileName ( inName, (Char*)"(stdin)" );
         copyFileName ( outName, (Char*)"(stdout)" ); 
         break;
      case SM_F2F: 
         copyFileName ( inName, name );
         copyFileName ( outName, name );
         for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++)
            if (mapSuffix(outName,zSuffix[i],unzSuffix[i]))
               goto zzz; 
         cantGuess = True;
         strcat ( outName, ".out" );
         break;
      case SM_F2O: 
         copyFileName ( inName, name );
         copyFileName ( outName, (Char*)"(stdout)" ); 
         break;
   }

   zzz:
   if ( srcMode != SM_I2O && containsDubiousChars ( inName ) ) {
      if (noisy)
      fprintf ( stderr, "%s: There are no files matching `%s'.\n",
                progName, inName );
      setExit(1);
      return;
   }
   if ( srcMode != SM_I2O && !fileExists ( inName ) ) {
      fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
                progName, inName, strerror(errno) );
      setExit(1);
      return;
   }
   if ( srcMode == SM_F2F || srcMode == SM_F2O ) {
      MY_STAT(inName, &statBuf);
      if ( MY_S_ISDIR(statBuf.st_mode) ) {
         fprintf( stderr,
                  "%s: Input file %s is a directory.\n",
                  progName,inName);
         setExit(1);
         return;
      }
   }
   if ( srcMode == SM_F2F && !forceOverwrite && notAStandardFile ( inName )) {
      if (noisy)
      fprintf ( stderr, "%s: Input file %s is not a normal file.\n",
                progName, inName );
      setExit(1);
      return;
   }
   if ( /* srcMode == SM_F2F implied && */ cantGuess ) {
      if (noisy)
      fprintf ( stderr, 
                "%s: Can't guess original name for %s -- using %s\n",
                progName, inName, outName );
      /* just a warning, no return */
   }   
   if ( srcMode == SM_F2F && fileExists ( outName ) ) {
      if (forceOverwrite) {
	remove(outName);
      } else {
        fprintf ( stderr, "%s: Output file %s already exists.\n",
                  progName, outName );
        setExit(1);
        return;
      }
   }
   if ( srcMode == SM_F2F && !forceOverwrite &&
        (n=countHardLinks ( inName ) ) > 0) {
      fprintf ( stderr, "%s: Input file %s has %d other link%s.\n",
                progName, inName, n, n > 1 ? "s" : "" );
      setExit(1);
      return;
   }

   if ( srcMode == SM_F2F ) {
      /* Save the file's meta-info before we open it.  Doing it later
         means we mess up the access times. */
      saveInputFileMetaInfo ( inName );
   }

   switch ( srcMode ) {

      case SM_I2O:
         inStr = stdin;
         outStr = stdout;
         if ( isatty ( fileno ( stdin ) ) ) {
            fprintf ( stderr,
                      "%s: I won't read compressed data from a terminal.\n",
                      progName );
            fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
                              progName, progName );
            setExit(1);
            return;
         };
         break;

      case SM_F2O:
         inStr = fopen ( inName, "rb" );
         outStr = stdout;
         if ( inStr == NULL ) {
            fprintf ( stderr, "%s: Can't open input file %s:%s.\n",
                      progName, inName, strerror(errno) );
            if ( inStr != NULL ) fclose ( inStr );
            setExit(1);
            return;
         };
         break;

      case SM_F2F:
         inStr = fopen ( inName, "rb" );
         outStr = fopen_output_safely ( outName, "wb" );
         if ( outStr == NULL) {
            fprintf ( stderr, "%s: Can't create output file %s: %s.\n",
                      progName, outName, strerror(errno) );
            if ( inStr != NULL ) fclose ( inStr );
            setExit(1);
            return;
         }
         if ( inStr == NULL ) {
            fprintf ( stderr, "%s: Can't open input file %s: %s.\n",
                      progName, inName, strerror(errno) );
            if ( outStr != NULL ) fclose ( outStr );
            setExit(1);
            return;
         };
         break;

      default:
         panic ( "uncompress: bad srcMode" );
         break;
   }

   if (verbosity >= 1) {
      fprintf ( stderr, "  %s: ", inName );
      pad ( inName );
      fflush ( stderr );
   }

   /*--- Now the input and output handles are sane.  Do the Biz. ---*/
   outputHandleJustInCase = outStr;
   deleteOutputOnInterrupt = True;
   magicNumberOK = uncompressStream ( inStr, outStr );
   outputHandleJustInCase = NULL;

   /*--- If there was an I/O error, we won't get here. ---*/
   if ( magicNumberOK ) {
      if ( srcMode == SM_F2F ) {
         applySavedTimeInfoToOutputFile ( outName );
         deleteOutputOnInterrupt = False;
         if ( !keepInputFiles ) {
            IntNative retVal = remove ( inName );
            ERROR_IF_NOT_ZERO ( retVal );
         }
      }
   } else {
      unzFailsExist = True;
      deleteOutputOnInterrupt = False;
      if ( srcMode == SM_F2F ) {
         IntNative retVal = remove ( outName );
         ERROR_IF_NOT_ZERO ( retVal );
      }
   }
   deleteOutputOnInterrupt = False;

   if ( magicNumberOK ) {
      if (verbosity >= 1)
         fprintf ( stderr, "done\n" );
   } else {
      setExit(2);
      if (verbosity >= 1)
         fprintf ( stderr, "not a bzip2 file.\n" ); else
         fprintf ( stderr,
                   "%s: %s is not a bzip2 file.\n",
                   progName, inName );
   }

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
movq %rdi, -0x8(%rbp)
movb $0x0, 0x1a2be(%rip)     # 0x1de94
cmpq $0x0, -0x8(%rbp)
jne 0x3bf2
cmpl $0x1, 0x1aef8(%rip)     # 0x1eadc
je 0x3bf2
leaq 0x15c35(%rip), %rdi     # 0x19822
callq 0x4ad0
movb $0x0, -0x22(%rbp)
movl 0x1aee0(%rip), %eax     # 0x1eadc
movl %eax, -0xc4(%rbp)
subl $0x1, %eax
je 0x3c2a
jmp 0x3c09
movl -0xc4(%rbp), %eax
subl $0x2, %eax
je 0x3cd8
jmp 0x3c1a
movl -0xc4(%rbp), %eax
subl $0x3, %eax
je 0x3c55
jmp 0x3cfb
leaq 0x1a26f(%rip), %rdi     # 0x1dea0
leaq 0x1585d(%rip), %rsi     # 0x19495
callq 0x3040
leaq 0x1a66c(%rip), %rdi     # 0x1e2b0
leaq 0x15852(%rip), %rsi     # 0x1949d
callq 0x3040
jmp 0x3cfb
movq -0x8(%rbp), %rsi
leaq 0x1a240(%rip), %rdi     # 0x1dea0
callq 0x3040
movq -0x8(%rbp), %rsi
leaq 0x1a640(%rip), %rdi     # 0x1e2b0
callq 0x3040
movl $0x0, -0x20(%rbp)
cmpl $0x4, -0x20(%rbp)
jge 0x3cbf
movslq -0x20(%rbp), %rcx
leaq 0x194d3(%rip), %rax     # 0x1d160
movq (%rax,%rcx,8), %rsi
movslq -0x20(%rbp), %rcx
leaq 0x194e4(%rip), %rax     # 0x1d180
movq (%rax,%rcx,8), %rdx
leaq 0x1a609(%rip), %rdi     # 0x1e2b0
callq 0x5590
cmpb $0x0, %al
je 0x3cb2
jmp 0x3cfd
jmp 0x3cb4
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x3c7c
movb $0x1, -0x22(%rbp)
leaq 0x1a5e6(%rip), %rdi     # 0x1e2b0
leaq 0x15b68(%rip), %rsi     # 0x19839
callq 0x2230
jmp 0x3cfb
movq -0x8(%rbp), %rsi
leaq 0x1a1bd(%rip), %rdi     # 0x1dea0
callq 0x3040
leaq 0x1a5c1(%rip), %rdi     # 0x1e2b0
leaq 0x157a7(%rip), %rsi     # 0x1949d
callq 0x3040
jmp 0x3cfd
cmpl $0x1, 0x1add8(%rip)     # 0x1eadc
je 0x3d58
leaq 0x1a193(%rip), %rdi     # 0x1dea0
callq 0x4b10
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3d58
cmpb $0x0, 0x1a15a(%rip)     # 0x1de7b
je 0x3d49
movq 0x192ce(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1ad9c(%rip), %rdx     # 0x1ead0
leaq 0x1576b(%rip), %rsi     # 0x194a6
leaq 0x1a15e(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
cmpl $0x1, 0x1ad7d(%rip)     # 0x1eadc
je 0x3dd1
leaq 0x1a138(%rip), %rdi     # 0x1dea0
callq 0x4b20
cmpb $0x0, %al
jne 0x3dd1
movq 0x19280(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0xd8(%rbp)
movq 0x1ad47(%rip), %rax     # 0x1ead0
movq %rax, -0xd0(%rbp)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq -0xd8(%rbp), %rdi
movq -0xd0(%rbp), %rdx
movq %rax, %r8
leaq 0x15719(%rip), %rsi     # 0x194cd
leaq 0x1a0e5(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
cmpl $0x3, 0x1ad04(%rip)     # 0x1eadc
je 0x3de3
cmpl $0x2, 0x1acfb(%rip)     # 0x1eadc
jne 0x3e3f
leaq 0x1a0b6(%rip), %rdi     # 0x1dea0
leaq -0xb8(%rbp), %rsi
callq 0x2180
movl -0xa0(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x3e3d
movq 0x191e9(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1acb7(%rip), %rdx     # 0x1ead0
leaq 0x156fa(%rip), %rsi     # 0x1951a
leaq 0x1a079(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
jmp 0x3e3f
cmpl $0x3, 0x1ac96(%rip)     # 0x1eadc
jne 0x3ea3
cmpb $0x0, 0x1a02b(%rip)     # 0x1de7a
jne 0x3ea3
leaq 0x1a048(%rip), %rdi     # 0x1dea0
callq 0x4be0
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3ea3
cmpb $0x0, 0x1a00f(%rip)     # 0x1de7b
je 0x3e94
movq 0x19183(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1ac51(%rip), %rdx     # 0x1ead0
leaq 0x156b7(%rip), %rsi     # 0x1953d
leaq 0x1a013(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
cmpb $0x0, -0x22(%rbp)
je 0x3ee1
cmpb $0x0, 0x19fcb(%rip)     # 0x1de7b
je 0x3edf
movq 0x1913f(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1ac0d(%rip), %rdx     # 0x1ead0
leaq 0x15974(%rip), %rsi     # 0x1983e
leaq 0x19fcf(%rip), %rcx     # 0x1dea0
leaq 0x1a3d8(%rip), %r8      # 0x1e2b0
movb $0x0, %al
callq 0x2170
jmp 0x3ee1
cmpl $0x3, 0x1abf4(%rip)     # 0x1eadc
jne 0x3f4c
leaq 0x1a3bf(%rip), %rdi     # 0x1e2b0
callq 0x4b20
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3f4c
cmpb $0x0, 0x19f75(%rip)     # 0x1de7a
je 0x3f15
leaq 0x1a3a2(%rip), %rdi     # 0x1e2b0
callq 0x2080
jmp 0x3f4a
movq 0x190dc(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1abaa(%rip), %rdx     # 0x1ead0
leaq 0x15639(%rip), %rsi     # 0x19566
leaq 0x1a37c(%rip), %rcx     # 0x1e2b0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
jmp 0x3f4c
cmpl $0x3, 0x1ab89(%rip)     # 0x1eadc
jne 0x3fc3
cmpb $0x0, 0x19f1e(%rip)     # 0x1de7a
jne 0x3fc3
leaq 0x19f3b(%rip), %rdi     # 0x1dea0
callq 0x4c40
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jle 0x3fc3
movq 0x1907f(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1ab4d(%rip), %rdx     # 0x1ead0
movl -0x1c(%rbp), %r8d
movl -0x1c(%rbp), %ecx
leaq 0x15d19(%rip), %r9      # 0x19caa
leaq 0x14272(%rip), %rax     # 0x1820a
cmpl $0x1, %ecx
cmovgq %rax, %r9
leaq 0x155e4(%rip), %rsi     # 0x1958a
leaq 0x19ef3(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
cmpl $0x3, 0x1ab12(%rip)     # 0x1eadc
jne 0x3fd8
leaq 0x19ecd(%rip), %rdi     # 0x1dea0
callq 0x4c90
movl 0x1aafe(%rip), %eax     # 0x1eadc
movl %eax, -0xdc(%rbp)
subl $0x1, %eax
je 0x4010
jmp 0x3feb
movl -0xdc(%rbp), %eax
subl $0x2, %eax
je 0x40a0
jmp 0x3ffc
movl -0xdc(%rbp), %eax
subl $0x3, %eax
je 0x4141
jmp 0x425f
movq 0x18fc1(%rip), %rax     # 0x1cfd8
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq 0x18fab(%rip), %rax     # 0x1cfd0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq 0x18fa5(%rip), %rax     # 0x1cfd8
movq (%rax), %rdi
callq 0x2190
movl %eax, %edi
callq 0x20c0
cmpl $0x0, %eax
je 0x409b
movq 0x18faa(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1aa78(%rip), %rdx     # 0x1ead0
leaq 0x15811(%rip), %rsi     # 0x19870
movb $0x0, %al
callq 0x2170
movq 0x18f8b(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1aa59(%rip), %rdx     # 0x1ead0
movq 0x1aa52(%rip), %rcx     # 0x1ead0
leaq 0x1555f(%rip), %rsi     # 0x195e4
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
jmp 0x426b
leaq 0x19df9(%rip), %rdi     # 0x1dea0
leaq 0x15558(%rip), %rsi     # 0x19606
callq 0x2210
movq %rax, -0x10(%rbp)
movq 0x18f12(%rip), %rax     # 0x1cfd0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x413c
movq 0x18f25(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
movq 0x1a9ec(%rip), %rax     # 0x1ead0
movq %rax, -0xe8(%rbp)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq -0xf0(%rbp), %rdi
movq -0xe8(%rbp), %rdx
movq %rax, %r8
leaq 0x15794(%rip), %rsi     # 0x198a3
leaq 0x19d8a(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
cmpq $0x0, -0x10(%rbp)
je 0x412d
movq -0x10(%rbp), %rdi
callq 0x20e0
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
jmp 0x426b
leaq 0x19d58(%rip), %rdi     # 0x1dea0
leaq 0x154b7(%rip), %rsi     # 0x19606
callq 0x2210
movq %rax, -0x10(%rbp)
leaq 0x1a151(%rip), %rdi     # 0x1e2b0
leaq 0x154a3(%rip), %rsi     # 0x19609
callq 0x4cc0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x41e6
movq 0x18e7b(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0x100(%rbp)
movq 0x1a942(%rip), %rax     # 0x1ead0
movq %rax, -0xf8(%rbp)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq -0x100(%rbp), %rdi
movq -0xf8(%rbp), %rdx
movq %rax, %r8
leaq 0x15453(%rip), %rsi     # 0x1960c
leaq 0x1a0f0(%rip), %rcx     # 0x1e2b0
movb $0x0, %al
callq 0x2170
cmpq $0x0, -0x10(%rbp)
je 0x41d7
movq -0x10(%rbp), %rdi
callq 0x20e0
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
cmpq $0x0, -0x10(%rbp)
jne 0x425d
movq 0x18e04(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0x110(%rbp)
movq 0x1a8cb(%rip), %rax     # 0x1ead0
movq %rax, -0x108(%rbp)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq -0x110(%rbp), %rdi
movq -0x108(%rbp), %rdx
movq %rax, %r8
leaq 0x1529d(%rip), %rsi     # 0x194cd
leaq 0x19c69(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
cmpq $0x0, -0x18(%rbp)
je 0x424e
movq -0x18(%rbp), %rdi
callq 0x20e0
movl $0x1, %edi
callq 0x4400
jmp 0x43ec
jmp 0x426b
leaq 0x1565f(%rip), %rdi     # 0x198c5
callq 0x4ad0
cmpl $0x1, 0x19c0a(%rip)     # 0x1de7c
jl 0x42ae
movq 0x18d7d(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x153ad(%rip), %rsi     # 0x19632
leaq 0x19c14(%rip), %rdx     # 0x1dea0
movb $0x0, %al
callq 0x2170
leaq 0x19c06(%rip), %rdi     # 0x1dea0
callq 0x4d30
movq 0x18d52(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
callq 0x21b0
movq -0x18(%rbp), %rax
movq %rax, 0x19bb7(%rip)     # 0x1de70
movb $0x1, 0x19bd4(%rip)     # 0x1de94
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x5610
movb %al, -0x21(%rbp)
movq $0x0, 0x19b95(%rip) # 0x1de70
cmpb $0x0, -0x21(%rbp)
je 0x432c
cmpl $0x3, 0x1a7f4(%rip)     # 0x1eadc
jne 0x432a
leaq 0x19fbf(%rip), %rdi     # 0x1e2b0
callq 0x5190
movb $0x0, 0x19b97(%rip)     # 0x1de94
cmpb $0x0, 0x19b75(%rip)     # 0x1de79
jne 0x4328
leaq 0x19b93(%rip), %rdi     # 0x1dea0
callq 0x2080
movl %eax, -0xbc(%rbp)
cmpl $0x0, -0xbc(%rbp)
je 0x4326
callq 0x51e0
jmp 0x4328
jmp 0x432a
jmp 0x4367
movb $0x1, 0x19b52(%rip)     # 0x1de85
movb $0x0, 0x19b5a(%rip)     # 0x1de94
cmpl $0x3, 0x1a79b(%rip)     # 0x1eadc
jne 0x4365
leaq 0x19f66(%rip), %rdi     # 0x1e2b0
callq 0x2080
movl %eax, -0xc0(%rbp)
cmpl $0x0, -0xc0(%rbp)
je 0x4363
callq 0x51e0
jmp 0x4365
jmp 0x4367
movb $0x0, 0x19b26(%rip)     # 0x1de94
cmpb $0x0, -0x21(%rbp)
je 0x4397
cmpl $0x1, 0x19b01(%rip)     # 0x1de7c
jl 0x4395
movq 0x18c74(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x1554f(%rip), %rsi     # 0x198dd
movb $0x0, %al
callq 0x2170
jmp 0x43ec
movl $0x2, %edi
callq 0x4400
cmpl $0x1, 0x19ad4(%rip)     # 0x1de7c
jl 0x43c4
movq 0x18c47(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x15532(%rip), %rsi     # 0x198ed
movb $0x0, %al
callq 0x2170
jmp 0x43ea
movq 0x18c2d(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1a6fb(%rip), %rdx     # 0x1ead0
leaq 0x15507(%rip), %rsi     # 0x198e3
leaq 0x19abd(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
jmp 0x43ec
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)