// File: /workspace/github_c_makefile_star2_O1/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
movl $0x1, %edi
movl $0x10, %esi
callq 0x1090
movq %rax, %rbx
movq %rax, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x124c
movl $0x1, %edi
movl $0x186, %esi            # imm = 0x186
callq 0x1090
movq %rax, %r14
movq %rax, %rdi
callq 0x1070
cmpl $-0x1, %eax
je 0x1632
cmpb $0x0, 0x1(%rbx)
je 0x14eb
movq 0x2b0a(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
movq %r14, %rdi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x14f6
movl $0x20, %edi
callq 0x1040
jmp 0x14f6
cmpl $0x1, %r15d
je 0x14c7
cmpb $0x0, (%rbx)
jne 0x14c7
cmpb $0x0, 0x2(%rbx)
jne 0x1501
cmpb $0x1, (%rbx)
jne 0x1524
leaq 0x41(%r14), %rdi
movq 0x2acc(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x1524
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x3(%rbx)
jne 0x152f
cmpb $0x1, (%rbx)
jne 0x1557
leaq 0x82(%r14), %rdi
movq 0x2a9b(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
xorl %eax, %eax
callq 0x1060
cmpl $0x2, 0xc(%rbx)
jl 0x1557
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x4(%rbx)
jne 0x1562
cmpb $0x1, (%rbx)
jne 0x1588
leaq 0xc3(%r14), %rdi
movq 0x2a68(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x1588
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x5(%rbx)
jne 0x1593
cmpb $0x1, (%rbx)
jne 0x15bc
movq %r14, %rdi
addq $0x104, %rdi            # imm = 0x104
movq 0x2a34(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%rbx)
jl 0x15bc
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x7(%rbx)
jne 0x15cd
cmpb $0x0, 0x6(%rbx)
jne 0x15cd
cmpb $0x1, (%rbx)
jne 0x15f0
cmpb $0x0, (%rbx)
jne 0x15f0
leaq 0xae7(%rip), %rdi       # 0x20c0
xorl %eax, %eax
callq 0x1060
cmpl $0x2, 0xc(%rbx)
jl 0x15f0
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x8(%rbx)
jne 0x15fb
cmpb $0x1, (%rbx)
jne 0x1609
leaq 0xac6(%rip), %rdi       # 0x20c8
xorl %eax, %eax
callq 0x1060
movl $0xa, %edi
callq 0x1040
xorl %r15d, %r15d
movq %rbx, %rdi
callq 0x1030
movq %r14, %rdi
callq 0x1030
movl %r15d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
callq 0x111d
movl $0x1, %r15d
jmp 0x1616