// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x80, %rsp
movw %si, %ax
movq %rdi, -0x8(%rbp)
movw %ax, -0xa(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq $0x0, -0x38(%rbp)
movl $0x0, -0x64(%rbp)
leaq 0x49734(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x40000, %rax          # imm = 0x40000
cmpq $0x0, %rax
je 0x2da7e
movq -0x28(%rbp), %rsi
leaq 0x3d252(%rip), %rdi     # 0x6acb8
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movl -0x64(%rbp), %edi
callq 0x1ef50
movl %eax, -0x64(%rbp)
movq -0x28(%rbp), %rax
shrq $0x3, %rax
movq %rax, -0x40(%rbp)
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rsi
movl -0x2c(%rbp), %edx
addl $0x4, %edx
movl $0x4003333, %edi        # imm = 0x4003333
leaq 0x36630(%rip), %rcx     # 0x640dc
callq 0x5ed0
cmpq $0x0, -0x18(%rbp)
je 0x2dac2
movq -0x18(%rbp), %rax
movq %rax, -0x70(%rbp)
jmp 0x2dacf
leaq 0x39c91(%rip), %rax     # 0x6775a
movq %rax, -0x70(%rbp)
jmp 0x2dacf
movq -0x70(%rbp), %rax
movq %rax, -0x18(%rbp)
leaq 0x496a2(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x1000, %rax           # imm = 0x1000
cmpq $0x0, %rax
je 0x2db05
movq -0x18(%rbp), %rsi
leaq 0x3659f(%rip), %rdi     # 0x64097
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
leaq 0x49674(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x2db45
leaq 0x3f1f8(%rip), %rdi     # 0x6cd18
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movq -0x8(%rbp), %rdi
movq -0x40(%rbp), %rsi
movw -0xa(%rbp), %ax
movq -0x20(%rbp), %rcx
movzwl %ax, %edx
callq 0x9df0
movq -0x8(%rbp), %rdi
movw -0xa(%rbp), %ax
movq -0x20(%rbp), %rdx
movzwl %ax, %esi
callq 0x4610
movq %rax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movzwl -0xa(%rbp), %esi
callq 0x4610
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movzwl -0xa(%rbp), %esi
callq 0x4610
movq %rax, -0x50(%rbp)
leaq 0x495f0(%rip), %rax     # 0x77180
movq (%rax), %rax
andq $0x30, %rax
cmpq $0x0, %rax
je 0x2dc2e
leaq -0x60(%rbp), %rdi
callq 0x3220
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl 0x14(%rax), %esi
addl $0x76c, %esi            # imm = 0x76C
movq -0x58(%rbp), %rax
movl 0x10(%rax), %edx
addl $0x1, %edx
movq -0x58(%rbp), %rax
movl 0xc(%rax), %ecx
movq -0x58(%rbp), %rax
movl 0x8(%rax), %r8d
movq -0x58(%rbp), %rax
movl 0x4(%rax), %r9d
movq -0x58(%rbp), %rax
movl (%rax), %eax
leaq 0x3d28f(%rip), %rdi     # 0x6ae78
movl %eax, (%rsp)
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
movabsq $0x80000000, %rax       # imm = 0x80000000
andq -0x50(%rbp), %rax
cmpq $0x0, %rax
je 0x2dc2c
cmpq $0x0, -0x48(%rbp)
je 0x2dc2c
movq -0x48(%rbp), %rsi
leaq 0x3d27e(%rip), %rdi     # 0x6ae9d
movb $0x0, %al
callq 0x3110
addl -0x64(%rbp), %eax
movl %eax, -0x64(%rbp)
jmp 0x2dc2e
movl -0x64(%rbp), %edi
callq 0x1ef50
movl %eax, -0x64(%rbp)
movq -0x38(%rbp), %rax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)