#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 *, char *, int, int, int, int, int, int, int,
                          int);
void print_regbin(char *str_register, uint8_t integer) {
  printf("%s: %d%d%d%d%d%d%d%d ", str_register, ((integer & (1 << 7)) != 0),
         ((integer & (1 << 6)) != 0), ((integer & (1 << 5)) != 0),
         ((integer & (1 << 4)) != 0), ((integer & (1 << 3)) != 0),
         ((integer & (1 << 2)) != 0), ((integer & (1 << 1)) != 0),
         ((integer & (1 << 0)) != 0));
}


x86 assembly (clang, -O0):
<print_regbin>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x38,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
and    $0x80,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%edx
mov    -0x14(%rbp),%eax
and    $0x40,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%ecx
mov    -0x14(%rbp),%eax
and    $0x20,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%r8d
mov    -0x14(%rbp),%eax
and    $0x10,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%r9d
mov    -0x14(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%ebx
mov    -0x14(%rbp),%eax
and    $0x4,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%r11d
mov    -0x14(%rbp),%eax
and    $0x2,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%r10d
mov    -0x14(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
lea    0xe47(%rip),%rdi
mov    %ebx,(%rsp)
mov    %r11d,0x8(%rsp)
mov    %r10d,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <printf@plt>
add    $0x38,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_regbin>:
push   %rbx
mov    %esi,%eax
mov    %rdi,%rsi
mov    %eax,%edx
shr    $0x7,%edx
and    $0x1,%edx
mov    %eax,%ecx
shr    $0x6,%ecx
and    $0x1,%ecx
mov    %eax,%r8d
shr    $0x5,%r8d
and    $0x1,%r8d
mov    %eax,%r9d
shr    $0x4,%r9d
and    $0x1,%r9d
mov    %eax,%r10d
shr    $0x3,%r10d
and    $0x1,%r10d
mov    %eax,%r11d
shr    $0x2,%r11d
and    $0x1,%r11d
mov    %eax,%ebx
shr    %ebx
and    $0x1,%ebx
and    $0x1,%eax
lea    0xe9d(%rip),%rdi
push   %rax
push   %rbx
push   %r11
push   %r10
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"%s: %d%d%d%d%d%d%d%d \00"
define void @print_regbin(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = and i32 %6, 128
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i32
%10 = load i32, i32* %4
%11 = and i32 %10, 64
%12 = icmp ne i32 %11, 0
%13 = zext i1 %12 to i32
%14 = load i32, i32* %4
%15 = and i32 %14, 32
%16 = icmp ne i32 %15, 0
%17 = zext i1 %16 to i32
%18 = load i32, i32* %4
%19 = and i32 %18, 16
%20 = icmp ne i32 %19, 0
%21 = zext i1 %20 to i32
%22 = load i32, i32* %4
%23 = and i32 %22, 8
%24 = icmp ne i32 %23, 0
%25 = zext i1 %24 to i32
%26 = load i32, i32* %4
%27 = and i32 %26, 4
%28 = icmp ne i32 %27, 0
%29 = zext i1 %28 to i32
%30 = load i32, i32* %4
%31 = and i32 %30, 2
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i32
%34 = load i32, i32* %4
%35 = and i32 %34, 1
%36 = icmp ne i32 %35, 0
%37 = zext i1 %36 to i32
%38 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %9, i32 %13, i32 %17, i32 %21, i32 %25, i32 %29, i32 %33, i32 %37)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"%s: %d%d%d%d%d%d%d%d \00"
define void @print_regbin(i8* %0, i32 %1) {
%3 = lshr i32 %1, 7
%4 = and i32 %3, 1
%5 = lshr i32 %1, 6
%6 = and i32 %5, 1
%7 = lshr i32 %1, 5
%8 = and i32 %7, 1
%9 = lshr i32 %1, 4
%10 = and i32 %9, 1
%11 = lshr i32 %1, 3
%12 = and i32 %11, 1
%13 = lshr i32 %1, 2
%14 = and i32 %13, 1
%15 = lshr i32 %1, 1
%16 = and i32 %15, 1
%17 = and i32 %1, 1
%18 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %4, i32 %6, i32 %8, i32 %10, i32 %12, i32 %14, i32 %16, i32 %17)
ret void
}