#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 */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct TYPE_4__ {
  long tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct TYPE_3__ {
  long tv_usec;
  int /*<<< orphan*/ tv_sec;
};
struct rusage {
  long ru_maxrss;
  long ru_ixrss;
  long ru_idrss;
  long ru_isrss;
  long ru_minflt;
  long ru_majflt;
  long ru_nswap;
  long ru_inblock;
  long ru_oublock;
  long ru_msgsnd;
  long ru_msgrcv;
  long ru_nsignals;
  long ru_nvcsw;
  long ru_nivcsw;
  TYPE_2__ ru_stime;
  TYPE_1__ ru_utime;
};

/* Variables and functions */
int /*<<< orphan*/ RUSAGE_SELF;
int getrusage(int /*<<< orphan*/, struct rusage *);
int octave_getrusage_wrapper(time_t *usr_sec, time_t *sys_sec, long *usr_usec,
                             long *sys_usec, long *maxrss, long *ixrss,
                             long *idrss, long *isrss, long *minflt,
                             long *majflt, long *nswap, long *inblock,
                             long *oublock, long *msgsnd, long *msgrcv,
                             long *nsignals, long *nvcsw, long *nivcsw) {
  struct rusage ru;
  int status = getrusage(RUSAGE_SELF, &ru);
  if (status < 0) {
    *usr_sec = 0;
    *usr_usec = 0;
    *sys_sec = 0;
    *sys_usec = 0;
    *maxrss = 0;
    *ixrss = 0;
    *idrss = 0;
    *isrss = 0;
    *minflt = 0;
    *majflt = 0;
    *nswap = 0;
    *inblock = 0;
    *oublock = 0;
    *msgsnd = 0;
    *msgrcv = 0;
    *nsignals = 0;
    *nvcsw = 0;
    *nivcsw = 0;
  } else {
    *usr_sec = ru.ru_utime.tv_sec;
    *usr_usec = ru.ru_utime.tv_usec;
    *sys_sec = ru.ru_stime.tv_sec;
    *sys_usec = ru.ru_stime.tv_usec;
    *maxrss = ru.ru_maxrss;
    *ixrss = ru.ru_ixrss;
    *idrss = ru.ru_idrss;
    *isrss = ru.ru_isrss;
    *minflt = ru.ru_minflt;
    *majflt = ru.ru_majflt;
    *nswap = ru.ru_nswap;
    *inblock = ru.ru_inblock;
    *oublock = ru.ru_oublock;
    *msgsnd = ru.ru_msgsnd;
    *msgrcv = ru.ru_msgrcv;
    *nsignals = ru.ru_nsignals;
    *nvcsw = ru.ru_nvcsw;
    *nivcsw = ru.ru_nivcsw;
  }
  return status;
}


