#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*/ fibo(long long, long long);
long long pow(int, long long);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int scanf(char *, long long *, long long *);
int main() {
  long long int n, p, m, i;
  while (scanf("%lld %lld", &n, &p) == 2) {
    m = pow(2, p);
    printf("%lld\n", fibo(n, m));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    119e <main+0x5e>
mov    -0x18(%rbp),%rsi
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <fibo@plt>
mov    %eax,%esi
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeae(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
jne    11b9 <main+0x79>
lea    0xe9d(%rip),%r14
lea    0xe8c(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x8(%rsp),%rbx
xchg   %ax,%ax
mov    0x8(%rsp),%rsi
mov    $0x2,%edi
call   1060 <pow@plt>
mov    0x10(%rsp),%rdi
mov    %rax,%rsi
call   1050 <fibo@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1040 <scanf@plt>
cmp    $0x2,%eax
je     1180 <main+0x40>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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