// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x1, %edi
movl $0x10, %esi
callq 0x1090
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
callq 0x11e0
movq %rax, -0x18(%rbp)
movl $0x1, %edi
movl $0x186, %esi            # imm = 0x186
callq 0x1090
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x1070
cmpl $-0x1, %eax
jne 0x162a
movq 0x2a23(%rip), %rax      # 0x3ff8
movq (%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
callq 0x1050
movl (%rax), %edi
callq 0x10d0
movq -0x30(%rbp), %rdi
movq -0x28(%rbp), %rdx
movq %rax, %rcx
leaq 0xab3(%rip), %rsi       # 0x20b8
movb $0x0, %al
callq 0x10b0
movq -0x18(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0x1, -0x4(%rbp)
jmp 0x180e
movq -0x18(%rbp), %rax
testb $0x1, 0x1(%rax)
jne 0x1643
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
jne 0x1643
cmpl $0x1, -0x8(%rbp)
jne 0x166c
movq -0x20(%rbp), %rdi
movq 0x298a(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x166a
movl $0x20, %edi
callq 0x1040
jmp 0x166c
movq -0x18(%rbp), %rax
testb $0x1, 0x2(%rax)
jne 0x167f
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x16ac
movq -0x20(%rbp), %rdi
addq $0x41, %rdi
movq 0x294a(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x16aa
movl $0x20, %edi
callq 0x1040
jmp 0x16ac
movq -0x18(%rbp), %rax
testb $0x1, 0x3(%rax)
jne 0x16bf
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x16f1
movq -0x20(%rbp), %rdi
addq $0x82, %rdi
movq 0x2907(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
movb $0x0, %al
callq 0x1060
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x16ef
movl $0x20, %edi
callq 0x1040
jmp 0x16f1
movq -0x18(%rbp), %rax
testb $0x1, 0x4(%rax)
jne 0x1704
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x1734
movq -0x20(%rbp), %rdi
addq $0xc3, %rdi
movq 0x28c2(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x1732
movl $0x20, %edi
callq 0x1040
jmp 0x1734
movq -0x18(%rbp), %rax
testb $0x1, 0x5(%rax)
jne 0x1747
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x1777
movq -0x20(%rbp), %rdi
addq $0x104, %rdi            # imm = 0x104
movq 0x287f(%rip), %rax      # 0x3fd8
movq (%rax), %rsi
callq 0x1080
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x1775
movl $0x20, %edi
callq 0x1040
jmp 0x1777
movq -0x18(%rbp), %rax
testb $0x1, 0x7(%rax)
jne 0x1794
movq -0x18(%rbp), %rax
testb $0x1, 0x6(%rax)
jne 0x1794
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x17ca
movq -0x18(%rbp), %rax
movb (%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x17c8
leaq 0x915(%rip), %rdi       # 0x20c0
movb $0x0, %al
callq 0x1060
movq -0x18(%rbp), %rax
cmpl $0x1, 0xc(%rax)
jle 0x17c6
movl $0x20, %edi
callq 0x1040
jmp 0x17c8
jmp 0x17ca
movq -0x18(%rbp), %rax
testb $0x1, 0x8(%rax)
jne 0x17dd
movq -0x18(%rbp), %rax
testb $0x1, (%rax)
je 0x17eb
leaq 0x8e4(%rip), %rdi       # 0x20c8
movb $0x0, %al
callq 0x1060
movl $0xa, %edi
callq 0x1040
movq -0x18(%rbp), %rdi
callq 0x1030
movq -0x20(%rbp), %rdi
callq 0x1030
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq