#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 CHAR_BIT;
int /*<<< orphan*/ putchar(char);
void show(const void *object, size_t size) {
  const unsigned char *byte;
  for (byte = object; size--; ++byte) {
    unsigned char mask;
    for (mask = 1 << (CHAR_BIT - 1); mask; mask >>= 1) {
      putchar(mask & *byte ? '1' : '0');
    }
    putchar(' ');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<show>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x10(%rbp)
cmp    $0x0,%rax
je     11b0 <show+0xa0>
mov    0x2e98(%rip),%rax
mov    (%rax),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %al,-0x19(%rbp)
cmpb   $0x0,-0x19(%rbp)
je     1195 <show+0x85>
movzbl -0x19(%rbp),%edx
mov    -0x18(%rbp),%rax
movzbl (%rax),%eax
and    %eax,%edx
mov    $0x30,%eax
mov    $0x31,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
movsbl %al,%edi
call   1030 <putchar@plt>
movzbl -0x19(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x19(%rbp)
jmp    1157 <show+0x47>
mov    $0x20,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1128 <show+0x18>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %rsi,%rsi
je     117e <show+0x6e>
mov    %rsi,%r14
mov    %rdi,%rbx
mov    0x2eb7(%rip),%r15
jmp    1143 <show+0x33>
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
test   %r14,%r14
je     117e <show+0x6e>
add    $0xffffffffffffffff,%r14
mov    (%r15),%cl
add    $0xff,%cl
mov    $0x1,%ebp
shl    %cl,%ebp
test   %bpl,%bpl
je     1130 <show+0x20>
nopl   0x0(%rax)
movzbl (%rbx),%eax
and    %ebp,%eax
cmp    $0x1,%eax
mov    $0x31,%edi
sbb    $0x0,%edi
call   1030 <putchar@plt>
shr    %ebp
and    $0x7f,%ebp
jne    1160 <show+0x50>
jmp    1130 <show+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@CHAR_BIT = global i32 0
define void @show(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8
store i8* %0, i8** %3
store i64 %1, i64* %4
%7 = load i8*, i8** %3
store i8* %7, i8** %5
br label %8
8: ; preds = %39, %2
%9 = load i64, i64* %4
%10 = add i64 %9, -1
store i64 %10, i64* %4
%11 = icmp ne i64 %9, 0
br i1 %11, label %12, label %42
12: ; preds = %8
%13 = load i32, i32* @CHAR_BIT
%14 = sub nsw i32 %13, 1
%15 = shl i32 1, %14
%16 = trunc i32 %15 to i8
store i8 %16, i8* %6
br label %17
17: ; preds = %32, %12
%18 = load i8, i8* %6
%19 = icmp ne i8 %18, 0
br i1 %19, label %20, label %37
20: ; preds = %17
%21 = load i8, i8* %6
%22 = zext i8 %21 to i32
%23 = load i8*, i8** %5
%24 = load i8, i8* %23
%25 = zext i8 %24 to i32
%26 = and i32 %22, %25
%27 = icmp ne i32 %26, 0
%28 = zext i1 %27 to i64
%29 = select i1 %27, i32 49, i32 48
%30 = trunc i32 %29 to i8
%31 = call i32 @putchar(i8 signext %30)
br label %32
32: ; preds = %20
%33 = load i8, i8* %6
%34 = zext i8 %33 to i32
%35 = ashr i32 %34, 1
%36 = trunc i32 %35 to i8
store i8 %36, i8* %6
br label %17
37: ; preds = %17
%38 = call i32 @putchar(i8 signext 32)
br label %39
39: ; preds = %37
%40 = load i8*, i8** %5
%41 = getelementptr inbounds i8, i8* %40, i32 1
store i8* %41, i8** %5
br label %8
42: ; preds = %8
%43 = call i32 @putchar(i8 signext 10)
ret void
}

LLVM IR (-O2):
@CHAR_BIT = global i32 0
define void @show(i8* nocapture %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %28, label %4
4: ; preds = %2, %24
%5 = phi i64 [ %7, %24 ], [ %1, %2 ]
%6 = phi i8* [ %26, %24 ], [ %0, %2 ]
%7 = add i64 %5, -1
%8 = load i32, i32* @CHAR_BIT
%9 = add nsw i32 %8, -1
%10 = shl nuw i32 1, %9
%11 = trunc i32 %10 to i8
%12 = icmp eq i8 %11, 0
br i1 %12, label %24, label %13
13: ; preds = %4, %13
%14 = phi i32 [ %22, %13 ], [ %10, %4 ]
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = and i32 %14, %16
%18 = icmp eq i32 %17, 0
%19 = select i1 %18, i8 48, i8 49
%20 = tail call i32 @putchar(i8 signext %19)
%21 = lshr i32 %14, 1
%22 = and i32 %21, 127
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %13
24: ; preds = %13, %4
%25 = tail call i32 @putchar(i8 signext 32)
%26 = getelementptr inbounds i8, i8* %6, i64 1
%27 = icmp eq i64 %7, 0
br i1 %27, label %28, label %4
28: ; preds = %24, %2
%29 = tail call i32 @putchar(i8 signext 10)
ret void
}