#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 */
double ceil(double);
double log(double);
double pow(double, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ scanf(char *, double *, double *, int *, double *);
int main() {
  double C, i, M, montante, lote;
  int n;
  scanf("%lf %lf %d %lf", &C, &i, &n, &M);
  i = i / 100;
  i++;
  montante = C * pow(i, n);
  lote = log(M / C) / log(i);
  lote = ceil(lote);
  printf("Montante = %.2lf\n", montante);
  printf("%.0lf lote(s)\n", lote);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeaa(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x18(%rbp),%rdx
lea    -0x34(%rbp),%rcx
lea    -0x20(%rbp),%r8
call   1050 <scanf@plt>
movsd  -0x18(%rbp),%xmm0
movsd  0xe80(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  0xe67(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x18(%rbp),%xmm0
mov    -0x34(%rbp),%edi
call   1070 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,-0x40(%rbp)
movsd  -0x18(%rbp),%xmm0
call   1060 <log@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
lea    0xe0a(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe0b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x38,%rsp
lea    0xeb5(%rip),%rdi
lea    0x28(%rsp),%rsi
lea    0x18(%rsp),%rdx
lea    0x24(%rsp),%rcx
lea    0x30(%rsp),%r8
call   1050 <scanf@plt>
movsd  0x18(%rsp),%xmm0
divsd  0xe7e(%rip),%xmm0
addsd  0xe7e(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0x28(%rsp),%xmm1
movsd  %xmm1,0x10(%rsp)
mov    0x24(%rsp),%edi
call   1070 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0x30(%rsp),%xmm0
divsd  0x28(%rsp),%xmm0
call   1060 <log@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x18(%rsp),%xmm0
call   1060 <log@plt>
movsd  0x8(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <ceil@plt>
movsd  %xmm0,0x8(%rsp)
lea    0xe2c(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1040 <printf@plt>
lea    0xe2c(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x38,%rsp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"%lf %lf %d %lf\00"
@.str.1 = [18 x i8] c"Montante = %.2lf\0A\00"
@.str.2 = [15 x i8] c"%.0lf lote(s)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca i32
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double* %2, double* %3, i32* %7, double* %4)
%9 = load double, double* %3
%10 = fdiv double %9, 1.000000e+02
store double %10, double* %3
%11 = load double, double* %3
%12 = fadd double %11, 1.000000e+00
store double %12, double* %3
%13 = load double, double* %2
%14 = load double, double* %3
%15 = load i32, i32* %7
%16 = call double @pow(double %14, i32 %15)
%17 = fmul double %13, %16
store double %17, double* %5
%18 = load double, double* %4
%19 = load double, double* %2
%20 = fdiv double %18, %19
%21 = call double @log(double %20)
%22 = load double, double* %3
%23 = call double @log(double %22)
%24 = fdiv double %21, %23
store double %24, double* %6
%25 = load double, double* %6
%26 = call double @llvm.ceil.f64(double %25)
store double %26, double* %6
%27 = load double, double* %5
%28 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %27)
%29 = load double, double* %6
%30 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %29)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"%lf %lf %d %lf\00"
@.str.1 = [18 x i8] c"Montante = %.2lf\0A\00"
@.str.2 = [15 x i8] c"%.0lf lote(s)\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca i32
%5 = bitcast double* %1 to i8*
%6 = bitcast double* %2 to i8*
%7 = bitcast double* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @scanf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), double* %1, double* %2, i32* %4, double* %3)
%10 = load double, double* %2
%11 = fdiv double %10, 1.000000e+02
%12 = fadd double %11, 1.000000e+00
store double %12, double* %2
%13 = load double, double* %1
%14 = load i32, i32* %4
%15 = call double @pow(double %12, i32 %14)
%16 = fmul double %13, %15
%17 = load double, double* %3
%18 = load double, double* %1
%19 = fdiv double %17, %18
%20 = call double @log(double %19)
%21 = load double, double* %2
%22 = call double @log(double %21)
%23 = fdiv double %20, %22
%24 = call double @llvm.ceil.f64(double %23)
%25 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), double %16)
%26 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %24)
ret i32 0
}