#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 */
long double pow(long double base, long double potencia) {
  if (potencia == 0.0 && base != 0.0)
    return 1.0;
  else if (potencia == 0.0 && base == 0.0)
    return 0.0;
  long double m = 1.0;
  for (int i = 1; i <= potencia; i++) {
    m *= base;
  }
  return m;
}


x86 assembly (clang, -O0):
<pow>:
push   %rbp
mov    %rsp,%rbp
fldt   0x20(%rbp)
fldt   0x10(%rbp)
fstpt  -0x20(%rbp)
fstpt  -0x30(%rbp)
fldt   -0x30(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1152 <pow+0x52>
jp     1152 <pow+0x52>
jmp    112c <pow+0x2c>
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1148 <pow+0x48>
jp     1148 <pow+0x48>
jmp    1152 <pow+0x52>
fld1
fstpt  -0x10(%rbp)
jmp    11df <pow+0xdf>
fldt   -0x30(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1194 <pow+0x94>
jp     1194 <pow+0x94>
jmp    116e <pow+0x6e>
fldt   -0x20(%rbp)
fldz
fxch   %st(1)
fucomip %st(1),%st
fstp   %st(0)
jne    1194 <pow+0x94>
jp     1194 <pow+0x94>
jmp    118a <pow+0x8a>
fldz
fstpt  -0x10(%rbp)
jmp    11df <pow+0xdf>
jmp    1199 <pow+0x99>
fld1
fstpt  -0x40(%rbp)
movl   $0x1,-0x44(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x48(%rbp)
fildl  -0x48(%rbp)
fldt   -0x30(%rbp)
fucomip %st(1),%st
fstp   %st(0)
jb     11d9 <pow+0xd9>
jmp    11c0 <pow+0xc0>
fldt   -0x20(%rbp)
fldt   -0x40(%rbp)
fmulp  %st,%st(1)
fstpt  -0x40(%rbp)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11a5 <pow+0xa5>
fldt   -0x40(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow>:
fldt   0x18(%rsp)
fldt   0x8(%rsp)
fldz
fxch   %st(1)
fucomi %st(1),%st
fld1
jne    1114 <pow+0x14>
jnp    1120 <pow+0x20>
fldz
fxch   %st(4)
fucomi %st(4),%st
fstp   %st(4)
jne    1120 <pow+0x20>
jnp    118b <pow+0x8b>
fstp   %st(0)
fucomi %st(1),%st
fldz
jne    113c <pow+0x3c>
jp     113c <pow+0x3c>
fstp   %st(0)
fldz
fxch   %st(3)
fucomi %st(3),%st
fstp   %st(3)
fldz
fxch   %st(2)
jne    113c <pow+0x3c>
jnp    118b <pow+0x8b>
fstp   %st(0)
fstp   %st(1)
fld1
fxch   %st(2)
fucomi %st(2),%st
fldz
fxch   %st(1)
fxch   %st(3)
fxch   %st(1)
fxch   %st(2)
fxch   %st(1)
jb     118b <pow+0x8b>
fstp   %st(0)
fstp   %st(1)
fld1
mov    $0x2,%eax
fldz
fxch   %st(2)
fxch   %st(1)
cs nopw 0x0(%rax,%rax,1)
nop
fstp   %st(2)
fmul   %st,%st(1)
mov    %eax,-0x4(%rsp)
fildl  -0x4(%rsp)
add    $0x1,%eax
fxch   %st(3)
fucomi %st(3),%st
fstp   %st(3)
fldz
fxch   %st(2)
jae    1170 <pow+0x70>
fstp   %st(3)
fstp   %st(0)
fstp   %st(0)
ret

LLVM IR (-O0):
define x86_fp80 @pow(x86_fp80 %0, x86_fp80 %1) {
%3 = alloca x86_fp80
%4 = alloca x86_fp80
%5 = alloca x86_fp80
%6 = alloca x86_fp80
%7 = alloca i32
store x86_fp80 %0, x86_fp80* %4
store x86_fp80 %1, x86_fp80* %5
%8 = load x86_fp80, x86_fp80* %5
%9 = fcmp oeq x86_fp80 %8, 0xK00000000000000000000
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load x86_fp80, x86_fp80* %4
%12 = fcmp une x86_fp80 %11, 0xK00000000000000000000
br i1 %12, label %13, label %14
13: ; preds = %10
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %3
br label %37
14: ; preds = %10, %2
%15 = load x86_fp80, x86_fp80* %5
%16 = fcmp oeq x86_fp80 %15, 0xK00000000000000000000
br i1 %16, label %17, label %21
17: ; preds = %14
%18 = load x86_fp80, x86_fp80* %4
%19 = fcmp oeq x86_fp80 %18, 0xK00000000000000000000
br i1 %19, label %20, label %21
20: ; preds = %17
store x86_fp80 0xK00000000000000000000, x86_fp80* %3
br label %37
21: ; preds = %17, %14
br label %22
22: ; preds = %21
store x86_fp80 0xK3FFF8000000000000000, x86_fp80* %6
store i32 1, i32* %7
br label %23
23: ; preds = %32, %22
%24 = load i32, i32* %7
%25 = sitofp i32 %24 to x86_fp80
%26 = load x86_fp80, x86_fp80* %5
%27 = fcmp ole x86_fp80 %25, %26
br i1 %27, label %28, label %35
28: ; preds = %23
%29 = load x86_fp80, x86_fp80* %4
%30 = load x86_fp80, x86_fp80* %6
%31 = fmul x86_fp80 %30, %29
store x86_fp80 %31, x86_fp80* %6
br label %32
32: ; preds = %28
%33 = load i32, i32* %7
%34 = add nsw i32 %33, 1
store i32 %34, i32* %7
br label %23
35: ; preds = %23
%36 = load x86_fp80, x86_fp80* %6
store x86_fp80 %36, x86_fp80* %3
br label %37
37: ; preds = %35, %20, %13
%38 = load x86_fp80, x86_fp80* %3
ret x86_fp80 %38
}

LLVM IR (-O2):
define x86_fp80 @pow(x86_fp80 %0, x86_fp80 %1) {
%3 = fcmp oeq x86_fp80 %1, 0xK00000000000000000000
%4 = fcmp une x86_fp80 %0, 0xK00000000000000000000
%5 = and i1 %4, %3
br i1 %5, label %18, label %6
6: ; preds = %2
%7 = fcmp oeq x86_fp80 %0, 0xK00000000000000000000
%8 = and i1 %7, %3
br i1 %8, label %18, label %9
9: ; preds = %6
%10 = fcmp ult x86_fp80 %1, 0xK3FFF8000000000000000
br i1 %10, label %18, label %11
11: ; preds = %9, %11
%12 = phi i32 [ %15, %11 ], [ 1, %9 ]
%13 = phi x86_fp80 [ %14, %11 ], [ 0xK3FFF8000000000000000, %9 ]
%14 = fmul x86_fp80 %13, %0
%15 = add nuw nsw i32 %12, 1
%16 = sitofp i32 %15 to x86_fp80
%17 = fcmp ugt x86_fp80 %16, %1
br i1 %17, label %18, label %11
18: ; preds = %11, %9, %6, %2
%19 = phi x86_fp80 [ 0xK3FFF8000000000000000, %2 ], [ 0xK00000000000000000000, %6 ], [ 0xK3FFF8000000000000000, %9 ], [ %14, %11 ]
ret x86_fp80 %19
}