#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
uint8_t displayBinary_uint8_t(uint8_t input) {
  printf(" %x '%c' = ", input, input);
  int i;
  for (i = 8 - 1; i >= 0; i--) {
    if ((input >> i) & 1u) {
      printf("1");
    } else {
      printf("0");
    }
  }
  printf("\n");
  return input;
}


x86 assembly (clang, -O0):
<displayBinary_uint8_t>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x4(%rbp),%edx
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1188 <displayBinary_uint8_t+0x78>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
sar    %cl,%eax
and    $0x1,%eax
cmp    $0x0,%eax
je     1167 <displayBinary_uint8_t+0x57>
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1175 <displayBinary_uint8_t+0x65>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    117a <displayBinary_uint8_t+0x6a>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <displayBinary_uint8_t+0x26>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<displayBinary_uint8_t>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0xed4(%rip),%rdi
mov    %ebx,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebx,%eax
and    $0x80,%eax
cmp    $0x1,%eax
mov    $0x31,%ebp
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x40,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x20,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x10,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x8,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x4,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
and    $0x2,%eax
cmp    $0x1,%eax
sbb    $0x0,%ebp
mov    %ebp,%edi
call   1030 <putchar@plt>
mov    %ebx,%edi
and    $0x1,%edi
or     $0x30,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [12 x i8] c" %x '%c' = \00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"0\00"
@.str.3 = [2 x i8] c"\0A\00"
define i32 @displayBinary_uint8_t(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
store i32 7, i32* %3
br label %7
7: ; preds = %21, %1
%8 = load i32, i32* %3
%9 = icmp sge i32 %8, 0
br i1 %9, label %10, label %24
10: ; preds = %7
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = ashr i32 %11, %12
%14 = and i32 %13, 1
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %18
16: ; preds = %10
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %20
18: ; preds = %10
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %20
20: ; preds = %18, %16
br label %21
21: ; preds = %20
%22 = load i32, i32* %3
%23 = add nsw i32 %22, -1
store i32 %23, i32* %3
br label %7
24: ; preds = %7
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@.str = [12 x i8] c" %x '%c' = \00"
define i32 @displayBinary_uint8_t(i32 returned %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %0)
%3 = and i32 %0, 128
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 48, i32 49
%6 = tail call i32 @putchar(i32 %5)
%7 = and i32 %0, 64
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 48, i32 49
%10 = tail call i32 @putchar(i32 %9)
%11 = and i32 %0, 32
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i32 48, i32 49
%14 = tail call i32 @putchar(i32 %13)
%15 = and i32 %0, 16
%16 = icmp eq i32 %15, 0
%17 = select i1 %16, i32 48, i32 49
%18 = tail call i32 @putchar(i32 %17)
%19 = and i32 %0, 8
%20 = icmp eq i32 %19, 0
%21 = select i1 %20, i32 48, i32 49
%22 = tail call i32 @putchar(i32 %21)
%23 = and i32 %0, 4
%24 = icmp eq i32 %23, 0
%25 = select i1 %24, i32 48, i32 49
%26 = tail call i32 @putchar(i32 %25)
%27 = and i32 %0, 2
%28 = icmp eq i32 %27, 0
%29 = select i1 %28, i32 48, i32 49
%30 = tail call i32 @putchar(i32 %29)
%31 = and i32 %0, 1
%32 = or i32 %31, 48
%33 = tail call i32 @putchar(i32 %32)
%34 = tail call i32 @putchar(i32 10)
ret i32 %0
}