x86 assembly (clang, -O0):
<octave_getrusage_wrapper>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
mov    0x68(%rbp),%rax
mov    0x60(%rbp),%rax
mov    0x58(%rbp),%rax
mov    0x50(%rbp),%rax
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    -0xc0(%rbp),%rsi
call   1030 <getrusage@plt>
mov    %eax,-0xc4(%rbp)
cmpl   $0x0,-0xc4(%rbp)
jge    1254 <octave_getrusage_wrapper+0x144>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x18(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x20(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x28(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x30(%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    0x30(%rbp),%rax
movq   $0x0,(%rax)
mov    0x38(%rbp),%rax
movq   $0x0,(%rax)
mov    0x40(%rbp),%rax
movq   $0x0,(%rax)
mov    0x48(%rbp),%rax
movq   $0x0,(%rax)
mov    0x50(%rbp),%rax
movq   $0x0,(%rax)
mov    0x58(%rbp),%rax
movq   $0x0,(%rax)
mov    0x60(%rbp),%rax
movq   $0x0,(%rax)
mov    0x68(%rbp),%rax
movq   $0x0,(%rax)
jmp    132e <octave_getrusage_wrapper+0x21e>
mov    -0x38(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x40(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x48(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x50(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc0(%rbp),%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xb8(%rbp),%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xb0(%rbp),%rcx
mov    0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xa8(%rbp),%rcx
mov    0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xa0(%rbp),%rcx
mov    0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x98(%rbp),%rcx
mov    0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x90(%rbp),%rcx
mov    0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x88(%rbp),%rcx
mov    0x38(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x80(%rbp),%rcx
mov    0x40(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x78(%rbp),%rcx
mov    0x48(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x70(%rbp),%rcx
mov    0x50(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x68(%rbp),%rcx
mov    0x58(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x60(%rbp),%rcx
mov    0x60(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x58(%rbp),%rcx
mov    0x68(%rbp),%rax
mov    %rcx,(%rax)
mov    -0xc4(%rbp),%eax
add    $0xd0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octave_getrusage_wrapper>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %rdi,%rbp
mov    0x2ea6(%rip),%rax
mov    (%rax),%edi
lea    0x8(%rsp),%rsi
call   1030 <getrusage@plt>
test   %eax,%eax
js     1241 <octave_getrusage_wrapper+0x131>
mov    0x90(%rsp),%ecx
mov    %ecx,0x0(%rbp)
mov    0x88(%rsp),%rcx
mov    %rcx,(%rbx)
mov    0x80(%rsp),%ecx
mov    %ecx,0x0(%r13)
mov    0x78(%rsp),%rcx
mov    %rcx,(%r12)
mov    0x8(%rsp),%rcx
mov    %rcx,(%r15)
mov    0x10(%rsp),%rcx
mov    %rcx,(%r14)
mov    0x18(%rsp),%rcx
mov    0xd0(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x20(%rsp),%rcx
mov    0xd8(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x28(%rsp),%rcx
mov    0xe0(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x30(%rsp),%rcx
mov    0xe8(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x38(%rsp),%rcx
mov    0xf0(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x40(%rsp),%rcx
mov    0xf8(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x48(%rsp),%rcx
mov    0x100(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x50(%rsp),%rcx
mov    0x108(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x58(%rsp),%rcx
mov    0x110(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x60(%rsp),%rcx
mov    0x118(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x68(%rsp),%rcx
mov    0x120(%rsp),%rdx
mov    %rcx,(%rdx)
mov    0x70(%rsp),%rcx
jmp    1314 <octave_getrusage_wrapper+0x204>
movl   $0x0,0x0(%rbp)
movq   $0x0,(%rbx)
movl   $0x0,0x0(%r13)
movq   $0x0,(%r12)
movq   $0x0,(%r15)
movq   $0x0,(%r14)
mov    0xd0(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0xd8(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0xe0(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0xe8(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0xf0(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0xf8(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0x100(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0x108(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0x110(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0x118(%rsp),%rcx
movq   $0x0,(%rcx)
mov    0x120(%rsp),%rcx
movq   $0x0,(%rcx)
xor    %ecx,%ecx
mov    0x128(%rsp),%rdx
mov    %rcx,(%rdx)
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.rusage = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i32 }
%struct.TYPE_3__ = type { i64, i32 }
@RUSAGE_SELF = global i32 0
define i32 @octave_getrusage_wrapper(i32* %0, i32* %1, i64* %2, i64* %3, i64* %4, i64* %5, i64* %6, i64* %7, i64* %8, i64* %9, i64* %10, i64* %11, i64* %12, i64* %13, i64* %14, i64* %15, i64* %16, i64* %17) {
%19 = alloca i32*
%20 = alloca i32*
%21 = alloca i64*
%22 = alloca i64*
%23 = alloca i64*
%24 = alloca i64*
%25 = alloca i64*
%26 = alloca i64*
%27 = alloca i64*
%28 = alloca i64*
%29 = alloca i64*
%30 = alloca i64*
%31 = alloca i64*
%32 = alloca i64*
%33 = alloca i64*
%34 = alloca i64*
%35 = alloca i64*
%36 = alloca i64*
%37 = alloca %struct.rusage
%38 = alloca i32
store i32* %0, i32** %19
store i32* %1, i32** %20
store i64* %2, i64** %21
store i64* %3, i64** %22
store i64* %4, i64** %23
store i64* %5, i64** %24
store i64* %6, i64** %25
store i64* %7, i64** %26
store i64* %8, i64** %27
store i64* %9, i64** %28
store i64* %10, i64** %29
store i64* %11, i64** %30
store i64* %12, i64** %31
store i64* %13, i64** %32
store i64* %14, i64** %33
store i64* %15, i64** %34
store i64* %16, i64** %35
store i64* %17, i64** %36
%39 = load i32, i32* @RUSAGE_SELF
%40 = call i32 @getrusage(i32 %39, %struct.rusage* %37)
store i32 %40, i32* %38
%41 = load i32, i32* %38
%42 = icmp slt i32 %41, 0
br i1 %42, label %43, label %62
43: ; preds = %18
%44 = load i32*, i32** %19
store i32 0, i32* %44
%45 = load i64*, i64** %21
store i64 0, i64* %45
%46 = load i32*, i32** %20
store i32 0, i32* %46
%47 = load i64*, i64** %22
store i64 0, i64* %47
%48 = load i64*, i64** %23
store i64 0, i64* %48
%49 = load i64*, i64** %24
store i64 0, i64* %49
%50 = load i64*, i64** %25
store i64 0, i64* %50
%51 = load i64*, i64** %26
store i64 0, i64* %51
%52 = load i64*, i64** %27
store i64 0, i64* %52
%53 = load i64*, i64** %28
store i64 0, i64* %53
%54 = load i64*, i64** %29
store i64 0, i64* %54
%55 = load i64*, i64** %30
store i64 0, i64* %55
%56 = load i64*, i64** %31
store i64 0, i64* %56
%57 = load i64*, i64** %32
store i64 0, i64* %57
%58 = load i64*, i64** %33
store i64 0, i64* %58
%59 = load i64*, i64** %34
store i64 0, i64* %59
%60 = load i64*, i64** %35
store i64 0, i64* %60
%61 = load i64*, i64** %36
store i64 0, i64* %61
br label %121
62: ; preds = %18
%63 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 15
%64 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %63, i32 0, i32 1
%65 = load i32, i32* %64
%66 = load i32*, i32** %19
store i32 %65, i32* %66
%67 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 15
%68 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %67, i32 0, i32 0
%69 = load i64, i64* %68
%70 = load i64*, i64** %21
store i64 %69, i64* %70
%71 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 14
%72 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %71, i32 0, i32 1
%73 = load i32, i32* %72
%74 = load i32*, i32** %20
store i32 %73, i32* %74
%75 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 14
%76 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %75, i32 0, i32 0
%77 = load i64, i64* %76
%78 = load i64*, i64** %22
store i64 %77, i64* %78
%79 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 0
%80 = load i64, i64* %79
%81 = load i64*, i64** %23
store i64 %80, i64* %81
%82 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 1
%83 = load i64, i64* %82
%84 = load i64*, i64** %24
store i64 %83, i64* %84
%85 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 2
%86 = load i64, i64* %85
%87 = load i64*, i64** %25
store i64 %86, i64* %87
%88 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 3
%89 = load i64, i64* %88
%90 = load i64*, i64** %26
store i64 %89, i64* %90
%91 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 4
%92 = load i64, i64* %91
%93 = load i64*, i64** %27
store i64 %92, i64* %93
%94 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 5
%95 = load i64, i64* %94
%96 = load i64*, i64** %28
store i64 %95, i64* %96
%97 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 6
%98 = load i64, i64* %97
%99 = load i64*, i64** %29
store i64 %98, i64* %99
%100 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 7
%101 = load i64, i64* %100
%102 = load i64*, i64** %30
store i64 %101, i64* %102
%103 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 8
%104 = load i64, i64* %103
%105 = load i64*, i64** %31
store i64 %104, i64* %105
%106 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 9
%107 = load i64, i64* %106
%108 = load i64*, i64** %32
store i64 %107, i64* %108
%109 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 10
%110 = load i64, i64* %109
%111 = load i64*, i64** %33
store i64 %110, i64* %111
%112 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 11
%113 = load i64, i64* %112
%114 = load i64*, i64** %34
store i64 %113, i64* %114
%115 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 12
%116 = load i64, i64* %115
%117 = load i64*, i64** %35
store i64 %116, i64* %117
%118 = getelementptr inbounds %struct.rusage, %struct.rusage* %37, i32 0, i32 13
%119 = load i64, i64* %118
%120 = load i64*, i64** %36
store i64 %119, i64* %120
br label %121
121: ; preds = %62, %43
%122 = load i32, i32* %38
ret i32 %122
}

LLVM IR (-O2):
%struct.rusage = type { i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, i64, %struct.TYPE_4__, %struct.TYPE_3__ }
%struct.TYPE_4__ = type { i64, i32 }
%struct.TYPE_3__ = type { i64, i32 }
@RUSAGE_SELF = global i32 0
define i32 @octave_getrusage_wrapper(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i64* nocapture writeonly %2, i64* nocapture writeonly %3, i64* nocapture writeonly %4, i64* nocapture writeonly %5, i64* nocapture writeonly %6, i64* nocapture writeonly %7, i64* nocapture writeonly %8, i64* nocapture writeonly %9, i64* nocapture writeonly %10, i64* nocapture writeonly %11, i64* nocapture writeonly %12, i64* nocapture writeonly %13, i64* nocapture writeonly %14, i64* nocapture writeonly %15, i64* nocapture writeonly %16, i64* nocapture writeonly %17) {
%19 = alloca %struct.rusage
%20 = bitcast %struct.rusage* %19 to i8*
%21 = load i32, i32* @RUSAGE_SELF
%22 = call i32 @getrusage(i32 %21, %struct.rusage* %19)
%23 = icmp slt i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %18
store i32 0, i32* %0
store i64 0, i64* %2
store i32 0, i32* %1
store i64 0, i64* %3
store i64 0, i64* %4
store i64 0, i64* %5
store i64 0, i64* %6
store i64 0, i64* %7
store i64 0, i64* %8
store i64 0, i64* %9
store i64 0, i64* %10
store i64 0, i64* %11
store i64 0, i64* %12
store i64 0, i64* %13
store i64 0, i64* %14
store i64 0, i64* %15
store i64 0, i64* %16
br label %62
25: ; preds = %18
%26 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 15, i32 1
%27 = load i32, i32* %26
store i32 %27, i32* %0
%28 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 15, i32 0
%29 = load i64, i64* %28
store i64 %29, i64* %2
%30 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 14, i32 1
%31 = load i32, i32* %30
store i32 %31, i32* %1
%32 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 14, i32 0
%33 = load i64, i64* %32
store i64 %33, i64* %3
%34 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 0
%35 = load i64, i64* %34
store i64 %35, i64* %4
%36 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 1
%37 = load i64, i64* %36
store i64 %37, i64* %5
%38 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 2
%39 = load i64, i64* %38
store i64 %39, i64* %6
%40 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 3
%41 = load i64, i64* %40
store i64 %41, i64* %7
%42 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 4
%43 = load i64, i64* %42
store i64 %43, i64* %8
%44 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 5
%45 = load i64, i64* %44
store i64 %45, i64* %9
%46 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 6
%47 = load i64, i64* %46
store i64 %47, i64* %10
%48 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 7
%49 = load i64, i64* %48
store i64 %49, i64* %11
%50 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 8
%51 = load i64, i64* %50
store i64 %51, i64* %12
%52 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 9
%53 = load i64, i64* %52
store i64 %53, i64* %13
%54 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 10
%55 = load i64, i64* %54
store i64 %55, i64* %14
%56 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 11
%57 = load i64, i64* %56
store i64 %57, i64* %15
%58 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 12
%59 = load i64, i64* %58
store i64 %59, i64* %16
%60 = getelementptr inbounds %struct.rusage, %struct.rusage* %19, i64 0, i32 13
%61 = load i64, i64* %60
br label %62
62: ; preds = %25, %24
%63 = phi i64 [ %61, %25 ], [ 0, %24 ]
store i64 %63, i64* %17
ret i32 %22
}