#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 */

/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void set_output_nodes(int value, int node_num, double ***out) {
  if (value >= node_num) {
    fprintf(stderr, "ERROR: Number of nodes not enough to represent output!\n");
    exit(EXIT_FAILURE);
  } else {
    (*out)[value][0] = 1;
  }
}


x86 assembly (clang, -O0):
<set_output_nodes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jl     1161 <set_output_nodes+0x41>
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeba(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  0xe88(%rip),%xmm0
movsd  %xmm0,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_output_nodes>:
push   %rax
cmp    %esi,%edi
jge    113e <set_output_nodes+0x1e>
mov    (%rdx),%rax
movslq %edi,%rcx
mov    (%rax,%rcx,8),%rax
movabs $0x3ff0000000000000,%rcx
mov    %rcx,(%rax)
pop    %rax
ret
mov    0x2e9b(%rip),%rax
mov    (%rax),%edi
lea    0xeb2(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [56 x i8] c"ERROR: Number of nodes not enough to represent output!\0A\00"
@EXIT_FAILURE = global i32 0
define void @set_output_nodes(i32 %0, i32 %1, double*** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double***
store i32 %0, i32* %4
store i32 %1, i32* %5
store double*** %2, double**** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = icmp sge i32 %7, %8
br i1 %9, label %10, label %15
10: ; preds = %3
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @EXIT_FAILURE
%14 = call i32 @exit(i32 %13)
unreachable
15: ; preds = %3
%16 = load double***, double**** %6
%17 = load double**, double*** %16
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds double*, double** %17, i64 %19
%21 = load double*, double** %20
%22 = getelementptr inbounds double, double* %21, i64 0
store double 1.000000e+00, double* %22
br label %23
23: ; preds = %15
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [56 x i8] c"ERROR: Number of nodes not enough to represent output!\0A\00"
@EXIT_FAILURE = global i32 0
define void @set_output_nodes(i32 %0, i32 %1, double*** nocapture %2) {
%4 = icmp slt i32 %0, %1
br i1 %4, label %10, label %5
5: ; preds = %3
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @EXIT_FAILURE
%9 = tail call i32 @exit(i32 %8)
unreachable
10: ; preds = %3
%11 = load double**, double*** %2
%12 = sext i32 %0 to i64
%13 = getelementptr inbounds double*, double** %11, i64 %12
%14 = load double*, double** %13
store double 1.000000e+00, double* %14
ret void
}