#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(int argc, char **argv) {
  struct utsname name;
  uname(&name);
  printf("a=%s -\n", name.sysname);
  printf("a=%s-\n", name.nodename);
  printf("a=%s-\n", name.release);
  printf("a=%s-\n", name.version);
  printf("a=%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>
mov    -0x38(%rbp),%rsi
lea    0xeb6(%rip),%rdi
call   1030 <printf@plt>
mov    -0x30(%rbp),%rsi
lea    0xeae(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rsi
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
mov    0x8(%rsp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@.str = [8 x i8] c"a=%s -\0A\00"
@.str.1 = [7 x i8] c"a=%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 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 0
%9 = load i8*, i8** %8
%10 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 1
%12 = load i8*, i8** %11
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 2
%15 = load i8*, i8** %14
%16 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 3
%18 = load i8*, i8** %17
%19 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds %struct.utsname, %struct.utsname* %6, i32 0, i32 4
%21 = load i8*, i8** %20
%22 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %21)
ret i32 0
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@.str = [8 x i8] c"a=%s -\0A\00"
@.str.1 = [7 x i8] c"a=%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 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 0
%7 = load i8*, i8** %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 1
%10 = load i8*, i8** %9
%11 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 2
%13 = load i8*, i8** %12
%14 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 3
%16 = load i8*, i8** %15
%17 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds %struct.utsname, %struct.utsname* %3, i64 0, i32 4
%19 = load i8*, i8** %18
%20 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %19)
ret i32 0
}