// File: /workspace/github_c_makefile_star2_O3/inflex[P]ripMIME/MIME_headers.c
// Function: MIMEH_read_headers
int MIMEH_read_headers( struct MIMEH_header_info *hinfo, FFGET_FILE *f )
{
    char buffer[_MIMEH_STRLEN_MAX+1];
    int totalsize=0;
    int linesize=0;
    int totalsize_original=0;
    int result = 0;
    int firstline = 1;
    int search_count=0;
    char *tmp;
    char *tmp_original;
    char *fget_result = NULL;
    char *headerline_end;
    char *p;
    char *linestart;
    char *lineend;

    int is_RFC822_headers=0;    // 20040208-1335:PLD: Added to give an indication if the headers are RFC822 like; used in conjunction with the header_longsearch for pulling apart qmail bouncebacks.

    /**
      Lets start the ugly big fat DO loop here so that we can, if needed
      search until we find headers which are actually valid.  Personally
      I hate this - but people want it in order to detect malformed
      (deliberate or otherwise) emails.  It'd be nice if for once in the
      software world someone actually enforced standards rather than trying
      to be overly intelligent about interpreting data.
     **/

    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: File position = %ld [0x%0X]"
            ,FL
            ,FFGET_ftell(f)
            ,FFGET_ftell(f)
            );
    do {

        search_count++;
        glb.headerline = NULL;
        glb.headerline_original = NULL;
        tmp_original = NULL;

        while ((fget_result=FFGET_fgets(buffer,_MIMEH_STRLEN_MAX, f)))
        {
            linestart = buffer;
            linesize = strlen(linestart);
            lineend = linestart +linesize;

            if (strstr(linestart,"\r\n")) hinfo->crlf_count++;
            else if (strstr(linestart,"\r\r")) hinfo->crcr_count++;
            else if (strchr(linestart,'\n')) hinfo->lf_count++;

            if (MIMEH_DNORMAL)LOGGER_log("%s:%d:MIMEH_read_headers: [CRLF=%d, CRCR=%d, LF=%d] Data In=[sz=%d:tb=%d:mem=%p]'%s'",FL, hinfo->crlf_count, hinfo->crcr_count, hinfo->lf_count, linesize, f->trueblank, glb.headerline, buffer);

            // If we are being told to copy the input data to an output file
            //      then do so here (this is for the originals)
            if ((glb.original_header_save_to_file > 0)&&(glb.original_header_file != NULL))
            {
                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: saving to file...",FL);
                fprintf(glb.original_header_file,"%s",linestart);
            }

            // if we are being told to keep a copy of the original data
            //  as it comes in from ffget, then do the storage here
            if (glb.save_headers_original > 0)
            {
                if (MIMEH_DNORMAL) LOGGER_log("MIMEH_read_headers:DEBUG:Data-In:[%d:%d] '%s'", strlen(linestart), linesize, linestart);
                tmp_original = realloc(glb.headerline_original, totalsize_original+linesize+1);
                if (tmp_original == NULL)
                {
                    LOGGER_log("%s:%d:MIMEH_read_headers:ERROR: Cannot allocate %d bytes to contain new headers_original ", FL,totalsize_original +linesize +1);
                    if (glb.headerline_original != NULL) free(glb.headerline_original);
                    glb.headerline_original = NULL;
                    return -1;
                }

                if (glb.headerline_original == NULL)
                {
                    glb.headerline_original = tmp_original;
                    totalsize_original = linesize +1;
                    PLD_strncpy( glb.headerline_original, linestart, (linesize+1));
                    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: '%s'", FL, glb.headerline_original);
                } else {
                    glb.headerline_original = tmp_original;
                    PLD_strncpy( (glb.headerline_original +totalsize_original -1), linestart, (linesize +1));
                    totalsize_original += linesize;
                    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: HO =  '%s'", FL, glb.headerline_original);
                }
                //LOGGER_log("DEBUG:linesize=%d data='%s'",linesize, linestart);
            }

            /** Normal processing of the headers now starts. **/
            if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: realloc'ing dataspace",FL);
            tmp = realloc(glb.headerline, totalsize+linesize+1);
            if (tmp == NULL)
            {
                LOGGER_log("%s:%d:MIMEH_read_headers:ERROR: Cannot allocate %d bytes to contain new headers ", FL,totalsize +linesize +1);
                if (glb.headerline != NULL) free(glb.headerline);
                glb.headerline = NULL;
                return -1;
            }

            if (glb.headerline == NULL)
            {
                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: Initial appending of head to dataspace headerline = NULL  realloc block = %p linestart = %p linesize = %d",FL, tmp, linestart, linesize);
                glb.headerline = tmp;
                totalsize = linesize;
                PLD_strncpy(glb.headerline, linestart, (linesize +1));
                headerline_end = glb.headerline +totalsize;
            } // If the global headerline is currently NULL
            else
            {
                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: Appending of new data to existing header  existing-headerline = %p  new realloc block = %p linestart = %p linesize = %d",FL, glb.headerline, tmp, linestart, linesize);

                // Perform header unfolding by removing any CRLF's
                //  of the last line if the first characters of the
                //  newline are blank/space

                glb.headerline = tmp;

                if ((linestart < lineend)&&((*linestart == '\t')||(*linestart == ' ')))
                {

                    // Here we start at the last character of the previous line
                    // and check to see if it's a 'space' type charcter, if it is
                    // we will then reduce the total size of the headers thus far and
                    // move the pointer where we're going to append this new line back
                    //  one more character - Ultimately what we wish to achieve is that
                    //  the new line will tacked on [sans leading spaces] to the end of
                    //  the previous line.
                    //
                    // 'p' holds the location at the -end- of the current headers where
                    //      we are going to append the newly read line

                    p = glb.headerline +totalsize -1;
                    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: unwrapping headers headers=%p, p = %p",FL,glb.headerline, p);
                    while ((p >= glb.headerline)&&(( *p == '\n' )||( *p == '\r' )))
                    {
                        if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: Removing trailing space p=[%p]%c",FL, p, *p);
                        *p = '\0';
                        p--;
                        totalsize--;
                    }

                    p = glb.headerline +totalsize -1;
                }

                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: Memcopying line, source = %p, dest = %p, size = %d", FL, linestart, glb.headerline +totalsize, linesize);
                memcpy((glb.headerline +totalsize), linestart, (linesize));
                totalsize += linesize;
                *(glb.headerline +totalsize) = '\0';

            }   // If the glb.headerline already is allocated and we're appending to it.

            if (f->trueblank)
            {
                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_read_headers:DEBUG: Trueblank line detected in header reading",FL);
                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_read_headers:DEBUG: Headers /before/ decoding\n-------\n%s\n-------------------",FL, glb.headerline);

                MIMEH_fix_header_mistakes( glb.headerline );
                MDECODE_decode_ISO( glb.headerline, totalsize  );

                if ((glb.save_headers)&&(glb.headerline))
                {
                    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_read_headers:DEBUG: Saving header line.",FL);
                    fprintf(glb.header_file,"%s",glb.headerline);
                }
                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_read_headers:DEBUG: Final Headers\n------------------\n%s---------------", FL,glb.headerline);
                //result = 1;
                //result = 0;
                break;
            } // If the last line was in fact a true blank line

            // If there was a doubleCR at the end of the line,
            //  then we need to save the next set of data until there
            //  is a \n
            if (FFGET_doubleCR)
            {
                if (glb.doubleCR_save != 0)
                {
                    MIMEH_save_doubleCR(f);
                    glb.doubleCR = 1;
                }
                FFGET_doubleCR = 0;
                FFGET_SDL_MODE = 0;
            } // FFGET_doubleCR test

            firstline = 0;
        } // While reading more headers from the source file.


        // If FFGET ran out of data whilst processing the headers, then acknowledge this
        // by returning a -1.
        //
        // NOTE - This does not mean we do not have any data!
        //  it just means that our input ran out.

        if (!fget_result)
        {
            if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_read_headers:ERROR: FFGET module ran out of input while reading headers",FL);
            /** If we're meant to be saving the headers, we better do that now, even though we couldn't
             ** read everything we wanted to **/
            if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_read_headers:DEBUG: save_headers=%d totalsize=%d headerline=%s", FL, glb.save_headers, totalsize, glb.headerline);

            if ((glb.save_headers)&&(glb.headerline))
            {
                if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIME_read_headers:DEBUG: Saving header line.",FL);
                MIMEH_fix_header_mistakes( glb.headerline );
                MDECODE_decode_ISO( glb.headerline, totalsize  );
                fprintf(glb.header_file,"%s",glb.headerline);
            }

            result = -1;
        } else {

            if (glb.header_longsearch > 0) {
                /** Test the headers for RFC compliance... **/
                is_RFC822_headers =  MIMEH_are_headers_RFC822(glb.headerline);
                if (is_RFC822_headers == 0)
                {
                    /** If not RFC822 headers, then clean up everything we allocated in here **/
                    DMIMEH LOGGER_log("%s:%d:MIME_read_headers:DEBUG: No RFC822 headers detected, cleanup.", FL);
                    MIMEH_headers_cleanup();
                }
            }
        }
    } while ((is_RFC822_headers==0)&&(glb.header_longsearch>0)&&(result==0)&&(search_count<glb.longsearch_limit));

    if (MIMEH_DNORMAL) LOGGER_log("%s:%d:MIMEH_read_headers:DEBUG: Finished.",FL);
    return result;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x2818, %rsp           # imm = 0x2818
