// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/mime.c
// Function: MIME_doubleCR_decode
int MIME_doubleCR_decode( char *filename, char *unpackdir, struct MIMEH_header_info *hinfo, int current_recursion_level )
{
    int result = 0;
    struct MIMEH_header_info h;
    char *p;
    // PLD:260303-1317
    //  if ((p=strrchr(filename,'/'))) p++;
    //  else p = filename;

    p = filename;
    // * Initialise the header fields
    h.uudec_name[0] = '\0';
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_doubleCR_decode:DEBUG: filename=%s, path=%s, recursion=%d", FL, filename, unpackdir, current_recursion_level );
    memcpy(&h, hinfo, sizeof(h));
    // Works for ripMIME    snprintf(h.filename, sizeof(h.filename), "%s/%s", unpackdir, p);
    snprintf(h.filename, sizeof(h.filename), "%s", p); /// Works for Xamime
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_doubleCR_decode:DEBUG: header.filename = %s", FL, h.filename );
    if (MIME_is_file_RFC822(filename))
    {
        if (MIME_VERBOSE) LOGGER_log("Attempting to decode Double-CR delimeted MIME attachment '%s'\n",filename);
        result = MIME_unpack( unpackdir, filename, current_recursion_level ); // 20040305-1303:PLD - Capture the result of the unpack and propagate up
    }
    else if (UUENCODE_is_file_uuencoded(h.filename))
    {
        if (MIME_VERBOSE) LOGGER_log("Attempting to decode UUENCODED attachment from Double-CR delimeted attachment '%s'\n",filename);
        UUENCODE_set_doubleCR_mode(1);
        result = UUENCODE_decode_uu(NULL, unpackdir, filename, h.uudec_name, _MIMEH_FILENAMELEN_MAX , 1, 1 );
        UUENCODE_set_doubleCR_mode(0);
        glb.attachment_count += result;
        result = 0;
    }
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x18d80, %rsp          # imm = 0x18D80
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18d70(%rbp)
movb $0x0, -0x11d8(%rbp)
cmpl $0x1, 0x21586(%rip)     # 0x276f0
jl 0x6192
movq -0x8(%rbp), %rcx
movq -0x10(%rbp), %r8
movl -0x1c(%rbp), %r9d
leaq 0x1430a(%rip), %rdi     # 0x1a489
leaq 0x13349(%rip), %rsi     # 0x194cf
movl $0x760, %edx            # imm = 0x760
movb $0x0, %al
callq 0x117c0
movq -0x18(%rbp), %rsi
leaq -0x18d68(%rbp), %rdi
movl $0x18d48, %edx          # imm = 0x18D48
callq 0x2250
leaq -0x18d68(%rbp), %rdi
addq $0x5efd, %rdi           # imm = 0x5EFD
movq -0x18d70(%rbp), %rcx
movl $0x1001, %esi           # imm = 0x1001
leaq 0x18de2(%rip), %rdx     # 0x1efaa
movb $0x0, %al
callq 0x2130
cmpl $0x1, 0x2151a(%rip)     # 0x276f0
jl 0x6200
leaq -0x18d68(%rbp), %rcx
addq $0x5efd, %rcx           # imm = 0x5EFD
leaq 0x142e1(%rip), %rdi     # 0x1a4ce
leaq 0x132db(%rip), %rsi     # 0x194cf
movl $0x764, %edx            # imm = 0x764
movb $0x0, %al
callq 0x117c0
movq -0x8(%rbp), %rdi
callq 0x4580
cmpl $0x0, %eax
je 0x6241
cmpl $0x0, 0x214c7(%rip)     # 0x276dc
jle 0x6229
movq -0x8(%rbp), %rsi
leaq 0x142e3(%rip), %rdi     # 0x1a505
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x62e0
movl %eax, -0x20(%rbp)
jmp 0x62d2
leaq -0x18d68(%rbp), %rdi
addq $0x5efd, %rdi           # imm = 0x5EFD
callq 0x13380
cmpl $0x0, %eax
je 0x62d0
cmpl $0x0, 0x2147c(%rip)     # 0x276dc
jle 0x6274
movq -0x8(%rbp), %rsi
leaq 0x142d7(%rip), %rdi     # 0x1a544
movb $0x0, %al
callq 0x117c0
movl $0x1, %edi
callq 0x13160
movq -0x10(%rbp), %rsi
movq -0x8(%rbp), %rdx
leaq -0x18d68(%rbp), %rcx
addq $0x17b90, %rcx          # imm = 0x17B90
xorl %eax, %eax
movl %eax, %edi
movl $0x1000, %r8d           # imm = 0x1000
movl $0x1, %r9d
movl $0x1, (%rsp)
callq 0x134d0
movl %eax, -0x20(%rbp)
xorl %edi, %edi
callq 0x13160
movl -0x20(%rbp), %eax
addl 0x21c49(%rip), %eax     # 0x27f0c
movl %eax, 0x21c43(%rip)     # 0x27f0c
movl $0x0, -0x20(%rbp)
jmp 0x62d2
movl -0x20(%rbp), %eax
addq $0x18d80, %rsp          # imm = 0x18D80
popq %rbp
retq
nop