#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*/ erreur(char *, int);
int /*<<< orphan*/ get_line(char *, char *);
int /*<<< orphan*/ info(char *, ...);
int /*<<< orphan*/ invite(char *, int);
int /*<<< orphan*/ scanf(char *);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ titre(char *);
int main(void) {
  int i = 5, j = 10;
  char *prompt = "Command >", line[100];
  titre("Calculateur de prix TTC");
  info("Une petite info paramétrée par %d et %d", i, j);
  invite("Entrez un phrase (%d mots):", j);
  scanf("%*[^\n]");
  erreur("Une erreur inconnue (code:%d)\n\n", i);
  info("");
  info("Entrez des commandes, exit pour quitter\n");
  do {
    get_line(prompt, line);
  } while (strcmp(line, "exit"));
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
lea    0xe69(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    0xe68(%rip),%rdi
call   1070 <titre@plt>
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1090 <info@plt>
mov    -0xc(%rbp),%esi
lea    0xe87(%rip),%rdi
call   1050 <invite@plt>
lea    0xe97(%rip),%rdi
call   1080 <scanf@plt>
mov    -0x8(%rbp),%esi
lea    0xe8f(%rip),%rdi
call   1060 <erreur@plt>
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1090 <info@plt>
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1090 <info@plt>
mov    -0x18(%rbp),%rdi
lea    -0x80(%rbp),%rsi
call   1030 <get_line@plt>
lea    -0x80(%rbp),%rdi
lea    0xe9f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1201 <main+0x91>
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xe8a(%rip),%rdi
call   1070 <titre@plt>
lea    0xe96(%rip),%rdi
mov    $0x5,%esi
mov    $0xa,%edx
xor    %eax,%eax
call   1090 <info@plt>
lea    0xea8(%rip),%rdi
mov    $0xa,%esi
call   1050 <invite@plt>
lea    0xeb3(%rip),%rdi
call   1080 <scanf@plt>
lea    0xeae(%rip),%rdi
mov    $0x5,%esi
call   1060 <erreur@plt>
lea    0xebc(%rip),%rdi
xor    %eax,%eax
call   1090 <info@plt>
lea    0xeaf(%rip),%rdi
xor    %eax,%eax
call   1090 <info@plt>
lea    0xe12(%rip),%r14
mov    %rsp,%rbx
lea    0xec0(%rip),%r15
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <get_line@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    1200 <main+0x90>
mov    0x2dbe(%rip),%rax
mov    (%rax),%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [10 x i8] c"Command >\00"
@.str.1 = [24 x i8] c"Calculateur de prix TTC\00"
@.str.2 = [42 x i8] c"Une petite info param\C3\A9tr\C3\A9e par %d et %d\00"
@.str.3 = [28 x i8] c"Entrez un phrase (%d mots):\00"
@.str.4 = [7 x i8] c"%*[^\0A]\00"
@.str.5 = [32 x i8] c"Une erreur inconnue (code:%d)\0A\0A\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [41 x i8] c"Entrez des commandes, exit pour quitter\0A\00"
@.str.8 = [5 x i8] c"exit\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i8*
%5 = alloca [100 x i8]
store i32 0, i32* %1
store i32 5, i32* %2
store i32 10, i32* %3
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %4
%6 = call i32 @titre(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%7 = load i32, i32* %2
%8 = load i32, i32* %3
%9 = call i32 (i8*, ...) @info(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = call i32 @invite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %10)
%12 = call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%13 = load i32, i32* %2
%14 = call i32 @erreur(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 %13)
%15 = call i32 (i8*, ...) @info(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
%16 = call i32 (i8*, ...) @info(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
br label %17
17: ; preds = %21, %0
%18 = load i8*, i8** %4
%19 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%20 = call i32 @get_line(i8* %18, i8* %19)
br label %21
21: ; preds = %17
%22 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%23 = call i64 @strcmp(i8* %22, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%24 = icmp ne i64 %23, 0
br i1 %24, label %17, label %25
25: ; preds = %21
%26 = load i32, i32* @EXIT_SUCCESS
ret i32 %26
}

LLVM IR (-O2):
@.str = [10 x i8] c"Command >\00"
@.str.1 = [24 x i8] c"Calculateur de prix TTC\00"
@.str.2 = [42 x i8] c"Une petite info param\C3\A9tr\C3\A9e par %d et %d\00"
@.str.3 = [28 x i8] c"Entrez un phrase (%d mots):\00"
@.str.4 = [7 x i8] c"%*[^\0A]\00"
@.str.5 = [32 x i8] c"Une erreur inconnue (code:%d)\0A\0A\00"
@.str.6 = [1 x i8] zeroinitializer
@.str.7 = [41 x i8] c"Entrez des commandes, exit pour quitter\0A\00"
@.str.8 = [5 x i8] c"exit\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = tail call i32 @titre(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @info(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0), i32 5, i32 10)
%5 = tail call i32 @invite(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 10)
%6 = tail call i32 @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%7 = tail call i32 @erreur(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0), i32 5)
%8 = tail call i32 (i8*, ...) @info(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 (i8*, ...) @info(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
br label %10
10: ; preds = %10, %0
%11 = call i32 @get_line(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %2)
%12 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %10
14: ; preds = %10
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}