// File: /workspace/github_c_makefile_star2_O2/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, 0x10e73(%rip)     # 0x12dc4
testq %rdi, %rdi
sete %cl
movl 0x11aaf(%rip), %eax     # 0x13a0c
cmpl $0x1, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x27a8
movq %rdi, %rbx
cmpl $0x3, %eax
je 0x1fb4
cmpl $0x2, %eax
je 0x1f90
cmpl $0x1, %eax
jne 0x1ff1
leaq 0x10e49(%rip), %rdi     # 0x12dd0
leaq 0xc45c(%rip), %rsi      # 0xe3ea
jmp 0x1f9a
leaq 0x10e39(%rip), %rdi     # 0x12dd0
movq %rbx, %rsi
callq 0x1cd8
leaq 0x1123a(%rip), %rdi     # 0x131e0
leaq 0xc445(%rip), %rsi      # 0xe3f2
callq 0x1cd8
jmp 0x1feb
leaq 0x10e15(%rip), %rdi     # 0x12dd0
movq %rbx, %rsi
callq 0x1cd8
leaq 0x11216(%rip), %r14     # 0x131e0
movq %r14, %rdi
movq %rbx, %rsi
callq 0x1cd8
movq %r14, %rdi
callq 0x10e0
movl $0x327a622e, (%rax,%r14) # imm = 0x327A622E
movb $0x0, 0x4(%rax,%r14)
movl 0x11a1b(%rip), %eax     # 0x13a0c
cmpl $0x1, %eax
je 0x200a
leaq 0x10dd3(%rip), %rdi     # 0x12dd0
callq 0x38f1
testb %al, %al
je 0x2212
xorl %r15d, %r15d
leaq 0x1013c(%rip), %r12     # 0x12150
leaq 0x10db5(%rip), %r14     # 0x12dd0
cmpq $0x20, %r15
je 0x206c
movq (%r15,%r12), %rbx
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3916
addq $0x8, %r15
testb %al, %al
je 0x201b
cmpb $0x0, 0x10d6c(%rip)     # 0x12dab
je 0x276d
movq 0xffac(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x119aa(%rip), %rdx     # 0x13a00
leaq 0xc3c1(%rip), %rsi      # 0xe41e
leaq 0x10d6c(%rip), %rcx     # 0x12dd0
movq %rbx, %r8
jmp 0x2246
movl 0x1199a(%rip), %eax     # 0x13a0c
movl %eax, %ecx
andl $-0x2, %ecx
cmpl $0x2, %ecx
jne 0x20ac
leaq 0x10d4d(%rip), %rdi     # 0x12dd0
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x1170
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rbx), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x2535
movl 0x11960(%rip), %eax     # 0x13a0c
cmpl $0x3, %eax
jne 0x20f3
cmpb $0x0, 0x10cf2(%rip)     # 0x12daa
jne 0x20f3
callq 0x395b
testb %al, %al
je 0x20ed
cmpb $0x0, 0x10ce1(%rip)     # 0x12dab
je 0x276d
movq 0xff21(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x1191f(%rip), %rdx     # 0x13a00
leaq 0xc383(%rip), %rsi      # 0xe46b
jmp 0x254d
movl 0x11919(%rip), %eax     # 0x13a0c
cmpl $0x3, %eax
jne 0x2121
leaq 0x110e1(%rip), %rdi     # 0x131e0
callq 0x38f1
testb %al, %al
je 0x2121
cmpb $0x0, 0x10c9b(%rip)     # 0x12daa
je 0x2700
leaq 0x110c4(%rip), %rdi     # 0x131e0
callq 0x1080
movl 0x118e5(%rip), %eax     # 0x13a0c
cmpl $0x3, %eax
jne 0x2148
cmpb $0x0, 0x10c77(%rip)     # 0x12daa
jne 0x2148
callq 0x3992
testl %eax, %eax
jg 0x2559
movl 0x118c4(%rip), %eax     # 0x13a0c
cmpl $0x3, %eax
jne 0x2158
callq 0x39c3
movl 0x118b4(%rip), %eax     # 0x13a0c
cmpl $0x3, %eax
je 0x2252
cmpl $0x2, %eax
je 0x21d4
cmpl $0x1, %eax
jne 0x27b4
movq 0xfe62(%rip), %rax      # 0x11fd8
movq (%rax), %rbx
movq 0xfe50(%rip), %rax      # 0x11fd0
movq (%rax), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1180
movl %eax, %edi
callq 0x10b0
testl %eax, %eax
je 0x2284
movq 0xfe55(%rip), %rbx      # 0x11ff8
movq (%rbx), %rdi
movq 0x11853(%rip), %rdx     # 0x13a00
leaq 0xc32c(%rip), %rsi      # 0xe4e0
xorl %eax, %eax
callq 0x1160
movq (%rbx), %rdi
movq 0x1183b(%rip), %rcx     # 0x13a00
leaq 0xc346(%rip), %rsi      # 0xe512
movq %rcx, %rdx
jmp 0x271f
leaq 0x10bf5(%rip), %rdi     # 0x12dd0
leaq 0xc352(%rip), %rsi      # 0xe534
callq 0x1200
movq %rax, %rbx
movq 0xfddf(%rip), %rax      # 0x11fd0
movq (%rax), %rdi
movq %rdi, 0x8(%rsp)
callq 0x1180
movl %eax, %edi
callq 0x10b0
testl %eax, %eax
jne 0x267f
testq %rbx, %rbx
jne 0x2284
movq 0xfddf(%rip), %rax      # 0x11ff8
movq (%rax), %rbx
movq 0x117dd(%rip), %r14     # 0x13a00
callq 0x1060
movl (%rax), %edi
callq 0x1250
leaq 0xc1c5(%rip), %rsi      # 0xe3fb
leaq 0x10b93(%rip), %rcx     # 0x12dd0
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %r8
xorl %eax, %eax
callq 0x1160
jmp 0x276d
leaq 0x10b77(%rip), %rdi     # 0x12dd0
leaq 0xc2d4(%rip), %rsi      # 0xe534
callq 0x1200
movq %rax, %rbx
callq 0x39e2
movq %rax, 0x8(%rsp)
testq %rax, %rax
je 0x26bb
testq %rbx, %rbx
je 0x2728
cmpl $0x0, 0x10b21(%rip)     # 0x12dac
jg 0x24d1
movq 0x8(%rsp), %rax
movq %rax, 0x10b03(%rip)     # 0x12da0
movb $0x1, 0x10b20(%rip)     # 0x12dc4
movq %rbx, %rdi
callq 0x10a0
testl %eax, %eax
jne 0x2792
movq 0x8(%rsp), %rdi
callq 0x10a0
testl %eax, %eax
jne 0x2792
movl 0x10ae4(%rip), %edx     # 0x12db0
movl 0x10ada(%rip), %ecx     # 0x12dac
movl 0x10ae7(%rip), %r8d     # 0x12dc0
leaq 0x14(%rsp), %r14
movq %r14, %rdi
movq 0x8(%rsp), %rsi
callq 0x5322
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x2373
cmpl $0x2, 0x10ab1(%rip)     # 0x12dac
jl 0x230f
movq 0xfcf4(%rip), %rax      # 0x11ff8
movq (%rax), %rsi
pushq $0xa
popq %rdi
callq 0x1120
leaq 0x110(%rsp), %r12
pushq $0x1
popq %r13
leaq 0x14(%rsp), %rbp
movq %rbx, %rdi
callq 0x3b04
testb %al, %al
jne 0x23bf
movl $0x1388, %edx           # imm = 0x1388
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rcx
callq 0x10c0
movq %rax, %r14
movq %rbx, %rdi
callq 0x10a0
testl %eax, %eax
jne 0x2792
testl %r14d, %r14d
jle 0x236c
movq %rbp, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %r14d, %ecx
callq 0x5447
cmpl $0x0, 0x14(%rsp)
je 0x2320
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x40(%rsp), %rdi
pushq $0x1
popq %rdx
leaq 0x24(%rsp), %rcx
leaq 0x20(%rsp), %r8
leaq 0x1c(%rsp), %r9
movq %r15, %rsi
callq 0x5575
movl 0x14(%rsp), %eax
cmpl $-0x3, %eax
je 0x2797
cmpl $-0x6, %eax
je 0x2792
cmpl $-0x9, %eax
jne 0x279c
callq 0x3c14
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x14(%rsp), %r14
leaq 0x24(%rsp), %rcx
leaq 0x20(%rsp), %r8
leaq 0x1c(%rsp), %r9
movq %r14, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x5575
cmpl $0x0, (%r14)
jne 0x2373
movq 0x8(%rsp), %rdi
callq 0x10a0
testl %eax, %eax
jne 0x2792
movq 0x8(%rsp), %rdi
callq 0x11a0
cmpl $-0x1, %eax
je 0x2792
movq 0xfbb5(%rip), %rax      # 0x11fd0
movq 0x8(%rsp), %rcx
cmpq %rcx, (%rax)
je 0x2459
movq 0x8(%rsp), %rdi
callq 0x1180
testl %eax, %eax
js 0x2792
movl %eax, %edi
callq 0x3b24
movq 0x8(%rsp), %rdi
callq 0x10d0
andq $0x0, 0x10950(%rip)     # 0x12da0
cmpl $-0x1, %eax
je 0x2792
andq $0x0, 0x1093f(%rip)     # 0x12da0
movq %rbx, %rdi
callq 0x10a0
testl %eax, %eax
jne 0x2792
movq %rbx, %rdi
callq 0x10d0
cmpl $-0x1, %eax
je 0x2792
cmpl $0x0, 0x10923(%rip)     # 0x12dac
jg 0x2502
andq $0x0, 0x1090d(%rip)     # 0x12da0
cmpl $0x3, 0x11572(%rip)     # 0x13a0c
jne 0x24c5
callq 0x3a93
movb $0x0, 0x1091c(%rip)     # 0x12dc4
cmpb $0x0, 0x108fa(%rip)     # 0x12da9
jne 0x24c5
leaq 0x10918(%rip), %rdi     # 0x12dd0
callq 0x1080
testl %eax, %eax
jne 0x2792
movb $0x0, 0x108f8(%rip)     # 0x12dc4
jmp 0x2780
movq 0xfb20(%rip), %r14      # 0x11ff8
movq (%r14), %rdi
leaq 0xc07e(%rip), %rsi      # 0xe560
leaq 0x108e7(%rip), %rdx     # 0x12dd0
xorl %eax, %eax
callq 0x1160
callq 0x3a2f
movq (%r14), %rdi
callq 0x11a0
jmp 0x2291
movl 0x24(%rsp), %eax
movl 0x20(%rsp), %ecx
movl %eax, %edx
orl %ecx, %edx
jne 0x259c
movq 0xfadd(%rip), %rax      # 0x11ff8
movq (%rax), %rcx
leaq 0xc0af(%rip), %rdi      # 0xe5d4
pushq $0x15
popq %rsi
pushq $0x1
popq %rdx
callq 0x1240
jmp 0x248b
movq 0xfabc(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x114ba(%rip), %rdx     # 0x13a00
leaq 0xbefb(%rip), %rsi      # 0xe448
leaq 0x1087c(%rip), %rcx     # 0x12dd0
jmp 0x271f
movq 0xfa98(%rip), %rcx      # 0x11ff8
movq (%rcx), %rdi
movq 0x11496(%rip), %rdx     # 0x13a00
cmpl $0x1, %eax
leaq 0xc6b6(%rip), %rcx      # 0xec2a
leaq 0xabe4(%rip), %r9       # 0xd15f
cmoveq %rcx, %r9
leaq 0xbf32(%rip), %rsi      # 0xe4b8
leaq 0x10843(%rip), %rcx     # 0x12dd0
movl %eax, %r8d
xorl %eax, %eax
callq 0x1160
jmp 0x276d
leaq 0x38(%rsp), %rbx
movl %ecx, 0x4(%rbx)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x3(%rbx)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x2(%rbx)
movb %ah, 0x39(%rsp)
movb %al, (%rbx)
movl 0x1c(%rsp), %eax
movl 0x18(%rsp), %ecx
leaq 0x30(%rsp), %r15
movl %ecx, 0x4(%r15)
movl %eax, %ecx
shrl $0x18, %ecx
movb %cl, 0x3(%r15)
movl %eax, %ecx
shrl $0x10, %ecx
movb %cl, 0x2(%r15)
movb %ah, 0x31(%rsp)
movb %al, (%r15)
movq %rbx, %rdi
callq 0x3b4f
movsd %xmm0, 0x8(%rsp)
movq %r15, %rdi
callq 0x3b4f
movsd %xmm0, 0x28(%rsp)
leaq 0x40(%rsp), %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3b85
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3b85
movq 0xf9d1(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movsd 0x8(%rsp), %xmm2
movapd %xmm2, %xmm0
movsd 0x28(%rsp), %xmm3
divsd %xmm3, %xmm0
movsd 0xaa7a(%rip), %xmm1     # 0xd0c0
mulsd %xmm3, %xmm1
divsd %xmm2, %xmm1
divsd %xmm2, %xmm3
movsd 0xaa6e(%rip), %xmm2     # 0xd0c8
subsd %xmm3, %xmm2
mulsd 0xaa6a(%rip), %xmm2     # 0xd0d0
leaq 0xbf7d(%rip), %rsi      # 0xe5ea
movq %r14, %rdx
movq %rbx, %rcx
movb $0x3, %al
callq 0x1160
jmp 0x248b
movq 0xf972(%rip), %r14      # 0x11ff8
movq (%r14), %rdi
movq 0x11370(%rip), %rdx     # 0x13a00
leaq 0xbe49(%rip), %rsi      # 0xe4e0
xorl %eax, %eax
callq 0x1160
movq (%r14), %rdi
movq 0x11358(%rip), %rcx     # 0x13a00
leaq 0xbe63(%rip), %rsi      # 0xe512
movq %rcx, %rdx
xorl %eax, %eax
callq 0x1160
jmp 0x26f6
movq 0xf936(%rip), %rax      # 0x11ff8
movq (%rax), %r14
movq 0x11334(%rip), %r15     # 0x13a00
callq 0x1060
movl (%rax), %edi
callq 0x1250
leaq 0xbe5b(%rip), %rsi      # 0xe53a
leaq 0x10afa(%rip), %rcx     # 0x131e0
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %r8
xorl %eax, %eax
callq 0x1160
testq %rbx, %rbx
je 0x276d
movq %rbx, %rdi
jmp 0x2768
movq 0xf8f1(%rip), %rax      # 0x11ff8
movq (%rax), %rdi
movq 0x112ef(%rip), %rdx     # 0x13a00
leaq 0xbd7c(%rip), %rsi      # 0xe494
leaq 0x10ac1(%rip), %rcx     # 0x131e0
xorl %eax, %eax
callq 0x1160
jmp 0x276d
movq 0xf8c9(%rip), %rax      # 0x11ff8
movq (%rax), %rbx
movq 0x112c7(%rip), %r14     # 0x13a00
callq 0x1060
movl (%rax), %edi
callq 0x1250
leaq 0xbcaf(%rip), %rsi      # 0xe3fb
leaq 0x1067d(%rip), %rcx     # 0x12dd0
movq %rbx, %rdi
movq %r14, %rdx
movq %rax, %r8
xorl %eax, %eax
callq 0x1160
movq 0x8(%rsp), %rdi
callq 0x10d0
cmpl $0x0, 0x10654(%rip)     # 0x12dc8
jg 0x2780
movl $0x1, 0x10648(%rip)     # 0x12dc8
addq $0x1498, %rsp           # imm = 0x1498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3acb
callq 0x3894
leaq 0xc0db(%rip), %rdi      # 0xe87e
callq 0x38c1
leaq 0xbfa3(%rip), %rdi      # 0xe752
callq 0x38c1
leaq 0xc03a(%rip), %rdi      # 0xe7f5
callq 0x38c1