int main(int argc, char *argv[]) {
  int exponentNum;
  float baseNum, returnNum;
  if (argc == 3) {
    baseNum = atoi(argv[1]);
    exponentNum = atoi(argv[2]);
  } else {
    printf("\nPlease enter base number:\n");
    scanf("%f", &baseNum);
    printf("\nPlease enter exponent:\n");
    scanf("%d", &exponentNum);
  }
  returnNum = toPower(baseNum, exponentNum);
  printf("\nResult: %f\n", returnNum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
jne    118f <main+0x4f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0x0,%al
call   1060 <atoi@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
mov    $0x0,%al
call   1060 <atoi@plt>
mov    %eax,-0x14(%rbp)
jmp    11cf <main+0x8f>
lea    0xe6a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe78(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
lea    0xe69(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe74(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1050 <scanf@plt>
movss  -0x18(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x14(%rbp),%edi
mov    $0x1,%al
call   1040 <toPower@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe40(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
cmp    $0x3,%edi
jne    1191 <main+0x41>
mov    %rsi,%rbx
mov    0x8(%rsi),%rdi
xor    %eax,%eax
call   1070 <atoi@plt>
cvtsi2ss %eax,%xmm0
movss  %xmm0,0xc(%rsp)
movss  %xmm0,0x4(%rsp)
mov    0x10(%rbx),%rdi
xor    %eax,%eax
call   1070 <atoi@plt>
movss  0xc(%rsp),%xmm0
mov    %eax,%edi
mov    %eax,0x8(%rsp)
jmp    11d9 <main+0x89>
lea    0xe7b(%rip),%rdi
call   1030 <puts@plt>
lea    0xe5c(%rip),%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
lea    0xe77(%rip),%rdi
call   1030 <puts@plt>
lea    0xe40(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1060 <scanf@plt>
movss  0x4(%rsp),%xmm0
mov    0x8(%rsp),%edi
cvtss2sd %xmm0,%xmm0
mov    $0x1,%al
call   1050 <toPower@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe10(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [28 x i8] c"\0APlease enter base number:\0A\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [25 x i8] c"\0APlease enter exponent:\0A\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [13 x i8] c"\0AResult: %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca float
%8 = alloca float
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp eq i32 %9, 3
br i1 %10, label %11, label %21
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %14)
%16 = sitofp i32 %15 to float
store float %16, float* %7
%17 = load i8**, i8*** %5
%18 = getelementptr inbounds i8*, i8** %17, i64 2
%19 = load i8*, i8** %18
%20 = call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %19)
store i32 %20, i32* %6
br label %26
21: ; preds = %2
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0))
%23 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %7)
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0))
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %6)
br label %26
26: ; preds = %21, %11
%27 = load float, float* %7
%28 = fpext float %27 to double
%29 = load i32, i32* %6
%30 = call i32 (double, i32, ...) bitcast (i32 (...)* @toPower to i32 (double, i32, ...)*)(double %28, i32 %29)
%31 = sitofp i32 %30 to float
store float %31, float* %8
%32 = load float, float* %8
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %33)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%f\00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [13 x i8] c"\0AResult: %f\0A\00"
@str = [27 x i8] c"\0APlease enter base number:\00"
@str.5 = [24 x i8] c"\0APlease enter exponent:\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca float
%5 = bitcast i32* %3 to i8*
%6 = bitcast float* %4 to i8*
%7 = icmp eq i32 %0, 3
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %10)
%12 = sitofp i32 %11 to float
store float %12, float* %4
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i32 (i8*, ...) bitcast (i32 (...)* @atoi to i32 (i8*, ...)*)(i8* %14)
store i32 %15, i32* %3
br label %23
16: ; preds = %2
%17 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %4)
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.5, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %3)
%21 = load float, float* %4
%22 = load i32, i32* %3
br label %23
23: ; preds = %16, %8
%24 = phi i32 [ %22, %16 ], [ %15, %8 ]
%25 = phi float [ %21, %16 ], [ %12, %8 ]
%26 = fpext float %25 to double
%27 = call i32 (double, i32, ...) bitcast (i32 (...)* @toPower to i32 (double, i32, ...)*)(double %26, i32 %24)
%28 = sitofp i32 %27 to float
%29 = fpext float %28 to double
%30 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %29)
ret i32 0
}