// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/process.c
// Function: new_summary_entry
struct image_summary *
new_summary_entry(struct image_summary *prev_entry,int fileformat,int datatype)
{
    struct image_summary *new = NULL;
    int chpr = 0;

    /* Make entries only for types which describe image data, i.e.    */
    /* not EXIF, Interop, etc.                                        */
    switch(datatype)
    {
        case EXIF_IFD:
        case INTEROP_IFD:
        case GPS_IFD:
            break;
        default:
            if(Debug & SCAN_DEBUG)
            {
                chpr = newline(1);
                printred("DEBUG: NEW SUMMARY ");
            }
            new = (struct image_summary *)malloc(sizeof(struct image_summary));
            if(new)
            {
                if(Debug & SCAN_DEBUG)
                    printf("%#lx\n",(unsigned long)new);
                memset(new,0,sizeof(struct image_summary));
                new->datatype = datatype;
                new->ifdnum = -1;
                new->subifdnum = -1;
                new->length = 0;
                new->offset = 0;
                new->subfiletype = -1;
                memset(new->filesubformatAPPN,0,16);
                if(prev_entry)
                {
                    if(Debug & SCAN_DEBUG)
                    {
                        printred("DEBUG: PREV ENTRY ");
                        chpr += printf("%#x, next=%#x, offset=%ld, lock=%d",
                                        (unsigned int)prev_entry,
                                        (unsigned int)prev_entry->next_entry,
                                        prev_entry->offset,prev_entry->entry_lock);
                        chpr = newline(chpr);
                    }
                    /* make sure to attach at the end of the chain        */
                    while(prev_entry->next_entry)
                    {
                        prev_entry = prev_entry->next_entry;
                        if(Debug & SCAN_DEBUG)
                        {
                            printred(" PREV ENTRY ");
                            chpr += printf("%#x, next=%#x, offset=%ld, lock=%d",
                                            (unsigned int)prev_entry,
                                            (unsigned int)prev_entry->next_entry,
                                            prev_entry->offset,prev_entry->entry_lock);
                            chpr = newline(chpr);
                        }
                    }
                    new->prev_entry = prev_entry;
                    if(Debug & SCAN_DEBUG)
                    {
                        printred("DEBUG: FOUND PREV ENTRY ");
                        chpr += printf("%#x, next=%#x, offset=%ld, lock=%d",
                                            (unsigned int)prev_entry,
                                            (unsigned int)prev_entry->next_entry,
                                            prev_entry->offset,prev_entry->entry_lock);
                        chpr = newline(chpr);
                    }
                    if(prev_entry->fileformat)
                        new->fileformat = prev_entry->fileformat;
                    prev_entry->next_entry = new;
                    if(Debug & SCAN_DEBUG)
                    {
                        printred("DEBUG: NEW ENTRY ");
                        chpr += printf(" next=%#x, prev offset=%d, prev lock=%d",
                                            (unsigned int)prev_entry->next_entry,
                                            (unsigned int)prev_entry->offset,prev_entry->entry_lock);
                        chpr = newline(chpr);
                    }
                }
                else
                    new->fileformat = fileformat;
            }
            else
            {
                printred("Memory allocation for image summary failed");
                if(prev_entry)
                    chpr += printf(" summary will be incomplete");
                else
                    chpr += printf(" no summary will be printed");
                newline(chpr);
            }
            if(Debug & SCAN_DEBUG)
                chpr = newline(1);
            break;
    }
    return(new);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x10(%rbp), %eax
addl $-0x2, %eax
subl $0x2, %eax
ja 0x15453
jmp 0x1544e
jmp 0x15771
leaq 0x67256(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1547d
movl $0x1, %edi
callq 0x1ef50
movl %eax, -0x1c(%rbp)
leaq 0x51c36(%rip), %rdi     # 0x670ae
callq 0x6860
movl $0x128, %edi            # imm = 0x128
callq 0x31d0
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x1570c
leaq 0x67213(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x154b9
movq -0x18(%rbp), %rsi
leaq 0x51c10(%rip), %rdi     # 0x670c2
movb $0x0, %al
callq 0x3110
movq -0x18(%rbp), %rdi
xorl %esi, %esi
movl $0x128, %edx            # imm = 0x128
callq 0x3130
movl -0x10(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x118(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x11c(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movl $0xffffffff, 0x120(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rax
movq $0x0, 0x98(%rax)
movq -0x18(%rbp), %rax
movq $0x0, 0x90(%rax)
movq -0x18(%rbp), %rax
movl $0xffffffff, 0xc4(%rax) # imm = 0xFFFFFFFF
movq -0x18(%rbp), %rdi
addq $0x1c, %rdi
xorl %esi, %esi
movl $0x10, %edx
callq 0x3130
cmpq $0x0, -0x8(%rbp)
je 0x15700
leaq 0x6716c(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1559c
leaq 0x51b73(%rip), %rdi     # 0x670c8
callq 0x6860
movq -0x8(%rbp), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %r8d
leaq 0x51b57(%rip), %rdi     # 0x670db
movb $0x0, %al
callq 0x3110
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x1c(%rbp)
jmp 0x1559e
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x15616
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x8(%rbp)
leaq 0x670f4(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x15614
leaq 0x51b01(%rip), %rdi     # 0x670ce
callq 0x6860
movq -0x8(%rbp), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %r8d
leaq 0x51adf(%rip), %rdi     # 0x670db
movb $0x0, %al
callq 0x3110
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x1c(%rbp)
jmp 0x1559e
movq -0x8(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
leaq 0x67088(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x15680
leaq 0x51ac5(%rip), %rdi     # 0x670fe
callq 0x6860
movq -0x8(%rbp), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rcx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %r8d
leaq 0x51a73(%rip), %rdi     # 0x670db
movb $0x0, %al
callq 0x3110
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x0, 0x14(%rax)
je 0x15698
movq -0x8(%rbp), %rax
movl 0x14(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq 0x67005(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x156fe
leaq 0x51a5b(%rip), %rdi     # 0x67117
callq 0x6860
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movl %eax, %edx
movq -0x8(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x51a43(%rip), %rdi     # 0x67129
movb $0x0, %al
callq 0x3110
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x1c(%rbp)
jmp 0x1570a
movl -0xc(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x14(%rax)
jmp 0x15751
leaq 0x51a3e(%rip), %rdi     # 0x67151
callq 0x6860
cmpq $0x0, -0x8(%rbp)
je 0x15735
leaq 0x51a56(%rip), %rdi     # 0x6717c
movb $0x0, %al
callq 0x3110
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
jmp 0x15749
leaq 0x51a5c(%rip), %rdi     # 0x67198
movb $0x0, %al
callq 0x3110
addl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %edi
callq 0x1ef50
leaq 0x66f58(%rip), %rax     # 0x7c6b0
movl (%rax), %eax
andl $0x4, %eax
cmpl $0x0, %eax
je 0x1576f
movl $0x1, %edi
callq 0x1ef50
movl %eax, -0x1c(%rbp)
jmp 0x15771
movq -0x18(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)