#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 *, ...);
char **splitspace(char *);
int executer(char *cmd) {
  printf("### Execution de la commande %s\n", cmd);
  char **args = splitspace(cmd);
  int i = 0;
  while (args[i] != 0) {
    printf("### Mot numéro %d: %s\n", i, args[i]);
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<executer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <splitspace@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1190 <executer+0x70>
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1152 <executer+0x32>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<executer>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xed1(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <splitspace@plt>
mov    (%rax),%rdx
test   %rdx,%rdx
je     117a <executer+0x5a>
mov    %rax,%r15
lea    0xece(%rip),%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%r15,%rbx,8),%rdx
add    $0x1,%rbx
test   %rdx,%rdx
jne    1160 <executer+0x40>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [33 x i8] c"### Execution de la commande %s\0A\00"
@.str.1 = [24 x i8] c"### Mot num\C3\A9ro %d: %s\0A\00"
define i32 @executer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8**
%4 = alloca i32
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %2
%8 = call i8** @splitspace(i8* %7)
store i8** %8, i8*** %3
store i32 0, i32* %4
br label %9
9: ; preds = %16, %1
%10 = load i8**, i8*** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8*, i8** %10, i64 %12
%14 = load i8*, i8** %13
%15 = icmp ne i8* %14, null
br i1 %15, label %16, label %26
16: ; preds = %9
%17 = load i32, i32* %4
%18 = load i8**, i8*** %3
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8*, i8** %18, i64 %20
%22 = load i8*, i8** %21
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %17, i8* %22)
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
store i32 %25, i32* %4
br label %9
26: ; preds = %9
ret i32 0
}

LLVM IR (-O2):
@.str = [33 x i8] c"### Execution de la commande %s\0A\00"
@.str.1 = [24 x i8] c"### Mot num\C3\A9ro %d: %s\0A\00"
define i32 @executer(i8* %0) {
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i8** @splitspace(i8* %0)
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %15, label %6
6: ; preds = %1, %6
%7 = phi i64 [ %11, %6 ], [ 0, %1 ]
%8 = phi i8* [ %13, %6 ], [ %4, %1 ]
%9 = trunc i64 %7 to i32
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %9, i8* %8)
%11 = add nuw i64 %7, 1
%12 = getelementptr inbounds i8*, i8** %3, i64 %11
%13 = load i8*, i8** %12
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %6
15: ; preds = %6, %1
ret i32 0
}