#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 (v == 0) {
    n &= ~(1 << p);
  }
  if (v == 1) {
    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>
cmpl   $0x0,-0xc(%rbp)
jne    117c <main+0x5c>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0xc(%rbp)
jne    1196 <main+0x76>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe60(%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    0xc(%rsp),%eax
test   %eax,%eax
je     116d <main+0x4d>
cmp    $0x1,%eax
jne    117e <main+0x5e>
mov    0x8(%rsp),%al
mov    0x4(%rsp),%esi
bts    %eax,%esi
jmp    1178 <main+0x58>
mov    0x8(%rsp),%al
mov    0x4(%rsp),%esi
btr    %eax,%esi
mov    %esi,0x4(%rsp)
jmp    1182 <main+0x62>
mov    0x4(%rsp),%esi
lea    0xe77(%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* %3
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %16
10: ; preds = %0
%11 = load i32, i32* %4
%12 = shl i32 1, %11
%13 = xor i32 %12, -1
%14 = load i32, i32* %2
%15 = and i32 %14, %13
store i32 %15, i32* %2
br label %16
16: ; preds = %10, %0
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 1
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i32, i32* %4
%21 = shl i32 1, %20
%22 = load i32, i32* %2
%23 = or i32 %22, %21
store i32 %23, i32* %2
br label %24
24: ; preds = %19, %16
%25 = load i32, i32* %2
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
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* %2
switch i32 %10, label %11 [
i32 0, label %13
i32 1, label %19
]
11: ; preds = %0
%12 = load i32, i32* %1
br label %24
13: ; preds = %0
%14 = load i32, i32* %3
%15 = shl nuw i32 1, %14
%16 = xor i32 %15, -1
%17 = load i32, i32* %1
%18 = and i32 %17, %16
store i32 %18, i32* %1
br label %24
19: ; preds = %0
%20 = load i32, i32* %3
%21 = shl nuw i32 1, %20
%22 = load i32, i32* %1
%23 = or i32 %22, %21
store i32 %23, i32* %1
br label %24
24: ; preds = %11, %13, %19
%25 = phi i32 [ %12, %11 ], [ %18, %13 ], [ %23, %19 ]
%26 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %25)
ret i32 0
}