#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*/ scanf(char *, ...);
int main(void) {
  float tassoInteresse = 0;
  unsigned int giorniPrestito = 0;
  int valoreSentinella = -1;
  float importoPrestito = 0;
  float ricaricoInteresse = 0;
  do {
    printf("%s", "\nInserire l'importo del Prestito (-1 per uscire): ");
    scanf("%f", &importoPrestito);
    if (importoPrestito != valoreSentinella) {
      printf("%s", "Inserire tasso d'interesse: ");
      scanf("%f", &tassoInteresse);
      printf("%s", "Inserire durata prestito in giorni: ");
      scanf("%u", &giorniPrestito);
      ricaricoInteresse =
          ((importoPrestito * tassoInteresse * (float)giorniPrestito) /
           (float)365);
      printf("Il ricarico degli interessi e' pari a: $%.02f\n",
             ricaricoInteresse);
    }
  } while (importoPrestito != valoreSentinella);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0xffffffff,-0x10(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x14(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x18(%rbp)
lea    0xea8(%rip),%rdi
lea    0xea4(%rip),%rsi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec9(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jne    119a <main+0x7a>
jp     119a <main+0x7a>
jmp    1231 <main+0x111>
lea    0xe63(%rip),%rdi
mov    %rdi,-0x28(%rbp)
lea    0xe91(%rip),%rsi
xor    %eax,%eax
mov    %al,-0x19(%rbp)
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe7a(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x28(%rbp),%rdi
mov    -0x19(%rbp),%al
lea    0xe83(%rip),%rsi
call   1030 <printf@plt>
mov    -0x19(%rbp),%al
lea    0xe99(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
movss  -0x14(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
mov    -0xc(%rbp),%eax
cvtsi2ss %rax,%xmm1
mulss  %xmm1,%xmm0
movss  0xdef(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe58(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    1236 <main+0x116>
movss  -0x14(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
ucomiss %xmm1,%xmm0
jne    1155 <main+0x35>
jp     1155 <main+0x35>
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
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xebb(%rip),%rbx
lea    0xeea(%rip),%r15
lea    0xf03(%rip),%r14
lea    0xf21(%rip),%r13
lea    0x10(%rsp),%rbp
lea    0xf18(%rip),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
lea    0xe91(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xe63(%rip),%xmm0
jne    11a5 <main+0x85>
jnp    122d <main+0x10d>
mov    %rbx,%rdi
lea    0xe92(%rip),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r15,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
mov    0x10(%rsp),%eax
xorps  %xmm1,%xmm1
cvtsi2ss %rax,%xmm1
mulss  %xmm0,%xmm1
divss  0xe01(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %r12,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xddf(%rip),%xmm0
jne    1170 <main+0x50>
jp     1170 <main+0x50>
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 = [51 x i8] c"\0AInserire l'importo del Prestito (-1 per uscire): \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [29 x i8] c"Inserire tasso d'interesse: \00"
@.str.4 = [37 x i8] c"Inserire durata prestito in giorni: \00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [47 x i8] c"Il ricarico degli interessi e' pari a: $%.02f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store i32 0, i32* %3
store i32 -1, i32* %4
store float 0.000000e+00, float* %5
store float 0.000000e+00, float* %6
br label %7
7: ; preds = %30, %0
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %5)
%10 = load float, float* %5
%11 = load i32, i32* %4
%12 = sitofp i32 %11 to float
%13 = fcmp une float %10, %12
br i1 %13, label %14, label %29
14: ; preds = %7
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %2)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %3)
%19 = load float, float* %5
%20 = load float, float* %2
%21 = fmul float %19, %20
%22 = load i32, i32* %3
%23 = uitofp i32 %22 to float
%24 = fmul float %21, %23
%25 = fdiv float %24, 3.650000e+02
store float %25, float* %6
%26 = load float, float* %6
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), double %27)
br label %29
29: ; preds = %14, %7
br label %30
30: ; preds = %29
%31 = load float, float* %5
%32 = load i32, i32* %4
%33 = sitofp i32 %32 to float
%34 = fcmp une float %31, %33
br i1 %34, label %7, label %35
35: ; preds = %30
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [51 x i8] c"\0AInserire l'importo del Prestito (-1 per uscire): \00"
@.str.2 = [3 x i8] c"%f\00"
@.str.3 = [29 x i8] c"Inserire tasso d'interesse: \00"
@.str.4 = [37 x i8] c"Inserire durata prestito in giorni: \00"
@.str.5 = [3 x i8] c"%u\00"
@.str.6 = [47 x i8] c"Il ricarico degli interessi e' pari a: $%.02f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca float
%4 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
br label %7
7: ; preds = %12, %0
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.1, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %3)
%10 = load float, float* %3
%11 = fcmp une float %10, -1.000000e+00
br i1 %11, label %12, label %28
12: ; preds = %7
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), float* %1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %2)
%17 = load float, float* %3
%18 = load float, float* %1
%19 = fmul float %17, %18
%20 = load i32, i32* %2
%21 = uitofp i32 %20 to float
%22 = fmul float %19, %21
%23 = fdiv float %22, 3.650000e+02
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0), double %24)
%26 = load float, float* %3
%27 = fcmp une float %26, -1.000000e+00
br i1 %27, label %7, label %28
28: ; preds = %7, %12
ret i32 0
}