#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*/ printf(char *, unsigned long long, unsigned long long,
                          unsigned long long);
unsigned long long nofllfgh(unsigned long long a, unsigned long long b,
                            unsigned long long recurrenceCounter) {
  printf("Status : %llu, %llu, %llu (Using NOF Mode)\n", a, b,
         recurrenceCounter);
  if (b == 1 && recurrenceCounter == 0) {
    return a * 2 + 1;
  } else if (recurrenceCounter == 0) {
    return nofllfgh(a, b - 1, a);
  } else {
    return nofllfgh(nofllfgh(a, b, recurrenceCounter - 1), b, 0);
  }
}


x86 assembly (clang, -O0):
<nofllfgh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
cmpq   $0x1,-0x18(%rbp)
jne    1177 <nofllfgh+0x57>
cmpq   $0x0,-0x20(%rbp)
jne    1177 <nofllfgh+0x57>
mov    -0x10(%rbp),%rax
shl    $0x1,%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    11c9 <nofllfgh+0xa9>
cmpq   $0x0,-0x20(%rbp)
jne    11a0 <nofllfgh+0x80>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
sub    $0x1,%rsi
mov    -0x10(%rbp),%rdx
call   1040 <nofllfgh@plt>
mov    %rax,-0x8(%rbp)
jmp    11c9 <nofllfgh+0xa9>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
sub    $0x1,%rdx
call   1040 <nofllfgh@plt>
mov    %rax,%rdi
mov    -0x18(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1040 <nofllfgh@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nofllfgh>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xec8(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r12,%rcx
call   1030 <printf@plt>
test   %r12,%r12
sete   %al
cmp    $0x1,%rbx
jne    115b <nofllfgh+0x3b>
test   %r12,%r12
je     11e8 <nofllfgh+0xc8>
lea    0xe9e(%rip),%r15
jmp    11aa <nofllfgh+0x8a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0x1,%rbx
mov    %r14,%r12
add    $0xffffffffffffffff,%r12
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %r12,%rdx
call   1040 <nofllfgh@plt>
mov    %rax,%r14
mov    %r15,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
xor    %ecx,%ecx
call   1030 <printf@plt>
mov    $0x1,%al
mov    $0x0,%r12d
cmp    $0x1,%rbx
je     11e8 <nofllfgh+0xc8>
test   $0x1,%al
je     1177 <nofllfgh+0x57>
add    $0xffffffffffffffff,%rbx
jmp    11c9 <nofllfgh+0xa9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffffffffffff,%rbx
test   %r14,%r14
jne    1170 <nofllfgh+0x50>
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
call   1030 <printf@plt>
cmp    $0x1,%rbx
jne    11c0 <nofllfgh+0xa0>
test   %r14,%r14
jne    11c0 <nofllfgh+0xa0>
xor    %r14d,%r14d
lea    (%r14,%r14,1),%rax
add    $0x1,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [44 x i8] c"Status : %llu, %llu, %llu (Using NOF Mode)\0A\00"
define i64 @nofllfgh(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i64 %0, i64* %5
store i64 %1, i64* %6
store i64 %2, i64* %7
%8 = load i64, i64* %5
%9 = load i64, i64* %6
%10 = load i64, i64* %7
%11 = call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %8, i64 %9, i64 %10)
%12 = load i64, i64* %6
%13 = icmp eq i64 %12, 1
br i1 %13, label %14, label %21
14: ; preds = %3
%15 = load i64, i64* %7
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load i64, i64* %5
%19 = mul i64 %18, 2
%20 = add i64 %19, 1
store i64 %20, i64* %4
br label %38
21: ; preds = %14, %3
%22 = load i64, i64* %7
%23 = icmp eq i64 %22, 0
br i1 %23, label %24, label %30
24: ; preds = %21
%25 = load i64, i64* %5
%26 = load i64, i64* %6
%27 = sub i64 %26, 1
%28 = load i64, i64* %5
%29 = call i64 @nofllfgh(i64 %25, i64 %27, i64 %28)
store i64 %29, i64* %4
br label %38
30: ; preds = %21
%31 = load i64, i64* %5
%32 = load i64, i64* %6
%33 = load i64, i64* %7
%34 = sub i64 %33, 1
%35 = call i64 @nofllfgh(i64 %31, i64 %32, i64 %34)
%36 = load i64, i64* %6
%37 = call i64 @nofllfgh(i64 %35, i64 %36, i64 0)
store i64 %37, i64* %4
br label %38
38: ; preds = %30, %24, %17
%39 = load i64, i64* %4
ret i64 %39
}

LLVM IR (-O2):
@.str = [44 x i8] c"Status : %llu, %llu, %llu (Using NOF Mode)\0A\00"
define i64 @nofllfgh(i64 %0, i64 %1, i64 %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1, i64 %2)
%5 = icmp eq i64 %1, 1
%6 = icmp eq i64 %2, 0
%7 = and i1 %5, %6
br i1 %7, label %14, label %8
8: ; preds = %3, %25
%9 = phi i1 [ true, %25 ], [ %6, %3 ]
%10 = phi i64 [ 0, %25 ], [ %2, %3 ]
%11 = phi i64 [ %27, %25 ], [ %1, %3 ]
%12 = phi i64 [ %29, %25 ], [ %0, %3 ]
%13 = icmp eq i64 %12, 0
br i1 %9, label %19, label %25
14: ; preds = %25, %19, %3
%15 = phi i64 [ %0, %3 ], [ 0, %19 ], [ %29, %25 ]
%16 = shl i64 %15, 1
%17 = or i64 %16, 1
ret i64 %17
18: ; preds = %19
br i1 %13, label %19, label %25
19: ; preds = %8, %18
%20 = phi i64 [ %21, %18 ], [ %11, %8 ]
%21 = add i64 %20, -1
%22 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %12, i64 %21, i64 %12)
%23 = icmp eq i64 %21, 1
%24 = and i1 %23, %13
br i1 %24, label %14, label %18
25: ; preds = %18, %8
%26 = phi i64 [ %10, %8 ], [ %12, %18 ]
%27 = phi i64 [ %11, %8 ], [ %21, %18 ]
%28 = add i64 %26, -1
%29 = tail call i64 @nofllfgh(i64 %12, i64 %27, i64 %28)
%30 = tail call i32 @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0), i64 %29, i64 %27, i64 0)
%31 = icmp eq i64 %27, 1
br i1 %31, label %14, label %8
}