#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 *);
void sys_call_uname() {
  printf("#########################Use funtion "
         "uname()###########################\n");
  struct utsname buf;
  struct utsname *p = &buf;
  uname(p);
  printf("sysname:%s\nnodename:%s\nrelease:%s\nversion:%s\nmachine:%s\n",
         buf.sysname, buf.nodename, buf.release, buf.version, buf.machine);
}


x86 assembly (clang, -O0):
<sys_call_uname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xee7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_call_uname>:
sub    $0x28,%rsp
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
mov    %rsp,%rdi
call   1050 <uname@plt>
mov    (%rsp),%rsi
mov    0x8(%rsp),%rdx
mov    0x10(%rsp),%rcx
mov    0x18(%rsp),%r8
mov    0x20(%rsp),%r9
lea    0xe99(%rip),%rdi
xor    %eax,%eax
add    $0x28,%rsp
jmp    1040 <printf@plt>

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@.str = [73 x i8] c"#########################Use funtion uname()###########################\0A\00"
@.str.1 = [57 x i8] c"sysname:%s\0Anodename:%s\0Arelease:%s\0Aversion:%s\0Amachine:%s\0A\00"
define void @sys_call_uname() {
%1 = alloca %struct.utsname
%2 = alloca %struct.utsname*
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
store %struct.utsname* %1, %struct.utsname** %2
%4 = load %struct.utsname*, %struct.utsname** %2
%5 = call i32 @uname(%struct.utsname* %4)
%6 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 0
%7 = load i8*, i8** %6
%8 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 1
%9 = load i8*, i8** %8
%10 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 2
%11 = load i8*, i8** %10
%12 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 3
%13 = load i8*, i8** %12
%14 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i32 0, i32 4
%15 = load i8*, i8** %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %9, i8* %11, i8* %13, i8* %15)
ret void
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@.str.1 = [57 x i8] c"sysname:%s\0Anodename:%s\0Arelease:%s\0Aversion:%s\0Amachine:%s\0A\00"
@str = [72 x i8] c"#########################Use funtion uname()###########################\00"
define void @sys_call_uname() {
%1 = alloca %struct.utsname
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([72 x i8], [72 x i8]* @str, i64 0, i64 0))
%3 = bitcast %struct.utsname* %1 to i8*
%4 = call i32 @uname(%struct.utsname* %1)
%5 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 2
%10 = load i8*, i8** %9
%11 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 3
%12 = load i8*, i8** %11
%13 = getelementptr inbounds %struct.utsname, %struct.utsname* %1, i64 0, i32 4
%14 = load i8*, i8** %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0), i8* %6, i8* %8, i8* %10, i8* %12, i8* %14)
ret void
}