#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 pow(float, int);
int /*<<< orphan*/ printf(char *, double, float, int);
int main(void) {
CASE1 : {
  double num = 10 ^ 3700;
  double exponent = 10 ^ 37;
  double ans;
  ans = pow(num, exponent);
  printf("ans = %lf, num = %lf, exponent = %lf\n", ans, num, exponent);
}
CASE2 : {
  float num = 1.004;
  int exponent = 3;
  double ans;
  ans = pow(num, exponent);
  printf("ans = %lf, num = %lf, exponent = %lf\n", ans, num, exponent);
}
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xed1(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xebc(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
cvttsd2si -0x18(%rbp),%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
cvtsd2ss %xmm1,%xmm1
cvttsd2si -0x18(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
movss  0xe88(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movl   $0x3,-0x28(%rbp)
movss  -0x24(%rbp),%xmm0
mov    -0x28(%rbp),%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movss  -0x24(%rbp),%xmm1
mov    -0x28(%rbp),%esi
lea    0xe5a(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xed7(%rip),%xmm0
mov    $0x2f,%edi
call   1040 <pow@plt>
lea    0xece(%rip),%rbx
mov    %rbx,%rdi
movss  0xebb(%rip),%xmm1
mov    $0x2f,%esi
call   1030 <printf@plt>
movss  0xead(%rip),%xmm0
mov    $0x3,%edi
call   1040 <pow@plt>
mov    %rbx,%rdi
movss  0xe98(%rip),%xmm1
mov    $0x3,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [38 x i8] c"ans = %lf, num = %lf, exponent = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
%5 = alloca float
%6 = alloca i32
%7 = alloca double
store i32 0, i32* %1
br label %8
8: ; preds = %0
store double 3.710000e+03, double* %2
store double 4.700000e+01, double* %3
%9 = load double, double* %2
%10 = fptrunc double %9 to float
%11 = load double, double* %3
%12 = fptosi double %11 to i32
%13 = call double @pow(float %10, i32 %12)
store double %13, double* %4
%14 = load double, double* %4
%15 = load double, double* %2
%16 = fptrunc double %15 to float
%17 = load double, double* %3
%18 = fptosi double %17 to i32
%19 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %14, float %16, i32 %18)
br label %20
20: ; preds = %8
store float 0x3FF0106240000000, float* %5
store i32 3, i32* %6
%21 = load float, float* %5
%22 = load i32, i32* %6
%23 = call double @pow(float %21, i32 %22)
store double %23, double* %7
%24 = load double, double* %7
%25 = load float, float* %5
%26 = load i32, i32* %6
%27 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %24, float %25, i32 %26)
ret i32 0
}

LLVM IR (-O2):
@.str = [38 x i8] c"ans = %lf, num = %lf, exponent = %lf\0A\00"
define i32 @main() {
%1 = tail call double @pow(float 3.710000e+03, i32 47)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %1, float 3.710000e+03, i32 47)
%3 = tail call double @pow(float 0x3FF0106240000000, i32 3)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str, i64 0, i64 0), double %3, float 0x3FF0106240000000, i32 3)
ret i32 0
}