#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 *, double *);
main() {
  double temp, p, cng, moles;
  double vol_i, vol_f;
  printf("Please enter the initial volume\n");
  scanf("%lf", &vol_i);
  printf("Please enter the final volume\n");
  scanf("%lf", &vol_f);
  printf("Please enter the volume change value\n");
  scanf("%lf", &cng);
  printf("Please enter the number of moles\n");
  scanf("%lf", &moles);
  printf("Please enter the tempreture\n");
  scanf("%lf", &temp);
  int i = vol_i;
  while (i <= vol_f) {
    p = 1000 * ((moles * 0.08206 * temp / (vol_i - (0.0427 * moles))) -
                (3.592 * moles / (vol_i * vol_i)));
    printf("%f : ", vol_i);
    printf("%f\n", p);
    vol_i += cng;
    i += cng;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeea(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
lea    -0x30(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
lea    -0x38(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec1(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x28(%rbp),%rsi
call   1040 <scanf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe85(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cvttsd2si -0x30(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cvtsi2sdl -0x3c(%rbp),%xmm1
movsd  -0x38(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1290 <main+0x170>
movsd  0xe2f(%rip),%xmm1
mulsd  -0x28(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  -0x30(%rbp),%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  0xe0b(%rip),%xmm3
mulsd  %xmm3,%xmm0
addsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  0xdef(%rip),%xmm0
mulsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm2
mulsd  -0x30(%rbp),%xmm2
divsd  %xmm2,%xmm0
subsd  %xmm0,%xmm1
movsd  0xdc8(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0xe7c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xe6f(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm1
cvtsi2sdl -0x3c(%rbp),%xmm0
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %eax,-0x3c(%rbp)
jmp    11cd <main+0xad>
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x58,%rsp
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rbx
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf00(%rip),%rdi
call   1030 <puts@plt>
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0x20(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf11(%rip),%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
lea    0xf19(%rip),%rdi
call   1030 <puts@plt>
lea    0x28(%rsp),%rsi
mov    %rbx,%rdi
call   1050 <scanf@plt>
movsd  0x8(%rsp),%xmm0
cvttpd2dq %xmm0,%xmm1
cvtdq2pd %xmm1,%xmm2
movsd  0x10(%rsp),%xmm1
ucomisd %xmm2,%xmm1
jb     12a5 <main+0x175>
lea    0xe54(%rip),%r14
lea    0xe53(%rip),%rbx
nopw   0x0(%rax,%rax,1)
movapd %xmm2,0x40(%rsp)
movsd  0x18(%rsp),%xmm1
movapd %xmm1,%xmm2
mulsd  0xdf8(%rip),%xmm2
unpcklpd %xmm1,%xmm2
mulsd  0xdf4(%rip),%xmm1
movapd 0xe04(%rip),%xmm3
movlpd 0x28(%rsp),%xmm3
addsd  %xmm0,%xmm1
mulpd  %xmm2,%xmm3
movapd %xmm0,%xmm2
mulsd  %xmm0,%xmm2
unpcklpd %xmm2,%xmm1
divpd  %xmm1,%xmm3
movapd %xmm3,%xmm1
unpckhpd %xmm3,%xmm1
subsd  %xmm1,%xmm3
mulsd  0xdc2(%rip),%xmm3
movapd %xmm3,0x30(%rsp)
mov    %r14,%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
movaps 0x30(%rsp),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0x20(%rsp),%xmm1
movsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
movapd 0x40(%rsp),%xmm2
addsd  %xmm1,%xmm2
cvttpd2dq %xmm2,%xmm1
cvtdq2pd %xmm1,%xmm2
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm1
ucomisd %xmm2,%xmm1
jae    11f0 <main+0xc0>
xor    %eax,%eax
add    $0x58,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [33 x i8] c"Please enter the initial volume\0A\00"
@.str.1 = [4 x i8] c"%lf\00"
@.str.2 = [31 x i8] c"Please enter the final volume\0A\00"
@.str.3 = [38 x i8] c"Please enter the volume change value\0A\00"
@.str.4 = [34 x i8] c"Please enter the number of moles\0A\00"
@.str.5 = [29 x i8] c"Please enter the tempreture\0A\00"
@.str.6 = [6 x i8] c"%f : \00"
@.str.7 = [4 x i8] c"%f\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 double
%8 = alloca i32
store i32 0, i32* %1
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %6)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.2, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %7)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%19 = load double, double* %6
%20 = fptosi double %19 to i32
store i32 %20, i32* %8
br label %21
21: ; preds = %26, %0
%22 = load i32, i32* %8
%23 = sitofp i32 %22 to double
%24 = load double, double* %7
%25 = fcmp ole double %23, %24
br i1 %25, label %26, label %55
26: ; preds = %21
%27 = load double, double* %5
%28 = fmul double %27, 0x3FB501E2584F4C6E
%29 = load double, double* %2
%30 = fmul double %28, %29
%31 = load double, double* %6
%32 = load double, double* %5
%33 = call double @llvm.fmuladd.f64(double -4.270000e-02, double %32, double %31)
%34 = fdiv double %30, %33
%35 = load double, double* %5
%36 = fmul double 3.592000e+00, %35
%37 = load double, double* %6
%38 = load double, double* %6
%39 = fmul double %37, %38
%40 = fdiv double %36, %39
%41 = fsub double %34, %40
%42 = fmul double 1.000000e+03, %41
store double %42, double* %3
%43 = load double, double* %6
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %43)
%45 = load double, double* %3
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double %45)
%47 = load double, double* %4
%48 = load double, double* %6
%49 = fadd double %48, %47
store double %49, double* %6
%50 = load double, double* %4
%51 = load i32, i32* %8
%52 = sitofp i32 %51 to double
%53 = fadd double %52, %50
%54 = fptosi double %53 to i32
store i32 %54, i32* %8
br label %21
55: ; preds = %21
%56 = load i32, i32* %1
ret i32 %56
}

LLVM IR (-O2):
@.str.1 = [4 x i8] c"%lf\00"
@.str.6 = [6 x i8] c"%f : \00"
@.str.7 = [4 x i8] c"%f\0A\00"
@str = [32 x i8] c"Please enter the initial volume\00"
@str.8 = [30 x i8] c"Please enter the final volume\00"
@str.9 = [37 x i8] c"Please enter the volume change value\00"
@str.10 = [33 x i8] c"Please enter the number of moles\00"
@str.11 = [28 x i8] c"Please enter the tempreture\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = bitcast double* %1 to i8*
%7 = bitcast double* %2 to i8*
%8 = bitcast double* %3 to i8*
%9 = bitcast double* %4 to i8*
%10 = bitcast double* %5 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %4)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.8, i64 0, i64 0))
%14 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %5)
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str.9, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.10, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %3)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.11, i64 0, i64 0))
%20 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %1)
%21 = load double, double* %4
%22 = fptosi double %21 to i32
%23 = sitofp i32 %22 to double
%24 = load double, double* %5
%25 = fcmp ult double %24, %23
br i1 %25, label %55, label %26
26: ; preds = %0, %26
%27 = phi double [ %49, %26 ], [ %21, %0 ]
%28 = phi double [ %52, %26 ], [ %23, %0 ]
%29 = load double, double* %3
%30 = fmul double %29, 0x3FB501E2584F4C6E
%31 = load double, double* %1
%32 = call double @llvm.fmuladd.f64(double %29, double -4.270000e-02, double %27)
%33 = insertelement <2 x double> poison, double %30, i64 0
%34 = insertelement <2 x double> %33, double %29, i64 1
%35 = insertelement <2 x double> <double poison, double 3.592000e+00>, double %31, i64 0
%36 = fmul <2 x double> %34, %35
%37 = fmul double %27, %27
%38 = insertelement <2 x double> poison, double %32, i64 0
%39 = insertelement <2 x double> %38, double %37, i64 1
%40 = fdiv <2 x double> %36, %39
%41 = shufflevector <2 x double> %40, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%42 = fsub <2 x double> %40, %41
%43 = extractelement <2 x double> %42, i64 0
%44 = fmul double %43, 1.000000e+03
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), double %27)
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0), double %44)
%47 = load double, double* %2
%48 = load double, double* %4
%49 = fadd double %47, %48
store double %49, double* %4
%50 = fadd double %28, %47
%51 = fptosi double %50 to i32
%52 = sitofp i32 %51 to double
%53 = load double, double* %5
%54 = fcmp ult double %53, %52
br i1 %54, label %55, label %26
55: ; preds = %26, %0
ret i32 0
}