// File: /workspace/github_c_makefile_star2_O1/hfiguiere[P]exifprobe/ciff.c
// Function: canon_ct_to_datetime
unsigned long
canon_ct_to_datetime(FILE *inptr,unsigned short byteorder,char *tagname,unsigned long offset,
                                                unsigned long dirlength,int indent)
{
    unsigned long end_offset = 0UL;
    unsigned long count;
    unsigned long timezone;
    unsigned long zoneinfo;
    struct tm *ts_time;
    long timestamp;
    int chpr = 0;

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

    count = dirlength / sizeof(unsigned long);
    end_offset = offset + dirlength;
    print_tag_address(ENTRY,offset,indent+MEDIUMINDENT,"@");
    tagname = tagname ? tagname : QSTRING;
    if(PRINT_TAGNAME)
        chpr += printf("%s",tagname);
    if(PRINT_VALUE)
    {
        chpr += printf(" = ");
        print_ulong(inptr,count,byteorder,offset);
    }
    timestamp = read_ulong(inptr,byteorder,offset);
    timezone = read_ulong(inptr,byteorder,HERE);
    zoneinfo = read_ulong(inptr,byteorder,HERE);
    if(PRINT_VALUE)
    {
        ts_time = gmtime(&timestamp);
        chpr += printf(" = %02d:%02d:%02d %02d:%02d:%02d GMT",ts_time->tm_year+1900,ts_time->tm_mon+1,
                ts_time->tm_mday,ts_time->tm_hour,ts_time->tm_min,ts_time->tm_sec);
        if((zoneinfo & 0x80000000) && timezone)
            chpr += printf(" + %lu",timezone);
    }
    chpr = newline(chpr);

    return(end_offset);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %r9d, %r14d
movq %r8, %rbx
movq %rcx, %r12
movq %rdx, %r13
movl %esi, 0xc(%rsp)
movq %rdi, %r15
leaq 0x38794(%rip), %rax     # 0x58180
xorl %ebp, %ebp
testb $0x4, 0x2(%rax)
je 0x1fa0e
leaq 0x28d1e(%rip), %rdi     # 0x48719
movq %rbx, %rsi
xorl %eax, %eax
callq 0x3120
movl %eax, %edi
callq 0x16b56
movl %eax, %ebp
addl $0x4, %r14d
leaq 0x216c3(%rip), %rcx     # 0x410dc
movl $0x4003333, %edi        # imm = 0x4003333
movq %r12, %rsi
movl %r14d, %edx
callq 0x5605
leaq 0x38750(%rip), %rax     # 0x58180
testb $0x10, 0x1(%rax)
je 0x1fa54
testq %r13, %r13
leaq 0x25648(%rip), %rsi     # 0x45088
cmovneq %r13, %rsi
leaq 0x2164c(%rip), %rdi     # 0x41097
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
leaq 0x38725(%rip), %rax     # 0x58180
testb $0x30, (%rax)
movzwl 0xc(%rsp), %r13d
je 0x1fa93
movq %rbx, %r14
shrq $0x3, %r14
leaq 0x2aaf4(%rip), %rdi     # 0x4a568
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
movq %r15, %rdi
movq %r14, %rsi
movl %r13d, %edx
movq %r12, %r14
movq %r12, %rcx
callq 0x8272
jmp 0x1fa96
movq %r12, %r14
movq %r15, %rdi
movl %r13d, %esi
movq %r14, %rdx
callq 0x46cc
movq %rax, 0x10(%rsp)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x46cc
movq %rax, %r12
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %r15, %rdi
movl %r13d, %esi
callq 0x46cc
movq %rax, %r15
leaq 0x386aa(%rip), %rax     # 0x58180
testb $0x30, (%rax)
je 0x1fb38
leaq 0x10(%rsp), %rdi
callq 0x3230
movl $0x76c, %esi            # imm = 0x76C
addl 0x14(%rax), %esi
movl 0x10(%rax), %edx
incl %edx
movl 0xc(%rax), %ecx
movl 0x8(%rax), %r8d
movl (%rax), %edi
movl 0x4(%rax), %r9d
movl %edi, (%rsp)
leaq 0x28dc4(%rip), %rdi     # 0x488cd
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
testl %r15d, %r15d
sets %al
testq %r12, %r12
setne %cl
andb %al, %cl
cmpb $0x1, %cl
jne 0x1fb38
leaq 0x28dc6(%rip), %rdi     # 0x488f2
movq %r12, %rsi
xorl %eax, %eax
callq 0x3120
addl %eax, %ebp
addq %r14, %rbx
movl %ebp, %edi
callq 0x16b56
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq