#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 */
double power(double, int);
int /*<<< orphan*/ printf(char *, ...);
int scanf(char *, double *, int *);
int main(void) {
  double x;
  int p;
  while (scanf("%lf%d", &x, &p) == 2) {
    if (x == 0 && p == 0) {
      printf("Not defined.\n");
      continue;
    } else
      printf("%.3g to the power %d is %.5g\n", x, p, power(x, p));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1050 <scanf@plt>
cmp    $0x2,%eax
jne    11cc <main+0x9c>
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1191 <main+0x61>
jp     1191 <main+0x61>
cmpl   $0x0,-0x14(%rbp)
jne    1191 <main+0x61>
lea    0xe81(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    113f <main+0xf>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x24(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <power@plt>
mov    -0x24(%rbp),%esi
movaps %xmm0,%xmm1
movsd  -0x20(%rbp),%xmm0
lea    0xe54(%rip),%rdi
mov    $0x2,%al
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xeb3(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    11ea <main+0xaa>
lea    0xeb8(%rip),%r14
lea    0xe8d(%rip),%r15
lea    0x8(%rsp),%r12
lea    0x4(%rsp),%rbx
lea    0xe82(%rip),%r13
jmp    11c6 <main+0x86>
xchg   %ax,%ax
movsd  %xmm0,0x10(%rsp)
mov    %ebp,%edi
call   1030 <power@plt>
movapd %xmm0,%xmm1
mov    %r13,%rdi
movsd  0x10(%rsp),%xmm0
mov    %ebp,%esi
mov    $0x2,%al
call   1050 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
call   1060 <scanf@plt>
cmp    $0x2,%eax
jne    11ea <main+0xaa>
movsd  0x8(%rsp),%xmm0
ucomisd 0xe2c(%rip),%xmm0
mov    0x4(%rsp),%ebp
jne    1190 <main+0x50>
jp     1190 <main+0x50>
test   %ebp,%ebp
jne    1190 <main+0x50>
mov    %r14,%rdi
call   1040 <puts@plt>
jmp    11b3 <main+0x73>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%lf%d\00"
@.str.1 = [14 x i8] c"Not defined.\0A\00"
@.str.2 = [30 x i8] c"%.3g to the power %d is %.5g\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca i32
store i32 0, i32* %1
br label %4
4: ; preds = %22, %13, %0
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double* %2, i32* %3)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %23
7: ; preds = %4
%8 = load double, double* %2
%9 = fcmp oeq double %8, 0.000000e+00
br i1 %9, label %10, label %15
10: ; preds = %7
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
br label %4
15: ; preds = %10, %7
%16 = load double, double* %2
%17 = load i32, i32* %3
%18 = load double, double* %2
%19 = load i32, i32* %3
%20 = call double @power(double %18, i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %16, i32 %17, double %20)
br label %22
22: ; preds = %15
br label %4
23: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%lf%d\00"
@.str.2 = [30 x i8] c"%.3g to the power %d is %.5g\0A\00"
@str = [13 x i8] c"Not defined.\00"
define i32 @main() {
%1 = alloca double
%2 = alloca i32
%3 = bitcast double* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double* %1, i32* %2)
%6 = icmp eq i32 %5, 2
br i1 %6, label %7, label %21
7: ; preds = %0, %15
%8 = load double, double* %1
%9 = fcmp oeq double %8, 0.000000e+00
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 0
%12 = select i1 %9, i1 %11, i1 false
br i1 %12, label %13, label %18
13: ; preds = %7
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %15
15: ; preds = %13, %18
%16 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double* %1, i32* %2)
%17 = icmp eq i32 %16, 2
br i1 %17, label %7, label %21
18: ; preds = %7
%19 = call double @power(double %8, i32 %10)
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), double %8, i32 %10, double %19)
br label %15
21: ; preds = %15, %0
ret i32 0
}