// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/mime.c
// Function: MIME_decode_64
int MIME_decode_64( FFGET_FILE *f, char *unpackdir, struct MIMEH_header_info *hinfo )
{
    int i;
    int cr_total = 0;
    int cr_count = 0; /* the number of consecutive \n's we've read in, used to detect End of B64 enc */
    int ignore_crcount = 0; /* If we have a boundary in our emails, then ignore the CR counts */
    int stopcount = 0; /* How many stop (=) characters we've read in */
    int eom_reached = 0; /* flag to say that we've reached the End-Of-MIME encoding. */
    int status = 0; /* Overall status of decoding operation */
    int c; /* a single char as retrieved using MIME_get_char() */
    int char_count = 0; /* How many chars have been received */
    int boundary_crash = 0; /* if we crash into a boundary, set this */
    long int bytecount=0; /* The total file decoded size */
    char output[3]; /* The 4->3 byte output array */
    char input[4]; /* The 4->3 byte input array */
    char fullMIME_filename[_MIME_STRLEN_MAX]=""; /* Full Filename of output file */

    // Write Buffer routine

    unsigned char *writebuffer;
    unsigned char *wbpos;
    int wbcount = 0;
    int loop;

    int of; /* output file pointer */
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: attempting to decode '%s'", FL, hinfo->filename);

    /* generate the MIME_filename, and open it up... */
    if (glb.unique_names) MIME_test_uniquename( unpackdir, hinfo->filename, glb.rename_method );
    snprintf(fullMIME_filename,_MIME_STRLEN_MAX,"%s/%s",unpackdir,hinfo->filename);
    //of = fopen(fullMIME_filename,"wb");
    of = open(fullMIME_filename, O_WRONLY|O_CREAT, S_IRUSR|S_IWUSR);
    /* if we were unable to open the output file, then we better log an error and drop out */
    if (of < 0)
    {
        LOGGER_log("%s:%d:MIME_decode_64:ERROR: Cannot open output file %s for BASE64 decoding. (%s)",FL,fullMIME_filename, strerror(errno));
        //      exit(_EXITERR_BASE64_OUTPUT_NOT_OPEN);
        return -1;
    }

    // Allocate the write buffer.  By using the write buffer we gain an additional 10% in performance
    // due to the lack of function call (fwrite) overheads
    writebuffer = malloc( _MIME_WRITE_BUFFER_SIZE *sizeof(unsigned char));
    if (!writebuffer)
    {
        LOGGER_log("%s:%d:MIME_decode_64:ERROR: cannot allocate %dbytes of memory for the write buffer",FL, _MIME_WRITE_BUFFER_SIZE);
        return -1;
    }
    else {
        wbpos = writebuffer;
        wbcount = 0;
    }
    /* Set our ignore_crcount flag */
    if (BS_count() > 0)
    {
        //LOGGER_log("%s:%d:MIME_decode_64:DEBUG: Ignore CR set to 1",FL);
        ignore_crcount = 1;
    }
    /* collect prefixing trash (if any, such as spaces, CR's etc)*/
    //  c = MIME_getchar_start(f);
    /* and push the good char back */
    //  FFGET_ungetc(f,c);
    c = '\0';

    /* do an endless loop, as we're -breaking- out later */
    while (1)
    {
        int lastchar_was_linebreak=0;
        /* Initialise the decode buffer */
        input[0] = input[1] = input[2] = input[3] = 0; // was '0' - Stepan Kasal patch
        /* snatch 4 characters from the input */
        for (i = 0; i < 4; i++)
        {
            // Get Next char from the file input
            //
            // A lot of CPU is wasted here due to function call overheads, unfortunately
            // I cannot yet work out how to make this call (FFGET) operate effectively
            // without including a couple of dozen lines in this section.
            //
            // Times like this C++'s "inline" statement would be nice.
            //
            //----------INLINE Version of FFGET_getchar()
            //
            do {
                if ((c == '\n')||(c == '\r')) lastchar_was_linebreak = 1; else lastchar_was_linebreak = 0;
                if (f->ungetcset)
                {
                    f->ungetcset = 0;
                    c = f->c;
                }
                else
                {
                    if ((!f->startpoint)||(f->startpoint > f->endpoint))
                    {
                        FFGET_getnewblock(f);
                    }
                    if (f->startpoint <= f->endpoint)
                    {
                        c = *f->startpoint;
                        f->startpoint++;
                    }
                    else
                    {
                        c = EOF;
                    }
                }
            }
            while ( (c != EOF) && ( c < ' ' ) && ( c != '\n' ) && (c != '-') && (c != '\r') );
            //
            //-------END OF INLINE---------------------------------------------
            if ((ignore_crcount == 1)&&(c == '-'))
                //&&(lastchar_was_linebreak == 1))
            {
                int hit = 0;
                char *p;
                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: leader '-' found at %50s",FL,(f->startpoint -1));
                p = strchr((f->startpoint -1), '\n');
                if (p == NULL) {
                    /* The boundary test was failing because sometimes the full line
                     * wasn't available to test against in BM_cmp(), so if we can't
                     * see a \n (or \r even), then we should load up some more data
                     */
                    char scratch[1024];
                    FFGET_fgets(scratch,sizeof(scratch), f);
                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: Scratch = '%s'", FL, scratch);
                    hit = BS_cmp(scratch,strlen(scratch) +1);
                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: Boundary hit = %d", FL, hit);
                } else {
                    *p = '\0';
                    hit = BS_cmp((f->startpoint -1),strlen(f->startpoint) +1);
                    *p = '\n';
                }
                if (hit > 0) {
                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: Boundary detected and breaking out ",FL);
                    //      FFGET_fgets(scratch,sizeof(scratch),f);
                    //      eom_reached = 1;
                    boundary_crash = 1;
                    break;
                } else {
                    /** 20041105-22H56:PLD: Applied Stepan Kasal patch **/
                    i--;
                    continue;
                }
            }
            // If we get a CR then we need to check a few things, namely to see
            //  if the BASE64 stream has terminated ( indicated by two consecutive
            //  \n's
            //
            // This should not be affected by \r's because the \r's will just pass
            //  through and be absorbed by the detection of possible 'invalid'
            //  characters
            if ((ignore_crcount == 0)&&(c == '\n'))
            {
                cr_count++;
                cr_total++;
                // Because there are some mail-agents out there which are REALLY naughty
                //      and do things like sticking random blank lines into B64 data streams
                //      (why o why!?) we need to have a settable option here to decide if
                //      we want to test for double-CR breaking or just ignore it
                //
                // To avoid this, we relax the double-CR extention, and say "Okay, we'll let
                // you have a single blank line - but any more than that and we'll slap you
                //  hand".  Honestly, I do not like this solution, but it seems to be the only
                //  way to preserve decoding accurancy without resorting to having to use
                //  a command line switch to dictate which method to use ( NO-CR's or ignore
                // CR's ).
                if (cr_count > 2)
                {
                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: EOF Reached due to two consecutive CR's on line %d\n",FL,cr_total);
                    eom_reached++;
                    break;
                }
                else
                {
                    char_count = 0;
                    i--;
                    continue;
                } // else if it wasn't our 3rd CR
            } else {
                cr_count=0;
            }
            /* if we get an EOF char, then we know something went wrong */
            if ( c == EOF )
            {
                size_t bc;
                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: input stream broken for base64 decoding for file %s. %ld bytes of data in buffer to be written out\n",FL,hinfo->filename,wbcount);
                status = MIME_ERROR_B64_INPUT_STREAM_EOF;
                //fwrite(writebuffer, 1, wbcount, of);
                bc = write( of, writebuffer, wbcount);
                close(of);
                if (writebuffer) free(writebuffer);
                return status;
                break;
            } /* if c was the EOF */
            else if (c == '=')
            {
                // Once we've found a stop char, we can actually just "pad" in the rest
                // of the stop chars because we know we're at the end. Some MTA's dont
                // put in enough stopchars... at least it seems X-MIMEOLE: Produced By Microsoft MimeOLE V5.50.4133.2400
                // doesnt.
                if (i == 2)
                {
                    input[2] = input[3] = (char)b64[c];
                }
                else if (i == 3)
                {
                    input[3] = (char)b64[c];
                }
                // NOTE------
                // Previously we relied on the fact that if we detected a stop char, that FFGET()
                // would automatically absorb the data till EOL. This is no longer the case as we
                // are now only retrieving data byte at a time.
                // So, now we -absorb- till the end of the line using FFGET_fgets()
                stopcount = 4 -i;
                FFGET_fgets(scratch,sizeof(scratch),f);
                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: Stop char detected pos=%d...StopCount = %d\n",FL,i,stopcount);
                i = 4;
                break; // out of FOR.
            }
            /*
                else if ((char_count == 0)&&(c == '-' )) {
                if (FFGET_fgetc(f) == '-')
                {
                boundary_crash++;
                eom_reached++;
                break;
                }
                }
                */
            /* test for and discard invalid chars */
            if (b64[c] == 0x80)
            {
                i--;
                continue;
            }
            // Finally, if we get this far without the character having been picked
            //  out as some special meaning character, we decode it and place the
            //  resultant byte into the input[] array.
            input[i] = (char)b64[c];
            /* assuming we've gotten this far, then we increment the char_count */
            char_count++;
        } // FOR
        // now that our 4-char buffer is full, we can do some fancy bit-shifting and get the required 3-chars of 8-bit data
        output[0] = (input[0] << 2) | (input[1] >> 4);
        output[1] = (input[1] << 4) | (input[2] >> 2);
        output[2] = (input[2] << 6) | input[3];
        // determine how many chars to write write and check for errors if our input char count was 4 then we did receive a propper 4:3 Base64 block, hence write it
        if (i == 4)
        {
            // If our buffer is full beyond the 'write out limit', then we write the buffered
            //  data to the file -  We use this method in order to save calling fwrite() too
            //  many times, thus avoiding function call overheads and [ possibly ] disk write
            //  interrupt costs.
            if ( wbcount > _MIME_WRITE_BUFFER_LIMIT )
            {
                size_t bc;
                bc = write ( of, writebuffer, wbcount );
                //          fwrite(writebuffer, 1, wbcount, of);
                wbpos = writebuffer;
                wbcount = 0;
            }
            // Copy our converted bytes to the write buffer
            for (loop = 0; loop < (3 -stopcount); loop++)
            {
                *wbpos = output[loop];
                wbpos++;
                wbcount++;
            }
            // tally up our total byte conversion count
            bytecount+=(3 -stopcount);
        }
        else if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: could not attain 4 bytes input\n",FL);

        // if we wrote less than 3 chars, it means we were at the end of the encoded file thus we exit
        if ((eom_reached)||(stopcount > 0)||(boundary_crash)||(i!=4))
        {
            // Write out the remaining contents of our write buffer - If we don't do this
            //  we'll end up with truncated files.
            if (wbcount > 0)
            {
                size_t bc;
                //fwrite(writebuffer, 1, wbcount, of);
                bc = write( of, writebuffer, wbcount);
            }
            /* close the output file, we're done writing to it */
            close(of);
            /* if we didn't really write anything, then trash the  file */
            if (bytecount == 0)
            {
                //              unlink(fullMIME_filename);
                status = MIME_BASE64_STATUS_ZERO_FILE;
            }
            if (boundary_crash)
            {
                // Absorb to end of line
                //
                status = MIME_BASE64_STATUS_HIT_BOUNDARY; // was _BOUNDARY_CRASH
            }
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_decode_64:DEBUG: File size = %ld bytes, Exit Status = %d, Boundary Crash = %d\n",FL, bytecount, status, boundary_crash);
            if (writebuffer) free(writebuffer);
            return status;
        } // if End-of-MIME or Stopchars appeared
    } // while
    if (writebuffer) free(writebuffer);
    return status;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x848, %rsp            # imm = 0x848
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
leaq 0x40(%rsp), %rdi
movl $0x3ff, %edx            # imm = 0x3FF
xorl %esi, %esi
callq 0x2170
cmpl $0x0, 0x1bc66(%rip)     # 0x20300
jle 0x46bd
leaq 0x5efd(%rbx), %rcx
leaq 0xdbe9(%rip), %rdi      # 0x12293
leaq 0xcd2e(%rip), %rsi      # 0x113df
movl $0x60f, %edx            # imm = 0x60F
xorl %eax, %eax
callq 0xc2a1
cmpl $0x0, 0x1bc4c(%rip)     # 0x20310
je 0x46db
leaq 0x5efd(%rbx), %rsi
movl 0x1bc41(%rip), %edx     # 0x20314
movq %r14, %rdi
callq 0x35f1
addq $0x5efd, %rbx           # imm = 0x5EFD
leaq 0xcd23(%rip), %rdx      # 0x1140c
leaq 0x40(%rsp), %r12
movl $0x3ff, %esi            # imm = 0x3FF
movq %r12, %rdi
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0x2140
pushq $0x41
popq %rsi
movq %r12, %rdi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2340
testl %eax, %eax
js 0x4c45
movl %eax, %ebp
movl $0x2000, %edi           # imm = 0x2000
callq 0x22a0
testq %rax, %rax
je 0x4c75
movq %rax, %r14
movl %ebp, 0x18(%rsp)
callq 0xce6a
movl %eax, 0x1c(%rsp)
movq $0x0, 0x38(%rsp)
movl $0x0, 0x14(%rsp)
movq %r14, 0x30(%rsp)
movq %r14, %rbp
movl $0x0, 0x8(%rsp)
xorl %r13d, %r13d
movl $0x0, 0x2c(%rsp)
movq %rbp, 0x20(%rsp)
andl $0x0, (%rsp)
movl %r13d, %ebp
xorl %r12d, %r12d
movl 0x1c(%rsp), %r14d
movl %ebp, %r13d
movq 0x20(%rsp), %rbp
cmpl $0x3, %r12d
jg 0x49ac
cmpl $0x0, 0x2050(%r15)
je 0x47af
andl $0x0, 0x2050(%r15)
movb 0x2038(%r15), %al
jmp 0x47f2
movq 0x2010(%r15), %rcx
testq %rcx, %rcx
je 0x47c7
movq 0x2018(%r15), %rax
cmpq %rax, %rcx
jbe 0x47dd
movq %r15, %rdi
callq 0x73f7
movq 0x2010(%r15), %rcx
movq 0x2018(%r15), %rax
cmpq %rax, %rcx
ja 0x4bec
movb (%rcx), %al
incq %rcx
movq %rcx, 0x2010(%r15)
movzbl %al, %ecx
cmpb $0x1f, %al
jg 0x4851
cmpb $0xa, %al
je 0x480a
cmpl $0xd, %ecx
je 0x480a
cmpl $0xff, %ecx
jne 0x4794
testl %r14d, %r14d
jg 0x4817
cmpb $0xa, %al
je 0x495e
cmpb $0x3d, %al
je 0x49be
cmpl $0xff, %ecx
je 0x4bec
leaq 0xce2e(%rip), %rax      # 0x11660
movb (%rcx,%rax), %al
xorl %r13d, %r13d
cmpb $-0x80, %al
je 0x478a
movslq %r12d, %rcx
movb %al, (%rsp,%rcx)
incl %r12d
xorl %r13d, %r13d
jmp 0x478a
testl %r14d, %r14d
jle 0x4817
cmpb $0x2d, %al
jne 0x4817
cmpl $0x0, 0x1ba9f(%rip)     # 0x20300
movq 0x2010(%r15), %rcx
jle 0x488e
decq %rcx
leaq 0xdaf9(%rip), %rdi      # 0x1236d
leaq 0xcb64(%rip), %rsi      # 0x113df
movl $0x669, %edx            # imm = 0x669
xorl %eax, %eax
callq 0xc2a1
movq 0x2010(%r15), %rcx
decq %rcx
movq %rcx, %rdi
pushq $0xa
popq %rsi
callq 0x2120
testq %rax, %rax
je 0x48cf
movq %rax, %r14
movb $0x0, (%rax)
movq 0x2010(%r15), %rdi
leaq -0x1(%rdi), %rbp
callq 0x2110
leal 0x1(%rax), %esi
movq %rbp, %rdi
callq 0xcfc7
movl %eax, %ebp
movb $0xa, (%r14)
movl 0x1c(%rsp), %r14d
jmp 0x494c
leaq 0x440(%rsp), %r14
movq %r14, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x76f2
cmpl $0x0, 0x1ba12(%rip)     # 0x20300
jle 0x490d
leaq 0xdaab(%rip), %rdi      # 0x123a2
leaq 0xcae1(%rip), %rsi      # 0x113df
movl $0x672, %edx            # imm = 0x672
movq %r14, %rcx
xorl %eax, %eax
callq 0xc2a1
movq %r14, %rdi
callq 0x2110
leal 0x1(%rax), %esi
movq %r14, %rdi
callq 0xcfc7
movl %eax, %ebp
cmpl $0x0, 0x1b9d7(%rip)     # 0x20300
movl 0x1c(%rsp), %r14d
jle 0x494c
leaq 0xda96(%rip), %rdi      # 0x123cd
leaq 0xcaa1(%rip), %rsi      # 0x113df
movl $0x674, %edx            # imm = 0x674
movl %ebp, %ecx
xorl %eax, %eax
callq 0xc2a1
testl %ebp, %ebp
movq 0x20(%rsp), %rbp
jle 0x478a
jmp 0x4a46
leal 0x1(%r13), %ebp
incl 0x2c(%rsp)
cmpl $0x2, %r13d
jl 0x4782
movb $0x1, %r14b
cmpl $0x0, 0x1b986(%rip)     # 0x20300
jle 0x499a
leaq 0xdab8(%rip), %rdi      # 0x1243b
leaq 0xca55(%rip), %rsi      # 0x113df
movl $0x69e, %edx            # imm = 0x69E
movl 0x2c(%rsp), %ecx
xorl %eax, %eax
callq 0xc2a1
xorl %edi, %edi
movl $0x0, 0x4(%rsp)
movl %ebp, %r13d
jmp 0x4a3f
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x0, 0x4(%rsp)
jmp 0x4a7e
leaq 0x3(%rsp), %rax
cmpl $0x3, %r12d
pushq $0x4
popq %rbp
je 0x49dc
cmpl $0x2, %r12d
jne 0x49df
movb $0x0, 0x3(%rsp)
leaq 0x2(%rsp), %rax
movb $0x0, (%rax)
movl %ebp, %r13d
subl %r12d, %r13d
leaq 0x1ed74(%rip), %rdi     # 0x23760
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x76f2
cmpl $0x0, 0x1b900(%rip)     # 0x20300
movl %r13d, 0x14(%rsp)
jle 0x4a2c
xorl %r14d, %r14d
leaq 0xdafa(%rip), %rdi      # 0x1250b
leaq 0xc9c7(%rip), %rsi      # 0x113df
movl $0x6cd, %edx            # imm = 0x6CD
movl %r12d, %ecx
movl %r13d, %r8d
xorl %eax, %eax
callq 0xc2a1
jmp 0x4a2f
xorl %r14d, %r14d
xorl %edi, %edi
movl $0x0, 0x4(%rsp)
xorl %r13d, %r13d
movl %ebp, %r12d
movq 0x20(%rsp), %rbp
jmp 0x4a7e
movb $0x1, %dil
cmpl $0x0, 0x1b8b0(%rip)     # 0x20300
jle 0x4a74
xorl %r14d, %r14d
leaq 0xd99f(%rip), %rdi      # 0x123fb
leaq 0xc97c(%rip), %rsi      # 0x113df
movl $0x67b, %edx            # imm = 0x67B
xorl %eax, %eax
callq 0xc2a1
movb $0x1, %dil
jmp 0x4a77
xorl %r14d, %r14d
pushq $0x1
popq %rax
movl %eax, 0x4(%rsp)
movb (%rsp), %al
movb 0x1(%rsp), %cl
shlb $0x2, %al
movl %ecx, %edx
sarb $0x4, %dl
orb %al, %dl
movb %dl, 0xd(%rsp)
shlb $0x4, %cl
movb 0x2(%rsp), %al
movl %eax, %edx
sarb $0x2, %dl
orb %cl, %dl
movb %dl, 0xe(%rsp)
shlb $0x6, %al
orb 0x3(%rsp), %al
movb %al, 0xf(%rsp)
cmpl $0x4, %r12d
jne 0x4b13
movl 0x8(%rsp), %eax
cmpl $0x1ffd, %eax           # imm = 0x1FFD
jl 0x4aec
movl %eax, %edx
movl %r14d, 0x10(%rsp)
movl %edi, %r14d
movl 0x18(%rsp), %edi
movq 0x30(%rsp), %rbp
movq %rbp, %rsi
callq 0x20e0
movl %r14d, %edi
movl 0x10(%rsp), %r14d
movl $0x0, 0x8(%rsp)
pushq $0x3
popq %rax
subl 0x14(%rsp), %eax
testl %eax, %eax
movl $0x0, %edx
cmovgl %eax, %edx
xorl %ecx, %ecx
cmpq %rcx, %rdx
je 0x4b48
movb 0xd(%rsp,%rcx), %sil
movb %sil, (%rbp,%rcx)
incq %rcx
jmp 0x4aff
cmpl $0x0, 0x1b7e6(%rip)     # 0x20300
jle 0x4b56
movl %r14d, 0x10(%rsp)
movl %edi, %r14d
leaq 0xda28(%rip), %rdi      # 0x12553
leaq 0xc8ad(%rip), %rsi      # 0x113df
movl $0x705, %edx            # imm = 0x705
xorl %eax, %eax
callq 0xc2a1
movl %r14d, %edi
movl 0x10(%rsp), %r14d
jmp 0x4b56
addl %edx, 0x8(%rsp)
cltq
addq %rax, 0x38(%rsp)
addq %rcx, %rbp
cmpl $0x0, 0x14(%rsp)
setg %al
orb %al, %r14b
cmpl $0x4, %r12d
setne %al
orb %dil, %al
orb %r14b, %al
cmpb $0x1, %al
jne 0x476e
movl %edi, %ebp
movl 0x8(%rsp), %eax
testl %eax, %eax
movq 0x30(%rsp), %r14
movl 0x18(%rsp), %ebx
jle 0x4b95
movl %eax, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x20e0
movl %ebx, %edi
callq 0x21a0
xorl %eax, %eax
movq 0x38(%rsp), %rcx
testq %rcx, %rcx
sete %al
addl %eax, %eax
testb %bpl, %bpl
pushq $0x1
popq %rbx
cmovel %eax, %ebx
cmpl $0x0, 0x1b745(%rip)     # 0x20300
jle 0x4bdf
leaq 0xd9cb(%rip), %rdi      # 0x1258f
leaq 0xc814(%rip), %rsi      # 0x113df
movl $0x720, %edx            # imm = 0x720
movl %ebx, %r8d
movl 0x4(%rsp), %r9d
xorl %eax, %eax
callq 0xc2a1
movq %r14, %rdi
callq 0x2030
jmp 0x4c97
cmpl $0x0, 0x1b70d(%rip)     # 0x20300
movl 0x8(%rsp), %ebp
jle 0x4c19
leaq 0xd88b(%rip), %rdi      # 0x1248b
leaq 0xc7d8(%rip), %rsi      # 0x113df
movl $0x6af, %edx            # imm = 0x6AF
movq %rbx, %rcx
movl %ebp, %r8d
xorl %eax, %eax
callq 0xc2a1
movslq %ebp, %rdx
movl 0x18(%rsp), %ebp
movl %ebp, %edi
movq 0x30(%rsp), %rbx
movq %rbx, %rsi
callq 0x20e0
movl %ebp, %edi
callq 0x21a0
movq %rbx, %rdi
callq 0x2030
movl $0xf2, %ebx
jmp 0x4c97
callq 0x2060
movl (%rax), %edi
callq 0x23c0
leaq 0xd671(%rip), %rdi      # 0x122c9
leaq 0xc780(%rip), %rsi      # 0x113df
leaq 0x40(%rsp), %rcx
movl $0x619, %edx            # imm = 0x619
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
jmp 0x4c94
leaq 0xd69e(%rip), %rdi      # 0x1231a
leaq 0xc75c(%rip), %rsi      # 0x113df
movl $0x623, %edx            # imm = 0x623
movl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
callq 0xc2a1
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x848, %rsp            # imm = 0x848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq