#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;
  char *__domainname;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ uname(struct utsname *);
void get_sys_info(void) {
  struct utsname uname_pointer;
  uname(&uname_pointer);
  printf("System name - %s\n", uname_pointer.sysname);
  printf("Nodename    - %s\n", uname_pointer.nodename);
  printf("Release     - %s\n", uname_pointer.release);
  printf("Version     - %s\n", uname_pointer.version);
  printf("Machine     - %s\n", uname_pointer.machine);
  printf("Domain name - %s\n", uname_pointer.__domainname);
}


x86 assembly (clang, -O0):
<get_sys_info>:
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    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rsi
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_sys_info>:
sub    $0x38,%rsp
lea    0x8(%rsp),%rdi
call   1040 <uname@plt>
mov    0x8(%rsp),%rsi
lea    0xec6(%rip),%rdi
call   1030 <printf@plt>
mov    0x10(%rsp),%rsi
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    0x20(%rsp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    0x28(%rsp),%rsi
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    0x30(%rsp),%rsi
lea    0xecb(%rip),%rdi
add    $0x38,%rsp
jmp    1030 <printf@plt>

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8*, i8* }
@.str = [18 x i8] c"System name - %s\0A\00"
@.str.1 = [18 x i8] c"Nodename - %s\0A\00"
@.str.2 = [18 x i8] c"Release - %s\0A\00"
@.str.3 = [18 x i8] c"Version - %s\0A\00"
@.str.4 = [18 x i8] c"Machine - %s\0A\00"
@.str.5 = [18 x i8] c"Domain name - %s\0A\00"
define void @get_sys_info() {
%1 = alloca %struct.utsname
%2 = call i32 @uname(%struct.utsname* %1)
%3 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 0
%4 = load i8*, i8** %3
%5 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 1
%7 = load i8*, i8** %6
%8 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%9 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 2
%10 = load i8*, i8** %9
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %10)
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 3
%13 = load i8*, i8** %12
%14 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 4
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 5
%19 = load i8*, i8** %18
%20 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %19)
ret void
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8*, i8* }
@.str = [18 x i8] c"System name - %s\0A\00"
@.str.1 = [18 x i8] c"Nodename - %s\0A\00"
@.str.2 = [18 x i8] c"Release - %s\0A\00"
@.str.3 = [18 x i8] c"Version - %s\0A\00"
@.str.4 = [18 x i8] c"Machine - %s\0A\00"
@.str.5 = [18 x i8] c"Domain name - %s\0A\00"
define void @get_sys_info() {
%1 = alloca %struct.utsname
%2 = bitcast %struct.utsname* %1 to i8*
%3 = call i32 @uname(%struct.utsname* %1)
%4 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%5 = load i8*, i8** %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 1
%8 = load i8*, i8** %7
%9 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %8)
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 2
%11 = load i8*, i8** %10
%12 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* %11)
%13 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 3
%14 = load i8*, i8** %13
%15 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i8* %14)
%16 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 4
%17 = load i8*, i8** %16
%18 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%19 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 5
%20 = load i8*, i8** %19
%21 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %20)
ret void
}