// File: /workspace/github_c_makefile_star2_O3/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1498, %rsp           # imm = 0x1498
movb $0x0, 0x15167(%rip)     # 0x18de4
testq %rdi, %rdi
sete %cl
movl 0x15da3(%rip), %eax     # 0x19a2c
cmpl $0x1, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x438d
movq %rdi, %rbx
cmpl $0x3, %eax
je 0x3ce0
cmpl $0x2, %eax
je 0x3cbc
cmpl $0x1, %eax
jne 0x3d1d
leaq 0x1513d(%rip), %rdi     # 0x18df0
leaq 0xf730(%rip), %rsi      # 0x133ea
jmp 0x3cc6
leaq 0x1512d(%rip), %rdi     # 0x18df0
movq %rbx, %rsi
callq 0x3a9d
leaq 0x1552e(%rip), %rdi     # 0x19200
leaq 0xf719(%rip), %rsi      # 0x133f2
callq 0x3a9d
jmp 0x3d17
leaq 0x15109(%rip), %rdi     # 0x18df0
movq %rbx, %rsi
callq 0x3a9d
leaq 0x1550a(%rip), %r14     # 0x19200
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3a9d
movq %r14, %rdi
callq 0x20e0
movl $0x327a622e, (%rax,%r14) # imm = 0x327A622E
movb $0x0, 0x4(%rax,%r14)
movl 0x15d0f(%rip), %eax     # 0x19a2c
cmpl $0x1, %eax
je 0x3d36
leaq 0x150c7(%rip), %rdi     # 0x18df0
callq 0x5169
testb %al, %al
je 0x41c9
xorl %r15d, %r15d
leaq 0x14430(%rip), %r12     # 0x18170
leaq 0x150a9(%rip), %rbx     # 0x18df0
movq (%r15,%r12), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x518e
testb %al, %al
jne 0x3ec0
addq $0x8, %r15
cmpq $0x20, %r15
jne 0x3d47
movl 0x15cbe(%rip), %eax     # 0x19a2c
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x3e1f
leaq 0x1506f(%rip), %rdi     # 0x18df0
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x2190
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rbx), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x41ff
movl 0x15c82(%rip), %eax     # 0x19a2c
cmpl $0x3, %eax
jne 0x3df1
cmpb $0x0, 0x15014(%rip)     # 0x18dca
jne 0x3df1
leaq 0x15031(%rip), %rdi     # 0x18df0
leaq 0x110(%rsp), %rsi
callq 0x2140
testl %eax, %eax
jne 0x41b2
movl $0xf000, %eax           # imm = 0xF000
andl 0x128(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x41b2
movl 0x15c3b(%rip), %eax     # 0x19a2c
cmpl $0x3, %eax
jne 0x3e1f
leaq 0x15403(%rip), %rdi     # 0x19200
callq 0x5169
testb %al, %al
je 0x3e1f
cmpb $0x0, 0x14fbd(%rip)     # 0x18dca
je 0x436d
leaq 0x153e6(%rip), %rdi     # 0x19200
callq 0x2080
movl 0x15c07(%rip), %eax     # 0x19a2c
cmpl $0x3, %eax
jne 0x3e64
cmpb $0x0, 0x14f99(%rip)     # 0x18dca
jne 0x3e64
leaq 0x14fb6(%rip), %rdi     # 0x18df0
leaq 0x110(%rsp), %rbx
movq %rbx, %rsi
callq 0x2140
movl 0x10(%rbx), %ecx
decl %ecx
xorl %edi, %edi
testl %eax, %eax
cmovel %ecx, %edi
testl %edi, %edi
jg 0x4206
movl 0x15bc8(%rip), %eax     # 0x19a2c
cmpl $0x3, %eax
jne 0x3e74
callq 0x51d3
movl 0x15bb8(%rip), %eax     # 0x19a2c
cmpl $0x3, %eax
je 0x3f2f
cmpl $0x2, %eax
je 0x3ee9
cmpl $0x1, %eax
jne 0x4399
movq 0x14146(%rip), %rax     # 0x17fd8
movq (%rax), %rbx
movq 0x14134(%rip), %rax     # 0x17fd0
movq (%rax), %r14
movq %r14, %rdi
callq 0x21b0
movl %eax, %edi
callq 0x20b0
testl %eax, %eax
je 0x3f5f
callq 0x276b
jmp 0x41a0
cmpb $0x0, 0x14f04(%rip)     # 0x18dcb
jne 0x41d0
cmpl $0x0, 0x14f14(%rip)     # 0x18de8
jg 0x41a0
movl $0x1, 0x14f04(%rip)     # 0x18de8
jmp 0x41a0
leaq 0x14f00(%rip), %rdi     # 0x18df0
leaq 0xf63d(%rip), %rsi      # 0x13534
callq 0x2230
movq %rax, %rbx
movq 0x140ca(%rip), %rax     # 0x17fd0
movq (%rax), %r14
movq %r14, %rdi
callq 0x21b0
movl %eax, %edi
callq 0x20b0
testl %eax, %eax
jne 0x4346
testq %rbx, %rbx
jne 0x3f5f
callq 0x270f
jmp 0x41a0
leaq 0x14eba(%rip), %rdi     # 0x18df0
leaq 0xf5f7(%rip), %rsi      # 0x13534
callq 0x2230
movq %rax, %rbx
callq 0x51f2
testq %rax, %rax
je 0x4353
movq %rax, %r14
testq %rbx, %rbx
je 0x4360
cmpl $0x0, 0x14e66(%rip)     # 0x18dcc
jg 0x41dd
movq %r14, 0x14e4d(%rip)     # 0x18dc0
movb $0x1, 0x14e6a(%rip)     # 0x18de4
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
jne 0x4377
movq %r14, %rdi
callq 0x20a0
testl %eax, %eax
jne 0x4377
movl 0x14e30(%rip), %edx     # 0x18dd0
movl 0x14e26(%rip), %ecx     # 0x18dcc
movl 0x14e33(%rip), %r8d     # 0x18de0
leaq 0xc(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x6cc3
movq %rax, %r15
cmpl $0x0, (%r12)
jne 0x4044
cmpl $0x2, 0x14dfe(%rip)     # 0x18dcc
jl 0x3fe4
movq 0x14021(%rip), %rax     # 0x17ff8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x2130
leaq 0x110(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
callq 0x530e
testb %al, %al
jne 0x4092
movl $0x1, %esi
movl $0x1388, %edx           # imm = 0x1388
movq %r12, %rdi
movq %rbx, %rcx
callq 0x20c0
movq %rax, %rbp
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
jne 0x4377
testl %ebp, %ebp
jle 0x403d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x6df6
cmpl $0x0, 0xc(%rsp)
je 0x3ff1
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
leaq 0x2c(%rsp), %rcx
leaq 0x28(%rsp), %r8
leaq 0x24(%rsp), %r9
movq %r15, %rsi
movl $0x1, %edx
callq 0x6f7c
movl 0xc(%rsp), %eax
cmpl $-0x3, %eax
je 0x437c
cmpl $-0x6, %eax
je 0x4377
cmpl $-0x9, %eax
jne 0x4381
callq 0x53e0
leaq 0x20(%rsp), %rax
movq %rax, (%rsp)
leaq 0xc(%rsp), %r12
leaq 0x2c(%rsp), %rcx
leaq 0x28(%rsp), %r8
leaq 0x24(%rsp), %r9
movq %r12, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x6f7c
cmpl $0x0, (%r12)
jne 0x4044
movq %r14, %rdi
callq 0x20a0
testl %eax, %eax
jne 0x4377
movq %r14, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x4377
movq 0x13ee5(%rip), %rax     # 0x17fd0
cmpq %r14, (%rax)
je 0x4123
movq %r14, %rdi
callq 0x21b0
testl %eax, %eax
js 0x4377
movl %eax, %edi
callq 0x532e
movq %r14, %rdi
callq 0x20d0
movq $0x0, 0x14ca6(%rip) # 0x18dc0
cmpl $-0x1, %eax
je 0x4377
movq $0x0, 0x14c92(%rip) # 0x18dc0
movq %rbx, %rdi
callq 0x20a0
testl %eax, %eax
jne 0x4377
movq %rbx, %rdi
callq 0x20d0
cmpl $-0x1, %eax
je 0x4377
cmpl $0x0, 0x14c76(%rip)     # 0x18dcc
jg 0x41e7
movq $0x0, 0x14c59(%rip) # 0x18dc0
cmpl $0x3, 0x158be(%rip)     # 0x19a2c
jne 0x4199
callq 0x529b
movb $0x0, 0x14c68(%rip)     # 0x18de4
cmpb $0x0, 0x14c46(%rip)     # 0x18dc9
jne 0x4199
leaq 0x14c64(%rip), %rdi     # 0x18df0
callq 0x2080
testl %eax, %eax
jne 0x4377
movb $0x0, 0x14c44(%rip)     # 0x18de4
addq $0x1498, %rsp           # imm = 0x1498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpb $0x0, 0x14c12(%rip)     # 0x18dcb
je 0x3ecd
callq 0x2514
jmp 0x3ecd
callq 0x248f
jmp 0x41a0
movq %r14, %rdi
callq 0x24eb
jmp 0x3ecd
callq 0x27bc
jmp 0x3f6c
movl 0x2c(%rsp), %eax
movl 0x28(%rsp), %ecx
movl %eax, %edx
orl %ecx, %edx
jne 0x420d
callq 0x27ea
jmp 0x415c
callq 0x280c
jmp 0x41a0
callq 0x257b
jmp 0x41a0
movl %ecx, 0x1c(%rsp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x1b(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x1a(%rsp)
movb %ah, 0x19(%rsp)
movb %al, 0x18(%rsp)
movl 0x24(%rsp), %eax
movl 0x20(%rsp), %ecx
movl %ecx, 0x14(%rsp)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x13(%rsp)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x12(%rsp)
movb %ah, 0x11(%rsp)
movb %al, 0x10(%rsp)
movsd 0xde67(%rip), %xmm1     # 0x120c0
xorpd %xmm3, %xmm3
xorl %eax, %eax
movsd 0xde61(%rip), %xmm0     # 0x120c8
movzbl 0x18(%rsp,%rax), %ecx
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm3
mulsd %xmm0, %xmm1
incq %rax
cmpq $0x8, %rax
jne 0x4267
movsd %xmm3, 0x38(%rsp)
movsd 0xde2a(%rip), %xmm1     # 0x120c0
xorpd %xmm3, %xmm3
xorl %eax, %eax
movzbl 0x10(%rsp,%rax), %ecx
xorps %xmm2, %xmm2
cvtsi2sd %ecx, %xmm2
mulsd %xmm1, %xmm2
addsd %xmm2, %xmm3
mulsd %xmm0, %xmm1
incq %rax
cmpq $0x8, %rax
jne 0x429c
movq 0x18(%rsp), %rsi
leaq 0x40(%rsp), %rbx
movq %rbx, %rdi
movsd %xmm3, 0x30(%rsp)
callq 0x5359
movq 0x10(%rsp), %rsi
leaq 0x60(%rsp), %r14
movq %r14, %rdi
callq 0x5359
movq 0x13d0a(%rip), %rax     # 0x17ff8
movq (%rax), %rdi
movsd 0x38(%rsp), %xmm2
movapd %xmm2, %xmm0
movsd 0x30(%rsp), %xmm3
divsd %xmm3, %xmm0
movsd 0xddc3(%rip), %xmm1     # 0x120d0
mulsd %xmm3, %xmm1
divsd %xmm2, %xmm1
divsd %xmm2, %xmm3
movsd 0xdd9f(%rip), %xmm2     # 0x120c0
subsd %xmm3, %xmm2
mulsd 0xddab(%rip), %xmm2     # 0x120d8
leaq 0xf2b6(%rip), %rsi      # 0x135ea
movq %rbx, %rdx
movq %r14, %rcx
movb $0x3, %al
callq 0x2180
jmp 0x415c
movq %rbx, %rdi
callq 0x26a4
jmp 0x41a0
movq %rbx, %rdi
callq 0x263a
jmp 0x41a0
movq %r14, %rdi
callq 0x25d5
jmp 0x41a0
callq 0x253a
jmp 0x41a0
callq 0x52d3
callq 0x5108
leaq 0xf4f6(%rip), %rdi      # 0x1387e
callq 0x5137
leaq 0xf3be(%rip), %rdi      # 0x13752
callq 0x5137
leaq 0xf455(%rip), %rdi      # 0x137f5
callq 0x5137