// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/mime.c
// Function: MIME_unpack_single
int MIME_unpack_single( char *unpackdir, char *mpname, int current_recursion_level, struct SS_object *ss )
{
    FILE *fi;           /* Pointer for the MIME file we're going to be going through */
    int result = 0;

    if (current_recursion_level > glb.max_recursion_level)
    {
        LOGGER_log("%s:%d:MIME_unpack_single:WARNING: Current recursion level of %d is greater than permitted %d",FL, current_recursion_level, glb.max_recursion_level);
        return MIME_ERROR_RECURSION_LIMIT_REACHED;
    }

    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_single:DEBUG: dir=%s packname=%s level=%d (max = %d)\n",FL, unpackdir, mpname, current_recursion_level, glb.max_recursion_level);
    /* if we're reading in from STDIN */
    if( mpname[0] == '-' && mpname[1] == '\0' )
    {
        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_single:DEBUG: STDIN opened...\n",FL);
        fi = stdin;
    }
    else
    {
        fi = fopen(mpname,"r");
        if (!fi)
        {
            LOGGER_log("%s:%d:MIME_unpack_single:ERROR: Cannot open file '%s' for reading.\n",FL, mpname);
            return -1;
        }
        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_single:DEBUG: Input file (%s) opened...\n",FL, mpname);
    }
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_single:DEBUG: Checking input streams...\n",FL);
    /* check to see if we had problems opening the file */
    if (fi == NULL)
    {
        LOGGER_log("%s:%d:MIME_unpack_single:ERROR: Could not open mailpack file '%s' (%s)",FL, mpname, strerror(errno));
        return -1;
    }
    // 20040317-2359:PLD
    result = MIME_unpack_single_fp(unpackdir,fi,current_recursion_level , ss);
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_single:DEBUG: result = %d, recursion = %d, filename = '%s'", FL, result, current_recursion_level, mpname );
    if ((current_recursion_level > 1)&&(result == 241)) result = 0;
    fclose(fi);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq %rcx, -0x28(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x1c(%rbp), %eax
cmpl 0x20669(%rip), %eax     # 0x27f40
jle 0x7909
movl -0x1c(%rbp), %ecx
movl 0x2065d(%rip), %r8d     # 0x27f40
leaq 0x140fd(%rip), %rdi     # 0x1b9e7
leaq 0x11bde(%rip), %rsi     # 0x194cf
movl $0xc34, %edx            # imm = 0xC34
movb $0x0, %al
callq 0x117c0
movl $0xf0, -0x4(%rbp)
jmp 0x7acd
cmpl $0x1, 0x1fde0(%rip)     # 0x276f0
jl 0x7941
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
movl -0x1c(%rbp), %r9d
movl 0x2061c(%rip), %eax     # 0x27f40
leaq 0x14119(%rip), %rdi     # 0x1ba44
leaq 0x11b9d(%rip), %rsi     # 0x194cf
movl $0xc38, %edx            # imm = 0xC38
movl %eax, (%rsp)
movb $0x0, %al
callq 0x117c0
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x798d
movq -0x18(%rbp), %rax
movsbl 0x1(%rax), %eax
cmpl $0x0, %eax
jne 0x798d
cmpl $0x1, 0x1fd8f(%rip)     # 0x276f0
jl 0x797d
leaq 0x14122(%rip), %rdi     # 0x1ba8c
leaq 0x11b5e(%rip), %rsi     # 0x194cf
movl $0xc3c, %edx            # imm = 0xC3C
movb $0x0, %al
callq 0x117c0
movq 0x1e654(%rip), %rax     # 0x25fd8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x79fb
movq -0x18(%rbp), %rdi
leaq 0x15cfc(%rip), %rsi     # 0x1d694
callq 0x2330
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x79d2
movq -0x18(%rbp), %rcx
leaq 0x1410a(%rip), %rdi     # 0x1babd
leaq 0x11b15(%rip), %rsi     # 0x194cf
movl $0xc44, %edx            # imm = 0xC44
movb $0x0, %al
callq 0x117c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7acd
cmpl $0x1, 0x1fd17(%rip)     # 0x276f0
jl 0x79f9
movq -0x18(%rbp), %rcx
leaq 0x1411b(%rip), %rdi     # 0x1bb01
leaq 0x11ae2(%rip), %rsi     # 0x194cf
movl $0xc47, %edx            # imm = 0xC47
movb $0x0, %al
callq 0x117c0
jmp 0x79fb
cmpl $0x1, 0x1fcee(%rip)     # 0x276f0
jl 0x7a1e
leaq 0x14131(%rip), %rdi     # 0x1bb3c
leaq 0x11abd(%rip), %rsi     # 0x194cf
movl $0xc49, %edx            # imm = 0xC49
movb $0x0, %al
callq 0x117c0
cmpq $0x0, -0x30(%rbp)
jne 0x7a63
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x23a0
movq -0x40(%rbp), %rcx
movq %rax, %r8
leaq 0x14130(%rip), %rdi     # 0x1bb77
leaq 0x11a81(%rip), %rsi     # 0x194cf
movl $0xc4d, %edx            # imm = 0xC4D
movb $0x0, %al
callq 0x117c0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x7acd
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
movl -0x1c(%rbp), %edx
movq -0x28(%rbp), %rcx
callq 0x9030
movl %eax, -0x34(%rbp)
cmpl $0x1, 0x1fc6f(%rip)     # 0x276f0
jl 0x7aa8
movl -0x34(%rbp), %ecx
movl -0x1c(%rbp), %r8d
movq -0x18(%rbp), %r9
leaq 0x14129(%rip), %rdi     # 0x1bbbe
leaq 0x11a33(%rip), %rsi     # 0x194cf
movl $0xc52, %edx            # imm = 0xC52
movb $0x0, %al
callq 0x117c0
cmpl $0x1, -0x1c(%rbp)
jle 0x7abe
cmpl $0xf1, -0x34(%rbp)
jne 0x7abe
movl $0x0, -0x34(%rbp)
movq -0x30(%rbp), %rdi
callq 0x20e0
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)