#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 main() {
  int a = 6;
  printf((a & 8) ? "ucuncu bit: 1\n" : "ucuncu bit: 0\n");
  printf((a & 0x10000) ? "17. bit: 1\n" : "17. bit: 0\n");
  int x = 30;
  printf("x: %d\n", x | 0x20);
  int y = 6;
  printf("y: %d\n", y & (~0x4));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x6,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
and    $0x8,%ecx
lea    0xedc(%rip),%rdi
lea    0xec6(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%ecx
and    $0x10000,%ecx
lea    0xed2(%rip),%rdi
lea    0xebf(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1e,-0xc(%rbp)
mov    -0xc(%rbp),%esi
or     $0x20,%esi
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x6,-0x10(%rbp)
mov    -0x10(%rbp),%esi
and    $0xfffffffb,%esi
lea    0xea1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xec0(%rip),%rdi
mov    $0x3e,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeb4(%rip),%rdi
mov    $0x2,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"ucuncu bit: 1\0A\00"
@.str.1 = [15 x i8] c"ucuncu bit: 0\0A\00"
@.str.2 = [12 x i8] c"17. bit: 1\0A\00"
@.str.3 = [12 x i8] c"17. bit: 0\0A\00"
@.str.4 = [7 x i8] c"x: %d\0A\00"
@.str.5 = [7 x i8] c"y: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
store i32 6, i32* %2
%5 = load i32, i32* %2
%6 = and i32 %5, 8
%7 = icmp ne i32 %6, 0
%8 = zext i1 %7 to i64
%9 = select i1 %7, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0)
%10 = call i32 (i8*, ...) @printf(i8* %9)
%11 = load i32, i32* %2
%12 = and i32 %11, 65536
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0)
%16 = call i32 (i8*, ...) @printf(i8* %15)
store i32 30, i32* %3
%17 = load i32, i32* %3
%18 = or i32 %17, 32
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 %18)
store i32 6, i32* %4
%20 = load i32, i32* %4
%21 = and i32 %20, -5
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str.4 = [7 x i8] c"x: %d\0A\00"
@.str.5 = [7 x i8] c"y: %d\0A\00"
@str = [14 x i8] c"ucuncu bit: 0\00"
@str.6 = [11 x i8] c"17. bit: 0\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.6, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0), i32 62)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), i32 2)
ret i32 0
}