#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 *, ...);
int /*<<< orphan*/ uname(struct utsname *);
int main(int argc, char **argv) {
  struct utsname x;
  printf("hello %p\n", &x);
  uname(&x);
  printf("%p  %d   %s\n", &x.sysname, sizeof(x.sysname), x.sysname);
  printf("%p  %d   %s\n", &x.nodename, sizeof(x.nodename), x.nodename);
  printf("%p  %d   %s\n", &x.release, sizeof(x.release), x.release);
  printf("%p  %d   %s\n", &x.version, sizeof(x.version), x.version);
  printf("%p  %d   %s\n", &x.machine, sizeof(x.machine), x.machine);
  return 1;
}


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    0xec3(%rip),%rdi
lea    -0x38(%rbp),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rdi
call   1040 <uname@plt>
lea    -0x38(%rbp),%rsi
mov    -0x38(%rbp),%rcx
lea    0xeaa(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x8,%rsi
mov    -0x30(%rbp),%rcx
lea    0xe8b(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x10,%rsi
mov    -0x28(%rbp),%rcx
lea    0xe6c(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x18,%rsi
mov    -0x20(%rbp),%rcx
lea    0xe4d(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x38(%rbp),%rsi
add    $0x20,%rsi
mov    -0x18(%rbp),%rcx
lea    0xe2e(%rip),%rdi
mov    $0x8,%edx
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x40,%rsp
pop    %rbp
ret

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

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

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