#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*/ print_bin(char);
int /*<<< orphan*/ printf(char *);
int main(void) {
  char x, y;
  x = 0b00011010;
  y = 0b00000011;
  printf("x:\n");
  print_bin(x);
  printf("y:\n");
  print_bin(y);
  printf("LOGICAL AND: x&y\n");
  print_bin(x & y);
  printf("LOGICAL OR: x|y\n");
  print_bin(x | y);
  printf("LOGICAL XOR: x^y\n");
  print_bin(x ^ y);
  printf("LOGICAL NOT: ~x\n");
  print_bin(~x);
  printf("LEFT SHIFT (1 BIT): x<<1\n");
  print_bin(x << 1);
  printf("RIGHT SHIFT (1 BIT): x>>1\n");
  print_bin(x >> 1);
  printf("LEFT SHIFT (2 BIT): x<<2\n");
  print_bin(x << 2);
  printf("RIGHT SHIFT (2 BIT): x>>2\n");
  print_bin(x >> 2);
  int N, M;
  printf("x:\n");
  print_bin(x);
  N = 2;
  printf("SET THE Nth BIT OF x TO 1 (WITH HERE N=2 IE THE THIRD BIT)\n");
  printf("- LONG VERSION:  x  = x | (1<<N)\n");
  printf("- SHORT VERSION: x |= (1<<N)\n");
  printf("USUALLY, x IS PORTB, PORTC or PORTD\n");
  print_bin(x | (1 << N));
  N = 3;
  printf("SET THE Nth BIT OF x TO 0 (WITH HERE N=3 IE THE FOURTH BIT)\n");
  printf("- LONG VERSION:  x  = x & ~(1<<N)\n");
  printf("- SHORT VERSION: x &= ~(1<<N)\n");
  printf("USUALLY, x IS PORTB, PORTC or PORTD\n");
  print_bin(x & ~(1 << N));
  N = 2;
  M = 0;
  printf("SET THE Nth AND THE Mth BIT OF x TO 1 (WITH HERE N=2 IE THE THIRD "
         "BIT AND M=0 IE THE FIRST BIT)\n");
  printf("- LONG VERSION:  x  = x | ( (1<<N)|(1<<M) )\n");
  printf("- SHORT VERSION: x |= (1<<N)|(1<<M)\n");
  printf("USUALLY, x IS PORTB, PORTC or PORTD\n");
  print_bin(x | ((1 << N) | (1 << M)));
  N = 3;
  M = 1;
  printf("SET THE Nth AND THE Mth BIT OF x TO 0 (WITH HERE N=3 IE THE FOURTH "
         "BIT AND M=1 IE THE SECOND BIT)\n");
  printf("- LONG VERSION:  x  = x & ~( (1<<N)|(1<<M) )\n");
  printf("- SHORT VERSION: x &= ~( (1<<N)|(1<<M) )\n");
  printf("USUALLY, x IS PORTB, PORTC or PORTD\n");
  print_bin(x & ~((1 << N) | (1 << M)));
  printf("x:\n");
  print_bin(x);
  N = 2;
  printf("TEST THE Nth BIT OF x (WITH HERE N=2 IE THE THIRD BIT)\n");
  printf("res = x & (1<<N)\n");
  printf("USUALLY, x IS PORTB, PORTC or PORTD\n");
  if (x & (1 << N))
    printf(">>> true\n");
  else
    printf(">>> false\n");
  printf("\n");
  printf("x:\n");
  print_bin(x);
  N = 2;
  printf("TOGGLE THE Nth BIT OF x (WITH HERE N=2 IE THE THIRD BIT)\n");
  printf("- LONG VERSION:  x  = x ^ (1<<N)\n");
  printf("- SHORT VERSION: x ^= (1<<N)\n");
  printf("USUALLY, x IS PORTB, PORTC or PORTD\n");
  print_bin(x ^ (1 << N));
  N = 2;
  M = 1;
  printf("TOGGLE THE Nth AND THE Mth BIT OF x (WITH HERE N=2 IE THE THIRD BIT "
         "AND M=1 IE THE SECOND BIT)\n");
  printf("- LONG VERSION:  x  = x ^ ( (1<<N)|(1<<M) )\n");
  printf("- SHORT VERSION: x ^= (1<<N)|(1<<M)\n");
  printf("USUALLY, x IS PORTB, PORTC or PORTD\n");
  print_bin(x ^ ((1 << N) | (1 << M)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x1a,-0x5(%rbp)
movb   $0x3,-0x6(%rbp)
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1040 <print_bin@plt>
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x6(%rbp),%edi
call   1040 <print_bin@plt>
lea    0xea0(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
and    %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
or     %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xe87(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
movsbl -0x6(%rbp),%ecx
xor    %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xe7b(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
xor    $0xffffffff,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xe71(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
shl    $0x1,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
sar    $0x1,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xe70(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
shl    $0x2,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xe6f(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
sar    $0x2,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xdb7(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1040 <print_bin@plt>
movl   $0x2,-0xc(%rbp)
lea    0xe53(%rip),%rdi
call   1030 <printf@plt>
lea    0xe83(%rip),%rdi
call   1030 <printf@plt>
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
lea    0xeab(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
movl   $0x3,-0xc(%rbp)
lea    0xea3(%rip),%rdi
call   1030 <printf@plt>
lea    0xed4(%rip),%rdi
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
movl   $0x2,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
lea    0xf1c(%rip),%rdi
call   1030 <printf@plt>
lea    0xf3d(%rip),%rdi
call   1030 <printf@plt>
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,-0x18(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x18(%rbp),%ecx
or     %edx,%ecx
or     %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
movl   $0x3,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xf12(%rip),%rdi
call   1030 <printf@plt>
lea    0xf69(%rip),%rdi
call   1030 <printf@plt>
lea    0xf8b(%rip),%rdi
call   1030 <printf@plt>
lea    0xd97(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x14(%rbp),%ecx
or     %edx,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
lea    0xc2a(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1040 <print_bin@plt>
movl   $0x2,-0xc(%rbp)
lea    0xf54(%rip),%rdi
call   1030 <printf@plt>
lea    0xf80(%rip),%rdi
call   1030 <printf@plt>
lea    0xd2a(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     143b <main+0x31b>
lea    0xf5f(%rip),%rdi
call   1030 <printf@plt>
jmp    1447 <main+0x327>
lea    0xf58(%rip),%rdi
call   1030 <printf@plt>
lea    0x105c(%rip),%rdi
call   1030 <printf@plt>
lea    0xba6(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%edi
call   1040 <print_bin@plt>
movl   $0x2,-0xc(%rbp)
lea    0xf2f(%rip),%rdi
call   1030 <printf@plt>
lea    0xf5d(%rip),%rdi
call   1030 <printf@plt>
lea    0xf73(%rip),%rdi
call   1030 <printf@plt>
lea    0xc9a(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
xor    %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
lea    0xf51(%rip),%rdi
call   1030 <printf@plt>
lea    0xfa5(%rip),%rdi
call   1030 <printf@plt>
lea    0xfc6(%rip),%rdi
call   1030 <printf@plt>
lea    0xc42(%rip),%rdi
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
mov    -0xc(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,-0x1c(%rbp)
mov    -0x10(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    -0x1c(%rbp),%ecx
or     %edx,%ecx
xor    %ecx,%eax
movsbl %al,%edi
call   1040 <print_bin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0x121f(%rip),%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x1a,%edi
call   1050 <print_bin@plt>
lea    0xeac(%rip),%rdi
call   1040 <puts@plt>
mov    $0x3,%edi
call   1050 <print_bin@plt>
lea    0xe99(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1050 <print_bin@plt>
lea    0xe94(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1b,%edi
call   1050 <print_bin@plt>
lea    0xe8e(%rip),%rdi
call   1040 <puts@plt>
mov    $0x19,%edi
call   1050 <print_bin@plt>
lea    0xe89(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffe5,%edi
call   1050 <print_bin@plt>
lea    0xe83(%rip),%rdi
call   1040 <puts@plt>
mov    $0x34,%edi
call   1050 <print_bin@plt>
lea    0xe86(%rip),%rdi
call   1040 <puts@plt>
mov    $0xd,%edi
call   1050 <print_bin@plt>
lea    0xe8a(%rip),%rdi
call   1040 <puts@plt>
mov    $0x68,%edi
call   1050 <print_bin@plt>
lea    0xe8d(%rip),%rdi
call   1040 <puts@plt>
mov    $0x6,%edi
call   1050 <print_bin@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x1a,%edi
call   1050 <print_bin@plt>
lea    0xe7f(%rip),%rdi
call   1040 <puts@plt>
lea    0xeae(%rip),%rdi
call   1040 <puts@plt>
lea    0xec3(%rip),%rdi
call   1040 <puts@plt>
lea    0x1233(%rip),%rbx
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1e,%edi
call   1050 <print_bin@plt>
lea    0xebb(%rip),%rdi
call   1040 <puts@plt>
lea    0xeeb(%rip),%rdi
call   1040 <puts@plt>
lea    0xf01(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x12,%edi
call   1050 <print_bin@plt>
lea    0xf01(%rip),%rdi
call   1040 <puts@plt>
lea    0xf55(%rip),%rdi
call   1040 <puts@plt>
lea    0xf75(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1f,%edi
call   1050 <print_bin@plt>
lea    0xf7b(%rip),%rdi
call   1040 <puts@plt>
lea    0xfd1(%rip),%rdi
call   1040 <puts@plt>
lea    0xff2(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x10,%edi
call   1050 <print_bin@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x1a,%edi
call   1050 <print_bin@plt>
lea    0xfeb(%rip),%rdi
call   1040 <puts@plt>
lea    0x1016(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
lea    0x1013(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r14,%rdi
call   1040 <puts@plt>
mov    $0x1a,%edi
call   1050 <print_bin@plt>
lea    0xff8(%rip),%rdi
call   1040 <puts@plt>
lea    0x1025(%rip),%rdi
call   1040 <puts@plt>
lea    0x103a(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1e,%edi
call   1050 <print_bin@plt>
lea    0x1039(%rip),%rdi
call   1040 <puts@plt>
lea    0x108c(%rip),%rdi
call   1040 <puts@plt>
lea    0x10ac(%rip),%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
call   1040 <puts@plt>
mov    $0x1c,%edi
call   1050 <print_bin@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"x:\0A\00"
@.str.1 = [4 x i8] c"y:\0A\00"
@.str.2 = [18 x i8] c"LOGICAL AND: x&y\0A\00"
@.str.3 = [17 x i8] c"LOGICAL OR: x|y\0A\00"
@.str.4 = [18 x i8] c"LOGICAL XOR: x^y\0A\00"
@.str.5 = [17 x i8] c"LOGICAL NOT: ~x\0A\00"
@.str.6 = [26 x i8] c"LEFT SHIFT (1 BIT): x<<1\0A\00"
@.str.7 = [27 x i8] c"RIGHT SHIFT (1 BIT): x>>1\0A\00"
@.str.8 = [26 x i8] c"LEFT SHIFT (2 BIT): x<<2\0A\00"
@.str.9 = [27 x i8] c"RIGHT SHIFT (2 BIT): x>>2\0A\00"
@.str.10 = [60 x i8] c"SET THE Nth BIT OF x TO 1 (WITH HERE N=2 IE THE THIRD BIT)\0A\00"
@.str.11 = [34 x i8] c"- LONG VERSION: x = x | (1<<N)\0A\00"
@.str.12 = [30 x i8] c"- SHORT VERSION: x |= (1<<N)\0A\00"
@.str.13 = [37 x i8] c"USUALLY, x IS PORTB, PORTC or PORTD\0A\00"
@.str.14 = [61 x i8] c"SET THE Nth BIT OF x TO 0 (WITH HERE N=3 IE THE FOURTH BIT)\0A\00"
@.str.15 = [35 x i8] c"- LONG VERSION: x = x & ~(1<<N)\0A\00"
@.str.16 = [31 x i8] c"- SHORT VERSION: x &= ~(1<<N)\0A\00"
@.str.17 = [97 x i8] c"SET THE Nth AND THE Mth BIT OF x TO 1 (WITH HERE N=2 IE THE THIRD BIT AND M=0 IE THE FIRST BIT)\0A\00"
@.str.18 = [45 x i8] c"- LONG VERSION: x = x | ( (1<<N)|(1<<M) )\0A\00"
@.str.19 = [37 x i8] c"- SHORT VERSION: x |= (1<<N)|(1<<M)\0A\00"
@.str.20 = [99 x i8] c"SET THE Nth AND THE Mth BIT OF x TO 0 (WITH HERE N=3 IE THE FOURTH BIT AND M=1 IE THE SECOND BIT)\0A\00"
@.str.21 = [46 x i8] c"- LONG VERSION: x = x & ~( (1<<N)|(1<<M) )\0A\00"
@.str.22 = [42 x i8] c"- SHORT VERSION: x &= ~( (1<<N)|(1<<M) )\0A\00"
@.str.23 = [56 x i8] c"TEST THE Nth BIT OF x (WITH HERE N=2 IE THE THIRD BIT)\0A\00"
@.str.24 = [18 x i8] c"res = x & (1<<N)\0A\00"
@.str.25 = [10 x i8] c">>> true\0A\00"
@.str.26 = [11 x i8] c">>> false\0A\00"
@.str.27 = [2 x i8] c"\0A\00"
@.str.28 = [58 x i8] c"TOGGLE THE Nth BIT OF x (WITH HERE N=2 IE THE THIRD BIT)\0A\00"
@.str.29 = [34 x i8] c"- LONG VERSION: x = x ^ (1<<N)\0A\00"
@.str.30 = [30 x i8] c"- SHORT VERSION: x ^= (1<<N)\0A\00"
@.str.31 = [96 x i8] c"TOGGLE THE Nth AND THE Mth BIT OF x (WITH HERE N=2 IE THE THIRD BIT AND M=1 IE THE SECOND BIT)\0A\00"
@.str.32 = [45 x i8] c"- LONG VERSION: x = x ^ ( (1<<N)|(1<<M) )\0A\00"
@.str.33 = [37 x i8] c"- SHORT VERSION: x ^= (1<<N)|(1<<M)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i8 26, i8* %2
store i8 3, i8* %3
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = load i8, i8* %2
%8 = call i32 @print_bin(i8 signext %7)
%9 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = load i8, i8* %3
%11 = call i32 @print_bin(i8 signext %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%13 = load i8, i8* %2
%14 = sext i8 %13 to i32
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = and i32 %14, %16
%18 = trunc i32 %17 to i8
%19 = call i32 @print_bin(i8 signext %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = load i8, i8* %3
%24 = sext i8 %23 to i32
%25 = or i32 %22, %24
%26 = trunc i32 %25 to i8
%27 = call i32 @print_bin(i8 signext %26)
%28 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%29 = load i8, i8* %2
%30 = sext i8 %29 to i32
%31 = load i8, i8* %3
%32 = sext i8 %31 to i32
%33 = xor i32 %30, %32
%34 = trunc i32 %33 to i8
%35 = call i32 @print_bin(i8 signext %34)
%36 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0))
%37 = load i8, i8* %2
%38 = sext i8 %37 to i32
%39 = xor i32 %38, -1
%40 = trunc i32 %39 to i8
%41 = call i32 @print_bin(i8 signext %40)
%42 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.6, i64 0, i64 0))
%43 = load i8, i8* %2
%44 = sext i8 %43 to i32
%45 = shl i32 %44, 1
%46 = trunc i32 %45 to i8
%47 = call i32 @print_bin(i8 signext %46)
%48 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0))
%49 = load i8, i8* %2
%50 = sext i8 %49 to i32
%51 = ashr i32 %50, 1
%52 = trunc i32 %51 to i8
%53 = call i32 @print_bin(i8 signext %52)
%54 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.8, i64 0, i64 0))
%55 = load i8, i8* %2
%56 = sext i8 %55 to i32
%57 = shl i32 %56, 2
%58 = trunc i32 %57 to i8
%59 = call i32 @print_bin(i8 signext %58)
%60 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%61 = load i8, i8* %2
%62 = sext i8 %61 to i32
%63 = ashr i32 %62, 2
%64 = trunc i32 %63 to i8
%65 = call i32 @print_bin(i8 signext %64)
%66 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%67 = load i8, i8* %2
%68 = call i32 @print_bin(i8 signext %67)
store i32 2, i32* %4
%69 = call i32 @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.10, i64 0, i64 0))
%70 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.11, i64 0, i64 0))
%71 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.12, i64 0, i64 0))
%72 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%73 = load i8, i8* %2
%74 = sext i8 %73 to i32
%75 = load i32, i32* %4
%76 = shl i32 1, %75
%77 = or i32 %74, %76
%78 = trunc i32 %77 to i8
%79 = call i32 @print_bin(i8 signext %78)
store i32 3, i32* %4
%80 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.14, i64 0, i64 0))
%81 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i64 0, i64 0))
%82 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0))
%83 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%84 = load i8, i8* %2
%85 = sext i8 %84 to i32
%86 = load i32, i32* %4
%87 = shl i32 1, %86
%88 = xor i32 %87, -1
%89 = and i32 %85, %88
%90 = trunc i32 %89 to i8
%91 = call i32 @print_bin(i8 signext %90)
store i32 2, i32* %4
store i32 0, i32* %5
%92 = call i32 @printf(i8* getelementptr inbounds ([97 x i8], [97 x i8]* @.str.17, i64 0, i64 0))
%93 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.18, i64 0, i64 0))
%94 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.19, i64 0, i64 0))
%95 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%96 = load i8, i8* %2
%97 = sext i8 %96 to i32
%98 = load i32, i32* %4
%99 = shl i32 1, %98
%100 = load i32, i32* %5
%101 = shl i32 1, %100
%102 = or i32 %99, %101
%103 = or i32 %97, %102
%104 = trunc i32 %103 to i8
%105 = call i32 @print_bin(i8 signext %104)
store i32 3, i32* %4
store i32 1, i32* %5
%106 = call i32 @printf(i8* getelementptr inbounds ([99 x i8], [99 x i8]* @.str.20, i64 0, i64 0))
%107 = call i32 @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.21, i64 0, i64 0))
%108 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.22, i64 0, i64 0))
%109 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%110 = load i8, i8* %2
%111 = sext i8 %110 to i32
%112 = load i32, i32* %4
%113 = shl i32 1, %112
%114 = load i32, i32* %5
%115 = shl i32 1, %114
%116 = or i32 %113, %115
%117 = xor i32 %116, -1
%118 = and i32 %111, %117
%119 = trunc i32 %118 to i8
%120 = call i32 @print_bin(i8 signext %119)
%121 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%122 = load i8, i8* %2
%123 = call i32 @print_bin(i8 signext %122)
store i32 2, i32* %4
%124 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.23, i64 0, i64 0))
%125 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.24, i64 0, i64 0))
%126 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%127 = load i8, i8* %2
%128 = sext i8 %127 to i32
%129 = load i32, i32* %4
%130 = shl i32 1, %129
%131 = and i32 %128, %130
%132 = icmp ne i32 %131, 0
br i1 %132, label %133, label %135
133: ; preds = %0
%134 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.25, i64 0, i64 0))
br label %137
135: ; preds = %0
%136 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.26, i64 0, i64 0))
br label %137
137: ; preds = %135, %133
%138 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.27, i64 0, i64 0))
%139 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%140 = load i8, i8* %2
%141 = call i32 @print_bin(i8 signext %140)
store i32 2, i32* %4
%142 = call i32 @printf(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str.28, i64 0, i64 0))
%143 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.29, i64 0, i64 0))
%144 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.30, i64 0, i64 0))
%145 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%146 = load i8, i8* %2
%147 = sext i8 %146 to i32
%148 = load i32, i32* %4
%149 = shl i32 1, %148
%150 = xor i32 %147, %149
%151 = trunc i32 %150 to i8
%152 = call i32 @print_bin(i8 signext %151)
store i32 2, i32* %4
store i32 1, i32* %5
%153 = call i32 @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str.31, i64 0, i64 0))
%154 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.32, i64 0, i64 0))
%155 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.33, i64 0, i64 0))
%156 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.13, i64 0, i64 0))
%157 = load i8, i8* %2
%158 = sext i8 %157 to i32
%159 = load i32, i32* %4
%160 = shl i32 1, %159
%161 = load i32, i32* %5
%162 = shl i32 1, %161
%163 = or i32 %160, %162
%164 = xor i32 %158, %163
%165 = trunc i32 %164 to i8
%166 = call i32 @print_bin(i8 signext %165)
ret i32 0
}

