#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 f91(int);
int /*<<< orphan*/ printf(char *, int, int);
int scanf(char *, int *);
int main() {
  int n;
  while (scanf("%d", &n) == 1) {
    if (n == 0)
      break;
    printf("f91(%d) = %d\n", n, f91(n));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    118b <main+0x5b>
cmpl   $0x0,-0x8(%rbp)
jne    1167 <main+0x37>
jmp    118b <main+0x5b>
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <f91@plt>
mov    -0xc(%rbp),%esi
mov    %eax,%edx
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
lea    0xec2(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    119b <main+0x6b>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
je     119b <main+0x6b>
lea    0xea7(%rip),%r14
lea    0xe9d(%rip),%r15
lea    0x4(%rsp),%rbx
nopl   0x0(%rax,%rax,1)
mov    %ebp,%edi
call   1030 <f91@plt>
mov    %r14,%rdi
mov    %ebp,%esi
mov    %eax,%edx
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
cmp    $0x1,%eax
jne    119b <main+0x6b>
mov    0x4(%rsp),%ebp
test   %ebp,%ebp
jne    1170 <main+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"f91(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
br label %3
3: ; preds = %10, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %15
6: ; preds = %3
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %6
br label %15
10: ; preds = %6
%11 = load i32, i32* %2
%12 = load i32, i32* %2
%13 = call i32 @f91(i32 %12)
%14 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %11, i32 %13)
br label %3
15: ; preds = %9, %3
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [14 x i8] c"f91(%d) = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp ne i32 %3, 1
%5 = load i32, i32* %1
%6 = icmp eq i32 %5, 0
%7 = select i1 %4, i1 true, i1 %6
br i1 %7, label %17, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %14, %8 ], [ %5, %0 ]
%10 = call i32 @f91(i32 %9)
%11 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %9, i32 %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%13 = icmp ne i32 %12, 1
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, 0
%16 = select i1 %13, i1 true, i1 %15
br i1 %16, label %17, label %8
17: ; preds = %8, %0
ret i32 0
}