#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;
  do {
    scanf("%d %d %d", &n, &v, &p);
  } while ((v > 1 || v < 0) || (p > 7 || p < 0));
  if (v == 1) {
    printf("%d", n | (1 << p));
  } else if (v == 0) {
    printf("%d", n ^ (1 << p));
  }
  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   $0x1,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jg     1184 <main+0x64>
mov    $0x1,%al
cmpl   $0x0,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jl     1184 <main+0x64>
mov    $0x1,%al
cmpl   $0x7,-0x10(%rbp)
mov    %al,-0x12(%rbp)
jg     117e <main+0x5e>
cmpl   $0x0,-0x10(%rbp)
setl   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    112f <main+0xf>
cmpl   $0x1,-0xc(%rbp)
jne    11b9 <main+0x99>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
or     %eax,%esi
lea    0xe57(%rip),%rdi
call   1030 <printf@plt>
jmp    11e3 <main+0xc3>
cmpl   $0x0,-0xc(%rbp)
jne    11de <main+0xbe>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    %eax,%esi
lea    0xe2d(%rip),%rdi
call   1030 <printf@plt>
jmp    11e3 <main+0xc3>
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    0x10(%rsp),%eax
cmp    $0x1,%eax
ja     1150 <main+0x30>
mov    0xc(%rsp),%ecx
cmp    $0x7,%ecx
ja     1150 <main+0x30>
mov    0x14(%rsp),%esi
mov    %esi,%edx
btc    %ecx,%edx
bts    %ecx,%esi
cmp    $0x1,%eax
cmovne %edx,%esi
lea    0xe7a(%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
store i32 0, i32* %1
br label %5
5: ; preds = %21, %0
%6 = 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 %7
7: ; preds = %5
%8 = load i32, i32* %3
%9 = icmp sgt i32 %8, 1
br i1 %9, label %21, label %10
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp slt i32 %11, 0
br i1 %12, label %21, label %13
13: ; preds = %10
%14 = load i32, i32* %4
%15 = icmp sgt i32 %14, 7
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %4
%18 = icmp slt i32 %17, 0
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ true, %13 ], [ %18, %16 ]
br label %21
21: ; preds = %19, %10, %7
%22 = phi i1 [ true, %10 ], [ true, %7 ], [ %20, %19 ]
br i1 %22, label %5, label %23
23: ; preds = %21
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, 1
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* %2
%28 = load i32, i32* %4
%29 = shl i32 1, %28
%30 = or i32 %27, %29
%31 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %30)
br label %42
32: ; preds = %23
%33 = load i32, i32* %3
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %41
35: ; preds = %32
%36 = load i32, i32* %2
%37 = load i32, i32* %4
%38 = shl i32 1, %37
%39 = xor i32 %36, %38
%40 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %39)
br label %41
41: ; preds = %35, %32
br label %42
42: ; preds = %41, %26
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* %2
%10 = icmp ugt i32 %9, 1
%11 = load i32, i32* %3
%12 = icmp ugt i32 %11, 7
%13 = select i1 %10, i1 true, i1 %12
br i1 %13, label %7, label %14
14: ; preds = %7
%15 = icmp eq i32 %9, 1
%16 = load i32, i32* %1
%17 = shl nuw nsw i32 1, %11
%18 = xor i32 %16, %17
%19 = or i32 %16, %17
%20 = select i1 %15, i32 %19, i32 %18
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}