#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 log(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *, float *, float *);
int main() {
  float c, d, n, p;
  printf("Enter the Values of C D P: ");
  scanf("%f %f %f", &c, &d, &p);
  n = log(p / c) / log(1 - d);
  if (d > 0)
    printf("N: %.4f \n", n);
  else
    printf("Sry.. No such Value \n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xecc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x14(%rbp),%rcx
call   1040 <scanf@plt>
movss  -0x14(%rbp),%xmm0
divss  -0x8(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1050 <log@plt>
movss  %xmm0,-0x18(%rbp)
movss  0xe7b(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
cvttss2si %xmm0,%edi
call   1050 <log@plt>
movaps %xmm0,%xmm1
movss  -0x18(%rbp),%xmm0
divss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11d1 <main+0xa1>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe64(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    11df <main+0xaf>
lea    0xe5b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0xeb9(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec7(%rip),%rdi
lea    0x14(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x10(%rsp),%rcx
call   1050 <scanf@plt>
movss  0x10(%rsp),%xmm0
divss  0x14(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1060 <log@plt>
movss  %xmm0,0xc(%rsp)
movss  0xe70(%rip),%xmm0
subss  0x8(%rsp),%xmm0
cvttss2si %xmm0,%edi
call   1060 <log@plt>
movss  0x8(%rsp),%xmm1
xorps  %xmm2,%xmm2
ucomiss %xmm2,%xmm1
jbe    11ce <main+0x8e>
movss  0xc(%rsp),%xmm1
divss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
lea    0xe64(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
jmp    11da <main+0x9a>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Enter the Values of C D P: \00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [10 x i8] c"N: %.4f \0A\00"
@.str.3 = [22 x i8] c"Sry.. No such Value \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %5)
%8 = load float, float* %5
%9 = load float, float* %2
%10 = fdiv float %8, %9
%11 = fptosi float %10 to i32
%12 = call float @log(i32 %11)
%13 = load float, float* %3
%14 = fsub float 1.000000e+00, %13
%15 = fptosi float %14 to i32
%16 = call float @log(i32 %15)
%17 = fdiv float %12, %16
store float %17, float* %4
%18 = load float, float* %3
%19 = fcmp ogt float %18, 0.000000e+00
br i1 %19, label %20, label %24
20: ; preds = %0
%21 = load float, float* %4
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %22)
br label %26
24: ; preds = %0
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
ret i32 0
}

LLVM IR (-O2):
@.str = [28 x i8] c"Enter the Values of C D P: \00"
@.str.1 = [9 x i8] c"%f %f %f\00"
@.str.2 = [10 x i8] c"N: %.4f \0A\00"
@str = [21 x i8] c"Sry.. No such Value \00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = alloca float
%4 = bitcast float* %1 to i8*
%5 = bitcast float* %2 to i8*
%6 = bitcast float* %3 to i8*
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), float* %1, float* %2, float* %3)
%9 = load float, float* %3
%10 = load float, float* %1
%11 = fdiv float %9, %10
%12 = fptosi float %11 to i32
%13 = call float @log(i32 %12)
%14 = load float, float* %2
%15 = fsub float 1.000000e+00, %14
%16 = fptosi float %15 to i32
%17 = call float @log(i32 %16)
%18 = load float, float* %2
%19 = fcmp ogt float %18, 0.000000e+00
br i1 %19, label %20, label %24
20: ; preds = %0
%21 = fdiv float %13, %17
%22 = fpext float %21 to double
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), double %22)
br label %26
24: ; preds = %0
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
br label %26
26: ; preds = %24, %20
ret i32 0
}