#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);
    printf("%d\n", n);
  }
  if (v == 1) {
    n |= (1 << p);
    printf("%d\n", 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    118b <main+0x6b>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    11b4 <main+0x94>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe54(%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     1183 <main+0x63>
cmp    $0x1,%eax
jne    117b <main+0x5b>
mov    0x8(%rsp),%al
mov    0x4(%rsp),%esi
bts    %eax,%esi
mov    %esi,0x4(%rsp)
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret
mov    0x8(%rsp),%al
mov    0x4(%rsp),%esi
btr    %eax,%esi
mov    %esi,0x4(%rsp)
lea    0xe6a(%rip),%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
cmp    $0x1,%eax
je     1160 <main+0x40>
jmp    117b <main+0x5b>

LLVM IR (-O0):
@.str = [3 x i8] c"%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
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 %18
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
%16 = load i32, i32* %2
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %16)
br label %18
18: ; preds = %10, %0
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, 1
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %4
%23 = shl i32 1, %22
%24 = load i32, i32* %2
%25 = or i32 %24, %23
store i32 %25, i32* %2
%26 = load i32, i32* %2
%27 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %26)
br label %28
28: ; preds = %21, %18
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%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 ([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
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %20
12: ; preds = %0
%13 = load i32, i32* %3
%14 = shl nuw i32 1, %13
%15 = xor i32 %14, -1
%16 = load i32, i32* %1
%17 = and i32 %16, %15
store i32 %17, i32* %1
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %2
br label %20
20: ; preds = %12, %0
%21 = phi i32 [ %19, %12 ], [ %10, %0 ]
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %29
23: ; preds = %20
%24 = load i32, i32* %3
%25 = shl nuw i32 1, %24
%26 = load i32, i32* %1
%27 = or i32 %26, %25
store i32 %27, i32* %1
%28 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %23, %20
ret i32 0
}