#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
struct utsname {
  char *sysname;
  char *nodename;
  char *release;
  char *version;
  char *machine;
};

/* Variables and functions */
int /*<<< orphan*/ err_ret(char *);
int /*<<< orphan*/ printf(char *, char *);
int uname(struct utsname *);
int main(int argc, char *argv[]) {
  struct utsname name;
  if (uname(&name) == -1) {
    err_ret("uname");
  }
  printf("sysname = %s\n", name.sysname);
  printf("nodename = %s\n", name.nodename);
  printf("release = %s\n", name.release);
  printf("version = %s\n", name.version);
  printf("machine = %s\n", name.machine);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x38(%rbp),%rdi
call   1040 <uname@plt>
cmp    $0xffffffff,%eax
jne    1164 <main+0x34>
lea    0xea1(%rip),%rdi
call   1050 <err_ret@plt>
mov    -0x38(%rbp),%rsi
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe92(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1040 <uname@plt>
cmp    $0xffffffff,%eax
jne    114d <main+0x1d>
lea    0xeb8(%rip),%rdi
call   1050 <err_ret@plt>
mov    (%rsp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@.str = [6 x i8] c"uname\00"
@.str.1 = [14 x i8] c"sysname = %s\0A\00"
@.str.2 = [15 x i8] c"nodename = %s\0A\00"
@.str.3 = [14 x i8] c"release = %s\0A\00"
@.str.4 = [14 x i8] c"version = %s\0A\00"
@.str.5 = [14 x i8] c"machine = %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.utsname
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 @uname(%struct.utsname* %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = call i32 @err_ret(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 0
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 1
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 2
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %19)
%21 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 3
%22 = load i8*, i8** %21
%23 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %22)
%24 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 4
%25 = load i8*, i8** %24
%26 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %25)
ret i32 0
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@.str = [6 x i8] c"uname\00"
@.str.1 = [14 x i8] c"sysname = %s\0A\00"
@.str.2 = [15 x i8] c"nodename = %s\0A\00"
@.str.3 = [14 x i8] c"release = %s\0A\00"
@.str.4 = [14 x i8] c"version = %s\0A\00"
@.str.5 = [14 x i8] c"machine = %s\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.utsname
%4 = bitcast %struct.utsname* %3 to i8*
%5 = call i32 @uname(%struct.utsname* %3)
%6 = icmp eq i32 %5, -1
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = tail call i32 @err_ret(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %7, %2
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 1
%14 = load i8*, i8** %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 2
%17 = load i8*, i8** %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 3
%20 = load i8*, i8** %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* %20)
%22 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 4
%23 = load i8*, i8** %22
%24 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i8* %23)
ret i32 0
}