// File: /workspace/github_c_makefile_star2_O0/inflex[P]ripMIME/mime.c
// Function: MIME_unpack_stage2
int MIME_unpack_stage2( FFGET_FILE *f, char *unpackdir, struct MIMEH_header_info *hinfo, int current_recursion_level, struct SS_object *ss )
{
    int result = 0;
    struct MIMEH_header_info *h;
    char *p;

    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Start, recursion %d\n",FL, current_recursion_level);
    if (current_recursion_level > glb.max_recursion_level)
    {
        /** Test for recursion limits **/
        if (MIME_VERBOSE) LOGGER_log("%s:%d:MIME_unpack_stage2:WARNING: Current recursion level of %d is greater than permitted %d"\
                ,FL, current_recursion_level, glb.max_recursion_level);
        return MIME_ERROR_RECURSION_LIMIT_REACHED; // 20040306-1301:PLD
    }
    h = hinfo;
    // Get our headers and determin what we have...
    //
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Parsing headers (initial)\n",FL);
    // Parse the headers, extracting what information we need
    /** 20041216-1102:PLD: Keep attempting to read headers until we get a sane set **/
    do {
        /** Read next set of headers, repeat until a sane set of headers are found **/
        result = MIMEH_parse_headers(f,h);
        DMIME LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Parsing of headers done, sanity = %d, result = %d",FL,h->sanity, result);
    } while ((h->sanity == 0)&&(result != -1));

    DMIME LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Repeat loop of header-reading done, sanity = %d, result = %d",FL,h->sanity, result);
    glb.header_defect_count += MIMEH_get_defect_count(h);
    // Test the result output
    switch (result) {
        case -1:
            return MIME_ERROR_FFGET_EMPTY;
            break;
    }
    // Copy the subject over to our global structure if the subject is not already set.
    //      this will give us the 'main' subject of the entire email and prevent
    //      and subsequent subjects from clobbering it.
    //if (glb.subject[0] == '\0') snprintf(glb.subject, _MIME_STRLEN_MAX, "%s", h->subject );
    if ((strlen(glb.subject) < 1)&&(h->subject != NULL)&&(strlen(h->subject) > 0))
    {
        snprintf(glb.subject, sizeof(glb.subject), "%s", h->subject );
    }
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Headers parsed, Result = %d, Boundary located = %d\n"\
            ,FL,result, hinfo->boundary_located);

    // Test to see if we encountered any DoubleCR situations while we
    //      were processing the headers.  If we did encounter a doubleCR
    //      then we need to decode that data and then reset the doubleCR
    //      flag.
    if (MIMEH_get_doubleCR() != 0)
    {
        MIME_doubleCR_decode( MIMEH_get_doubleCR_name(), unpackdir, h, current_recursion_level);
        MIMEH_set_doubleCR( 0 );
        FFGET_SDL_MODE = 0;
    }

    // If we located a boundary being specified (as apposed to existing)
    // then we push it to the BoundaryStack

    if (h->boundary_located)
    {
        char *lbc;
        char *fbc;

        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Boundary located, pushing to stack (%s)\n",FL,h->boundary);
        BS_push(h->boundary);

        // Get the first and last character positions of the boundary
        //      so we can test these for quotes.
        fbc = h->boundary;
        lbc = h->boundary +strlen(h->boundary) -1;

        // Circumvent attempts to trick the boundary
        //      Even though we may end up pushing 3 boundaries to the stack
        //      they will be popped off if they're not needed.
        if (*fbc == '"') { BS_push((fbc +1)); MIMEH_set_defect( hinfo, MIMEH_DEFECT_UNBALANCED_BOUNDARY_QUOTE); }
        if (*lbc == '"') { *lbc = '\0'; BS_push(h->boundary); *lbc = '"'; MIMEH_set_defect( hinfo, MIMEH_DEFECT_UNBALANCED_BOUNDARY_QUOTE); }
        h->boundary_located = 0;
    } else {
        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding in BOUNDARY-LESS mode\n",FL);
        if (h->content_type == _CTYPE_RFC822)
        {
            // Pass off to the RFC822 handler
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding with RFC822 decoder\n",FL);
            result = MIME_handle_rfc822(f,unpackdir,h,current_recursion_level,ss);
        } else if (MIMEH_is_contenttype(_CTYPE_MULTIPART, h->content_type)) {
            // Pass off to the multipart handler
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding with Multipart decoder\n",FL);
            result = MIME_handle_multipart(f,unpackdir,h,current_recursion_level,ss);
        } else {
            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding boundaryless file (%s)...\n",FL,h->filename);
            result = MIME_handle_plain( f, unpackdir,h,current_recursion_level,ss);
        } // else-if content was RFC822 or multi-part
        return result;
    } // End of the boundary-LESS mode ( processing the mail which has no boundaries in the primary headers )

    if ((BS_top()!=NULL)&&(result == 0))
    {
        // Commence decoding WITH boundary awareness.
        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding with boundaries (filename = %s)\n",FL,h->filename);

        // Decode the data in the current MIME segment
        // based on the header information retrieved from
        // the start of this function.
        result = MIME_decode_encoding(f, unpackdir, h, ss);
        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Done decoding, result = %d",FL,result);
        if (result == 0)
        {
            if (BS_top()!=NULL)
            {
                // As this is a multipart email, then, each section will have its
                // own headers, so, we just simply call the MIMEH_parse call again
                // and get the attachment details
                while ((result == 0)||(result == MIME_STATUS_ZERO_FILE)||(result == MIME_ERROR_RECURSION_LIMIT_REACHED))
                {
                    h->content_type = -1;
                    h->filename[0] = '\0';
                    h->name[0]     = '\0';
                    h->content_transfer_encoding = -1;
                    h->content_disposition = -1;

                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding headers...\n",FL);
                    do {
                        result = MIMEH_parse_headers(f,h);
                    } while ((h->sanity == 0)&&(result != -1));

                    glb.header_defect_count += MIMEH_get_defect_count(h);
                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Mime header parsing result = %d\n",FL, result);
                    // 20040305-1331:PLD
                    if (result == -1)
                    {
                        result = MIME_ERROR_FFGET_EMPTY;
                        return result;
                    }

                    if (h->boundary_located)
                    {
                        if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Pushing boundary %s\n",FL, h->boundary);
                        BS_push(h->boundary);
                        h->boundary_located = 0;
                    }

                    if (result == _MIMEH_FOUND_FROM)
                    {
                        return _MIMEH_FOUND_FROM;
                    }

                    if (result == 0)
                    {
                        // If we locate a new boundary specified, it means we have a
                        // embedded message, also if we have a ctype of RFC822
                        if ( (h->boundary_located) \
                                || (h->content_type == _CTYPE_RFC822)\
                                || (MIMEH_is_contenttype(_CTYPE_MULTIPART, h->content_type))\
                            )
                        {
                            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Multipart/RFC822 mail headers found\n",FL);
                            /* If there is no filename, then we have a "standard"
                             * embedded message, which can be just read off as a
                             * continuous stream (simply with new boundaries */
                            if (( h->content_type == _CTYPE_RFC822 ))
                            {
                                // If the content_type is set to message/RFC822
                                // then we simply read off the data to the next
                                // boundary into a seperate file, then 'reload'
                                // the file into ripMIME.  Certainly, this is not
                                // the most efficent way of dealing with nested emails
                                // however, it is a rather robust/reliable way.
                                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Chose Content-type == RFC822 clause",FL);
                                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Calling MIME_decode_encoding()",FL);
                                result = MIME_handle_rfc822(f,unpackdir,h,current_recursion_level,ss);
                                // First up - extract the RFC822 body out of the parent mailpack
                                // XX result = MIME_decode_encoding( f, unpackdir, h, ss );

                                // Now decode the RFC822 body.
                                /**
                                  XX
                                  if (result == 0)
                                  {
                                  snprintf(scratch,sizeof(scratch),"%s/%s",unpackdir, h->filename);
                                  snprintf(h->filename,sizeof(h->filename),"%s",scratch);
                                  if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Now calling MIME_unpack_single() on the file '%s' for our RFC822 decode operation.",FL, scratch);
                                //result = MIME_unpack_single( unpackdir, h->filename, current_recursion_level +1, ss);
                                result = MIME_unpack( unpackdir, h->filename, current_recursion_level +1  );
                                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Unpack result = %d", FL, result);
                                result = 0;
                                } else return result; // 20040305-1312:PLD
                                */
                            } else if (( h->content_transfer_encoding != _CTRANS_ENCODING_B64)&&(h->filename[0] == '\0' )) {

                                // Decode nameless MIME segments which are not BASE64 encoded
                                //
                                // To be honest, i've forgotten what this section of test is supposed to pick out
                                // in terms of files - certainly it does pick out some, but I'm not sure what format
                                // they are.  Shame on me for not remembering, in future I must comment more.
                                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: NON-BASE64 DECODE\n",FL);
                                h->boundary_located = 0;
                                result = MIME_unpack_stage2(f, unpackdir, h, current_recursion_level , ss);

                                // When we've exited from decoding the sub-mailpack, we need to restore the original
                                // boundary
                                p = BS_top();
                                if (p) snprintf(h->boundary,_MIME_STRLEN_MAX,"%s",p);

                                /** 20041207-0106:PLD:
                                 ** changed to test for _INLINE **/
                                //} else if (( h->content_type = _CTYPE_MULTIPART_APPLEDOUBLE )&&(h->content_disposition != _CDISPOSITION_INLINE)) {
                        } else if (( h->content_type = _CTYPE_MULTIPART_APPLEDOUBLE )&&(h->content_disposition != _CDISPOSITION_INLINE)) {

                            // AppleDouble needs to be handled explicity - as even though it's
                            //      and embedded format, it does not have the normal headers->[headers->data]
                            //      layout of other nested emails

                            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Handle Appledouble explicitly",FL);
                            result = MIME_unpack_stage2(f, unpackdir, h, current_recursion_level , ss);

                        } else {
                            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: RFC822 Message to be decoded...\n",FL);
                            result = MIME_decode_encoding( f, unpackdir, h, ss );
                            if (result != 0) return result; // 20040305-1313:PLD
                            else
                            {
                                if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Now running ripMIME over decoded RFC822 message...\n",FL);

                                // Because we're calling MIME_unpack_single again [ie, recursively calling it
                                // we need to now adjust the input-filename so that it correctly is prefixed
                                // with the directory we unpacked to.

                                snprintf(scratch,sizeof(scratch),"%s/%s",unpackdir, h->filename);
                                snprintf(h->filename,sizeof(h->filename),"%s",scratch);
                                //result = MIME_unpack_single( unpackdir, h->filename, current_recursion_level +1, ss);
                                result = MIME_unpack_single( unpackdir, h->filename, current_recursion_level,ss );
                            }

                        } // else-if transfer-encoding wasn't B64 and filename was blank
                        } else {
                            // If the attachment included in this MIME segment is NOT a
                            // multipart or RFC822 embedded email, we can then simply use
                            // the normal decoding function to interpret its data.
                            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding a normal attachment \n",FL);
                            result = MIME_decode_encoding( f, unpackdir, h, ss );

                            if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Decoding a normal attachment '%s' done. \n",FL, h->filename);
                            // See if we have an attachment output which is actually another
                            //      email.
                            //
                            // Added 24 Aug 2003 by PLD
                            //      Ricardo Kleemann supplied offending mailpack to display
                            //      this behavior
                            if (result != 0) return result; // 20040305-1314:PLD
                            else
                            {
                                char *mime_fname;

                                mime_fname = PLD_dprintf("%s/%s", unpackdir, h->filename);
                                if(mime_fname != NULL)
                                {
                                    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Testing '%s' for email type",FL,mime_fname);
                                    if (MIME_is_file_RFC822(mime_fname))
                                    {
                                        //MIME_unpack_single( unpackdir, mime_fname, (hinfo->current_recursion_level+1), ss);
                                        MIME_unpack_single( unpackdir, mime_fname, current_recursion_level+1,ss);
                                    }
                                    free(mime_fname);
                                }
                            }
                        } // if there was a boundary, RFC822 content or it was multi-part
                    } else {
                        // if the result is not 0
                        break;
                    } // result == 0 test
                } // While (result)

                // ???? Why do we bother to pop the stack ???
                //  The way BS is designed it will auto-pop the inner nested boundaries
                //      when a higher-up one is located.
                //if (result == 0) BS_pop(); // 20040305-2219:PLD
            } // if MIME_BS_top()
        } // if result == 0
    } // if (result)
    if (MIME_DNORMAL) LOGGER_log("%s:%d:MIME_unpack_stage2:DEBUG: Exiting with result=%d recursion=%d\n",FL,result, current_recursion_level);
    return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq %r8, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
cmpl $0x1, 0x1f884(%rip)     # 0x276f0
jl 0x7e8b
movl -0x24(%rbp), %ecx
leaq 0x13344(%rip), %rdi     # 0x1b1bc
leaq 0x11650(%rip), %rsi     # 0x194cf
movl $0xa98, %edx            # imm = 0xA98
movb $0x0, %al
callq 0x117c0
movl -0x24(%rbp), %eax
cmpl 0x200ac(%rip), %eax     # 0x27f40
jle 0x7ecf
cmpl $0x0, 0x1f83f(%rip)     # 0x276dc
jle 0x7ec3
movl -0x24(%rbp), %ecx
movl 0x20097(%rip), %r8d     # 0x27f40
leaq 0x13341(%rip), %rdi     # 0x1b1f1
leaq 0x11618(%rip), %rsi     # 0x194cf
movl $0xa9d, %edx            # imm = 0xA9D
movb $0x0, %al
callq 0x117c0
movl $0xf0, -0x4(%rbp)
jmp 0x88e1
movq -0x20(%rbp), %rax
movq %rax, -0x40(%rbp)
cmpl $0x1, 0x1f812(%rip)     # 0x276f0
jl 0x7efa
leaq 0x13367(%rip), %rdi     # 0x1b24e
leaq 0x115e1(%rip), %rsi     # 0x194cf
movl $0xaa3, %edx            # imm = 0xAA3
movb $0x0, %al
callq 0x117c0
jmp 0x7efc
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xec10
movl %eax, -0x34(%rbp)
cmpl $0x1, 0x1f7dd(%rip)     # 0x276f0
jl 0x7f3d
movq -0x40(%rbp), %rax
movl 0x18d30(%rax), %ecx
movl -0x34(%rbp), %r8d
leaq 0x1335f(%rip), %rdi     # 0x1b289
leaq 0x1159e(%rip), %rsi     # 0x194cf
movl $0xaa9, %edx            # imm = 0xAA9
movb $0x0, %al
callq 0x117c0
jmp 0x7f3f
movq -0x40(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x18d30(%rcx)
movb %al, -0x61(%rbp)
jne 0x7f5b
cmpl $-0x1, -0x34(%rbp)
setne %al
movb %al, -0x61(%rbp)
movb -0x61(%rbp), %al
testb $0x1, %al
jne 0x7efc
cmpl $0x1, 0x1f787(%rip)     # 0x276f0
jl 0x7f93
movq -0x40(%rbp), %rax
movl 0x18d30(%rax), %ecx
movl -0x34(%rbp), %r8d
leaq 0x1335b(%rip), %rdi     # 0x1b2db
leaq 0x11548(%rip), %rsi     # 0x194cf
movl $0xaac, %edx            # imm = 0xAAC
movb $0x0, %al
callq 0x117c0
movq -0x40(%rbp), %rdi
callq 0xee80
movl %eax, %ecx
movl 0x1f32c(%rip), %eax     # 0x272d0
addl %ecx, %eax
movl %eax, 0x1f324(%rip)     # 0x272d0
movl -0x34(%rbp), %eax
subl $-0x1, %eax
jne 0x7fc2
jmp 0x7fb6
movl $0xf1, -0x4(%rbp)
jmp 0x88e1
leaq 0x22787(%rip), %rdi     # 0x2a750
callq 0x2100
cmpq $0x1, %rax
jae 0x8026
movq -0x40(%rbp), %rax
addq $0x59fc, %rax           # imm = 0x59FC
cmpq $0x0, %rax
je 0x8026
movq -0x40(%rbp), %rdi
addq $0x59fc, %rdi           # imm = 0x59FC
callq 0x2100
cmpq $0x0, %rax
jbe 0x8026
movq -0x40(%rbp), %rcx
addq $0x59fc, %rcx           # imm = 0x59FC
leaq 0x1f2c4(%rip), %rdi     # 0x272d0
addq $0x3480, %rdi           # imm = 0x3480
movl $0x3ff, %esi            # imm = 0x3FF
leaq 0x16f8b(%rip), %rdx     # 0x1efaa
movb $0x0, %al
callq 0x2130
cmpl $0x1, 0x1f6c3(%rip)     # 0x276f0
jl 0x8057
movl -0x34(%rbp), %ecx
movq -0x20(%rbp), %rax
movl 0x59f8(%rax), %r8d
leaq 0x132f4(%rip), %rdi     # 0x1b338
leaq 0x11484(%rip), %rsi     # 0x194cf
movl $0xabd, %edx            # imm = 0xABD
movb $0x0, %al
callq 0x117c0
callq 0xa380
cmpl $0x0, %eax
je 0x808d
callq 0xa400
movq %rax, %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x24(%rbp), %ecx
callq 0x6130
xorl %edi, %edi
callq 0xa390
leaq 0x22ed9(%rip), %rax     # 0x2af60
movl $0x0, (%rax)
movq -0x40(%rbp), %rax
cmpl $0x0, 0x59f8(%rax)
je 0x818c
cmpl $0x1, 0x1f64b(%rip)     # 0x276f0
jl 0x80cc
movq -0x40(%rbp), %rcx
addq $0x31fe, %rcx           # imm = 0x31FE
leaq 0x132d3(%rip), %rdi     # 0x1b38c
leaq 0x1140f(%rip), %rsi     # 0x194cf
movl $0xad2, %edx            # imm = 0xAD2
movb $0x0, %al
callq 0x117c0
movq -0x40(%rbp), %rdi
addq $0x31fe, %rdi           # imm = 0x31FE
callq 0x12910
movq -0x40(%rbp), %rax
addq $0x31fe, %rax           # imm = 0x31FE
movq %rax, -0x58(%rbp)
movq -0x40(%rbp), %rax
addq $0x31fe, %rax           # imm = 0x31FE
movq %rax, -0x70(%rbp)
movq -0x40(%rbp), %rdi
addq $0x31fe, %rdi           # imm = 0x31FE
callq 0x2100
movq %rax, %rcx
movq -0x70(%rbp), %rax
addq %rcx, %rax
addq $-0x1, %rax
movq %rax, -0x50(%rbp)
movq -0x58(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x8141
movq -0x58(%rbp), %rdi
addq $0x1, %rdi
callq 0x12910
movq -0x20(%rbp), %rdi
movl $0x6, %esi
callq 0xa610
movq -0x50(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x22, %eax
jne 0x8179
movq -0x50(%rbp), %rax
movb $0x0, (%rax)
movq -0x40(%rbp), %rdi
addq $0x31fe, %rdi           # imm = 0x31FE
callq 0x12910
movq -0x50(%rbp), %rax
movb $0x22, (%rax)
movq -0x20(%rbp), %rdi
movl $0x6, %esi
callq 0xa610
movq -0x40(%rbp), %rax
movl $0x0, 0x59f8(%rax)
jmp 0x82b1
cmpl $0x1, 0x1f55d(%rip)     # 0x276f0
jl 0x81af
leaq 0x13239(%rip), %rdi     # 0x1b3d5
leaq 0x1132c(%rip), %rsi     # 0x194cf
movl $0xae1, %edx            # imm = 0xAE1
movb $0x0, %al
callq 0x117c0
movq -0x40(%rbp), %rax
cmpl $0x1f4, 0x27f8(%rax)    # imm = 0x1F4
jne 0x8202
cmpl $0x1, 0x1f52a(%rip)     # 0x276f0
jl 0x81e2
leaq 0x13246(%rip), %rdi     # 0x1b415
leaq 0x112f9(%rip), %rsi     # 0x194cf
movl $0xae5, %edx            # imm = 0xAE5
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x88f0
movl %eax, -0x34(%rbp)
jmp 0x82a6
movq -0x40(%rbp), %rax
movl 0x27f8(%rax), %esi
movl $0x64, %edi
callq 0xa6a0
cmpl $0x0, %eax
je 0x825b
cmpl $0x1, 0x1f4ce(%rip)     # 0x276f0
jl 0x823e
leaq 0x13228(%rip), %rdi     # 0x1b453
leaq 0x1129d(%rip), %rsi     # 0x194cf
movl $0xae9, %edx            # imm = 0xAE9
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x7c60
movl %eax, -0x34(%rbp)
jmp 0x82a4
cmpl $0x1, 0x1f48e(%rip)     # 0x276f0
jl 0x8289
movq -0x40(%rbp), %rcx
addq $0x5efd, %rcx           # imm = 0x5EFD
leaq 0x1321e(%rip), %rdi     # 0x1b494
leaq 0x11252(%rip), %rsi     # 0x194cf
movl $0xaec, %edx            # imm = 0xAEC
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x8b90
movl %eax, -0x34(%rbp)
jmp 0x82a6
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x88e1
callq 0x12b70
cmpq $0x0, %rax
je 0x88b1
cmpl $0x0, -0x34(%rbp)
jne 0x88b1
cmpl $0x1, 0x1f41f(%rip)     # 0x276f0
jl 0x82f8
movq -0x40(%rbp), %rcx
addq $0x5efd, %rcx           # imm = 0x5EFD
leaq 0x131f3(%rip), %rdi     # 0x1b4d8
leaq 0x111e3(%rip), %rsi     # 0x194cf
movl $0xaf5, %edx            # imm = 0xAF5
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x6e60
movl %eax, -0x34(%rbp)
cmpl $0x1, 0x1f3d9(%rip)     # 0x276f0
jl 0x8336
movl -0x34(%rbp), %ecx
leaq 0x131ff(%rip), %rdi     # 0x1b522
leaq 0x111a5(%rip), %rsi     # 0x194cf
movl $0xafb, %edx            # imm = 0xAFB
movb $0x0, %al
callq 0x117c0
cmpl $0x0, -0x34(%rbp)
jne 0x88af
callq 0x12b70
cmpq $0x0, %rax
je 0x88ad
jmp 0x8351
movb $0x1, %al
cmpl $0x0, -0x34(%rbp)
movb %al, -0x71(%rbp)
je 0x8374
movb $0x1, %al
cmpl $0x64, -0x34(%rbp)
movb %al, -0x71(%rbp)
je 0x8374
cmpl $0xf0, -0x34(%rbp)
sete %al
movb %al, -0x71(%rbp)
movb -0x71(%rbp), %al
testb $0x1, %al
jne 0x8380
jmp 0x88ab
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x27f8(%rax) # imm = 0xFFFFFFFF
movq -0x40(%rbp), %rax
movb $0x0, 0x5efd(%rax)
movq -0x40(%rbp), %rax
movb $0x0, 0x6efe(%rax)
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x166f8(%rax) # imm = 0xFFFFFFFF
movq -0x40(%rbp), %rax
movl $0xffffffff, 0x17100(%rax) # imm = 0xFFFFFFFF
cmpl $0x1, 0x1f329(%rip)     # 0x276f0
jl 0x83e3
leaq 0x1318d(%rip), %rdi     # 0x1b55d
leaq 0x110f8(%rip), %rsi     # 0x194cf
movl $0xb0b, %edx            # imm = 0xB0B
movb $0x0, %al
callq 0x117c0
jmp 0x83e5
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
callq 0xec10
movl %eax, -0x34(%rbp)
movq -0x40(%rbp), %rcx
xorl %eax, %eax
cmpl $0x0, 0x18d30(%rcx)
movb %al, -0x72(%rbp)
jne 0x8411
cmpl $-0x1, -0x34(%rbp)
setne %al
movb %al, -0x72(%rbp)
movb -0x72(%rbp), %al
testb $0x1, %al
jne 0x83e5
movq -0x40(%rbp), %rdi
callq 0xee80
addl 0x1eea9(%rip), %eax     # 0x272d0
movl %eax, 0x1eea3(%rip)     # 0x272d0
cmpl $0x1, 0x1f2bc(%rip)     # 0x276f0
jl 0x8453
movl -0x34(%rbp), %ecx
leaq 0x13152(%rip), %rdi     # 0x1b592
leaq 0x11088(%rip), %rsi     # 0x194cf
movl $0xb11, %edx            # imm = 0xB11
movb $0x0, %al
callq 0x117c0
cmpl $-0x1, -0x34(%rbp)
jne 0x846b
movl $0xf1, -0x34(%rbp)
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x88e1
movq -0x40(%rbp), %rax
cmpl $0x0, 0x59f8(%rax)
je 0x84c4
cmpl $0x1, 0x1f271(%rip)     # 0x276f0
jl 0x84a6
movq -0x40(%rbp), %rcx
addq $0x31fe, %rcx           # imm = 0x31FE
leaq 0x13140(%rip), %rdi     # 0x1b5d3
leaq 0x11035(%rip), %rsi     # 0x194cf
movl $0xb1b, %edx            # imm = 0xB1B
movb $0x0, %al
callq 0x117c0
movq -0x40(%rbp), %rdi
addq $0x31fe, %rdi           # imm = 0x31FE
callq 0x12910
movq -0x40(%rbp), %rax
movl $0x0, 0x59f8(%rax)
cmpl $0x64, -0x34(%rbp)
jne 0x84d6
movl $0x64, -0x4(%rbp)
jmp 0x88e1
cmpl $0x0, -0x34(%rbp)
jne 0x88a4
movq -0x40(%rbp), %rax
cmpl $0x0, 0x59f8(%rax)
jne 0x851a
movq -0x40(%rbp), %rax
cmpl $0x1f4, 0x27f8(%rax)    # imm = 0x1F4
je 0x851a
movq -0x40(%rbp), %rax
movl 0x27f8(%rax), %esi
movl $0x64, %edi
callq 0xa6a0
cmpl $0x0, %eax
je 0x87a7
cmpl $0x1, 0x1f1cf(%rip)     # 0x276f0
jl 0x853d
leaq 0x130de(%rip), %rdi     # 0x1b608
leaq 0x10f9e(%rip), %rsi     # 0x194cf
movl $0xb2e, %edx            # imm = 0xB2E
movb $0x0, %al
callq 0x117c0
movq -0x40(%rbp), %rax
cmpl $0x1f4, 0x27f8(%rax)    # imm = 0x1F4
jne 0x85b3
cmpl $0x1, 0x1f19c(%rip)     # 0x276f0
jl 0x8570
leaq 0x130f0(%rip), %rdi     # 0x1b64d
leaq 0x10f6b(%rip), %rsi     # 0x194cf
movl $0xb3a, %edx            # imm = 0xB3A
movb $0x0, %al
callq 0x117c0
cmpl $0x1, 0x1f179(%rip)     # 0x276f0
jl 0x8593
leaq 0x13111(%rip), %rdi     # 0x1b691
leaq 0x10f48(%rip), %rsi     # 0x194cf
movl $0xb3b, %edx            # imm = 0xB3B
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x88f0
movl %eax, -0x34(%rbp)
jmp 0x87a2
movq -0x40(%rbp), %rax
cmpl $0x64, 0x166f8(%rax)
je 0x865b
movq -0x40(%rbp), %rax
movsbl 0x5efd(%rax), %eax
cmpl $0x0, %eax
jne 0x865b
cmpl $0x1, 0x1f111(%rip)     # 0x276f0
jl 0x85fb
leaq 0x130e8(%rip), %rdi     # 0x1b6d0
leaq 0x10ee0(%rip), %rsi     # 0x194cf
movl $0xb55, %edx            # imm = 0xB55
movb $0x0, %al
callq 0x117c0
movq -0x40(%rbp), %rax
movl $0x0, 0x59f8(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x7e40
movl %eax, -0x34(%rbp)
callq 0x12b70
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x8656
movq -0x40(%rbp), %rdi
addq $0x31fe, %rdi           # imm = 0x31FE
movq -0x48(%rbp), %rcx
movl $0x3ff, %esi            # imm = 0x3FF
leaq 0x1695b(%rip), %rdx     # 0x1efaa
movb $0x0, %al
callq 0x2130
jmp 0x87a0
movq -0x40(%rbp), %rax
movl $0x66, 0x27f8(%rax)
movb $0x1, %al
testb $0x1, %al
jne 0x8671
jmp 0x86c1
movq -0x40(%rbp), %rax
cmpl $0x64, 0x17100(%rax)
je 0x86c1
cmpl $0x1, 0x1f06b(%rip)     # 0x276f0
jl 0x86a1
leaq 0x13075(%rip), %rdi     # 0x1b703
leaq 0x10e3a(%rip), %rsi     # 0x194cf
movl $0xb67, %edx            # imm = 0xB67
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movl -0x24(%rbp), %ecx
movq -0x30(%rbp), %r8
callq 0x7e40
movl %eax, -0x34(%rbp)
jmp 0x879e
cmpl $0x1, 0x1f028(%rip)     # 0x276f0
jl 0x86e4
leaq 0x13070(%rip), %rdi     # 0x1b741
leaq 0x10df7(%rip), %rsi     # 0x194cf
movl $0xb6b, %edx            # imm = 0xB6B
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x6e60
movl %eax, -0x34(%rbp)
cmpl $0x0, -0x34(%rbp)
je 0x870d
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x88e1
cmpl $0x1, 0x1efdc(%rip)     # 0x276f0
jl 0x8730
leaq 0x13065(%rip), %rdi     # 0x1b782
leaq 0x10dab(%rip), %rsi     # 0x194cf
movl $0xb70, %edx            # imm = 0xB70
movb $0x0, %al
callq 0x117c0
movq -0x18(%rbp), %rcx
movq -0x40(%rbp), %r8
addq $0x5efd, %r8            # imm = 0x5EFD
leaq 0x2240a(%rip), %rdi     # 0x2ab50
movl $0x400, %esi            # imm = 0x400
leaq 0x10daa(%rip), %rdx     # 0x194fc
movb $0x0, %al
callq 0x2130
movq -0x40(%rbp), %rdi
addq $0x5efd, %rdi           # imm = 0x5EFD
movl $0x1001, %esi           # imm = 0x1001
leaq 0x1683a(%rip), %rdx     # 0x1efaa
leaq 0x223d9(%rip), %rcx     # 0x2ab50
movb $0x0, %al
callq 0x2130
movq -0x18(%rbp), %rdi
movq -0x40(%rbp), %rsi
addq $0x5efd, %rsi           # imm = 0x5EFD
movl -0x24(%rbp), %edx
movq -0x30(%rbp), %rcx
callq 0x78b0
movl %eax, -0x34(%rbp)
jmp 0x879e
jmp 0x87a0
jmp 0x87a2
jmp 0x88a2
cmpl $0x1, 0x1ef42(%rip)     # 0x276f0
jl 0x87ca
leaq 0x1301f(%rip), %rdi     # 0x1b7d6
leaq 0x10d11(%rip), %rsi     # 0x194cf
movl $0xb81, %edx            # imm = 0xB81
movb $0x0, %al
callq 0x117c0
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x6e60
movl %eax, -0x34(%rbp)
cmpl $0x1, 0x1ef07(%rip)     # 0x276f0
jl 0x8810
movq -0x40(%rbp), %rcx
addq $0x5efd, %rcx           # imm = 0x5EFD
leaq 0x13018(%rip), %rdi     # 0x1b815
leaq 0x10ccb(%rip), %rsi     # 0x194cf
movl $0xb84, %edx            # imm = 0xB84
movb $0x0, %al
callq 0x117c0
cmpl $0x0, -0x34(%rbp)
je 0x8821
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x88e1
movq -0x18(%rbp), %rsi
movq -0x40(%rbp), %rdx
addq $0x5efd, %rdx           # imm = 0x5EFD
leaq 0x10cc5(%rip), %rdi     # 0x194fc
movb $0x0, %al
callq 0x11330
movq %rax, -0x60(%rbp)
cmpq $0x0, -0x60(%rbp)
je 0x889e
cmpl $0x1, 0x1eea0(%rip)     # 0x276f0
jl 0x8870
movq -0x60(%rbp), %rcx
leaq 0x13002(%rip), %rdi     # 0x1b85f
leaq 0x10c6b(%rip), %rsi     # 0x194cf
movl $0xb93, %edx            # imm = 0xB93
movb $0x0, %al
callq 0x117c0
movq -0x60(%rbp), %rdi
callq 0x4580
cmpl $0x0, %eax
je 0x8895
movq -0x18(%rbp), %rdi
movq -0x60(%rbp), %rsi
movl -0x24(%rbp), %edx
addl $0x1, %edx
movq -0x30(%rbp), %rcx
callq 0x78b0
movq -0x60(%rbp), %rdi
callq 0x2030
jmp 0x88a0
jmp 0x88a2
jmp 0x88a6
jmp 0x88ab
jmp 0x8351
jmp 0x88ad
jmp 0x88af
jmp 0x88b1
cmpl $0x1, 0x1ee38(%rip)     # 0x276f0
jl 0x88db
movl -0x34(%rbp), %ecx
movl -0x24(%rbp), %r8d
leaq 0x12fd3(%rip), %rdi     # 0x1b89b
leaq 0x10c00(%rip), %rsi     # 0x194cf
movl $0xbaa, %edx            # imm = 0xBAA
movb $0x0, %al
callq 0x117c0
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopl (%rax)