// File: /workspace/github_c_makefile_star2_O2/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, %r13
movq %rdi, 0x8(%rsp)
cmpl $0x0, 0x22eb5(%rip)     # 0x2b38c
jle 0x850c
movq %r13, %rdi
callq 0x766c
movq %rax, %rbx
movq %r13, %rdi
callq 0x766c
leaq 0xc209(%rip), %rdi      # 0x146fc
leaq 0xbde4(%rip), %rsi      # 0x142de
movl $0x449, %edx            # imm = 0x449
movq %rbx, %rcx
movq %rax, %r8
xorl %eax, %eax
callq 0xc2a1
xorl %eax, %eax
movq $0x0, 0x10(%rsp)
xorl %ebp, %ebp
movq %r13, 0x18(%rsp)
incl %eax
movl %eax, 0x4(%rsp)
xorps %xmm0, %xmm0
movups %xmm0, 0x22e42(%rip)    # 0x2b370
leaq 0x20(%rsp), %r15
movq %r15, %rdi
movl $0x27f6, %esi           # imm = 0x27F6
movq %r13, %rdx
callq 0x76f2
movq %rax, %r12
testq %rax, %rax
je 0x89db
movq %r15, %rdi
callq 0x2110
movq %rax, %rbx
movq %r15, %rdi
leaq 0xbd03(%rip), %rsi      # 0x14267
callq 0x23d0
testq %rax, %rax
je 0x857b
movq 0x8(%rsp), %rax
incl 0x18d3c(%rax)
jmp 0x85b7
movq %r15, %rdi
leaq 0xc1b3(%rip), %rsi      # 0x14738
callq 0x23d0
testq %rax, %rax
je 0x859c
movq 0x8(%rsp), %rax
incl 0x18d40(%rax)
jmp 0x85b7
movq %r15, %rdi
pushq $0xa
popq %rsi
callq 0x2120
testq %rax, %rax
je 0x85b7
movq 0x8(%rsp), %rax
incl 0x18d44(%rax)
cmpl $0x0, 0x22dce(%rip)     # 0x2b38c
jle 0x8609
movq 0x8(%rsp), %rax
movl 0x18d3c(%rax), %ecx
movl 0x18d40(%rax), %r8d
movl 0x18d44(%rax), %r9d
movl 0x2054(%r13), %r10d
leaq 0xc154(%rip), %rdi      # 0x1473b
leaq 0xbcf0(%rip), %rsi      # 0x142de
movl $0x45e, %edx            # imm = 0x45E
xorl %eax, %eax
pushq %r15
pushq 0x22d73(%rip)           # 0x2b370
pushq %r10
pushq %rbx
callq 0xc2a1
addq $0x20, %rsp
cmpl $0x0, 0x255a8(%rip)     # 0x2dbb8
setg %al
movq 0x25596(%rip), %rsi     # 0x2dbb0
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8659
cmpl $0x0, 0x22d5e(%rip)     # 0x2b38c
jle 0x8651
leaq 0xc159(%rip), %rdi      # 0x14790
leaq 0xbca0(%rip), %rsi      # 0x142de
movl $0x464, %edx            # imm = 0x464
xorl %eax, %eax
callq 0xc2a1
movq 0x2555f(%rip), %rsi     # 0x2dbb0
movq %r15, %rdi
callq 0x2160
movq %rbx, %r14
shlq $0x20, %r14
cmpl $0x0, 0x22d1d(%rip)     # 0x2b384
jle 0x8766
cmpl $0x0, 0x22d18(%rip)     # 0x2b38c
jle 0x8694
movq %r15, %rdi
callq 0x2110
leaq 0xc13d(%rip), %rdi      # 0x147c2
movq %rax, %rsi
movl %ebx, %edx
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
movq 0x22cdd(%rip), %rdi     # 0x2b378
movq 0x10(%rsp), %rax
leal (%rax,%rbx), %r15d
incl %r15d
movslq %r15d, %rsi
callq 0x2320
testq %rax, %rax
je 0x8c64
cmpq $0x0, 0x22cb8(%rip)     # 0x2b378
movq %rax, 0x22cb1(%rip)     # 0x2b378
je 0x8724
movq 0x10(%rsp), %rdx
movslq %edx, %rcx
addl %ebx, %edx
movq %rdx, 0x10(%rsp)
leaq (%rax,%rcx), %rdi
decq %rdi
movabsq $0x100000000, %rax      # imm = 0x100000000
leaq (%r14,%rax), %rdx
sarq $0x20, %rdx
leaq 0x20(%rsp), %rsi
callq 0xba3e
cmpl $0x0, 0x22c8a(%rip)     # 0x2b38c
jle 0x8789
movq 0x22c69(%rip), %rcx     # 0x2b378
leaq 0xc159(%rip), %rdi      # 0x1486f
leaq 0xbbc1(%rip), %rsi      # 0x142de
movl $0x480, %edx            # imm = 0x480
jmp 0x875f
leal 0x1(%rbx), %ecx
movq %rcx, 0x10(%rsp)
movslq %ecx, %rdx
movq %rax, %rdi
leaq 0x20(%rsp), %rsi
callq 0xba3e
cmpl $0x0, 0x22c49(%rip)     # 0x2b38c
jle 0x8789
movq 0x22c2c(%rip), %rcx     # 0x2b378
leaq 0xc0f7(%rip), %rdi      # 0x1484a
leaq 0xbb84(%rip), %rsi      # 0x142de
movl $0x47b, %edx            # imm = 0x47B
xorl %eax, %eax
callq 0xc2a1
cmpl $0x0, 0x22c1f(%rip)     # 0x2b38c
jle 0x8789
leaq 0xc124(%rip), %rdi      # 0x1489a
leaq 0xbb61(%rip), %rsi      # 0x142de
movl $0x486, %edx            # imm = 0x486
xorl %eax, %eax
callq 0xc2a1
movq 0x22be0(%rip), %rdi     # 0x2b370
leal (%rbx,%rbp), %r15d
incl %r15d
movslq %r15d, %rsi
callq 0x2320
testq %rax, %rax
je 0x8c31
movq %rax, %r13
movq 0x22bbe(%rip), %rcx     # 0x2b370
movl 0x22bd4(%rip), %eax     # 0x2b38c
testq %rcx, %rcx
leaq 0x20(%rsp), %r15
je 0x885b
testl %eax, %eax
jle 0x87f1
subq $0x8, %rsp
leaq 0xc1d6(%rip), %rdi      # 0x149ab
leaq 0xbb02(%rip), %rsi      # 0x142de
movl $0x49a, %edx            # imm = 0x49A
movq %r13, %r8
movq %r15, %r9
xorl %eax, %eax
pushq %rbx
callq 0xc2a1
popq %rcx
popq %rdx
movslq %ebx, %r14
movq %r13, 0x22b75(%rip)     # 0x2b370
testq %r14, %r14
jle 0x88af
movzbl 0x20(%rsp), %eax
cmpl $0x20, %eax
je 0x8817
cmpl $0x9, %eax
jne 0x88af
movslq %ebp, %rbp
cmpl $0x0, 0x22b6b(%rip)     # 0x2b38c
jle 0x897c
leaq -0x1(,%rbp), %r8
addq %r13, %r8
leaq 0xc20a(%rip), %rdi      # 0x14a43
leaq 0xba9e(%rip), %rsi      # 0x142de
movl $0x4b1, %edx            # imm = 0x4B1
movq %r13, %rcx
xorl %eax, %eax
callq 0xc2a1
movq 0x22b1a(%rip), %rax     # 0x2b370
jmp 0x897f
testl %eax, %eax
jle 0x8882
leaq 0xc0bb(%rip), %rdi      # 0x14921
leaq 0xba71(%rip), %rsi      # 0x142de
movl $0x492, %edx            # imm = 0x492
movq %r13, %rcx
movq %r15, %r8
movl %ebx, %r9d
xorl %eax, %eax
callq 0xc2a1
movq %r13, 0x22ae7(%rip)     # 0x2b370
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r14
sarq $0x20, %r14
movq %r13, %rdi
movq %r15, %rsi
movq %r14, %rdx
callq 0xba3e
movq 0x18(%rsp), %r13
jmp 0x8921
movq %r13, %rax
cmpl $0x0, 0x22ad3(%rip)     # 0x2b38c
movslq %ebp, %r15
movq 0x18(%rsp), %r13
jle 0x88f7
addq %r15, %rax
leaq 0xc1fd(%rip), %rdi      # 0x14aca
leaq 0xba0a(%rip), %rsi      # 0x142de
movl $0x4bd, %edx            # imm = 0x4BD
leaq 0x20(%rsp), %rbp
movq %rbp, %rcx
movq %rax, %r8
movl %ebx, %r9d
xorl %eax, %eax
callq 0xc2a1
movq 0x22a7b(%rip), %rax     # 0x2b370
jmp 0x88fc
leaq 0x20(%rsp), %rbp
addq %r15, %rax
movq %rax, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x2260
addl %ebx, %r15d
movq 0x22a59(%rip), %rax     # 0x2b370
movslq %r15d, %rcx
movb $0x0, (%rax,%rcx)
movl %r15d, %ebx
cmpl $0x0, 0x2054(%r13)
jne 0x8aab
leaq 0x1b236(%rip), %rax     # 0x23b6c
cmpl $0x0, (%rax)
movl %ebx, %ebp
leaq 0x20(%rsp), %r15
je 0x8533
cmpl $0x0, 0x1b237(%rip)     # 0x23b84
je 0x8961
movq %r13, %rdi
callq 0x7f01
movl $0x1, 0x1b21f(%rip)     # 0x23b80
leaq 0x1b204(%rip), %rax     # 0x23b6c
andl $0x0, (%rax)
leaq 0x1b1fe(%rip), %rax     # 0x23b70
andl $0x0, (%rax)
movl %ebx, %ebp
jmp 0x8533
movq %r13, %rax
decq %r13
movq %r13, %r15
addq %rbp, %r15
cmpq %rax, %r15
jb 0x88b2
movzbl (%r15), %r8d
cmpl $0xd, %r8d
je 0x89a5
cmpl $0xa, %r8d
jne 0x88b2
cmpl $0x0, 0x229e0(%rip)     # 0x2b38c
jle 0x89d2
leaq 0xc0d4(%rip), %rdi      # 0x14a89
leaq 0xb922(%rip), %rsi      # 0x142de
movl $0x4b4, %edx            # imm = 0x4B4
movq %r15, %rcx
xorl %eax, %eax
callq 0xc2a1
movq 0x2299e(%rip), %rax     # 0x2b370
movb $0x0, (%r15)
decq %rbp
jmp 0x8982
cmpl $0x0, 0x229aa(%rip)     # 0x2b38c
jle 0x8a31
leaq 0xc258(%rip), %rdi      # 0x14c43
leaq 0xb8ec(%rip), %rsi      # 0x142de
movl $0x4f1, %edx            # imm = 0x4F1
xorl %eax, %eax
callq 0xc2a1
cmpl $0x0, 0x22987(%rip)     # 0x2b38c
jle 0x8a31
movl 0x22973(%rip), %ecx     # 0x2b380
movq 0x2295c(%rip), %r9      # 0x2b370
leaq 0xc27b(%rip), %rdi      # 0x14c96
leaq 0xb8bc(%rip), %rsi      # 0x142de
movl $0x4f4, %edx            # imm = 0x4F4
movl %ebp, %r8d
xorl %eax, %eax
callq 0xc2a1
cmpl $0x0, 0x22948(%rip)     # 0x2b380
setne %al
movq 0x2292e(%rip), %rdi     # 0x2b370
testq %rdi, %rdi
setne %cl
andb %al, %cl
movb $0x1, %r15b
cmpb $0x1, %cl
jne 0x8aa2
cmpl $0x0, 0x22933(%rip)     # 0x2b38c
jle 0x8a7c
leaq 0xc15c(%rip), %rdi      # 0x14bbe
leaq 0xb875(%rip), %rsi      # 0x142de
movl $0x4f8, %edx            # imm = 0x4F8
xorl %eax, %eax
callq 0xc2a1
movq 0x228f4(%rip), %rdi     # 0x2b370
callq 0x8337
movq 0x228e8(%rip), %rdi     # 0x2b370
movl %ebp, %esi
callq 0xc705
movq 0x25112(%rip), %rsi     # 0x2dba8
movq 0x228d3(%rip), %rdi     # 0x2b370
callq 0x2160
pushq $-0x1
popq %r14
jmp 0x8be5
cmpl $0x0, 0x228da(%rip)     # 0x2b38c
jle 0x8af8
leaq 0xc062(%rip), %rdi      # 0x14b1d
leaq 0xb81c(%rip), %rsi      # 0x142de
movl $0x4c6, %edx            # imm = 0x4C6
xorl %eax, %eax
callq 0xc2a1
cmpl $0x0, 0x228b7(%rip)     # 0x2b38c
jle 0x8af8
movq 0x22892(%rip), %rcx     # 0x2b370
leaq 0xc081(%rip), %rdi      # 0x14b66
leaq 0xb7f2(%rip), %rsi      # 0x142de
movl $0x4c7, %edx            # imm = 0x4C7
xorl %eax, %eax
callq 0xc2a1
movq 0x22871(%rip), %rdi     # 0x2b370
callq 0x8337
movq 0x22865(%rip), %rdi     # 0x2b370
movl %ebx, %esi
callq 0xc705
cmpl $0x0, 0x22867(%rip)     # 0x2b380
setne %al
movq 0x2284d(%rip), %rdi     # 0x2b370
testq %rdi, %rdi
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x8b66
cmpl $0x0, 0x22855(%rip)     # 0x2b38c
jle 0x8b5a
leaq 0xc07e(%rip), %rdi      # 0x14bbe
leaq 0xb797(%rip), %rsi      # 0x142de
movl $0x4ce, %edx            # imm = 0x4CE
xorl %eax, %eax
callq 0xc2a1
movq 0x22816(%rip), %rdi     # 0x2b370
movq 0x25047(%rip), %rsi     # 0x2dba8
callq 0x2160
cmpl $0x0, 0x2281f(%rip)     # 0x2b38c
jle 0x8b90
movq 0x227fa(%rip), %rcx     # 0x2b370
leaq 0xc074(%rip), %rdi      # 0x14bf1
leaq 0xb75a(%rip), %rsi      # 0x142de
movl $0x4d1, %edx            # imm = 0x4D1
xorl %eax, %eax
callq 0xc2a1
movb $0x1, %r15b
cmpl $0x0, 0x2280a(%rip)     # 0x2b3a4
jle 0x8bb6
movq 0x227cd(%rip), %rdi     # 0x2b370
callq 0x7dc6
xorl %r14d, %r14d
testl %eax, %eax
je 0x8bbb
movl %ebx, %ebp
xorl %r15d, %r15d
jmp 0x8be5
xorl %r14d, %r14d
jmp 0x8be3
cmpl $0x0, 0x227ca(%rip)     # 0x2b38c
jle 0x8bde
leaq 0xc115(%rip), %rdi      # 0x14ce0
leaq 0xb70c(%rip), %rsi      # 0x142de
movl $0x507, %edx            # imm = 0x507
xorl %eax, %eax
callq 0xc2a1
callq 0xabc3
movl %ebx, %ebp
movl 0x4(%rsp), %eax
testq %r12, %r12
je 0x8c08
testb %r15b, %r15b
je 0x8c08
cmpl $0x0, 0x227aa(%rip)     # 0x2b3a4
jle 0x8c08
cmpl 0x227a6(%rip), %eax     # 0x2b3a8
jl 0x851e
cmpl $0x0, 0x2277d(%rip)     # 0x2b38c
jle 0x8c99
leaq 0xc108(%rip), %rdi      # 0x14d24
leaq 0xb6bb(%rip), %rsi      # 0x142de
movl $0x50e, %edx            # imm = 0x50E
xorl %eax, %eax
callq 0xc2a1
jmp 0x8c99
leaq 0xbc98(%rip), %rdi      # 0x148d0
leaq 0xb69f(%rip), %rsi      # 0x142de
movl $0x48a, %edx            # imm = 0x48A
movl %r15d, %ecx
xorl %eax, %eax
callq 0xc2a1
movq 0x2271b(%rip), %rdi     # 0x2b370
callq 0x2030
andq $0x0, 0x2270e(%rip)     # 0x2b370
jmp 0x8c95
leaq 0xbb85(%rip), %rdi      # 0x147f0
leaq 0xb66c(%rip), %rsi      # 0x142de
movl $0x470, %edx            # imm = 0x470
movl %r15d, %ecx
xorl %eax, %eax
callq 0xc2a1
movq 0x226f0(%rip), %rdi     # 0x2b378
callq 0x2030
andq $0x0, 0x226e3(%rip)     # 0x2b378
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x2818, %rsp           # imm = 0x2818
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq