#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*/ putchar(char);
void Display_Byte(const unsigned char Ch) {
  unsigned char i, c = Ch;
  unsigned char Mask = 1 << 7;
  for (i = 1; i <= 8; i++) {
    putchar(c & Mask ? '1' : '0');
    c <<= 1;
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<Display_Byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x3(%rbp)
movb   $0x80,-0x4(%rbp)
movb   $0x1,-0x2(%rbp)
movzbl -0x2(%rbp),%eax
cmp    $0x8,%eax
jg     1172 <Display_Byte+0x62>
movzbl -0x3(%rbp),%edx
movzbl -0x4(%rbp),%eax
and    %eax,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x3(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    112c <Display_Byte+0x1c>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Display_Byte>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
xor    %edi,%edi
test   %bl,%bl
setns  %dil
xor    $0x31,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x40,%al
cmp    $0x1,%al
mov    $0x31,%ebp
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x20,%al
cmp    $0x1,%al
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x10,%al
cmp    $0x1,%al
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x8,%al
cmp    $0x1,%al
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x4,%al
cmp    $0x1,%al
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x2,%al
cmp    $0x1,%al
sbb    $0x0,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
and    $0x1,%bl
or     $0x30,%bl
movzbl %bl,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @Display_Byte(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
store i8 %0, i8* %2
%6 = load i8, i8* %2
store i8 %6, i8* %4
store i8 -128, i8* %5
store i8 1, i8* %3
br label %7
7: ; preds = %26, %1
%8 = load i8, i8* %3
%9 = zext i8 %8 to i32
%10 = icmp sle i32 %9, 8
br i1 %10, label %11, label %29
11: ; preds = %7
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = and i32 %13, %15
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i64
%19 = select i1 %17, i32 49, i32 48
%20 = trunc i32 %19 to i8
%21 = call i32 @putchar(i8 signext %20)
%22 = load i8, i8* %4
%23 = zext i8 %22 to i32
%24 = shl i32 %23, 1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %4
br label %26
26: ; preds = %11
%27 = load i8, i8* %3
%28 = add i8 %27, 1
store i8 %28, i8* %3
br label %7
29: ; preds = %7
%30 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
define void @Display_Byte(i8 zeroext %0) {
%2 = icmp sgt i8 %0, -1
%3 = select i1 %2, i8 48, i8 49
%4 = tail call i32 @putchar(i8 signext %3)
%5 = and i8 %0, 64
%6 = icmp eq i8 %5, 0
%7 = select i1 %6, i8 48, i8 49
%8 = tail call i32 @putchar(i8 signext %7)
%9 = and i8 %0, 32
%10 = icmp eq i8 %9, 0
%11 = select i1 %10, i8 48, i8 49
%12 = tail call i32 @putchar(i8 signext %11)
%13 = and i8 %0, 16
%14 = icmp eq i8 %13, 0
%15 = select i1 %14, i8 48, i8 49
%16 = tail call i32 @putchar(i8 signext %15)
%17 = and i8 %0, 8
%18 = icmp eq i8 %17, 0
%19 = select i1 %18, i8 48, i8 49
%20 = tail call i32 @putchar(i8 signext %19)
%21 = and i8 %0, 4
%22 = icmp eq i8 %21, 0
%23 = select i1 %22, i8 48, i8 49
%24 = tail call i32 @putchar(i8 signext %23)
%25 = and i8 %0, 2
%26 = icmp eq i8 %25, 0
%27 = select i1 %26, i8 48, i8 49
%28 = tail call i32 @putchar(i8 signext %27)
%29 = and i8 %0, 1
%30 = or i8 %29, 48
%31 = tail call i32 @putchar(i8 signext %30)
%32 = tail call i32 @putchar(i8 signext 10)
ret void
}