#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 */
typedef int /*<<< orphan*/ nums;

/* Variables and functions */
double exp(int);
double myexp(int);
int /*<<< orphan*/ printf(char *, int, double);
int main(void) {
  int nums[] = {-1000, -200, -100, -50, -10, -1, 0, 1, 10, 50, 100, 200, 1000};
  for (int i = 0; i < sizeof(nums) / sizeof(int); ++i) {
    printf("  exp(%+6d): %e\n", nums[i], exp(nums[i]));
    printf("myexp(%+6d): %e\n", nums[i], myexp(nums[i]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x34,%edx
call   1050 <memcpy@plt>
movl   $0x0,-0x44(%rbp)
movslq -0x44(%rbp),%rax
cmp    $0xd,%rax
jae    11d5 <main+0x95>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x4c(%rbp)
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
call   1060 <exp@plt>
mov    -0x4c(%rbp),%esi
lea    0xe99(%rip),%rdi
call   1040 <printf@plt>
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%eax
mov    %eax,-0x48(%rbp)
movslq -0x44(%rbp),%rax
mov    -0x40(%rbp,%rax,4),%edi
call   1030 <myexp@plt>
mov    -0x48(%rbp),%esi
lea    0xe83(%rip),%rdi
call   1040 <printf@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    116b <main+0x2b>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %ebx,%ebx
lea    0xebf(%rip),%r12
lea    0xeec(%rip),%r14
lea    0xef6(%rip),%r15
nop
mov    (%rbx,%r12,1),%ebp
mov    %ebp,%edi
call   1050 <exp@plt>
mov    %r14,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    %ebp,%edi
call   1030 <myexp@plt>
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
add    $0x4,%rbx
cmp    $0x34,%rbx
jne    1150 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.nums = [13 x i32] [i32 -1000, i32 -200, i32 -100, i32 -50, i32 -10, i32 -1, i32 0, i32 1, i32 10, i32 50, i32 100, i32 200, i32 1000]
@.str = [17 x i8] c" exp(%+6d): %e\0A\00"
@.str.1 = [17 x i8] c"myexp(%+6d): %e\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [13 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [13 x i32]* %2 to i8*
store i32 0, i32* %3
br label %5
5: ; preds = %30, %0
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 13
br i1 %8, label %9, label %33
9: ; preds = %5
%10 = load i32, i32* %3
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %11
%13 = load i32, i32* %12
%14 = load i32, i32* %3
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %15
%17 = load i32, i32* %16
%18 = call double @exp(i32 %17)
%19 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %13, double %18)
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %21
%23 = load i32, i32* %22
%24 = load i32, i32* %3
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [13 x i32], [13 x i32]* %2, i64 0, i64 %25
%27 = load i32, i32* %26
%28 = call double @myexp(i32 %27)
%29 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %23, double %28)
br label %30
30: ; preds = %9
%31 = load i32, i32* %3
%32 = add nsw i32 %31, 1
store i32 %32, i32* %3
br label %5
33: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [13 x i32] [i32 -1000, i32 -200, i32 -100, i32 -50, i32 -10, i32 -1, i32 0, i32 1, i32 10, i32 50, i32 100, i32 200, i32 1000]
@.str = [17 x i8] c" exp(%+6d): %e\0A\00"
@.str.1 = [17 x i8] c"myexp(%+6d): %e\0A\00"
define i32 @main() {
br label %2
1: ; preds = %2
ret i32 0
2: ; preds = %0, %2
%3 = phi i64 [ 0, %0 ], [ %10, %2 ]
%4 = getelementptr inbounds [13 x i32], [13 x i32]* @__const.main.nums, i64 0, i64 %3
%5 = load i32, i32* %4
%6 = tail call double @exp(i32 %5)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, double %6)
%8 = tail call double @myexp(i32 %5)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %5, double %8)
%10 = add nuw nsw i64 %3, 1
%11 = icmp eq i64 %10, 13
br i1 %11, label %1, label %2
}