#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*/ file_binary();
int /*<<< orphan*/ file_read();
int /*<<< orphan*/ file_seek();
int /*<<< orphan*/ file_write();
int /*<<< orphan*/ format_number();
int /*<<< orphan*/ format_string();
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Formattazione numeri\n");
  format_number();
  printf("\n");
  printf("Formattazione stringe\n");
  format_string();
  printf("\n");
  printf("Scrivi su file\n");
  file_write();
  printf("\n");
  printf("Leggi da file\n");
  file_read();
  printf("\n");
  printf("Leggi e scrivi bytes\n");
  file_binary();
  printf("\n");
  printf("File seek\n");
  file_seek();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe7a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <format_number@plt>
lea    0xe92(%rip),%rdi
call   1040 <printf@plt>
lea    0xe71(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <format_string@plt>
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1090 <file_write@plt>
lea    0xe54(%rip),%rdi
call   1040 <printf@plt>
lea    0xe5a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <file_read@plt>
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
lea    0xe4a(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <file_binary@plt>
lea    0xe16(%rip),%rdi
call   1040 <printf@plt>
lea    0xe41(%rip),%rdi
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <file_seek@plt>
lea    0xdf7(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xe78(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1080 <format_number@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe70(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1060 <format_string@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe69(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10a0 <file_write@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe5b(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <file_read@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe4c(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <file_binary@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe44(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1050 <file_seek@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"Formattazione numeri\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [23 x i8] c"Formattazione stringe\0A\00"
@.str.3 = [16 x i8] c"Scrivi su file\0A\00"
@.str.4 = [15 x i8] c"Leggi da file\0A\00"
@.str.5 = [22 x i8] c"Leggi e scrivi bytes\0A\00"
@.str.6 = [11 x i8] c"File seek\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @format_number()
%7 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%9 = call i32 (...) @format_string()
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 (...) @file_write()
%13 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (...) @file_read()
%16 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 (...) @file_binary()
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 (...) @file_seek()
%22 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [21 x i8] c"Formattazione numeri\00"
@str.7 = [22 x i8] c"Formattazione stringe\00"
@str.8 = [15 x i8] c"Scrivi su file\00"
@str.9 = [14 x i8] c"Leggi da file\00"
@str.10 = [21 x i8] c"Leggi e scrivi bytes\00"
@str.11 = [10 x i8] c"File seek\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 (...) @format_number()
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.7, i64 0, i64 0))
%7 = tail call i32 (...) @format_string()
%8 = tail call i32 @putchar(i32 10)
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str.8, i64 0, i64 0))
%10 = tail call i32 (...) @file_write()
%11 = tail call i32 @putchar(i32 10)
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.9, i64 0, i64 0))
%13 = tail call i32 (...) @file_read()
%14 = tail call i32 @putchar(i32 10)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.10, i64 0, i64 0))
%16 = tail call i32 (...) @file_binary()
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.11, i64 0, i64 0))
%19 = tail call i32 (...) @file_seek()
%20 = tail call i32 @putchar(i32 10)
ret i32 0
}