// File: /workspace/github_c_makefile_star2_O1/Keith-S-Thompson[P]kst-time-utils/clock_gettime.c
// Function: main
int main(int argc, char **argv) {
    bool ok = true;
    bool show_res = false;
    bool shown = false;

    for (int i = 1; i < argc; i ++) {
        if (strlen(argv[i]) == 2 && argv[i][0] == '-') {
            switch (argv[i][1]) {
                case 'R':
                    show_res = true;
                    break;
                case 'r':
                    ok = ok && show(CLOCK_REALTIME, show_res);
                    shown = true;
                    break;
#ifdef CLOCK_TAI
                case 'T':
                    ok = ok && show(CLOCK_TAI, show_res);
                    shown = true;
                    break;
#endif
                case 'm':
                    ok = ok && show(CLOCK_MONOTONIC, show_res);
                    shown = true;
                    break;
#ifdef CLOCK_MONOTONIC_RAW
                case 'M':
                    ok = ok && show(CLOCK_MONOTONIC_RAW, show_res);
                    shown = true;
                    break;
#endif
                case 'p':
                    ok = ok && show(CLOCK_PROCESS_CPUTIME_ID, show_res);
                    shown = true;
                    break;
                case 't':
                    ok = ok && show(CLOCK_THREAD_CPUTIME_ID, show_res);
                    shown = true;
                    break;
                default:
                    usage();
                    break;
            }
        }
        else {
            usage();
        }
    }

    if (!shown) {
        ok = ok && show(CLOCK_REALTIME, show_res);
    }

    exit(ok ? EXIT_SUCCESS : EXIT_FAILURE);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x2, %edi
jl 0x12b2
movq %rsi, %rbx
movl %edi, %r12d
movb $0x1, %bpl
movl $0x1, %r13d
xorl %r15d, %r15d
leaq 0x1ee(%rip), %rax       # 0x13ba
movq %rax, 0x10(%rsp)
movl $0x0, 0xc(%rsp)
movq (%rbx,%r13,8), %r14
movq %r14, %rdi
callq 0x1050
cmpq $0x2, %rax
jne 0x12da
cmpb $0x2d, (%r14)
jne 0x12da
movzbl 0x1(%r14), %eax
cmpl $0x6c, %eax
jle 0x1226
addl $-0x6d, %eax
cmpl $0x7, %eax
ja 0x12da
leaq 0xdee(%rip), %rcx       # 0x2004
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x1, %edi
jmp 0x125f
cmpl $0x4d, %eax
je 0x125a
cmpl $0x52, %eax
je 0x1252
cmpl $0x54, %eax
jne 0x12da
movl $0xb, %edi
jmp 0x125f
movl $0x3, %edi
jmp 0x125f
movl $0x2, %edi
jmp 0x125f
xorl %edi, %edi
jmp 0x125f
movb $0x1, %al
movl %eax, 0xc(%rsp)
jmp 0x128a
movl $0x4, %edi
testb $0x1, %bpl
je 0x1285
testb $0x1, 0xc(%rsp)
leaq 0x149(%rip), %rax       # 0x13ba
leaq 0xf9(%rip), %rcx        # 0x1371
cmovneq %rcx, %rax
callq *%rax
movl %eax, %ebp
movb $0x1, %r15b
jmp 0x128a
movb $0x1, %r15b
xorl %ebp, %ebp
incq %r13
cmpq %r13, %r12
jne 0x11d9
testb $0x1, 0xc(%rsp)
movq 0x10(%rsp), %rax
leaq 0xca(%rip), %rcx        # 0x1371
cmovneq %rcx, %rax
movq %rax, 0x10(%rsp)
jmp 0x12c4
leaq 0x101(%rip), %rax       # 0x13ba
movq %rax, 0x10(%rsp)
movb $0x1, %bpl
xorl %r15d, %r15d
testb $0x1, %r15b
jne 0x12e1
testb $0x1, %bpl
je 0x12df
xorl %edi, %edi
callq *0x10(%rsp)
movl %eax, %ebp
jmp 0x12e1
callq 0x12f1
xorl %ebp, %ebp
notb %bpl
andb $0x1, %bpl
movzbl %bpl, %edi
callq 0x1090