// File: /workspace/github_c_makefile_star2_O1/msteveb[P]autosetup/./jimsh0.c
// Function: clock_cmd_format
static int clock_cmd_format(Jim_Interp *interp, int argc, Jim_Obj *const *argv)
{

    char buf[100];
    time_t t;
    jim_wide seconds;
    struct clock_options options = { 0, "%a %b %d %H:%M:%S %Z %Y" };
    struct tm *tm;

    if (Jim_GetWide(interp, argv[0], &seconds) != JIM_OK) {
        return JIM_ERR;
    }
    if (argc % 2 == 0) {
        return -1;
    }
    if (parse_clock_options(interp, argc - 1, argv + 1, &options) == JIM_ERR) {
        return JIM_ERR;
    }

    t = seconds;
    tm = options.gmt ? gmtime(&t) : localtime(&t);

    if (tm == NULL || strftime(buf, sizeof(buf), options.format, tm) == 0) {
        Jim_SetResultString(interp, "format string too long or invalid time", -1);
        return JIM_ERR;
    }

    Jim_SetResultString(interp, buf, -1);

    return JIM_OK;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x98, %rsp
movq %rdx, %r14
movl %esi, %r15d
movq %rdi, %rbx
movups 0x1f7b6(%rip), %xmm0    # 0x36ce0
movaps %xmm0, -0x50(%rbp)
movq (%rdx), %r12
leaq 0x1eda8(%rip), %rax     # 0x362e0
cmpq %rax, 0x8(%r12)
je 0x17557
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0xd6d7
testl %eax, %eax
je 0x17557
xorl %ecx, %ecx
jmp 0x1755e
movq 0x18(%r12), %rdx
movb $0x1, %cl
movl $0x1, %eax
testb %cl, %cl
je 0x176df
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x1, %r15b
je 0x176df
movq %rdx, -0x58(%rbp)
cmpl $0x2, %r15d
jl 0x17626
decl %r15d
xorl %r13d, %r13d
leaq 0x1f75b(%rip), %r12     # 0x36cf0
movl %r15d, -0x2c(%rbp)
movq 0x8(%r14,%r13,8), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0xc0(%rbp), %rcx
xorl %r8d, %r8d
movl $0x3, %r9d
callq 0x7e97
testl %eax, %eax
jne 0x176da
movl -0xc0(%rbp), %eax
cmpl $0x1, %eax
je 0x175ea
testl %eax, %eax
jne 0x17619
movq 0x10(%r14,%r13,8), %rsi
movq %rbx, %rdi
leaq -0x50(%rbp), %rdx
callq 0xe1bf
testl %eax, %eax
je 0x17619
jmp 0x176da
movq %rbx, %r15
movq %r12, %rbx
movq 0x10(%r14,%r13,8), %r12
cmpq $0x0, (%r12)
jne 0x17607
movq 0x8(%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq (%r12), %rax
movq %rax, -0x48(%rbp)
movq %rbx, %r12
movq %r15, %rbx
movl -0x2c(%rbp), %r15d
addq $0x2, %r13
cmpl %r13d, %r15d
jg 0x17599
movq -0x58(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0x50(%rbp)
je 0x1763f
leaq -0x38(%rbp), %rdi
callq 0x6450
jmp 0x17648
leaq -0x38(%rbp), %rdi
callq 0x6060
testq %rax, %rax
je 0x176a4
movq -0x48(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
movl $0x64, %esi
movq %rax, %rcx
callq 0x63e0
testq %rax, %rax
je 0x176a4
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x1769d
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
xorl %eax, %eax
jmp 0x176df
leaq 0x15410(%rip), %rsi     # 0x2cabb
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7516
movq %rax, %r14
incl 0x10(%rax)
movq (%rbx), %rsi
movl 0x10(%rsi), %eax
leal -0x1(%rax), %ecx
movl %ecx, 0x10(%rsi)
cmpl $0x1, %eax
jg 0x176d7
movq %rbx, %rdi
callq 0x759a
movq %r14, (%rbx)
movl $0x1, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq