// File: /workspace/github_c_makefile_star2_O2/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, 0x1acbe(%rip)     # 0x20300
jle 0x5665
leaq 0x5efd(%r14), %rcx
leaq 0xd37f(%rip), %rdi      # 0x129d1
leaq 0xbd86(%rip), %rsi      # 0x113df
movl $0x8b7, %edx            # imm = 0x8B7
xorl %eax, %eax
callq 0xc2a1
callq 0x23f0
movq (%rax), %rcx
leaq 0x5efd(%r14), %r15
movsbq 0x5efd(%r14), %rax
testb $0x40, 0x1(%rcx,%rax,2)
je 0x56b6
cmpl $0x0, 0x1ac76(%rip)     # 0x20300
jle 0x56a6
leaq 0xd373(%rip), %rdi      # 0x12a06
leaq 0xbd45(%rip), %rsi      # 0x113df
movl $0x8bd, %edx            # imm = 0x8BD
xorl %eax, %eax
callq 0xc2a1
movq %r15, %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0xdf02
movb (%r15), %al
testb %al, %al
je 0x56ee
leaq 0x1a827(%rip), %rbp     # 0x1fee8
movq %rbp, %rdi
callq 0x2110
movq %r15, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x20a0
pushq $0x1
popq %rbp
testl %eax, %eax
je 0x57c9
leaq 0x1b433(%rip), %rax     # 0x20b1c
jmp 0x57c7
cmpl $0x1, 0x1b433(%rip)     # 0x20b28
jne 0x5726
leaq 0x27fc(%r14), %rdi
callq 0x23b0
testq %rax, %rax
je 0x5726
movq %rax, %rbp
movzbl (%rax), %ecx
cmpl $0x2f, %ecx
je 0x571e
cmpl $0x5c, %ecx
je 0x571e
testl %ecx, %ecx
jne 0x5721
jmp 0x574c
movb $0x2d, (%rax)
incq %rax
jmp 0x570b
movl 0x1a7b7(%rip), %r8d     # 0x1fee4
leaq 0xd313(%rip), %rdx      # 0x12a47
leaq 0x1a7ad(%rip), %rcx     # 0x1fee8
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
xorl %eax, %eax
callq 0x2140
jmp 0x578d
cmpl $0x0, 0x1ab95(%rip)     # 0x202e8
leaq 0xfb70(%rip), %rax      # 0x152ca
leaq 0x1a787(%rip), %rcx     # 0x1fee8
cmoveq %rax, %rcx
movl 0x1a778(%rip), %r9d     # 0x1fee4
leaq 0xd2d2(%rip), %rdx      # 0x12a45
movl $0x1000, %esi           # imm = 0x1000
movq %r15, %rdi
movq %rbp, %r8
xorl %eax, %eax
callq 0x2140
movq %rbp, %rdi
callq 0x2030
cmpl $0x0, 0x1ab6c(%rip)     # 0x20300
jle 0x57b3
leaq 0xd2af(%rip), %rdi      # 0x12a4c
leaq 0xbc3b(%rip), %rsi      # 0x113df
movl $0x8dc, %edx            # imm = 0x8DC
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
xorl %ebp, %ebp
cmpl $0x0, 0x1b368(%rip)     # 0x20b24
sete %bpl
leaq 0x1a71d(%rip), %rax     # 0x1fee4
incl (%rax)
testl %ebp, %ebp
je 0x57e7
cmpl $0x0, 0x1ab3c(%rip)     # 0x20310
je 0x57e7
movl 0x1ab38(%rip), %edx     # 0x20314
movq %rbx, %rdi
movq %r15, %rsi
callq 0x35f1
testl %ebp, %ebp
je 0x5860
cmpl $0x0, 0x1aafa(%rip)     # 0x202ec
jle 0x5860
cmpl $0x0, 0x1aaf5(%rip)     # 0x202f0
jle 0x5810
leaq 0xd298(%rip), %rdi      # 0x12a9c
movq %r15, %rsi
xorl %eax, %eax
callq 0xc2a1
jmp 0x5860
cmpl $0x0, 0x1aae9(%rip)     # 0x20300
jle 0x583a
movq 0x1db38(%rip), %rcx     # 0x23358
leaq 0xd283(%rip), %rdi      # 0x12aaa
leaq 0xbbb1(%rip), %rsi      # 0x113df
movl $0x909, %edx            # imm = 0x909
xorl %eax, %eax
callq 0xc2a1
movq 0x1db17(%rip), %r12     # 0x23358
testq %r12, %r12
je 0x5860
callq 0x7c9c
leaq 0x27fc(%r14), %rcx
xorl %esi, %esi
testl %eax, %eax
cmovneq %rcx, %rsi
movq %r15, %rdi
callq *%r12
pushq $0x2f
popq %rsi
movq %r15, %rdi
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 0x31c2
cmpl $0x0, 0x1aa6b(%rip)     # 0x20300
jle 0x58b8
movl 0x166f8(%r14), %ecx
leaq 0xd248(%rip), %rdi      # 0x12aed
leaq 0xbb33(%rip), %rsi      # 0x113df
movl $0x91f, %edx            # imm = 0x91F
xorl %eax, %eax
callq 0xc2a1
movl 0x166f8(%r14), %ecx
leal -0x64(%rcx), %eax
cmpl $0x6, %eax
ja 0x5903
leaq 0xbc6a(%rip), %rcx      # 0x11538
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
cmpl $0x0, 0x1aa22(%rip)     # 0x20300
jle 0x5b76
leaq 0xd2dd(%rip), %rdi      # 0x12bc8
leaq 0xbaed(%rip), %rsi      # 0x113df
movl $0x93c, %edx            # imm = 0x93C
xorl %eax, %eax
callq 0xc2a1
jmp 0x5b76
cmpl $-0x1, %ecx
je 0x597f
testl %ecx, %ecx
jne 0x5b53
cmpl $0x12c, 0x17100(%r14) # imm = 0x12C
movl 0x1a9df(%rip), %eax     # 0x20300
jne 0x5ccb
testl %eax, %eax
jle 0x5945
leaq 0xd34e(%rip), %rdi      # 0x12c80
leaq 0xbaa6(%rip), %rsi      # 0x113df
movl $0x950, %edx            # imm = 0x950
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3c7a
jmp 0x5cf9
cmpl $0x0, 0x1a99f(%rip)     # 0x20300
jle 0x5ad6
leaq 0xd222(%rip), %rdi      # 0x12b90
leaq 0xba6a(%rip), %rsi      # 0x113df
movl $0x937, %edx            # imm = 0x937
jmp 0x5acf
cmpl $0x0, 0x1a97a(%rip)     # 0x20300
jle 0x59a2
leaq 0xd3c8(%rip), %rdi      # 0x12d57
leaq 0xba49(%rip), %rsi      # 0x113df
movl $0x95a, %edx            # imm = 0x95A
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x40d6
movl %eax, %ebp
cmpl $0x0, 0x1a945(%rip)     # 0x20300
jle 0x59d9
leaq 0xd3d2(%rip), %rdi      # 0x12d96
leaq 0xba14(%rip), %rsi      # 0x113df
movl $0x95c, %edx            # imm = 0x95C
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc2a1
leaq 0xba2c(%rip), %rdx      # 0x1140c
movl $0x27f7, %esi           # imm = 0x27F7
movq %r14, %rdi
movq %rbx, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x2140
leaq 0xd3e9(%rip), %rdi      # 0x12de5
leaq 0xb9dc(%rip), %rsi      # 0x113df
movl $0x96b, %edx            # imm = 0x96B
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
movq %r14, %rdi
callq 0x3874
testl %eax, %eax
je 0x5b88
movl 0x18b94(%r14), %edx
incl %edx
movq %rbx, %rdi
movq %r14, %rsi
movq 0x10(%rsp), %rcx
callq 0x5d29
jmp 0x5b86
cmpl $0x0, 0x1a8b9(%rip)     # 0x20300
jle 0x5ad6
leaq 0xd1ab(%rip), %rdi      # 0x12bff
leaq 0xb984(%rip), %rsi      # 0x113df
movl $0x940, %edx            # imm = 0x940
jmp 0x5acf
cmpl $0x0, 0x1a897(%rip)     # 0x20300
jle 0x5a85
leaq 0xd0ac(%rip), %rdi      # 0x12b1e
leaq 0xb966(%rip), %rsi      # 0x113df
movl $0x923, %edx            # imm = 0x923
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x4668
cmpl $0x1, %eax
je 0x5b90
movl %eax, %ebp
testl %eax, %eax
jne 0x5b88
movq %r13, %rdi
callq 0x4cab
jmp 0x5b90
cmpl $0x0, 0x1a846(%rip)     # 0x20300
jle 0x5ad6
leaq 0xd095(%rip), %rdi      # 0x12b58
leaq 0xb915(%rip), %rsi      # 0x113df
movl $0x933, %edx            # imm = 0x933
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x40d6
jmp 0x5b86
cmpl $0x0, 0x1a80e(%rip)     # 0x20300
jle 0x5b0e
leaq 0xd148(%rip), %rdi      # 0x12c43
leaq 0xb8dd(%rip), %rsi      # 0x113df
movl $0x944, %edx            # imm = 0x944
xorl %eax, %eax
callq 0xc2a1
leaq 0x17b90(%r14), %r12
leaq 0x11544(%rip), %rdx     # 0x17060
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 0xd3fd
addl %eax, 0x1afcb(%rip)     # 0x20b1c
jmp 0x5b90
cmpl $0x0, 0x1a7a6(%rip)     # 0x20300
jle 0x5b76
leaq 0xd2d3(%rip), %rdi      # 0x12e36
leaq 0xb875(%rip), %rsi      # 0x113df
movl $0x974, %edx            # imm = 0x974
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x3c7a
movl %eax, %ebp
testl %ebp, %ebp
jne 0x5cba
cmpl $0x0, 0x1afad(%rip)     # 0x20b44
jle 0x5ba4
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3b5f
cmpl $0x258, 0x27f8(%r14) # imm = 0x258
jne 0x5be5
cmpl $0x0, 0x1a748(%rip)     # 0x20300
jle 0x5bd4
leaq 0xd2bc(%rip), %rdi      # 0x12e7d
leaq 0xb817(%rip), %rsi      # 0x113df
movl $0x99f, %edx            # imm = 0x99F
xorl %eax, %eax
callq 0xc2a1
incl 0x1af42(%rip)           # 0x20b1c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3afe
leaq 0xd2c9(%rip), %rsi      # 0x12eb5
movq %r15, %rdi
callq 0x23d0
testq %rax, %rax
je 0x5c09
cmpl $0x0, 0x1af40(%rip)     # 0x20b40
jne 0x5c2c
xorl %ebp, %ebp
jmp 0x5c89
leaq 0x6efe(%r14), %rdi
leaq 0xd29e(%rip), %rsi      # 0x12eb5
callq 0x23d0
xorl %ebp, %ebp
testq %rax, %rax
je 0x5c89
cmpl $0x0, 0x1af16(%rip)     # 0x20b40
je 0x5c89
cmpl $0x0, 0x1a6cd(%rip)     # 0x20300
jle 0x5c52
leaq 0xd27e(%rip), %rdi      # 0x12eba
leaq 0xb79c(%rip), %rsi      # 0x113df
movl $0x9ae, %edx            # imm = 0x9AE
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
leaq 0xb7b3(%rip), %rdx      # 0x1140c
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 0x5d29
movl %eax, %ebp
movq %r14, %rdi
movq %rbx, %rsi
callq 0x53ec
cmpl $0x0, 0x1a665(%rip)     # 0x20300
jle 0x5cba
leaq 0xd262(%rip), %rdi      # 0x12f06
leaq 0xb734(%rip), %rsi      # 0x113df
movl $0x9b9, %edx            # imm = 0x9B9
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %eax, %eax
jle 0x5ce9
leaq 0xcffd(%rip), %rdi      # 0x12cd3
leaq 0xb702(%rip), %rsi      # 0x113df
movl $0x954, %edx            # imm = 0x954
xorl %eax, %eax
callq 0xc2a1
movq %r13, %rdi
movq %rbx, %rsi
movq %r14, %rdx
movl %ebp, %ecx
callq 0x40d6
movl %eax, %ebp
cmpl $0x0, 0x1a5fe(%rip)     # 0x20300
jle 0x5b88
leaq 0xcfff(%rip), %rdi      # 0x12d0e
leaq 0xb6c9(%rip), %rsi      # 0x113df
movl $0x957, %edx            # imm = 0x957
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc2a1
jmp 0x5b88