// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rsi, %rbx
movq %rdi, %r15
leaq 0x40(%rsp), %rdi
movl $0x3ff, %edx            # imm = 0x3FF
xorl %esi, %esi
callq 0x2170
cmpl $0x0, 0x1cafa(%rip)     # 0x21300
jle 0x4829
leaq 0x5efd(%r14), %rcx
leaq 0xea7d(%rip), %rdi      # 0x13293
leaq 0xdbc2(%rip), %rsi      # 0x123df
movl $0x60f, %edx            # imm = 0x60F
xorl %eax, %eax
callq 0xc84f
cmpl $0x0, 0x1cae0(%rip)     # 0x21310
je 0x4847
leaq 0x5efd(%r14), %rsi
movl 0x1cad5(%rip), %edx     # 0x21314
movq %rbx, %rdi
callq 0x3705
addq $0x5efd, %r14           # imm = 0x5EFD
leaq 0xdbb7(%rip), %rdx      # 0x1240c
leaq 0x40(%rsp), %r12
movl $0x3ff, %esi            # imm = 0x3FF
movq %r12, %rdi
movq %rbx, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x2140
movq %r12, %rdi
movl $0x41, %esi
movl $0x180, %edx            # imm = 0x180
xorl %eax, %eax
callq 0x2330
testl %eax, %eax
js 0x4d1d
movl %eax, %ebp
movl $0x2000, %edi           # imm = 0x2000
callq 0x22a0
testq %rax, %rax
je 0x4d4d
movq %rax, %rbx
movl %ebp, 0x10(%rsp)
movq %r14, 0x38(%rsp)
callq 0xd496
movl %eax, %r12d
movq $0x0, 0x28(%rsp)
xorl %ecx, %ecx
movq %rbx, 0x20(%rsp)
movq %rbx, %rbp
xorl %ebx, %ebx
movq $0x0, 0x8(%rsp)
xorl %r13d, %r13d
movl %eax, 0x1c(%rsp)
movl %ecx, 0x14(%rsp)
movl %ebx, 0x18(%rsp)
movl $0x0, (%rsp)
xorl %ebx, %ebx
cmpl $0x0, 0x2050(%r15)
je 0x4908
movl $0x0, 0x2050(%r15)
movb 0x2038(%r15), %al
jmp 0x494b
movq 0x2010(%r15), %rcx
testq %rcx, %rcx
je 0x4920
movq 0x2018(%r15), %rax
cmpq %rax, %rcx
jbe 0x4936
movq %r15, %rdi
callq 0x763f
movq 0x2010(%r15), %rcx
movq 0x2018(%r15), %rax
cmpq %rax, %rcx
ja 0x4cc2
movb (%rcx), %al
incq %rcx
movq %rcx, 0x2010(%r15)
movzbl %al, %ecx
cmpb $0x1f, %al
jg 0x499a
cmpb $0xa, %al
je 0x4963
cmpl $0xd, %ecx
je 0x4963
cmpl $0xff, %ecx
jne 0x48ea
testl %r12d, %r12d
jg 0x4a33
cmpb $0xa, %al
jne 0x4a33
movq %rbp, %r14
movq 0x8(%rsp), %rax
leal 0x1(%rax), %ebp
incl %r13d
cmpl $0x2, %eax
jge 0x4b72
movl %ebp, %eax
movq %rax, 0x8(%rsp)
movq %r14, %rbp
jmp 0x4af4
testl %r12d, %r12d
jle 0x4a33
cmpb $0x2d, %al
jne 0x4a33
cmpl $0x0, 0x1c94e(%rip)     # 0x21300
movq 0x2010(%r15), %rcx
movq %rbp, 0x30(%rsp)
jle 0x49e4
decq %rcx
leaq 0xe9a3(%rip), %rdi      # 0x1336d
leaq 0xda0e(%rip), %rsi      # 0x123df
movl $0x669, %edx            # imm = 0x669
xorl %eax, %eax
callq 0xc84f
movq 0x2010(%r15), %rcx
leaq 0x440(%rsp), %r12
decq %rcx
movq %rcx, %rdi
movl $0xa, %esi
callq 0x2120
testq %rax, %rax
je 0x4a6f
movq %rax, %rbp
movb $0x0, (%rax)
movq 0x2010(%r15), %rdi
leaq -0x1(%rdi), %r12
callq 0x2110
leal 0x1(%rax), %esi
movq %r12, %rdi
callq 0xd609
movl %eax, %r12d
movb $0xa, (%rbp)
movq 0x30(%rsp), %rbp
jmp 0x4ae6
cmpb $0x3d, %al
je 0x4b07
cmpl $0xff, %ecx
je 0x4cc2
leaq 0xdc12(%rip), %rax      # 0x12660
movb (%rcx,%rax), %al
movq $0x0, 0x8(%rsp)
cmpb $-0x80, %al
je 0x4af4
movslq %ebx, %rcx
movb %al, (%rsp,%rcx)
incl %ebx
jmp 0x4af4
movq %r12, %rdi
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x7949
cmpl $0x0, 0x1c87a(%rip)     # 0x21300
jle 0x4aa5
leaq 0xe913(%rip), %rdi      # 0x133a2
leaq 0xd949(%rip), %rsi      # 0x123df
movl $0x672, %edx            # imm = 0x672
movq %r12, %rcx
xorl %eax, %eax
callq 0xc84f
movq %r12, %rdi
callq 0x2110
leal 0x1(%rax), %esi
movq %r12, %rdi
callq 0xd609
movl %eax, %r12d
cmpl $0x0, 0x1c83e(%rip)     # 0x21300
movq 0x30(%rsp), %rbp
jle 0x4ae6
leaq 0xe8fd(%rip), %rdi      # 0x133cd
leaq 0xd908(%rip), %rsi      # 0x123df
movl $0x674, %edx            # imm = 0x674
movl %r12d, %ecx
xorl %eax, %eax
callq 0xc84f
testl %r12d, %r12d
jg 0x4c83
movl 0x1c(%rsp), %r12d
cmpl $0x4, %ebx
jl 0x48ea
xorl %r12d, %r12d
xorl %edi, %edi
jmp 0x4ba7
leaq 0x3(%rsp), %rax
cmpl $0x3, %ebx
je 0x4b20
cmpl $0x2, %ebx
jne 0x4b23
movb $0x0, 0x3(%rsp)
leaq 0x2(%rsp), %rax
movb $0x0, (%rax)
movl $0x4, %r14d
subl %ebx, %r14d
leaq 0x1fc2d(%rip), %rdi     # 0x24760
movl $0x400, %esi            # imm = 0x400
movq %r15, %rdx
callq 0x7949
cmpl $0x0, 0x1c7b9(%rip)     # 0x21300
movl %r14d, 0x14(%rsp)
jle 0x4bac
xorl %r12d, %r12d
leaq 0xe9b3(%rip), %rdi      # 0x1350b
leaq 0xd880(%rip), %rsi      # 0x123df
movl $0x6cd, %edx            # imm = 0x6CD
movl %ebx, %ecx
movl %r14d, %r8d
xorl %eax, %eax
callq 0xc84f
jmp 0x4baf
movb $0x1, %r12b
cmpl $0x0, 0x1c784(%rip)     # 0x21300
jle 0x4b9b
leaq 0xe8b6(%rip), %rdi      # 0x1343b
leaq 0xd853(%rip), %rsi      # 0x123df
movl $0x69e, %edx            # imm = 0x69E
movl %r13d, %ecx
xorl %eax, %eax
callq 0xc84f
xorl %edi, %edi
movl %ebp, %eax
movq %rax, 0x8(%rsp)
movq %r14, %rbp
xorl %r14d, %r14d
jmp 0x4bc2
xorl %r12d, %r12d
xorl %edi, %edi
xorl %r14d, %r14d
movq $0x0, 0x8(%rsp)
movl $0x4, %ebx
movb (%rsp), %al
movb 0x1(%rsp), %cl
shlb $0x2, %al
movl %ecx, %edx
sarb $0x4, %dl
orb %al, %dl
movb %dl, 0x5(%rsp)
shlb $0x4, %cl
movb 0x2(%rsp), %al
movl %eax, %edx
sarb $0x2, %dl
orb %cl, %dl
movb %dl, 0x6(%rsp)
shlb $0x6, %al
orb 0x3(%rsp), %al
movb %al, 0x7(%rsp)
cmpl $0x4, %ebx
jne 0x4d85
movl 0x18(%rsp), %ebx
cmpl $0x1ffd, %ebx           # imm = 0x1FFD
jl 0x4c25
movl %ebx, %edx
movl %edi, %ebp
movl 0x10(%rsp), %edi
movq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x20e0
movl %ebp, %edi
movq %rbx, %rbp
xorl %ebx, %ebx
movl $0x3, %eax
movl 0x14(%rsp), %ecx
subl %ecx, %eax
cmpl $0x2, %ecx
jg 0x4c5d
cmpl $0x2, %eax
movl $0x1, %ecx
cmovgel %eax, %ecx
xorl %edx, %edx
movb 0x5(%rsp,%rdx), %sil
movb %sil, (%rbp,%rdx)
incq %rdx
cmpq %rdx, %rcx
jne 0x4c42
addl %ecx, %ebx
addq %rdx, %rbp
movl 0x14(%rsp), %ecx
cltq
addq %rax, 0x28(%rsp)
testl %ecx, %ecx
setg %al
orb %dil, %r12b
orb %al, %r12b
cmpb $0x1, %r12b
movl 0x1c(%rsp), %r12d
jne 0x48d9
jmp 0x4db0
movl $0x1, %r14d
movb $0x1, %dil
cmpl $0x0, 0x1c66d(%rip)     # 0x21300
jle 0x4cba
xorl %r12d, %r12d
leaq 0xe75c(%rip), %rdi      # 0x133fb
leaq 0xd739(%rip), %rsi      # 0x123df
movl $0x67b, %edx            # imm = 0x67B
xorl %eax, %eax
callq 0xc84f
movb $0x1, %dil
jmp 0x4bc2
xorl %r12d, %r12d
jmp 0x4bc2
cmpl $0x0, 0x1c637(%rip)     # 0x21300
movl 0x18(%rsp), %ebx
jle 0x4cf1
leaq 0xe7b5(%rip), %rdi      # 0x1348b
leaq 0xd702(%rip), %rsi      # 0x123df
movl $0x6af, %edx            # imm = 0x6AF
movq 0x38(%rsp), %rcx
movl %ebx, %r8d
xorl %eax, %eax
callq 0xc84f
movslq %ebx, %rdx
movl 0x10(%rsp), %ebp
movl %ebp, %edi
movq 0x20(%rsp), %rbx
movq %rbx, %rsi
callq 0x20e0
movl %ebp, %edi
callq 0x21a0
movq %rbx, %rdi
callq 0x2030
movl $0xf2, %ebx
jmp 0x4d71
callq 0x2060
movl (%rax), %edi
callq 0x23b0
leaq 0xe599(%rip), %rdi      # 0x132c9
leaq 0xd6a8(%rip), %rsi      # 0x123df
leaq 0x40(%rsp), %rcx
movl $0x619, %edx            # imm = 0x619
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
jmp 0x4d6c
leaq 0xe5c6(%rip), %rdi      # 0x1331a
leaq 0xd684(%rip), %rsi      # 0x123df
movl $0x623, %edx            # imm = 0x623
movl $0x2000, %ecx           # imm = 0x2000
xorl %eax, %eax
callq 0xc84f
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x848, %rsp            # imm = 0x848
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x1c574(%rip)     # 0x21300
movl 0x18(%rsp), %ebx
jle 0x4db0
movl %edi, %ebp
leaq 0xe7b8(%rip), %rdi      # 0x13553
leaq 0xd63d(%rip), %rsi      # 0x123df
movl $0x705, %edx            # imm = 0x705
xorl %eax, %eax
callq 0xc84f
movl %ebp, %edi
movl %edi, %r15d
movl %r14d, %ebp
testl %ebx, %ebx
movq 0x20(%rsp), %r14
movl %ebx, %eax
movl 0x10(%rsp), %ebx
jle 0x4dd1
movl %eax, %edx
movl %ebx, %edi
movq %r14, %rsi
callq 0x20e0
movl %ebx, %edi
callq 0x21a0
xorl %eax, %eax
movq 0x28(%rsp), %rcx
testq %rcx, %rcx
sete %al
addl %eax, %eax
testb %r15b, %r15b
movl $0x1, %ebx
cmovel %eax, %ebx
cmpl $0x0, 0x1c507(%rip)     # 0x21300
jle 0x4e1b
leaq 0xe78d(%rip), %rdi      # 0x1358f
leaq 0xd5d6(%rip), %rsi      # 0x123df
movl $0x720, %edx            # imm = 0x720
movl %ebx, %r8d
movl %ebp, %r9d
xorl %eax, %eax
callq 0xc84f
movq %r14, %rdi
callq 0x2030
jmp 0x4d71