#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
int check_node_id_range(int node_id) {
  if (0 <= node_id && node_id < (1 << 20))
    return 1;
  fprintf(stderr, "W: node id outside [0..%d).\n", (1 << 20));
  if ((1 << 20) <= node_id) {
    fprintf(stderr, "W: You may want to increase active_size and recompile.\n");
  } else {
    fprintf(stderr, "W: Please use nonnegative IDs.\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_node_id_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%eax
jg     113f <check_node_id_range+0x2f>
cmpl   $0x100000,-0x8(%rbp)
jge    113f <check_node_id_range+0x2f>
movl   $0x1,-0x4(%rbp)
jmp    11a3 <check_node_id_range+0x93>
mov    0x2e9a(%rip),%rax
mov    (%rax),%edi
lea    0xeb1(%rip),%rsi
mov    $0x100000,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x100000,%eax
cmp    -0x8(%rbp),%eax
jg     1185 <check_node_id_range+0x75>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    119c <check_node_id_range+0x8c>
mov    0x2e54(%rip),%rax
mov    (%rax),%edi
lea    0xec0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_node_id_range>:
push   %rbp
push   %r14
push   %rbx
mov    $0x1,%ebx
cmp    $0x100000,%edi
jb     1164 <check_node_id_range+0x54>
mov    %edi,%ebp
mov    0x2eb6(%rip),%r14
mov    (%r14),%edi
lea    0xecc(%rip),%rsi
xor    %ebx,%ebx
mov    $0x100000,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
cmp    $0x100000,%ebp
mov    (%r14),%edi
lea    0xecb(%rip),%rax
lea    0xefc(%rip),%rsi
cmovge %rax,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"W: node id outside [0..%d).\0A\00"
@.str.1 = [56 x i8] c"W: You may want to increase active_size and recompile.\0A\00"
@.str.2 = [32 x i8] c"W: Please use nonnegative IDs.\0A\00"
define i32 @check_node_id_range(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 0, %4
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 1048576
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %22
10: ; preds = %6, %1
%11 = load i32, i32* @stderr
%12 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1048576)
%13 = load i32, i32* %3
%14 = icmp sle i32 1048576, %13
br i1 %14, label %15, label %18
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0))
br label %21
18: ; preds = %10
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %18, %15
store i32 0, i32* %2
br label %22
22: ; preds = %21, %9
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"W: node id outside [0..%d).\0A\00"
@.str.1 = [56 x i8] c"W: You may want to increase active_size and recompile.\0A\00"
@.str.2 = [32 x i8] c"W: Please use nonnegative IDs.\0A\00"
define i32 @check_node_id_range(i32 %0) {
%2 = icmp ult i32 %0, 1048576
br i1 %2, label %10, label %3
3: ; preds = %1
%4 = load i32, i32* @stderr
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %4, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 1048576)
%6 = icmp sgt i32 %0, 1048575
%7 = load i32, i32* @stderr
%8 = select i1 %6, i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0)
%9 = tail call i32 (i32, i8*, ...) @fprintf(i32 %7, i8* %8)
br label %10
10: ; preds = %3, %1
%11 = phi i32 [ 1, %1 ], [ 0, %3 ]
ret i32 %11
}