#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ feof(int /*<<< orphan*/);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, unsigned int, char *,
                           char *, double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
unsigned int scanf(char *, ...);
int /*<<< orphan*/ stdin;
void tipo1(void) {
  FILE *filePtr;
  unsigned int numeroConto;
  char nome[20];
  char cognome[20];
  double saldo;
  unsigned int esitoScanf;
  if ((filePtr = fopen("FileTransazioni.dat", "w")) == NULL) {
    puts("Errore nell'apertura del file esami.dat");
  } else {
    printf("File delle transazioni:\n");
    printf("%-18s%-19s%s\n", "Numero di conto", "Nome", "Saldo");
    do {
      if (((esitoScanf = scanf("%d", &numeroConto))) == 0) {
        scanf("%*[^\n]");
        puts("Input non valido");
      }
    } while (esitoScanf == 0);
    do {
      if (((esitoScanf = scanf("%s", nome))) == 0) {
        scanf("%*[^\n]");
        puts("Input non valido");
      }
    } while (esitoScanf == 0);
    do {
      if (((esitoScanf = scanf("%s", cognome))) == 0) {
        scanf("%*[^\n]");
        puts("Input non valido");
      }
    } while (esitoScanf == 0);
    do {
      if (((esitoScanf = scanf("%lf", &saldo))) == 0) {
        scanf("%*[^\n]");
        puts("Input non valido");
      }
    } while (esitoScanf == 0);
    while (!feof(stdin)) {
      fprintf(filePtr, "%d %s %s %.2lf\n", numeroConto, nome, cognome, saldo);
      do {
        if (((esitoScanf = scanf("%d", &numeroConto))) == 0) {
          scanf("%*[^\n]");
          puts("Input non valido");
        }
      } while (esitoScanf == 0);
      do {
        if (((esitoScanf = scanf("%s", nome))) == 0) {
          scanf("%*[^\n]");
          puts("Input non valido");
        }
      } while (esitoScanf == 0);
      do {
        if (((esitoScanf = scanf("%s", cognome))) == 0) {
          scanf("%*[^\n]");
          puts("Input non valido");
        }
      } while (esitoScanf == 0);
      do {
        if (((esitoScanf = scanf("%lf", &saldo))) == 0) {
          scanf("%*[^\n]");
          puts("Input non valido");
        }
      } while (esitoScanf == 0);
    }
  }
  fclose(filePtr);
  return;
}