LLVM IR (-O2):
@str.34 = [3 x i8] c"y:\00"
@str.35 = [17 x i8] c"LOGICAL AND: x&y\00"
@str.36 = [16 x i8] c"LOGICAL OR: x|y\00"
@str.37 = [17 x i8] c"LOGICAL XOR: x^y\00"
@str.38 = [16 x i8] c"LOGICAL NOT: ~x\00"
@str.39 = [25 x i8] c"LEFT SHIFT (1 BIT): x<<1\00"
@str.40 = [26 x i8] c"RIGHT SHIFT (1 BIT): x>>1\00"
@str.41 = [25 x i8] c"LEFT SHIFT (2 BIT): x<<2\00"
@str.42 = [26 x i8] c"RIGHT SHIFT (2 BIT): x>>2\00"
@str.44 = [59 x i8] c"SET THE Nth BIT OF x TO 1 (WITH HERE N=2 IE THE THIRD BIT)\00"
@str.45 = [33 x i8] c"- LONG VERSION: x = x | (1<<N)\00"
@str.46 = [29 x i8] c"- SHORT VERSION: x |= (1<<N)\00"
@str.48 = [60 x i8] c"SET THE Nth BIT OF x TO 0 (WITH HERE N=3 IE THE FOURTH BIT)\00"
@str.49 = [34 x i8] c"- LONG VERSION: x = x & ~(1<<N)\00"
@str.50 = [30 x i8] c"- SHORT VERSION: x &= ~(1<<N)\00"
@str.52 = [96 x i8] c"SET THE Nth AND THE Mth BIT OF x TO 1 (WITH HERE N=2 IE THE THIRD BIT AND M=0 IE THE FIRST BIT)\00"
@str.53 = [44 x i8] c"- LONG VERSION: x = x | ( (1<<N)|(1<<M) )\00"
@str.54 = [36 x i8] c"- SHORT VERSION: x |= (1<<N)|(1<<M)\00"
@str.56 = [98 x i8] c"SET THE Nth AND THE Mth BIT OF x TO 0 (WITH HERE N=3 IE THE FOURTH BIT AND M=1 IE THE SECOND BIT)\00"
@str.57 = [45 x i8] c"- LONG VERSION: x = x & ~( (1<<N)|(1<<M) )\00"
@str.58 = [41 x i8] c"- SHORT VERSION: x &= ~( (1<<N)|(1<<M) )\00"
@str.61 = [55 x i8] c"TEST THE Nth BIT OF x (WITH HERE N=2 IE THE THIRD BIT)\00"
@str.62 = [17 x i8] c"res = x & (1<<N)\00"
@str.64 = [10 x i8] c">>> false\00"
@str.65 = [3 x i8] c"x:\00"
@str.66 = [57 x i8] c"TOGGLE THE Nth BIT OF x (WITH HERE N=2 IE THE THIRD BIT)\00"
@str.67 = [33 x i8] c"- LONG VERSION: x = x ^ (1<<N)\00"
@str.68 = [29 x i8] c"- SHORT VERSION: x ^= (1<<N)\00"
@str.70 = [95 x i8] c"TOGGLE THE Nth AND THE Mth BIT OF x (WITH HERE N=2 IE THE THIRD BIT AND M=1 IE THE SECOND BIT)\00"
@str.71 = [44 x i8] c"- LONG VERSION: x = x ^ ( (1<<N)|(1<<M) )\00"
@str.72 = [36 x i8] c"- SHORT VERSION: x ^= (1<<N)|(1<<M)\00"
@str.73 = [36 x i8] c"USUALLY, x IS PORTB, PORTC or PORTD\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.65, i64 0, i64 0))
%2 = tail call i32 @print_bin(i8 signext 26)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.34, i64 0, i64 0))
%4 = tail call i32 @print_bin(i8 signext 3)
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.35, i64 0, i64 0))
%6 = tail call i32 @print_bin(i8 signext 2)
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.36, i64 0, i64 0))
%8 = tail call i32 @print_bin(i8 signext 27)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.37, i64 0, i64 0))
%10 = tail call i32 @print_bin(i8 signext 25)
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.38, i64 0, i64 0))
%12 = tail call i32 @print_bin(i8 signext -27)
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.39, i64 0, i64 0))
%14 = tail call i32 @print_bin(i8 signext 52)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.40, i64 0, i64 0))
%16 = tail call i32 @print_bin(i8 signext 13)
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.41, i64 0, i64 0))
%18 = tail call i32 @print_bin(i8 signext 104)
%19 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.42, i64 0, i64 0))
%20 = tail call i32 @print_bin(i8 signext 6)
%21 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.65, i64 0, i64 0))
%22 = tail call i32 @print_bin(i8 signext 26)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @str.44, i64 0, i64 0))
%24 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.45, i64 0, i64 0))
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.46, i64 0, i64 0))
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.73, i64 0, i64 0))
%27 = tail call i32 @print_bin(i8 signext 30)
%28 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @str.48, i64 0, i64 0))
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.49, i64 0, i64 0))
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.50, i64 0, i64 0))
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.73, i64 0, i64 0))
%32 = tail call i32 @print_bin(i8 signext 18)
%33 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([96 x i8], [96 x i8]* @str.52, i64 0, i64 0))
%34 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.53, i64 0, i64 0))
%35 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.54, i64 0, i64 0))
%36 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.73, i64 0, i64 0))
%37 = tail call i32 @print_bin(i8 signext 31)
%38 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([98 x i8], [98 x i8]* @str.56, i64 0, i64 0))
%39 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.57, i64 0, i64 0))
%40 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.58, i64 0, i64 0))
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.73, i64 0, i64 0))
%42 = tail call i32 @print_bin(i8 signext 16)
%43 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.65, i64 0, i64 0))
%44 = tail call i32 @print_bin(i8 signext 26)
%45 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str.61, i64 0, i64 0))
%46 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.62, i64 0, i64 0))
%47 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.73, i64 0, i64 0))
%48 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.64, i64 0, i64 0))
%49 = tail call i32 @putchar(i32 10)
%50 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str.65, i64 0, i64 0))
%51 = tail call i32 @print_bin(i8 signext 26)
%52 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([57 x i8], [57 x i8]* @str.66, i64 0, i64 0))
%53 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.67, i64 0, i64 0))
%54 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.68, i64 0, i64 0))
%55 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.73, i64 0, i64 0))
%56 = tail call i32 @print_bin(i8 signext 30)
%57 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str.70, i64 0, i64 0))
%58 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.71, i64 0, i64 0))
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.72, i64 0, i64 0))
%60 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.73, i64 0, i64 0))
%61 = tail call i32 @print_bin(i8 signext 28)
ret i32 0
}