#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 */
float pow(int, float);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float p, n, r, a, s, c;
  printf("Enter the amount and number of months\n");
  scanf("%f %f", &p, &n);
  r = 0.01;
  s = (p * n * r) / 100;
  printf("The simple intrest is %f \n ", s);
  c = p * pow((1 + r / 100), n);
  printf("The compound intrest is %f\n", c);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  0xe9f(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  0xe7f(%rip),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe9b(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x20(%rbp)
movss  -0x10(%rbp),%xmm1
movss  0xe48(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xe38(%rip),%xmm0
addss  %xmm1,%xmm0
cvttss2si %xmm0,%edi
movss  -0xc(%rbp),%xmm0
call   1050 <pow@plt>
movaps %xmm0,%xmm1
movss  -0x20(%rbp),%xmm0
mulss  %xmm1,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe5a(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xefb(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb1(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
mulss  0xc(%rsp),%xmm0
mulss  0xe86(%rip),%xmm0
divss  0xe82(%rip),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe81(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
movss  0xc(%rsp),%xmm0
mov    $0x1,%edi
call   1060 <pow@plt>
mulss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe69(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Enter the amount and number of months\0A\00"
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [28 x i8] c"The simple intrest is %f \0A \00"
@.str.3 = [28 x i8] c"The compound intrest is %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store i32 0, i32* %1
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3)
store float 0x3F847AE140000000, float* %4
%10 = load float, float* %2
%11 = load float, float* %3
%12 = fmul float %10, %11
%13 = load float, float* %4
%14 = fmul float %12, %13
%15 = fdiv float %14, 1.000000e+02
store float %15, float* %6
%16 = load float, float* %6
%17 = fpext float %16 to double
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %17)
%19 = load float, float* %2
%20 = load float, float* %4
%21 = fdiv float %20, 1.000000e+02
%22 = fadd float 1.000000e+00, %21
%23 = fptosi float %22 to i32
%24 = load float, float* %3
%25 = call float @pow(i32 %23, float %24)
%26 = fmul float %19, %25
store float %26, float* %7
%27 = load float, float* %7
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %28)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c"%f %f\00"
@.str.2 = [28 x i8] c"The simple intrest is %f \0A \00"
@.str.3 = [28 x i8] c"The compound intrest is %f\0A\00"
@str = [38 x i8] c"Enter the amount and number of months\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2)
%7 = load float, float* %1
%8 = load float, float* %2
%9 = fmul float %7, %8
%10 = fmul float %9, 0x3F847AE140000000
%11 = fdiv float %10, 1.000000e+02
%12 = fpext float %11 to double
%13 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load float, float* %1
%15 = load float, float* %2
%16 = call float @pow(i32 1, float %15)
%17 = fmul float %14, %16
%18 = fpext float %17 to double
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), double %18)
ret i32 0
}