#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*/ alloc_dyna();
int /*<<< orphan*/ aritmetica();
int /*<<< orphan*/ conversioni();
int /*<<< orphan*/ matrix_dyna();
int /*<<< orphan*/ pointer_to_pointer();
int /*<<< orphan*/ printf(char *, ...);
int strlength(char *);
int /*<<< orphan*/ swap(int *, int *);
int /*<<< orphan*/ unari();
int main(int argc, char **argv) {
  int i = 0;
  printf("Argomenti\n");
  for (; *(argv + i) != NULL; i++)
    printf("%s\n", *(argv + i));
  printf("\n");
  unari();
  printf("\n");
  printf("Conversioni\n");
  conversioni();
  printf("\n");
  printf("Aritmetica\n");
  aritmetica();
  printf("\n");
  printf("Swap\n");
  int x = 1, y = 2;
  swap(&x, &y);
  printf("\n");
  printf("Lughezza stringa\n");
  char *str = "MarcoMerli";
  printf("%d\n", strlength(str));
  printf("\n");
  printf("Allocazione dinamica\n");
  alloc_dyna();
  printf("\n");
  printf("Puntatore al puntatore\n");
  pointer_to_pointer();
  printf("\n");
  printf("Matrice dinamica\n");
  matrix_dyna();
  printf("\n");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     11f6 <main+0x66>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bb <main+0x2b>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1060 <unari@plt>
lea    0xe7b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1080 <conversioni@plt>
lea    0xe58(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1090 <aritmetica@plt>
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x18(%rbp)
movl   $0x2,-0x1c(%rbp)
lea    -0x18(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   10a0 <swap@plt>
lea    0xdfe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd95(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1030 <strlength@plt>
mov    %eax,%esi
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdbe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1050 <alloc_dyna@plt>
lea    0xd9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1070 <pointer_to_pointer@plt>
lea    0xd78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   10b0 <matrix_dyna@plt>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0xe50(%rip),%rdi
call   1040 <puts@plt>
mov    (%rbx),%rdi
test   %rdi,%rdi
je     11e1 <main+0x31>
add    $0x8,%rbx
call   1040 <puts@plt>
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    11d0 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
call   1080 <unari@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe16(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10a0 <conversioni@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xe05(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10b0 <aritmetica@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdf3(%rip),%rdi
call   1040 <puts@plt>
movl   $0x1,0xc(%rsp)
movl   $0x2,0x8(%rsp)
lea    0xc(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   10c0 <swap@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdc3(%rip),%rdi
call   1040 <puts@plt>
lea    0xd82(%rip),%rdi
call   1050 <strlength@plt>
lea    0xd81(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xda2(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1070 <alloc_dyna@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd9a(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   1090 <pointer_to_pointer@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd94(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
call   10d0 <matrix_dyna@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Argomenti\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [13 x i8] c"Conversioni\0A\00"
@.str.4 = [12 x i8] c"Aritmetica\0A\00"
@.str.5 = [6 x i8] c"Swap\0A\00"
@.str.6 = [18 x i8] c"Lughezza stringa\0A\00"
@.str.7 = [11 x i8] c"MarcoMerli\00"
@.str.8 = [4 x i8] c"%d\0A\00"
@.str.9 = [22 x i8] c"Allocazione dinamica\0A\00"
@.str.10 = [24 x i8] c"Puntatore al puntatore\0A\00"
@.str.11 = [18 x i8] c"Matrice dinamica\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %25, %2
%12 = load i8**, i8*** %5
%13 = load i32, i32* %6
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8*, i8** %12, i64 %14
%16 = load i8*, i8** %15
%17 = icmp ne i8* %16, null
br i1 %17, label %18, label %28
18: ; preds = %11
%19 = load i8**, i8*** %5
%20 = load i32, i32* %6
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8*, i8** %19, i64 %21
%23 = load i8*, i8** %22
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %18
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
store i32 %27, i32* %6
br label %11
28: ; preds = %11
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 (...) @unari()
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%33 = call i32 (...) @conversioni()
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%36 = call i32 (...) @aritmetica()
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %7
store i32 2, i32* %8
%39 = call i32 @swap(i32* %7, i32* %8)
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
store i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0), i8** %9
%42 = load i8*, i8** %9
%43 = call i32 @strlength(i8* %42)
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %43)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.9, i64 0, i64 0))
%47 = call i32 (...) @alloc_dyna()
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
%50 = call i32 (...) @pointer_to_pointer()
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
%53 = call i32 (...) @matrix_dyna()
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%55 = load i32, i32* %3
ret i32 %55
}

LLVM IR (-O2):
@.str.7 = [11 x i8] c"MarcoMerli\00"
@.str.8 = [4 x i8] c"%d\0A\00"
@str = [10 x i8] c"Argomenti\00"
@str.12 = [12 x i8] c"Conversioni\00"
@str.13 = [11 x i8] c"Aritmetica\00"
@str.14 = [5 x i8] c"Swap\00"
@str.15 = [17 x i8] c"Lughezza stringa\00"
@str.16 = [21 x i8] c"Allocazione dinamica\00"
@str.17 = [23 x i8] c"Puntatore al puntatore\00"
@str.18 = [17 x i8] c"Matrice dinamica\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = icmp eq i8* %6, null
br i1 %7, label %16, label %8
8: ; preds = %2, %8
%9 = phi i64 [ %12, %8 ], [ 0, %2 ]
%10 = phi i8* [ %14, %8 ], [ %6, %2 ]
%11 = tail call i32 @puts(i8* %10)
%12 = add nuw i64 %9, 1
%13 = getelementptr inbounds i8*, i8** %1, i64 %12
%14 = load i8*, i8** %13
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %8
16: ; preds = %8, %2
%17 = tail call i32 @putchar(i32 10)
%18 = tail call i32 (...) @unari()
%19 = tail call i32 @putchar(i32 10)
%20 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.12, i64 0, i64 0))
%21 = tail call i32 (...) @conversioni()
%22 = tail call i32 @putchar(i32 10)
%23 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.13, i64 0, i64 0))
%24 = tail call i32 (...) @aritmetica()
%25 = tail call i32 @putchar(i32 10)
%26 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str.14, i64 0, i64 0))
%27 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%28 = bitcast i32* %4 to i8*
store i32 2, i32* %4
%29 = call i32 @swap(i32* %3, i32* %4)
%30 = call i32 @putchar(i32 10)
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.15, i64 0, i64 0))
%32 = call i32 @strlength(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i32 %32)
%34 = call i32 @putchar(i32 10)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
%36 = call i32 (...) @alloc_dyna()
%37 = call i32 @putchar(i32 10)
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.17, i64 0, i64 0))
%39 = call i32 (...) @pointer_to_pointer()
%40 = call i32 @putchar(i32 10)
%41 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.18, i64 0, i64 0))
%42 = call i32 (...) @matrix_dyna()
%43 = call i32 @putchar(i32 10)
ret i32 0
}