// File: /workspace/github_c_makefile_star2_O0/janet-lang[P]janet/src/core/os.c
// Function: time_to_tm
static struct tm *time_to_tm(const Janet *argv, int32_t argc, int32_t n, struct tm *t_infos) {
    time_t t;
    if (argc > n && !janet_checktype(argv[n], JANET_NIL)) {
        int64_t integer = janet_getinteger64(argv, n);
        t = (time_t) integer;
    } else {
        time(&t);
    }
    struct tm *t_info = NULL;
    if (argc > n + 1 && janet_truthy(argv[n + 1])) {
        /* local time */
#ifdef JANET_WINDOWS
        _tzset();
        localtime_s(t_infos, &t);
        t_info = t_infos;
#else
        tzset();
        t_info = localtime_r(&t, t_infos);
#endif
    } else {
        /* utc time */
#ifdef JANET_WINDOWS
        gmtime_s(t_infos, &t);
        t_info = t_infos;
#else
        t_info = gmtime_r(&t, t_infos);
#endif
    }
    return t_info;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq %rcx, -0x18(%rbp)
movl -0xc(%rbp), %eax
cmpl -0x10(%rbp), %eax
jle 0x4c4cb
xorl %eax, %eax
testb $0x1, %al
jne 0x4c456
jmp 0x4c48c
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x4c470
jmp 0x4c4cb
movq -0x8(%rbp), %rax
movslq -0x10(%rbp), %rcx
movq (%rax,%rcx,8), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x4c4cb
jmp 0x4c4b1
movq -0x8(%rbp), %rcx
movslq -0x10(%rbp), %rdx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx,%rdx,8), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
je 0x4c4cb
movq -0x8(%rbp), %rdi
movl -0x10(%rbp), %esi
callq 0x1c910
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x4c4d4
leaq -0x20(%rbp), %rdi
callq 0x126f0
movq $0x0, -0x30(%rbp)
movl -0xc(%rbp), %eax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
cmpl %ecx, %eax
jle 0x4c60f
xorl %eax, %eax
testb $0x1, %al
jne 0x4c4f5
jmp 0x4c53c
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x4c517
jmp 0x4c60f
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x4c60f
jmp 0x4c56a
movq -0x8(%rbp), %rcx
movl -0x10(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx,%rdx,8), %rax
movabsq $-0x7800000000000, %rcx # imm = 0xFFF8800000000000
cmpq %rcx, %rax
je 0x4c60f
xorl %eax, %eax
testb $0x1, %al
jne 0x4c572
jmp 0x4c5b2
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movsd (%rax,%rcx,8), %xmm0
ucomisd %xmm0, %xmm0
setp %al
testb $0x1, %al
jne 0x4c591
jmp 0x4c5dc
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
shrq $0x2f, %rax
andq $0xf, %rax
cmpq $0x0, %rax
je 0x4c5dc
jmp 0x4c5f7
movq -0x8(%rbp), %rcx
movl -0x10(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdx
movabsq $-0x800000000000, %rax  # imm = 0xFFFF800000000000
andq (%rcx,%rdx,8), %rax
movabsq $-0x7000000000000, %rcx # imm = 0xFFF9000000000000
cmpq %rcx, %rax
jne 0x4c5f7
movq -0x8(%rbp), %rax
movl -0x10(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0x4c60f
callq 0x126d0
movq -0x18(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x12170
movq %rax, -0x30(%rbp)
jmp 0x4c620
movq -0x18(%rbp), %rsi
leaq -0x20(%rbp), %rdi
callq 0x123d0
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)