#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, v, p, bit;
  do {
    scanf("%d %d %d", &n, &v, &p);
  } while ((p < 0 || p > 7) || (v < 0 || v > 1));
  if ((n >> p) != v) {
    bit = n ^ (1 << p);
  }
  printf("%d", bit);
  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    $0x1,%al
cmpl   $0x0,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jl     1184 <main+0x64>
mov    $0x1,%al
cmpl   $0x7,-0x10(%rbp)
mov    %al,-0x15(%rbp)
jg     1184 <main+0x64>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x16(%rbp)
jl     117e <main+0x5e>
cmpl   $0x1,-0xc(%rbp)
setg   %al
mov    %al,-0x16(%rbp)
mov    -0x16(%rbp),%al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    112f <main+0xf>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
cmp    -0xc(%rbp),%eax
je     11b4 <main+0x94>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe48(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xece(%rip),%r14
lea    0x14(%rsp),%r15
lea    0x10(%rsp),%r12
lea    0xc(%rsp),%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r12,%rdx
mov    %rbx,%rcx
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x7,%eax
ja     1150 <main+0x30>
cmpl   $0x1,0x10(%rsp)
ja     1150 <main+0x30>
mov    0x14(%rsp),%esi
btc    %eax,%esi
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

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