#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 number, zero_or_one, position;
  scanf("%d %d %d", &number, &zero_or_one, &position);
  int result;
  if (zero_or_one == 1) {
    int mask = zero_or_one << position;
    result = mask | number;
  } else {
    int mask = ~(1 << position);
    result = mask & number;
  }
  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
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
cmpl   $0x1,-0xc(%rbp)
jne    116a <main+0x4a>
mov    -0xc(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
or     -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    1183 <main+0x63>
mov    -0x10(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
and    -0x8(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%esi
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1040 <scanf@plt>
mov    0x10(%rsp),%cl
mov    $0x1,%esi
shl    %cl,%esi
cmpl   $0x1,0x14(%rsp)
jne    1157 <main+0x37>
or     0xc(%rsp),%esi
jmp    115d <main+0x3d>
not    %esi
and    0xc(%rsp),%esi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
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
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 1
br i1 %10, label %11, label %18
11: ; preds = %0
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = shl i32 %12, %13
store i32 %14, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %2
%17 = or i32 %15, %16
store i32 %17, i32* %5
br label %25
18: ; preds = %0
%19 = load i32, i32* %4
%20 = shl i32 1, %19
%21 = xor i32 %20, -1
store i32 %21, i32* %7
%22 = load i32, i32* %7
%23 = load i32, i32* %2
%24 = and i32 %22, %23
store i32 %24, i32* %5
br label %25
25: ; preds = %18, %11
%26 = load i32, i32* %5
%27 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %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*
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 1
%10 = load i32, i32* %3
%11 = shl nuw i32 1, %10
br i1 %9, label %12, label %15
12: ; preds = %0
%13 = load i32, i32* %1
%14 = or i32 %11, %13
br label %19
15: ; preds = %0
%16 = xor i32 %11, -1
%17 = load i32, i32* %1
%18 = and i32 %17, %16
br label %19
19: ; preds = %15, %12
%20 = phi i32 [ %14, %12 ], [ %18, %15 ]
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
ret i32 0
}