#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*/ assert(int);
scalar_t__ myPow(double, int);
scalar_t__ pow(double, int);
int /*<<< orphan*/ printf(char *);
int main(void) {
  assert(myPow(2, 3) == pow(2, 3));
  assert(myPow(34.00515, -3) == pow(34.00515, -3));
  assert(myPow(0.00001, 2147483647) == pow(0.00001, 2147483647));
  printf("All pass\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xeb9(%rip),%xmm0
mov    $0x3,%edi
call   1040 <myPow@plt>
mov    %rax,-0x20(%rbp)
movsd  0xea3(%rip),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xe72(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1040 <myPow@plt>
mov    %rax,-0x18(%rbp)
movsd  0xe5c(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1060 <pow@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movsd  0xe2b(%rip),%xmm0
mov    $0x7fffffff,%edi
call   1040 <myPow@plt>
mov    %rax,-0x10(%rbp)
movsd  0xe15(%rip),%xmm0
mov    $0x7fffffff,%edi
call   1060 <pow@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
lea    0xe05(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movsd  0xeb7(%rip),%xmm0
mov    $0x3,%edi
call   1040 <myPow@plt>
mov    %rax,%rbx
movsd  0xea2(%rip),%xmm0
mov    $0x3,%edi
call   1060 <pow@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1050 <assert@plt>
movsd  0xe8a(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1040 <myPow@plt>
mov    %rax,%rbx
movsd  0xe75(%rip),%xmm0
mov    $0xfffffffd,%edi
call   1060 <pow@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1050 <assert@plt>
movsd  0xe5d(%rip),%xmm0
mov    $0x7fffffff,%edi
call   1040 <myPow@plt>
mov    %rax,%rbx
movsd  0xe48(%rip),%xmm0
mov    $0x7fffffff,%edi
call   1060 <pow@plt>
xor    %edi,%edi
cmp    %rax,%rbx
sete   %dil
call   1050 <assert@plt>
lea    0xe31(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"All pass\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @myPow(double 2.000000e+00, i32 3)
%3 = call i64 @pow(double 2.000000e+00, i32 3)
%4 = icmp eq i64 %2, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i64 @myPow(double 0x404100A8C154C986, i32 -3)
%8 = call i64 @pow(double 0x404100A8C154C986, i32 -3)
%9 = icmp eq i64 %7, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = call i64 @myPow(double 1.000000e-05, i32 2147483647)
%13 = call i64 @pow(double 1.000000e-05, i32 2147483647)
%14 = icmp eq i64 %12, %13
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [9 x i8] c"All pass\00"
define i32 @main() {
%1 = tail call i64 @myPow(double 2.000000e+00, i32 3)
%2 = tail call i64 @pow(double 2.000000e+00, i32 3)
%3 = icmp eq i64 %1, %2
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 @myPow(double 0x404100A8C154C986, i32 -3)
%7 = tail call i64 @pow(double 0x404100A8C154C986, i32 -3)
%8 = icmp eq i64 %6, %7
%9 = zext i1 %8 to i32
%10 = tail call i32 @assert(i32 %9)
%11 = tail call i64 @myPow(double 1.000000e-05, i32 2147483647)
%12 = tail call i64 @pow(double 1.000000e-05, i32 2147483647)
%13 = icmp eq i64 %11, %12
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret i32 0
}