#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 atoi(char *);
int /*<<< orphan*/ fonctionTriFusion(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main(int argc, char *argv[]) {
  if (argc == 2) {
    char *buffer = argv[1];
    int num = atoi(buffer);
    fonctionTriFusion(num);
  } else {
    int n = 2;
    printf("entrez un entier n (il sera multiplié 2)\n");
    scanf("%d", &n);
    fonctionTriFusion(n);
  }
  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)
cmpl   $0x2,-0x8(%rbp)
jne    1185 <main+0x45>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1060 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
call   1040 <fonctionTriFusion@plt>
jmp    11b0 <main+0x70>
movl   $0x2,-0x20(%rbp)
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x20(%rbp),%edi
call   1040 <fonctionTriFusion@plt>
mov    0x2e29(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jne    1153 <main+0x13>
mov    0x8(%rsi),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
jmp    117c <main+0x3c>
movl   $0x2,0x4(%rsp)
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe92(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <fonctionTriFusion@plt>
mov    0x2e58(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [43 x i8] c"entrez un entier n (il sera multipli\C3\A9 2)\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 2
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
store i8* %14, i8** %6
%15 = load i8*, i8** %6
%16 = call i32 @atoi(i8* %15)
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = call i32 @fonctionTriFusion(i32 %17)
br label %24
19: ; preds = %2
store i32 2, i32* %8
%20 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
%22 = load i32, i32* %8
%23 = call i32 @fonctionTriFusion(i32 %22)
br label %24
24: ; preds = %19, %11
%25 = load i32, i32* @EXIT_SUCCESS
ret i32 %25
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@EXIT_SUCCESS = global i32 0
@str = [42 x i8] c"entrez un entier n (il sera multipli\C3\A9 2)\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = icmp eq i32 %0, 2
br i1 %4, label %5, label %10
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call i32 @atoi(i8* %7)
%9 = tail call i32 @fonctionTriFusion(i32 %8)
br label %16
10: ; preds = %2
%11 = bitcast i32* %3 to i8*
store i32 2, i32* %3
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%13 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%14 = load i32, i32* %3
%15 = call i32 @fonctionTriFusion(i32 %14)
br label %16
16: ; preds = %10, %5
%17 = load i32, i32* @EXIT_SUCCESS
ret i32 %17
}