void putppt(c) int c;
{
  int i;
  (void)putchar('|');
  for (i = 7; i >= 0; i--) {
    if (i == 2)
      (void)putchar('.');
    if ((c & (1 << i)) != 0)
      (void)putchar('o');
    else
      (void)putchar(' ');
  }
  (void)putchar('|');
  (void)putchar('\n');
}


x86 assembly (clang, -O0):
<putppt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x7c,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
movl   $0x7,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     1198 <putppt+0x88>
cmpl   $0x2,-0x8(%rbp)
jne    114e <putppt+0x3e>
mov    $0x2e,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1179 <putppt+0x69>
mov    $0x6f,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    1185 <putppt+0x75>
mov    $0x20,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
jmp    118a <putppt+0x7a>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    112e <putppt+0x1e>
mov    $0x7c,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
mov    $0xa,%edi
mov    $0x0,%al
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putppt>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%ebx
mov    $0x7c,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
movd   %ebx,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xecd(%rip),%xmm1
pand   %xmm0,%xmm1
pand   0xed1(%rip),%xmm0
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebp
test   $0x80,%bpl
mov    $0x20,%ebx
mov    $0x6f,%r14d
mov    $0x6f,%edi
cmovne %ebx,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   $0x40,%bpl
mov    $0x6f,%edi
cmovne %ebx,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   $0x20,%bpl
mov    $0x6f,%edi
cmovne %ebx,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   $0x10,%bpl
mov    $0x6f,%edi
cmovne %ebx,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   $0x8,%bpl
mov    $0x6f,%edi
cmovne %ebx,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x2e,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   $0x4,%bpl
mov    $0x6f,%edi
cmovne %ebx,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   $0x2,%bpl
mov    $0x6f,%edi
cmovne %ebx,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
test   $0x1,%bpl
cmovne %ebx,%r14d
mov    %r14d,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0x7c,%edi
xor    %eax,%eax
call   1030 <putchar@plt>
mov    $0xa,%edi
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @putppt(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 124)
store i32 7, i32* %3
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %3
%7 = icmp sge i32 %6, 0
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i32, i32* %3
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
br label %13
13: ; preds = %11, %8
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = shl i32 1, %15
%17 = and i32 %14, %16
%18 = icmp ne i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %13
%20 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 111)
br label %23
21: ; preds = %13
%22 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 32)
br label %23
23: ; preds = %21, %19
br label %24
24: ; preds = %23
%25 = load i32, i32* %3
%26 = add nsw i32 %25, -1
store i32 %26, i32* %3
br label %5
27: ; preds = %5
%28 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 124)
%29 = call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret void
}

LLVM IR (-O2):
define void @putppt(i32 %0) {
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 124)
%3 = insertelement <8 x i32> poison, i32 %0, 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, i32 32, i32 111
%9 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %8)
%10 = extractelement <8 x i1> %6, i64 6
%11 = select i1 %10, i32 32, i32 111
%12 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %11)
%13 = extractelement <8 x i1> %6, i64 5
%14 = select i1 %13, i32 32, i32 111
%15 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %14)
%16 = extractelement <8 x i1> %6, i64 4
%17 = select i1 %16, i32 32, i32 111
%18 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %17)
%19 = extractelement <8 x i1> %6, i64 3
%20 = select i1 %19, i32 32, i32 111
%21 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %20)
%22 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 46)
%23 = extractelement <8 x i1> %6, i64 2
%24 = select i1 %23, i32 32, i32 111
%25 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %24)
%26 = extractelement <8 x i1> %6, i64 1
%27 = select i1 %26, i32 32, i32 111
%28 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %27)
%29 = extractelement <8 x i1> %6, i64 0
%30 = select i1 %29, i32 32, i32 111
%31 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 %30)
%32 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 124)
%33 = tail call i32 (i32, ...) bitcast (i32 (...)* @putchar to i32 (i32, ...)*)(i32 10)
ret void
}