#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 EXIT_FAILURE;
int EXIT_SUCCESS;
double atof(char *);
double pow(double, double);
int /*<<< orphan*/ printf(char *, double, double, double);
int main(int argc, char **argv) {
  double a, b;
  if (argc < 2)
    return EXIT_FAILURE;
  a = atof(argv[1]);
  b = pow(a, a);
  printf("%f^%f = %f\n", a, a, b);
  return EXIT_SUCCESS;
}


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   $0x2,-0x8(%rbp)
jge    1161 <main+0x31>
mov    0x2e89(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    11ae <main+0x7e>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1030 <atof@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
call   1050 <pow@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm2
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
mov    0x2e2f(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jge    113f <main+0xf>
mov    0x2ea3(%rip),%rax
jmp    1173 <main+0x43>
mov    0x8(%rsi),%rdi
call   1030 <atof@plt>
movsd  %xmm0,(%rsp)
movaps %xmm0,%xmm1
call   1050 <pow@plt>
movaps %xmm0,%xmm2
lea    0xea1(%rip),%rdi
movsd  (%rsp),%xmm0
movaps %xmm0,%xmm1
call   1040 <printf@plt>
mov    0x2e65(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@.str = [12 x i8] c"%f^%f = %f\0A\00"
@EXIT_SUCCESS = global i32 0
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
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 2
br i1 %9, label %10, label %12
10: ; preds = %2
%11 = load i32, i32* @EXIT_FAILURE
store i32 %11, i32* %3
br label %25
12: ; preds = %2
%13 = load i8**, i8*** %5
%14 = getelementptr inbounds i8*, i8** %13, i64 1
%15 = load i8*, i8** %14
%16 = call double @atof(i8* %15)
store double %16, double* %6
%17 = load double, double* %6
%18 = load double, double* %6
%19 = call double @pow(double %17, double %18)
store double %19, double* %7
%20 = load double, double* %6
%21 = load double, double* %6
%22 = load double, double* %7
%23 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %20, double %21, double %22)
%24 = load i32, i32* @EXIT_SUCCESS
store i32 %24, i32* %3
br label %25
25: ; preds = %12, %10
%26 = load i32, i32* %3
ret i32 %26
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@.str = [12 x i8] c"%f^%f = %f\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %10, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call double @atof(i8* %6)
%8 = tail call double @pow(double %7, double %7)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %7, double %7, double %8)
br label %10
10: ; preds = %2, %4
%11 = phi i32* [ @EXIT_SUCCESS, %4 ], [ @EXIT_FAILURE, %2 ]
%12 = load i32, i32* %11
ret i32 %12
}