#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 print_binaire(char *Msg) {
  int i;
  printf("Binaire : ");
  for (i = 0; i < 10; ++i) {
    printf("%d", Msg[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_binaire>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1163 <print_binaire+0x53>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%esi
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1131 <print_binaire+0x21>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_binaire>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xed2(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl (%rbx),%esi
lea    0xecc(%rip),%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x1(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x2(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x3(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x4(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x5(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x6(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x7(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x8(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movsbl 0x9(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"Binaire : \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define void @print_binaire(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %3
br label %5
5: ; preds = %16, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 10
br i1 %7, label %8, label %19
8: ; preds = %5
%9 = load i8*, i8** %2
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds i8, i8* %9, i64 %11
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %8
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %5
19: ; preds = %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"Binaire : \00"
@.str.1 = [3 x i8] c"%d\00"
define void @print_binaire(i8* nocapture %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = load i8, i8* %0
%4 = sext i8 %3 to i32
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = getelementptr inbounds i8, i8* %0, i64 1
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds i8, i8* %0, i64 2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds i8, i8* %0, i64 3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %16)
%18 = getelementptr inbounds i8, i8* %0, i64 4
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = getelementptr inbounds i8, i8* %0, i64 5
%23 = load i8, i8* %22
%24 = sext i8 %23 to i32
%25 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds i8, i8* %0, i64 6
%27 = load i8, i8* %26
%28 = sext i8 %27 to i32
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %28)
%30 = getelementptr inbounds i8, i8* %0, i64 7
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %32)
%34 = getelementptr inbounds i8, i8* %0, i64 8
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds i8, i8* %0, i64 9
%39 = load i8, i8* %38
%40 = sext i8 %39 to i32
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %40)
%42 = tail call i32 @putchar(i32 10)
ret void
}