// File: /workspace/github_c_makefile_star2_O1/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, 0x10(%rsp)
cmpl $0x0, 0x23b5b(%rip)     # 0x2c38c
jle 0x8866
movq %r14, %rdi
callq 0x7980
movq %rax, %rbx
movq %r14, %rdi
callq 0x7980
leaq 0xce7f(%rip), %rdi      # 0x156cc
leaq 0xca5a(%rip), %rsi      # 0x152ae
movl $0x449, %edx            # imm = 0x449
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc960
leaq 0x20(%rsp), %r15
xorl %ecx, %ecx
movq $0x0, 0x18(%rsp)
xorl %r12d, %r12d
movl %ecx, 0xc(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x23ae9(%rip)    # 0x2c370
movq %r15, %rdi
movl $0x27f6, %esi           # imm = 0x27F6
movq %r14, %rdx
callq 0x7a09
testq %rax, %rax
setne %r13b
je 0x8deb
movb %r13b, 0xb(%rsp)
movq %r15, %rdi
callq 0x2110
movq %rax, %r13
movq %r15, %rdi
leaq 0xc979(%rip), %rsi      # 0x15237
callq 0x23d0
testq %rax, %rax
je 0x88d5
movq 0x10(%rsp), %rax
incl 0x18d3c(%rax)
jmp 0x8913
movq %r15, %rdi
leaq 0xce29(%rip), %rsi      # 0x15708
callq 0x23d0
testq %rax, %rax
je 0x88f6
movq 0x10(%rsp), %rax
incl 0x18d40(%rax)
jmp 0x8913
movq %r15, %rdi
movl $0xa, %esi
callq 0x2120
testq %rax, %rax
je 0x8913
movq 0x10(%rsp), %rax
incl 0x18d44(%rax)
cmpl $0x0, 0x23a72(%rip)     # 0x2c38c
jle 0x8966
movq 0x10(%rsp), %rax
movl 0x18d3c(%rax), %ecx
movl 0x18d40(%rax), %r8d
movl 0x18d44(%rax), %r9d
movl 0x2054(%r14), %r10d
leaq 0xcdc8(%rip), %rdi      # 0x1570b
leaq 0xc964(%rip), %rsi      # 0x152ae
movl $0x45e, %edx            # imm = 0x45E
xorl %eax, %eax
pushq %r15
pushq 0x23a17(%rip)           # 0x2c370
pushq %r10
pushq %r13
callq 0xc960
addq $0x20, %rsp
cmpl $0x0, 0x2624b(%rip)     # 0x2ebb8
jle 0x89ab
cmpq $0x0, 0x26239(%rip)     # 0x2ebb0
je 0x89ab
cmpl $0x0, 0x23a0c(%rip)     # 0x2c38c
jle 0x899c
leaq 0xcdd7(%rip), %rdi      # 0x15760
leaq 0xc91e(%rip), %rsi      # 0x152ae
movl $0x464, %edx            # imm = 0x464
xorl %eax, %eax
callq 0xc960
movq 0x2620d(%rip), %rsi     # 0x2ebb0
movq %r15, %rdi
callq 0x2160
movq %r13, %rbp
shlq $0x20, %rbp
cmpl $0x0, 0x239cb(%rip)     # 0x2c384
jle 0x8ab2
cmpl $0x0, 0x239c6(%rip)     # 0x2c38c
jle 0x89e7
movq %r15, %rdi
callq 0x2110
leaq 0xcdbb(%rip), %rdi      # 0x15792
movq %rax, %rsi
movl %r13d, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xc960
movq 0x2398a(%rip), %rdi     # 0x2c378
movq 0x18(%rsp), %rax
leal (%rax,%r13), %ebx
incl %ebx
movslq %ebx, %rsi
callq 0x2320
testq %rax, %rax
je 0x8fa3
cmpq $0x0, 0x23966(%rip)     # 0x2c378
movq %rax, 0x2395f(%rip)     # 0x2c378
je 0x8a71
movq 0x18(%rsp), %rdx
movslq %edx, %rcx
addl %r13d, %edx
movq %rdx, 0x18(%rsp)
leaq (%rax,%rcx), %rdi
decq %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%rax,%rbp), %rdx
sarq $0x20, %rdx
movq %r15, %rsi
callq 0xbfb6
cmpl $0x0, 0x23939(%rip)     # 0x2c38c
jle 0x8ab2
movq 0x2391c(%rip), %rcx     # 0x2c378
leaq 0xcddc(%rip), %rdi      # 0x1583f
leaq 0xc844(%rip), %rsi      # 0x152ae
movl $0x480, %edx            # imm = 0x480
jmp 0x8aab
leal 0x1(%r13), %ecx
movq %rcx, 0x18(%rsp)
movslq %ecx, %rdx
movq %rax, %rdi
movq %r15, %rsi
callq 0xbfb6
cmpl $0x0, 0x238fd(%rip)     # 0x2c38c
jle 0x8ab2
movq 0x238e0(%rip), %rcx     # 0x2c378
leaq 0xcd7b(%rip), %rdi      # 0x1581a
leaq 0xc808(%rip), %rsi      # 0x152ae
movl $0x47b, %edx            # imm = 0x47B
xorl %eax, %eax
callq 0xc960
movq %r14, %r15
cmpl $0x0, 0x238d0(%rip)     # 0x2c38c
jle 0x8ad8
leaq 0xcda5(%rip), %rdi      # 0x1586a
leaq 0xc7e2(%rip), %rsi      # 0x152ae
movl $0x486, %edx            # imm = 0x486
xorl %eax, %eax
callq 0xc960
movq 0x23891(%rip), %rdi     # 0x2c370
leal (%r12,%r13), %ebx
incl %ebx
movslq %ebx, %rsi
callq 0x2320
testq %rax, %rax
je 0x8f69
movq %rax, %r14
movq 0x23870(%rip), %rcx     # 0x2c370
movl 0x23886(%rip), %eax     # 0x2c38c
testq %rcx, %rcx
je 0x8bfc
testl %eax, %eax
jle 0x8b3f
subq $0x8, %rsp
leaq 0xce5d(%rip), %rdi      # 0x1597b
leaq 0xc789(%rip), %rsi      # 0x152ae
movl $0x49a, %edx            # imm = 0x49A
movq %r14, %r8
leaq 0x28(%rsp), %r9
xorl %eax, %eax
pushq %r13
callq 0xc960
addq $0x10, %rsp
movslq %r13d, %rbp
movq %r14, 0x23827(%rip)     # 0x2c370
testq %rbp, %rbp
jle 0x8c59
movzbl 0x20(%rsp), %eax
cmpl $0x20, %eax
je 0x8b65
cmpl $0x9, %eax
jne 0x8c59
movslq %r12d, %rax
leaq (%r14,%rax), %rbx
decq %rbx
cmpl $0x0, 0x23816(%rip)     # 0x2c38c
jle 0x8b98
leaq 0xce94(%rip), %rdi      # 0x15a13
leaq 0xc728(%rip), %rsi      # 0x152ae
movl $0x4b1, %edx            # imm = 0x4B1
movq %r14, %rcx
movq %rbx, %r8
xorl %eax, %eax
callq 0xc960
cmpq 0x237d1(%rip), %rbx     # 0x2c370
movq %r15, %r14
jb 0x8c5c
leaq 0x20(%rsp), %r15
movzbl (%rbx), %eax
cmpl $0xd, %eax
je 0x8bbe
cmpl $0xa, %eax
jne 0x8c61
cmpl $0x0, 0x237c7(%rip)     # 0x2c38c
jle 0x8be8
movsbl %al, %r8d
leaq 0xce87(%rip), %rdi      # 0x15a59
leaq 0xc6d5(%rip), %rsi      # 0x152ae
movl $0x4b4, %edx            # imm = 0x4B4
movq %rbx, %rcx
xorl %eax, %eax
callq 0xc960
movb $0x0, (%rbx)
decq %rbx
decl %r12d
cmpq 0x23778(%rip), %rbx     # 0x2c370
jae 0x8bad
jmp 0x8c61
testl %eax, %eax
leaq 0x20(%rsp), %rbx
jle 0x8c28
leaq 0xcce5(%rip), %rdi      # 0x158f1
leaq 0xc69b(%rip), %rsi      # 0x152ae
movl $0x492, %edx            # imm = 0x492
movq %r14, %rcx
movq %rbx, %r8
movl %r13d, %r9d
xorl %eax, %eax
callq 0xc960
movq %r14, 0x23741(%rip)     # 0x2c370
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %rbp
sarq $0x20, %rbp
movq %r14, %rdi
movq %rbx, %rsi
movq %rbp, %rdx
callq 0xbfb6
movl %r13d, %r12d
movq %r15, %r14
movq %rbx, %r15
jmp 0x8cbd
movq %r15, %r14
leaq 0x20(%rsp), %r15
cmpl $0x0, 0x23724(%rip)     # 0x2c38c
movslq %r12d, %r12
jle 0x8c97
movq 0x236fc(%rip), %r8      # 0x2c370
addq %r12, %r8
leaq 0xce1c(%rip), %rdi      # 0x15a9a
leaq 0xc629(%rip), %rsi      # 0x152ae
movl $0x4bd, %edx            # imm = 0x4BD
movq %r15, %rcx
movl %r13d, %r9d
xorl %eax, %eax
callq 0xc960
movq 0x236d2(%rip), %rdi     # 0x2c370
addq %r12, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2270
addl %r13d, %r12d
movq 0x236ba(%rip), %rax     # 0x2c370
movslq %r12d, %rcx
movb $0x0, (%rax,%rcx)
cmpl $0x0, 0x2054(%r14)
jne 0x8d0b
leaq 0x1be9e(%rip), %rax     # 0x24b6c
cmpl $0x0, (%rax)
je 0x8887
cmpl $0x0, 0x1bea6(%rip)     # 0x24b84
je 0x8cf2
movq %r14, %rdi
callq 0x822c
movl $0x1, 0x1be8e(%rip)     # 0x24b80
xorl %eax, %eax
leaq 0x1be71(%rip), %rcx     # 0x24b6c
movl %eax, (%rcx)
leaq 0x1be6c(%rip), %rcx     # 0x24b70
movl %eax, (%rcx)
jmp 0x8887
cmpl $0x0, 0x2367a(%rip)     # 0x2c38c
jle 0x8d2e
leaq 0xcdd2(%rip), %rdi      # 0x15aed
leaq 0xc58c(%rip), %rsi      # 0x152ae
movl $0x4c6, %edx            # imm = 0x4C6
xorl %eax, %eax
callq 0xc960
cmpl $0x0, 0x23657(%rip)     # 0x2c38c
jle 0x8d58
movq 0x23632(%rip), %rcx     # 0x2c370
leaq 0xcdf1(%rip), %rdi      # 0x15b36
leaq 0xc562(%rip), %rsi      # 0x152ae
movl $0x4c7, %edx            # imm = 0x4C7
xorl %eax, %eax
callq 0xc960
movq 0x23611(%rip), %rdi     # 0x2c370
callq 0x866a
movq 0x23605(%rip), %rdi     # 0x2c370
movl %r12d, %esi
callq 0xce4f
cmpl $0x0, 0x23606(%rip)     # 0x2c380
je 0x8dbc
cmpq $0x0, 0x235ec(%rip)     # 0x2c370
je 0x8dbc
cmpl $0x0, 0x235ff(%rip)     # 0x2c38c
jle 0x8da9
leaq 0xcdf8(%rip), %rdi      # 0x15b8e
leaq 0xc511(%rip), %rsi      # 0x152ae
movl $0x4ce, %edx            # imm = 0x4CE
xorl %eax, %eax
callq 0xc960
movq 0x25df8(%rip), %rsi     # 0x2eba8
movq 0x235b9(%rip), %rdi     # 0x2c370
callq 0x2160
cmpl $0x0, 0x235c9(%rip)     # 0x2c38c
jle 0x8de6
movq 0x235a4(%rip), %rcx     # 0x2c370
leaq 0xcdee(%rip), %rdi      # 0x15bc1
leaq 0xc4d4(%rip), %rsi      # 0x152ae
movl $0x4d1, %edx            # imm = 0x4D1
xorl %eax, %eax
callq 0xc960
movb 0xb(%rsp), %r13b
testb $0x1, %r13b
je 0x8e1d
movb $0x1, %bl
cmpl $0x0, 0x235aa(%rip)     # 0x2c3a4
jle 0x8eec
movq 0x23569(%rip), %rdi     # 0x2c370
callq 0x80f1
xorl %ebp, %ebp
testl %eax, %eax
je 0x8ef0
xorl %ebx, %ebx
jmp 0x8f18
cmpl $0x0, 0x23568(%rip)     # 0x2c38c
jle 0x8e40
leaq 0xcde6(%rip), %rdi      # 0x15c13
leaq 0xc47a(%rip), %rsi      # 0x152ae
movl $0x4f1, %edx            # imm = 0x4F1
xorl %eax, %eax
callq 0xc960
cmpl $0x0, 0x23545(%rip)     # 0x2c38c
jle 0x8e73
movl 0x23531(%rip), %ecx     # 0x2c380
movq 0x2351a(%rip), %r9      # 0x2c370
leaq 0xce09(%rip), %rdi      # 0x15c66
leaq 0xc44a(%rip), %rsi      # 0x152ae
movl $0x4f4, %edx            # imm = 0x4F4
movl %r12d, %r8d
xorl %eax, %eax
callq 0xc960
cmpl $0x0, 0x23506(%rip)     # 0x2c380
movb $0x1, %bl
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
je 0x8f18
cmpq $0x0, 0x234e1(%rip)     # 0x2c370
movl 0xc(%rsp), %ecx
je 0x8f1c
cmpl $0x0, 0x234ec(%rip)     # 0x2c38c
jle 0x8ebc
leaq 0xcce5(%rip), %rdi      # 0x15b8e
leaq 0xc3fe(%rip), %rsi      # 0x152ae
movl $0x4f8, %edx            # imm = 0x4F8
xorl %eax, %eax
callq 0xc960
movq 0x234ad(%rip), %rdi     # 0x2c370
callq 0x866a
movq 0x234a1(%rip), %rdi     # 0x2c370
movl %r12d, %esi
callq 0xce4f
movq 0x25cca(%rip), %rsi     # 0x2eba8
movq 0x2348b(%rip), %rdi     # 0x2c370
callq 0x2160
jmp 0x8f18
xorl %ebp, %ebp
jmp 0x8f18
cmpl $0x0, 0x23495(%rip)     # 0x2c38c
jle 0x8f13
leaq 0xcdb0(%rip), %rdi      # 0x15cb0
leaq 0xc3a7(%rip), %rsi      # 0x152ae
movl $0x507, %edx            # imm = 0x507
xorl %eax, %eax
callq 0xc960
callq 0xb033
movl 0xc(%rsp), %ecx
cmpl $0x0, 0x23481(%rip)     # 0x2c3a4
setg %al
andb %bl, %r13b
andb %al, %r13b
cmpb $0x1, %r13b
jne 0x8f40
incl %ecx
cmpl 0x2346e(%rip), %ecx     # 0x2c3a8
jl 0x8879
cmpl $0x0, 0x23445(%rip)     # 0x2c38c
jle 0x8fe0
leaq 0xcda0(%rip), %rdi      # 0x15cf4
leaq 0xc353(%rip), %rsi      # 0x152ae
movl $0x50e, %edx            # imm = 0x50E
xorl %eax, %eax
callq 0xc960
jmp 0x8fe0
leaq 0xc930(%rip), %rdi      # 0x158a0
leaq 0xc337(%rip), %rsi      # 0x152ae
movl $0x48a, %edx            # imm = 0x48A
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc960
movq 0x233e4(%rip), %rdi     # 0x2c370
testq %rdi, %rdi
je 0x8f96
callq 0x2030
movq $0x0, 0x233cf(%rip) # 0x2c370
jmp 0x8fdb
leaq 0xc816(%rip), %rdi      # 0x157c0
leaq 0xc2fd(%rip), %rsi      # 0x152ae
movl $0x470, %edx            # imm = 0x470
movl %ebx, %ecx
xorl %eax, %eax
callq 0xc960
movq 0x233b2(%rip), %rdi     # 0x2c378
testq %rdi, %rdi
je 0x8fd0
callq 0x2030
movq $0x0, 0x2339d(%rip) # 0x2c378
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x2818, %rsp           # imm = 0x2818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq