#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);
extern void DCC_byte_dump(unsigned char byte) {
  int i;
  for (i = 7; i >= 0; i--)
    printf("%c", (byte & (1 << i)) ? '1' : '0');
  return;
}


x86 assembly (clang, -O0):
<DCC_byte_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     116c <DCC_byte_dump+0x5c>
movzbl -0x1(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    $0x1,%eax
shl    %cl,%eax
and    %eax,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
lea    0xeaa(%rip),%rdi
movsbl %al,%esi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1125 <DCC_byte_dump+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DCC_byte_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xed4(%rip),%xmm1
pand   %xmm0,%xmm1
pand   0xed8(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebx
mov    %ebx,%eax
and    $0x2,%al
shr    %al
mov    %al,0x7(%rsp)
mov    %ebx,%r15d
and    $0x4,%r15b
shr    $0x2,%r15b
mov    %ebx,%r12d
and    $0x8,%r12b
shr    $0x3,%r12b
mov    %ebx,%r13d
and    $0x10,%r13b
shr    $0x4,%r13b
mov    %ebx,%r14d
and    $0x20,%r14b
shr    $0x5,%r14b
mov    %ebx,%ebp
and    $0x40,%bpl
shr    $0x6,%bpl
mov    %ebx,%eax
shr    $0x7,%al
movzbl %al,%esi
xor    $0x31,%esi
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
movzbl %bpl,%esi
xor    $0x31,%esi
lea    0xe6b(%rip),%rbp
mov    %rbp,%rdi
call   1030 <printf@plt>
movzbl %r14b,%esi
xor    $0x31,%esi
mov    %rbp,%rdi
call   1030 <printf@plt>
movzbl %r13b,%esi
xor    $0x31,%esi
mov    %rbp,%rdi
call   1030 <printf@plt>
movzbl %r12b,%esi
xor    $0x31,%esi
mov    %rbp,%rdi
call   1030 <printf@plt>
movzbl %r15b,%esi
xor    $0x31,%esi
mov    %rbp,%rdi
call   1030 <printf@plt>
movzbl 0x7(%rsp),%esi
xor    $0x31,%esi
mov    %rbp,%rdi
call   1030 <printf@plt>
and    $0x1,%ebx
xor    $0x31,%ebx
mov    %rbp,%rdi
mov    %ebx,%esi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
define void @DCC_byte_dump(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i32
store i8 %0, i8* %2
store i32 7, i32* %3
br label %4
4: ; preds = %18, %1
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %21
7: ; preds = %4
%8 = load i8, i8* %2
%9 = zext i8 %8 to i32
%10 = load i32, i32* %3
%11 = shl i32 1, %10
%12 = and i32 %9, %11
%13 = icmp ne i32 %12, 0
%14 = zext i1 %13 to i64
%15 = select i1 %13, i32 49, i32 48
%16 = trunc i32 %15 to i8
%17 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %16)
br label %18
18: ; preds = %7
%19 = load i32, i32* %3
%20 = add nsw i32 %19, -1
store i32 %20, i32* %3
br label %4
21: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%c\00"
define void @DCC_byte_dump(i8 zeroext %0) {
%2 = zext i8 %0 to i32
%3 = insertelement <8 x i32> poison, i32 %2, i64 0
%4 = shufflevector <8 x i32> %3, <8 x i32> poison, <8 x i32> zeroinitializer
%5 = and <8 x i32> %4, <i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128>
%6 = icmp eq <8 x i32> %5, zeroinitializer
%7 = extractelement <8 x i1> %6, i64 7
%8 = select i1 %7, i8 48, i8 49
%9 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%10 = extractelement <8 x i1> %6, i64 6
%11 = select i1 %10, i8 48, i8 49
%12 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = extractelement <8 x i1> %6, i64 5
%14 = select i1 %13, i8 48, i8 49
%15 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %14)
%16 = extractelement <8 x i1> %6, i64 4
%17 = select i1 %16, i8 48, i8 49
%18 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %17)
%19 = extractelement <8 x i1> %6, i64 3
%20 = select i1 %19, i8 48, i8 49
%21 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %20)
%22 = extractelement <8 x i1> %6, i64 2
%23 = select i1 %22, i8 48, i8 49
%24 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %23)
%25 = extractelement <8 x i1> %6, i64 1
%26 = select i1 %25, i8 48, i8 49
%27 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %26)
%28 = extractelement <8 x i1> %6, i64 0
%29 = select i1 %28, i8 48, i8 49
%30 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %29)
ret void
}