#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 *ToBinary8(int nombreNatif) {
  static char buffer[1 + sizeof(int) * 8] = {0};
  char *BinaryChar8 = buffer - 1 + sizeof(int) * 8;
  *BinaryChar8 = 0;
  int iBit;
  for (iBit = 0; iBit < 8; iBit++) {
    int valeurBit = nombreNatif & 0x80;
    nombreNatif <<= 1;
    if (valeurBit == 0)
      strcat(BinaryChar8, "0");
    else
      strcat(BinaryChar8, "1");
  }
  return BinaryChar8;
}


x86 assembly (clang, -O0):
<ToBinary8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    0x2f1e(%rip),%rax
add    $0x1f,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
cmpl   $0x8,-0x14(%rbp)
jge    1198 <ToBinary8+0x88>
mov    -0x4(%rbp),%eax
and    $0x80,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x18(%rbp)
jne    1175 <ToBinary8+0x65>
mov    -0x10(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1030 <strcat@plt>
jmp    1185 <ToBinary8+0x75>
mov    -0x10(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   1030 <strcat@plt>
jmp    118a <ToBinary8+0x7a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1138 <ToBinary8+0x28>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ToBinary8>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x2f41(%rip)
movd   %edi,%xmm0
pshufd $0x0,%xmm0,%xmm0
movdqa 0xed1(%rip),%xmm1
pand   %xmm0,%xmm1
pand   0xed5(%rip),%xmm0
lea    0x2f1d(%rip),%r14
pxor   %xmm2,%xmm2
pcmpeqd %xmm2,%xmm0
pcmpeqd %xmm2,%xmm1
packssdw %xmm0,%xmm1
packsswb %xmm1,%xmm1
pmovmskb %xmm1,%ebp
lea    0xebf(%rip),%r15
lea    0xeba(%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):
@ToBinary8.buffer = internal global [33 x i8] zeroinitializer
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
define i8* @ToBinary8(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8** %3
%6 = load i8*, i8** %3
store i8 0, i8* %6
store i32 0, i32* %4
br label %7
7: ; preds = %24, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %27
10: ; preds = %7
%11 = load i32, i32* %2
%12 = and i32 %11, 128
store i32 %12, i32* %5
%13 = load i32, i32* %2
%14 = shl i32 %13, 1
store i32 %14, i32* %2
%15 = load i32, i32* %5
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %10
%18 = load i8*, i8** %3
%19 = call i32 @strcat(i8* %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %23
20: ; preds = %10
%21 = load i8*, i8** %3
%22 = call i32 @strcat(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %20, %17
br label %24
24: ; preds = %23
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %7
27: ; preds = %7
%28 = load i8*, i8** %3
ret i8* %28
}

LLVM IR (-O2):
@ToBinary8.buffer = internal global [33 x i8] zeroinitializer
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
define i8* @ToBinary8(i32 %0) {
store i8 0, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31)
%2 = insertelement <8 x i32> poison, i32 %0, i64 0
%3 = shufflevector <8 x i32> %2, <8 x i32> poison, <8 x i32> zeroinitializer
%4 = and <8 x i32> %3, <i32 1, i32 2, i32 4, i32 8, i32 16, i32 32, i32 64, i32 128>
%5 = icmp eq <8 x i32> %4, zeroinitializer
%6 = extractelement <8 x i1> %5, i64 7
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%8 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %7)
%9 = extractelement <8 x i1> %5, i64 6
%10 = select i1 %9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%11 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %10)
%12 = extractelement <8 x i1> %5, i64 5
%13 = select i1 %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%14 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %13)
%15 = extractelement <8 x i1> %5, i64 4
%16 = select i1 %15, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%17 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %16)
%18 = extractelement <8 x i1> %5, i64 3
%19 = select i1 %18, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%20 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %19)
%21 = extractelement <8 x i1> %5, i64 2
%22 = select i1 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%23 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %22)
%24 = extractelement <8 x i1> %5, i64 1
%25 = select i1 %24, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%26 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %25)
%27 = extractelement <8 x i1> %5, i64 0
%28 = select i1 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%29 = tail call i32 @strcat(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31), i8* %28)
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @ToBinary8.buffer, i64 0, i64 31)
}