// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/print.c
// Function: print_user_comment
void
print_user_comment(FILE *inptr,unsigned long count,unsigned long offset,
                                                unsigned short byteorder)
{
    char *data;
    int i;
    int chpr = 0;

    /* The first 8 bytes identify the character code                  */

    if(PRINT_ENTRY)
    {
        if(PRINT_SECTION)
            chpr += printf("length %lu+8: (CC=",count - 8);
        if((offset != HERE) && (fseek(inptr,offset,SEEK_SET) == -1))
        {
            chpr += printf("seek failed to offset %lu to process user comment)",offset);
            chpr = newline(chpr);
        }
        else if((data = (char *)read_bytes(inptr,8UL,HERE)))
        {
            if(offset == HERE)
                offset = ftell(inptr);  /* need to return after check     */
            if((data[0] == 0) || (strncmp(data,"ASCII",5) == 0))
            {
                if(PRINT_SECTION)
                {
                    if(data[0] == 0)
                        chpr += printf("undefined");
                    else
                    {
                        for(i = 0; i < 8; ++i)
                        {
                            if(data[i] && isascii(data[i]))
                            {
                                (void)putchar(data[i]);
                                chpr++;
                            }
                        }
                    }
                    (void)putchar(')');
                    chpr++;
                    chpr += printf(" = ");
                }
                i = 8;
                if(PRINT_SECTION)
                {
                    /* check for all nulls                                   */
                    for( ; i < count; ++i)
                    {
                        if(fgetc(inptr) != '\0')
                            break;
                    }
                }
                if(i == count)
                    chpr += printf(" (%lu nulls)",count - 8);
                else
                {
                    /* check for all spaces                               */
                    if(fseek(inptr,offset + 8,SEEK_SET))
                    {
                        chpr += printf(" re-seek to comment offset %lu failed ",offset + 8);
                        chpr = newline(chpr);
                        why(stdout);
                    }
                    else
                    {
                        i = 8;
                        for( ; i < count; ++i)
                        {
                            if(fgetc(inptr) != ' ')
                                break;
                        }
                        if(i >= count)
                            chpr += printf("(%d spaces)",i - 8);
                        else
                        {
                            if(fseek(inptr,offset + i,SEEK_SET))
                            {
                                chpr += printf(" re-seek to comment offset %lu failed ",offset + 8);
                                why(stdout);
                            }
                            else
                            {
                                chpr++;
                                /* note that the above loop strips leading spaces */
                                if((i > 20) && (PRINT_SECTION))
                                    chpr += printf("(%d spaces)",i - 8);
                                print_ascii(inptr,count - i,offset + i);
                            }
                        }
                    }
                }
                if((LIST_MODE))
                {
                    chpr += printf(" # CC='");
                    if(data[0])
                    {
                        for(i = 0; i < 8; ++i)
                        {
                            if(data[i] && isascii(data[i]))
                            {
                                (void)putchar(data[i]);
                                chpr++;
                            }
                        }
                        putchar('\''); ++chpr;
                    }
                    else
                        chpr += printf("undefined'");
                }
            }
            else if(strncmp(data,"UNICODE",5) == 0)
            {
                if((PRINT_SECTION))
                {
                    for(i = 0; i < 8; ++i)
                    {
                        if(data[i] && isascii(data[i]))
                        {
                            (void)putchar(data[i]);
                            chpr++;
                        }
                    }
                }
                print_unicode(inptr,count - 8,HERE,byteorder);
                if((LIST_MODE))
                {
                    chpr += printf(" # CC='");
                    if(data[0])
                    {
                        for(i = 0; i < 8; ++i)
                        {
                            if(data[i] && isascii(data[i]))
                            {
                                (void)putchar(data[i]);
                                chpr++;
                            }
                        }
                        putchar('\''); ++chpr;
                    }
                    else
                        chpr += printf("undefined'");
                }
            }
            else
            {
                chpr = newline(chpr);
                hexdump(inptr,offset,count,count,16,0,SUBINDENT);
                chpr = newline(chpr);
            }
        }
        setcharsprinted(chpr);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movw %cx, %ax
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movw %ax, -0x1a(%rbp)
movl $0x0, -0x30(%rbp)
leaq 0x6ee67(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x4003333, %rax        # imm = 0x4003333
cmpq $0x0, %rax
je 0x88fe
leaq 0x6ee4d(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x835e
movq -0x10(%rbp), %rsi
subq $0x8, %rsi
leaq 0x5c4ed(%rip), %rdi     # 0x6483e
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x18(%rbp)
je 0x83a5
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x3200
cmpl $-0x1, %eax
jne 0x83a5
movq -0x18(%rbp), %rsi
leaq 0x5c4c9(%rip), %rdi     # 0x64851
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %edi
callq 0x1ef50
movl %eax, -0x30(%rbp)
jmp 0x88f6
movq -0x8(%rbp), %rdi
movl $0x8, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x47a0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
je 0x88f4
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x18(%rbp)
jne 0x83de
movq -0x8(%rbp), %rdi
callq 0x3180
movq %rax, -0x18(%rbp)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x8408
movq -0x28(%rbp), %rdi
leaq 0x5c48f(%rip), %rsi     # 0x64884
movl $0x5, %edx
callq 0x3080
cmpl $0x0, %eax
jne 0x874f
leaq 0x6ed71(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x84c6
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
jne 0x8444
leaq 0x631d6(%rip), %rdi     # 0x6b60b
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x849f
movl $0x0, -0x2c(%rbp)
cmpl $0x8, -0x2c(%rbp)
jge 0x849d
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x8490
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $-0x80, %eax
cmpl $0x0, %eax
jne 0x8490
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x3050
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x8492
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x844b
jmp 0x849f
movl $0x29, %edi
callq 0x3050
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
leaq 0x6485f(%rip), %rdi     # 0x6cd18
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl $0x8, -0x2c(%rbp)
leaq 0x6ecac(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x850e
jmp 0x84e5
movslq -0x2c(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x850c
movq -0x8(%rbp), %rdi
callq 0x3140
cmpl $0x0, %eax
je 0x84ff
jmp 0x850c
jmp 0x8501
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x84e5
jmp 0x850e
movslq -0x2c(%rbp), %rax
cmpq -0x10(%rbp), %rax
jne 0x8539
movq -0x10(%rbp), %rsi
subq $0x8, %rsi
leaq 0x5c363(%rip), %rdi     # 0x6488a
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x868f
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
xorl %edx, %edx
callq 0x3200
cmpl $0x0, %eax
je 0x858c
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
leaq 0x5c337(%rip), %rdi     # 0x64897
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movl -0x30(%rbp), %edi
callq 0x1ef50
movl %eax, -0x30(%rbp)
movq 0x6ea49(%rip), %rax     # 0x76fc8
movq (%rax), %rdi
callq 0x20840
jmp 0x868d
movl $0x8, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
cmpq -0x10(%rbp), %rax
jae 0x85ba
movq -0x8(%rbp), %rdi
callq 0x3140
cmpl $0x20, %eax
je 0x85ad
jmp 0x85ba
jmp 0x85af
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x8593
movslq -0x2c(%rbp), %rax
cmpq -0x10(%rbp), %rax
jb 0x85e3
movl -0x2c(%rbp), %esi
subl $0x8, %esi
leaq 0x5c2ed(%rip), %rdi     # 0x648be
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x868b
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movslq -0x2c(%rbp), %rax
addq %rax, %rsi
xorl %edx, %edx
callq 0x3200
cmpl $0x0, %eax
je 0x862b
movq -0x18(%rbp), %rsi
addq $0x8, %rsi
leaq 0x5c28a(%rip), %rdi     # 0x64897
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq 0x6e9a7(%rip), %rax     # 0x76fc8
movq (%rax), %rdi
callq 0x20840
jmp 0x8689
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
cmpl $0x14, -0x2c(%rbp)
jle 0x866a
leaq 0x6eb3f(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x866a
movl -0x2c(%rbp), %esi
subl $0x8, %esi
leaq 0x5c261(%rip), %rdi     # 0x648be
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x2c(%rbp), %rax
subq %rax, %rsi
movq -0x18(%rbp), %rdx
movslq -0x2c(%rbp), %rax
addq %rax, %rdx
callq 0x8e70
jmp 0x868b
jmp 0x868d
jmp 0x868f
leaq 0x6eaea(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1040000, %rax        # imm = 0x1040000
cmpq $0x0, %rax
jne 0x874a
leaq 0x5c21a(%rip), %rdi     # 0x648ca
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x8734
movl $0x0, -0x2c(%rbp)
cmpl $0x8, -0x2c(%rbp)
jge 0x871f
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x8712
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $-0x80, %eax
cmpl $0x0, %eax
jne 0x8712
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x3050
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x8714
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x86cd
movl $0x27, %edi
callq 0x3050
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x8748
leaq 0x5c197(%rip), %rdi     # 0x648d2
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x874a
jmp 0x88f2
movq -0x28(%rbp), %rdi
leaq 0x5bf13(%rip), %rsi     # 0x6466d
movl $0x5, %edx
callq 0x3080
cmpl $0x0, %eax
jne 0x88b5
leaq 0x6ea0c(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x87de
movl $0x0, -0x2c(%rbp)
cmpl $0x8, -0x2c(%rbp)
jge 0x87dc
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x87cf
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $-0x80, %eax
cmpl $0x0, %eax
jne 0x87cf
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x3050
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x87d1
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x878a
jmp 0x87de
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
subq $0x8, %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movzwl -0x1a(%rbp), %ecx
callq 0x8910
leaq 0x6e981(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1040000, %rax        # imm = 0x1040000
cmpq $0x0, %rax
jne 0x88b3
leaq 0x5c0b1(%rip), %rdi     # 0x648ca
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
movq -0x28(%rbp), %rax
cmpb $0x0, (%rax)
je 0x889d
movl $0x0, -0x2c(%rbp)
cmpl $0x8, -0x2c(%rbp)
jge 0x8888
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
je 0x887b
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
andl $-0x80, %eax
cmpl $0x0, %eax
jne 0x887b
movq -0x28(%rbp), %rax
movslq -0x2c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x3050
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x887d
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x8836
movl $0x27, %edi
callq 0x3050
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x88b1
leaq 0x5c02e(%rip), %rdi     # 0x648d2
movb $0x0, %al
callq 0x3110
addl -0x30(%rbp), %eax
movl %eax, -0x30(%rbp)
jmp 0x88b3
jmp 0x88f0
movl -0x30(%rbp), %edi
callq 0x1ef50
movl %eax, -0x30(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x10(%rbp), %rcx
movl $0x10, %r8d
xorl %r9d, %r9d
movl $0x2, (%rsp)
callq 0x8aa0
movl -0x30(%rbp), %edi
callq 0x1ef50
movl %eax, -0x30(%rbp)
jmp 0x88f2
jmp 0x88f4
jmp 0x88f6
movl -0x30(%rbp), %edi
callq 0x1ff00
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)