#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 number, Make, position;
  int result;
  scanf("%d", &number);
  scanf("%d", &Make);
  scanf("%d", &position);
  result = -1;
  if (Make == 0) {
    result = number & ~(1 << position);
  } else if (Make == 1) {
    result = number | (1 << position);
  }
  printf("%d", result);
  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
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>
movl   $0xffffffff,-0x14(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    118c <main+0x6c>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    11af <main+0x8f>
cmpl   $0x1,-0xc(%rbp)
jne    11aa <main+0x8a>
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    11af <main+0x8f>
mov    -0x14(%rbp),%esi
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0xc(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x1,%eax
je     1172 <main+0x52>
mov    $0xffffffff,%esi
test   %eax,%eax
jne    117d <main+0x5d>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%al
btr    %eax,%esi
jmp    117d <main+0x5d>
mov    0x8(%rsp),%esi
mov    0x4(%rsp),%al
bts    %eax,%esi
lea    0xe7c(%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
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%7 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %3)
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %4)
store i32 -1, i32* %5
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %17
11: ; preds = %0
%12 = load i32, i32* %2
%13 = load i32, i32* %4
%14 = shl i32 1, %13
%15 = xor i32 %14, -1
%16 = and i32 %12, %15
store i32 %16, i32* %5
br label %26
17: ; preds = %0
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %25
20: ; preds = %17
%21 = load i32, i32* %2
%22 = load i32, i32* %4
%23 = shl i32 1, %22
%24 = or i32 %21, %23
store i32 %24, i32* %5
br label %25
25: ; preds = %20, %17
br label %26
26: ; preds = %25, %11
%27 = load i32, i32* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %27)
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 %22 [
i32 0, label %11
i32 1, label %17
]
11: ; preds = %0
%12 = load i32, i32* %1
%13 = load i32, i32* %3
%14 = shl nuw i32 1, %13
%15 = xor i32 %14, -1
%16 = and i32 %12, %15
br label %22
17: ; preds = %0
%18 = load i32, i32* %1
%19 = load i32, i32* %3
%20 = shl nuw i32 1, %19
%21 = or i32 %20, %18
br label %22
22: ; preds = %0, %17, %11
%23 = phi i32 [ %16, %11 ], [ %21, %17 ], [ -1, %0 ]
%24 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
ret i32 0
}