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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeba(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
cmp    -0xc(%rbp),%eax
je     11b1 <main+0x91>
cmpl   $0x0,-0xc(%rbp)
jne    118e <main+0x6e>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    11ac <main+0x8c>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    11b1 <main+0x91>
mov    -0x8(%rbp),%esi
lea    0xe45(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%ecx
mov    %esi,%edx
shl    %cl,%edx
mov    0xc(%rsp),%eax
cmp    %eax,%edx
je     1184 <main+0x64>
cmp    $0x1,%eax
je     1177 <main+0x57>
test   %eax,%eax
jne    1184 <main+0x64>
mov    $0xffffffff,%eax
jmp    117c <main+0x5c>
mov    $0x1,%eax
shl    %cl,%eax
add    %eax,%esi
mov    %esi,0x4(%rsp)
lea    0xe75(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
%8 = load i32, i32* %2
%9 = load i32, i32* %4
%10 = shl i32 %8, %9
%11 = load i32, i32* %3
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %30
13: ; preds = %0
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %21
16: ; preds = %13
%17 = load i32, i32* %2
%18 = load i32, i32* %4
%19 = shl i32 1, %18
%20 = sub nsw i32 %17, %19
store i32 %20, i32* %2
br label %21
21: ; preds = %16, %13
%22 = load i32, i32* %3
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %29
24: ; preds = %21
%25 = load i32, i32* %2
%26 = load i32, i32* %4
%27 = shl i32 1, %26
%28 = add nsw i32 %25, %27
store i32 %28, i32* %2
br label %29
29: ; preds = %24, %21
br label %30
30: ; preds = %29, %0
%31 = load i32, i32* %2
%32 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %31)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast i32* %3 to i8*
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %1
%11 = load i32, i32* %3
%12 = shl i32 %10, %11
%13 = load i32, i32* %2
%14 = icmp eq i32 %12, %13
br i1 %14, label %22, label %15
15: ; preds = %0
switch i32 %13, label %22 [
i32 0, label %16
i32 1, label %19
]
16: ; preds = %15
%17 = shl nsw i32 -1, %11
%18 = add i32 %17, %10
store i32 %18, i32* %1
br label %22
19: ; preds = %15
%20 = shl nuw i32 1, %11
%21 = add nsw i32 %10, %20
store i32 %21, i32* %1
br label %22
22: ; preds = %15, %16, %19, %0
%23 = phi i32 [ %10, %15 ], [ %18, %16 ], [ %21, %19 ], [ %10, %0 ]
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
ret i32 0
}