#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 *, ...);
void dump_conf_byte(int reg) {
  unsigned char byte_reg;
  byte_reg = reg & 0x00ff;
  printf("   7   6   5   4  3 2  1    0\n");
  printf("|Done|THF|TLF|NVB|X|X|POL|1SHOT| \n");
  printf("   %d   %d   %d   %d  %d %d  %d    %d\n", ((byte_reg >> 7) & 0x01),
         ((byte_reg >> 6) & 0x01), ((byte_reg >> 5) & 0x01),
         ((byte_reg >> 4) & 0x01), ((byte_reg >> 3) & 0x01),
         ((byte_reg >> 2) & 0x01), ((byte_reg >> 1) & 0x01), (byte_reg & 0x01));
}


x86 assembly (clang, -O0):
<dump_conf_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    %al,-0x5(%rbp)
lea    0xed3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movzbl -0x5(%rbp),%esi
sar    $0x7,%esi
and    $0x1,%esi
movzbl -0x5(%rbp),%edx
sar    $0x6,%edx
and    $0x1,%edx
movzbl -0x5(%rbp),%ecx
sar    $0x5,%ecx
and    $0x1,%ecx
movzbl -0x5(%rbp),%r8d
sar    $0x4,%r8d
and    $0x1,%r8d
movzbl -0x5(%rbp),%r9d
sar    $0x3,%r9d
and    $0x1,%r9d
movzbl -0x5(%rbp),%r11d
sar    $0x2,%r11d
and    $0x1,%r11d
movzbl -0x5(%rbp),%r10d
sar    $0x1,%r10d
and    $0x1,%r10d
movzbl -0x5(%rbp),%eax
and    $0x1,%eax
lea    0xea0(%rip),%rdi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_conf_byte>:
push   %rbx
mov    %edi,%ebx
lea    0xefd(%rip),%rdi
call   1030 <puts@plt>
lea    0xf0f(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%esi
shr    $0x7,%esi
and    $0x1,%esi
mov    %ebx,%edx
shr    $0x6,%edx
and    $0x1,%edx
mov    %ebx,%ecx
shr    $0x5,%ecx
and    $0x1,%ecx
mov    %ebx,%r8d
shr    $0x4,%r8d
and    $0x1,%r8d
mov    %ebx,%r9d
shr    $0x3,%r9d
and    $0x1,%r9d
mov    %ebx,%r10d
shr    $0x2,%r10d
and    $0x1,%r10d
mov    %ebx,%r11d
shr    %r11d
and    $0x1,%r11d
and    $0x1,%ebx
sub    $0x8,%rsp
lea    0xe74(%rip),%rdi
xor    %eax,%eax
push   %rbx
push   %r11
push   %r10
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [31 x i8] c" 7 6 5 4 3 2 1 0\0A\00"
@.str.1 = [35 x i8] c"|Done|THF|TLF|NVB|X|X|POL|1SHOT| \0A\00"
@.str.2 = [39 x i8] c" %d %d %d %d %d %d %d %d\0A\00"
define void @dump_conf_byte(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = ashr i32 %10, 7
%12 = and i32 %11, 1
%13 = load i8, i8* %3
%14 = zext i8 %13 to i32
%15 = ashr i32 %14, 6
%16 = and i32 %15, 1
%17 = load i8, i8* %3
%18 = zext i8 %17 to i32
%19 = ashr i32 %18, 5
%20 = and i32 %19, 1
%21 = load i8, i8* %3
%22 = zext i8 %21 to i32
%23 = ashr i32 %22, 4
%24 = and i32 %23, 1
%25 = load i8, i8* %3
%26 = zext i8 %25 to i32
%27 = ashr i32 %26, 3
%28 = and i32 %27, 1
%29 = load i8, i8* %3
%30 = zext i8 %29 to i32
%31 = ashr i32 %30, 2
%32 = and i32 %31, 1
%33 = load i8, i8* %3
%34 = zext i8 %33 to i32
%35 = ashr i32 %34, 1
%36 = and i32 %35, 1
%37 = load i8, i8* %3
%38 = zext i8 %37 to i32
%39 = and i32 %38, 1
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %12, i32 %16, i32 %20, i32 %24, i32 %28, i32 %32, i32 %36, i32 %39)
ret void
}

LLVM IR (-O2):
@.str.2 = [39 x i8] c" %d %d %d %d %d %d %d %d\0A\00"
@str = [30 x i8] c" 7 6 5 4 3 2 1 0\00"
@str.3 = [34 x i8] c"|Done|THF|TLF|NVB|X|X|POL|1SHOT| \00"
define void @dump_conf_byte(i32 %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.3, i64 0, i64 0))
%4 = lshr i32 %0, 7
%5 = and i32 %4, 1
%6 = lshr i32 %0, 6
%7 = and i32 %6, 1
%8 = lshr i32 %0, 5
%9 = and i32 %8, 1
%10 = lshr i32 %0, 4
%11 = and i32 %10, 1
%12 = lshr i32 %0, 3
%13 = and i32 %12, 1
%14 = lshr i32 %0, 2
%15 = and i32 %14, 1
%16 = lshr i32 %0, 1
%17 = and i32 %16, 1
%18 = and i32 %0, 1
%19 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %18)
ret void
}