#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 abs(int);
double sqrt(double);
void ERI_RCSH_Coeff(int m, double a[2], double b[2]) {
  double oost;
  oost = 1.0 / sqrt(2.0);
  if (m > 0) {
    if (m % 2 == 0) {
      a[0] = oost;
      a[1] = 0.0;
      b[0] = oost;
      b[1] = 0.0;
    } else {
      a[0] = -oost;
      a[1] = 0.0;
      b[0] = oost;
      b[1] = 0.0;
    }
  } else if (m < 0) {
    if (abs(m) % 2 == 0) {
      a[0] = 0.0;
      a[1] = oost;
      b[0] = 0.0;
      b[1] = -oost;
    } else {
      a[0] = 0.0;
      a[1] = oost;
      b[0] = 0.0;
      b[1] = oost;
    }
  } else {
    a[0] = 1.0;
    a[1] = 0.0;
    b[0] = 0.0;
    b[1] = 0.0;
  }
}


x86 assembly (clang, -O0):
<ERI_RCSH_Coeff>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  0xecd(%rip),%xmm0
call   1040 <sqrt@plt>
movaps %xmm0,%xmm1
movsd  0xeb5(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    11f7 <ERI_RCSH_Coeff+0xd7>
mov    -0x4(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11a9 <ERI_RCSH_Coeff+0x89>
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    11f2 <ERI_RCSH_Coeff+0xd2>
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    12d7 <ERI_RCSH_Coeff+0x1b7>
cmpl   $0x0,-0x4(%rbp)
jge    129f <ERI_RCSH_Coeff+0x17f>
mov    -0x4(%rbp),%edi
call   1030 <abs@plt>
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1268 <ERI_RCSH_Coeff+0x148>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
jmp    129a <ERI_RCSH_Coeff+0x17a>
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
movsd  -0x20(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,0x8(%rax)
jmp    12d2 <ERI_RCSH_Coeff+0x1b2>
mov    -0x10(%rbp),%rax
movsd  0xd55(%rip),%xmm0
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax)
mov    -0x18(%rbp),%rax
xorps  %xmm0,%xmm0
movsd  %xmm0,0x8(%rax)
jmp    12d7 <ERI_RCSH_Coeff+0x1b7>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ERI_RCSH_Coeff>:
test   %edi,%edi
jle    1119 <ERI_RCSH_Coeff+0x19>
test   $0x1,%dil
jne    112d <ERI_RCSH_Coeff+0x2d>
movsd  0xef6(%rip),%xmm0
movups %xmm0,(%rsi)
movups %xmm0,(%rdx)
ret
js     1144 <ERI_RCSH_Coeff+0x44>
movsd  0xedd(%rip),%xmm0
movups %xmm0,(%rsi)
xorps  %xmm0,%xmm0
movups %xmm0,(%rdx)
ret
movsd  0xedb(%rip),%xmm0
movups %xmm0,(%rsi)
movsd  0xec8(%rip),%xmm0
movups %xmm0,(%rdx)
ret
xorps  %xmm0,%xmm0
movhps 0xeba(%rip),%xmm0
movups %xmm0,(%rsi)
movq   $0x0,(%rdx)
test   $0x1,%dil
jne    116d <ERI_RCSH_Coeff+0x6d>
movabs $0xbfe6a09e667f3bcc,%rax
a0 e6 bf
mov    %rax,0x8(%rdx)
ret
movabs $0x3fe6a09e667f3bcc,%rax
a0 e6 3f
mov    %rax,0x8(%rdx)
ret

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

LLVM IR (-O2):
define void @ERI_RCSH_Coeff(i32 %0, double* nocapture writeonly %1, double* nocapture writeonly %2) {
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %14
5: ; preds = %3
%6 = and i32 %0, 1
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %5
%9 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 0x3FE6A09E667F3BCC, double 0.000000e+00>, <2 x double>* %9
%10 = bitcast double* %2 to <2 x double>*
store <2 x double> <double 0x3FE6A09E667F3BCC, double 0.000000e+00>, <2 x double>* %10
br label %26
11: ; preds = %5
%12 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 0xBFE6A09E667F3BCC, double 0.000000e+00>, <2 x double>* %12
%13 = bitcast double* %2 to <2 x double>*
store <2 x double> <double 0x3FE6A09E667F3BCC, double 0.000000e+00>, <2 x double>* %13
br label %26
14: ; preds = %3
%15 = icmp slt i32 %0, 0
br i1 %15, label %16, label %23
16: ; preds = %14
%17 = and i32 %0, 1
%18 = icmp eq i32 %17, 0
%19 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 0.000000e+00, double 0x3FE6A09E667F3BCC>, <2 x double>* %19
store double 0.000000e+00, double* %2
%20 = getelementptr inbounds double, double* %2, i64 1
br i1 %18, label %21, label %22
21: ; preds = %16
store double 0xBFE6A09E667F3BCC, double* %20
br label %26
22: ; preds = %16
store double 0x3FE6A09E667F3BCC, double* %20
br label %26
23: ; preds = %14
%24 = bitcast double* %1 to <2 x double>*
store <2 x double> <double 1.000000e+00, double 0.000000e+00>, <2 x double>* %24
%25 = bitcast double* %2 to i8*
br label %26
26: ; preds = %23, %22, %21, %8, %11
ret void
}