#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 *, char);
int main(void) {
  void print_binary(char *, int);
  signed char i_28 = 0b11100100;
  unsigned char i228 = 0b11100100;
  printf("signed char 0b11100100 is : %d \n", i_28);
  printf("unsigned char 0b11100100 is : %x \n", i228);
  printf("unsigned char 0b10111000 is : %x \n", 0b10111000);
  printf("unsigned char 0b10101101 is : %x \n", 0b10101101);
  char i = -1;
  print_binary("-1 >> 0 = ", i >> 0);
  print_binary("-1 << 0 = ", i << 0);
  char c1 = 0xff;
  printf("c1 = %d\n", c1);
  print_binary("c1 = ", c1);
  print_binary("c1 << 0 = ", c1 << 0);
  unsigned char uc1 = 0xff;
  print_binary("unsigned char uc1 = ", uc1);
  char c2 = 0xfe;
  printf("c2 = %d\n", c2);
  print_binary("c2 = ", c2);
  unsigned char uc2 = 0xfe;
  print_binary("unsigned char uc2 = ", uc2);
  char b1 = 0b0001010;
  char b2 = 0b0010100;
  char b3 = 0b0011110;
  print_binary("b1 & b2 = ", b1 & b2);
  print_binary("b1 | b2 = ", b1 | b2);
  print_binary("b1 ^ b2 = ", b1 ^ b2);
  print_binary("b1 ^ b3 = ", b1 ^ b3);
  print_binary("b2 ^ b3 = ", b2 ^ b3);
  print_binary("b3 >> 1 = ", b3 >> 1);
  print_binary("b3 << 1 = ", b3 << 1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0xe4,-0x1(%rbp)
movb   $0xe4,-0x2(%rbp)
lea    0xec9(%rip),%rdi
movsbl -0x1(%rbp),%esi
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
movsbl -0x2(%rbp),%esi
call   1030 <printf@plt>
lea    0xeed(%rip),%rdi
mov    $0xffffffb8,%esi
call   1030 <printf@plt>
lea    0xeff(%rip),%rdi
mov    $0xffffffad,%esi
call   1030 <printf@plt>
movb   $0xff,-0x3(%rbp)
movsbl -0x3(%rbp),%esi
sar    $0x0,%esi
lea    0xf06(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0x3(%rbp),%esi
shl    $0x0,%esi
lea    0xefe(%rip),%rdi
call   1040 <print_binary@plt>
movb   $0xff,-0x4(%rbp)
lea    0xef9(%rip),%rdi
movsbl -0x4(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x4(%rbp),%esi
lea    0xf08(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0x4(%rbp),%esi
shl    $0x0,%esi
lea    0xedb(%rip),%rdi
call   1040 <print_binary@plt>
movb   $0xff,-0x5(%rbp)
movzbl -0x5(%rbp),%esi
lea    0xed2(%rip),%rdi
call   1040 <print_binary@plt>
movb   $0xfe,-0x6(%rbp)
lea    0xed7(%rip),%rdi
movsbl -0x6(%rbp),%esi
call   1030 <printf@plt>
movsbl -0x6(%rbp),%esi
lea    0xedb(%rip),%rdi
call   1040 <print_binary@plt>
movb   $0xfe,-0x7(%rbp)
movzbl -0x7(%rbp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <print_binary@plt>
movb   $0xa,-0x8(%rbp)
movb   $0x14,-0x9(%rbp)
movb   $0x1e,-0xa(%rbp)
movsbl -0x8(%rbp),%esi
movsbl -0x9(%rbp),%eax
and    %eax,%esi
lea    0xeab(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0x8(%rbp),%esi
movsbl -0x9(%rbp),%eax
or     %eax,%esi
lea    0xea0(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0x8(%rbp),%esi
movsbl -0x9(%rbp),%eax
xor    %eax,%esi
lea    0xe95(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0x8(%rbp),%esi
movsbl -0xa(%rbp),%eax
xor    %eax,%esi
lea    0xe8a(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0x9(%rbp),%esi
movsbl -0xa(%rbp),%eax
xor    %eax,%esi
lea    0xe7f(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0xa(%rbp),%esi
sar    $0x1,%esi
lea    0xe77(%rip),%rdi
call   1040 <print_binary@plt>
movsbl -0xa(%rbp),%esi
shl    $0x1,%esi
lea    0xe6f(%rip),%rdi
call   1040 <print_binary@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0xffffffe4,%esi
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
mov    $0xffffffe4,%esi
call   1030 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0xffffffb8,%esi
call   1030 <printf@plt>
lea    0xf0c(%rip),%rdi
mov    $0xffffffad,%esi
call   1030 <printf@plt>
lea    0xf1e(%rip),%rdi
mov    $0xffffffff,%esi
call   1040 <print_binary@plt>
lea    0xf18(%rip),%rdi
mov    $0xffffffff,%esi
call   1040 <print_binary@plt>
lea    0xf12(%rip),%rdi
mov    $0xffffffff,%esi
call   1030 <printf@plt>
lea    0xf24(%rip),%rdi
mov    $0xffffffff,%esi
call   1040 <print_binary@plt>
lea    0xef9(%rip),%rdi
mov    $0xffffffff,%esi
call   1040 <print_binary@plt>
lea    0xef3(%rip),%rdi
mov    $0xff,%esi
call   1040 <print_binary@plt>
lea    0xef7(%rip),%rdi
mov    $0xfffffffe,%esi
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0xfffffffe,%esi
call   1040 <print_binary@plt>
lea    0xede(%rip),%rdi
mov    $0xfe,%esi
call   1040 <print_binary@plt>
lea    0xee2(%rip),%rdi
xor    %esi,%esi
call   1040 <print_binary@plt>
lea    0xedf(%rip),%rdi
mov    $0x1e,%esi
call   1040 <print_binary@plt>
lea    0xed9(%rip),%rdi
mov    $0x1e,%esi
call   1040 <print_binary@plt>
lea    0xed3(%rip),%rdi
mov    $0x14,%esi
call   1040 <print_binary@plt>
lea    0xecd(%rip),%rdi
mov    $0xa,%esi
call   1040 <print_binary@plt>
lea    0xec7(%rip),%rdi
mov    $0xf,%esi
call   1040 <print_binary@plt>
lea    0xec1(%rip),%rdi
mov    $0x3c,%esi
call   1040 <print_binary@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [33 x i8] c"signed char 0b11100100 is : %d \0A\00"
@.str.1 = [35 x i8] c"unsigned char 0b11100100 is : %x \0A\00"
@.str.2 = [35 x i8] c"unsigned char 0b10111000 is : %x \0A\00"
@.str.3 = [35 x i8] c"unsigned char 0b10101101 is : %x \0A\00"
@.str.4 = [11 x i8] c"-1 >> 0 = \00"
@.str.5 = [11 x i8] c"-1 << 0 = \00"
@.str.6 = [9 x i8] c"c1 = %d\0A\00"
@.str.7 = [6 x i8] c"c1 = \00"
@.str.8 = [11 x i8] c"c1 << 0 = \00"
@.str.9 = [21 x i8] c"unsigned char uc1 = \00"
@.str.10 = [9 x i8] c"c2 = %d\0A\00"
@.str.11 = [6 x i8] c"c2 = \00"
@.str.12 = [21 x i8] c"unsigned char uc2 = \00"
@.str.13 = [11 x i8] c"b1 & b2 = \00"
@.str.14 = [11 x i8] c"b1 | b2 = \00"
@.str.15 = [11 x i8] c"b1 ^ b2 = \00"
@.str.16 = [11 x i8] c"b1 ^ b3 = \00"
@.str.17 = [11 x i8] c"b2 ^ b3 = \00"
@.str.18 = [11 x i8] c"b3 >> 1 = \00"
@.str.19 = [11 x i8] c"b3 << 1 = \00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
%10 = alloca i8
store i8 -28, i8* %1
store i8 -28, i8* %2
%11 = load i8, i8* %1
%12 = call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = load i8, i8* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8 signext %13)
%15 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8 signext -72)
%16 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8 signext -83)
store i8 -1, i8* %3
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = ashr i32 %18, 0
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = shl i32 %21, 0
store i8 -1, i8* %4
%23 = load i8, i8* %4
%24 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8 signext %23)
%25 = load i8, i8* %4
%26 = sext i8 %25 to i32
%27 = load i8, i8* %4
%28 = sext i8 %27 to i32
%29 = shl i32 %28, 0
store i8 -1, i8* %5
%30 = load i8, i8* %5
%31 = zext i8 %30 to i32
store i8 -2, i8* %6
%32 = load i8, i8* %6
%33 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8 signext %32)
%34 = load i8, i8* %6
%35 = sext i8 %34 to i32
store i8 -2, i8* %7
%36 = load i8, i8* %7
%37 = zext i8 %36 to i32
store i8 10, i8* %8
store i8 20, i8* %9
store i8 30, i8* %10
%38 = load i8, i8* %8
%39 = sext i8 %38 to i32
%40 = load i8, i8* %9
%41 = sext i8 %40 to i32
%42 = and i32 %39, %41
%43 = load i8, i8* %8
%44 = sext i8 %43 to i32
%45 = load i8, i8* %9
%46 = sext i8 %45 to i32
%47 = or i32 %44, %46
%48 = load i8, i8* %8
%49 = sext i8 %48 to i32
%50 = load i8, i8* %9
%51 = sext i8 %50 to i32
%52 = xor i32 %49, %51
%53 = load i8, i8* %8
%54 = sext i8 %53 to i32
%55 = load i8, i8* %10
%56 = sext i8 %55 to i32
%57 = xor i32 %54, %56
%58 = load i8, i8* %9
%59 = sext i8 %58 to i32
%60 = load i8, i8* %10
%61 = sext i8 %60 to i32
%62 = xor i32 %59, %61
%63 = load i8, i8* %10
%64 = sext i8 %63 to i32
%65 = ashr i32 %64, 1
%66 = load i8, i8* %10
%67 = sext i8 %66 to i32
%68 = shl i32 %67, 1
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"signed char 0b11100100 is : %d \0A\00"
@.str.1 = [35 x i8] c"unsigned char 0b11100100 is : %x \0A\00"
@.str.2 = [35 x i8] c"unsigned char 0b10111000 is : %x \0A\00"
@.str.3 = [35 x i8] c"unsigned char 0b10101101 is : %x \0A\00"
@.str.4 = [11 x i8] c"-1 >> 0 = \00"
@.str.5 = [11 x i8] c"-1 << 0 = \00"
@.str.6 = [9 x i8] c"c1 = %d\0A\00"
@.str.7 = [6 x i8] c"c1 = \00"
@.str.8 = [11 x i8] c"c1 << 0 = \00"
@.str.9 = [21 x i8] c"unsigned char uc1 = \00"
@.str.10 = [9 x i8] c"c2 = %d\0A\00"
@.str.11 = [6 x i8] c"c2 = \00"
@.str.12 = [21 x i8] c"unsigned char uc2 = \00"
@.str.13 = [11 x i8] c"b1 & b2 = \00"
@.str.14 = [11 x i8] c"b1 | b2 = \00"
@.str.15 = [11 x i8] c"b1 ^ b2 = \00"
@.str.16 = [11 x i8] c"b1 ^ b3 = \00"
@.str.17 = [11 x i8] c"b2 ^ b3 = \00"
@.str.18 = [11 x i8] c"b3 >> 1 = \00"
@.str.19 = [11 x i8] c"b3 << 1 = \00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8 signext -28)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8 signext -28)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0), i8 signext -72)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.3, i64 0, i64 0), i8 signext -83)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.4, i64 0, i64 0), i32 -1)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.5, i64 0, i64 0), i32 -1)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i8 signext -1)
tail call void @print_binary(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i32 -1)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i32 -1)
tail call void @print_binary(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 255)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0), i8 signext -2)
tail call void @print_binary(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.11, i64 0, i64 0), i32 -2)
tail call void @print_binary(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), i32 254)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0), i32 0)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0), i32 30)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.15, i64 0, i64 0), i32 30)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.16, i64 0, i64 0), i32 20)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i32 10)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.18, i64 0, i64 0), i32 15)
tail call void @print_binary(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.19, i64 0, i64 0), i32 60)
ret i32 0
}