#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*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, ...);
int main(void) {
  int numeroConto = 0;
  float saldoInizioMese = 0;
  float totaleAddebiti = 0;
  float totaleAccrediti = 0;
  float limiteCreditoConcesso = 0;
  int valoreSentinella = -1;
  float saldoAttuale = 0;
  do {
    printf("%s", "Inserire il numero di conto (-1 per uscire): ");
    scanf("%u", &numeroConto);
    if (numeroConto != valoreSentinella) {
      printf("%s", "Inserire il bilancio iniziale: ");
      scanf("%f", &saldoInizioMese);
      printf("%s", "Inserire il totale addebiti: ");
      scanf("%f", &totaleAddebiti);
      printf("%s", "Inserire il totale accrediti: ");
      scanf("%f", &totaleAccrediti);
      printf("%s", "Inserire il limite di credito concesso: ");
      scanf("%f", &limiteCreditoConcesso);
      saldoAttuale = (saldoInizioMese + totaleAddebiti - totaleAccrediti);
      if (saldoAttuale > limiteCreditoConcesso) {
        printf("\nNumero conto: %u\n", numeroConto);
        printf("Limite credito concesso: %f.02\n", limiteCreditoConcesso);
        printf("Saldo attuale: %f.02\n", saldoAttuale);
        puts("Limite Credito Superato.\n");
      }
    }
  } while (numeroConto != valoreSentinella);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
movl   $0xffffffff,-0x1c(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x20(%rbp)
lea    0xe84(%rip),%rdi
lea    0xe80(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     12b7 <main+0x187>
lea    0xe51(%rip),%rdi
lea    0xe7e(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe90(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe2a(%rip),%rdi
lea    0xe7a(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe69(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe03(%rip),%rdi
lea    0xe71(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe42(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xddc(%rip),%rdi
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe1b(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0xc(%rbp),%xmm0
addss  -0x10(%rbp),%xmm0
subss  -0x14(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x20(%rbp),%xmm0
ucomiss -0x18(%rbp),%xmm0
jbe    12b2 <main+0x182>
mov    -0x8(%rbp),%esi
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe48(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x20(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe51(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe59(%rip),%rdi
call   1030 <puts@plt>
jmp    12b7 <main+0x187>
jmp    12bc <main+0x18c>
mov    -0x8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1175 <main+0x45>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    0xe94(%rip),%rbx
lea    0xee1(%rip),%rbp
lea    0xefb(%rip),%r14
lea    0x8(%rsp),%r15
lea    0xf0e(%rip),%r13
lea    0x4(%rsp),%r12
jmp    119a <main+0x6a>
nopl   (%rax)
cmpl   $0xffffffff,(%rsp)
je     12af <main+0x17f>
mov    %rbx,%rdi
lea    0xe5f(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe7f(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpl   $0xffffffff,(%rsp)
je     12af <main+0x17f>
mov    %rbx,%rdi
lea    0xe64(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
lea    0xe67(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
addss  0xc(%rsp),%xmm0
subss  0x8(%rsp),%xmm0
ucomiss 0x4(%rsp),%xmm0
jbe    1190 <main+0x60>
mov    (%rsp),%esi
lea    0xe5c(%rip),%rdi
xor    %eax,%eax
movss  %xmm0,0x14(%rsp)
call   1040 <printf@plt>
movss  0x4(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe51(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe59(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe61(%rip),%rdi
call   1030 <puts@plt>
jmp    1190 <main+0x60>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [46 x i8] c"Inserire il numero di conto (-1 per uscire): \00"
@.str.2 = [3 x i8] c"%u\00"
@.str.3 = [32 x i8] c"Inserire il bilancio iniziale: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [30 x i8] c"Inserire il totale addebiti: \00"
@.str.6 = [31 x i8] c"Inserire il totale accrediti: \00"
@.str.7 = [41 x i8] c"Inserire il limite di credito concesso: \00"
@.str.8 = [19 x i8] c"\0ANumero conto: %u\0A\00"
@.str.9 = [32 x i8] c"Limite credito concesso: %f.02\0A\00"
@.str.10 = [22 x i8] c"Saldo attuale: %f.02\0A\00"
@.str.11 = [26 x i8] c"Limite Credito Superato.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca i32
%8 = alloca float
store i32 0, i32* %1
store i32 0, i32* %2
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
store i32 -1, i32* %7
store float 0.000000e+00, float* %8
br label %9
9: ; preds = %44, %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %2)
%12 = load i32, i32* %2
%13 = load i32, i32* %7
%14 = icmp ne i32 %12, %13
br i1 %14, label %15, label %43
15: ; preds = %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %5)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %6)
%24 = load float, float* %3
%25 = load float, float* %4
%26 = fadd float %24, %25
%27 = load float, float* %5
%28 = fsub float %26, %27
store float %28, float* %8
%29 = load float, float* %8
%30 = load float, float* %6
%31 = fcmp ogt float %29, %30
br i1 %31, label %32, label %42
32: ; preds = %15
%33 = load i32, i32* %2
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %33)
%35 = load float, float* %6
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), double %36)
%38 = load float, float* %8
%39 = fpext float %38 to double
%40 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), double %39)
%41 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
br label %42
42: ; preds = %32, %15
br label %43
43: ; preds = %42, %9
br label %44
44: ; preds = %43
%45 = load i32, i32* %2
%46 = load i32, i32* %7
%47 = icmp ne i32 %45, %46
br i1 %47, label %9, label %48
48: ; preds = %44
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [46 x i8] c"Inserire il numero di conto (-1 per uscire): \00"
@.str.2 = [3 x i8] c"%u\00"
@.str.3 = [32 x i8] c"Inserire il bilancio iniziale: \00"
@.str.4 = [3 x i8] c"%f\00"
@.str.5 = [30 x i8] c"Inserire il totale addebiti: \00"
@.str.6 = [31 x i8] c"Inserire il totale accrediti: \00"
@.str.7 = [41 x i8] c"Inserire il limite di credito concesso: \00"
@.str.8 = [19 x i8] c"\0ANumero conto: %u\0A\00"
@.str.9 = [32 x i8] c"Limite credito concesso: %f.02\0A\00"
@.str.10 = [22 x i8] c"Saldo attuale: %f.02\0A\00"
@.str.11 = [26 x i8] c"Limite Credito Superato.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%7 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%8 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
%9 = bitcast float* %4 to i8*
store float 0.000000e+00, float* %4
%10 = bitcast float* %5 to i8*
store float 0.000000e+00, float* %5
br label %11
11: ; preds = %41, %0
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%14 = load i32, i32* %1
%15 = icmp eq i32 %14, -1
br i1 %15, label %44, label %16
16: ; preds = %11
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %2)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %3)
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.6, i64 0, i64 0))
%22 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %4)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.7, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), float* %5)
%25 = load float, float* %2
%26 = load float, float* %3
%27 = fadd float %25, %26
%28 = load float, float* %4
%29 = fsub float %27, %28
%30 = load float, float* %5
%31 = fcmp ogt float %29, %30
br i1 %31, label %32, label %41
32: ; preds = %16
%33 = load i32, i32* %1
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.8, i64 0, i64 0), i32 %33)
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.9, i64 0, i64 0), double %36)
%38 = fpext float %29 to double
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), double %38)
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.11, i64 0, i64 0))
br label %41
41: ; preds = %32, %16
%42 = load i32, i32* %1
%43 = icmp eq i32 %42, -1
br i1 %43, label %44, label %11
44: ; preds = %11, %41
ret i32 0
}