#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) {
  int dias = 0;
  float taxa = 0, principal = 0, juros = 0;
  while (principal != -1) {
    printf("informe o valor principal do emprestimo(-1 para terminar): ");
    scanf("%f", &principal);
    if (principal == -1)
      continue;
    printf("informe a taxa de juros: ");
    scanf("%f", &taxa);
    printf("informe o prazo de emprestimo em dias: ");
    scanf("%d", &dias);
    juros = (principal * taxa * dias) / 365;
    printf("o valor do juros é de R$%.2f: \n", juros);
  }
  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)
movss  -0x10(%rbp),%xmm0
movss  0xea5(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    116f <main+0x4f>
jp     116f <main+0x4f>
jmp    1230 <main+0x110>
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec0(%rip),%rdi
lea    -0x10(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
movss  0xe64(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    11b0 <main+0x90>
jp     11b0 <main+0x90>
jmp    114e <main+0x2e>
lea    0xe90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe7f(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movss  -0x10(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  0xdf9(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe68(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    114e <main+0x2e>
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,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
lea    0xef7(%rip),%rbx
lea    0xc(%rsp),%r15
lea    0xf08(%rip),%rbp
lea    0xf29(%rip),%r14
lea    0x14(%rsp),%r12
lea    0xf20(%rip),%r13
nopl   0x0(%rax)
lea    0xe91(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xe68(%rip),%xmm0
jne    119c <main+0x7c>
jnp    121b <main+0xfb>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
movss  0xc(%rsp),%xmm0
mulss  0x10(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtsi2ssl 0x14(%rsp),%xmm1
mulss  %xmm0,%xmm1
divss  0xe13(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
mov    %r13,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xdf1(%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 = [60 x i8] c"informe o valor principal do emprestimo(-1 para terminar): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"informe a taxa de juros: \00"
@.str.3 = [40 x i8] c"informe o prazo de emprestimo em dias: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [33 x i8] c"o valor do juros \C3\A9 de R$%.2f: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = 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
br label %6
6: ; preds = %15, %14, %0
%7 = load float, float* %4
%8 = fcmp une float %7, -1.000000e+00
br i1 %8, label %9, label %30
9: ; preds = %6
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, 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* %4)
%12 = load float, float* %4
%13 = fcmp oeq float %12, -1.000000e+00
br i1 %13, label %14, label %15
14: ; preds = %9
br label %6
15: ; preds = %9
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %2)
%20 = load float, float* %4
%21 = load float, float* %3
%22 = fmul float %20, %21
%23 = load i32, i32* %2
%24 = sitofp i32 %23 to float
%25 = fmul float %22, %24
%26 = fdiv float %25, 3.650000e+02
store float %26, float* %5
%27 = load float, float* %5
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.5, i64 0, i64 0), double %28)
br label %6
30: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [60 x i8] c"informe o valor principal do emprestimo(-1 para terminar): \00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [26 x i8] c"informe a taxa de juros: \00"
@.str.3 = [40 x i8] c"informe o prazo de emprestimo em dias: \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [33 x i8] c"o valor do juros \C3\A9 de R$%.2f: \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast float* %2 to i8*
store float 0.000000e+00, float* %2
%6 = bitcast float* %3 to i8*
store float 0.000000e+00, float* %3
br label %7
7: ; preds = %0, %12
%8 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %3)
%10 = load float, float* %3
%11 = fcmp oeq float %10, -1.000000e+00
br i1 %11, label %28, label %12
12: ; preds = %7
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%17 = load float, float* %3
%18 = load float, float* %2
%19 = fmul float %17, %18
%20 = load i32, i32* %1
%21 = sitofp 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 ([33 x i8], [33 x i8]* @.str.5, 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
}