// File: /workspace/github_c_makefile_star2_O2/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
movq %rdi, %rbx
xorl %ebp, %ebp
cmpl $0x3f, (%rdi)
jl 0x11f1
leaq 0x4(%rbx), %rdi
pushq $0x3c
popq %rdx
movq %rbx, %rsi
callq 0x182e
movl %eax, %ebp
leaq 0x8(%rbx), %r14
leaq 0x4(%rbx), %rsi
pushq $0x3c
popq %rdx
movq %r14, %rdi
callq 0x182e
movl %eax, %r12d
orl %ebp, %r12d
leaq 0xc(%rbx), %r15
pushq $0x18
popq %rdx
movq %r15, %rdi
movq %r14, %rsi
callq 0x182e
movl %eax, %ebp
orl %r12d, %ebp
leaq 0x14(%rbx), %r12
leaq 0x10(%rbx), %r14
pushq $0xc
popq %rdx
movq %r12, %rdi
movq %r14, %rsi
callq 0x182e
orl %ebp, %eax
je 0x1258
callq 0x1030
movl $0x4b, (%rax)
pushq $-0x1
popq %rax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, (%rsp)
movq %rbx, 0x18(%rsp)
movl (%r12), %eax
movq %rax, 0x8(%rsp)
cltq
movq %rax, 0x20(%rsp)
leaq 0x76c(%rax), %r13
movl (%r15), %ebp
leaq 0xebe(%rip), %r14       # 0x2140
testl %ebp, %ebp
jg 0x12b0
leaq -0x1(%r13), %rbx
xorl %eax, %eax
movq (%rsp), %rcx
cmpl $0x2, (%rcx)
setge %al
leaq (%rax,%r13), %rdi
decq %rdi
callq 0x17fe
movl %eax, %eax
addl (%r14,%rax,4), %ebp
movl %ebp, (%r15)
movq %rbx, %r13
jmp 0x1282
movq %r12, 0x10(%rsp)
movq (%rsp), %rax
movl (%rax), %ebx
xorl %r12d, %r12d
cmpl $0x2, %ebx
setge %r12b
cmpl $0x16e, %ebp            # imm = 0x16E
jle 0x12e4
leaq (%r12,%r13), %rdi
callq 0x17fe
movl %eax, %eax
subl (%r14,%rax,4), %ebp
movl %ebp, (%r15)
incq %r13
jmp 0x12c5
movl %ebp, %r12d
movq %r13, %rdi
callq 0x17fe
movl %eax, %eax
movslq %ebx, %r14
imulq $0x30, %rax, %rax
leaq 0xde1(%rip), %rcx       # 0x20e0
addq %rcx, %rax
subl (%rax,%r14,4), %r12d
jle 0x132e
movl %r12d, (%r15)
xorl %eax, %eax
cmpl $0xb, %ebx
leal 0x1(%rbx), %ecx
setge %al
movl $0x0, %edx
cmovgel %edx, %ecx
addq %rax, %r13
movq (%rsp), %rax
movl %ecx, (%rax)
movl %r12d, %ebp
movl %ecx, %ebx
jmp 0x12e7
leaq -0x76c(%r13), %rax
cmpq 0x20(%rsp), %rax
je 0x1366
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq (%rcx,%r13), %rdx
addq $0x7ffff894, %rdx       # imm = 0x7FFFF894
cmpq %rcx, %rdx
movq 0x10(%rsp), %rcx
jb 0x123b
movl %eax, (%rcx)
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %r10
cmpl $0x46, %r10d
movq 0x18(%rsp), %r15
jl 0x123b
leal 0x76c(%r10), %edi
leal 0x76b(%r10), %ecx
movl %ecx, %r8d
shrl $0x2, %r8d
pushq $0x64
popq %rsi
movl %ecx, %eax
xorl %edx, %edx
divl %esi
movl %eax, %esi
movl $0x190, %r9d            # imm = 0x190
movl %ecx, %eax
xorl %edx, %edx
divl %r9d
subl %esi, %r8d
addl %r8d, %eax
addl $0xfffffe23, %eax       # imm = 0xFFFFFE23
subl %eax, %r10d
imull $0x16d, %r10d, %ecx     # imm = 0x16D
imull $0x16e, %eax, %ebx      # imm = 0x16E
addl %ecx, %ebx
callq 0x17fe
movl %eax, %eax
imulq $0x30, %rax, %rax
leaq 0xcaa(%rip), %rcx       # 0x2080
addq %rax, %rcx
addl (%rcx,%r14,4), %ebx
leal (%rbx,%rbp), %eax
addl $0xffff9c31, %eax       # imm = 0xFFFF9C31
cltq
imulq $0x15180, %rax, %rcx    # imm = 0x15180
movslq 0x8(%r15), %rax
imulq $0xe10, %rax, %rax      # imm = 0xE10
movslq 0x4(%r15), %rdx
imulq $0x3c, %rdx, %rdx
addq %rax, %rdx
movslq (%r15), %rax
addq %rdx, %rax
addq %rcx, %rax
jmp 0x1249