#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 const ceil(double const);
double pow(double, double const);
char f_pow(double *a, const double *b) {
  if (*a == 0 && *b <= 0) {
    return (1);
  } else {
    if (*a < 0 && ceil(*b) != *b) {
      return (1);
    } else {
      *a = pow(*a, *b);
    }
  }
  return (0);
}


x86 assembly (clang, -O0):
<f_pow>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1165 <f_pow+0x45>
jp     1165 <f_pow+0x45>
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jb     1165 <f_pow+0x45>
movb   $0x1,-0x1(%rbp)
jmp    11cb <f_pow+0xab>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
ucomisd (%rax),%xmm0
jbe    11a5 <f_pow+0x85>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1030 <ceil@plt>
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jne    119c <f_pow+0x7c>
jp     119c <f_pow+0x7c>
jmp    11a5 <f_pow+0x85>
movb   $0x1,-0x1(%rbp)
jmp    11cb <f_pow+0xab>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
call   1040 <pow@plt>
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
jmp    11c7 <f_pow+0xa7>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_pow>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movsd  (%rdi),%xmm1
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm1
jne    1140 <f_pow+0x20>
jp     1140 <f_pow+0x20>
mov    $0x1,%al
ucomisd (%rsi),%xmm0
jae    1182 <f_pow+0x62>
movsd  (%rsi),%xmm0
movsd  %xmm0,(%rsp)
movsd  %xmm1,0x8(%rsp)
call   1030 <ceil@plt>
movsd  (%rsp),%xmm1
movsd  0x8(%rsp),%xmm2
xorpd  %xmm3,%xmm3
ucomisd %xmm2,%xmm3
jbe    1173 <f_pow+0x53>
mov    $0x1,%al
ucomisd %xmm1,%xmm0
jne    1182 <f_pow+0x62>
jp     1182 <f_pow+0x62>
movapd %xmm2,%xmm0
call   1040 <pow@plt>
movsd  %xmm0,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define signext i8 @f_pow(double* %0, double* %1) {
%3 = alloca i8
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = fcmp oeq double %7, 0.000000e+00
br i1 %8, label %9, label %14
9: ; preds = %2
%10 = load double*, double** %5
%11 = load double, double* %10
%12 = fcmp ole double %11, 0.000000e+00
br i1 %12, label %13, label %14
13: ; preds = %9
store i8 1, i8* %3
br label %35
14: ; preds = %9, %2
%15 = load double*, double** %4
%16 = load double, double* %15
%17 = fcmp olt double %16, 0.000000e+00
br i1 %17, label %18, label %26
18: ; preds = %14
%19 = load double*, double** %5
%20 = load double, double* %19
%21 = call double @ceil(double %20)
%22 = load double*, double** %5
%23 = load double, double* %22
%24 = fcmp une double %21, %23
br i1 %24, label %25, label %26
25: ; preds = %18
store i8 1, i8* %3
br label %35
26: ; preds = %18, %14
%27 = load double*, double** %4
%28 = load double, double* %27
%29 = load double*, double** %5
%30 = load double, double* %29
%31 = call double @pow(double %28, double %30)
%32 = load double*, double** %4
store double %31, double* %32
br label %33
33: ; preds = %26
br label %34
34: ; preds = %33
store i8 0, i8* %3
br label %35
35: ; preds = %34, %25, %13
%36 = load i8, i8* %3
ret i8 %36
}

LLVM IR (-O2):
define signext i8 @f_pow(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = fcmp oeq double %3, 0.000000e+00
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = load double, double* %1
%7 = fcmp ugt double %6, 0.000000e+00
br i1 %7, label %8, label %16
8: ; preds = %5, %2
%9 = fcmp olt double %3, 0.000000e+00
%10 = load double, double* %1
%11 = tail call double @llvm.ceil.f64(double %10)
%12 = fcmp une double %11, %10
%13 = select i1 %9, i1 %12, i1 false
br i1 %13, label %16, label %14
14: ; preds = %8
%15 = tail call double @pow(double %3, double %10)
store double %15, double* %0
br label %16
16: ; preds = %8, %5, %14
%17 = phi i8 [ 0, %14 ], [ 1, %5 ], [ 1, %8 ]
ret i8 %17
}