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

   deleteOutputOnInterrupt = False;

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

   switch (srcMode) {
      case SM_I2O: 
         copyFileName ( inName, (Char*)"(stdin)" );
         copyFileName ( outName, (Char*)"(stdout)" ); 
         break;
      case SM_F2F: 
         copyFileName ( inName, name );
         copyFileName ( outName, name );
         strcat ( outName, ".bz2" ); 
         break;
      case SM_F2O: 
         copyFileName ( inName, name );
         copyFileName ( outName, (Char*)"(stdout)" ); 
         break;
   }

   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;
   }
   for (i = 0; i < BZ_N_SUFFIX_PAIRS; i++) {
      if (hasSuffix(inName, zSuffix[i])) {
         if (noisy)
         fprintf ( stderr, 
                   "%s: Input file %s already has %s suffix.\n",
                   progName, inName, zSuffix[i] );
         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 && 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 ( stdout ) ) ) {
            fprintf ( stderr,
                      "%s: I won't write compressed data to 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 ( isatty ( fileno ( stdout ) ) ) {
            fprintf ( stderr,
                      "%s: I won't write compressed data to a terminal.\n",
                      progName );
            fprintf ( stderr, "%s: For help, type: `%s --help'.\n",
                              progName, progName );
            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) );
            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 ( "compress: 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;
   compressStream ( inStr, outStr );
   outputHandleJustInCase = NULL;

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

   deleteOutputOnInterrupt = False;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movb $0x0, 0x1aa8e(%rip)     # 0x1de94
cmpq $0x0, -0x8(%rbp)
jne 0x3422
cmpl $0x1, 0x1b6c8(%rip)     # 0x1eadc
je 0x3422
leaq 0x16407(%rip), %rdi     # 0x19824
callq 0x4ad0
movl 0x1b6b4(%rip), %eax     # 0x1eadc
movl %eax, -0xb8(%rbp)
subl $0x1, %eax
je 0x3452
jmp 0x3435
movl -0xb8(%rbp), %eax
subl $0x2, %eax
je 0x34af
jmp 0x3442
movl -0xb8(%rbp), %eax
subl $0x3, %eax
je 0x347a
jmp 0x34d2
leaq 0x1aa47(%rip), %rdi     # 0x1dea0
leaq 0x16035(%rip), %rsi     # 0x19495
callq 0x3040
leaq 0x1ae44(%rip), %rdi     # 0x1e2b0
leaq 0x1602a(%rip), %rsi     # 0x1949d
callq 0x3040
jmp 0x34d2
movq -0x8(%rbp), %rsi
leaq 0x1aa1b(%rip), %rdi     # 0x1dea0
callq 0x3040
movq -0x8(%rbp), %rsi
leaq 0x1ae1b(%rip), %rdi     # 0x1e2b0
callq 0x3040
leaq 0x1ae0f(%rip), %rdi     # 0x1e2b0
leaq 0x14ce0(%rip), %rsi     # 0x18188
callq 0x2230
jmp 0x34d2
movq -0x8(%rbp), %rsi
leaq 0x1a9e6(%rip), %rdi     # 0x1dea0
callq 0x3040
leaq 0x1adea(%rip), %rdi     # 0x1e2b0
leaq 0x15fd0(%rip), %rsi     # 0x1949d
callq 0x3040
cmpl $0x1, 0x1b603(%rip)     # 0x1eadc
je 0x352d
leaq 0x1a9be(%rip), %rdi     # 0x1dea0
callq 0x4b10
movzbl %al, %eax
cmpl $0x0, %eax
je 0x352d
cmpb $0x0, 0x1a985(%rip)     # 0x1de7b
je 0x351e
movq 0x19af9(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b5c7(%rip), %rdx     # 0x1ead0
leaq 0x15f96(%rip), %rsi     # 0x194a6
leaq 0x1a989(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
cmpl $0x1, 0x1b5a8(%rip)     # 0x1eadc
je 0x35a6
leaq 0x1a963(%rip), %rdi     # 0x1dea0
callq 0x4b20
cmpb $0x0, %al
jne 0x35a6
movq 0x19aab(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0xc8(%rbp)
movq 0x1b572(%rip), %rax     # 0x1ead0
movq %rax, -0xc0(%rbp)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rdx
movq %rax, %r8
leaq 0x15f44(%rip), %rsi     # 0x194cd
leaq 0x1a910(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
movl $0x0, -0x20(%rbp)
cmpl $0x4, -0x20(%rbp)
jge 0x362c
movslq -0x20(%rbp), %rcx
leaq 0x19ba2(%rip), %rax     # 0x1d160
movq (%rax,%rcx,8), %rsi
leaq 0x1a8d7(%rip), %rdi     # 0x1dea0
callq 0x4b70
cmpb $0x0, %al
je 0x361f
cmpb $0x0, 0x1a8a2(%rip)     # 0x1de7b
je 0x3610
movq 0x19a16(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b4e4(%rip), %rdx     # 0x1ead0
movslq -0x20(%rbp), %rcx
leaq 0x19b69(%rip), %rax     # 0x1d160
movq (%rax,%rcx,8), %r8
leaq 0x15eee(%rip), %rsi     # 0x194f0
leaq 0x1a897(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
jmp 0x3621
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x35ad
cmpl $0x3, 0x1b4a9(%rip)     # 0x1eadc
je 0x363e
cmpl $0x2, 0x1b4a0(%rip)     # 0x1eadc
jne 0x369a
leaq 0x1a85b(%rip), %rdi     # 0x1dea0
leaq -0xb0(%rbp), %rsi
callq 0x2180
movl -0x98(%rbp), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
jne 0x3698
movq 0x1998e(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b45c(%rip), %rdx     # 0x1ead0
leaq 0x15e9f(%rip), %rsi     # 0x1951a
leaq 0x1a81e(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
jmp 0x369a
cmpl $0x3, 0x1b43b(%rip)     # 0x1eadc
jne 0x36fe
cmpb $0x0, 0x1a7d0(%rip)     # 0x1de7a
jne 0x36fe
leaq 0x1a7ed(%rip), %rdi     # 0x1dea0
callq 0x4be0
movzbl %al, %eax
cmpl $0x0, %eax
je 0x36fe
cmpb $0x0, 0x1a7b4(%rip)     # 0x1de7b
je 0x36ef
movq 0x19928(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b3f6(%rip), %rdx     # 0x1ead0
leaq 0x15e5c(%rip), %rsi     # 0x1953d
leaq 0x1a7b8(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
cmpl $0x3, 0x1b3d7(%rip)     # 0x1eadc
jne 0x3769
leaq 0x1aba2(%rip), %rdi     # 0x1e2b0
callq 0x4b20
movzbl %al, %eax
cmpl $0x0, %eax
je 0x3769
cmpb $0x0, 0x1a758(%rip)     # 0x1de7a
je 0x3732
leaq 0x1ab85(%rip), %rdi     # 0x1e2b0
callq 0x2080
jmp 0x3767
movq 0x198bf(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b38d(%rip), %rdx     # 0x1ead0
leaq 0x15e1c(%rip), %rsi     # 0x19566
leaq 0x1ab5f(%rip), %rcx     # 0x1e2b0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
jmp 0x3769
cmpl $0x3, 0x1b36c(%rip)     # 0x1eadc
jne 0x37e0
cmpb $0x0, 0x1a701(%rip)     # 0x1de7a
jne 0x37e0
leaq 0x1a71e(%rip), %rdi     # 0x1dea0
callq 0x4c40
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
jle 0x37e0
movq 0x19862(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b330(%rip), %rdx     # 0x1ead0
movl -0x1c(%rbp), %r8d
movl -0x1c(%rbp), %ecx
leaq 0x164fc(%rip), %r9      # 0x19caa
leaq 0x14a55(%rip), %rax     # 0x1820a
cmpl $0x1, %ecx
cmovgq %rax, %r9
leaq 0x15dc7(%rip), %rsi     # 0x1958a
leaq 0x1a6d6(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
cmpl $0x3, 0x1b2f5(%rip)     # 0x1eadc
jne 0x37f5
leaq 0x1a6b0(%rip), %rdi     # 0x1dea0
callq 0x4c90
movl 0x1b2e1(%rip), %eax     # 0x1eadc
movl %eax, -0xcc(%rbp)
subl $0x1, %eax
je 0x382d
jmp 0x3808
movl -0xcc(%rbp), %eax
subl $0x2, %eax
je 0x38bd
jmp 0x3819
movl -0xcc(%rbp), %eax
subl $0x3, %eax
je 0x39cd
jmp 0x3aeb
movq 0x197a4(%rip), %rax     # 0x1cfd8
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq 0x1978e(%rip), %rax     # 0x1cfd0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq 0x19780(%rip), %rax     # 0x1cfd0
movq (%rax), %rdi
callq 0x2190
movl %eax, %edi
callq 0x20c0
cmpl $0x0, %eax
je 0x38b8
movq 0x1978d(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b25b(%rip), %rdx     # 0x1ead0
leaq 0x15d36(%rip), %rsi     # 0x195b2
movb $0x0, %al
callq 0x2170
movq 0x1976e(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b23c(%rip), %rdx     # 0x1ead0
movq 0x1b235(%rip), %rcx     # 0x1ead0
leaq 0x15d42(%rip), %rsi     # 0x195e4
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
jmp 0x3af7
leaq 0x1a5dc(%rip), %rdi     # 0x1dea0
leaq 0x15d3b(%rip), %rsi     # 0x19606
callq 0x2210
movq %rax, -0x10(%rbp)
movq 0x196f5(%rip), %rax     # 0x1cfd0
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movq 0x196e7(%rip), %rax     # 0x1cfd0
movq (%rax), %rdi
callq 0x2190
movl %eax, %edi
callq 0x20c0
cmpl $0x0, %eax
je 0x3961
movq 0x196f4(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b1c2(%rip), %rdx     # 0x1ead0
leaq 0x15c9d(%rip), %rsi     # 0x195b2
movb $0x0, %al
callq 0x2170
movq 0x196d5(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
movq 0x1b1a3(%rip), %rdx     # 0x1ead0
movq 0x1b19c(%rip), %rcx     # 0x1ead0
leaq 0x15ca9(%rip), %rsi     # 0x195e4
movb $0x0, %al
callq 0x2170
cmpq $0x0, -0x10(%rbp)
je 0x3952
movq -0x10(%rbp), %rdi
callq 0x20e0
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
cmpq $0x0, -0x10(%rbp)
jne 0x39c8
movq 0x19689(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0xe0(%rbp)
movq 0x1b150(%rip), %rax     # 0x1ead0
movq %rax, -0xd8(%rbp)
callq 0x2060
movl (%rax), %edi
callq 0x2260
movq -0xe0(%rbp), %rdi
movq -0xd8(%rbp), %rdx
movq %rax, %r8
leaq 0x15b22(%rip), %rsi     # 0x194cd
leaq 0x1a4ee(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
jmp 0x3af7
leaq 0x1a4cc(%rip), %rdi     # 0x1dea0
leaq 0x15c2b(%rip), %rsi     # 0x19606
callq 0x2210
movq %rax, -0x10(%rbp)
leaq 0x1a8c5(%rip), %rdi     # 0x1e2b0
leaq 0x15c17(%rip), %rsi     # 0x19609
callq 0x4cc0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
jne 0x3a72
movq 0x195ef(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0xf0(%rbp)
movq 0x1b0b6(%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 0x15bc7(%rip), %rsi     # 0x1960c
leaq 0x1a864(%rip), %rcx     # 0x1e2b0
movb $0x0, %al
callq 0x2170
cmpq $0x0, -0x10(%rbp)
je 0x3a63
movq -0x10(%rbp), %rdi
callq 0x20e0
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
cmpq $0x0, -0x10(%rbp)
jne 0x3ae9
movq 0x19578(%rip), %rax     # 0x1cff8
movq (%rax), %rax
movq %rax, -0x100(%rbp)
movq 0x1b03f(%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 0x15a11(%rip), %rsi     # 0x194cd
leaq 0x1a3dd(%rip), %rcx     # 0x1dea0
movb $0x0, %al
callq 0x2170
cmpq $0x0, -0x18(%rbp)
je 0x3ada
movq -0x18(%rbp), %rdi
callq 0x20e0
movl $0x1, %edi
callq 0x4400
jmp 0x3bb4
jmp 0x3af7
leaq 0x15dd5(%rip), %rdi     # 0x198c7
callq 0x4ad0
cmpl $0x1, 0x1a37e(%rip)     # 0x1de7c
jl 0x3b3a
movq 0x194f1(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
leaq 0x15b21(%rip), %rsi     # 0x19632
leaq 0x1a388(%rip), %rdx     # 0x1dea0
movb $0x0, %al
callq 0x2170
leaq 0x1a37a(%rip), %rdi     # 0x1dea0
callq 0x4d30
movq 0x194c6(%rip), %rax     # 0x1cff8
movq (%rax), %rdi
callq 0x21b0
movq -0x18(%rbp), %rax
movq %rax, 0x1a32b(%rip)     # 0x1de70
movb $0x1, 0x1a348(%rip)     # 0x1de94
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4db0
movq $0x0, 0x1a30c(%rip) # 0x1de70
cmpl $0x3, 0x1af71(%rip)     # 0x1eadc
jne 0x3bad
leaq 0x1a73c(%rip), %rdi     # 0x1e2b0
callq 0x5190
movb $0x0, 0x1a314(%rip)     # 0x1de94
cmpb $0x0, 0x1a2f2(%rip)     # 0x1de79
jne 0x3bab
leaq 0x1a310(%rip), %rdi     # 0x1dea0
callq 0x2080
movl %eax, -0xb4(%rbp)
cmpl $0x0, -0xb4(%rbp)
je 0x3ba9
callq 0x51e0
jmp 0x3bab
jmp 0x3bad
movb $0x0, 0x1a2e0(%rip)     # 0x1de94
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
nopl (%rax)