#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ printf(char *, int, char *);
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  while (--argc > 0)
    printf("Hello, argument no %d : %s !\n", argc, argv[argc]);
  fprintf(stdout, "Fin de programme\n");
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1168 <main+0x48>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%rax
movslq -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1136 <main+0x16>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
lea    0xea6(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e54(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jl     115f <main+0x3f>
mov    %rsi,%r15
mov    %edi,%ebx
lea    0xec7(%rip),%r14
nopl   0x0(%rax)
lea    -0x1(%rbx),%r12
mov    %r12d,%eax
mov    (%r15,%rax,8),%rdx
mov    %r14,%rdi
mov    %r12d,%esi
call   1030 <printf@plt>
cmp    $0x2,%rbx
mov    %r12,%rbx
ja     1140 <main+0x20>
mov    0x2e7a(%rip),%rax
mov    (%rax),%edi
lea    0xeaf(%rip),%rsi
call   1040 <fprintf@plt>
mov    0x2e5d(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [30 x i8] c"Hello, argument no %d : %s !\0A\00"
@stdout = global i32 0
@.str.1 = [18 x i8] c"Fin de programme\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
br label %6
6: ; preds = %10, %2
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
%9 = icmp sgt i32 %8, 0
br i1 %9, label %10, label %18
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i8**, i8*** %5
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %11, i8* %16)
br label %6
18: ; preds = %6
%19 = load i32, i32* @stdout
%20 = call i32 @fprintf(i32 %19, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [30 x i8] c"Hello, argument no %d : %s !\0A\00"
@stdout = global i32 0
@.str.1 = [18 x i8] c"Fin de programme\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %15
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %5, %4 ], [ %8, %6 ]
%8 = add nsw i64 %7, -1
%9 = trunc i64 %8 to i32
%10 = and i64 %8, 4294967295
%11 = getelementptr inbounds i8*, i8** %1, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i32 %9, i8* %12)
%14 = icmp ugt i64 %7, 2
br i1 %14, label %6, label %15
15: ; preds = %6, %2
%16 = load i32, i32* @stdout
%17 = tail call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @EXIT_SUCCESS
ret i32 %18
}