// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/mime.c
// Function: MIME_decode_encoding
int MIME_decode_encoding( FFGET_FILE *f, char *unpackdir, struct MIMEH_header_info *hinfo, struct SS_object *ss )
{
    int keep = 1;
    int result = -1;

    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Start:DEBUG: (%s)\n",FL, hinfo->filename);

    // If we have a valid filename, then put it through the process of
    //  cleaning and filtering
    if (isprint((int)hinfo->filename[0]))
    {
        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Filename is valid, cleaning\n",FL);
        FNFILTER_filter(hinfo->filename, _MIMEH_FILENAMELEN_MAX);   /* check out thefilename for ISO filenames */
    }

    // If the filename is NOT valid [doesn't have a printable first char]
    //  then we must create a new file name for it.
    //
    if (hinfo->filename[0] == '\0')
    {
        if (glb.name_by_type == 1)
        {
            // If we're to name our nameless files based on the content-type
            //      then we need to get the content-type string from the hinfo
            //      and then strip it of any nasty characters (such as / and \)
            char *filename_prefix;
            filename_prefix = strdup( hinfo->content_type_string );
            if (filename_prefix != NULL)
            {
                char *pp;
                pp = filename_prefix;
                while (*pp) { if ((*pp == '/') || (*pp == '\\')) *pp = '-'; pp++; }
                snprintf( hinfo->filename, _MIMEH_FILENAMELEN_MAX, "%s%s%d", glb.blankfileprefix_expliticly_set?glb.blankfileprefix:"", filename_prefix, glb.filecount );
                free(filename_prefix);
            } else {
                snprintf( hinfo->filename, _MIMEH_FILENAMELEN_MAX, "%s%d", glb.blankfileprefix, glb.filecount );
            }
        } else {
            // If we don't care to rename our files based on the content-type
            //      then we'll simply use the blankfileprefix.
            snprintf( hinfo->filename, _MIMEH_FILENAMELEN_MAX, "%s%d", glb.blankfileprefix, glb.filecount );
        }
        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Filename is empty, setting to default...(%s)\n",FL, hinfo->filename);
        if (glb.no_nameless) keep = 0;
        glb.filecount++;
    }
    else if (strncmp(hinfo->filename, glb.blankfileprefix, strlen(glb.blankfileprefix)) != 0)
    {
        // If the filename does not contain the blankfile prefix at the beginning, then we
        //  will consider it a normal attachment, thus, we
        // need to increment the attachment count
        glb.attachment_count++;
    }
    // If we are required to have "unique" filenames for everything, rather than
    //  allowing ripMIME to overwrite stuff, then we put the filename through
    //      its tests here
    if ((glb.unique_names)&&(keep))
    {
        MIME_test_uniquename( unpackdir, hinfo->filename, glb.rename_method );
    }
    // If the calling program requested verbosity, then indicate that we're decoding
    //      the file here
    if ((keep)&&(MIME_VERBOSE))
    {
        if (MIME_VERBOSE_12)
        {
            LOGGER_log("Decoding: %s\n", hinfo->filename);
        } else {
            // Now, please bare with me on this horrid little piece of tortured code,
            // ... basically, now that we're using LOGGER_log to generate our output, we
            // need to compose everything onto a single LOGGER_log() call, otherwise our
            // output will get split into several lines, not entirely the most plesant
            // thing we want to see when we've got another program most likely reading
            // the output.
            //
            // The %s%s pair is DELIBERATELY pressed up against the 'Decoding' word because
            // otherwise, if we are not outputting any data, we'll end up with a double
            // space between Decoding and filename, certainly not very good thing to do
            // if we're trying to present a consistant output.
            //
            // The parameters for the content-type output are decided on by the result
            // of the MIMEH_get_verbosity_contenttype() call.  If the call returns > 0
            // then the TRUE token is selected to be displayed, else the FALSE token
            // ( in this case, an empty string "" ) is selected.
            // The format of the evaluation is:
            //
            //      (logic-test?true-expression:false-expression)
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: About to execute callback [0x%p]",FL,glb.filename_decoded_reporter);
            if (glb.filename_decoded_reporter != NULL)
            {
                glb.filename_decoded_reporter( hinfo->filename, (MIMEH_get_verbosity_contenttype()?hinfo->content_type_string:NULL));
            }

        } // If we were using the new filename telling format
    } // If we were telling the filename (verbosity)
    if (1)
    {
        char *fp;
        /** Find the start of the filename. **/
        fp = strrchr(hinfo->filename, '/');
        if (fp) fp++; else fp = hinfo->filename;
        //LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Pushing filename %s to the stack",FL,fp);
        // 20040305-1419:PLD
        // Store the filename we're going to use to save the file to in the filename stack
        SS_push(ss, fp, strlen(fp));
    }
    // Select the decoding method based on the content transfer encoding
    //  method which we read from the headers

    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: ENCODING = %d\n",FL, hinfo->content_transfer_encoding);
    switch (hinfo->content_transfer_encoding)
    {
        case _CTRANS_ENCODING_B64:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding BASE64 format\n",FL);
            result = MIME_decode_64(f, unpackdir, hinfo);
            switch (result) {
                case MIME_ERROR_B64_INPUT_STREAM_EOF:
                    break;
                case MIME_BASE64_STATUS_HIT_BOUNDARY:
                    result = 0;
                    break;
                case 0:
                    result = MIME_decode_64_cleanup(f, unpackdir, hinfo);
                    break;
                default:
                    break;
            }
            break;
        case _CTRANS_ENCODING_7BIT:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding 7BIT format\n",FL);
            result = MIME_decode_text(f, unpackdir, hinfo, keep);
            break;
        case _CTRANS_ENCODING_8BIT:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding 8BIT format\n",FL);
            result = MIME_decode_text(f, unpackdir, hinfo, keep);
            break;
        case _CTRANS_ENCODING_BINARY:
        case _CTRANS_ENCODING_RAW:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding RAW format\n",FL);
            result = MIME_decode_raw(f, unpackdir, hinfo, keep);
            break;
        case _CTRANS_ENCODING_QP:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding Quoted-Printable format\n",FL);
            result = MIME_decode_text(f, unpackdir, hinfo, keep);
            break;
        case _CTRANS_ENCODING_UUENCODE:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding UUENCODED format\n",FL);
            // Added as a test - remove if we can get this to work in a better way
            snprintf(hinfo->uudec_name,sizeof(hinfo->uudec_name),"%s",hinfo->filename);
            result = UUENCODE_decode_uu(f, unpackdir, hinfo->filename, hinfo->uudec_name, sizeof(hinfo->uudec_name), 0, keep );
            glb.attachment_count += result;
            // Because this is a file-count, it's not really an 'error result' as such, so, set the
            //      return code back to 0!
            result = 0;
            break;
        case _CTRANS_ENCODING_UNKNOWN:
            switch (hinfo->content_disposition) {
                case _CDISPOSITION_FORMDATA:
                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding UNKNOWN format of FORMDATA disposition\n",FL);
                    result = MIME_decode_raw(f, unpackdir, hinfo, keep);
                    break;
                default:
                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding UNKNOWN format\n",FL);
                    result = MIME_decode_text(f, unpackdir, hinfo, keep);
            }
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: UNKNOWN Decode completed, result = %d\n",FL,result);
            break;
        case _CTRANS_ENCODING_UNSPECIFIED:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding UNSPECIFIED format\n",FL);
            result = MIME_decode_text(f, unpackdir, hinfo, keep);
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding result for UNSPECIFIED format = %d\n",FL, result);
            // 20040114-1236:PLD: Added nested mail checking
            //
            // Sometimes mailpacks have false headers at the start, resulting
            //      in ripMIME terminating the recursion process too early.  This
            //      little test here checks to see if the output of the file is
            //      a nested MIME email (or even an ordinary email
            //
            //  It should be noted, that the reason why the test occurs /here/ is
            //      because dud headers will always result in a UNSPECIFIED encoding
            //
            //  Original sample mailpack was sent by Farit - thanks.
            if (1)
            {
                snprintf(hinfo->scratch,sizeof(hinfo->scratch),"%s/%s",unpackdir,hinfo->filename);
                LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG:REMOVEME: Testing for RFC822 headers in file %s",FL,hinfo->scratch);
                if (MIME_is_file_RFC822(hinfo->scratch) > 0 )
                {
                    // 20040305-1304:PLD: unpack the file, propagate result upwards
                    result = MIME_unpack_single( unpackdir, hinfo->scratch, (hinfo->current_recursion_level+1),ss );
                }
            }
            break;
        default:
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding format is not defined (%d)\n",FL, hinfo->content_transfer_encoding);
            result = MIME_decode_raw(f, unpackdir, hinfo, keep);
            break;
    }
    // Analyze our results
    switch (result) {
        case 0:
            break;
        case MIME_STATUS_ZERO_FILE:
            return MIME_STATUS_ZERO_FILE;
            break;
        case MIME_ERROR_FFGET_EMPTY:
            return result;
            break;
        case MIME_ERROR_RECURSION_LIMIT_REACHED:
            return result;
            break;
		  default: 
				return result;
    }

    if ((result != -1)&&(result != MIME_STATUS_ZERO_FILE))
    {
#ifdef RIPOLE
        // If we have OLE decoding active and compiled in, then
        //      do a quick attempt at decoding the file, fortunately
        //      because the ripOLE engine detects if the file is not an
        //      OLE file, it does not have a major impact on the
        //      performance of the ripMIME decoding engine
        if (glb.decode_ole > 0)
        {
            MIME_decode_OLE( unpackdir, hinfo, 0 );
        }
#endif

        // If our content-type was TNEF, then we need to decode it
        //      using an external decoding engine (see tnef/tnef.c)
        // Admittingly, this is not the most ideal way of picking out
        //      TNEF files from our decoded attachments, but, for now
        //      it'll have to do, besides, it does work fine, without any
        //      side-effects
        if (hinfo->content_type == _CTYPE_TNEF)
        {
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Decoding TNEF format\n",FL);
            glb.attachment_count++;
            MIME_decode_TNEF( unpackdir, hinfo, 0 );
        } // Decode TNEF

        // Look for Microsoft MHT files... and try decode them.
        //  MHT files are just embedded email files, except they're usually
        //  encoded as BASE64... so, you have to -unencode- them, to which
        //  you find out that lo, you have another email.

        if ((strstr(hinfo->filename,".mht"))||(strstr(hinfo->name,".mht")) )
        {
            if (glb.decode_mht != 0)
            {
                //  Patched 26-01-03: supplied by Chris Hine
                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Microsoft MHT format email filename='%s'\n",FL, hinfo->filename);
                snprintf(hinfo->scratch,sizeof(hinfo->scratch),"%s/%s",unpackdir,hinfo->filename);

                // 20040305-1304:PLD: unpack the file, propagate result upwards
                result = MIME_unpack_single( unpackdir, hinfo->scratch, (hinfo->current_recursion_level+1),ss );
            }
        } // Decode MHT files
    } // If result != -1
    // End.

    MIME_generate_multiple_hardlink_filenames(hinfo,unpackdir);
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_encoding:DEBUG: Done for filename = '%s'",FL,hinfo->filename);
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, 0x10(%rsp)
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r13
cmpl $0x0, 0x1bad1(%rip)     # 0x21300
jle 0x5852
leaq 0x5efd(%r14), %rcx
leaq 0xe192(%rip), %rdi      # 0x139d1
leaq 0xcb99(%rip), %rsi      # 0x123df
movl $0x8b7, %edx            # imm = 0x8B7
xorl %eax, %eax
callq 0xc84f
callq 0x23e0
movq (%rax), %rcx
leaq 0x5efd(%r14), %r15
movsbq 0x5efd(%r14), %rax
testb $0x40, 0x1(%rcx,%rax,2)
je 0x58a3
cmpl $0x0, 0x1ba89(%rip)     # 0x21300
jle 0x5893
leaq 0xe186(%rip), %rdi      # 0x13a06
leaq 0xcb58(%rip), %rsi      # 0x123df
movl $0x8bd, %edx            # imm = 0x8BD
xorl %eax, %eax
callq 0xc84f
movq %r15, %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0xe573
movb (%r15), %al
testb %al, %al
je 0x58dd
leaq 0x1b63a(%rip), %rbp     # 0x20ee8
movq %rbp, %rdi
callq 0x2110
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x20a0
movl $0x1, %ebp
testl %eax, %eax
je 0x59b8
leaq 0x1c244(%rip), %rax     # 0x21b1c
jmp 0x59b6
cmpl $0x1, 0x1c244(%rip)     # 0x21b28
jne 0x5915
leaq 0x27fc(%r14), %rdi
callq 0x23a0
testq %rax, %rax
je 0x5915
movq %rax, %rbp
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x590d
cmpl $0x5c, %ecx
je 0x590d
testl %ecx, %ecx
jne 0x5910
jmp 0x593b
movb $0x2d, (%rax)
incq %rax
jmp 0x58fa
movl 0x1b5c8(%rip), %r8d     # 0x20ee4
leaq 0xe124(%rip), %rdx      # 0x13a47
leaq 0x1b5be(%rip), %rcx     # 0x20ee8
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
jmp 0x597c
cmpl $0x0, 0x1b9a6(%rip)     # 0x212e8
leaq 0x10981(%rip), %rax     # 0x162ca
leaq 0x1b598(%rip), %rcx     # 0x20ee8
cmoveq %rax, %rcx
movl 0x1b589(%rip), %r9d     # 0x20ee4
leaq 0xe0e3(%rip), %rdx      # 0x13a45
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %rbp, %r8
xorl %eax, %eax
callq 0x2140
movq %rbp, %rdi
callq 0x2030
cmpl $0x0, 0x1b97d(%rip)     # 0x21300
jle 0x59a2
leaq 0xe0c0(%rip), %rdi      # 0x13a4c
leaq 0xca4c(%rip), %rsi      # 0x123df
movl $0x8dc, %edx            # imm = 0x8DC
movq %r15, %rcx
xorl %eax, %eax
callq 0xc84f
xorl %ebp, %ebp
cmpl $0x0, 0x1c179(%rip)     # 0x21b24
sete %bpl
leaq 0x1b52e(%rip), %rax     # 0x20ee4
incl (%rax)
testl %ebp, %ebp
je 0x59d6
cmpl $0x0, 0x1b94d(%rip)     # 0x21310
je 0x59d6
movl 0x1b949(%rip), %edx     # 0x21314
movq %rbx, %rdi
movq %r15, %rsi
callq 0x3705
testl %ebp, %ebp
je 0x5a4f
cmpl $0x0, 0x1b90b(%rip)     # 0x212ec
jle 0x5a4f
cmpl $0x0, 0x1b906(%rip)     # 0x212f0
jle 0x59ff
leaq 0xe0a9(%rip), %rdi      # 0x13a9c
movq %r15, %rsi
xorl %eax, %eax
callq 0xc84f
jmp 0x5a4f
cmpl $0x0, 0x1b8fa(%rip)     # 0x21300
jle 0x5a29
movq 0x1e949(%rip), %rcx     # 0x24358
leaq 0xe094(%rip), %rdi      # 0x13aaa
leaq 0xc9c2(%rip), %rsi      # 0x123df
movl $0x909, %edx            # imm = 0x909
xorl %eax, %eax
callq 0xc84f
movq 0x1e928(%rip), %r12     # 0x24358
testq %r12, %r12
je 0x5a4f
callq 0x7f05
leaq 0x27fc(%r14), %rcx
xorl %esi, %esi
testl %eax, %eax
cmovneq %rcx, %rsi
movq %r15, %rdi
callq *%r12
movq %r15, %rdi
movl $0x2f, %esi
callq 0x2150
leaq 0x1(%rax), %r12
testq %rax, %rax
cmoveq %r15, %r12
movq %r12, %rdi
callq 0x2110
movq 0x10(%rsp), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x32eb
cmpl $0x0, 0x1b87a(%rip)     # 0x21300
jle 0x5aa9
movl 0x166f8(%r14), %ecx
leaq 0xe057(%rip), %rdi      # 0x13aed
leaq 0xc942(%rip), %rsi      # 0x123df
movl $0x91f, %edx            # imm = 0x91F
xorl %eax, %eax
callq 0xc84f
movl 0x166f8(%r14), %ecx
leal -0x64(%rcx), %eax
cmpl $0x6, %eax
ja 0x5af4
leaq 0xca79(%rip), %rcx      # 0x12538
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x1b831(%rip)     # 0x21300
jle 0x5d67
leaq 0xe0ec(%rip), %rdi      # 0x13bc8
leaq 0xc8fc(%rip), %rsi      # 0x123df
movl $0x93c, %edx            # imm = 0x93C
xorl %eax, %eax
callq 0xc84f
jmp 0x5d67
cmpl $-0x1, %ecx
je 0x5b70
testl %ecx, %ecx
jne 0x5d44
cmpl $0x12c, 0x17100(%r14) # imm = 0x12C
movl 0x1b7ee(%rip), %eax     # 0x21300
jne 0x5ebc
testl %eax, %eax
jle 0x5b36
leaq 0xe15d(%rip), %rdi      # 0x13c80
leaq 0xc8b5(%rip), %rsi      # 0x123df
movl $0x950, %edx            # imm = 0x950
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3da0
jmp 0x5eea
cmpl $0x0, 0x1b7ae(%rip)     # 0x21300
jle 0x5cc7
leaq 0xe031(%rip), %rdi      # 0x13b90
leaq 0xc879(%rip), %rsi      # 0x123df
movl $0x937, %edx            # imm = 0x937
jmp 0x5cc0
cmpl $0x0, 0x1b789(%rip)     # 0x21300
jle 0x5b93
leaq 0xe1d7(%rip), %rdi      # 0x13d57
leaq 0xc858(%rip), %rsi      # 0x123df
movl $0x95a, %edx            # imm = 0x95A
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x4206
movl %eax, %ebp
cmpl $0x0, 0x1b754(%rip)     # 0x21300
jle 0x5bca
leaq 0xe1e1(%rip), %rdi      # 0x13d96
leaq 0xc823(%rip), %rsi      # 0x123df
movl $0x95c, %edx            # imm = 0x95C
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc84f
leaq 0xc83b(%rip), %rdx      # 0x1240c
movl $0x27f7, %esi           # imm = 0x27F7
movq %r14, %rdi
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2140
leaq 0xe1f8(%rip), %rdi      # 0x13de5
leaq 0xc7eb(%rip), %rsi      # 0x123df
movl $0x96b, %edx            # imm = 0x96B
movq %r14, %rcx
xorl %eax, %eax
callq 0xc84f
movq %r14, %rdi
callq 0x39aa
testl %eax, %eax
je 0x5d79
movl 0x18b94(%r14), %edx
incl %edx
movq %rbx, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rcx
callq 0x5f1a
jmp 0x5d77
cmpl $0x0, 0x1b6c8(%rip)     # 0x21300
jle 0x5cc7
leaq 0xdfba(%rip), %rdi      # 0x13bff
leaq 0xc793(%rip), %rsi      # 0x123df
movl $0x940, %edx            # imm = 0x940
jmp 0x5cc0
cmpl $0x0, 0x1b6a6(%rip)     # 0x21300
jle 0x5c76
leaq 0xdebb(%rip), %rdi      # 0x13b1e
leaq 0xc775(%rip), %rsi      # 0x123df
movl $0x923, %edx            # imm = 0x923
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x47d4
cmpl $0x1, %eax
je 0x5d81
movl %eax, %ebp
testl %eax, %eax
jne 0x5d79
movq %r13, %rdi
callq 0x4e28
jmp 0x5d81
cmpl $0x0, 0x1b655(%rip)     # 0x21300
jle 0x5cc7
leaq 0xdea4(%rip), %rdi      # 0x13b58
leaq 0xc724(%rip), %rsi      # 0x123df
movl $0x933, %edx            # imm = 0x933
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x4206
jmp 0x5d77
cmpl $0x0, 0x1b61d(%rip)     # 0x21300
jle 0x5cff
leaq 0xdf57(%rip), %rdi      # 0x13c43
leaq 0xc6ec(%rip), %rsi      # 0x123df
movl $0x944, %edx            # imm = 0x944
xorl %eax, %eax
callq 0xc84f
leaq 0x17b90(%r14), %r12
leaq 0x12353(%rip), %rdx     # 0x18060
movl $0x1001, %esi           # imm = 0x1001
movq %r12, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2140
movl %ebp, (%rsp)
movq %r13, %rdi
movq %rbx, %rsi
movq %r15, %rdx
movq %r12, %rcx
movl $0x1001, %r8d           # imm = 0x1001
xorl %r9d, %r9d
callq 0xda45
addl %eax, 0x1bdda(%rip)     # 0x21b1c
jmp 0x5d81
cmpl $0x0, 0x1b5b5(%rip)     # 0x21300
jle 0x5d67
leaq 0xe0e2(%rip), %rdi      # 0x13e36
leaq 0xc684(%rip), %rsi      # 0x123df
movl $0x974, %edx            # imm = 0x974
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3da0
movl %eax, %ebp
testl %ebp, %ebp
jne 0x5eab
cmpl $0x0, 0x1bdbc(%rip)     # 0x21b44
jle 0x5d95
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c85
cmpl $0x258, 0x27f8(%r14) # imm = 0x258
jne 0x5dd6
cmpl $0x0, 0x1b557(%rip)     # 0x21300
jle 0x5dc5
leaq 0xe0cb(%rip), %rdi      # 0x13e7d
leaq 0xc626(%rip), %rsi      # 0x123df
movl $0x99f, %edx            # imm = 0x99F
xorl %eax, %eax
callq 0xc84f
incl 0x1bd51(%rip)           # 0x21b1c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c24
leaq 0xe0d8(%rip), %rsi      # 0x13eb5
movq %r15, %rdi
callq 0x23c0
testq %rax, %rax
je 0x5dfa
cmpl $0x0, 0x1bd4f(%rip)     # 0x21b40
jne 0x5e1d
xorl %ebp, %ebp
jmp 0x5e7a
leaq 0x6efe(%r14), %rdi
leaq 0xe0ad(%rip), %rsi      # 0x13eb5
callq 0x23c0
xorl %ebp, %ebp
testq %rax, %rax
je 0x5e7a
cmpl $0x0, 0x1bd25(%rip)     # 0x21b40
je 0x5e7a
cmpl $0x0, 0x1b4dc(%rip)     # 0x21300
jle 0x5e43
leaq 0xe08d(%rip), %rdi      # 0x13eba
leaq 0xc5ab(%rip), %rsi      # 0x123df
movl $0x9ae, %edx            # imm = 0x9AE
movq %r15, %rcx
xorl %eax, %eax
callq 0xc84f
leaq 0xc5c2(%rip), %rdx      # 0x1240c
movl $0x27f7, %esi           # imm = 0x27F7
movq %r14, %rdi
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2140
movl 0x18b94(%r14), %edx
incl %edx
movq %rbx, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rcx
callq 0x5f1a
movl %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x55c0
cmpl $0x0, 0x1b474(%rip)     # 0x21300
jle 0x5eab
leaq 0xe071(%rip), %rdi      # 0x13f06
leaq 0xc543(%rip), %rsi      # 0x123df
movl $0x9b9, %edx            # imm = 0x9B9
movq %r15, %rcx
xorl %eax, %eax
callq 0xc84f
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jle 0x5eda
leaq 0xde0c(%rip), %rdi      # 0x13cd3
leaq 0xc511(%rip), %rsi      # 0x123df
movl $0x954, %edx            # imm = 0x954
xorl %eax, %eax
callq 0xc84f
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x4206
movl %eax, %ebp
cmpl $0x0, 0x1b40d(%rip)     # 0x21300
jle 0x5d79
leaq 0xde0e(%rip), %rdi      # 0x13d0e
leaq 0xc4d8(%rip), %rsi      # 0x123df
movl $0x957, %edx            # imm = 0x957
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc84f
jmp 0x5d79