#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 atof(char *);
int /*<<< orphan*/ powD(double, double);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  double n = 0.0;
  double exp = 0.0;
  printf("pow\n");
  if (argc > 1)
    n = atof(argv[1]);
  if (argc > 2)
    exp = atof(argv[2]);
  printf("%.*f to the %.*f = %.*f\n", 3, n, 3, exp, 3, powD(n, exp));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
jle    1180 <main+0x50>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x2,-0x8(%rbp)
jle    119c <main+0x6c>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atof@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
call   1030 <powD@plt>
movsd  -0x30(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    %eax,%r8d
lea    0xe32(%rip),%rdi
mov    $0x3,%ecx
mov    %ecx,%esi
mov    %ecx,%edx
mov    $0x2,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec7(%rip),%rdi
call   1040 <puts@plt>
xorps  %xmm1,%xmm1
cmp    $0x2,%ebp
jl     1172 <main+0x32>
mov    0x8(%rbx),%rdi
call   1050 <atof@plt>
cmp    $0x2,%ebp
jne    1177 <main+0x37>
xorps  %xmm1,%xmm1
jmp    118f <main+0x4f>
xorps  %xmm0,%xmm0
jmp    118f <main+0x4f>
mov    0x10(%rbx),%rdi
movsd  %xmm0,0x8(%rsp)
call   1050 <atof@plt>
movaps %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1030 <powD@plt>
lea    0xe59(%rip),%rdi
mov    $0x3,%esi
movsd  0x8(%rsp),%xmm0
mov    $0x3,%edx
movsd  0x10(%rsp),%xmm1
mov    $0x3,%ecx
mov    %eax,%r8d
mov    $0x2,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"pow\0A\00"
@.str.1 = [25 x i8] c"%.*f to the %.*f = %.*f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call double @atof(i8* %14)
store double %15, double* %6
br label %16
16: ; preds = %11, %2
%17 = load i32, i32* %4
%18 = icmp sgt i32 %17, 2
br i1 %18, label %19, label %24
19: ; preds = %16
%20 = load i8**, i8*** %5
%21 = getelementptr inbounds i8*, i8** %20, i64 2
%22 = load i8*, i8** %21
%23 = call double @atof(i8* %22)
store double %23, double* %7
br label %24
24: ; preds = %19, %16
%25 = load double, double* %6
%26 = load double, double* %7
%27 = load double, double* %6
%28 = load double, double* %7
%29 = call i32 @powD(double %27, double %28)
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 3, double %25, i32 3, double %26, i32 3, i32 %29)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"%.*f to the %.*f = %.*f\0A\00"
@str = [4 x i8] c"pow\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%4 = icmp sgt i32 %0, 1
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = tail call double @atof(i8* %7)
%9 = icmp eq i32 %0, 2
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
%13 = tail call double @atof(i8* %12)
br label %14
14: ; preds = %2, %10, %5
%15 = phi double [ %8, %10 ], [ %8, %5 ], [ 0.000000e+00, %2 ]
%16 = phi double [ %13, %10 ], [ 0.000000e+00, %5 ], [ 0.000000e+00, %2 ]
%17 = tail call i32 @powD(double %15, double %16)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 3, double %15, i32 3, double %16, i32 3, i32 %17)
ret i32 0
}