#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*/ printf(char *, char *);
int /*<<< orphan*/ uname(struct utsname *);
int main() {
  struct utsname cursys[1];
  uname(cursys);
  printf("on a %s machine, ", cursys->sysname);
  printf("nodename %s, ", cursys->nodename);
  printf("release %s, ", cursys->release);
  printf("version %s, ", cursys->version);
  printf("machine %s \n", cursys->machine);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    -0x30(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x30(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    %rsp,%rdi
call   1040 <uname@plt>
mov    (%rsp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x8(%rsp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%rsi
lea    0xebf(%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 = [18 x i8] c"on a %s machine, \00"
@.str.1 = [14 x i8] c"nodename %s, \00"
@.str.2 = [13 x i8] c"release %s, \00"
@.str.3 = [13 x i8] c"version %s, \00"
@.str.4 = [13 x i8] c"machine %s \0A\00"
define i32 @main() {
%1 = alloca [1 x %struct.utsname]
%2 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0
%3 = call i32 @uname(%struct.utsname* %2)
%4 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0
%5 = getelementptr inbounds %struct.utsname, %struct.utsname* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0
%9 = getelementptr inbounds %struct.utsname, %struct.utsname* %8, i32 0, i32 1
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0
%13 = getelementptr inbounds %struct.utsname, %struct.utsname* %12, i32 0, i32 2
%14 = load i8*, i8** %13
%15 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0
%17 = getelementptr inbounds %struct.utsname, %struct.utsname* %16, i32 0, i32 3
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0
%21 = getelementptr inbounds %struct.utsname, %struct.utsname* %20, i32 0, i32 4
%22 = load i8*, i8** %21
%23 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %22)
ret i32 0
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@.str = [18 x i8] c"on a %s machine, \00"
@.str.1 = [14 x i8] c"nodename %s, \00"
@.str.2 = [13 x i8] c"release %s, \00"
@.str.3 = [13 x i8] c"version %s, \00"
@.str.4 = [13 x i8] c"machine %s \0A\00"
define i32 @main() {
%1 = alloca [1 x %struct.utsname]
%2 = bitcast [1 x %struct.utsname]* %1 to i8*
%3 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0
%4 = call i32 @uname(%struct.utsname* %3)
%5 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %6)
%8 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0, i32 1
%9 = load i8*, i8** %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0, i32 2
%12 = load i8*, i8** %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0, i32 3
%15 = load i8*, i8** %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [1 x %struct.utsname], [1 x %struct.utsname]* %1, i64 0, i64 0, i32 4
%18 = load i8*, i8** %17
%19 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i8* %18)
ret i32 0
}