#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 {
  int /*<<< orphan*/ machine;
  int /*<<< orphan*/ version;
  int /*<<< orphan*/ release;
  int /*<<< orphan*/ nodename;
  int /*<<< orphan*/ sysname;
};

/* Variables and functions */
int /*<<< orphan*/ strncpy(char *, int /*<<< orphan*/, size_t);
int /*<<< orphan*/ uname(struct utsname *);
void c_uname_(char *sysname, char *nodename, char *release, char *version,
              char *machine, int sl, int nl, int rl, int vl, int ml) {
  struct utsname buf;
  uname(&buf);
  strncpy(sysname, buf.sysname, (size_t)sl);
  strncpy(nodename, buf.nodename, (size_t)nl);
  strncpy(release, buf.release, (size_t)rl);
  strncpy(version, buf.version, (size_t)vl);
  strncpy(machine, buf.machine, (size_t)ml);
}


x86 assembly (clang, -O0):
<c_uname_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x28(%rbp),%eax
mov    0x20(%rbp),%eax
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
lea    -0x40(%rbp),%rdi
call   1040 <uname@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%esi
movslq -0x2c(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x34(%rbp),%esi
movslq 0x10(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x18(%rbp),%rdi
mov    -0x38(%rbp),%esi
movslq 0x18(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x3c(%rbp),%esi
movslq 0x20(%rbp),%rdx
call   1030 <strncpy@plt>
mov    -0x28(%rbp),%rdi
mov    -0x40(%rbp),%esi
movslq 0x28(%rbp),%rdx
call   1030 <strncpy@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_uname_>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %r9d,%ebp
mov    %r8,0x30(%rsp)
mov    %rcx,0x20(%rsp)
mov    %rdx,%rbx
mov    %rsi,%r14
mov    %rdi,%r15
movslq 0x88(%rsp),%rax
mov    %rax,0x28(%rsp)
movslq 0x80(%rsp),%rax
mov    %rax,0x18(%rsp)
movslq 0x78(%rsp),%r12
movslq 0x70(%rsp),%r13
mov    %rsp,%rdi
call   1040 <uname@plt>
mov    0x10(%rsp),%esi
movslq %ebp,%rdx
mov    %r15,%rdi
call   1030 <strncpy@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
mov    %r13,%rdx
call   1030 <strncpy@plt>
mov    0x8(%rsp),%esi
mov    %rbx,%rdi
mov    %r12,%rdx
call   1030 <strncpy@plt>
mov    0x4(%rsp),%esi
mov    0x20(%rsp),%rdi
mov    0x18(%rsp),%rdx
call   1030 <strncpy@plt>
mov    (%rsp),%esi
mov    0x30(%rsp),%rdi
mov    0x28(%rsp),%rdx
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <strncpy@plt>

LLVM IR (-O0):
%struct.utsname = type { i32, i32, i32, i32, i32 }
define void @c_uname_(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca %struct.utsname
store i8* %0, i8** %11
store i8* %1, i8** %12
store i8* %2, i8** %13
store i8* %3, i8** %14
store i8* %4, i8** %15
store i32 %5, i32* %16
store i32 %6, i32* %17
store i32 %7, i32* %18
store i32 %8, i32* %19
store i32 %9, i32* %20
%22 = call i32 @uname(%struct.utsname* %21)
%23 = load i8*, i8** %11
%24 = getelementptr inbounds %struct.utsname, %struct.utsname* %21, i32 0, i32 4
%25 = load i32, i32* %24
%26 = load i32, i32* %16
%27 = sext i32 %26 to i64
%28 = call i32 @strncpy(i8* %23, i32 %25, i64 %27)
%29 = load i8*, i8** %12
%30 = getelementptr inbounds %struct.utsname, %struct.utsname* %21, i32 0, i32 3
%31 = load i32, i32* %30
%32 = load i32, i32* %17
%33 = sext i32 %32 to i64
%34 = call i32 @strncpy(i8* %29, i32 %31, i64 %33)
%35 = load i8*, i8** %13
%36 = getelementptr inbounds %struct.utsname, %struct.utsname* %21, i32 0, i32 2
%37 = load i32, i32* %36
%38 = load i32, i32* %18
%39 = sext i32 %38 to i64
%40 = call i32 @strncpy(i8* %35, i32 %37, i64 %39)
%41 = load i8*, i8** %14
%42 = getelementptr inbounds %struct.utsname, %struct.utsname* %21, i32 0, i32 1
%43 = load i32, i32* %42
%44 = load i32, i32* %19
%45 = sext i32 %44 to i64
%46 = call i32 @strncpy(i8* %41, i32 %43, i64 %45)
%47 = load i8*, i8** %15
%48 = getelementptr inbounds %struct.utsname, %struct.utsname* %21, i32 0, i32 0
%49 = load i32, i32* %48
%50 = load i32, i32* %20
%51 = sext i32 %50 to i64
%52 = call i32 @strncpy(i8* %47, i32 %49, i64 %51)
ret void
}

LLVM IR (-O2):
%struct.utsname = type { i32, i32, i32, i32, i32 }
define void @c_uname_(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i32 %5, i32 %6, i32 %7, i32 %8, i32 %9) {
%11 = alloca %struct.utsname
%12 = bitcast %struct.utsname* %11 to i8*
%13 = call i32 @uname(%struct.utsname* %11)
%14 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i64 0, i32 4
%15 = load i32, i32* %14
%16 = sext i32 %5 to i64
%17 = tail call i32 @strncpy(i8* %0, i32 %15, i64 %16)
%18 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i64 0, i32 3
%19 = load i32, i32* %18
%20 = sext i32 %6 to i64
%21 = tail call i32 @strncpy(i8* %1, i32 %19, i64 %20)
%22 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i64 0, i32 2
%23 = load i32, i32* %22
%24 = sext i32 %7 to i64
%25 = tail call i32 @strncpy(i8* %2, i32 %23, i64 %24)
%26 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i64 0, i32 1
%27 = load i32, i32* %26
%28 = sext i32 %8 to i64
%29 = tail call i32 @strncpy(i8* %3, i32 %27, i64 %28)
%30 = getelementptr inbounds %struct.utsname, %struct.utsname* %11, i64 0, i32 0
%31 = load i32, i32* %30
%32 = sext i32 %9 to i64
%33 = tail call i32 @strncpy(i8* %4, i32 %31, i64 %32)
ret void
}