#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 log(double);
double pow(double, double);
int /*<<< orphan*/ printf(char *, double, ...);
int main() {
  double num = 5.6, result;
  double pow1;
  double num2, result2;
  result = log(num);
  printf("1 log(%.1f) = %.2f\n", num, result);
  pow1 = pow(1.72, result);
  printf("pow1 = %g\n", pow1);
  num2 = 2.0;
  result2 = log(num2);
  printf("2 log(%.1f) = %.2f\n", num2, result2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
lea    0xeac(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm1
movsd  0xe88(%rip),%xmm0
call   1050 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xe96(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0xe5b(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x28(%rbp),%xmm0
call   1040 <log@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  -0x30(%rbp),%xmm1
lea    0xe6d(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
movsd  0xed2(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xefb(%rip),%rdi
movsd  0xec4(%rip),%xmm0
movsd  0xec4(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"1 log(%.1f) = %.2f\0A\00"
@.str.1 = [11 x i8] c"pow1 = %g\0A\00"
@.str.2 = [20 x i8] c"2 log(%.1f) = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
store i32 0, i32* %1
store double 5.600000e+00, double* %2
%7 = load double, double* %2
%8 = call double @log(double %7)
store double %8, double* %3
%9 = load double, double* %2
%10 = load double, double* %3
%11 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double %9, double %10)
%12 = load double, double* %3
%13 = call double @pow(double 1.720000e+00, double %12)
store double %13, double* %4
%14 = load double, double* %4
%15 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %14)
store double 2.000000e+00, double* %5
%16 = load double, double* %5
%17 = call double @log(double %16)
store double %17, double* %6
%18 = load double, double* %5
%19 = load double, double* %6
%20 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double %18, double %19)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"1 log(%.1f) = %.2f\0A\00"
@.str.1 = [11 x i8] c"pow1 = %g\0A\00"
@.str.2 = [20 x i8] c"2 log(%.1f) = %.2f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), double 5.600000e+00, double 0x3FFB9073B53F0713)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double 0x40045D0881E0AF02)
%3 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), double 2.000000e+00, double 0x3FE62E42FEFA39EF)
ret i32 0
}