// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/maker_canon.c
// Function: canon_imageinfo
unsigned long
canon_imageinfo(FILE *inptr,unsigned short byteorder,char *tagprefix,
                            unsigned long offset,unsigned long dirlength,int indent,
                            struct image_summary *summary_entry)
{
    unsigned long count,value;
    unsigned long end_offset;
    float fvalue;
    int i;
    int chpr = 0;

    if(PRINT_SECTION)
    {
        chpr += printf(" length %lu",dirlength);
        chpr = newline(chpr);
    }

    /* NOTE that imageinfo is not treated as a directory; there is no */
    /* 2-byte count at the beginning.                                 */

    end_offset = offset + dirlength;
    count = (dirlength / sizeof(unsigned long));

    /* Must always do the processing, in order to pick up the image   */
    /* width and height for the summary, even if nothing is to be     */
    /* printed                                                        */
    for(i = 0; i < count; ++i)
    {
        value = read_ulong(inptr,byteorder,offset);
        print_tag_address(ENTRY,offset,indent + MEDIUMINDENT,"@");
        if((PRINT_ENTRY))
        {
            if((PRINT_TAGINFO))
                chpr += printf("%s",tagprefix);
        }
        offset += 4;
        switch(i)
        {
            case 0:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ImageWidth");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                if(summary_entry)
                    summary_entry->pixel_width = value;
                break;
            case 1:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ImageHeight");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                if(summary_entry)
                    summary_entry->pixel_height = value;
                break;
            case 2:
                fvalue = to_float(value);
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"PixelAspectRatio");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 3:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"Rotation");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 4:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ComponentBitDepth");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 5:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ColorBitDepth");
                if((PRINT_VALUE))
                    chpr += printf(" = %lu",value);
                break;
            case 6:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"ColorBW");
                if((PRINT_VALUE))
                {
                    chpr += printf(" = %#lx/%lu",value,value);
                    if((value & 0xff) == 1)
                         chpr += printf(" = color");
                    else
                         chpr += printf(" = greyscale");
                    if(((value & 0xff00) >> 8) == 1)
                         chpr += printf(" = \'pixel ratio postproc reqd\'");
                }
                break;
            default:
                if((PRINT_TAGINFO))
                     chpr += printf(".%02d_%-22.22s",i,"Undefined");
                if((PRINT_VALUE))
                    chpr += printf(" = %#lx/%lu",value,value);
                break;
        }
        chpr = newline(chpr);
    }
    setcharsprinted(chpr);
    return(end_offset);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movw %si, %ax
