// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/misc.c
// Function: scan_summary
int
scan_summary(struct image_summary *summary_entry)
{
    struct image_summary *next_entry = NULL;
    struct image_summary *prev_entry = NULL;
    unsigned long long image_size = 0ULL;
    unsigned long long max_image_size = 0ULL;
    unsigned long marked_primary_image_length = 0ULL;
    unsigned long long marked_primary_image_size = 0ULL;
    unsigned long long primary_image_size = 0ULL;
    unsigned long long next_primary_size = 0ULL;
    unsigned long max_image_width = 0UL;
    unsigned long max_image_height = 0UL;
    unsigned long max_image_length = 0UL;
    unsigned long image_length = 0UL;
    int primary_found = 0;
    int number_of_images = 0;

    if(Debug & 0x4)
        (void)newline(1);

    /* The passed entry should be the head; scan forward merging data */
    while(summary_entry/*  && next_entry */)
    {
        if(summary_entry->entry_lock <= 0)
        {
            summary_entry = summary_entry->next_entry;
            continue;
        }
        if(summary_entry)
            next_entry = summary_entry->next_entry;
        if(Debug & 0x4)
        {
            printred("DEBUG:");
            printf(" %d: ffm=%#x, fsf=%#x",summary_entry->entry_lock,
                    summary_entry->fileformat,summary_entry->filesubformat);
            printf(", spp=%d, bps[0]=%d",summary_entry->spp,summary_entry->bps[0]);
        }

        /* 'image_size' in pixels                                     */
        image_size = summary_entry->pixel_width * summary_entry->pixel_height;

        /* image_length vs summary length: compressed? how much?      */
        /* ###%%% this is "experimental" and shows up only in Debug   */
        if(summary_entry->bps[0] && summary_entry->spp)
        {
            int i;
            int spp = summary_entry->spp;
            float total_bits,bytes_per_pixel;

            total_bits = 0;
            if (spp > MAXSAMPLE)
            {
                spp = MAXSAMPLE;
                if(Debug & 0x4)
                {
                    printf("CLAMPING spp\n");
                }
            }
            for(i = 0; i < spp; ++i)
                total_bits += summary_entry->bps[i];
            bytes_per_pixel = total_bits / 8.0;
            if(Debug & 0x4)
                printf(", bytesperpixel=%.1f",bytes_per_pixel);
            image_length = image_size * bytes_per_pixel;
            summary_entry->compress_percent = (float)summary_entry->length / (float)image_length;
            summary_entry->compress_percent *= 100.0;
        }
        if(Debug & 0x4)
            printf(" c=%lu/%lu=%.0f%%\n",summary_entry->length,image_length,
                                            summary_entry->compress_percent);

        if(summary_entry->subfiletype == PRIMARY_TYPE)
        {
            ++primary_found;    /* marked in a TIFF/EP IFD            */
            marked_primary_image_size = image_size;
            marked_primary_image_length = summary_entry->length;
            if(summary_entry->primary_height == 0UL)
                summary_entry->primary_height = summary_entry->pixel_height;
            if(summary_entry->primary_width == 0UL)
                summary_entry->primary_width = summary_entry->pixel_width;
            
        }
        /* maintain max values independently of primary               */
        if(image_size > max_image_size)
        {
            max_image_height = summary_entry->pixel_height;
            max_image_width = summary_entry->pixel_width;
            max_image_size = image_size;
        }

        /* The largest chunk of image data; could be very important   */
        if(summary_entry->length > max_image_length)
            max_image_length = summary_entry->length;

        /* If a primary size was found, e.g. in an exif ifd, carry    */
        /* it forward. If more than one was found, keep the largest.  */
        /* Then carry it back down to the head in the backward loop.  */
        /* Should wind up with all entries the same (and possibly     */
        /* zero).                                                     */
        if(summary_entry->primary_height || summary_entry->primary_width)
        {
            primary_image_size = summary_entry->primary_width * summary_entry->primary_height;
            if(next_entry && (next_entry->primary_height || next_entry->primary_width))
            {
                next_primary_size = next_entry->primary_width * next_entry->primary_height;
                if(next_primary_size > primary_image_size)
                {
                    summary_entry->primary_width = next_entry->primary_width;
                    summary_entry->primary_height = next_entry->primary_height;
                    primary_image_size = next_primary_size;
                }
                else
                {
                    next_entry->primary_width = summary_entry->primary_width;
                    next_entry->primary_height = summary_entry->primary_height;
                }
            }
            else if(next_entry)
            {
                next_entry->primary_width = summary_entry->primary_width;
                next_entry->primary_height = summary_entry->primary_height;
            }
        }
        /* In JPEG format files, it's almost certain that the primary */
        /* begins at the beginning of the file; "almost" only because */
        /* I've seen some strange things...                           */
        if((summary_entry->fileformat == FILEFMT_JPEG) &&
                            (summary_entry->subfiletype == UNKNOWN_TYPE))
        {
            if(summary_entry->offset == 0)
                summary_entry->subfiletype = POSSIBLE_PRIMARY_TYPE;
        }
        
        prev_entry = summary_entry;
        summary_entry = next_entry;
    }
    summary_entry = prev_entry;
    if((Debug & 0x4) && summary_entry)
    {
        printred("DEBUG:");
        printf(" Exif   Primary=%lux%lu = %llu\n",summary_entry->primary_width,summary_entry->primary_height,primary_image_size);
        printred("DEBUG:");
        printf("        Maxsize=%lux%lu = %llu\n",max_image_width,max_image_height,max_image_size);
        printred("DEBUG:");
        printf(" Marked Primary size = %llu",marked_primary_image_size);
        printf(" Marked Primary length=%lu, max length = %lu\n",marked_primary_image_length,max_image_length);
    }

    /* now walk back to the head                                      */
    /* If a marked primary has been found, the primary job is to mark */
    /* reduced resolution images which haven't been defined as        */
    /* thumbnails in the main code. If no marked primary, it is also  */
    /* necessary to deduce the identity of the primary image, using   */
    /* size, length and/or image and compression type.                */

    /* ###%%% at this point, after all the futzing around with        */
    /* primary_width, etc., it never gets used. max_* are used        */
    /* (and primary_image_size may not have been set if the last      */
    /* entry contained the values)                                    */

    if(summary_entry)
        prev_entry = summary_entry->prev_entry;
    while(summary_entry)
    {
        if(Debug & 0x4)
        {
            printred("DEBUG:");
            printf(" #%d se=%#-9x, pe=%#-9x",summary_entry->entry_lock,
                    (unsigned int)summary_entry,(unsigned int)prev_entry);
        }
        image_size = summary_entry->pixel_width * summary_entry->pixel_height;
        image_length = summary_entry->length;
        if(summary_entry->entry_lock <= 0)
        {
            summary_entry = prev_entry;
            if(summary_entry)
                prev_entry = summary_entry->prev_entry;
            continue;
        }
        if(Debug & 0x4)
        {
            printf(" ffm=%#x, fsf=%#-3x",summary_entry->fileformat,summary_entry->filesubformat);
            printf(", ifm=%#lx, isf=%#lx",summary_entry->imageformat,summary_entry->imagesubformat);
            printf(", offs=%lu, len=%lu",summary_entry->offset,summary_entry->length);
            printf(", pw=%lu, ph=%lu",summary_entry->pixel_width,summary_entry->pixel_height);
        }
        if(prev_entry && (prev_entry->subfiletype != PRIMARY_TYPE))
        {
            /* The primary size was carried up to the last entry in   */
            /* the forward scan; now copy it back down.               */
            /* ###%%% is this used?   ...no, never                    */
            prev_entry->primary_width = summary_entry->primary_width;
            prev_entry->primary_height = summary_entry->primary_height;
        }
        if(Debug & 0x4)
            printf(" sft=%d\n",summary_entry->subfiletype);
        if(primary_found >= 1)  /* should never be greater than 1     */
        {
            if(summary_entry->subfiletype == POSSIBLE_PRIMARY_TYPE)
                summary_entry->subfiletype = REDUCED_RES_TYPE;
        }
        else if(primary_found == 0)
        {
            if(summary_entry->subfiletype == POSSIBLE_PRIMARY_TYPE)
            {
                if((summary_entry->fileformat == FILEFMT_TIFF) ||
                    (summary_entry->fileformat == FILEFMT_ORF1) ||
                        (summary_entry->fileformat == FILEFMT_ORF2))
                {
                    switch(summary_entry->compression)
                    {
                        case 1:
                        case 34712:     /* JPEG 2000 */
                        case 34713:     /* NEF compressed */
                        case JPEG_SOF_3:
                        case JPEG_SOF_7:
                        case JPEG_SOF_11:
                        case JPEG_SOF_15:
                            if(image_size >= max_image_size)
                            {
                                summary_entry->subfiletype = PRIMARY_TYPE;
                                ++primary_found;
                            }
                            break;
                        default:
                            if((image_size < max_image_size) || (image_length < max_image_length))
                                summary_entry->subfiletype = REDUCED_RES_TYPE;
                            break;
                    }
                }
                else if(summary_entry->fileformat == FILEFMT_JP2)
                {
                        summary_entry->subfiletype = PRIMARY_TYPE;
                        ++primary_found;
                }
                else if(summary_entry->fileformat == FILEFMT_JPEG)
                {
                    if(summary_entry->offset == 0)
                    {
                        summary_entry->subfiletype = PRIMARY_TYPE;
                        ++primary_found;
                    }
                    else if(summary_entry->filesubformat & (FILESUBFMT_TIFF|FILESUBFMT_TIFFEP))
                    {
                        switch(summary_entry->compression)
                        {
                            case JPEG_SOF_3:
                            case JPEG_SOF_7:
                            case JPEG_SOF_11:
                            case JPEG_SOF_15:
                                /* lossless compression               */
                                if(image_size >= max_image_size)
                                {
                                    summary_entry->subfiletype = PRIMARY_TYPE;
                                    ++primary_found;
                                }
                                break;
                            default:
                                if((image_size < max_image_size) ||
                                                            (image_length < max_image_length))
                                    summary_entry->subfiletype = REDUCED_RES_TYPE;
                                break;
                        }
                    }
                }
                else if(summary_entry->imagesubformat == IMGSUBFMT_CFA)
                {
                    /* fileformat may be MRW; other fileformats?      */
                    if(image_size >= max_image_size)
                    {
                        summary_entry->subfiletype = PRIMARY_TYPE;
                        ++primary_found;
                    }
                    else
                        summary_entry->subfiletype = REDUCED_RES_TYPE;
                }
                else
                    summary_entry->subfiletype = REDUCED_RES_TYPE;
            }
        }

        if(primary_found)
        {
            if(summary_entry->subfiletype <= POSSIBLE_PRIMARY_TYPE)
                summary_entry->subfiletype = REDUCED_RES_TYPE;
        }
        else if(image_size >= max_image_size)
        {
            if(summary_entry->subfiletype == POSSIBLE_PRIMARY_TYPE)
            {
                summary_entry->subfiletype = PRIMARY_TYPE;
                ++primary_found;
            }
        }
        else if(summary_entry->subfiletype <= POSSIBLE_PRIMARY_TYPE)
            summary_entry->subfiletype = REDUCED_RES_TYPE;

        if(((summary_entry->imageformat) != IMGFMT_NOIMAGE) &&
                ((summary_entry->imagesubformat & ~IMGSUBFMT_ERRORMASK) != IMGSUBFMT_JPEGTABLES))
            ++number_of_images;
        if(Debug & 0x4)
        {
            printred("DEBUG:");
            printf(" #%d se=%#-9x, pe=%#-9x",summary_entry->entry_lock,
                    (unsigned int)summary_entry,(unsigned int)prev_entry);
            printf(" ffm=%#x, fsf=%#-3x",summary_entry->fileformat,summary_entry->filesubformat);
            printf(", ifm=%#lx, isf=%#lx",summary_entry->imageformat,summary_entry->imagesubformat);
            printf(", offs=%lu, len=%lu",summary_entry->offset,summary_entry->length);
            printf(", pw=%lu, ph=%lu",summary_entry->pixel_width,summary_entry->pixel_height);
            printf(" sft=%d\n",summary_entry->subfiletype);
        }
        summary_entry = prev_entry;
        if(summary_entry)
            prev_entry = summary_entry->prev_entry;
        else
            prev_entry = NULL;
    }
    if(Debug & 0x4)
        (void)newline(1);
    return(number_of_images);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq $0x0, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movq $0x0, -0x60(%rbp)
movq $0x0, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl $0x0, -0x70(%rbp)
leaq 0x5e6bc(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e008
movl $0x1, %edi
callq 0x1ef50
jmp 0x1e00a
cmpq $0x0, -0x8(%rbp)
je 0x1e520
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jg 0x1e02d
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x1e00a
cmpq $0x0, -0x8(%rbp)
je 0x1e040
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
leaq 0x5e669(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e0a2
leaq 0x48e7f(%rip), %rdi     # 0x66ed7
callq 0x6860
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edx
movq -0x8(%rbp), %rax
movl 0x18(%rax), %ecx
leaq 0x49d26(%rip), %rdi     # 0x67d9f
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movl 0xcc(%rax), %esi
movq -0x8(%rbp), %rax
movl 0xd0(%rax), %edx
leaq 0x49d1a(%rip), %rdi     # 0x67db5
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x8(%rbp), %rcx
imulq 0x78(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0xd0(%rax)
je 0x1e300
movq -0x8(%rbp), %rax
cmpl $0x0, 0xcc(%rax)
je 0x1e300
movq -0x8(%rbp), %rax
movl 0xcc(%rax), %eax
movl %eax, -0x78(%rbp)
xorps %xmm0, %xmm0
movss %xmm0, -0x7c(%rbp)
cmpl $0x10, -0x78(%rbp)
jle 0x1e11c
movl $0x10, -0x78(%rbp)
leaq 0x5e5ae(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e11a
leaq 0x49cb6(%rip), %rdi     # 0x67dc9
movb $0x0, %al
callq 0x3110
jmp 0x1e11c
movl $0x0, -0x74(%rbp)
movl -0x74(%rbp), %eax
cmpl -0x78(%rbp), %eax
jge 0x1e151
movq -0x8(%rbp), %rax
movslq -0x74(%rbp), %rcx
cvtsi2ssl 0xd0(%rax,%rcx,4), %xmm0
addss -0x7c(%rbp), %xmm0
movss %xmm0, -0x7c(%rbp)
movl -0x74(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x74(%rbp)
jmp 0x1e123
movss -0x7c(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x49b16(%rip), %xmm1    # 0x67c78
divsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, -0x80(%rbp)
leaq 0x5e53a(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e197
movss -0x80(%rbp), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x49c47(%rip), %rdi     # 0x67dd7
movb $0x1, %al
callq 0x3110
movq -0x20(%rbp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x88(%rbp)
testq %rax, %rax
movss %xmm0, -0x84(%rbp)
js 0x1e1dc
movss -0x88(%rbp), %xmm0
movss %xmm0, -0x84(%rbp)
movss -0x84(%rbp), %xmm0
movss -0x80(%rbp), %xmm1
mulss %xmm1, %xmm0
movaps %xmm0, %xmm1
cvttss2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movss 0x49a84(%rip), %xmm1    # 0x67c88
subss %xmm1, %xmm0
cvttss2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x90(%rbp)
testq %rax, %rax
movss %xmm0, -0x8c(%rbp)
js 0x1e263
movss -0x90(%rbp), %xmm0
movss %xmm0, -0x8c(%rbp)
movss -0x8c(%rbp), %xmm0
movss %xmm0, -0x9c(%rbp)
movq -0x68(%rbp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, -0x98(%rbp)
testq %rax, %rax
movss %xmm0, -0x94(%rbp)
js 0x1e2b8
movss -0x98(%rbp), %xmm0
movss %xmm0, -0x94(%rbp)
movss -0x9c(%rbp), %xmm0
movss -0x94(%rbp), %xmm1
divss %xmm1, %xmm0
movq -0x8(%rbp), %rax
movss %xmm0, 0x114(%rax)
movq -0x8(%rbp), %rax
movss 0x114(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x49990(%rip), %xmm1    # 0x67c80
mulsd %xmm1, %xmm0
cvtsd2ss %xmm0, %xmm0
movss %xmm0, 0x114(%rax)
leaq 0x5e3a9(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e33e
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rsi
movq -0x68(%rbp), %rdx
movq -0x8(%rbp), %rax
movss 0x114(%rax), %xmm0
cvtss2sd %xmm0, %xmm0
leaq 0x49ab5(%rip), %rdi     # 0x67dec
movb $0x1, %al
callq 0x3110
movq -0x8(%rbp), %rax
cmpl $0x1, 0xc4(%rax)
jne 0x1e3a3
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x1e386
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x1e3a1
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
jmp 0x1e3a3
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jbe 0x1e3cd
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
cmpq -0x60(%rbp), %rax
jbe 0x1e3ed
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x1e407
movq -0x8(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x1e4d3
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x8(%rbp), %rcx
imulq 0x68(%rcx), %rax
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x1e4a8
movq -0x10(%rbp), %rax
cmpq $0x0, 0x68(%rax)
jne 0x1e43d
movq -0x10(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x1e4a8
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq -0x10(%rbp), %rcx
imulq 0x68(%rcx), %rax
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
cmpq -0x40(%rbp), %rax
jbe 0x1e486
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x10(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x48(%rbp), %rax
movq %rax, -0x40(%rbp)
jmp 0x1e4a6
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
jmp 0x1e4d1
cmpq $0x0, -0x10(%rbp)
je 0x1e4cf
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
jmp 0x1e4d1
jmp 0x1e4d3
movq -0x8(%rbp), %rax
cmpl $0xffd8, 0x14(%rax)     # imm = 0xFFD8
jne 0x1e50b
movq -0x8(%rbp), %rax
cmpl $-0x1, 0xc4(%rax)
jne 0x1e50b
movq -0x8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
jne 0x1e509
movq -0x8(%rbp), %rax
movl $0x0, 0xc4(%rax)
jmp 0x1e50b
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1e00a
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq 0x5e181(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e5d0
cmpq $0x0, -0x8(%rbp)
je 0x1e5d0
leaq 0x48988(%rip), %rdi     # 0x66ed7
callq 0x6860
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rdx
movq -0x40(%rbp), %rcx
leaq 0x49890(%rip), %rdi     # 0x67dff
movb $0x0, %al
callq 0x3110
leaq 0x4895a(%rip), %rdi     # 0x66ed7
callq 0x6860
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x4988a(%rip), %rdi     # 0x67e1f
movb $0x0, %al
callq 0x3110
leaq 0x48934(%rip), %rdi     # 0x66ed7
callq 0x6860
movq -0x38(%rbp), %rsi
leaq 0x4988c(%rip), %rdi     # 0x67e3f
movb $0x0, %al
callq 0x3110
movq -0x30(%rbp), %rsi
movq -0x60(%rbp), %rdx
leaq 0x49892(%rip), %rdi     # 0x67e5b
movb $0x0, %al
callq 0x3110
cmpq $0x0, -0x8(%rbp)
je 0x1e5e2
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x1e5e4
cmpq $0x0, -0x8(%rbp)
je 0x1eb97
leaq 0x5e0ba(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e62d
leaq 0x488d0(%rip), %rdi     # 0x66ed7
callq 0x6860
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x8(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movl %eax, %ecx
leaq 0x49863(%rip), %rdi     # 0x67e89
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rax
movq -0x8(%rbp), %rcx
imulq 0x78(%rcx), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jg 0x1e67a
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1e675
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x1e5e4
leaq 0x5e02f(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e711
movq -0x8(%rbp), %rax
movl 0x14(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x497fd(%rip), %rdi     # 0x67ea1
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rdx
leaq 0x497ed(%rip), %rdi     # 0x67eb5
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rdx
leaq 0x497de(%rip), %rdi     # 0x67eca
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdx
leaq 0x497d4(%rip), %rdi     # 0x67ede
movb $0x0, %al
callq 0x3110
cmpq $0x0, -0x18(%rbp)
je 0x1e745
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc4(%rax)
je 0x1e745
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x60(%rax)
movq -0x8(%rbp), %rax
movq 0x68(%rax), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x68(%rax)
leaq 0x5df64(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1e76e
movq -0x8(%rbp), %rax
movl 0xc4(%rax), %esi
leaq 0x49788(%rip), %rdi     # 0x67eef
movb $0x0, %al
callq 0x3110
cmpl $0x1, -0x6c(%rbp)
jl 0x1e794
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
jne 0x1e78f
movq -0x8(%rbp), %rax
movl $0x5, 0xc4(%rax)
jmp 0x1e9f0
cmpl $0x0, -0x6c(%rbp)
jne 0x1e9ee
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
jne 0x1e9ec
movq -0x8(%rbp), %rax
cmpl $0x2a, 0x14(%rax)
je 0x1e7d7
movq -0x8(%rbp), %rax
cmpl $0x4f52, 0x14(%rax)     # imm = 0x4F52
je 0x1e7d7
movq -0x8(%rbp), %rax
cmpl $0x5352, 0x14(%rax)     # imm = 0x5352
jne 0x1e888
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %eax
movl %eax, -0xa0(%rbp)
subl $0x1, %eax
je 0x1e83c
jmp 0x1e7ee
movl -0xa0(%rbp), %eax
addl $0xffff7868, %eax       # imm = 0xFFFF7868
subl $0x2, %eax
jb 0x1e83c
jmp 0x1e800
movl -0xa0(%rbp), %eax
subl $0xffc3, %eax           # imm = 0xFFC3
je 0x1e83c
jmp 0x1e80f
movl -0xa0(%rbp), %eax
subl $0xffc7, %eax           # imm = 0xFFC7
je 0x1e83c
jmp 0x1e81e
movl -0xa0(%rbp), %eax
subl $0xffcb, %eax           # imm = 0xFFCB
je 0x1e83c
jmp 0x1e82d
movl -0xa0(%rbp), %eax
subl $0xffcf, %eax           # imm = 0xFFCF
jne 0x1e85f
jmp 0x1e83c
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1e85d
movq -0x8(%rbp), %rax
movl $0x1, 0xc4(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1e883
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1e873
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x1e881
movq -0x8(%rbp), %rax
movl $0x5, 0xc4(%rax)
jmp 0x1e883
jmp 0x1e9ea
movq -0x8(%rbp), %rax
cmpl $0xd0a870a, 0x14(%rax)  # imm = 0xD0A870A
jne 0x1e8b1
movq -0x8(%rbp), %rax
movl $0x1, 0xc4(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1e9e8
movq -0x8(%rbp), %rax
cmpl $0xffd8, 0x14(%rax)     # imm = 0xFFD8
jne 0x1e992
movq -0x8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
jne 0x1e8ec
movq -0x8(%rbp), %rax
movl $0x1, 0xc4(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1e990
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
andl $0x5, %eax
cmpl $0x0, %eax
je 0x1e98e
movq -0x8(%rbp), %rax
movl 0xc8(%rax), %eax
movl %eax, -0xa4(%rbp)
subl $0xffc3, %eax           # imm = 0xFFC3
je 0x1e945
jmp 0x1e918
movl -0xa4(%rbp), %eax
subl $0xffc7, %eax           # imm = 0xFFC7
je 0x1e945
jmp 0x1e927
movl -0xa4(%rbp), %eax
subl $0xffcb, %eax           # imm = 0xFFCB
je 0x1e945
jmp 0x1e936
movl -0xa4(%rbp), %eax
subl $0xffcf, %eax           # imm = 0xFFCF
jne 0x1e968
jmp 0x1e945
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1e966
movq -0x8(%rbp), %rax
movl $0x1, 0xc4(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1e98c
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1e97c
movq -0x68(%rbp), %rax
cmpq -0x60(%rbp), %rax
jae 0x1e98a
movq -0x8(%rbp), %rax
movl $0x5, 0xc4(%rax)
jmp 0x1e98c
jmp 0x1e98e
jmp 0x1e990
jmp 0x1e9e6
movq -0x8(%rbp), %rax
cmpq $0x18023, 0x88(%rax) # imm = 0x18023
jne 0x1e9d6
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1e9c6
movq -0x8(%rbp), %rax
movl $0x1, 0xc4(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1e9d4
movq -0x8(%rbp), %rax
movl $0x5, 0xc4(%rax)
jmp 0x1e9e4
movq -0x8(%rbp), %rax
movl $0x5, 0xc4(%rax)
jmp 0x1e9e6
jmp 0x1e9e8
jmp 0x1e9ea
jmp 0x1e9ec
jmp 0x1e9ee
jmp 0x1e9f0
cmpl $0x0, -0x6c(%rbp)
je 0x1ea13
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
jg 0x1ea11
movq -0x8(%rbp), %rax
movl $0x5, 0xc4(%rax)
jmp 0x1ea62
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x1ea43
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
jne 0x1ea41
movq -0x8(%rbp), %rax
movl $0x1, 0xc4(%rax)
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x1ea60
movq -0x8(%rbp), %rax
cmpl $0x0, 0xc4(%rax)
jg 0x1ea5e
movq -0x8(%rbp), %rax
movl $0x5, 0xc4(%rax)
jmp 0x1ea60
jmp 0x1ea62
movq -0x8(%rbp), %rax
cmpq $0x0, 0x80(%rax)
je 0x1ea92
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rax
andq $0xfffffff, %rax        # imm = 0xFFFFFFF
cmpq $0x15b, %rax            # imm = 0x15B
je 0x1ea92
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
leaq 0x5dc17(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1eb6e
leaq 0x48429(%rip), %rdi     # 0x66ed7
callq 0x6860
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x8(%rbp), %rax
movl %eax, %edx
movq -0x18(%rbp), %rax
movl %eax, %ecx
leaq 0x493bc(%rip), %rdi     # 0x67e89
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movl 0x14(%rax), %esi
movq -0x8(%rbp), %rax
movl 0x18(%rax), %edx
leaq 0x493b8(%rip), %rdi     # 0x67ea1
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x80(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x88(%rax), %rdx
leaq 0x493a8(%rip), %rdi     # 0x67eb5
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x98(%rax), %rdx
leaq 0x49399(%rip), %rdi     # 0x67eca
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movq 0x70(%rax), %rsi
movq -0x8(%rbp), %rax
movq 0x78(%rax), %rdx
leaq 0x4938f(%rip), %rdi     # 0x67ede
movb $0x0, %al
callq 0x3110
movq -0x8(%rbp), %rax
movl 0xc4(%rax), %esi
leaq 0x49388(%rip), %rdi     # 0x67eef
movb $0x0, %al
callq 0x3110
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x1eb8a
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x1eb92
movq $0x0, -0x18(%rbp)
jmp 0x1e5e4
leaq 0x5db12(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1ebb2
movl $0x1, %edi
callq 0x1ef50
movl -0x70(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nop