#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 valor_emprestimo = 0.0, juros = 0.0;
  int dias = 0;
  printf("informe os valor principal do emprestimo: (-1 para terminar)\n");
  scanf("%f", &valor_emprestimo);
  if (valor_emprestimo != -1) {
    printf("informe a taxa de juros: \n");
    scanf("%f", &juros);
    printf("informe o prazo de emprestimo em dias: \n");
    scanf("%d", &dias);
    printf("O valor do juros é: %.2f\n\n",
           (valor_emprestimo * juros * dias) / 365);
  }
  while (valor_emprestimo != -1) {
    printf("informe os valor principal do emprestimo: (-1 para terminar)\n");
    scanf("%f", &valor_emprestimo);
    if (valor_emprestimo != -1) {
      printf("informe a taxa de juros: \n");
      scanf("%f", &juros);
      printf("informe o prazo de emprestimo em dias: \n");
      scanf("%d", &dias);
      printf("O valor do juros é: %.2f\n\n",
             (valor_emprestimo * juros * dias) / 365);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe8d(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1187 <main+0x67>
jp     1187 <main+0x67>
jmp    11f8 <main+0xd8>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed1(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xe22(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
movss  -0x8(%rbp),%xmm0
movss  0xdf6(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    121e <main+0xfe>
jp     121e <main+0xfe>
jmp    12d5 <main+0x1b5>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe13(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xdb5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    125f <main+0x13f>
jp     125f <main+0x13f>
jmp    12d0 <main+0x1b0>
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdd2(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xdde(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdf9(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x10(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xd4a(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdc7(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11fd <main+0xdd>
xor    %eax,%eax
add    $0x10,%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,0xc(%rsp)
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xecd(%rip),%rdi
call   1030 <puts@plt>
lea    0xe9f(%rip),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xe7e(%rip),%xmm0
jne    118a <main+0x5a>
jnp    12e5 <main+0x1b5>
lea    0xed6(%rip),%rdi
call   1030 <puts@plt>
lea    0xe6b(%rip),%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xed1(%rip),%rdi
call   1030 <puts@plt>
lea    0xe4f(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
cvtsi2ssl 0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
divss  0xe1e(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe1a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xdf8(%rip),%xmm0
jne    1210 <main+0xe0>
jnp    12e5 <main+0x1b5>
lea    0xdf1(%rip),%rbx
lea    0xc(%rsp),%r15
lea    0xe5e(%rip),%rbp
lea    0xde1(%rip),%r14
lea    0x10(%rsp),%r12
lea    0xdd8(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
lea    0xde3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xd9a(%rip),%xmm0
jne    126a <main+0x13a>
jnp    12e5 <main+0x1b5>
lea    0xdf6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
lea    0x14(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0x14(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssl 0x10(%rsp),%xmm1
mulss  %xmm0,%xmm1
divss  0xd49(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xd27(%rip),%xmm0
jne    1240 <main+0x110>
jp     1240 <main+0x110>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [62 x i8] c"informe os valor principal do emprestimo: (-1 para terminar)\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [27 x i8] c"informe a taxa de juros: \0A\00"
@.str.3 = [41 x i8] c"informe o prazo de emprestimo em dias: \0A\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [28 x i8] c"O valor do juros \C3\A9: %.2f\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %2
store float 0.000000e+00, float* %3
store i32 0, i32* %4
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%7 = load float, float* %2
%8 = fcmp une float %7, -1.000000e+00
br i1 %8, label %9, label %23
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%14 = load float, float* %2
%15 = load float, float* %3
%16 = fmul float %14, %15
%17 = load i32, i32* %4
%18 = sitofp i32 %17 to float
%19 = fmul float %16, %18
%20 = fdiv float %19, 3.650000e+02
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %21)
br label %23
23: ; preds = %9, %0
br label %24
24: ; preds = %46, %23
%25 = load float, float* %2
%26 = fcmp une float %25, -1.000000e+00
br i1 %26, label %27, label %47
27: ; preds = %24
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%30 = load float, float* %2
%31 = fcmp une float %30, -1.000000e+00
br i1 %31, label %32, label %46
32: ; preds = %27
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.3, i64 0, i64 0))
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%37 = load float, float* %2
%38 = load float, float* %3
%39 = fmul float %37, %38
%40 = load i32, i32* %4
%41 = sitofp i32 %40 to float
%42 = fmul float %39, %41
%43 = fdiv float %42, 3.650000e+02
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %44)
br label %46
46: ; preds = %32, %27
br label %24
47: ; preds = %24
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [28 x i8] c"O valor do juros \C3\A9: %.2f\0A\0A\00"
@str.6 = [61 x i8] c"informe os valor principal do emprestimo: (-1 para terminar)\00"
@str.9 = [26 x i8] c"informe a taxa de juros: \00"
@str.10 = [40 x i8] c"informe o prazo de emprestimo em dias: \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca i32
%4 = bitcast float* %1 to i8*
store float 0.000000e+00, float* %1
%5 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%7 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.6, i64 0, i64 0))
%8 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%9 = load float, float* %1
%10 = fcmp une float %9, -1.000000e+00
br i1 %10, label %11, label %48
11: ; preds = %0
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.10, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%16 = load float, float* %1
%17 = load float, float* %2
%18 = fmul float %16, %17
%19 = load i32, i32* %3
%20 = sitofp i32 %19 to float
%21 = fmul float %18, %20
%22 = fdiv float %21, 3.650000e+02
%23 = fpext float %22 to double
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %23)
%25 = load float, float* %1
%26 = fcmp une float %25, -1.000000e+00
br i1 %26, label %27, label %48
27: ; preds = %11, %32
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @str.6, i64 0, i64 0))
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%30 = load float, float* %1
%31 = fcmp une float %30, -1.000000e+00
br i1 %31, label %32, label %48
32: ; preds = %27
%33 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.9, i64 0, i64 0))
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.10, i64 0, i64 0))
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%37 = load float, float* %1
%38 = load float, float* %2
%39 = fmul float %37, %38
%40 = load i32, i32* %3
%41 = sitofp i32 %40 to float
%42 = fmul float %39, %41
%43 = fdiv float %42, 3.650000e+02
%44 = fpext float %43 to double
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.5, i64 0, i64 0), double %44)
%46 = load float, float* %1
%47 = fcmp une float %46, -1.000000e+00
br i1 %47, label %27, label %48
48: ; preds = %27, %32, %0, %11
ret i32 0
}