#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 pow(double, double);
double gam(int i, int k, int j, double kappa, double beta, double alpha) {
  double val = 0.0;
  if (i == 1) {
    if (k == 0) {
      val = beta;
    }
    if (k == 1) {
      val = beta + 1.0;
    }
    if (k == -1) {
      val = beta - 1.0;
    }
    if (k == 2) {
      val = beta + pow(alpha, 1.5);
      ;
    }
    if (k == -2) {
      val = beta - pow(alpha, 1.5);
    }
  } else {
    if (k == 0) {
      val = kappa;
    }
    if (k == 2) {
      val = kappa + 1.0;
    }
    if (k == -2) {
      val = kappa - 1.0;
    }
    if (k == 1) {
      val = kappa + pow(alpha, -1.5);
      ;
    }
    if (k == -1) {
      val = kappa - pow(alpha, -1.5);
    }
  }
  return (val);
}


x86 assembly (clang, -O0):
<gam>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsd  %xmm0,-0x18(%rbp)
movsd  %xmm1,-0x20(%rbp)
movsd  %xmm2,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1205 <gam+0xf5>
cmpl   $0x0,-0x8(%rbp)
jne    1156 <gam+0x46>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1172 <gam+0x62>
movsd  0xe98(%rip),%xmm0
addsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    1192 <gam+0x82>
movsd  -0x20(%rbp),%xmm0
movsd  0xe77(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    11c9 <gam+0xb9>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe5d(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x38(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jne    1200 <gam+0xf0>
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xe26(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x40(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12c8 <gam+0x1b8>
cmpl   $0x0,-0x8(%rbp)
jne    1219 <gam+0x109>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    1235 <gam+0x125>
movsd  0xdd5(%rip),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0xfffffffe,-0x8(%rbp)
jne    1255 <gam+0x145>
movsd  -0x18(%rbp),%xmm0
movsd  0xdb4(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    128c <gam+0x17c>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xd92(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x48(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cmpl   $0xffffffff,-0x8(%rbp)
jne    12c3 <gam+0x1b3>
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  0xd5b(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x50(%rbp),%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
jmp    12c8 <gam+0x1b8>
movsd  -0x30(%rbp),%xmm0
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gam>:
push   %rax
cmp    $0x1,%edi
jne    1159 <gam+0x49>
movapd %xmm1,%xmm0
test   %esi,%esi
jne    11a6 <gam+0x96>
cmp    $0x1,%esi
je     11b3 <gam+0xa3>
cmp    $0xffffffff,%esi
je     11c8 <gam+0xb8>
cmp    $0xfffffffe,%esi
je     11dd <gam+0xcd>
cmp    $0x2,%esi
jne    124a <gam+0x13a>
movsd  %xmm1,(%rsp)
movsd  0xec5(%rip),%xmm1
movapd %xmm2,%xmm0
jmp    119a <gam+0x8a>
movapd %xmm0,%xmm3
test   %esi,%esi
jne    11f0 <gam+0xe0>
cmp    $0x2,%esi
je     11fd <gam+0xed>
cmp    $0xfffffffe,%esi
je     1212 <gam+0x102>
cmp    $0xffffffff,%esi
je     1227 <gam+0x117>
cmp    $0x1,%esi
jne    124a <gam+0x13a>
movsd  0xe7f(%rip),%xmm1
movapd %xmm2,%xmm0
movsd  %xmm3,(%rsp)
call   1030 <pow@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret
xorpd  %xmm0,%xmm0
cmp    $0x1,%esi
jne    112b <gam+0x1b>
movsd  0xe45(%rip),%xmm0
addsd  %xmm1,%xmm0
cmp    $0xffffffff,%esi
jne    1134 <gam+0x24>
movsd  0xe38(%rip),%xmm0
addsd  %xmm1,%xmm0
cmp    $0xfffffffe,%esi
jne    113d <gam+0x2d>
movsd  %xmm1,(%rsp)
movsd  0xe2e(%rip),%xmm1
movapd %xmm2,%xmm0
jmp    1238 <gam+0x128>
xorpd  %xmm0,%xmm0
cmp    $0x2,%esi
jne    116e <gam+0x5e>
movsd  0xdfb(%rip),%xmm0
addsd  %xmm3,%xmm0
cmp    $0xfffffffe,%esi
jne    1177 <gam+0x67>
movsd  0xdee(%rip),%xmm0
addsd  %xmm3,%xmm0
cmp    $0xffffffff,%esi
jne    1180 <gam+0x70>
movsd  0xde1(%rip),%xmm1
movapd %xmm2,%xmm0
movsd  %xmm3,(%rsp)
call   1030 <pow@plt>
movsd  (%rsp),%xmm1
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @gam(i32 %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
store double 0.000000e+00, double* %13
%14 = load i32, i32* %7
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %50
16: ; preds = %6
%17 = load i32, i32* %8
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = load double, double* %11
store double %20, double* %13
br label %21
21: ; preds = %19, %16
%22 = load i32, i32* %8
%23 = icmp eq i32 %22, 1
br i1 %23, label %24, label %27
24: ; preds = %21
%25 = load double, double* %11
%26 = fadd double %25, 1.000000e+00
store double %26, double* %13
br label %27
27: ; preds = %24, %21
%28 = load i32, i32* %8
%29 = icmp eq i32 %28, -1
br i1 %29, label %30, label %33
30: ; preds = %27
%31 = load double, double* %11
%32 = fsub double %31, 1.000000e+00
store double %32, double* %13
br label %33
33: ; preds = %30, %27
%34 = load i32, i32* %8
%35 = icmp eq i32 %34, 2
br i1 %35, label %36, label %41
36: ; preds = %33
%37 = load double, double* %11
%38 = load double, double* %12
%39 = call double @pow(double %38, double 1.500000e+00)
%40 = fadd double %37, %39
store double %40, double* %13
br label %41
41: ; preds = %36, %33
%42 = load i32, i32* %8
%43 = icmp eq i32 %42, -2
br i1 %43, label %44, label %49
44: ; preds = %41
%45 = load double, double* %11
%46 = load double, double* %12
%47 = call double @pow(double %46, double 1.500000e+00)
%48 = fsub double %45, %47
store double %48, double* %13
br label %49
49: ; preds = %44, %41
br label %84
50: ; preds = %6
%51 = load i32, i32* %8
%52 = icmp eq i32 %51, 0
br i1 %52, label %53, label %55
53: ; preds = %50
%54 = load double, double* %10
store double %54, double* %13
br label %55
55: ; preds = %53, %50
%56 = load i32, i32* %8
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %61
58: ; preds = %55
%59 = load double, double* %10
%60 = fadd double %59, 1.000000e+00
store double %60, double* %13
br label %61
61: ; preds = %58, %55
%62 = load i32, i32* %8
%63 = icmp eq i32 %62, -2
br i1 %63, label %64, label %67
64: ; preds = %61
%65 = load double, double* %10
%66 = fsub double %65, 1.000000e+00
store double %66, double* %13
br label %67
67: ; preds = %64, %61
%68 = load i32, i32* %8
%69 = icmp eq i32 %68, 1
br i1 %69, label %70, label %75
70: ; preds = %67
%71 = load double, double* %10
%72 = load double, double* %12
%73 = call double @pow(double %72, double -1.500000e+00)
%74 = fadd double %71, %73
store double %74, double* %13
br label %75
75: ; preds = %70, %67
%76 = load i32, i32* %8
%77 = icmp eq i32 %76, -1
br i1 %77, label %78, label %83
78: ; preds = %75
%79 = load double, double* %10
%80 = load double, double* %12
%81 = call double @pow(double %80, double -1.500000e+00)
%82 = fsub double %79, %81
store double %82, double* %13
br label %83
83: ; preds = %78, %75
br label %84
84: ; preds = %83, %49
%85 = load double, double* %13
ret double %85
}

LLVM IR (-O2):
define double @gam(i32 %0, i32 %1, i32 %2, double %3, double %4, double %5) {
%7 = icmp eq i32 %0, 1
%8 = icmp eq i32 %1, 0
br i1 %7, label %9, label %23
9: ; preds = %6
%10 = select i1 %8, double %4, double 0.000000e+00
%11 = icmp eq i32 %1, 1
%12 = fadd double %4, 1.000000e+00
%13 = select i1 %11, double %12, double %10
%14 = icmp eq i32 %1, -1
%15 = fadd double %4, -1.000000e+00
%16 = select i1 %14, double %15, double %13
switch i32 %1, label %37 [
i32 2, label %17
i32 -2, label %20
]
17: ; preds = %9
%18 = tail call double @pow(double %5, double 1.500000e+00)
%19 = fadd double %18, %4
br label %37
20: ; preds = %9
%21 = tail call double @pow(double %5, double 1.500000e+00)
%22 = fsub double %4, %21
br label %37
23: ; preds = %6
%24 = select i1 %8, double %3, double 0.000000e+00
%25 = icmp eq i32 %1, 2
%26 = fadd double %3, 1.000000e+00
%27 = select i1 %25, double %26, double %24
%28 = icmp eq i32 %1, -2
%29 = fadd double %3, -1.000000e+00
%30 = select i1 %28, double %29, double %27
switch i32 %1, label %37 [
i32 1, label %31
i32 -1, label %34
]
31: ; preds = %23
%32 = tail call double @pow(double %5, double -1.500000e+00)
%33 = fadd double %32, %3
br label %37
34: ; preds = %23
%35 = tail call double @pow(double %5, double -1.500000e+00)
%36 = fsub double %3, %35
br label %37
37: ; preds = %23, %9, %31, %17, %34, %20
%38 = phi double [ %22, %20 ], [ %36, %34 ], [ %19, %17 ], [ %33, %31 ], [ %16, %9 ], [ %30, %23 ]
ret double %38
}