#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 /*<<< orphan*/ RaiseRealToPower(double, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main(int argc, const char *argv[]) {
  int i, start, end;
  double n;
  printf("n^k\n");
  printf(" n ? ");
  scanf("%lf", &n);
  printf(" k start ? ");
  scanf("%d", &start);
  printf(" k end   ? ");
  scanf("%d", &end);
  printf("--------------------\n");
  for (i = start; i <= end; i++) {
    if (i < 0)
      printf("%4d        %-6Lg\n", i, RaiseRealToPower(n, i));
    else
      printf("%4d %8Lg\n", i, RaiseRealToPower(n, i));
  }
  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)
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xeaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea2(%rip),%rdi
lea    -0x28(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe92(%rip),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe72(%rip),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jg     1242 <main+0x112>
cmpl   $0x0,-0x14(%rbp)
jge    1209 <main+0xd9>
mov    -0x14(%rbp),%eax
mov    %eax,-0x2c(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1050 <RaiseRealToPower@plt>
mov    -0x2c(%rbp),%esi
mov    %eax,%edx
lea    0xe43(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    122f <main+0xff>
mov    -0x14(%rbp),%eax
mov    %eax,-0x30(%rbp)
movsd  -0x28(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1050 <RaiseRealToPower@plt>
mov    -0x30(%rbp),%esi
mov    %eax,%edx
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1234 <main+0x104>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c8 <main+0x98>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xef1(%rip),%rdi
call   1030 <puts@plt>
lea    0xea4(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9c(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe8d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8b(%rip),%rbx
lea    0x4(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe78(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rsp,%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xe89(%rip),%rdi
call   1030 <puts@plt>
mov    0x4(%rsp),%ebx
cmp    (%rsp),%ebx
jg     120b <main+0xcb>
lea    0xe54(%rip),%r14
lea    0xe5f(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
mov    %ebx,%edi
call   1060 <RaiseRealToPower@plt>
test   %ebx,%ebx
mov    %r15,%rdi
cmovs  %r14,%rdi
mov    %ebx,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbx),%eax
cmp    (%rsp),%ebx
mov    %eax,%ebx
jl     11e0 <main+0xa0>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"n^k\0A\00"
@.str.1 = [6 x i8] c" n ? \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [12 x i8] c" k start ? \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [12 x i8] c" k end ? \00"
@.str.6 = [22 x i8] c"--------------------\0A\00"
@.str.7 = [18 x i8] c"%4d %-6Lg\0A\00"
@.str.8 = [10 x i8] c"%4d %8Lg\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %9)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %7)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %8)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32, i32* %7
store i32 %18, i32* %6
br label %19
19: ; preds = %39, %2
%20 = load i32, i32* %6
%21 = load i32, i32* %8
%22 = icmp sle i32 %20, %21
br i1 %22, label %23, label %42
23: ; preds = %19
%24 = load i32, i32* %6
%25 = icmp slt i32 %24, 0
br i1 %25, label %26, label %32
26: ; preds = %23
%27 = load i32, i32* %6
%28 = load double, double* %9
%29 = load i32, i32* %6
%30 = call i32 @RaiseRealToPower(double %28, i32 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i32 %27, i32 %30)
br label %38
32: ; preds = %23
%33 = load i32, i32* %6
%34 = load double, double* %9
%35 = load i32, i32* %6
%36 = call i32 @RaiseRealToPower(double %34, i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i32 %33, i32 %36)
br label %38
38: ; preds = %32, %26
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %19
42: ; preds = %19
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [6 x i8] c" n ? \00"
@.str.2 = [4 x i8] c"%lf\00"
@.str.3 = [12 x i8] c" k start ? \00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [12 x i8] c" k end ? \00"
@.str.7 = [18 x i8] c"%4d %-6Lg\0A\00"
@.str.8 = [10 x i8] c"%4d %8Lg\0A\00"
@str = [4 x i8] c"n^k\00"
@str.9 = [21 x i8] c"--------------------\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
%6 = bitcast i32* %3 to i8*
%7 = bitcast i32* %4 to i8*
%8 = bitcast double* %5 to i8*
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double* %5)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %4)
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.9, i64 0, i64 0))
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = icmp sgt i32 %17, %18
br i1 %19, label %30, label %20
20: ; preds = %2, %20
%21 = phi i32 [ %27, %20 ], [ %17, %2 ]
%22 = icmp slt i32 %21, 0
%23 = load double, double* %5
%24 = call i32 @RaiseRealToPower(double %23, i32 %21)
%25 = select i1 %22, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %25, i32 %21, i32 %24)
%27 = add nsw i32 %21, 1
%28 = load i32, i32* %4
%29 = icmp slt i32 %21, %28
br i1 %29, label %20, label %30
30: ; preds = %20, %2
ret i32 0
}