// File: /workspace/github_c_makefile_star2_O3/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, %r14
movq %rax, %rdi
movl %r15d, %esi
movq %r12, %rdx
callq 0x125c
movl $0x1, %edi
movl $0x186, %esi            # imm = 0x186
callq 0x1090
movq %rax, %rbx
movq %rax, %rdi
callq 0x1070
cmpl $-0x1, %eax
je 0x16dd
cmpb $0x0, 0x1(%r14)
je 0x157e
movq 0x2a78(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x1080
cmpl $0x2, 0xc(%r14)
jl 0x158a
movl $0x20, %edi
callq 0x1040
jmp 0x158a
cmpl $0x1, %r15d
je 0x1559
cmpb $0x0, (%r14)
jne 0x1559
cmpb $0x0, 0x2(%r14)
jne 0x1597
cmpb $0x1, (%r14)
jne 0x15bb
leaq 0x41(%rbx), %rdi
movq 0x2a36(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%r14)
jl 0x15bb
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x3(%r14)
jne 0x15c8
cmpb $0x1, (%r14)
jne 0x15f1
leaq 0x82(%rbx), %rdi
movq 0x2a02(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
xorl %eax, %eax
callq 0x1060
cmpl $0x2, 0xc(%r14)
jl 0x15f1
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x4(%r14)
jne 0x15fe
cmpb $0x1, (%r14)
jne 0x1625
leaq 0xc3(%rbx), %rdi
movq 0x29cc(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%r14)
jl 0x1625
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x5(%r14)
jne 0x1632
cmpb $0x1, (%r14)
jne 0x165c
movq %rbx, %rdi
addq $0x104, %rdi            # imm = 0x104
movq 0x2995(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
cmpl $0x2, 0xc(%r14)
jl 0x165c
movl $0x20, %edi
callq 0x1040
cmpb $0x1, 0x7(%r14)
jne 0x1668
movb (%r14), %al
jmp 0x1676
movb (%r14), %al
cmpb $0x0, 0x6(%r14)
jne 0x1676
testb $0x1, %al
je 0x1699
testb %al, %al
jne 0x1699
leaq 0xa24(%rip), %rdi       # 0x20a5
xorl %eax, %eax
callq 0x1060
cmpl $0x2, 0xc(%r14)
jl 0x1699
movl $0x20, %edi
callq 0x1040
cmpb $0x0, 0x8(%r14)
jne 0x16a6
cmpb $0x1, (%r14)
jne 0x16b4
leaq 0xa00(%rip), %rdi       # 0x20ad
xorl %eax, %eax
callq 0x1060
movl $0xa, %edi
callq 0x1040
movq %r14, %rdi
callq 0x1030
xorl %r14d, %r14d
movq %rbx, %rdi
callq 0x1030
movl %r14d, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movq %r12, %rdi
movq %r14, %rsi
callq 0x111d
movl $0x1, %r14d
jmp 0x16c9