// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/ripmime.c
// Function: main
int main (int argc, char **argv)
{
   struct RIPMIME_globals glb;
   int result = 0;

   /* if the user has just typed in "ripmime" and nothing else, then we had better give them
    * the rundown on how to use this program */

   if (argc < 2)
   {
       fprintf (stderr, "%s\n%s", version, help);
       return RIPMIME_ERROR_INSUFFICIENT_PARAMETERS;
   }

   // Set the global pointer ripmime_globals to point to
   //      the glb struct, so that if we have a timeout condition
   //      we can use the data
   ripmime_globals = &glb;


   // Set up our initial logging mode - so that we can always get
   //              report messages if need be.

   LOGGER_set_output_mode (_LOGGER_STDOUT);

   // Perform system initialisations

   MIME_init ();
   RIPMIME_init (&glb);

   // Setup our default behaviours */

   MIME_set_uniquenames (1);
   MIME_set_paranoid (0);
   MIME_set_header_longsearch(1); // 20040310-0117:PLD - Added by default as it seems stable, use --disable-qmail-bounce to turn off
   MIME_set_renamemethod (_MIME_RENAME_METHOD_INFIX);


   RIPMIME_parse_parameters (&glb, argc, argv);


   // if our input filename wasn't specified, then we better let the user know!
   if (!glb.inputfile)
   {
       LOGGER_log("Error: No input file was specified\n");
       return RIPMIME_ERROR_NO_INPUT_FILE;
   }

   // Fire up the randomizer

   srand (time (NULL));

   // clean up the output directory name if required (remove any trailing /'s, as suggested by James Cownie 03/02/2001

   if (glb.dir[strlen (glb.dir) - 1] == '/')
   {
       glb.dir[strlen (glb.dir) - 1] = '\0';
   }

   // Create the output directory required as specified by the -d parameter

   if (glb.dir != defaultdir)
   {
       result = mkdir (glb.dir, S_IRWXU);

       // if we had a problem creating a directory, and it wasn't just
       // due to the directory already existing, then we have a bit of
       // a problem on our hands, hence, report it.
       //

       if ((result == -1) && (errno != EEXIST))
       {
           LOGGER_log("ripMIME: Cannot create directory '%s' (%s)\n",
                   glb.dir, strerror (errno));

           return RIPMIME_ERROR_CANT_CREATE_OUTPUT_DIR;
       }
   }

   // Unpack the contents
   result = RIPMIME_unpack(&glb);

   // Possible exit codes include;
   //      0 - all okay
   //      240 - processing stopped due to recursion limit
   if (glb.use_return_codes == 0) result = 0;
   return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x3c(%rbp)
cmpl $0x2, -0x8(%rbp)
jge 0x35e5
movq 0x22a3e(%rip), %rax     # 0x25ff8
movq (%rax), %rdi
leaq 0x15f55(%rip), %rsi     # 0x19519
leaq 0x22c45(%rip), %rdx     # 0x26210
leaq 0x22c8e(%rip), %rcx     # 0x26260
movb $0x0, %al
callq 0x2200
movl $0x4, -0x4(%rbp)
jmp 0x3734
leaq -0x38(%rbp), %rax
movq %rax, 0x23cd8(%rip)     # 0x272c8
movl $0x2, %edi
callq 0x11490
callq 0x6970
leaq -0x38(%rbp), %rdi
callq 0x3230
movl $0x1, %edi
callq 0x4050
xorl %edi, %edi
callq 0x4070
movl $0x1, %edi
callq 0x3de0
movl $0x1, %edi
callq 0x40c0
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0x2550
cmpq $0x0, -0x38(%rbp)
jne 0x365e
leaq 0x15ed4(%rip), %rdi     # 0x1951f
movb $0x0, %al
callq 0x117c0
movl $0x3, -0x4(%rbp)
jmp 0x3734
xorl %eax, %eax
movl %eax, %edi
callq 0x2260
movl %eax, %edi
callq 0x21b0
movq -0x30(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdi
callq 0x2100
movq %rax, %rcx
movq -0x48(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x2f, %eax
jne 0x36b3
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x30(%rbp), %rdi
callq 0x2100
movq %rax, %rcx
movq -0x50(%rbp), %rax
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
leaq 0x22b46(%rip), %rax     # 0x26200
cmpq %rax, -0x30(%rbp)
je 0x3715
movq -0x30(%rbp), %rdi
movl $0x1c0, %esi            # imm = 0x1C0
callq 0x20a0
movl %eax, -0x3c(%rbp)
cmpl $-0x1, -0x3c(%rbp)
jne 0x3713
callq 0x2050
cmpl $0x11, (%rax)
je 0x3713
movq -0x30(%rbp), %rax
movq %rax, -0x58(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x23a0
movq -0x58(%rbp), %rsi
movq %rax, %rdx
leaq 0x15e40(%rip), %rdi     # 0x19543
movb $0x0, %al
callq 0x117c0
movl $0x1, -0x4(%rbp)
jmp 0x3734
jmp 0x3715
leaq -0x38(%rbp), %rdi
callq 0x3360
movl %eax, -0x3c(%rbp)
cmpl $0x0, -0x28(%rbp)
jne 0x372e
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)