// File: /workspace/github_c_makefile_star2_O3/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 0x1eccb(%rip), %xmm0    # 0x35ce0
movaps %xmm0, -0x50(%rbp)
movq (%rdx), %r12
leaq 0x1e2cd(%rip), %rax     # 0x352f0
cmpq %rax, 0x8(%r12)
je 0x17048
movl $0x1, %r13d
movq %rbx, %rdi
movq %r12, %rsi
movl $0x1, %edx
callq 0xd6c3
testl %eax, %eax
jne 0x171ca
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testb $0x1, %r15b
je 0x171ca
movq 0x18(%r12), %rax
cmpl $0x1, %r15d
jle 0x17124
movq %rax, -0x58(%rbp)
decl %r15d
xorl %r13d, %r13d
leaq 0x1ec78(%rip), %r12     # 0x35cf0
movl %r15d, -0x34(%rbp)
movq 0x8(%r14,%r13,8), %rsi
movq %rbx, %rdi
movq %r12, %rdx
leaq -0xc0(%rbp), %rcx
xorl %r8d, %r8d
movl $0x3, %r9d
callq 0x7eac
testl %eax, %eax
jne 0x171c4
movl -0xc0(%rbp), %eax
cmpl $0x1, %eax
je 0x170cd
testl %eax, %eax
jne 0x170fe
movq 0x10(%r14,%r13,8), %rsi
movq %rbx, %rdi
leaq -0x50(%rbp), %rdx
callq 0xe195
testl %eax, %eax
je 0x170fe
jmp 0x171c4
movq %rbx, %r15
movq %r12, %rbx
movq 0x10(%r14,%r13,8), %r12
movq (%r12), %rax
testq %rax, %rax
jne 0x170f0
movq 0x8(%r12), %rax
movq %r12, %rdi
callq *0x18(%rax)
movq (%r12), %rax
movq %rax, -0x48(%rbp)
movq %rbx, %r12
movq %r15, %rbx
movl -0x34(%rbp), %r15d
addq $0x2, %r13
cmpl %r13d, %r15d
jg 0x1707c
cmpl $0x0, -0x50(%rbp)
movq -0x58(%rbp), %rax
movq %rax, -0x30(%rbp)
je 0x17128
leaq -0x30(%rbp), %rdi
callq 0x6450
jmp 0x17131
movq %rax, -0x30(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x6060
testq %rax, %rax
je 0x1718e
movq -0x48(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
movl $0x64, %esi
movq %rax, %rcx
callq 0x63e0
testq %rax, %rax
je 0x1718e
leaq -0xc0(%rbp), %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
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 0x17186
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
xorl %r13d, %r13d
jmp 0x171ca
leaq 0x148c8(%rip), %rsi     # 0x2ba5d
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x7508
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 0x171c1
movq %rbx, %rdi
callq 0x758c
movq %r14, (%rbx)
movl $0x1, %r13d
movl %r13d, %eax
addq $0x98, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq