#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;
  unsigned int limiteCreditoVecchio;
  unsigned int limiteCredito;
  int valoreSentinella = -1;
  float saldoAttuale;
  float saldoEccedente;
  for (valoreSentinella = -1; numeroConto != valoreSentinella;) {
    puts("");
    printf("%s", "Inserire il numero di conto del cliente: ");
    scanf("%d", &numeroConto);
    if (numeroConto != valoreSentinella) {
      printf("%s", "Inserire limite di credito attuale: ");
      scanf("%u", &limiteCreditoVecchio);
      printf("%s", "Inserire saldoAttuale: ");
      scanf("%f", &saldoAttuale);
      puts("");
      limiteCredito = (limiteCreditoVecchio / (unsigned int)2);
      if (saldoAttuale > limiteCredito) {
        saldoEccedente = saldoAttuale - limiteCredito;
        puts("**********");
        printf("Il cliente numero conto: %d ha superato il suo nuovo limite di "
               "credito pari a: %u di %.2f.\n",
               numeroConto, limiteCredito, saldoEccedente);
        puts("**********");
      } else {
        printf("Il nuovo limite di credito per il cliente numero conto: %d e' "
               "pari a: %u.",
               numeroConto, limiteCredito);
      }
    } else {
      puts("Grazie per aver utilizzato il nostro software!");
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x14(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1291 <main+0x161>
lea    0xf79(%rip),%rdi
call   1030 <puts@plt>
lea    0xe94(%rip),%rdi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeac(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
mov    -0x8(%rbp),%eax
cmp    -0x14(%rbp),%eax
je     1280 <main+0x150>
lea    0xe61(%rip),%rdi
mov    %rdi,-0x28(%rbp)
lea    0xe86(%rip),%rsi
xor    %eax,%eax
mov    %al,-0x1d(%rbp)
call   1040 <printf@plt>
mov    -0x1d(%rbp),%al
lea    0xe97(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x1d(%rbp),%al
lea    0xe83(%rip),%rsi
call   1040 <printf@plt>
mov    -0x1d(%rbp),%al
lea    0xe8c(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <scanf@plt>
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
shr    %eax
mov    %eax,-0x10(%rbp)
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%eax
cvtsi2ss %rax,%xmm1
ucomiss %xmm1,%xmm0
jbe    1267 <main+0x137>
movss  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%eax
cvtsi2ss %rax,%xmm1
subss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
lea    0xe3f(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe16(%rip),%rdi
call   1030 <puts@plt>
jmp    127b <main+0x14b>
mov    -0x8(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    0xe66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    128c <main+0x15c>
lea    0xe9d(%rip),%rdi
call   1030 <puts@plt>
jmp    114d <main+0x1d>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeab(%rip),%rbx
lea    0xea7(%rip),%r14
lea    0xeca(%rip),%r15
lea    0x8(%rsp),%r12
lea    0xf04(%rip),%rbp
jmp    1197 <main+0x57>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xf9d(%rip),%rdi
call   1040 <puts@plt>
cmpl   $0xffffffff,0x8(%rsp)
je     1290 <main+0x150>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
cmpl   $0xffffffff,0x8(%rsp)
je     1180 <main+0x40>
mov    %rbx,%rdi
lea    0xe64(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe7b(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    %rbx,%rdi
lea    0xe68(%rip),%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe72(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x14(%rsp),%r13d
shr    %r13d
xorps  %xmm0,%xmm0
cvtsi2ss %r13d,%xmm0
movss  0x10(%rsp),%xmm1
ucomiss %xmm0,%xmm1
jbe    1270 <main+0x130>
subss  %xmm0,%xmm1
movss  %xmm1,0xc(%rsp)
mov    %rbp,%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%esi
movss  0xc(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe28(%rip),%rdi
mov    %r13d,%edx
mov    $0x1,%al
call   1050 <printf@plt>
mov    %rbp,%rdi
jmp    1187 <main+0x47>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%esi
lea    0xe5f(%rip),%rdi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0xffffffff,0x8(%rsp)
jne    1197 <main+0x57>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [42 x i8] c"Inserire il numero di conto del cliente: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [37 x i8] c"Inserire limite di credito attuale: \00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [24 x i8] c"Inserire saldoAttuale: \00"
@.str.7 = [3 x i8] c"%f\00"
@.str.8 = [11 x i8] c"**********\00"
@.str.9 = [92 x i8] c"Il cliente numero conto: %d ha superato il suo nuovo limite di credito pari a: %u di %.2f.\0A\00"
@.str.10 = [74 x i8] c"Il nuovo limite di credito per il cliente numero conto: %d e' pari a: %u.\00"
@.str.11 = [47 x i8] c"Grazie per aver utilizzato il nostro software!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
store i32 -1, i32* %5
store i32 -1, i32* %5
br label %8
8: ; preds = %50, %0
%9 = load i32, i32* %2
%10 = load i32, i32* %5
%11 = icmp ne i32 %9, %10
br i1 %11, label %12, label %51
12: ; preds = %8
%13 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = load i32, i32* %5
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %48
19: ; preds = %12
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), float* %6)
%24 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%25 = load i32, i32* %3
%26 = udiv i32 %25, 2
store i32 %26, i32* %4
%27 = load float, float* %6
%28 = load i32, i32* %4
%29 = uitofp i32 %28 to float
%30 = fcmp ogt float %27, %29
br i1 %30, label %31, label %43
31: ; preds = %19
%32 = load float, float* %6
%33 = load i32, i32* %4
%34 = uitofp i32 %33 to float
%35 = fsub float %32, %34
store float %35, float* %7
%36 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%37 = load i32, i32* %2
%38 = load i32, i32* %4
%39 = load float, float* %7
%40 = fpext float %39 to double
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([92 x i8], [92 x i8]* @.str.9, i64 0, i64 0), i32 %37, i32 %38, double %40)
%42 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %47
43: ; preds = %19
%44 = load i32, i32* %2
%45 = load i32, i32* %4
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.10, i64 0, i64 0), i32 %44, i32 %45)
br label %47
47: ; preds = %43, %31
br label %50
48: ; preds = %12
%49 = call i32 @puts(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.11, i64 0, i64 0))
br label %50
50: ; preds = %48, %47
br label %8
51: ; preds = %8
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [42 x i8] c"Inserire il numero di conto del cliente: \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [37 x i8] c"Inserire limite di credito attuale: \00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [24 x i8] c"Inserire saldoAttuale: \00"
@.str.7 = [3 x i8] c"%f\00"
@.str.8 = [11 x i8] c"**********\00"
@.str.9 = [92 x i8] c"Il cliente numero conto: %d ha superato il suo nuovo limite di credito pari a: %u di %.2f.\0A\00"
@.str.10 = [74 x i8] c"Il nuovo limite di credito per il cliente numero conto: %d e' pari a: %u.\00"
@.str.11 = [47 x i8] c"Grazie per aver utilizzato il nostro software!\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = bitcast i32* %1 to i8*
%5 = bitcast i32* %2 to i8*
%6 = bitcast float* %3 to i8*
br label %7
7: ; preds = %0, %36
%8 = call i32 @putchar(i32 10)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.2, i64 0, i64 0))
%10 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = icmp eq i32 %11, -1
br i1 %12, label %34, label %13
13: ; preds = %7
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), float* %3)
%18 = call i32 @putchar(i32 10)
%19 = load i32, i32* %2
%20 = lshr i32 %19, 1
%21 = load float, float* %3
%22 = uitofp i32 %20 to float
%23 = fcmp ogt float %21, %22
br i1 %23, label %24, label %31
24: ; preds = %13
%25 = fsub float %21, %22
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
%27 = load i32, i32* %1
%28 = fpext float %25 to double
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([92 x i8], [92 x i8]* @.str.9, i64 0, i64 0), i32 %27, i32 %20, double %28)
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0))
br label %36
31: ; preds = %13
%32 = load i32, i32* %1
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([74 x i8], [74 x i8]* @.str.10, i64 0, i64 0), i32 %32, i32 %20)
br label %36
34: ; preds = %7
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.11, i64 0, i64 0))
br label %36
36: ; preds = %24, %31, %34
%37 = load i32, i32* %1
%38 = icmp eq i32 %37, -1
br i1 %38, label %39, label %7
39: ; preds = %36
ret i32 0
}