#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 /*<<< orphan*/ twobody_XA_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_XC_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_XG_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_XM_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_YA_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_YB_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_YC_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_YG_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_YH_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_YM_lub(int, double, double, double *, double *);
int /*<<< orphan*/ twobody_ZM_lub(int, double, double, double *, double *);
void twobody_lub(int version, int n, double l, double s, double *lub) {
  twobody_XA_lub(n, l, s, lub + 0, lub + 1);
  twobody_YA_lub(n, l, s, lub + 2, lub + 3);
  if (version == 0)
    return;
  twobody_YB_lub(n, l, s, lub + 4, lub + 5);
  twobody_XC_lub(n, l, s, lub + 6, lub + 7);
  twobody_YC_lub(n, l, s, lub + 8, lub + 9);
  if (version == 1)
    return;
  twobody_XG_lub(n, l, s, lub + 10, lub + 11);
  twobody_YG_lub(n, l, s, lub + 12, lub + 13);
  twobody_YH_lub(n, l, s, lub + 14, lub + 15);
  twobody_XM_lub(n, l, s, lub + 16, lub + 17);
  twobody_YM_lub(n, l, s, lub + 18, lub + 19);
  twobody_ZM_lub(n, l, s, lub + 20, lub + 21);
}


x86 assembly (clang, -O0):
<twobody_lub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rdx
add    $0x8,%rdx
call   1030 <twobody_XA_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x10,%rsi
mov    -0x20(%rbp),%rdx
add    $0x18,%rdx
call   10b0 <twobody_YA_lub@plt>
cmpl   $0x0,-0x4(%rbp)
jne    121b <twobody_lub+0x6b>
jmp    136e <twobody_lub+0x1be>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x20,%rsi
mov    -0x20(%rbp),%rdx
add    $0x28,%rdx
call   10a0 <twobody_YB_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x30,%rsi
mov    -0x20(%rbp),%rdx
add    $0x38,%rdx
call   1040 <twobody_XC_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x40,%rsi
mov    -0x20(%rbp),%rdx
add    $0x48,%rdx
call   1070 <twobody_YC_lub@plt>
cmpl   $0x1,-0x4(%rbp)
jne    1290 <twobody_lub+0xe0>
jmp    136e <twobody_lub+0x1be>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x50,%rsi
mov    -0x20(%rbp),%rdx
add    $0x58,%rdx
call   1060 <twobody_XG_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x60,%rsi
mov    -0x20(%rbp),%rdx
add    $0x68,%rdx
call   1050 <twobody_YG_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x70,%rsi
mov    -0x20(%rbp),%rdx
add    $0x78,%rdx
call   10c0 <twobody_YH_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x80,%rsi
mov    -0x20(%rbp),%rdx
add    $0x88,%rdx
call   1090 <twobody_XM_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0x90,%rsi
mov    -0x20(%rbp),%rdx
add    $0x98,%rdx
call   10d0 <twobody_YM_lub@plt>
mov    -0x8(%rbp),%edi
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mov    -0x20(%rbp),%rsi
add    $0xa0,%rsi
mov    -0x20(%rbp),%rdx
add    $0xa8,%rdx
call   1080 <twobody_ZM_lub@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<twobody_lub>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
movsd  %xmm1,0x8(%rsp)
movsd  %xmm0,(%rsp)
mov    %esi,%ebp
mov    %edi,%r14d
add    $0x8,%rdx
mov    %esi,%edi
mov    %rbx,%rsi
call   1030 <twobody_XA_lub@plt>
lea    0x10(%rbx),%rsi
lea    0x18(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   10b0 <twobody_YA_lub@plt>
test   %r14d,%r14d
je     124c <twobody_lub+0x9c>
lea    0x20(%rbx),%rsi
lea    0x28(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   10a0 <twobody_YB_lub@plt>
lea    0x30(%rbx),%rsi
lea    0x38(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1040 <twobody_XC_lub@plt>
lea    0x40(%rbx),%rsi
lea    0x48(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1070 <twobody_YC_lub@plt>
cmp    $0x1,%r14d
jne    1255 <twobody_lub+0xa5>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret
lea    0x50(%rbx),%rsi
lea    0x58(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1060 <twobody_XG_lub@plt>
lea    0x60(%rbx),%rsi
lea    0x68(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1050 <twobody_YG_lub@plt>
lea    0x70(%rbx),%rsi
lea    0x78(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   10c0 <twobody_YH_lub@plt>
lea    0x80(%rbx),%rsi
lea    0x88(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   1090 <twobody_XM_lub@plt>
lea    0x90(%rbx),%rsi
lea    0x98(%rbx),%rdx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
call   10d0 <twobody_YM_lub@plt>
lea    0xa0(%rbx),%rsi
add    $0xa8,%rbx
mov    %ebp,%edi
movsd  (%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
mov    %rbx,%rdx
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
jmp    1080 <twobody_ZM_lub@plt>

LLVM IR (-O0):
define void @twobody_lub(i32 %0, i32 %1, double %2, double %3, double* %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca double
%9 = alloca double
%10 = alloca double*
store i32 %0, i32* %6
store i32 %1, i32* %7
store double %2, double* %8
store double %3, double* %9
store double* %4, double** %10
%11 = load i32, i32* %7
%12 = load double, double* %8
%13 = load double, double* %9
%14 = load double*, double** %10
%15 = getelementptr inbounds double, double* %14, i64 0
%16 = load double*, double** %10
%17 = getelementptr inbounds double, double* %16, i64 1
%18 = call i32 @twobody_XA_lub(i32 %11, double %12, double %13, double* %15, double* %17)
%19 = load i32, i32* %7
%20 = load double, double* %8
%21 = load double, double* %9
%22 = load double*, double** %10
%23 = getelementptr inbounds double, double* %22, i64 2
%24 = load double*, double** %10
%25 = getelementptr inbounds double, double* %24, i64 3
%26 = call i32 @twobody_YA_lub(i32 %19, double %20, double %21, double* %23, double* %25)
%27 = load i32, i32* %6
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %30
29: ; preds = %5
br label %107
30: ; preds = %5
%31 = load i32, i32* %7
%32 = load double, double* %8
%33 = load double, double* %9
%34 = load double*, double** %10
%35 = getelementptr inbounds double, double* %34, i64 4
%36 = load double*, double** %10
%37 = getelementptr inbounds double, double* %36, i64 5
%38 = call i32 @twobody_YB_lub(i32 %31, double %32, double %33, double* %35, double* %37)
%39 = load i32, i32* %7
%40 = load double, double* %8
%41 = load double, double* %9
%42 = load double*, double** %10
%43 = getelementptr inbounds double, double* %42, i64 6
%44 = load double*, double** %10
%45 = getelementptr inbounds double, double* %44, i64 7
%46 = call i32 @twobody_XC_lub(i32 %39, double %40, double %41, double* %43, double* %45)
%47 = load i32, i32* %7
%48 = load double, double* %8
%49 = load double, double* %9
%50 = load double*, double** %10
%51 = getelementptr inbounds double, double* %50, i64 8
%52 = load double*, double** %10
%53 = getelementptr inbounds double, double* %52, i64 9
%54 = call i32 @twobody_YC_lub(i32 %47, double %48, double %49, double* %51, double* %53)
%55 = load i32, i32* %6
%56 = icmp eq i32 %55, 1
br i1 %56, label %57, label %58
57: ; preds = %30
br label %107
58: ; preds = %30
%59 = load i32, i32* %7
%60 = load double, double* %8
%61 = load double, double* %9
%62 = load double*, double** %10
%63 = getelementptr inbounds double, double* %62, i64 10
%64 = load double*, double** %10
%65 = getelementptr inbounds double, double* %64, i64 11
%66 = call i32 @twobody_XG_lub(i32 %59, double %60, double %61, double* %63, double* %65)
%67 = load i32, i32* %7
%68 = load double, double* %8
%69 = load double, double* %9
%70 = load double*, double** %10
%71 = getelementptr inbounds double, double* %70, i64 12
%72 = load double*, double** %10
%73 = getelementptr inbounds double, double* %72, i64 13
%74 = call i32 @twobody_YG_lub(i32 %67, double %68, double %69, double* %71, double* %73)
%75 = load i32, i32* %7
%76 = load double, double* %8
%77 = load double, double* %9
%78 = load double*, double** %10
%79 = getelementptr inbounds double, double* %78, i64 14
%80 = load double*, double** %10
%81 = getelementptr inbounds double, double* %80, i64 15
%82 = call i32 @twobody_YH_lub(i32 %75, double %76, double %77, double* %79, double* %81)
%83 = load i32, i32* %7
%84 = load double, double* %8
%85 = load double, double* %9
%86 = load double*, double** %10
%87 = getelementptr inbounds double, double* %86, i64 16
%88 = load double*, double** %10
%89 = getelementptr inbounds double, double* %88, i64 17
%90 = call i32 @twobody_XM_lub(i32 %83, double %84, double %85, double* %87, double* %89)
%91 = load i32, i32* %7
%92 = load double, double* %8
%93 = load double, double* %9
%94 = load double*, double** %10
%95 = getelementptr inbounds double, double* %94, i64 18
%96 = load double*, double** %10
%97 = getelementptr inbounds double, double* %96, i64 19
%98 = call i32 @twobody_YM_lub(i32 %91, double %92, double %93, double* %95, double* %97)
%99 = load i32, i32* %7
%100 = load double, double* %8
%101 = load double, double* %9
%102 = load double*, double** %10
%103 = getelementptr inbounds double, double* %102, i64 20
%104 = load double*, double** %10
%105 = getelementptr inbounds double, double* %104, i64 21
%106 = call i32 @twobody_ZM_lub(i32 %99, double %100, double %101, double* %103, double* %105)
br label %107
107: ; preds = %58, %57, %29
ret void
}

LLVM IR (-O2):
define void @twobody_lub(i32 %0, i32 %1, double %2, double %3, double* %4) {
%6 = getelementptr inbounds double, double* %4, i64 1
%7 = tail call i32 @twobody_XA_lub(i32 %1, double %2, double %3, double* %4, double* %6)
%8 = getelementptr inbounds double, double* %4, i64 2
%9 = getelementptr inbounds double, double* %4, i64 3
%10 = tail call i32 @twobody_YA_lub(i32 %1, double %2, double %3, double* %8, double* %9)
%11 = icmp eq i32 %0, 0
br i1 %11, label %42, label %12
12: ; preds = %5
%13 = getelementptr inbounds double, double* %4, i64 4
%14 = getelementptr inbounds double, double* %4, i64 5
%15 = tail call i32 @twobody_YB_lub(i32 %1, double %2, double %3, double* %13, double* %14)
%16 = getelementptr inbounds double, double* %4, i64 6
%17 = getelementptr inbounds double, double* %4, i64 7
%18 = tail call i32 @twobody_XC_lub(i32 %1, double %2, double %3, double* %16, double* %17)
%19 = getelementptr inbounds double, double* %4, i64 8
%20 = getelementptr inbounds double, double* %4, i64 9
%21 = tail call i32 @twobody_YC_lub(i32 %1, double %2, double %3, double* %19, double* %20)
%22 = icmp eq i32 %0, 1
br i1 %22, label %42, label %23
23: ; preds = %12
%24 = getelementptr inbounds double, double* %4, i64 10
%25 = getelementptr inbounds double, double* %4, i64 11
%26 = tail call i32 @twobody_XG_lub(i32 %1, double %2, double %3, double* %24, double* %25)
%27 = getelementptr inbounds double, double* %4, i64 12
%28 = getelementptr inbounds double, double* %4, i64 13
%29 = tail call i32 @twobody_YG_lub(i32 %1, double %2, double %3, double* %27, double* %28)
%30 = getelementptr inbounds double, double* %4, i64 14
%31 = getelementptr inbounds double, double* %4, i64 15
%32 = tail call i32 @twobody_YH_lub(i32 %1, double %2, double %3, double* %30, double* %31)
%33 = getelementptr inbounds double, double* %4, i64 16
%34 = getelementptr inbounds double, double* %4, i64 17
%35 = tail call i32 @twobody_XM_lub(i32 %1, double %2, double %3, double* %33, double* %34)
%36 = getelementptr inbounds double, double* %4, i64 18
%37 = getelementptr inbounds double, double* %4, i64 19
%38 = tail call i32 @twobody_YM_lub(i32 %1, double %2, double %3, double* %36, double* %37)
%39 = getelementptr inbounds double, double* %4, i64 20
%40 = getelementptr inbounds double, double* %4, i64 21
%41 = tail call i32 @twobody_ZM_lub(i32 %1, double %2, double %3, double* %39, double* %40)
br label %42
42: ; preds = %12, %5, %23
ret void
}