movq %rsi, %r14
movq %rdi, 0x8(%rsp)
cmpl $0x0, 0x23c98(%rip)     # 0x2c38c
jle 0x8729
movq %r14, %rdi
callq 0x78c0
movq %rax, %rbx
movq %r14, %rdi
callq 0x78c0
leaq 0xcfec(%rip), %rdi      # 0x156fc
leaq 0xcbc7(%rip), %rsi      # 0x152de
movl $0x449, %edx            # imm = 0x449
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc84f
movq %r14, 0x18(%rsp)
leaq 0x20(%rsp), %r15
xorl %eax, %eax
movq $0x0, 0x10(%rsp)
xorl %ebp, %ebp
movl %eax, 0x4(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x23c22(%rip)    # 0x2c370
movq %r15, %rdi
movl $0x27f6, %esi           # imm = 0x27F6
movq 0x18(%rsp), %rbx
movq %rbx, %rdx
callq 0x7949
testq %rax, %rax
je 0x8bbe
movq %r15, %rdi
callq 0x2110
movq %rax, %r13
movq %r15, %rdi
leaq 0xcae6(%rip), %rsi      # 0x15267
callq 0x23c0
testq %rax, %rax
je 0x8798
movq 0x8(%rsp), %rax
incl 0x18d3c(%rax)
jmp 0x87d6
movq %r15, %rdi
leaq 0xcf96(%rip), %rsi      # 0x15738
callq 0x23c0
testq %rax, %rax
je 0x87b9
movq 0x8(%rsp), %rax
incl 0x18d40(%rax)
jmp 0x87d6
movq %r15, %rdi
movl $0xa, %esi
callq 0x2120
testq %rax, %rax
je 0x87d6
movq 0x8(%rsp), %rax
incl 0x18d44(%rax)
cmpl $0x0, 0x23baf(%rip)     # 0x2c38c
jle 0x8829
movq 0x8(%rsp), %rax
movl 0x18d3c(%rax), %ecx
movl 0x18d40(%rax), %r8d
movl 0x18d44(%rax), %r9d
movl 0x2054(%rbx), %r10d
leaq 0xcf35(%rip), %rdi      # 0x1573b
leaq 0xcad1(%rip), %rsi      # 0x152de
movl $0x45e, %edx            # imm = 0x45E
xorl %eax, %eax
pushq %r15
pushq 0x23b54(%rip)           # 0x2c370
pushq %r10
pushq %r13
callq 0xc84f
addq $0x20, %rsp
cmpl $0x0, 0x26388(%rip)     # 0x2ebb8
setg %al
movq 0x26376(%rip), %rsi     # 0x2ebb0
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8879
cmpl $0x0, 0x23b3e(%rip)     # 0x2c38c
jle 0x8871
leaq 0xcf39(%rip), %rdi      # 0x15790
leaq 0xca80(%rip), %rsi      # 0x152de
movl $0x464, %edx            # imm = 0x464
xorl %eax, %eax
callq 0xc84f
movq 0x2633f(%rip), %rsi     # 0x2ebb0
movq %r15, %rdi
callq 0x2160
movq %r13, %r12
shlq $0x20, %r12
cmpl $0x0, 0x23afd(%rip)     # 0x2c384
jle 0x8984
cmpl $0x0, 0x23af8(%rip)     # 0x2c38c
jle 0x88b5
movq %r15, %rdi
callq 0x2110
leaq 0xcf1d(%rip), %rdi      # 0x157c2
movq %rax, %rsi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xc84f
movq 0x23abc(%rip), %rdi     # 0x2c378
movq 0x10(%rsp), %rax
leal (%rax,%r13), %ebx
incl %ebx
movslq %ebx, %rsi
callq 0x2310
testq %rax, %rax
je 0x8e3c
cmpq $0x0, 0x23a98(%rip)     # 0x2c378
movq %rax, 0x23a91(%rip)     # 0x2c378
je 0x8943
movq 0x10(%rsp), %rdx
movslq %edx, %rcx
addl %r13d, %edx
movq %rdx, 0x10(%rsp)
leaq (%rax,%rcx), %rdi
decq %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r12,%rax), %rdx
sarq $0x20, %rdx
movq %r15, %rsi
callq 0xbede
cmpl $0x0, 0x23a6b(%rip)     # 0x2c38c
jle 0x89a7
movq 0x23a4a(%rip), %rcx     # 0x2c378
leaq 0xcf3a(%rip), %rdi      # 0x1586f
leaq 0xc9a2(%rip), %rsi      # 0x152de
movl $0x480, %edx            # imm = 0x480
jmp 0x897d
leal 0x1(%r13), %ecx
movq %rcx, 0x10(%rsp)
movslq %ecx, %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0xbede
cmpl $0x0, 0x23a2b(%rip)     # 0x2c38c
jle 0x89a7
movq 0x23a0e(%rip), %rcx     # 0x2c378
leaq 0xced9(%rip), %rdi      # 0x1584a
leaq 0xc966(%rip), %rsi      # 0x152de
movl $0x47b, %edx            # imm = 0x47B
xorl %eax, %eax
callq 0xc84f
cmpl $0x0, 0x23a01(%rip)     # 0x2c38c
jle 0x89a7
leaq 0xcf06(%rip), %rdi      # 0x1589a
leaq 0xc943(%rip), %rsi      # 0x152de
movl $0x486, %edx            # imm = 0x486
xorl %eax, %eax
callq 0xc84f
movq 0x239c2(%rip), %rdi     # 0x2c370
leal 0x1(%rbp,%r13), %ebx
movslq %ebx, %rsi
callq 0x2310
testq %rax, %rax
je 0x8e02
movq %rax, %r14
movq 0x239a2(%rip), %rcx     # 0x2c370
movl 0x239b8(%rip), %eax     # 0x2c38c
testq %rcx, %rcx
je 0x8b14
testl %eax, %eax
jle 0x8a0b
subq $0x8, %rsp
leaq 0xcfbf(%rip), %rdi      # 0x159ab
leaq 0xc8eb(%rip), %rsi      # 0x152de
movl $0x49a, %edx            # imm = 0x49A
movq %r14, %r8
movq %r15, %r9
xorl %eax, %eax
pushq %r13
callq 0xc84f
addq $0x10, %rsp
movslq %r13d, %r12
movq %r14, 0x2395b(%rip)     # 0x2c370
testq %r12, %r12
jle 0x8ab7
movzbl 0x20(%rsp), %eax
cmpl $0x20, %eax
je 0x8a31
cmpl $0x9, %eax
jne 0x8ab7
movslq %ebp, %rax
leaq (%r14,%rax), %rbx
decq %rbx
cmpl $0x0, 0x2394a(%rip)     # 0x2c38c
jle 0x8a6b
leaq 0xcff8(%rip), %rdi      # 0x15a43
leaq 0xc88c(%rip), %rsi      # 0x152de
movl $0x4b1, %edx            # imm = 0x4B1
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc84f
movq 0x23905(%rip), %r14     # 0x2c370
cmpq %r14, %rbx
jb 0x8ab7
movzbl (%rbx), %r8d
cmpl $0xd, %r8d
je 0x8a80
cmpl $0xa, %r8d
jne 0x8ab7
cmpl $0x0, 0x23905(%rip)     # 0x2c38c
jle 0x8aad
leaq 0xcff9(%rip), %rdi      # 0x15a89
leaq 0xc847(%rip), %rsi      # 0x152de
movl $0x4b4, %edx            # imm = 0x4B4
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc84f
movq 0x238c3(%rip), %r14     # 0x2c370
movb $0x0, (%rbx)
decq %rbx
decl %ebp
jmp 0x8a6b
cmpl $0x0, 0x238ce(%rip)     # 0x2c38c
movslq %ebp, %rbp
jle 0x8af0
addq %rbp, %r14
leaq 0xcffd(%rip), %rdi      # 0x15aca
leaq 0xc80a(%rip), %rsi      # 0x152de
movl $0x4bd, %edx            # imm = 0x4BD
movq %r15, %rcx
movq %r14, %r8
movl %r13d, %r9d
xorl %eax, %eax
callq 0xc84f
movq 0x23880(%rip), %r14     # 0x2c370
addq %rbp, %r14
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2260
addl %r13d, %ebp
movq 0x23865(%rip), %rax     # 0x2c370
movslq %ebp, %rcx
movb $0x0, (%rax,%rcx)
jmp 0x8b64
testl %eax, %eax
jle 0x8b3b
leaq 0xce02(%rip), %rdi      # 0x15921
leaq 0xc7b8(%rip), %rsi      # 0x152de
movl $0x492, %edx            # imm = 0x492
movq %r14, %rcx
movq %r15, %r8
movl %r13d, %r9d
xorl %eax, %eax
callq 0xc84f
movq %r14, 0x2382e(%rip)     # 0x2c370
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r12
sarq $0x20, %r12
movq %r14, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0xbede
movl %r13d, %ebp
movq 0x18(%rsp), %rbx
cmpl $0x0, 0x2054(%rbx)
jne 0x8cc2
leaq 0x1bfef(%rip), %rax     # 0x24b6c
cmpl $0x0, (%rax)
je 0x8bb1
cmpl $0x0, 0x1bffb(%rip)     # 0x24b84
je 0x8b9d
movq %rbx, %rdi
callq 0x817e
movl $0x1, 0x1bfe3(%rip)     # 0x24b80
xorl %eax, %eax
leaq 0x1bfc6(%rip), %rcx     # 0x24b6c
movl %eax, (%rcx)
leaq 0x1bfc1(%rip), %rcx     # 0x24b70
movl %eax, (%rcx)
movq %r15, %rdi
movl $0x27f6, %esi           # imm = 0x27F6
jmp 0x875b
cmpl $0x0, 0x237c7(%rip)     # 0x2c38c
jle 0x8c14
leaq 0xd075(%rip), %rdi      # 0x15c43
leaq 0xc709(%rip), %rsi      # 0x152de
movl $0x4f1, %edx            # imm = 0x4F1
xorl %eax, %eax
callq 0xc84f
cmpl $0x0, 0x237a4(%rip)     # 0x2c38c
jle 0x8c14
movl 0x23790(%rip), %ecx     # 0x2c380
movq 0x23779(%rip), %r9      # 0x2c370
leaq 0xd098(%rip), %rdi      # 0x15c96
leaq 0xc6d9(%rip), %rsi      # 0x152de
movl $0x4f4, %edx            # imm = 0x4F4
movl %ebp, %r8d
xorl %eax, %eax
callq 0xc84f
cmpl $0x0, 0x23765(%rip)     # 0x2c380
setne %al
movq 0x2374b(%rip), %rdi     # 0x2c370
testq %rdi, %rdi
setne %cl
andb %al, %cl
movb $0x1, %r12b
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
cmpb $0x1, %cl
jne 0x8c8b
cmpl $0x0, 0x2374a(%rip)     # 0x2c38c
jle 0x8c65
leaq 0xcf73(%rip), %rdi      # 0x15bbe
leaq 0xc68c(%rip), %rsi      # 0x152de
movl $0x4f8, %edx            # imm = 0x4F8
xorl %eax, %eax
callq 0xc84f
movq 0x2370b(%rip), %rdi     # 0x2c370
callq 0x854e
movq 0x236ff(%rip), %rdi     # 0x2c370
movl %ebp, %esi
callq 0xccd7
movq 0x25f29(%rip), %rsi     # 0x2eba8
movq 0x236ea(%rip), %rdi     # 0x2c370
callq 0x2160
xorl %ebx, %ebx
movl 0x4(%rsp), %eax
testb %bl, %bl
je 0x8e8f
testb %r12b, %r12b
je 0x8e8f
cmpl $0x0, 0x236fb(%rip)     # 0x2c3a4
jle 0x8e8f
incl %eax
cmpl 0x236f1(%rip), %eax     # 0x2c3a8
jl 0x8740
jmp 0x8e8f
cmpl $0x0, 0x236c3(%rip)     # 0x2c38c
jle 0x8d0f
leaq 0xce4b(%rip), %rdi      # 0x15b1d
leaq 0xc605(%rip), %rsi      # 0x152de
movl $0x4c6, %edx            # imm = 0x4C6
xorl %eax, %eax
callq 0xc84f
cmpl $0x0, 0x236a0(%rip)     # 0x2c38c
jle 0x8d0f
movq 0x2367b(%rip), %rcx     # 0x2c370
leaq 0xce6a(%rip), %rdi      # 0x15b66
leaq 0xc5db(%rip), %rsi      # 0x152de
movl $0x4c7, %edx            # imm = 0x4C7
xorl %eax, %eax
callq 0xc84f
movq 0x2365a(%rip), %rdi     # 0x2c370
callq 0x854e
movq 0x2364e(%rip), %rdi     # 0x2c370
movl %ebp, %esi
callq 0xccd7
cmpl $0x0, 0x23650(%rip)     # 0x2c380
setne %al
movq 0x23636(%rip), %rdi     # 0x2c370
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8d7d
cmpl $0x0, 0x2363e(%rip)     # 0x2c38c
jle 0x8d71
leaq 0xce67(%rip), %rdi      # 0x15bbe
leaq 0xc580(%rip), %rsi      # 0x152de
movl $0x4ce, %edx            # imm = 0x4CE
xorl %eax, %eax
callq 0xc84f
movq 0x235ff(%rip), %rdi     # 0x2c370
movq 0x25e30(%rip), %rsi     # 0x2eba8
callq 0x2160
cmpl $0x0, 0x23608(%rip)     # 0x2c38c
jle 0x8da7
movq 0x235e3(%rip), %rcx     # 0x2c370
leaq 0xce5d(%rip), %rdi      # 0x15bf1
leaq 0xc543(%rip), %rsi      # 0x152de
movl $0x4d1, %edx            # imm = 0x4D1
xorl %eax, %eax
callq 0xc84f
movb $0x1, %bl
cmpl $0x0, 0x235f4(%rip)     # 0x2c3a4
jle 0x8dcd
movq 0x235b7(%rip), %rdi     # 0x2c370
callq 0x8039
xorl %r14d, %r14d
testl %eax, %eax
je 0x8dd2
xorl %r12d, %r12d
jmp 0x8c8d
xorl %r14d, %r14d
jmp 0x8dfa
cmpl $0x0, 0x235b3(%rip)     # 0x2c38c
jle 0x8df5
leaq 0xcefe(%rip), %rdi      # 0x15ce0
leaq 0xc4f5(%rip), %rsi      # 0x152de
movl $0x507, %edx            # imm = 0x507
xorl %eax, %eax
callq 0xc84f
callq 0xaf9a
movb $0x1, %r12b
jmp 0x8c8d
leaq 0xcac7(%rip), %rdi      # 0x158d0
leaq 0xc4ce(%rip), %rsi      # 0x152de
movl $0x48a, %edx            # imm = 0x48A
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc84f
movq 0x2354b(%rip), %rdi     # 0x2c370
testq %rdi, %rdi
je 0x8e2f
callq 0x2030
movq $0x0, 0x23536(%rip) # 0x2c370
jmp 0x8e74
leaq 0xc9ad(%rip), %rdi      # 0x157f0
leaq 0xc494(%rip), %rsi      # 0x152de
movl $0x470, %edx            # imm = 0x470
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc84f
movq 0x23519(%rip), %rdi     # 0x2c378
testq %rdi, %rdi
je 0x8e69
callq 0x2030
movq $0x0, 0x23504(%rip) # 0x2c378
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
movl %r14d, %eax
addq $0x2818, %rsp           # imm = 0x2818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0x234f6(%rip)     # 0x2c38c
jle 0x8e7a
leaq 0xce85(%rip), %rdi      # 0x15d24
leaq 0xc438(%rip), %rsi      # 0x152de
movl $0x50e, %edx            # imm = 0x50E
xorl %eax, %eax
callq 0xc84f
jmp 0x8e7a