// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
pushq %rbx
subq $0x28a8, %rsp           # imm = 0x28A8
movq %rdi, -0x18(%rbp)
movq %rsi, -0x20(%rbp)
movl $0x0, -0x2824(%rbp)
movl $0x0, -0x2828(%rbp)
movl $0x0, -0x282c(%rbp)
movl $0x0, -0x2830(%rbp)
movl $0x1, -0x2834(%rbp)
movl $0x0, -0x2838(%rbp)
movq $0x0, -0x2850(%rbp)
movl $0x0, -0x2874(%rbp)
cmpl $0x1, 0x274c0(%rip)     # 0x3277c
jl 0xb2fb
movq -0x20(%rbp), %rdi
callq 0x9980
movq %rax, -0x2880(%rbp)
movq -0x20(%rbp), %rdi
callq 0x9980
movq -0x2880(%rbp), %rcx
movq %rax, %r8
leaq 0x115a4(%rip), %rdi     # 0x1c88c
leaq 0x1117f(%rip), %rsi     # 0x1c46e
movl $0x449, %edx            # imm = 0x449
movb $0x0, %al
callq 0x117c0
jmp 0xb2fd
movl -0x2838(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2838(%rbp)
movq $0x0, 0x27449(%rip) # 0x32760
movq $0x0, 0x27446(%rip) # 0x32768
movq $0x0, -0x2848(%rbp)
leaq -0x2820(%rbp), %rdi
movq -0x20(%rbp), %rdx
movl $0x27f6, %esi           # imm = 0x27F6
callq 0x9ab0
movq %rax, -0x2850(%rbp)
cmpq $0x0, %rax
je 0xbb58
leaq -0x2820(%rbp), %rax
movq %rax, -0x2868(%rbp)
movq -0x2868(%rbp), %rdi
callq 0x2100
movl %eax, -0x2828(%rbp)
movq -0x2868(%rbp), %rax
movslq -0x2828(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2870(%rbp)
movq -0x2868(%rbp), %rdi
leaq 0x10e9b(%rip), %rsi     # 0x1c234
callq 0x23b0
cmpq $0x0, %rax
je 0xb3b9
movq -0x18(%rbp), %rax
movl 0x18d3c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18d3c(%rax)
jmp 0xb415
movq -0x2868(%rbp), %rdi
leaq 0x11501(%rip), %rsi     # 0x1c8c8
callq 0x23b0
cmpq $0x0, %rax
je 0xb3e7
movq -0x18(%rbp), %rax
movl 0x18d40(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18d40(%rax)
jmp 0xb413
movq -0x2868(%rbp), %rdi
movl $0xa, %esi
callq 0x2110
cmpq $0x0, %rax
je 0xb411
movq -0x18(%rbp), %rax
movl 0x18d44(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x18d44(%rax)
jmp 0xb413
jmp 0xb415
cmpl $0x1, 0x27360(%rip)     # 0x3277c
jl 0xb489
movq -0x18(%rbp), %rax
movl 0x18d3c(%rax), %ecx
movq -0x18(%rbp), %rax
movl 0x18d40(%rax), %r8d
movq -0x18(%rbp), %rax
movl 0x18d44(%rax), %r9d
movl -0x2828(%rbp), %ebx
movq -0x20(%rbp), %rax
movl 0x2054(%rax), %r11d
movq 0x2730a(%rip), %r10     # 0x32760
leaq -0x2820(%rbp), %rax
leaq 0x11467(%rip), %rdi     # 0x1c8cb
leaq 0x11003(%rip), %rsi     # 0x1c46e
movl $0x45e, %edx            # imm = 0x45E
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movq %r10, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movb $0x0, %al
callq 0x117c0
cmpl $0x0, 0x29b18(%rip)     # 0x34fa8
jle 0xb4db
cmpq $0x0, 0x29b06(%rip)     # 0x34fa0
je 0xb4db
cmpl $0x1, 0x272d9(%rip)     # 0x3277c
jl 0xb4bf
leaq 0x11474(%rip), %rdi     # 0x1c920
leaq 0x10fbb(%rip), %rsi     # 0x1c46e
movl $0x464, %edx            # imm = 0x464
movb $0x0, %al
callq 0x117c0
movq 0x29ada(%rip), %rdi     # 0x34fa0
movq -0x2868(%rbp), %rdx
leaq 0x13ad6(%rip), %rsi     # 0x1efaa
movb $0x0, %al
callq 0x2200
cmpl $0x0, 0x27292(%rip)     # 0x32774
jle 0xb68d
cmpl $0x1, 0x2728d(%rip)     # 0x3277c
jl 0xb51b
movq -0x2868(%rbp), %rdi
callq 0x2100
movq %rax, %rsi
movl -0x2828(%rbp), %edx
movq -0x2868(%rbp), %rcx
leaq 0x1143e(%rip), %rdi     # 0x1c952
movb $0x0, %al
callq 0x117c0
movq 0x27246(%rip), %rdi     # 0x32768
movl -0x282c(%rbp), %eax
addl -0x2828(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x2300
movq %rax, -0x2848(%rbp)
cmpq $0x0, -0x2848(%rbp)
jne 0xb5a0
movl -0x282c(%rbp), %ecx
addl -0x2828(%rbp), %ecx
addl $0x1, %ecx
leaq 0x11420(%rip), %rdi     # 0x1c980
leaq 0x10f07(%rip), %rsi     # 0x1c46e
movl $0x470, %edx            # imm = 0x470
movb $0x0, %al
callq 0x117c0
cmpq $0x0, 0x271ed(%rip)     # 0x32768
je 0xb589
movq 0x271e4(%rip), %rdi     # 0x32768
callq 0x2030
movq $0x0, 0x271d4(%rip) # 0x32768
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
jmp 0xbd10
cmpq $0x0, 0x271c0(%rip)     # 0x32768
jne 0xb612
movq -0x2848(%rbp), %rax
movq %rax, 0x271b0(%rip)     # 0x32768
movl -0x2828(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x282c(%rbp)
movq 0x2719a(%rip), %rdi     # 0x32768
movq -0x2868(%rbp), %rsi
movl -0x2828(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x10640
cmpl $0x1, 0x2718f(%rip)     # 0x3277c
jl 0xb610
movq 0x27172(%rip), %rcx     # 0x32768
leaq 0x113dd(%rip), %rdi     # 0x1c9da
leaq 0x10e6a(%rip), %rsi     # 0x1c46e
movl $0x47b, %edx            # imm = 0x47B
movb $0x0, %al
callq 0x117c0
jmp 0xb68b
movq -0x2848(%rbp), %rax
movq %rax, 0x27148(%rip)     # 0x32768
movq 0x27141(%rip), %rdi     # 0x32768
movslq -0x282c(%rbp), %rax
addq %rax, %rdi
addq $-0x1, %rdi
movq -0x2868(%rbp), %rsi
movl -0x2828(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x10640
movl -0x2828(%rbp), %eax
addl -0x282c(%rbp), %eax
movl %eax, -0x282c(%rbp)
cmpl $0x1, 0x27116(%rip)     # 0x3277c
jl 0xb689
movq 0x270f9(%rip), %rcx     # 0x32768
leaq 0x11389(%rip), %rdi     # 0x1c9ff
leaq 0x10df1(%rip), %rsi     # 0x1c46e
movl $0x480, %edx            # imm = 0x480
movb $0x0, %al
callq 0x117c0
jmp 0xb68b
jmp 0xb68d
cmpl $0x1, 0x270e8(%rip)     # 0x3277c
jl 0xb6b0
leaq 0x1138d(%rip), %rdi     # 0x1ca2a
leaq 0x10dca(%rip), %rsi     # 0x1c46e
movl $0x486, %edx            # imm = 0x486
movb $0x0, %al
callq 0x117c0
movq 0x270a9(%rip), %rdi     # 0x32760
movl -0x2824(%rbp), %eax
addl -0x2828(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rsi
callq 0x2300
movq %rax, -0x2840(%rbp)
cmpq $0x0, -0x2840(%rbp)
jne 0xb735
movl -0x2824(%rbp), %ecx
addl -0x2828(%rbp), %ecx
addl $0x1, %ecx
leaq 0x1136b(%rip), %rdi     # 0x1ca60
leaq 0x10d72(%rip), %rsi     # 0x1c46e
movl $0x48a, %edx            # imm = 0x48A
movb $0x0, %al
callq 0x117c0
cmpq $0x0, 0x27050(%rip)     # 0x32760
je 0xb71e
movq 0x27047(%rip), %rdi     # 0x32760
callq 0x2030
movq $0x0, 0x27037(%rip) # 0x32760
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
jmp 0xbd10
cmpq $0x0, 0x27023(%rip)     # 0x32760
jne 0xb7d1
cmpl $0x1, 0x27032(%rip)     # 0x3277c
jl 0xb77b
movq -0x2840(%rbp), %rcx
movq -0x2868(%rbp), %r8
movl -0x2828(%rbp), %r9d
leaq 0x11349(%rip), %rdi     # 0x1cab1
leaq 0x10cff(%rip), %rsi     # 0x1c46e
movl $0x492, %edx            # imm = 0x492
movb $0x0, %al
callq 0x117c0
movq -0x2840(%rbp), %rax
movq %rax, 0x26fd7(%rip)     # 0x32760
movl -0x2828(%rbp), %eax
movl %eax, -0x2824(%rbp)
movq 0x26fc4(%rip), %rdi     # 0x32760
movq -0x2868(%rbp), %rsi
movl -0x2828(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
callq 0x10640
movq 0x26fa5(%rip), %rax     # 0x32760
movslq -0x2824(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x2858(%rbp)
jmp 0xba0d
cmpl $0x1, 0x26fa4(%rip)     # 0x3277c
jl 0xb812
movq 0x26f7f(%rip), %rcx     # 0x32760
movq -0x2840(%rbp), %r8
movq -0x2868(%rbp), %r9
movl -0x2828(%rbp), %eax
leaq 0x1133f(%rip), %rdi     # 0x1cb3b
leaq 0x10c6b(%rip), %rsi     # 0x1c46e
movl $0x49a, %edx            # imm = 0x49A
movl %eax, (%rsp)
movb $0x0, %al
callq 0x117c0
movq -0x2840(%rbp), %rax
movq %rax, 0x26f40(%rip)     # 0x32760
movq -0x2868(%rbp), %rax
cmpq -0x2870(%rbp), %rax
jae 0xb983
movq -0x2868(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
je 0xb856
movq -0x2868(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0xb983
movq 0x26f03(%rip), %rax     # 0x32760
movslq -0x2824(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x2860(%rbp)
cmpl $0x1, 0x26f03(%rip)     # 0x3277c
jl 0xb8a3
movq 0x26ede(%rip), %rcx     # 0x32760
movq -0x2860(%rbp), %r8
leaq 0x11343(%rip), %rdi     # 0x1cbd3
leaq 0x10bd7(%rip), %rsi     # 0x1c46e
movl $0x4b1, %edx            # imm = 0x4B1
movb $0x0, %al
callq 0x117c0
jmp 0xb8a5
movq -0x2860(%rbp), %rcx
xorl %eax, %eax
cmpq 0x26eab(%rip), %rcx     # 0x32760
movb %al, -0x2881(%rbp)
jb 0xb8f6
movq -0x2860(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0xa, %ecx
movb %al, -0x2882(%rbp)
je 0xb8ea
movq -0x2860(%rbp), %rax
movsbl (%rax), %eax
cmpl $0xd, %eax
sete %al
movb %al, -0x2882(%rbp)
movb -0x2882(%rbp), %al
movb %al, -0x2881(%rbp)
movb -0x2881(%rbp), %al
testb $0x1, %al
jne 0xb902
jmp 0xb967
cmpl $0x1, 0x26e73(%rip)     # 0x3277c
jl 0xb937
movq -0x2860(%rbp), %rcx
movq -0x2860(%rbp), %rax
movsbl (%rax), %r8d
leaq 0x112f5(%rip), %rdi     # 0x1cc19
leaq 0x10b43(%rip), %rsi     # 0x1c46e
movl $0x4b4, %edx            # imm = 0x4B4
movb $0x0, %al
callq 0x117c0
movq -0x2860(%rbp), %rax
movb $0x0, (%rax)
movq -0x2860(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x2860(%rbp)
movl -0x2824(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x2824(%rbp)
jmp 0xb8a5
movq 0x26df2(%rip), %rax     # 0x32760
movslq -0x2824(%rbp), %rcx
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x2860(%rbp)
cmpl $0x1, 0x26df2(%rip)     # 0x3277c
jl 0xb9c5
movq -0x2868(%rbp), %rcx
movq 0x26dc6(%rip), %r8      # 0x32760
movslq -0x2824(%rbp), %rax
addq %rax, %r8
movl -0x2828(%rbp), %r9d
leaq 0x112a8(%rip), %rdi     # 0x1cc5a
leaq 0x10ab5(%rip), %rsi     # 0x1c46e
movl $0x4bd, %edx            # imm = 0x4BD
movb $0x0, %al
callq 0x117c0
movq 0x26d94(%rip), %rdi     # 0x32760
movslq -0x2824(%rbp), %rax
addq %rax, %rdi
movq -0x2868(%rbp), %rsi
movslq -0x2828(%rbp), %rdx
callq 0x2250
movl -0x2828(%rbp), %eax
addl -0x2824(%rbp), %eax
movl %eax, -0x2824(%rbp)
movq 0x26d5e(%rip), %rax     # 0x32760
movslq -0x2824(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq -0x20(%rbp), %rax
cmpl $0x0, 0x2054(%rax)
je 0xbb07
cmpl $0x1, 0x26d57(%rip)     # 0x3277c
jl 0xba41
leaq 0x1127f(%rip), %rdi     # 0x1ccad
leaq 0x10a39(%rip), %rsi     # 0x1c46e
movl $0x4c6, %edx            # imm = 0x4C6
movb $0x0, %al
callq 0x117c0
cmpl $0x1, 0x26d34(%rip)     # 0x3277c
jl 0xba6b
movq 0x26d0f(%rip), %rcx     # 0x32760
leaq 0x1129e(%rip), %rdi     # 0x1ccf6
leaq 0x10a0f(%rip), %rsi     # 0x1c46e
movl $0x4c7, %edx            # imm = 0x4C7
movb $0x0, %al
callq 0x117c0
movq 0x26cee(%rip), %rdi     # 0x32760
callq 0xafb0
movq 0x26ce2(%rip), %rdi     # 0x32760
movl -0x2824(%rbp), %esi
callq 0x12010
cmpl $0x0, 0x26ce0(%rip)     # 0x32770
je 0xbadb
cmpq $0x0, 0x26cc6(%rip)     # 0x32760
je 0xbadb
cmpl $0x1, 0x26cd9(%rip)     # 0x3277c
jl 0xbabf
leaq 0x112a2(%rip), %rdi     # 0x1cd4e
leaq 0x109bb(%rip), %rsi     # 0x1c46e
movl $0x4ce, %edx            # imm = 0x4CE
movb $0x0, %al
callq 0x117c0
movq 0x294d2(%rip), %rdi     # 0x34f98
movq 0x26c93(%rip), %rdx     # 0x32760
leaq 0x134d6(%rip), %rsi     # 0x1efaa
movb $0x0, %al
callq 0x2200
cmpl $0x1, 0x26c9a(%rip)     # 0x3277c
jl 0xbb05
movq 0x26c75(%rip), %rcx     # 0x32760
leaq 0x1128f(%rip), %rdi     # 0x1cd81
leaq 0x10975(%rip), %rsi     # 0x1c46e
movl $0x4d1, %edx            # imm = 0x4D1
movb $0x0, %al
callq 0x117c0
jmp 0xbb58
leaq 0x1f44e(%rip), %rax     # 0x2af5c
cmpl $0x0, (%rax)
je 0xbb49
cmpl $0x0, 0x1f45a(%rip)     # 0x2af74
je 0xbb2f
movq -0x20(%rbp), %rdi
callq 0xa9b0
movl $0x1, 0x1f441(%rip)     # 0x2af70
leaq 0x1f426(%rip), %rax     # 0x2af5c
movl $0x0, (%rax)
leaq 0x1f41d(%rip), %rax     # 0x2af60
movl $0x0, (%rax)
movl $0x0, -0x2834(%rbp)
jmp 0xb32d
cmpq $0x0, -0x2850(%rbp)
jne 0xbc3c
cmpl $0x1, 0x26c0f(%rip)     # 0x3277c
jl 0xbb89
leaq 0x1125d(%rip), %rdi     # 0x1cdd3
leaq 0x108f1(%rip), %rsi     # 0x1c46e
movl $0x4f1, %edx            # imm = 0x4F1
movb $0x0, %al
callq 0x117c0
cmpl $0x1, 0x26bec(%rip)     # 0x3277c
jl 0xbbc0
movl 0x26bd8(%rip), %ecx     # 0x32770
movl -0x2824(%rbp), %r8d
movq 0x26bba(%rip), %r9      # 0x32760
leaq 0x11279(%rip), %rdi     # 0x1ce26
leaq 0x108ba(%rip), %rsi     # 0x1c46e
movl $0x4f4, %edx            # imm = 0x4F4
movb $0x0, %al
callq 0x117c0
cmpl $0x0, 0x26ba9(%rip)     # 0x32770
je 0xbc30
cmpq $0x0, 0x26b8f(%rip)     # 0x32760
je 0xbc30
cmpl $0x1, 0x26ba2(%rip)     # 0x3277c
jl 0xbbf6
leaq 0x1116b(%rip), %rdi     # 0x1cd4e
leaq 0x10884(%rip), %rsi     # 0x1c46e
movl $0x4f8, %edx            # imm = 0x4F8
movb $0x0, %al
callq 0x117c0
movq 0x26b63(%rip), %rdi     # 0x32760
callq 0xafb0
movq 0x26b57(%rip), %rdi     # 0x32760
movl -0x2824(%rbp), %esi
callq 0x12010
movq 0x2937d(%rip), %rdi     # 0x34f98
movq 0x26b3e(%rip), %rdx     # 0x32760
leaq 0x13381(%rip), %rsi     # 0x1efaa
movb $0x0, %al
callq 0x2200
movl $0xffffffff, -0x2830(%rbp) # imm = 0xFFFFFFFF
jmp 0xbc8c
cmpl $0x0, 0x26b51(%rip)     # 0x32794
jle 0xbc8a
movq 0x26b14(%rip), %rdi     # 0x32760
callq 0xa7a0
movl %eax, -0x2874(%rbp)
cmpl $0x0, -0x2874(%rbp)
jne 0xbc88
cmpl $0x1, 0x26b15(%rip)     # 0x3277c
jl 0xbc83
leaq 0x11200(%rip), %rdi     # 0x1ce70
leaq 0x107f7(%rip), %rsi     # 0x1c46e
movl $0x507, %edx            # imm = 0x507
movb $0x0, %al
callq 0x117c0
callq 0xebc0
jmp 0xbc8a
jmp 0xbc8c
jmp 0xbc8e
xorl %eax, %eax
cmpl $0x0, -0x2874(%rbp)
movb %al, -0x2883(%rbp)
jne 0xbcd6
xorl %eax, %eax
cmpl $0x0, 0x26aec(%rip)     # 0x32794
movb %al, -0x2883(%rbp)
jle 0xbcd6
xorl %eax, %eax
cmpl $0x0, -0x2830(%rbp)
movb %al, -0x2883(%rbp)
jne 0xbcd6
movl -0x2838(%rbp), %eax
cmpl 0x26acb(%rip), %eax     # 0x32798
setl %al
movb %al, -0x2883(%rbp)
movb -0x2883(%rbp), %al
testb $0x1, %al
jne 0xb2fd
cmpl $0x1, 0x26a91(%rip)     # 0x3277c
jl 0xbd07
leaq 0x111c0(%rip), %rdi     # 0x1ceb4
leaq 0x10773(%rip), %rsi     # 0x1c46e
movl $0x50e, %edx            # imm = 0x50E
movb $0x0, %al
callq 0x117c0
movl -0x2830(%rbp), %eax
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %eax
addq $0x28a8, %rsp           # imm = 0x28A8
popq %rbx
popq %rbp
retq
nopl (%rax)