#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 uname(struct utsname *);
int octave_uname_wrapper(char **sysname, char **nodename, char **release,
                         char **version, char **machine) {
  static struct utsname unm;
  int err = uname(&unm);
  if (err == 0) {
    *sysname = unm.sysname;
    *nodename = unm.nodename;
    *release = unm.release;
    *version = unm.version;
    *machine = unm.machine;
  } else {
    *sysname = 0;
    *nodename = 0;
    *release = 0;
    *version = 0;
    *machine = 0;
  }
  return err;
}


x86 assembly (clang, -O0):
<octave_uname_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
lea    0x2efd(%rip),%rdi
call   1030 <uname@plt>
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1190 <octave_uname_wrapper+0x80>
mov    0x2ee4(%rip),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2ede(%rip),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2ed8(%rip),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2ed2(%rip),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    0x2ecc(%rip),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
jmp    11c7 <octave_uname_wrapper+0xb7>
mov    -0x8(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x2c(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_uname_wrapper>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
mov    %r8,%r14
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
lea    0x2f01(%rip),%rdi
call   1030 <uname@plt>
test   %eax,%eax
je     115a <octave_uname_wrapper+0x4a>
movq   $0x0,(%rbx)
movq   $0x0,0x0(%r13)
movq   $0x0,(%r12)
movq   $0x0,(%r15)
xor    %ecx,%ecx
jmp    118b <octave_uname_wrapper+0x7b>
mov    0x2ecf(%rip),%rcx
mov    %rcx,(%rbx)
mov    0x2ecd(%rip),%rcx
mov    %rcx,0x0(%r13)
mov    0x2eca(%rip),%rcx
mov    %rcx,(%r12)
mov    0x2ec7(%rip),%rcx
mov    %rcx,(%r15)
mov    0x2ec5(%rip),%rcx
mov    %rcx,(%r14)
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@octave_uname_wrapper.unm = internal global %struct.utsname zeroinitializer
define i32 @octave_uname_wrapper(i8** %0, i8** %1, i8** %2, i8** %3, i8** %4) {
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i8**
%9 = alloca i8**
%10 = alloca i8**
%11 = alloca i32
store i8** %0, i8*** %6
store i8** %1, i8*** %7
store i8** %2, i8*** %8
store i8** %3, i8*** %9
store i8** %4, i8*** %10
%12 = call i32 @uname(%struct.utsname* @octave_uname_wrapper.unm)
store i32 %12, i32* %11
%13 = load i32, i32* %11
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %26
15: ; preds = %5
%16 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i32 0, i32 0)
%17 = load i8**, i8*** %6
store i8* %16, i8** %17
%18 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i32 0, i32 1)
%19 = load i8**, i8*** %7
store i8* %18, i8** %19
%20 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i32 0, i32 2)
%21 = load i8**, i8*** %8
store i8* %20, i8** %21
%22 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i32 0, i32 3)
%23 = load i8**, i8*** %9
store i8* %22, i8** %23
%24 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i32 0, i32 4)
%25 = load i8**, i8*** %10
store i8* %24, i8** %25
br label %32
26: ; preds = %5
%27 = load i8**, i8*** %6
store i8* null, i8** %27
%28 = load i8**, i8*** %7
store i8* null, i8** %28
%29 = load i8**, i8*** %8
store i8* null, i8** %29
%30 = load i8**, i8*** %9
store i8* null, i8** %30
%31 = load i8**, i8*** %10
store i8* null, i8** %31
br label %32
32: ; preds = %26, %15
%33 = load i32, i32* %11
ret i32 %33
}

LLVM IR (-O2):
%struct.utsname = type { i8*, i8*, i8*, i8*, i8* }
@octave_uname_wrapper.unm = internal global %struct.utsname zeroinitializer
define i32 @octave_uname_wrapper(i8** nocapture writeonly %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2, i8** nocapture writeonly %3, i8** nocapture writeonly %4) {
%6 = tail call i32 @uname(%struct.utsname* @octave_uname_wrapper.unm)
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i64 0, i32 0)
store i8* %9, i8** %0
%10 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i64 0, i32 1)
store i8* %10, i8** %1
%11 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i64 0, i32 2)
store i8* %11, i8** %2
%12 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i64 0, i32 3)
store i8* %12, i8** %3
%13 = load i8*, i8** getelementptr inbounds (%struct.utsname, %struct.utsname* @octave_uname_wrapper.unm, i64 0, i32 4)
br label %15
14: ; preds = %5
store i8* null, i8** %0
store i8* null, i8** %1
store i8* null, i8** %2
store i8* null, i8** %3
br label %15
15: ; preds = %14, %8
%16 = phi i8* [ null, %14 ], [ %13, %8 ]
store i8* %16, i8** %4
ret i32 %6
}