#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*/ USARTPutc(char);
void putcbin(char c) {
  char i;
  for (i = 0; i < 8; i++) {
    if (c & (1 << (7 - i)))
      USARTPutc('1');
    else
      USARTPutc('0');
  }
  USARTPutc(' ');
}


x86 assembly (clang, -O0):
<putcbin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x8,%eax
jge    117d <putcbin+0x6d>
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%edx
mov    $0x7,%ecx
sub    %edx,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1161 <putcbin+0x51>
mov    $0x31,%edi
call   1030 <USARTPutc@plt>
jmp    116b <putcbin+0x5b>
mov    $0x30,%edi
call   1030 <USARTPutc@plt>
jmp    1170 <putcbin+0x60>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
jmp    1122 <putcbin+0x12>
mov    $0x20,%edi
call   1030 <USARTPutc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putcbin>:
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,%r14d
and    $0x4,%r14b
shr    $0x2,%r14b
mov    %ebx,%r15d
and    $0x8,%r15b
shr    $0x3,%r15b
mov    %ebx,%r12d
and    $0x10,%r12b
shr    $0x4,%r12b
mov    %ebx,%r13d
and    $0x20,%r13b
shr    $0x5,%r13b
mov    %ebx,%ebp
and    $0x40,%bpl
shr    $0x6,%bpl
mov    %ebx,%eax
shr    $0x7,%al
movzbl %al,%edi
xor    $0x31,%edi
call   1030 <USARTPutc@plt>
movzbl %bpl,%edi
xor    $0x31,%edi
call   1030 <USARTPutc@plt>
movzbl %r13b,%edi
xor    $0x31,%edi
call   1030 <USARTPutc@plt>
movzbl %r12b,%edi
xor    $0x31,%edi
call   1030 <USARTPutc@plt>
movzbl %r15b,%edi
xor    $0x31,%edi
call   1030 <USARTPutc@plt>
movzbl %r14b,%edi
xor    $0x31,%edi
call   1030 <USARTPutc@plt>
movzbl 0x7(%rsp),%edi
xor    $0x31,%edi
call   1030 <USARTPutc@plt>
and    $0x1,%ebx
xor    $0x31,%ebx
mov    %ebx,%edi
call   1030 <USARTPutc@plt>
mov    $0x20,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <USARTPutc@plt>

LLVM IR (-O0):
define void @putcbin(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %2
store i8 0, i8* %3
br label %4
4: ; preds = %22, %1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %25
8: ; preds = %4
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = sub nsw i32 7, %12
%14 = shl i32 1, %13
%15 = and i32 %10, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %8
%18 = call i32 @USARTPutc(i8 signext 49)
br label %21
19: ; preds = %8
%20 = call i32 @USARTPutc(i8 signext 48)
br label %21
21: ; preds = %19, %17
br label %22
22: ; preds = %21
%23 = load i8, i8* %3
%24 = add i8 %23, 1
store i8 %24, i8* %3
br label %4
25: ; preds = %4
%26 = call i32 @USARTPutc(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @putcbin(i8 signext %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 @USARTPutc(i8 signext %8)
%10 = extractelement <8 x i1> %6, i64 6
%11 = select i1 %10, i8 48, i8 49
%12 = tail call i32 @USARTPutc(i8 signext %11)
%13 = extractelement <8 x i1> %6, i64 5
%14 = select i1 %13, i8 48, i8 49
%15 = tail call i32 @USARTPutc(i8 signext %14)
%16 = extractelement <8 x i1> %6, i64 4
%17 = select i1 %16, i8 48, i8 49
%18 = tail call i32 @USARTPutc(i8 signext %17)
%19 = extractelement <8 x i1> %6, i64 3
%20 = select i1 %19, i8 48, i8 49
%21 = tail call i32 @USARTPutc(i8 signext %20)
%22 = extractelement <8 x i1> %6, i64 2
%23 = select i1 %22, i8 48, i8 49
%24 = tail call i32 @USARTPutc(i8 signext %23)
%25 = extractelement <8 x i1> %6, i64 1
%26 = select i1 %25, i8 48, i8 49
%27 = tail call i32 @USARTPutc(i8 signext %26)
%28 = extractelement <8 x i1> %6, i64 0
%29 = select i1 %28, i8 48, i8 49
%30 = tail call i32 @USARTPutc(i8 signext %29)
%31 = tail call i32 @USARTPutc(i8 signext 32)
ret void
}