#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, int, int);
int /*<<< orphan*/ fputc(char, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int node_callback(int group, int beg, int end, int level, int at, void *arg) {
  int i;
  if (at != 1)
    return -1;
  for (i = 0; i < level * 2; i++)
    fputc(' ', stderr);
  fprintf(stderr, "%d: (%d-%d)\n", group, beg, end);
  return 0;
}


x86 assembly (clang, -O0):
<node_callback>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
cmpl   $0x1,-0x18(%rbp)
je     1152 <node_callback+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b1 <node_callback+0x91>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x14(%rbp),%ecx
shl    $0x1,%ecx
cmp    %ecx,%eax
jge    118b <node_callback+0x6b>
mov    0x2e6f(%rip),%rax
mov    (%rax),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1159 <node_callback+0x39>
mov    0x2e4e(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x10(%rbp),%r8d
lea    0xe5b(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<node_callback>:
mov    $0xffffffff,%eax
cmp    $0x1,%r8d
jne    1199 <node_callback+0x79>
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%r15d
mov    %edi,%r12d
test   %ecx,%ecx
jle    1171 <node_callback+0x51>
add    %ecx,%ecx
cmp    $0x2,%ecx
mov    $0x1,%ebp
cmovge %ecx,%ebp
mov    0x2e8c(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rbx),%esi
mov    $0x20,%edi
call   1030 <fputc@plt>
add    $0xffffffff,%ebp
jne    1160 <node_callback+0x40>
mov    0x2e68(%rip),%rax
mov    (%rax),%edi
lea    0xe7f(%rip),%rsi
mov    %r12d,%edx
mov    %r15d,%ecx
mov    %r14d,%r8d
call   1040 <fprintf@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [13 x i8] c"%d: (%d-%d)\0A\00"
define i32 @node_callback(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i8* %5, i8** %13
%15 = load i32, i32* %12
%16 = icmp ne i32 %15, 1
br i1 %16, label %17, label %18
17: ; preds = %6
store i32 -1, i32* %7
br label %36
18: ; preds = %6
store i32 0, i32* %14
br label %19
19: ; preds = %27, %18
%20 = load i32, i32* %14
%21 = load i32, i32* %11
%22 = mul nsw i32 %21, 2
%23 = icmp slt i32 %20, %22
br i1 %23, label %24, label %30
24: ; preds = %19
%25 = load i32, i32* @stderr
%26 = call i32 @fputc(i8 signext 32, i32 %25)
br label %27
27: ; preds = %24
%28 = load i32, i32* %14
%29 = add nsw i32 %28, 1
store i32 %29, i32* %14
br label %19
30: ; preds = %19
%31 = load i32, i32* @stderr
%32 = load i32, i32* %8
%33 = load i32, i32* %9
%34 = load i32, i32* %10
%35 = call i32 @fprintf(i32 %31, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %32, i32 %33, i32 %34)
store i32 0, i32* %7
br label %36
36: ; preds = %30, %17
%37 = load i32, i32* %7
ret i32 %37
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [13 x i8] c"%d: (%d-%d)\0A\00"
define i32 @node_callback(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* nocapture readnone %5) {
%7 = icmp eq i32 %4, 1
br i1 %7, label %8, label %22
8: ; preds = %6
%9 = icmp sgt i32 %3, 0
br i1 %9, label %10, label %19
10: ; preds = %8
%11 = shl nuw i32 %3, 1
%12 = call i32 @llvm.smax.i32(i32 %11, i32 1)
br label %13
13: ; preds = %10, %13
%14 = phi i32 [ %17, %13 ], [ 0, %10 ]
%15 = load i32, i32* @stderr
%16 = tail call i32 @fputc(i8 signext 32, i32 %15)
%17 = add nuw nsw i32 %14, 1
%18 = icmp eq i32 %17, %12
br i1 %18, label %19, label %13
19: ; preds = %13, %8
%20 = load i32, i32* @stderr
%21 = tail call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %2)
br label %22
22: ; preds = %6, %19
%23 = phi i32 [ 0, %19 ], [ -1, %6 ]
ret i32 %23
}