// File: /workspace/github_c_makefile_star2_O1/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, 0x110f8(%rip)     # 0x14de4
testq %rdi, %rdi
sete %cl
movl 0x11d34(%rip), %eax     # 0x15a2c
cmpl $0x1, %eax
setne %dl
andb %cl, %dl
cmpb $0x1, %dl
je 0x43f9
movq %rdi, %rbx
cmpl $0x3, %eax
je 0x3d4f
cmpl $0x2, %eax
je 0x3d2b
cmpl $0x1, %eax
jne 0x3d86
leaq 0x110ce(%rip), %rdi     # 0x14df0
leaq 0xc6c4(%rip), %rsi      # 0x103ed
jmp 0x3d35
leaq 0x110be(%rip), %rdi     # 0x14df0
movq %rbx, %rsi
callq 0x3b15
leaq 0x114bf(%rip), %rdi     # 0x15200
leaq 0xc6ad(%rip), %rsi      # 0x103f5
callq 0x3b15
jmp 0x3d86
leaq 0x1109a(%rip), %rdi     # 0x14df0
movq %rbx, %rsi
callq 0x3b15
leaq 0x1149b(%rip), %r14     # 0x15200
movq %r14, %rdi
movq %rbx, %rsi
callq 0x3b15
movq %r14, %rdi
callq 0x20f0
movl $0x327a622e, (%rax,%r14) # imm = 0x327A622E
movb $0x0, 0x4(%rax,%r14)
cmpl $0x1, 0x11c9f(%rip)     # 0x15a2c
je 0x3da3
leaq 0x1105a(%rip), %rdi     # 0x14df0
callq 0x51ce
testb %al, %al
je 0x4235
xorl %r15d, %r15d
leaq 0x103c3(%rip), %r12     # 0x14170
leaq 0x1103c(%rip), %rbx     # 0x14df0
movq (%r15,%r12), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x51f3
testb %al, %al
jne 0x3f37
addq $0x8, %r15
cmpq $0x20, %r15
jne 0x3db4
movl 0x11c51(%rip), %eax     # 0x15a2c
andl $-0x2, %eax
cmpl $0x2, %eax
jne 0x3e0d
leaq 0x11006(%rip), %rdi     # 0x14df0
leaq 0x80(%rsp), %rbx
movq %rbx, %rsi
callq 0x2190
movl $0xf000, %eax           # imm = 0xF000
andl 0x18(%rbx), %eax
cmpl $0x4000, %eax           # imm = 0x4000
je 0x426b
cmpl $0x3, 0x11c18(%rip)     # 0x15a2c
jne 0x3e52
cmpb $0x0, 0x10fad(%rip)     # 0x14dca
jne 0x3e52
leaq 0x10fca(%rip), %rdi     # 0x14df0
leaq 0x110(%rsp), %rsi
callq 0x2150
testl %eax, %eax
jne 0x3f60
movl $0xf000, %eax           # imm = 0xF000
andl 0x128(%rsp), %eax
cmpl $0x8000, %eax           # imm = 0x8000
jne 0x3f60
cmpl $0x3, 0x11bd3(%rip)     # 0x15a2c
jne 0x3e84
leaq 0x1139e(%rip), %rdi     # 0x15200
callq 0x51ce
testb %al, %al
je 0x3e84
cmpb $0x0, 0x10f58(%rip)     # 0x14dca
je 0x43cc
leaq 0x11381(%rip), %rdi     # 0x15200
callq 0x2080
cmpl $0x3, 0x11ba1(%rip)     # 0x15a2c
jne 0x3ec1
cmpb $0x0, 0x10f36(%rip)     # 0x14dca
jne 0x3ec1
leaq 0x10f53(%rip), %rdi     # 0x14df0
leaq 0x110(%rsp), %rbx
movq %rbx, %rsi
callq 0x2150
movl 0x10(%rbx), %ecx
decl %ecx
xorl %edi, %edi
testl %eax, %eax
cmovel %ecx, %edi
testl %edi, %edi
jg 0x4272
cmpl $0x3, 0x11b64(%rip)     # 0x15a2c
jne 0x3ee5
leaq 0x10f1f(%rip), %rdi     # 0x14df0
leaq 0x11f78(%rip), %rsi     # 0x15e50
callq 0x2190
testl %eax, %eax
jne 0x43e3
movl 0x11b41(%rip), %eax     # 0x15a2c
cmpl $0x3, %eax
je 0x3fb6
cmpl $0x2, %eax
je 0x3f70
cmpl $0x1, %eax
jne 0x4405
movq 0x100cf(%rip), %rax     # 0x13fd8
movq (%rax), %rbx
movq 0x100bd(%rip), %rax     # 0x13fd0
movq (%rax), %r14
movq %r14, %rdi
callq 0x21b0
movl %eax, %edi
callq 0x20c0
testl %eax, %eax
je 0x3fe6
callq 0x2793
jmp 0x4223
cmpb $0x0, 0x10e8d(%rip)     # 0x14dcb
jne 0x423c
cmpl $0x0, 0x10e9d(%rip)     # 0x14de8
jg 0x4223
movl $0x1, 0x10e8d(%rip)     # 0x14de8
jmp 0x4223
cmpb $0x0, 0x10e64(%rip)     # 0x14dcb
je 0x3f44
callq 0x253c
jmp 0x3f44
leaq 0x10e79(%rip), %rdi     # 0x14df0
leaq 0xc5b9(%rip), %rsi      # 0x10537
callq 0x2230
movq %rax, %rbx
movq 0x10043(%rip), %rax     # 0x13fd0
movq (%rax), %r14
movq %r14, %rdi
callq 0x21b0
movl %eax, %edi
callq 0x20c0
testl %eax, %eax
jne 0x43b2
testq %rbx, %rbx
jne 0x3fe6
callq 0x2737
jmp 0x4223
leaq 0x10e33(%rip), %rdi     # 0x14df0
leaq 0xc573(%rip), %rsi      # 0x10537
callq 0x2230
movq %rax, %rbx
callq 0x5238
testq %rax, %rax
je 0x43bf
movq %rax, %r14
testq %rbx, %rbx
je 0x43d6
cmpl $0x0, 0x10ddf(%rip)     # 0x14dcc
jg 0x4249
movq %r14, 0x10dc6(%rip)     # 0x14dc0
movb $0x1, 0x10de3(%rip)     # 0x14de4
movq %rbx, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x43e3
movq %r14, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x43e3
movl 0x10da9(%rip), %edx     # 0x14dd0
movl 0x10d9f(%rip), %ecx     # 0x14dcc
movl 0x10dac(%rip), %r8d     # 0x14de0
leaq 0xc(%rsp), %r12
movq %r12, %rdi
movq %r14, %rsi
callq 0x6ccd
movq %rax, %r15
cmpl $0x0, (%r12)
jne 0x40cb
cmpl $0x2, 0x10d77(%rip)     # 0x14dcc
jl 0x406b
movq 0xff9a(%rip), %rax      # 0x13ff8
movq (%rax), %rsi
movl $0xa, %edi
callq 0x2140
leaq 0x110(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %rbx, %rdi
callq 0x5368
testb %al, %al
jne 0x4119
movl $0x1, %esi
movl $0x1388, %edx           # imm = 0x1388
movq %r12, %rdi
movq %rbx, %rcx
callq 0x20d0
movq %rax, %rbp
movq %rbx, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x43e3
testl %ebp, %ebp
jle 0x40c4
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl %ebp, %ecx
callq 0x6e0b
cmpl $0x0, 0xc(%rsp)
je 0x4078
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 0x6f53
movl 0xc(%rsp), %eax
cmpl $-0x3, %eax
je 0x43e8
cmpl $-0x6, %eax
je 0x43e3
cmpl $-0x9, %eax
jne 0x43ed
callq 0x5442
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 0x6f53
cmpl $0x0, (%r12)
jne 0x40cb
movq %r14, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x43e3
movq %r14, %rdi
callq 0x21d0
cmpl $-0x1, %eax
je 0x43e3
movq 0xfe5e(%rip), %rax      # 0x13fd0
cmpq %r14, (%rax)
je 0x41aa
movq %r14, %rdi
callq 0x21b0
testl %eax, %eax
js 0x43e3
movl %eax, %edi
callq 0x5388
movq %r14, %rdi
callq 0x20e0
movq $0x0, 0x10c1f(%rip) # 0x14dc0
cmpl $-0x1, %eax
je 0x43e3
movq $0x0, 0x10c0b(%rip) # 0x14dc0
movq %rbx, %rdi
callq 0x20b0
testl %eax, %eax
jne 0x43e3
movq %rbx, %rdi
callq 0x20e0
cmpl $-0x1, %eax
je 0x43e3
cmpl $0x0, 0x10bef(%rip)     # 0x14dcc
jg 0x4253
movq $0x0, 0x10bd6(%rip) # 0x14dc0
cmpl $0x3, 0x1183b(%rip)     # 0x15a2c
jne 0x421c
callq 0x52f5
movb $0x0, 0x10be5(%rip)     # 0x14de4
cmpb $0x0, 0x10bc3(%rip)     # 0x14dc9
jne 0x421c
leaq 0x10be1(%rip), %rdi     # 0x14df0
callq 0x2080
testl %eax, %eax
jne 0x43e3
movb $0x0, 0x10bc1(%rip)     # 0x14de4
addq $0x1498, %rsp           # imm = 0x1498
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x24b7
jmp 0x4223
movq %r14, %rdi
callq 0x2513
jmp 0x3f44
callq 0x27e4
jmp 0x3ff3
movl 0x2c(%rsp), %eax
movl 0x28(%rsp), %ecx
movl %eax, %edx
orl %ecx, %edx
jne 0x4279
callq 0x2812
jmp 0x41df
callq 0x2834
jmp 0x4223
callq 0x25a3
jmp 0x4223
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 0xadfb(%rip), %xmm1     # 0xf0c0
xorpd %xmm3, %xmm3
xorl %eax, %eax
movsd 0xadf5(%rip), %xmm0     # 0xf0c8
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 0x42d3
movsd %xmm3, 0x38(%rsp)
movsd 0xadbe(%rip), %xmm1     # 0xf0c0
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 0x4308
leaq 0x40(%rsp), %rbx
leaq 0x18(%rsp), %rsi
movq %rbx, %rdi
movsd %xmm3, 0x30(%rsp)
callq 0x53b3
leaq 0x60(%rsp), %r14
leaq 0x10(%rsp), %rsi
movq %r14, %rdi
callq 0x53b3
movq 0xfc9e(%rip), %rax      # 0x13ff8
movq (%rax), %rdi
movsd 0x38(%rsp), %xmm2
movapd %xmm2, %xmm0
movsd 0x30(%rsp), %xmm3
divsd %xmm3, %xmm0
movsd 0xad57(%rip), %xmm1     # 0xf0d0
mulsd %xmm3, %xmm1
divsd %xmm2, %xmm1
divsd %xmm2, %xmm3
movsd 0xad33(%rip), %xmm2     # 0xf0c0
subsd %xmm3, %xmm2
mulsd 0xad3f(%rip), %xmm2     # 0xf0d8
leaq 0xc24d(%rip), %rsi      # 0x105ed
movq %rbx, %rdx
movq %r14, %rcx
movb $0x3, %al
callq 0x2180
jmp 0x41df
movq %rbx, %rdi
callq 0x26cc
jmp 0x4223
movq %rbx, %rdi
callq 0x2662
jmp 0x4223
callq 0x2562
jmp 0x4223
movq %r14, %rdi
callq 0x25fd
jmp 0x4223
callq 0x532d
callq 0x516d
leaq 0xc48d(%rip), %rdi      # 0x10881
callq 0x519c
leaq 0xc355(%rip), %rdi      # 0x10755
callq 0x519c
leaq 0xc3ec(%rip), %rdi      # 0x107f8
callq 0x519c