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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e7e(%rip),%rcx
cmp    (%rcx),%rax
je     11a3 <main+0x63>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1060 <pow@plt>
mov    -0x10(%rbp),%edi
mov    %eax,%esi
call   1040 <modularFibonacci@plt>
mov    %eax,%esi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
jmp    114f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xeae(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    0x2e82(%rip),%r13
cmp    0x0(%r13),%rax
je     11c8 <main+0x88>
lea    0xe93(%rip),%r14
lea    0xe86(%rip),%r15
lea    0x4(%rsp),%r12
mov    %rsp,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x4(%rsp),%ebp
mov    (%rsp),%esi
mov    $0x2,%edi
call   1060 <pow@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1040 <modularFibonacci@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1190 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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