#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 Xgamm(double *);
double exp(double);
double gam1(double *);
double log(double);
double pow(double, double);
double rlog(double *);
double sqrt(double);
double rcomp(double *a, double *x) {
  static double rt2pin = .398942280401433e0;
  static double rcomp, t, t1, u;
  rcomp = 0.0e0;
  if (*a >= 20.0e0)
    goto S20;
  t = *a * log(*x) - *x;
  if (*a >= 1.0e0)
    goto S10;
  rcomp = *a * exp(t) * (1.0e0 + gam1(a));
  return rcomp;
S10:
  rcomp = exp(t) / Xgamm(a);
  return rcomp;
S20:
  u = *x / *a;
  if (u == 0.0e0)
    return rcomp;
  t = pow(1.0e0 / *a, 2.0);
  t1 = (((0.75e0 * t - 1.0e0) * t + 3.5e0) * t - 105.0e0) / (*a * 1260.0e0);
  t1 -= (*a * rlog(&u));
  rcomp = rt2pin * sqrt(*a) * exp(t1);
  return rcomp;
}


x86 assembly (clang, -O0):
<rcomp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,0x2edd(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe65(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     11aa <rcomp+0x3a>
jmp    12c1 <rcomp+0x151>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
call   1070 <log@plt>
movaps %xmm0,%xmm2
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2e75(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xdfd(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     121a <rcomp+0xaa>
jmp    1280 <rcomp+0x110>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0x2e41(%rip),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <gam1@plt>
movaps %xmm0,%xmm2
movsd  -0x28(%rbp),%xmm0
movsd  0xdaa(%rip),%xmm1
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2dfa(%rip)
movsd  0x2df2(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1440 <rcomp+0x2d0>
movsd  0x2de8(%rip),%xmm0
call   1050 <exp@plt>
movsd  %xmm0,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <Xgamm@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2db9(%rip)
movsd  0x2db1(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1440 <rcomp+0x2d0>
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
divsd  (%rax),%xmm0
movsd  %xmm0,0x2da7(%rip)
movsd  0x2d9f(%rip),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1306 <rcomp+0x196>
jp     1306 <rcomp+0x196>
movsd  0x2d6c(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1440 <rcomp+0x2d0>
mov    -0x10(%rbp),%rax
movsd  0xcf6(%rip),%xmm0
divsd  (%rax),%xmm0
movsd  0xd1a(%rip),%xmm1
call   1080 <pow@plt>
movsd  %xmm0,0x2d45(%rip)
movsd  0x2d3d(%rip),%xmm0
movsd  0xced(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xce9(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x2d1d(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xcc1(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0x2d05(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xca1(%rip),%xmm1
addsd  %xmm1,%xmm0
mov    -0x10(%rbp),%rax
movsd  0xc89(%rip),%xmm1
mulsd  (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2ce1(%rip)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
lea    0x2cd5(%rip),%rdi
call   1060 <rlog@plt>
movaps %xmm0,%xmm2
movsd  -0x50(%rbp),%xmm0
movsd  0x2cb8(%rip),%xmm1
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x2c91(%rip)
movsd  0x2c69(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
call   1090 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0x2c5e(%rip),%xmm0
call   1050 <exp@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,0x2c35(%rip)
movsd  0x2c2d(%rip),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rcomp>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movsd  (%rdi),%xmm1
ucomisd 0xe8d(%rip),%xmm1
movsd  (%rsi),%xmm0
jae    11d7 <rcomp+0x77>
mov    %rsi,%rbx
movsd  %xmm1,(%rsp)
call   1070 <log@plt>
mulsd  (%rsp),%xmm0
subsd  (%rbx),%xmm0
movsd  (%r14),%xmm1
movsd  %xmm1,(%rsp)
call   1050 <exp@plt>
movsd  (%rsp),%xmm2
ucomisd 0xe5d(%rip),%xmm2
jae    128f <rcomp+0x12f>
movapd %xmm2,%xmm1
mulsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp)
mov    %r14,%rdi
call   1030 <gam1@plt>
movapd %xmm0,%xmm1
addsd  0xe36(%rip),%xmm1
jmp    12ca <rcomp+0x16a>
divsd  %xmm1,%xmm0
movsd  %xmm0,0x2e7d(%rip)
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    11f3 <rcomp+0x93>
jnp    12cf <rcomp+0x16f>
movsd  (%r14),%xmm1
movsd  0xe08(%rip),%xmm0
divsd  %xmm1,%xmm0
movapd %xmm1,%xmm2
movsd  %xmm1,(%rsp)
mulsd  %xmm0,%xmm0
movsd  0xdf7(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdf3(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdef(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xdeb(%rip),%xmm1
movsd  0xdeb(%rip),%xmm0
mulsd  %xmm2,%xmm0
divsd  %xmm0,%xmm1
movsd  %xmm1,0x2e03(%rip)
lea    0x2e04(%rip),%rdi
call   1060 <rlog@plt>
movsd  0x2def(%rip),%xmm1
mulsd  (%rsp),%xmm0
subsd  %xmm0,%xmm1
movsd  %xmm1,0x2dde(%rip)
movsd  (%r14),%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     12a7 <rcomp+0x147>
sqrtsd %xmm0,%xmm0
jmp    12ac <rcomp+0x14c>
mov    %r14,%rdi
movsd  %xmm0,(%rsp)
call   1040 <Xgamm@plt>
movsd  (%rsp),%xmm1
divsd  %xmm0,%xmm1
jmp    12cf <rcomp+0x16f>
call   1080 <sqrt@plt>
mulsd  0xd84(%rip),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x2d97(%rip),%xmm0
call   1050 <exp@plt>
movapd %xmm0,%xmm1
mulsd  (%rsp),%xmm1
movapd %xmm1,%xmm0
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@rcomp.rt2pin = internal global double 0x3FD9884533D43656
@rcomp.rcomp = internal global double 0.000000e+00
@rcomp.t = internal global double 0.000000e+00
@rcomp.t1 = internal global double 0.000000e+00
@rcomp.u = internal global double 0.000000e+00
define double @rcomp(double* %0, double* %1) {
%3 = alloca double
%4 = alloca double*
%5 = alloca double*
store double* %0, double** %4
store double* %1, double** %5
store double 0.000000e+00, double* @rcomp.rcomp
%6 = load double*, double** %4
%7 = load double, double* %6
%8 = fcmp oge double %7, 2.000000e+01
br i1 %8, label %9, label %10
9: ; preds = %2
br label %42
10: ; preds = %2
%11 = load double*, double** %4
%12 = load double, double* %11
%13 = load double*, double** %5
%14 = load double, double* %13
%15 = call double @log(double %14)
%16 = load double*, double** %5
%17 = load double, double* %16
%18 = fneg double %17
%19 = call double @llvm.fmuladd.f64(double %12, double %15, double %18)
store double %19, double* @rcomp.t
%20 = load double*, double** %4
%21 = load double, double* %20
%22 = fcmp oge double %21, 1.000000e+00
br i1 %22, label %23, label %24
23: ; preds = %10
br label %35
24: ; preds = %10
%25 = load double*, double** %4
%26 = load double, double* %25
%27 = load double, double* @rcomp.t
%28 = call double @exp(double %27)
%29 = fmul double %26, %28
%30 = load double*, double** %4
%31 = call double @gam1(double* %30)
%32 = fadd double 1.000000e+00, %31
%33 = fmul double %29, %32
store double %33, double* @rcomp.rcomp
%34 = load double, double* @rcomp.rcomp
store double %34, double* %3
br label %82
35: ; preds = %23
%36 = load double, double* @rcomp.t
%37 = call double @exp(double %36)
%38 = load double*, double** %4
%39 = call double @Xgamm(double* %38)
%40 = fdiv double %37, %39
store double %40, double* @rcomp.rcomp
%41 = load double, double* @rcomp.rcomp
store double %41, double* %3
br label %82
42: ; preds = %9
%43 = load double*, double** %5
%44 = load double, double* %43
%45 = load double*, double** %4
%46 = load double, double* %45
%47 = fdiv double %44, %46
store double %47, double* @rcomp.u
%48 = load double, double* @rcomp.u
%49 = fcmp oeq double %48, 0.000000e+00
br i1 %49, label %50, label %52
50: ; preds = %42
%51 = load double, double* @rcomp.rcomp
store double %51, double* %3
br label %82
52: ; preds = %42
%53 = load double*, double** %4
%54 = load double, double* %53
%55 = fdiv double 1.000000e+00, %54
%56 = call double @pow(double %55, double 2.000000e+00)
store double %56, double* @rcomp.t
%57 = load double, double* @rcomp.t
%58 = call double @llvm.fmuladd.f64(double 7.500000e-01, double %57, double -1.000000e+00)
%59 = load double, double* @rcomp.t
%60 = call double @llvm.fmuladd.f64(double %58, double %59, double 3.500000e+00)
%61 = load double, double* @rcomp.t
%62 = call double @llvm.fmuladd.f64(double %60, double %61, double -1.050000e+02)
%63 = load double*, double** %4
%64 = load double, double* %63
%65 = fmul double %64, 1.260000e+03
%66 = fdiv double %62, %65
store double %66, double* @rcomp.t1
%67 = load double*, double** %4
%68 = load double, double* %67
%69 = call double @rlog(double* @rcomp.u)
%70 = load double, double* @rcomp.t1
%71 = fneg double %68
%72 = call double @llvm.fmuladd.f64(double %71, double %69, double %70)
store double %72, double* @rcomp.t1
%73 = load double, double* @rcomp.rt2pin
%74 = load double*, double** %4
%75 = load double, double* %74
%76 = call double @sqrt(double %75)
%77 = fmul double %73, %76
%78 = load double, double* @rcomp.t1
%79 = call double @exp(double %78)
%80 = fmul double %77, %79
store double %80, double* @rcomp.rcomp
%81 = load double, double* @rcomp.rcomp
store double %81, double* %3
br label %82
82: ; preds = %52, %50, %35, %24
%83 = load double, double* %3
ret double %83
}

LLVM IR (-O2):
@rcomp.t1 = internal unnamed_addr global double 0.000000e+00
@rcomp.u = internal global double 0.000000e+00
define double @rcomp(double* %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = fcmp ult double %3, 2.000000e+01
%5 = load double, double* %1
br i1 %4, label %6, label %22
6: ; preds = %2
%7 = tail call double @log(double %5)
%8 = load double, double* %1
%9 = fneg double %8
%10 = tail call double @llvm.fmuladd.f64(double %3, double %7, double %9)
%11 = load double, double* %0
%12 = fcmp ult double %11, 1.000000e+00
%13 = tail call double @exp(double %10)
br i1 %12, label %14, label %19
14: ; preds = %6
%15 = fmul double %11, %13
%16 = tail call double @gam1(double* %0)
%17 = fadd double %16, 1.000000e+00
%18 = fmul double %15, %17
br label %44
19: ; preds = %6
%20 = tail call double @Xgamm(double* %0)
%21 = fdiv double %13, %20
br label %44
22: ; preds = %2
%23 = fdiv double %5, %3
store double %23, double* @rcomp.u
%24 = fcmp oeq double %23, 0.000000e+00
br i1 %24, label %44, label %25
25: ; preds = %22
%26 = load double, double* %0
%27 = fdiv double 1.000000e+00, %26
%28 = fmul double %27, %27
%29 = tail call double @llvm.fmuladd.f64(double %28, double 7.500000e-01, double -1.000000e+00)
%30 = tail call double @llvm.fmuladd.f64(double %29, double %28, double 3.500000e+00)
%31 = tail call double @llvm.fmuladd.f64(double %30, double %28, double -1.050000e+02)
%32 = fmul double %26, 1.260000e+03
%33 = fdiv double %31, %32
store double %33, double* @rcomp.t1
%34 = tail call double @rlog(double* @rcomp.u)
%35 = load double, double* @rcomp.t1
%36 = fneg double %26
%37 = tail call double @llvm.fmuladd.f64(double %36, double %34, double %35)
store double %37, double* @rcomp.t1
%38 = load double, double* %0
%39 = tail call double @sqrt(double %38)
%40 = fmul double %39, 0x3FD9884533D43656
%41 = load double, double* @rcomp.t1
%42 = tail call double @exp(double %41)
%43 = fmul double %40, %42
br label %44
44: ; preds = %25, %19, %14, %22
%45 = phi double [ 0.000000e+00, %22 ], [ %43, %25 ], [ %21, %19 ], [ %18, %14 ]
ret double %45
}