#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*/ atoi(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ format(int /*<<< orphan*/);
int /*<<< orphan*/ init();
int /*<<< orphan*/ puts(char *);
int main(int argc, char **argv) {
  puts("\n--- Programme \"format\" (frmt) ---\n");
  if (argc != 2) {
    puts("Utilisation : ./frmt valeur				\n\tvaleur : "
         "entier\n");
    exit(8);
  }
  init();
  puts("Formatage du disque ...");
  format(atoi(argv[1]));
  puts("Formatage terminé");
  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)
lea    0xe93(%rip),%rdi
call   1030 <puts@plt>
cmpl   $0x2,-0x8(%rbp)
je     1192 <main+0x42>
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1070 <exit@plt>
mov    $0x0,%al
call   1040 <init@plt>
lea    0xeb6(%rip),%rdi
call   1030 <puts@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1050 <format@plt>
lea    0xeae(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e14(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xea1(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebp
jne    11a8 <main+0x58>
xor    %eax,%eax
call   1040 <init@plt>
lea    0xedf(%rip),%rdi
call   1030 <puts@plt>
mov    0x8(%rbx),%rdi
call   1060 <atoi@plt>
mov    %eax,%edi
call   1050 <format@plt>
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e41(%rip),%rax
mov    (%rax),%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
mov    $0x8,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"\0A--- Programme \22format\22 (frmt) ---\0A\00"
@.str.1 = [50 x i8] c"Utilisation : ./frmt valeur\09\09\09\09\0A\09valeur : entier\0A\00"
@.str.2 = [24 x i8] c"Formatage du disque ...\00"
@.str.3 = [19 x i8] c"Formatage termin\C3\A9\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
%6 = call i32 @puts(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 2
br i1 %8, label %9, label %12
9: ; preds = %2
%10 = call i32 @puts(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @exit(i32 8)
unreachable
12: ; preds = %2
%13 = call i32 (...) @init()
%14 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%15 = load i8**, i8*** %5
%16 = getelementptr inbounds i8*, i8** %15, i64 1
%17 = load i8*, i8** %16
%18 = call i32 @atoi(i8* %17)
%19 = call i32 @format(i32 %18)
%20 = call i32 @puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* @EXIT_SUCCESS
ret i32 %21
}

LLVM IR (-O2):
@.str = [36 x i8] c"\0A--- Programme \22format\22 (frmt) ---\0A\00"
@.str.1 = [50 x i8] c"Utilisation : ./frmt valeur\09\09\09\09\0A\09valeur : entier\0A\00"
@.str.2 = [24 x i8] c"Formatage du disque ...\00"
@.str.3 = [19 x i8] c"Formatage termin\C3\A9\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %0, 2
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @.str.1, i64 0, i64 0))
%7 = tail call i32 @exit(i32 8)
unreachable
8: ; preds = %2
%9 = tail call i32 (...) @init()
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0))
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = tail call i32 @atoi(i8* %12)
%14 = tail call i32 @format(i32 %13)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
%16 = load i32, i32* @EXIT_SUCCESS
ret i32 %16
}