movq 0x10(%rbp), %rsi
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl $0x0, -0x54(%rbp)
leaq 0x1bf4b(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x5b267
movq -0x28(%rbp), %rsi
leaq 0xfa6a(%rip), %rdi      # 0x6acb9
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
shrq $0x3, %rax
movq %rax, -0x38(%rbp)
movl $0x0, -0x50(%rbp)
movslq -0x50(%rbp), %rax
cmpq -0x38(%rbp), %rax
jae 0x5b71d
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %ax
movq -0x20(%rbp), %rdx
movzwl %ax, %esi
callq 0x4610
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %edx
addl $0x4, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x8e1a(%rip), %rcx      # 0x640dc
callq 0x5ed0
leaq 0x1beb2(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4003333, %rax        # imm = 0x4003333
cmpq $0x0, %rax
je 0x5b30d
leaq 0x1be9c(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b30b
movq -0x18(%rbp), %rsi
leaq 0x8d99(%rip), %rdi      # 0x64097
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b30d
movq -0x20(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x20(%rbp)
movl -0x50(%rbp), %eax
movq %rax, -0x60(%rbp)
subq $0x6, %rax
ja 0x5b69e
movq -0x60(%rbp), %rax
leaq 0x1410b(%rip), %rcx     # 0x6f440
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x1be3b(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b372
movl -0x50(%rbp), %esi
leaq 0x15305(%rip), %rdi     # 0x70663
leaq 0x152bd(%rip), %rdx     # 0x70622
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1be07(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b39e
movq -0x40(%rbp), %rsi
leaq 0x8d3a(%rip), %rdi      # 0x640cb
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x5b3b1
movq -0x40(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x70(%rax)
jmp 0x5b704
leaq 0x1bdc3(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b3ea
movl -0x50(%rbp), %esi
leaq 0x1528d(%rip), %rdi     # 0x70663
leaq 0x15257(%rip), %rdx     # 0x70634
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1bd8f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b416
movq -0x40(%rbp), %rsi
leaq 0x8cc2(%rip), %rdi      # 0x640cb
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
cmpq $0x0, 0x10(%rbp)
je 0x5b429
movq -0x40(%rbp), %rcx
movq 0x10(%rbp), %rax
movq %rcx, 0x78(%rax)
jmp 0x5b704
movq -0x40(%rbp), %rdi
callq 0x5100
movss %xmm0, -0x4c(%rbp)
leaq 0x1bd3d(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b470
movl -0x50(%rbp), %esi
leaq 0x15207(%rip), %rdi     # 0x70663
leaq 0x1537e(%rip), %rdx     # 0x707e1
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1bd09(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b49c
movq -0x40(%rbp), %rsi
leaq 0x8c3c(%rip), %rdi      # 0x640cb
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b704
leaq 0x1bcd8(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b4d5
movl -0x50(%rbp), %esi
leaq 0x151a2(%rip), %rdi     # 0x70663
leaq 0x10cbe(%rip), %rdx     # 0x6c186
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1bca4(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b501
movq -0x40(%rbp), %rsi
leaq 0x8bd7(%rip), %rdi      # 0x640cb
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b704
leaq 0x1bc73(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b53a
movl -0x50(%rbp), %esi
leaq 0x1513d(%rip), %rdi     # 0x70663
leaq 0x152c5(%rip), %rdx     # 0x707f2
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1bc3f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b566
movq -0x40(%rbp), %rsi
leaq 0x8b72(%rip), %rdi      # 0x640cb
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b704
leaq 0x1bc0e(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b59f
movl -0x50(%rbp), %esi
leaq 0x150d8(%rip), %rdi     # 0x70663
leaq 0x15272(%rip), %rdx     # 0x70804
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1bbda(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b5cb
movq -0x40(%rbp), %rsi
leaq 0x8b0d(%rip), %rdi      # 0x640cb
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b704
leaq 0x1bba9(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b604
movl -0x50(%rbp), %esi
leaq 0x15073(%rip), %rdi     # 0x70663
leaq 0x1521b(%rip), %rdx     # 0x70812
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1bb75(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b69c
movq -0x40(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq 0x8abe(%rip), %rdi      # 0x640e9
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rax
andq $0xff, %rax
cmpq $0x1, %rax
jne 0x5b65e
leaq 0x151cb(%rip), %rdi     # 0x7081a
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b672
leaq 0xff96(%rip), %rdi      # 0x6b5fb
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
movq -0x40(%rbp), %rax
andq $0xff00, %rax           # imm = 0xFF00
shrq $0x8, %rax
cmpq $0x1, %rax
jne 0x5b69a
leaq 0x15196(%rip), %rdi     # 0x70823
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b69c
jmp 0x5b704
leaq 0x1badb(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x3003, %rax           # imm = 0x3003
cmpq $0x0, %rax
je 0x5b6d2
movl -0x50(%rbp), %esi
leaq 0x14fa5(%rip), %rdi     # 0x70663
leaq 0xf86c(%rip), %rdx      # 0x6af31
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
leaq 0x1baa7(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x5b702
movq -0x40(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq 0x89f4(%rip), %rdi      # 0x640e9
movb $0x0, %al
callq 0x3110
addl -0x54(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0x5b704
movl -0x54(%rbp), %edi
callq 0x1ef50
movl %eax, -0x54(%rbp)
movl -0x50(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x50(%rbp)
jmp 0x5b286
movl -0x54(%rbp), %edi
callq 0x1ff00
movq -0x48(%rbp), %rax
addq $0x60, %rsp
popq %rbp
retq
nop