#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 */
struct DynArr {
  int dummy;
};

/* Variables and functions */
scalar_t__ isEmptyDynArr(struct DynArr *);
int /*<<< orphan*/ popDynArr(struct DynArr *);
double pow(double, double);
int /*<<< orphan*/ pushDynArr(struct DynArr *, double);
double topDynArr(struct DynArr *);
void exponential(struct DynArr *stack) {
  double a, c;
  if (isEmptyDynArr(stack))
    return;
  a = topDynArr(stack);
  popDynArr(stack);
  c = pow(2.7182818, a);
  pushDynArr(stack, c);
}


x86 assembly (clang, -O0):
<exponential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isEmptyDynArr@plt>
cmp    $0x0,%rax
je     1174 <exponential+0x24>
jmp    11b0 <exponential+0x60>
mov    -0x8(%rbp),%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <popDynArr@plt>
movsd  -0x10(%rbp),%xmm1
movsd  0xe68(%rip),%xmm0
call   1060 <pow@plt>
movsd  %xmm0,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
movsd  -0x18(%rbp),%xmm0
call   1070 <pushDynArr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exponential>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <isEmptyDynArr@plt>
test   %rax,%rax
je     1168 <exponential+0x18>
add    $0x10,%rsp
pop    %rbx
ret
mov    %rbx,%rdi
call   1030 <topDynArr@plt>
movsd  %xmm0,0x8(%rsp)
mov    %rbx,%rdi
call   1040 <popDynArr@plt>
movsd  0xe7a(%rip),%xmm0
movsd  0x8(%rsp),%xmm1
call   1060 <pow@plt>
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1070 <pushDynArr@plt>

LLVM IR (-O0):
%struct.DynArr = type { i32 }
define void @exponential(%struct.DynArr* %0) {
%2 = alloca %struct.DynArr*
%3 = alloca double
%4 = alloca double
store %struct.DynArr* %0, %struct.DynArr** %2
%5 = load %struct.DynArr*, %struct.DynArr** %2
%6 = call i64 @isEmptyDynArr(%struct.DynArr* %5)
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %9
8: ; preds = %1
br label %19
9: ; preds = %1
%10 = load %struct.DynArr*, %struct.DynArr** %2
%11 = call double @topDynArr(%struct.DynArr* %10)
store double %11, double* %3
%12 = load %struct.DynArr*, %struct.DynArr** %2
%13 = call i32 @popDynArr(%struct.DynArr* %12)
%14 = load double, double* %3
%15 = call double @pow(double 0x4005BF0A87427F01, double %14)
store double %15, double* %4
%16 = load %struct.DynArr*, %struct.DynArr** %2
%17 = load double, double* %4
%18 = call i32 @pushDynArr(%struct.DynArr* %16, double %17)
br label %19
19: ; preds = %9, %8
ret void
}

LLVM IR (-O2):
%struct.DynArr = type { i32 }
define void @exponential(%struct.DynArr* %0) {
%2 = tail call i64 @isEmptyDynArr(%struct.DynArr* %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1
%5 = tail call double @topDynArr(%struct.DynArr* %0)
%6 = tail call i32 @popDynArr(%struct.DynArr* %0)
%7 = tail call double @pow(double 0x4005BF0A87427F01, double %5)
%8 = tail call i32 @pushDynArr(%struct.DynArr* %0, double %7)
br label %9
9: ; preds = %1, %4
ret void
}