x86 assembly (clang, -O0):
<tipo1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
lea    0xe81(%rip),%rdi
lea    0xe8e(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x8(%rbp)
cmp    $0x0,%rax
jne    11aa <tipo1+0x3a>
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
jmp    1483 <tipo1+0x313>
lea    0xe8d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe98(%rip),%rdi
lea    0xe9f(%rip),%rsi
lea    0xea8(%rip),%rdx
lea    0xea6(%rip),%rcx
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe9e(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    1213 <tipo1+0xa3>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
jmp    1218 <tipo1+0xa8>
cmpl   $0x0,-0x4c(%rbp)
je     11db <tipo1+0x6b>
jmp    1227 <tipo1+0xb7>
lea    -0x20(%rbp),%rsi
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    125f <tipo1+0xef>
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xe30(%rip),%rdi
call   1030 <puts@plt>
jmp    1264 <tipo1+0xf4>
cmpl   $0x0,-0x4c(%rbp)
je     1227 <tipo1+0xb7>
jmp    1273 <tipo1+0x103>
lea    -0x40(%rbp),%rsi
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    12ab <tipo1+0x13b>
lea    0xdeb(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xde4(%rip),%rdi
call   1030 <puts@plt>
jmp    12b0 <tipo1+0x140>
cmpl   $0x0,-0x4c(%rbp)
je     1273 <tipo1+0x103>
jmp    12bf <tipo1+0x14f>
lea    0xdd8(%rip),%rdi
lea    -0x48(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    12f7 <tipo1+0x187>
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xd98(%rip),%rdi
call   1030 <puts@plt>
jmp    12fc <tipo1+0x18c>
cmpl   $0x0,-0x4c(%rbp)
je     12bf <tipo1+0x14f>
jmp    130b <tipo1+0x19b>
mov    0x2cd6(%rip),%rax
mov    (%rax),%edi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    132e <tipo1+0x1be>
jmp    147e <tipo1+0x30e>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    -0x20(%rbp),%rcx
lea    -0x40(%rbp),%r8
movsd  -0x48(%rbp),%xmm0
lea    0xd59(%rip),%rsi
call   1060 <fprintf@plt>
lea    0xd2b(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    1386 <tipo1+0x216>
lea    0xd10(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xd09(%rip),%rdi
call   1030 <puts@plt>
jmp    138b <tipo1+0x21b>
cmpl   $0x0,-0x4c(%rbp)
je     134e <tipo1+0x1de>
jmp    139a <tipo1+0x22a>
lea    -0x20(%rbp),%rsi
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    13d2 <tipo1+0x262>
lea    0xcc4(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xcbd(%rip),%rdi
call   1030 <puts@plt>
jmp    13d7 <tipo1+0x267>
cmpl   $0x0,-0x4c(%rbp)
je     139a <tipo1+0x22a>
jmp    13e6 <tipo1+0x276>
lea    -0x40(%rbp),%rsi
lea    0xcaa(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    141e <tipo1+0x2ae>
lea    0xc78(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xc71(%rip),%rdi
call   1030 <puts@plt>
jmp    1423 <tipo1+0x2b3>
cmpl   $0x0,-0x4c(%rbp)
je     13e6 <tipo1+0x276>
jmp    1432 <tipo1+0x2c2>
lea    0xc65(%rip),%rdi
lea    -0x48(%rbp),%rsi
mov    $0x0,%al
call   1080 <scanf@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
jne    146a <tipo1+0x2fa>
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1080 <scanf@plt>
lea    0xc25(%rip),%rdi
call   1030 <puts@plt>
jmp    146f <tipo1+0x2ff>
cmpl   $0x0,-0x4c(%rbp)
je     1432 <tipo1+0x2c2>
jmp    130b <tipo1+0x19b>
jmp    1483 <tipo1+0x313>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tipo1>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
lea    0xe7b(%rip),%rdi
lea    0xe88(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,0x18(%rsp)
test   %rax,%rax
je     14b9 <tipo1+0x349>
lea    0xef3(%rip),%rdi
call   1030 <puts@plt>
lea    0xe8c(%rip),%rdi
lea    0xe93(%rip),%rsi
lea    0xe9c(%rip),%rdx
lea    0xe9a(%rip),%rcx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe92(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
jne    1223 <tipo1+0xb3>
lea    0xe7e(%rip),%r14
lea    0xe7e(%rip),%r15
lea    0xe6d(%rip),%rbx
lea    0xc(%rsp),%rbp
nop
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
je     1200 <tipo1+0x90>
lea    0xe58(%rip),%rdi
lea    0x20(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
jne    1283 <tipo1+0x113>
lea    0xe29(%rip),%r14
lea    0xe29(%rip),%r15
lea    0xe33(%rip),%rbx
lea    0x20(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
je     1260 <tipo1+0xf0>
lea    0xdf8(%rip),%rdi
lea    0x40(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
jne    12e3 <tipo1+0x173>
lea    0xdc9(%rip),%r14
lea    0xdc9(%rip),%r15
lea    0xdd3(%rip),%rbx
lea    0x40(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
je     12c0 <tipo1+0x150>
lea    0xd9b(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
jne    1343 <tipo1+0x1d3>
lea    0xd69(%rip),%r14
lea    0xd69(%rip),%r15
lea    0xd76(%rip),%rbx
lea    0x10(%rsp),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
je     1320 <tipo1+0x1b0>
mov    0x2c9e(%rip),%rax
mov    (%rax),%edi
call   1070 <feof@plt>
test   %eax,%eax
jne    14c5 <tipo1+0x355>
lea    0x20(%rsp),%r12
lea    0x40(%rsp),%rbp
lea    0xd00(%rip),%r14
lea    0xd00(%rip),%r15
lea    0xd0a(%rip),%r13
jmp    139d <tipo1+0x22d>
nopw   0x0(%rax,%rax,1)
mov    0x2c61(%rip),%rax
mov    (%rax),%edi
call   1070 <feof@plt>
test   %eax,%eax
lea    0xceb(%rip),%r13
jne    14c5 <tipo1+0x355>
mov    0xc(%rsp),%edx
movsd  0x10(%rsp),%xmm0
mov    0x18(%rsp),%rdi
lea    0xcd6(%rip),%rsi
mov    %r12,%rcx
mov    %rbp,%rbx
mov    %rbp,%r8
call   1060 <fprintf@plt>
lea    0xc9f(%rip),%rbp
mov    %rbp,%rdi
lea    0xc(%rsp),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
jne    1400 <tipo1+0x290>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbp,%rdi
jmp    13d0 <tipo1+0x260>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
lea    0x20(%rsp),%r12
nopl   0x0(%rax,%rax,1)
mov    %r12,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
jne    1440 <tipo1+0x2d0>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
jmp    1410 <tipo1+0x2a0>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rdi
mov    %rbx,%rbp
mov    %rbx,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
lea    0xc2c(%rip),%rbx
jne    1483 <tipo1+0x313>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
je     1460 <tipo1+0x2f0>
mov    %rbx,%rdi
lea    0x10(%rsp),%r13
nopl   0x0(%rax,%rax,1)
mov    %r13,%rsi
xor    %eax,%eax
call   1080 <scanf@plt>
test   %eax,%eax
jne    1380 <tipo1+0x210>
mov    %r14,%rdi
xor    %eax,%eax
call   1080 <scanf@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
jmp    1490 <tipo1+0x320>
lea    0xb56(%rip),%rdi
call   1030 <puts@plt>
mov    0x18(%rsp),%rdi
call   1040 <fclose@plt>
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"FileTransazioni.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [40 x i8] c"Errore nell'apertura del file esami.dat\00"
@.str.3 = [25 x i8] c"File delle transazioni:\0A\00"
@.str.4 = [14 x i8] c"%-18s%-19s%s\0A\00"
@.str.5 = [16 x i8] c"Numero di conto\00"
@.str.6 = [5 x i8] c"Nome\00"
@.str.7 = [6 x i8] c"Saldo\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [7 x i8] c"%*[^\0A]\00"
@.str.10 = [17 x i8] c"Input non valido\00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [4 x i8] c"%lf\00"
@stdin = global i32 0
@.str.13 = [16 x i8] c"%d %s %s %.2lf\0A\00"
define void @tipo1() {
%1 = alloca i32*
%2 = alloca i32
%3 = alloca [20 x i8]
%4 = alloca [20 x i8]
%5 = alloca double
%6 = alloca i32
%7 = call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %7, i32** %1
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 @puts(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
br label %119
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
br label %14
14: ; preds = %21, %11
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
store i32 %15, i32* %6
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %14
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %20
20: ; preds = %17, %14
br label %21
21: ; preds = %20
%22 = load i32, i32* %6
%23 = icmp eq i32 %22, 0
br i1 %23, label %14, label %24
24: ; preds = %21
br label %25
25: ; preds = %33, %24
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %26)
store i32 %27, i32* %6
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %32
32: ; preds = %29, %25
br label %33
33: ; preds = %32
%34 = load i32, i32* %6
%35 = icmp eq i32 %34, 0
br i1 %35, label %25, label %36
36: ; preds = %33
br label %37
37: ; preds = %45, %36
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %38)
store i32 %39, i32* %6
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%43 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %44
44: ; preds = %41, %37
br label %45
45: ; preds = %44
%46 = load i32, i32* %6
%47 = icmp eq i32 %46, 0
br i1 %47, label %37, label %48
48: ; preds = %45
br label %49
49: ; preds = %56, %48
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), double* %5)
store i32 %50, i32* %6
%51 = icmp eq i32 %50, 0
br i1 %51, label %52, label %55
52: ; preds = %49
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%54 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %55
55: ; preds = %52, %49
br label %56
56: ; preds = %55
%57 = load i32, i32* %6
%58 = icmp eq i32 %57, 0
br i1 %58, label %49, label %59
59: ; preds = %56
br label %60
60: ; preds = %117, %59
%61 = load i32, i32* @stdin
%62 = call i32 @feof(i32 %61)
%63 = icmp ne i32 %62, 0
%64 = xor i1 %63, true
br i1 %64, label %65, label %118
65: ; preds = %60
%66 = load i32*, i32** %1
%67 = load i32, i32* %2
%68 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%69 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%70 = load double, double* %5
%71 = call i32 @fprintf(i32* %66, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 %67, i8* %68, i8* %69, double %70)
br label %72
72: ; preds = %79, %65
%73 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %2)
store i32 %73, i32* %6
%74 = icmp eq i32 %73, 0
br i1 %74, label %75, label %78
75: ; preds = %72
%76 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%77 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %78
78: ; preds = %75, %72
br label %79
79: ; preds = %78
%80 = load i32, i32* %6
%81 = icmp eq i32 %80, 0
br i1 %81, label %72, label %82
82: ; preds = %79
br label %83
83: ; preds = %91, %82
%84 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%85 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %84)
store i32 %85, i32* %6
%86 = icmp eq i32 %85, 0
br i1 %86, label %87, label %90
87: ; preds = %83
%88 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%89 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %90
90: ; preds = %87, %83
br label %91
91: ; preds = %90
%92 = load i32, i32* %6
%93 = icmp eq i32 %92, 0
br i1 %93, label %83, label %94
94: ; preds = %91
br label %95
95: ; preds = %103, %94
%96 = getelementptr inbounds [20 x i8], [20 x i8]* %4, i64 0, i64 0
%97 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %96)
store i32 %97, i32* %6
%98 = icmp eq i32 %97, 0
br i1 %98, label %99, label %102
99: ; preds = %95
%100 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%101 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %102
102: ; preds = %99, %95
br label %103
103: ; preds = %102
%104 = load i32, i32* %6
%105 = icmp eq i32 %104, 0
br i1 %105, label %95, label %106
106: ; preds = %103
br label %107
107: ; preds = %114, %106
%108 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), double* %5)
store i32 %108, i32* %6
%109 = icmp eq i32 %108, 0
br i1 %109, label %110, label %113
110: ; preds = %107
%111 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%112 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
br label %113
113: ; preds = %110, %107
br label %114
114: ; preds = %113
%115 = load i32, i32* %6
%116 = icmp eq i32 %115, 0
br i1 %116, label %107, label %117
117: ; preds = %114
br label %60
118: ; preds = %60
br label %119
119: ; preds = %118, %9
%120 = load i32*, i32** %1
%121 = call i32 @fclose(i32* %120)
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"FileTransazioni.dat\00"
@.str.1 = [2 x i8] c"w\00"
@.str.2 = [40 x i8] c"Errore nell'apertura del file esami.dat\00"
@.str.4 = [14 x i8] c"%-18s%-19s%s\0A\00"
@.str.5 = [16 x i8] c"Numero di conto\00"
@.str.6 = [5 x i8] c"Nome\00"
@.str.7 = [6 x i8] c"Saldo\00"
@.str.8 = [3 x i8] c"%d\00"
@.str.9 = [7 x i8] c"%*[^\0A]\00"
@.str.10 = [17 x i8] c"Input non valido\00"
@.str.11 = [3 x i8] c"%s\00"
@.str.12 = [4 x i8] c"%lf\00"
@stdin = global i32 0
@.str.13 = [16 x i8] c"%d %s %s %.2lf\0A\00"
@str = [24 x i8] c"File delle transazioni:\00"
define void @tipo1() {
%1 = alloca i32
%2 = alloca [20 x i8]
%3 = alloca [20 x i8]
%4 = alloca double
%5 = bitcast i32* %1 to i8*
%6 = getelementptr inbounds [20 x i8], [20 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%8 = bitcast double* %4 to i8*
%9 = tail call i32* @fopen(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
br label %90
13: ; preds = %0
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%17 = icmp eq i32 %16, 0
br i1 %17, label %21, label %18
18: ; preds = %21, %13
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %6)
%20 = icmp eq i32 %19, 0
br i1 %20, label %29, label %26
21: ; preds = %13, %21
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%25 = icmp eq i32 %24, 0
br i1 %25, label %21, label %18
26: ; preds = %29, %18
%27 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %7)
%28 = icmp eq i32 %27, 0
br i1 %28, label %37, label %34
29: ; preds = %18, %29
%30 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %6)
%33 = icmp eq i32 %32, 0
br i1 %33, label %29, label %26
34: ; preds = %37, %26
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), double* %4)
%36 = icmp eq i32 %35, 0
br i1 %36, label %46, label %42
37: ; preds = %26, %37
%38 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %7)
%41 = icmp eq i32 %40, 0
br i1 %41, label %37, label %34
42: ; preds = %46, %34
%43 = load i32, i32* @stdin
%44 = call i32 @feof(i32 %43)
%45 = icmp eq i32 %44, 0
br i1 %45, label %55, label %90
46: ; preds = %34, %46
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), double* %4)
%50 = icmp eq i32 %49, 0
br i1 %50, label %46, label %42
51: ; preds = %85, %77
%52 = load i32, i32* @stdin
%53 = call i32 @feof(i32 %52)
%54 = icmp eq i32 %53, 0
br i1 %54, label %55, label %90
55: ; preds = %42, %51
%56 = load i32, i32* %1
%57 = load double, double* %4
%58 = call i32 @fprintf(i32* %9, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.13, i64 0, i64 0), i32 %56, i8* %6, i8* %7, double %57)
%59 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%60 = icmp eq i32 %59, 0
br i1 %60, label %64, label %61
61: ; preds = %64, %55
%62 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %6)
%63 = icmp eq i32 %62, 0
br i1 %63, label %72, label %69
64: ; preds = %55, %64
%65 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0), i32* %1)
%68 = icmp eq i32 %67, 0
br i1 %68, label %64, label %61
69: ; preds = %72, %61
%70 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %7)
%71 = icmp eq i32 %70, 0
br i1 %71, label %80, label %77
72: ; preds = %61, %72
%73 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%75 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %6)
%76 = icmp eq i32 %75, 0
br i1 %76, label %72, label %69
77: ; preds = %80, %69
%78 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), double* %4)
%79 = icmp eq i32 %78, 0
br i1 %79, label %85, label %51
80: ; preds = %69, %80
%81 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%82 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%83 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i8* %7)
%84 = icmp eq i32 %83, 0
br i1 %84, label %80, label %77
85: ; preds = %77, %85
%86 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0))
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.10, i64 0, i64 0))
%88 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.12, i64 0, i64 0), double* %4)
%89 = icmp eq i32 %88, 0
br i1 %89, label %85, label %51
90: ; preds = %51, %42, %11
%91 = call i32 @fclose(i32* %9)
ret void
}