// File: /workspace/github_c_makefile_star2_O1/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, %r13
movq %rdx, %r14
movq %rsi, 0x8(%rsp)
movq %rdi, %rbx
cmpl $0x0, 0x1ba55(%rip)     # 0x21300
jle 0x58ce
leaq 0x5efd(%r14), %rcx
leaq 0xe0e6(%rip), %rdi      # 0x139a1
leaq 0xcb1d(%rip), %rsi      # 0x123df
movl $0x8b7, %edx            # imm = 0x8B7
xorl %eax, %eax
callq 0xc960
callq 0x23f0
movq (%rax), %rax
leaq 0x5efd(%r14), %r15
movsbq 0x5efd(%r14), %rcx
testb $0x40, 0x1(%rax,%rcx,2)
je 0x591c
cmpl $0x0, 0x1ba0d(%rip)     # 0x21300
jle 0x590f
leaq 0xe0da(%rip), %rdi      # 0x139d6
leaq 0xcadc(%rip), %rsi      # 0x123df
movl $0x8bd, %edx            # imm = 0x8BD
xorl %eax, %eax
callq 0xc960
movq %r15, %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0xe6c5
cmpb $0x0, (%r15)
je 0x5958
leaq 0x1b5bf(%rip), %r12     # 0x20ee8
movq %r12, %rdi
callq 0x2110
movq %r15, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x20a0
movl $0x1, %ebp
testl %eax, %eax
je 0x5a33
leaq 0x1c1c9(%rip), %rax     # 0x21b1c
jmp 0x5a31
cmpl $0x1, 0x1c1c9(%rip)     # 0x21b28
jne 0x5990
leaq 0x27fc(%r14), %rdi
callq 0x23b0
testq %rax, %rax
je 0x5990
movq %rax, %r12
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x5988
cmpl $0x5c, %ecx
je 0x5988
testl %ecx, %ecx
jne 0x598b
jmp 0x59b6
movb $0x2d, (%rax)
incq %rax
jmp 0x5975
movl 0x1b54d(%rip), %r8d     # 0x20ee4
leaq 0xe079(%rip), %rdx      # 0x13a17
leaq 0x1b543(%rip), %rcx     # 0x20ee8
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
jmp 0x59f7
cmpl $0x0, 0x1b92b(%rip)     # 0x212e8
leaq 0x108d6(%rip), %rax     # 0x1629a
leaq 0x1b51d(%rip), %rcx     # 0x20ee8
cmoveq %rax, %rcx
movl 0x1b50e(%rip), %r9d     # 0x20ee4
leaq 0xe038(%rip), %rdx      # 0x13a15
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %r12, %r8
xorl %eax, %eax
callq 0x2140
movq %r12, %rdi
callq 0x2030
cmpl $0x0, 0x1b902(%rip)     # 0x21300
jle 0x5a1d
leaq 0xe015(%rip), %rdi      # 0x13a1c
leaq 0xc9d1(%rip), %rsi      # 0x123df
movl $0x8dc, %edx            # imm = 0x8DC
movq %r15, %rcx
xorl %eax, %eax
callq 0xc960
xorl %ebp, %ebp
cmpl $0x0, 0x1c0fe(%rip)     # 0x21b24
sete %bpl
leaq 0x1b4b3(%rip), %rax     # 0x20ee4
incl (%rax)
testl %ebp, %ebp
je 0x5a53
cmpl $0x0, 0x1b8d2(%rip)     # 0x21310
je 0x5a53
movl 0x1b8ce(%rip), %edx     # 0x21314
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x3738
testl %ebp, %ebp
je 0x5acc
cmpl $0x0, 0x1b88e(%rip)     # 0x212ec
jle 0x5acc
cmpl $0x0, 0x1b889(%rip)     # 0x212f0
jle 0x5a7c
leaq 0xdffc(%rip), %rdi      # 0x13a6c
movq %r15, %rsi
xorl %eax, %eax
callq 0xc960
jmp 0x5acc
cmpl $0x0, 0x1b87d(%rip)     # 0x21300
jle 0x5aa6
movq 0x1e8cc(%rip), %rcx     # 0x24358
leaq 0xdfe7(%rip), %rdi      # 0x13a7a
leaq 0xc945(%rip), %rsi      # 0x123df
movl $0x909, %edx            # imm = 0x909
xorl %eax, %eax
callq 0xc960
movq 0x1e8ab(%rip), %r12     # 0x24358
testq %r12, %r12
je 0x5acc
callq 0x7fbd
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 %r13, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x331f
cmpl $0x0, 0x1b7ff(%rip)     # 0x21300
jle 0x5b24
movl 0x166f8(%r14), %ecx
leaq 0xdfac(%rip), %rdi      # 0x13abd
leaq 0xc8c7(%rip), %rsi      # 0x123df
movl $0x91f, %edx            # imm = 0x91F
xorl %eax, %eax
callq 0xc960
movl 0x166f8(%r14), %ecx
leal -0x64(%rcx), %eax
cmpl $0x6, %eax
ja 0x5b6f
leaq 0xc9fe(%rip), %rcx      # 0x12538
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x1b7b6(%rip)     # 0x21300
jle 0x5e06
leaq 0xe041(%rip), %rdi      # 0x13b98
leaq 0xc881(%rip), %rsi      # 0x123df
movl $0x93c, %edx            # imm = 0x93C
xorl %eax, %eax
callq 0xc960
jmp 0x5e06
cmpl $-0x1, %ecx
je 0x5bf0
testl %ecx, %ecx
jne 0x5de3
cmpl $0x12c, 0x17100(%r14) # imm = 0x12C
movl 0x1b773(%rip), %eax     # 0x21300
jne 0x5f64
testl %eax, %eax
jle 0x5bb1
leaq 0xe0b2(%rip), %rdi      # 0x13c50
leaq 0xc83a(%rip), %rsi      # 0x123df
movl $0x950, %edx            # imm = 0x950
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3de7
jmp 0x5f97
cmpl $0x0, 0x1b72e(%rip)     # 0x21300
jle 0x5d4f
leaq 0xdf81(%rip), %rdi      # 0x13b60
leaq 0xc7f9(%rip), %rsi      # 0x123df
movl $0x937, %edx            # imm = 0x937
jmp 0x5d48
cmpl $0x0, 0x1b709(%rip)     # 0x21300
jle 0x5c13
leaq 0xe127(%rip), %rdi      # 0x13d27
leaq 0xc7d8(%rip), %rsi      # 0x123df
movl $0x95a, %edx            # imm = 0x95A
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x4258
movl %eax, %r12d
cmpl $0x0, 0x1b6ce(%rip)     # 0x21300
jle 0x5c51
leaq 0xe12b(%rip), %rdi      # 0x13d66
leaq 0xc79d(%rip), %rsi      # 0x123df
movl $0x95c, %edx            # imm = 0x95C
movl %r12d, %ecx
xorl %eax, %eax
callq 0xc960
leaq 0xc7b4(%rip), %rdx      # 0x1240c
movl $0x27f7, %esi           # imm = 0x27F7
movq %r14, %rdi
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2140
leaq 0xe141(%rip), %rdi      # 0x13db5
leaq 0xc764(%rip), %rsi      # 0x123df
movl $0x96b, %edx            # imm = 0x96B
movq %r14, %rcx
xorl %eax, %eax
callq 0xc960
movq %r14, %rdi
callq 0x39e8
testl %eax, %eax
je 0x5e1e
movl 0x18b94(%r14), %edx
incl %edx
movq %rbx, %rdi
movq %r14, %rsi
movq %r13, %rcx
callq 0x5fde
jmp 0x5e1b
cmpl $0x0, 0x1b643(%rip)     # 0x21300
jle 0x5d4f
leaq 0xdf05(%rip), %rdi      # 0x13bcf
leaq 0xc70e(%rip), %rsi      # 0x123df
movl $0x940, %edx            # imm = 0x940
jmp 0x5d48
cmpl $0x0, 0x1b621(%rip)     # 0x21300
jle 0x5cfb
leaq 0xde06(%rip), %rdi      # 0x13aee
leaq 0xc6f0(%rip), %rsi      # 0x123df
movl $0x923, %edx            # imm = 0x923
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
movq 0x8(%rsp), %rsi
movq %r14, %rdx
callq 0x4837
testl %eax, %eax
je 0x5fc9
movl %eax, %r12d
cmpl $0x1, %eax
movq 0x8(%rsp), %rbx
jne 0x5e1e
xorl %r12d, %r12d
jmp 0x5e1e
cmpl $0x0, 0x1b5cd(%rip)     # 0x21300
jle 0x5d4f
leaq 0xddec(%rip), %rdi      # 0x13b28
leaq 0xc69c(%rip), %rsi      # 0x123df
movl $0x933, %edx            # imm = 0x933
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x4258
jmp 0x5e1b
movq %r13, 0x10(%rsp)
cmpl $0x0, 0x1b58b(%rip)     # 0x21300
jle 0x5d91
leaq 0xde95(%rip), %rdi      # 0x13c13
leaq 0xc65a(%rip), %rsi      # 0x123df
movl $0x944, %edx            # imm = 0x944
xorl %eax, %eax
callq 0xc960
leaq 0x17b90(%r14), %r13
leaq 0x122ee(%rip), %rdx     # 0x1808d
xorl %r12d, %r12d
movl $0x1001, %esi           # imm = 0x1001
movq %r13, %rdi
movq %r15, %rcx
xorl %eax, %eax
callq 0x2140
movl %ebp, (%rsp)
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r15, %rdx
movq %r13, %rcx
movl $0x1001, %r8d           # imm = 0x1001
xorl %r9d, %r9d
callq 0xdbe8
addl %eax, 0x1bd40(%rip)     # 0x21b1c
movq 0x10(%rsp), %r13
jmp 0x5e1e
cmpl $0x0, 0x1b516(%rip)     # 0x21300
jle 0x5e06
leaq 0xe013(%rip), %rdi      # 0x13e06
leaq 0xc5e5(%rip), %rsi      # 0x123df
movl $0x974, %edx            # imm = 0x974
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3de7
movl %eax, %r12d
testl %r12d, %r12d
jne 0x5f52
cmpl $0x0, 0x1bd16(%rip)     # 0x21b44
jle 0x5e3b
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3ccc
cmpl $0x258, 0x27f8(%r14) # imm = 0x258
jne 0x5e7c
cmpl $0x0, 0x1b4b1(%rip)     # 0x21300
jle 0x5e6b
leaq 0xdff5(%rip), %rdi      # 0x13e4d
leaq 0xc580(%rip), %rsi      # 0x123df
movl $0x99f, %edx            # imm = 0x99F
xorl %eax, %eax
callq 0xc960
incl 0x1bcab(%rip)           # 0x21b1c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3c6b
leaq 0xe002(%rip), %rsi      # 0x13e85
movq %r15, %rdi
callq 0x23d0
testq %rax, %rax
je 0x5ea1
cmpl $0x0, 0x1bca9(%rip)     # 0x21b40
jne 0x5ec5
xorl %r12d, %r12d
jmp 0x5f21
leaq 0x6efe(%r14), %rdi
leaq 0xdfd6(%rip), %rsi      # 0x13e85
callq 0x23d0
xorl %r12d, %r12d
testq %rax, %rax
je 0x5f21
cmpl $0x0, 0x1bc7d(%rip)     # 0x21b40
je 0x5f21
cmpl $0x0, 0x1b434(%rip)     # 0x21300
jle 0x5eeb
leaq 0xdfb5(%rip), %rdi      # 0x13e8a
leaq 0xc503(%rip), %rsi      # 0x123df
movl $0x9ae, %edx            # imm = 0x9AE
movq %r15, %rcx
xorl %eax, %eax
callq 0xc960
leaq 0xc51a(%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 %r13, %rcx
callq 0x5fde
movl %eax, %r12d
movq %r14, %rdi
movq %rbx, %rsi
callq 0x563c
cmpl $0x0, 0x1b3cd(%rip)     # 0x21300
jle 0x5f52
leaq 0xdf9a(%rip), %rdi      # 0x13ed6
leaq 0xc49c(%rip), %rsi      # 0x123df
movl $0x9b9, %edx            # imm = 0x9B9
movq %r15, %rcx
xorl %eax, %eax
callq 0xc960
movl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jle 0x5f82
leaq 0xdd34(%rip), %rdi      # 0x13ca3
leaq 0xc469(%rip), %rsi      # 0x123df
movl $0x954, %edx            # imm = 0x954
xorl %eax, %eax
callq 0xc960
movq %rbx, %rdi
movq 0x8(%rsp), %rbx
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x4258
movl %eax, %r12d
cmpl $0x0, 0x1b35f(%rip)     # 0x21300
jle 0x5e1e
leaq 0xdd30(%rip), %rdi      # 0x13cde
leaq 0xc42a(%rip), %rsi      # 0x123df
movl $0x957, %edx            # imm = 0x957
movl %r12d, %ecx
xorl %eax, %eax
callq 0xc960
jmp 0x5e1e
movq %rbx, %rdi
callq 0x4e95
xorl %r12d, %r12d
movq 0x8(%rsp), %rbx
jmp 0x5e1e