// File: /workspace/github_c_makefile_star2_O2/ikbenlike[P]nngutils/src/uname.c
// Function: main
int main(int argc, char **argv){
    struct uname_args *args = calloc(1, sizeof(struct uname_args));
    args = parse_arg(args, argc, argv);

    struct utsname *buf = calloc(1, sizeof(struct utsname));
    if(uname(buf) == -1){
        fprintf(stderr, "%s: %s\n", argv[0], strerror(errno));
        free(args);
        free(buf);
        return 1;
    }

    if(args->p_kname || args->p_all || argc == 1){
        fputs(buf->sysname, stdout);
        if(args->count > 1){
            putchar(' ');
        }
    }
    if(args->p_nname || args->p_all){
        fputs(buf->nodename, stdout);
        if(args->count > 1){
            putchar(' ');
        }
    }
    if(args->p_krelease || args->p_all){
        printf(buf->release, stdout);
        if(args->count > 1){
            putchar(' ');
        }
    }
    if(args->p_kversion || args->p_all){
        fputs(buf->version, stdout);
        if(args->count > 1){
            putchar(' ');
        }
    }
    if(args->p_machine || args->p_all){
        fputs(buf->machine, stdout);
        if(args->count > 1){
            putchar(' ');
        }
    }
    if(args->p_platform || args->p_processor || args->p_all){
        if(args->p_all == false){
            printf("unknown");
            if(args->count > 1){
                putchar(' ');
            }
        }
    }
    if(args->p_os || args->p_all){
        printf("GNU/Linux"); //just hardcoded for now
    }
    putchar('\n');
    free(args);
    free(buf);
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rsi, %r12
movl %edi, %r15d
pushq $0x1
popq %r14
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x1090
movq %rax, %rbx
movq %rax, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x11dc
movl $0x186, %esi            # imm = 0x186
movq %r14, %rdi
callq 0x1090
movq %rax, %r14
movq %rax, %rdi
callq 0x1070
cmpl $-0x1, %eax
je 0x164a
cmpb $0x0, 0x1(%rbx)
je 0x150d
movq 0x2ae6(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x1518
pushq $0x20
popq %rdi
callq 0x1040
jmp 0x1518
cmpl $0x1, %r15d
je 0x14eb
cmpb $0x0, (%rbx)
jne 0x14eb
cmpb $0x0, 0x2(%rbx)
jne 0x1523
cmpb $0x1, (%rbx)
jne 0x1544
leaq 0x41(%r14), %rdi
movq 0x2aaa(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x1544
pushq $0x20
popq %rdi
callq 0x1040
cmpb $0x0, 0x3(%rbx)
jne 0x154f
cmpb $0x1, (%rbx)
jne 0x1575
leaq 0x82(%r14), %rdi
movq 0x2a7b(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
xorl %eax, %eax
callq 0x1060
cmpl $0x2, 0xc(%rbx)
jl 0x1575
pushq $0x20
popq %rdi
callq 0x1040
cmpb $0x0, 0x4(%rbx)
jne 0x1580
cmpb $0x1, (%rbx)
jne 0x15a4
leaq 0xc3(%r14), %rdi
movq 0x2a4a(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x15a4
pushq $0x20
popq %rdi
callq 0x1040
cmpb $0x0, 0x5(%rbx)
jne 0x15af
cmpb $0x1, (%rbx)
jne 0x15d6
movq %r14, %rdi
addq $0x104, %rdi            # imm = 0x104
movq 0x2a18(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x15d6
pushq $0x20
popq %rdi
callq 0x1040
cmpb $0x1, 0x7(%rbx)
jne 0x15e0
movb (%rbx), %al
jmp 0x15ec
movb (%rbx), %al
cmpb $0x0, 0x6(%rbx)
jne 0x15ec
testb $0x1, %al
je 0x160c
testb %al, %al
jne 0x160c
leaq 0xaae(%rip), %rdi       # 0x20a5
xorl %eax, %eax
callq 0x1060
cmpl $0x2, 0xc(%rbx)
jl 0x160c
pushq $0x20
popq %rdi
callq 0x1040
cmpb $0x0, 0x8(%rbx)
jne 0x1617
cmpb $0x1, (%rbx)
jne 0x1625
leaq 0xa8f(%rip), %rdi       # 0x20ad
xorl %eax, %eax
callq 0x1060
pushq $0xa
popq %rdi
callq 0x1040
movq %rbx, %rdi
callq 0x1030
xorl %ebx, %ebx
movq %r14, %rdi
callq 0x1030
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq 0x29a7(%rip), %rax      # 0x3ff8
movq (%rax), %r15
movq (%r12), %r12
callq 0x1050
movl (%rax), %edi
callq 0x10d0
leaq 0xa32(%rip), %rsi       # 0x209d
movq %r15, %rdi
movq %r12, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x10b0
movq %rbx, %rdi
callq 0x1030
pushq $0x1
popq %rbx
jmp 0x1637