#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*/ strcat(char *, char *);
char *rc_byte_to_binary(unsigned char c) {
  static char b[9];
  unsigned char x = (unsigned char)c;
  b[0] = '\0';
  unsigned char z;
  for (z = 128; z > 0; z >>= 1) {
    if (x & z)
      strcat(b, "1");
    else
      strcat(b, "0");
  }
  return b;
}


x86 assembly (clang, -O0):
<rc_byte_to_binary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    -0x1(%rbp),%al
mov    %al,-0x2(%rbp)
movb   $0x0,0x2efe(%rip)
movb   $0x80,-0x3(%rbp)
movzbl -0x3(%rbp),%eax
cmp    $0x0,%eax
jle    118e <rc_byte_to_binary+0x7e>
movzbl -0x2(%rbp),%eax
movzbl -0x3(%rbp),%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1167 <rc_byte_to_binary+0x57>
lea    0x2ed3(%rip),%rdi
lea    0xea3(%rip),%rsi
call   1030 <strcat@plt>
jmp    117a <rc_byte_to_binary+0x6a>
lea    0x2ebb(%rip),%rdi
lea    0xe8d(%rip),%rsi
call   1030 <strcat@plt>
jmp    117f <rc_byte_to_binary+0x6f>
movzbl -0x3(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x3(%rbp)
jmp    112f <rc_byte_to_binary+0x1f>
lea    0x2e94(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rc_byte_to_binary>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x2f0b(%rip)
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xed1(%rip),%xmm1
pand   %xmm0,%xmm1
pand   0xed5(%rip),%xmm0
lea    0x2ee7(%rip),%r14
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebp
lea    0xec1(%rip),%r15
lea    0xeb8(%rip),%rbx
test   $0x80,%bpl
mov    %rbx,%rsi
cmovne %r15,%rsi
mov    %r14,%rdi
call   1030 <strcat@plt>
test   $0x40,%bpl
mov    %rbx,%rsi
cmovne %r15,%rsi
mov    %r14,%rdi
call   1030 <strcat@plt>
test   $0x20,%bpl
mov    %rbx,%rsi
cmovne %r15,%rsi
mov    %r14,%rdi
call   1030 <strcat@plt>
test   $0x10,%bpl
mov    %rbx,%rsi
cmovne %r15,%rsi
mov    %r14,%rdi
call   1030 <strcat@plt>
test   $0x8,%bpl
mov    %rbx,%rsi
cmovne %r15,%rsi
mov    %r14,%rdi
call   1030 <strcat@plt>
test   $0x4,%bpl
mov    %rbx,%rsi
cmovne %r15,%rsi
mov    %r14,%rdi
call   1030 <strcat@plt>
test   $0x2,%bpl
mov    %rbx,%rsi
cmovne %r15,%rsi
mov    %r14,%rdi
call   1030 <strcat@plt>
test   $0x1,%bpl
cmovne %r15,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <strcat@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@rc_byte_to_binary.b = internal global [9 x i8] zeroinitializer
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define i8* @rc_byte_to_binary(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
store i8 %0, i8* %2
%5 = load i8, i8* %2
store i8 %5, i8* %3
store i8 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0)
store i8 -128, i8* %4
br label %6
6: ; preds = %22, %1
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %27
10: ; preds = %6
%11 = load i8, i8* %3
%12 = zext i8 %11 to i32
%13 = load i8, i8* %4
%14 = zext i8 %13 to i32
%15 = and i32 %12, %14
%16 = icmp ne i32 %15, 0
br i1 %16, label %17, label %19
17: ; preds = %10
%18 = call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %21
19: ; preds = %10
%20 = call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %21
21: ; preds = %19, %17
br label %22
22: ; preds = %21
%23 = load i8, i8* %4
%24 = zext i8 %23 to i32
%25 = ashr i32 %24, 1
%26 = trunc i32 %25 to i8
store i8 %26, i8* %4
br label %6
27: ; preds = %6
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0)
}

LLVM IR (-O2):
@rc_byte_to_binary.b = internal global [9 x i8] zeroinitializer
@.str = [2 x i8] c"1\00"
@.str.1 = [2 x i8] c"0\00"
define i8* @rc_byte_to_binary(i8 zeroext %0) {
store i8 0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 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* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%9 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %8)
%10 = extractelement <8 x i1> %6, i64 6
%11 = select i1 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%12 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %11)
%13 = extractelement <8 x i1> %6, i64 5
%14 = select i1 %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%15 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %14)
%16 = extractelement <8 x i1> %6, i64 4
%17 = select i1 %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%18 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %17)
%19 = extractelement <8 x i1> %6, i64 3
%20 = select i1 %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%21 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %20)
%22 = extractelement <8 x i1> %6, i64 2
%23 = select i1 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%24 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %23)
%25 = extractelement <8 x i1> %6, i64 1
%26 = select i1 %25, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%27 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %26)
%28 = extractelement <8 x i1> %6, i64 0
%29 = select i1 %28, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
%30 = tail call i32 @strcat(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0), i8* %29)
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @rc_byte_to_binary.b, i64 0, i64 0)
}