#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 num, pos, bin;
  scanf("%d %d %d", &num, &bin, &pos);
  if ((num & (1 << pos)) == 0)
    num = (num | (1 << pos));
  else
    num = (num ^ (1 << pos));
  printf("%d", num);
  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
lea    -0x10(%rbp),%rdx
lea    -0xc(%rbp),%rcx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
jne    117a <main+0x5a>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    118e <main+0x6e>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe6e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%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    0xc(%rsp),%eax
mov    0x10(%rsp),%ecx
mov    %eax,%edx
btc    %ecx,%edx
mov    %eax,%esi
bts    %ecx,%esi
bt     %ecx,%eax
cmovb  %edx,%esi
mov    %esi,0xc(%rsp)
lea    0xea4(%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
store i32 0, i32* %1
%5 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %4, i32* %3)
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = shl i32 1, %7
%9 = and i32 %6, %8
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %16
11: ; preds = %0
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = shl i32 1, %13
%15 = or i32 %12, %14
store i32 %15, i32* %2
br label %21
16: ; preds = %0
%17 = load i32, i32* %2
%18 = load i32, i32* %3
%19 = shl i32 1, %18
%20 = xor i32 %17, %19
store i32 %20, i32* %2
br label %21
21: ; preds = %16, %11
%22 = load i32, i32* %2
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %22)
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* %3, i32* %2)
%8 = load i32, i32* %1
%9 = load i32, i32* %2
%10 = shl nuw i32 1, %9
%11 = and i32 %10, %8
%12 = icmp eq i32 %11, 0
%13 = xor i32 %10, %8
%14 = or i32 %10, %8
%15 = select i1 %12, i32 %14, i32 %13
store i32 %15, i32* %1
%16 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %15)
ret i32 0
}