#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*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main(void) {
  float base, exponent;
  float result = 1;
  scanf("%f %f", &base, &exponent);
  for (int i = 0; i < (exponent < 0 ? -exponent : exponent); i++) {
    result *= base;
  }
  if (exponent < 0) {
    result = 1 / result;
  }
  printf("%f\n", result);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xec9(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
lea    0xec1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x0,-0x14(%rbp)
cvtsi2ssl -0x14(%rbp),%xmm0
movss  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    118a <main+0x6a>
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x1c(%rbp)
jmp    1194 <main+0x74>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x1c(%rbp)
movss  -0x18(%rbp),%xmm1
movss  -0x1c(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    11c4 <main+0xa4>
movss  -0x8(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <main+0x37>
xorps  %xmm0,%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    11e3 <main+0xc3>
movss  0xe27(%rip),%xmm0
divss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
lea    0xe1b(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xeec(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movss  (%rsp),%xmm1
movaps 0xebf(%rip),%xmm0
xorps  %xmm1,%xmm0
xorps  %xmm2,%xmm2
movaps %xmm1,%xmm3
cmpltss %xmm2,%xmm3
andps  %xmm3,%xmm0
andnps %xmm1,%xmm3
orps   %xmm0,%xmm3
movss  0xeb0(%rip),%xmm0
ucomiss %xmm2,%xmm3
jbe    1183 <main+0x63>
mov    $0x1,%eax
movss  0x4(%rsp),%xmm4
xorps  %xmm5,%xmm5
cvtsi2ss %eax,%xmm5
mulss  %xmm4,%xmm0
add    $0x1,%eax
ucomiss %xmm5,%xmm3
ja     1170 <main+0x50>
ucomiss %xmm1,%xmm2
jbe    1197 <main+0x77>
movss  0xe80(%rip),%xmm1
divss  %xmm0,%xmm1
movaps %xmm1,%xmm0
lea    0xe7c(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca i32
store i32 0, i32* %1
store float 1.000000e+00, float* %4
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %2, float* %3)
store i32 0, i32* %5
br label %7
7: ; preds = %24, %0
%8 = load i32, i32* %5
%9 = sitofp i32 %8 to float
%10 = load float, float* %3
%11 = fcmp olt float %10, 0.000000e+00
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = load float, float* %3
%14 = fneg float %13
br label %17
15: ; preds = %7
%16 = load float, float* %3
br label %17
17: ; preds = %15, %12
%18 = phi float [ %14, %12 ], [ %16, %15 ]
%19 = fcmp olt float %9, %18
br i1 %19, label %20, label %27
20: ; preds = %17
%21 = load float, float* %2
%22 = load float, float* %4
%23 = fmul float %22, %21
store float %23, float* %4
br label %24
24: ; preds = %20
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %7
27: ; preds = %17
%28 = load float, float* %3
%29 = fcmp olt float %28, 0.000000e+00
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load float, float* %4
%32 = fdiv float 1.000000e+00, %31
store float %32, float* %4
br label %33
33: ; preds = %30, %27
%34 = load float, float* %4
%35 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %34)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %2
%7 = fcmp olt float %6, 0.000000e+00
%8 = fneg float %6
%9 = select i1 %7, float %8, float %6
%10 = fcmp ogt float %9, 0.000000e+00
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = load float, float* %1
br label %18
13: ; preds = %18, %0
%14 = phi float [ 1.000000e+00, %0 ], [ %21, %18 ]
%15 = fdiv float 1.000000e+00, %14
%16 = select i1 %7, float %15, float %14
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), float %16)
ret i32 0
18: ; preds = %11, %18
%19 = phi i32 [ 0, %11 ], [ %22, %18 ]
%20 = phi float [ 1.000000e+00, %11 ], [ %21, %18 ]
%21 = fmul float %20, %12
%22 = add nuw nsw i32 %19, 1
%23 = sitofp i32 %22 to float
%24 = fcmp ogt float %9, %23
br i1 %24, label %18, label %13
}