// File: /workspace/github_c_makefile_star2_O3/samtools[P]htslib/test/../hts_time_funcs.h
// Function: hts_time_gm
static inline time_t hts_time_gm(struct tm *target)
{
    int month_start[2][12] = {
        { 0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334 },
        { 0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335 }
    };
    int years_from_epoch, leaps, days;
    int64_t secs;

    if (hts_time_normalise_tm(target) != 0)
        goto overflow;

    if (target->tm_year < 70)
        goto overflow;

    years_from_epoch = target->tm_year - 70;
    leaps = (hts_leaps_to_year_start(target->tm_year + 1900)
        - hts_leaps_to_year_start(1970));
    days = ((365 * (years_from_epoch - leaps) + 366 * leaps)
        + month_start[hts_year_is_leap(target->tm_year + 1900)][target->tm_mon]
        + target->tm_mday - 1);
    secs = ((int64_t) days * 86400LL
        + target->tm_hour * 3600
        + target->tm_min * 60
        + target->tm_sec);
    if (sizeof(time_t) < 8 && secs > INT_MAX)
        goto overflow;

    return (time_t) secs;

 overflow:
    errno = EOVERFLOW;
    return (time_t) -1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movabsq $-0x100000000, %rbx     # imm = 0xFFFFFFFF00000000
movl (%rdi), %r15d
cmpl $0x3e, %r15d
jle 0x1219
movl %r15d, %ecx
movl $0x88888889, %eax       # imm = 0x88888889
imulq %rcx, %rax
shrq $0x25, %rax
movslq 0x4(%rdi), %r9
leaq (%r9,%rax), %rcx
addq $-0x80000000, %rcx      # imm = 0x80000000
cmpq %rbx, %rcx
jae 0x121f
movl $0x1, %ecx
jmp 0x1231
movl 0x4(%rdi), %r9d
jmp 0x122f
addq %rax, %r9
movl %r9d, 0x4(%rdi)
imull $-0x3c, %eax, %eax
addl %eax, %r15d
movl %r15d, (%rdi)
xorl %ecx, %ecx
cmpl $0x3b, %r9d
ja 0x123f
movl 0x8(%rdi), %r10d
xorl %eax, %eax
jmp 0x129c
testl %r9d, %r9d
js 0x1256
movl %r9d, %edx
movl $0x88888889, %eax       # imm = 0x88888889
imulq %rdx, %rax
shrq $0x25, %rax
jmp 0x126a
movl %r9d, %edx
notl %edx
movl $0x88888889, %eax       # imm = 0x88888889
imulq %rdx, %rax
shrq $0x25, %rax
notl %eax
movslq 0x8(%rdi), %r10
cltq
leaq (%r10,%rax), %rdx
addq $-0x80000000, %rdx      # imm = 0x80000000
cmpq %rbx, %rdx
jae 0x1287
movl $0x1, %eax
jmp 0x129c
addq %rax, %r10
movl %r10d, 0x8(%rdi)
imull $-0x3c, %eax, %edx
addl %r9d, %edx
movl %edx, 0x4(%rdi)
xorl %eax, %eax
movl %edx, %r9d
orl %ecx, %eax
xorl %ecx, %ecx
cmpl $0x18, %r10d
jb 0x1301
testl %r10d, %r10d
js 0x12bd
movl %r10d, %esi
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rsi, %rdx
shrq $0x24, %rdx
jmp 0x12d1
movl %r10d, %esi
notl %esi
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rsi, %rdx
shrq $0x24, %rdx
notl %edx
movslq 0xc(%rdi), %r8
movslq %edx, %rdx
leaq (%r8,%rdx), %r11
addq $-0x80000000, %r11      # imm = 0x80000000
movl $0x1, %esi
cmpq %rbx, %r11
jb 0x1303
addq %rdx, %r8
movl %r8d, 0xc(%rdi)
shll $0x3, %edx
leal (%rdx,%rdx,2), %edx
subl %edx, %r10d
movl %r10d, 0x8(%rdi)
xorl %esi, %esi
orl %esi, %eax
movl 0x10(%rdi), %r14d
cmpl $0xc, %r14d
jb 0x136b
testl %r14d, %r14d
js 0x1326
movl %r14d, %esi
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rsi, %rdx
shrq $0x23, %rdx
jmp 0x133a
movl %r14d, %esi
notl %esi
movl $0xaaaaaaab, %edx       # imm = 0xAAAAAAAB
imulq %rsi, %rdx
shrq $0x23, %rdx
notl %edx
movslq 0x14(%rdi), %rsi
movslq %edx, %rdx
leaq (%rsi,%rdx), %r8
addq $-0x80000000, %r8       # imm = 0x80000000
cmpq %rbx, %r8
jae 0x1358
movl $0x1, %ecx
jmp 0x136b
addq %rdx, %rsi
movl %esi, 0x14(%rdi)
shll $0x2, %edx
leal (%rdx,%rdx,2), %edx
subl %edx, %r14d
movl %r14d, 0x10(%rdi)
orl %ecx, %eax
je 0x1390
callq 0x1030
movl $0x4b, (%rax)
movq $-0x1, %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r9, 0x20(%rsp)
movl 0xc(%rdi), %ebx
movl 0x14(%rdi), %eax
movq %rax, 0x10(%rsp)
cltq
movq %rax, 0x18(%rsp)
leaq 0x76c(%rax), %rcx
movabsq $-0x5c28f5c28f5c28f5, %r13 # imm = 0xA3D70A3D70A3D70B
movabsq $-0x70a3d70a3d70a3d7, %rbp # imm = 0x8F5C28F5C28F5C29
movabsq $0x51eb851eb851eb0, %r11 # imm = 0x51EB851EB851EB0
movabsq $0xa3d70a3d70a3d7, %r12 # imm = 0xA3D70A3D70A3D7
testl %ebx, %ebx
jg 0x1451
movl %r15d, 0xc(%rsp)
xorl %r8d, %r8d
cmpl $0x2, %r14d
setge %r8b
leaq 0xd4f(%rip), %r15       # 0x2140
leaq (%r8,%rcx), %rsi
decq %rsi
movq %rsi, %rax
imulq %r13
testb $0x3, %sil
jne 0x142d
leaq (%r8,%rcx), %rax
addq %rdx, %rax
decq %rax
movq %rax, %rdx
shrq $0x3f, %rdx
sarq $0x6, %rax
addq %rdx, %rax
imulq $0x64, %rax, %rdx
movq %rsi, %r9
movl $0x1, %eax
subq %rdx, %r9
jne 0x1440
imulq %rbp, %rsi
addq %r11, %rsi
rorq $0x4, %rsi
xorl %eax, %eax
cmpq %r12, %rsi
setb %al
decq %rcx
addl (%r15,%rax,4), %ebx
jle 0x13f1
movl %ebx, 0xc(%rdi)
movl 0xc(%rsp), %r15d
cmpl $0x16e, %ebx            # imm = 0x16E
jbe 0x14cc
movl %r15d, 0xc(%rsp)
xorl %r8d, %r8d
cmpl $0x2, %r14d
setge %r8b
leaq 0xcd0(%rip), %r15       # 0x2140
leaq (%r8,%rcx), %rsi
movq %rsi, %rax
imulq %r13
testb $0x3, %sil
jne 0x14a2
addq %rsi, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x6, %rdx
addq %rax, %rdx
imulq $0x64, %rdx, %rdx
movq %rsi, %r9
movl $0x1, %eax
subq %rdx, %r9
jne 0x14b5
imulq %rbp, %rsi
addq %r11, %rsi
rorq $0x4, %rsi
xorl %eax, %eax
cmpq %r12, %rsi
setb %al
subl (%r15,%rax,4), %ebx
incq %rcx
cmpl $0x16e, %ebx            # imm = 0x16E
jg 0x1470
movl %ebx, 0xc(%rdi)
movl 0xc(%rsp), %r15d
leaq 0xc0d(%rip), %rsi       # 0x20e0
xorl %r8d, %r8d
movq %rcx, %rax
imulq %r13
testb $0x3, %cl
jne 0x1503
addq %rcx, %rdx
movq %rdx, %rax
shrq $0x3f, %rax
sarq $0x6, %rdx
addq %rax, %rdx
imulq $0x64, %rdx, %rax
movq %rcx, %r9
movl $0x1, %edx
subq %rax, %r9
jne 0x1519
movq %rcx, %rax
imulq %rbp, %rax
addq %r11, %rax
rorq $0x4, %rax
xorl %edx, %edx
cmpq %r12, %rax
setb %dl
movslq %r14d, %rax
leaq (%rdx,%rdx,2), %r9
shll $0x4, %r9d
addq %rsi, %r9
movl %ebx, %edx
subl (%r9,%rax,4), %edx
jle 0x1551
movl %edx, 0xc(%rdi)
xorl %eax, %eax
cmpl $0xb, %r14d
leal 0x1(%r14), %r9d
setge %al
cmovgel %r8d, %r9d
addq %rax, %rcx
movl %r9d, 0x10(%rdi)
movl %edx, %ebx
movl %r9d, %r14d
jmp 0x14d6
leaq -0x76c(%rcx), %rdx
cmpq 0x18(%rsp), %rdx
movq 0x20(%rsp), %r9
je 0x1589
movabsq $-0x100000000, %rsi     # imm = 0xFFFFFFFF00000000
addq %rsi, %rcx
addq $0x7ffff894, %rcx       # imm = 0x7FFFF894
cmpq %rsi, %rcx
jb 0x136f
movl %edx, 0x14(%rdi)
movq %rdx, 0x10(%rsp)
movq 0x10(%rsp), %r8
cmpl $0x46, %r8d
jl 0x136f
leal 0x76c(%r8), %edx
leal 0x76b(%r8), %ecx
imulq $0x51eb851f, %rcx, %rsi # imm = 0x51EB851F
shrl $0x2, %ecx
movq %rsi, %rdi
shrq $0x25, %rdi
shrq $0x27, %rsi
subl %edi, %ecx
addl %esi, %ecx
addl $0xfffffe23, %ecx       # imm = 0xFFFFFE23
movl %r8d, %esi
subl %ecx, %esi
imull $0x16d, %esi, %esi      # imm = 0x16D
addl $0xffff9c32, %esi       # imm = 0xFFFF9C32
imull $0x16e, %ecx, %ecx      # imm = 0x16E
testb $0x3, %r8b
jne 0x1606
imulq $0x51eb851f, %rdx, %rdi # imm = 0x51EB851F
shrq $0x25, %rdi
imull $0x64, %edi, %edi
negl %edi
addl %edi, %r8d
addl $0x76c, %r8d            # imm = 0x76C
movl $0x1, %edi
testl %r8d, %r8d
jne 0x161b
imull $0xc28f5c29, %edx, %edx # imm = 0xC28F5C29
rorl $0x4, %edx
xorl %edi, %edi
cmpl $0xa3d70b, %edx         # imm = 0xA3D70B
setb %dil
leaq (%rdi,%rdi,2), %rdx
shll $0x4, %edx
leaq 0xa57(%rip), %rdi       # 0x2080
addq %rdx, %rdi
addl %esi, %ecx
addl (%rdi,%rax,4), %ecx
leal (%rbx,%rcx), %eax
decl %eax
cltq
imulq $0x15180, %rax, %rcx    # imm = 0x15180
imull $0xe10, %r10d, %eax     # imm = 0xE10
cltq
imull $0x3c, %r9d, %edx
movslq %edx, %rdx
addq %rax, %rdx
movslq %r15d, %rax
addq %rdx, %rax
addq %rcx, %rax
jmp 0x1381