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


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     11a9 <main+0x89>
cmpl   $0x0,-0xc(%rbp)
jne    1181 <main+0x61>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    11a4 <main+0x84>
cmpl   $0x0,-0xc(%rbp)
je     119f <main+0x7f>
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    11a4 <main+0x84>
jmp    11a9 <main+0x89>
mov    -0x8(%rbp),%esi
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
mov    0x10(%rsp),%ecx
mov    %esi,%edx
shl    %cl,%edx
mov    0x14(%rsp),%eax
cmp    %eax,%edx
je     116b <main+0x4b>
test   %eax,%eax
je     115e <main+0x3e>
mov    $0x1,%eax
jmp    1163 <main+0x43>
mov    $0xffffffff,%eax
shl    %cl,%eax
add    %eax,%esi
mov    %esi,0xc(%rsp)
lea    0xe97(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%7 = load i32, i32* %2
%8 = load i32, i32* %4
%9 = shl i32 %7, %8
store i32 %9, i32* %5
%10 = load i32, i32* %5
%11 = load i32, i32* %3
%12 = icmp ne i32 %10, %11
br i1 %12, label %13, label %31
13: ; preds = %0
%14 = load i32, i32* %3
%15 = icmp ne i32 %14, 0
br i1 %15, label %21, label %16
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 %30
21: ; preds = %13
%22 = load i32, i32* %3
%23 = icmp ne i32 %22, 0
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, %16
br label %31
31: ; preds = %30, %0
%32 = load i32, i32* %2
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\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 ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %1
%9 = load i32, i32* %3
%10 = shl i32 %8, %9
%11 = load i32, i32* %2
%12 = icmp eq i32 %10, %11
br i1 %12, label %21, label %13
13: ; preds = %0
%14 = icmp eq i32 %11, 0
br i1 %14, label %15, label %18
15: ; preds = %13
%16 = shl nsw i32 -1, %9
%17 = add i32 %16, %8
store i32 %17, i32* %1
br label %21
18: ; preds = %13
%19 = shl nuw i32 1, %9
%20 = add nsw i32 %19, %8
store i32 %20, i32* %1
br label %21
21: ; preds = %15, %18, %0
%22 = phi i32 [ %17, %15 ], [ %20, %18 ], [ %8, %0 ]
%23 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %22)
ret i32 0
}