#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 ERI_Gaunt(int, int, int, int, int, int);
double ERI_Gaunt_R(int, int, int, int, int, int);
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
double gaunt(int l, int m, int l1, int m1, int l2, int m2, int type) {
  switch (type) {
  case 2:
    return ERI_Gaunt(l, m, l1, m1, l2, m2);
    break;
  case 1:
    return ERI_Gaunt_R(l, m, l1, m1, l2, m2);
    break;
  }
  fprintf(stderr, "***ERROR in %s (%d)\n",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/RafaelDexter/OpenMX/refs/heads/master/"
          "source/liberi-091216/source/eri_gtbl.c",
          49);
  fprintf(stderr, "   undefined type (%d)\n", type);
  abort();
  return 0.0;
}


x86 assembly (clang, -O0):
<gaunt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    0x10(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x1,%eax
je     11a7 <gaunt+0x67>
jmp    1173 <gaunt+0x33>
mov    -0x24(%rbp),%eax
sub    $0x2,%eax
jne    11ca <gaunt+0x8a>
jmp    1184 <gaunt+0x44>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1040 <ERI_Gaunt@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    120e <gaunt+0xce>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
call   1050 <ERI_Gaunt_R@plt>
movsd  %xmm0,-0x8(%rbp)
jmp    120e <gaunt+0xce>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe26(%rip),%rsi
lea    0xe34(%rip),%rdx
mov    $0x31,%ecx
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dec(%rip),%rax
mov    (%rax),%edi
mov    0x10(%rbp),%edx
lea    0xebc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>
movsd  -0x8(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gaunt>:
push   %r14
push   %rbx
push   %rax
mov    0x20(%rsp),%ebx
cmp    $0x1,%ebx
je     115e <gaunt+0x1e>
cmp    $0x2,%ebx
jne    116a <gaunt+0x2a>
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <ERI_Gaunt@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <ERI_Gaunt_R@plt>
mov    0x2e6f(%rip),%r14
mov    (%r14),%edi
lea    0xe85(%rip),%rsi
lea    0xe93(%rip),%rdx
mov    $0x31,%ecx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%r14),%edi
lea    0xf24(%rip),%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   1060 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [21 x i8] c"***ERROR in %s (%d)\0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RafaelDexter/OpenMX/refs/heads/master/source/liberi-091216/source/eri_gtbl.c\00"
@.str.2 = [24 x i8] c" undefined type (%d)\0A\00"
define double @gaunt(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca double
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 %0, i32* %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
%16 = load i32, i32* %15
switch i32 %16, label %33 [
i32 2, label %17
i32 1, label %25
]
17: ; preds = %7
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = load i32, i32* %11
%21 = load i32, i32* %12
%22 = load i32, i32* %13
%23 = load i32, i32* %14
%24 = call double @ERI_Gaunt(i32 %18, i32 %19, i32 %20, i32 %21, i32 %22, i32 %23)
store double %24, double* %8
br label %40
25: ; preds = %7
%26 = load i32, i32* %9
%27 = load i32, i32* %10
%28 = load i32, i32* %11
%29 = load i32, i32* %12
%30 = load i32, i32* %13
%31 = load i32, i32* %14
%32 = call double @ERI_Gaunt_R(i32 %26, i32 %27, i32 %28, i32 %29, i32 %30, i32 %31)
store double %32, double* %8
br label %40
33: ; preds = %7
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0), i32 49)
%36 = load i32, i32* @stderr
%37 = load i32, i32* %15
%38 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %37)
%39 = call i32 (...) @abort()
unreachable
40: ; preds = %25, %17
%41 = load double, double* %8
ret double %41
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [21 x i8] c"***ERROR in %s (%d)\0A\00"
@.str.1 = [167 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/RafaelDexter/OpenMX/refs/heads/master/source/liberi-091216/source/eri_gtbl.c\00"
@.str.2 = [24 x i8] c" undefined type (%d)\0A\00"
define double @gaunt(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
switch i32 %6, label %12 [
i32 2, label %8
i32 1, label %10
]
8: ; preds = %7
%9 = tail call double @ERI_Gaunt(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
br label %18
10: ; preds = %7
%11 = tail call double @ERI_Gaunt_R(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5)
br label %18
12: ; preds = %7
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([167 x i8], [167 x i8]* @.str.1, i64 0, i64 0), i32 49)
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%17 = tail call i32 (...) @abort()
unreachable
18: ; preds = %10, %8
%19 = phi double [ %11, %10 ], [ %9, %8 ]
ret double %19
}