#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 pow(double, double);
double FG_transfer_function(double x, double n, double k) {
  return (1 - pow(1 - x, n) / (pow(1 - x, n) + pow(k, n)) * (1 + pow(k, n)));
}


x86 assembly (clang, -O0):
<FG_transfer_function>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xed1(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    %eax,-0x20(%rbp)
movsd  0xeb7(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    %eax,-0x24(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    -0x24(%rbp),%ecx
mov    %eax,%edx
mov    -0x20(%rbp),%eax
add    %edx,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <pow@plt>
mov    -0x1c(%rbp),%ecx
add    $0x1,%eax
imul   %eax,%ecx
mov    $0x1,%eax
sub    %ecx,%eax
cvtsi2sd %eax,%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FG_transfer_function>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
movsd  %xmm2,0x8(%rsp)
movsd  %xmm1,(%rsp)
movsd  0xed7(%rip),%xmm2
subsd  %xmm0,%xmm2
movsd  %xmm2,0x10(%rsp)
movapd %xmm2,%xmm0
call   1030 <pow@plt>
mov    %eax,%ebx
movsd  0x10(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1030 <pow@plt>
mov    %eax,%ebp
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1030 <pow@plt>
mov    %eax,%ecx
add    %ebp,%ecx
mov    %ebx,%eax
cltd
idiv   %ecx
mov    %eax,%ebx
movsd  0x8(%rsp),%xmm0
movsd  (%rsp),%xmm1
call   1030 <pow@plt>
not    %eax
imul   %ebx,%eax
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define double @FG_transfer_function(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
%7 = load double, double* %4
%8 = fsub double 1.000000e+00, %7
%9 = load double, double* %5
%10 = call i32 @pow(double %8, double %9)
%11 = load double, double* %4
%12 = fsub double 1.000000e+00, %11
%13 = load double, double* %5
%14 = call i32 @pow(double %12, double %13)
%15 = load double, double* %6
%16 = load double, double* %5
%17 = call i32 @pow(double %15, double %16)
%18 = add nsw i32 %14, %17
%19 = sdiv i32 %10, %18
%20 = load double, double* %6
%21 = load double, double* %5
%22 = call i32 @pow(double %20, double %21)
%23 = add nsw i32 1, %22
%24 = mul nsw i32 %19, %23
%25 = sub nsw i32 1, %24
%26 = sitofp i32 %25 to double
ret double %26
}

LLVM IR (-O2):
define double @FG_transfer_function(double %0, double %1, double %2) {
%4 = fsub double 1.000000e+00, %0
%5 = tail call i32 @pow(double %4, double %1)
%6 = tail call i32 @pow(double %4, double %1)
%7 = tail call i32 @pow(double %2, double %1)
%8 = add nsw i32 %7, %6
%9 = sdiv i32 %5, %8
%10 = tail call i32 @pow(double %2, double %1)
%11 = xor i32 %10, -1
%12 = mul i32 %9, %11
%13 = add i32 %12, 1
%14 = sitofp i32 %13 to double
ret double %14
}