#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 EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  char s[] = "toto";
  int i;
  printf("Ma chaine est %s\n", s);
  s[1] = 'x';
  printf("Ma chaine est %s\n", s);
  s[4] = 'y';
  printf("Ma chaine est %s\n", s);
  s[2] = 0;
  printf("Ma chaine est %s\n", s);
  s[2] = 50;
  printf("Ma chaine est %s\n", s);
  for (i = 1; i < 255; i++) {
    printf("caractère codeBase10=%d codeHexa=%x asscii=%c\n", i, i, i);
  }
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0xed4(%rip),%eax
mov    %eax,-0x15(%rbp)
mov    0xecf(%rip),%al
mov    %al,-0x11(%rbp)
lea    -0x15(%rbp),%rsi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x78,-0x14(%rbp)
lea    -0x15(%rbp),%rsi
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x79,-0x11(%rbp)
lea    -0x15(%rbp),%rsi
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x0,-0x13(%rbp)
lea    -0x15(%rbp),%rsi
lea    0xe80(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movb   $0x32,-0x13(%rbp)
lea    -0x15(%rbp),%rsi
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
cmpl   $0xff,-0x1c(%rbp)
jge    11db <main+0xcb>
mov    -0x1c(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x1c(%rbp),%ecx
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11a9 <main+0x99>
mov    0x2dfe(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
movb   $0x0,0x4(%rsp)
movl   $0x6f746f74,(%rsp)
lea    0xede(%rip),%r14
mov    %rsp,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x78,0x1(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x79,0x4(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x0,0x2(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
movb   $0x32,0x2(%rsp)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%ebx
lea    0xe8c(%rip),%r14
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0xff,%ebx
jne    1190 <main+0x80>
mov    0x2e2e(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@__const.main.s = [5 x i8] c"toto\00"
@.str = [18 x i8] c"Ma chaine est %s\0A\00"
@.str.1 = [48 x i8] c"caract\C3\A8re codeBase10=%d codeHexa=%x asscii=%c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [5 x i8]
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = bitcast [5 x i8]* %6 to i8*
%9 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 1
store i8 120, i8* %11
%12 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %12)
%14 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 4
store i8 121, i8* %14
%15 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %15)
%17 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 2
store i8 0, i8* %17
%18 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %18)
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 2
store i8 50, i8* %20
%21 = getelementptr inbounds [5 x i8], [5 x i8]* %6, i64 0, i64 0
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %21)
store i32 1, i32* %7
br label %23
23: ; preds = %31, %2
%24 = load i32, i32* %7
%25 = icmp slt i32 %24, 255
br i1 %25, label %26, label %34
26: ; preds = %23
%27 = load i32, i32* %7
%28 = load i32, i32* %7
%29 = load i32, i32* %7
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %28, i32 %29)
br label %31
31: ; preds = %26
%32 = load i32, i32* %7
%33 = add nsw i32 %32, 1
store i32 %33, i32* %7
br label %23
34: ; preds = %23
%35 = load i32, i32* @EXIT_SUCCESS
ret i32 %35
}

LLVM IR (-O2):
@__const.main.s = [5 x i8] c"toto\00"
@.str = [18 x i8] c"Ma chaine est %s\0A\00"
@.str.1 = [48 x i8] c"caract\C3\A8re codeBase10=%d codeHexa=%x asscii=%c\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 1
store i8 120, i8* %6
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%8 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 4
store i8 121, i8* %8
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%10 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 2
store i8 0, i8* %10
%11 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
store i8 50, i8* %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
br label %13
13: ; preds = %2, %13
%14 = phi i32 [ 1, %2 ], [ %16, %13 ]
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i64 0, i64 0), i32 %14, i32 %14, i32 %14)
%16 = add nuw nsw i32 %14, 1
%17 = icmp eq i32 %16, 255
br i1 %17, label %18, label %13
18: ; preds = %13
%19 = load i32, i32* @EXIT_SUCCESS
ret i32 %19
}