// File: /workspace/github_c_makefile_star2_O0/hfiguiere[P]exifprobe/print.c
// Function: print_ascii
int
print_ascii(FILE *inptr,unsigned long count,unsigned long offset)
{
    int remaining;
    int nread;
    int ch,lastch;
    int chpr = 0;
    int indent = 0;

    remaining = count;
    nread = 0;
    if((offset != HERE) && (fseek(inptr,offset,SEEK_SET) == -1))
    {
        chpr += printf(" seek failed to offset %lu to print ascii",offset);
        chpr = newline(chpr);
    }
    else
    {
        indent = charsprinted();
        lastch = 'A';
        (void)putchar('\'');
        chpr++;
        while((remaining > 0) && !feof(inptr))
        {
            ch = fgetc(inptr);
            ++nread;
            --remaining;
            if(ch && isprint(ch))
            {
                if(isdigit(ch) && (lastch == '\0'))
                    chpr += printf("00");
                (void)putchar(ch);
                chpr++;
            }
            else if(ch == '\0')
            {
                if((PRINT_ASCII_IGNORE_LENGTH))
                {
                    /* read it but don't print any more               */
                    while((remaining-- > 0) && !feof(inptr))
                    {
                        ch = fgetc(inptr);
                        ++nread;
                    }
                    break;
                }
                chpr += printf("\\0");
            }
            else if((ch == '\n') && !(LIST_MODE))
            {
                chpr = newline(chpr);
                putindent(indent);
            }
            else if((ch == '\011') && !(LIST_MODE))
            {
                putchar(ch);
                ++ch;
            }
            else
                chpr += printf("\\%03o",(unsigned int)(ch & 0xff));
            lastch = ch;
        }
        (void)putchar('\'');
        chpr++;
        if(ferror(inptr))
            clearerr(inptr);
    }
    setcharsprinted(chpr);
    return(nread);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x2c(%rbp)
movl $0x0, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl %eax, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rax, -0x18(%rbp)
je 0x8ee7
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
xorl %edx, %edx
callq 0x3200
cmpl $-0x1, %eax
jne 0x8ee7
movq -0x18(%rbp), %rsi
leaq 0x5b915(%rip), %rdi     # 0x647df
movb $0x0, %al
callq 0x3110
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x2c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x2c(%rbp)
jmp 0x90fd
movb $0x0, %al
callq 0x20a00
movl %eax, -0x30(%rbp)
movl $0x41, -0x28(%rbp)
movl $0x27, %edi
callq 0x3050
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
xorl %eax, %eax
cmpl $0x0, -0x1c(%rbp)
movb %al, -0x31(%rbp)
jle 0x8f2a
movq -0x8(%rbp), %rdi
callq 0x3190
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x31(%rbp)
movb -0x31(%rbp), %al
testb $0x1, %al
jne 0x8f36
jmp 0x90d1
movq -0x8(%rbp), %rdi
callq 0x3140
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x8fbe
callq 0x32c0
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x8fbe
callq 0x32c0
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x8fa8
cmpl $0x0, -0x28(%rbp)
jne 0x8fa8
leaq 0x61fc7(%rip), %rdi     # 0x6af62
movb $0x0, %al
callq 0x3110
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %edi
callq 0x3050
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x90c6
cmpl $0x0, -0x24(%rbp)
jne 0x9043
leaq 0x6e1b5(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000000, %rax       # imm = 0x40000000
cmpq $0x0, %rax
je 0x902a
jmp 0x8fdc
movl -0x1c(%rbp), %ecx
movl %ecx, %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x32(%rbp)
jle 0x9005
movq -0x8(%rbp), %rdi
callq 0x3190
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
movb %al, -0x32(%rbp)
movb -0x32(%rbp), %al
testb $0x1, %al
jne 0x900e
jmp 0x9025
movq -0x8(%rbp), %rdi
callq 0x3140
movl %eax, -0x24(%rbp)
movl -0x20(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x8fdc
jmp 0x90d1
leaq 0x5b7d8(%rip), %rdi     # 0x64809
movb $0x0, %al
callq 0x3110
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x90c4
cmpl $0xa, -0x24(%rbp)
jne 0x9074
leaq 0x6e130(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1040000, %rax        # imm = 0x1040000
cmpq $0x0, %rax
je 0x9074
movl -0x2c(%rbp), %edi
callq 0x1ef50
movl %eax, -0x2c(%rbp)
movl -0x30(%rbp), %edi
callq 0x60e0
jmp 0x90c2
cmpl $0x9, -0x24(%rbp)
jne 0x90a3
leaq 0x6e0ff(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1040000, %rax        # imm = 0x1040000
cmpq $0x0, %rax
je 0x90a3
movl -0x24(%rbp), %edi
callq 0x3050
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x90c0
movl -0x24(%rbp), %esi
andl $0xff, %esi
leaq 0x5b759(%rip), %rdi     # 0x6480c
movb $0x0, %al
callq 0x3110
addl -0x2c(%rbp), %eax
movl %eax, -0x2c(%rbp)
jmp 0x90c2
jmp 0x90c4
jmp 0x90c6
movl -0x24(%rbp), %eax
movl %eax, -0x28(%rbp)
jmp 0x8f0b
movl $0x27, %edi
callq 0x3050
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x30a0
cmpl $0x0, %eax
je 0x90fb
movq -0x8(%rbp), %rdi
callq 0x31a0
jmp 0x90fd
movl -0x2c(%rbp), %edi
callq 0x1ff00
movl -0x20(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop