#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 */
typedef size_t uint;

/* Variables and functions */
int /*<<< orphan*/ dGdp_dangle3_pseq(double **, size_t, size_t, size_t,
                                     double **);
int /*<<< orphan*/ dGdp_dangle5_pseq(double **, size_t, size_t, size_t,
                                     double **);
int /*<<< orphan*/ dGdp_non_gc_penalty_pseq(double **, size_t, size_t,
                                            double **);
void dGdp_extloop_multiloop_pseq(double **p, uint nstems, uint (*stems)[2],
                                 uint ndangle5, uint (*dangle5)[3],
                                 uint ndangle3, uint (*dangle3)[3],
                                 double **dGdp) {
  uint i;
  for (i = 0; i < nstems; i++)
    dGdp_non_gc_penalty_pseq(p, stems[i][0], stems[i][1], dGdp);
  for (i = 0; i < ndangle5; i++)
    dGdp_dangle5_pseq(p, dangle5[i][0], dangle5[i][1], dangle5[i][2], dGdp);
  for (i = 0; i < ndangle3; i++)
    dGdp_dangle3_pseq(p, dangle3[i][0], dangle3[i][1], dangle3[i][2], dGdp);
}


x86 assembly (clang, -O0):
<dGdp_extloop_multiloop_pseq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11b1 <dGdp_extloop_multiloop_pseq+0x81>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
mov    -0x38(%rbp),%rcx
shl    $0x4,%rcx
add    %rcx,%rax
mov    0x8(%rax),%rdx
mov    0x18(%rbp),%rcx
call   1040 <dGdp_non_gc_penalty_pseq@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    1160 <dGdp_extloop_multiloop_pseq+0x30>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1214 <dGdp_extloop_multiloop_pseq+0xe4>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rax
imul   $0x18,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    (%rax),%rsi
mov    -0x28(%rbp),%rax
imul   $0x18,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x8(%rax),%rdx
mov    -0x28(%rbp),%rax
imul   $0x18,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x10(%rax),%rcx
mov    0x18(%rbp),%r8
call   1050 <dGdp_dangle5_pseq@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11b9 <dGdp_extloop_multiloop_pseq+0x89>
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
cmp    -0x30(%rbp),%rax
jae    1277 <dGdp_extloop_multiloop_pseq+0x147>
mov    -0x8(%rbp),%rdi
mov    0x10(%rbp),%rax
imul   $0x18,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    (%rax),%rsi
mov    0x10(%rbp),%rax
imul   $0x18,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x8(%rax),%rdx
mov    0x10(%rbp),%rax
imul   $0x18,-0x38(%rbp),%rcx
add    %rcx,%rax
mov    0x10(%rax),%rcx
mov    0x18(%rbp),%r8
call   1030 <dGdp_dangle3_pseq@plt>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    121c <dGdp_extloop_multiloop_pseq+0xec>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dGdp_extloop_multiloop_pseq>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,(%rsp)
mov    %r8,%rbx
mov    %rcx,%r13
mov    %rdi,%r12
mov    0x48(%rsp),%r14
test   %rsi,%rsi
je     117d <dGdp_extloop_multiloop_pseq+0x4d>
mov    %rdx,%rbp
mov    %rsi,%r15
add    $0x8,%rbp
nopl   0x0(%rax)
mov    -0x8(%rbp),%rsi
mov    0x0(%rbp),%rdx
mov    %r12,%rdi
mov    %r14,%rcx
call   1040 <dGdp_non_gc_penalty_pseq@plt>
add    $0x10,%rbp
add    $0xffffffffffffffff,%r15
jne    1160 <dGdp_extloop_multiloop_pseq+0x30>
test   %r13,%r13
je     11b0 <dGdp_extloop_multiloop_pseq+0x80>
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
mov    -0x10(%rbx),%rsi
mov    -0x8(%rbx),%rdx
mov    (%rbx),%rcx
mov    %r12,%rdi
mov    %r14,%r8
call   1050 <dGdp_dangle5_pseq@plt>
add    $0x18,%rbx
add    $0xffffffffffffffff,%r13
jne    1190 <dGdp_extloop_multiloop_pseq+0x60>
mov    (%rsp),%rbp
test   %rbp,%rbp
je     11f0 <dGdp_extloop_multiloop_pseq+0xc0>
mov    0x40(%rsp),%rbx
add    $0x10,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x10(%rbx),%rsi
mov    -0x8(%rbx),%rdx
mov    (%rbx),%rcx
mov    %r12,%rdi
mov    %r14,%r8
call   1030 <dGdp_dangle3_pseq@plt>
add    $0x18,%rbx
add    $0xffffffffffffffff,%rbp
jne    11d0 <dGdp_extloop_multiloop_pseq+0xa0>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @dGdp_extloop_multiloop_pseq(double** %0, i64 %1, [2 x i64]* %2, i64 %3, [3 x i64]* %4, i64 %5, [3 x i64]* %6, double** %7) {
%9 = alloca double**
%10 = alloca i64
%11 = alloca [2 x i64]*
%12 = alloca i64
%13 = alloca [3 x i64]*
%14 = alloca i64
%15 = alloca [3 x i64]*
%16 = alloca double**
%17 = alloca i64
store double** %0, double*** %9
store i64 %1, i64* %10
store [2 x i64]* %2, [2 x i64]** %11
store i64 %3, i64* %12
store [3 x i64]* %4, [3 x i64]** %13
store i64 %5, i64* %14
store [3 x i64]* %6, [3 x i64]** %15
store double** %7, double*** %16
store i64 0, i64* %17
br label %18
18: ; preds = %36, %8
%19 = load i64, i64* %17
%20 = load i64, i64* %10
%21 = icmp ult i64 %19, %20
br i1 %21, label %22, label %39
22: ; preds = %18
%23 = load double**, double*** %9
%24 = load [2 x i64]*, [2 x i64]** %11
%25 = load i64, i64* %17
%26 = getelementptr inbounds [2 x i64], [2 x i64]* %24, i64 %25
%27 = getelementptr inbounds [2 x i64], [2 x i64]* %26, i64 0, i64 0
%28 = load i64, i64* %27
%29 = load [2 x i64]*, [2 x i64]** %11
%30 = load i64, i64* %17
%31 = getelementptr inbounds [2 x i64], [2 x i64]* %29, i64 %30
%32 = getelementptr inbounds [2 x i64], [2 x i64]* %31, i64 0, i64 1
%33 = load i64, i64* %32
%34 = load double**, double*** %16
%35 = call i32 @dGdp_non_gc_penalty_pseq(double** %23, i64 %28, i64 %33, double** %34)
br label %36
36: ; preds = %22
%37 = load i64, i64* %17
%38 = add i64 %37, 1
store i64 %38, i64* %17
br label %18
39: ; preds = %18
store i64 0, i64* %17
br label %40
40: ; preds = %63, %39
%41 = load i64, i64* %17
%42 = load i64, i64* %12
%43 = icmp ult i64 %41, %42
br i1 %43, label %44, label %66
44: ; preds = %40
%45 = load double**, double*** %9
%46 = load [3 x i64]*, [3 x i64]** %13
%47 = load i64, i64* %17
%48 = getelementptr inbounds [3 x i64], [3 x i64]* %46, i64 %47
%49 = getelementptr inbounds [3 x i64], [3 x i64]* %48, i64 0, i64 0
%50 = load i64, i64* %49
%51 = load [3 x i64]*, [3 x i64]** %13
%52 = load i64, i64* %17
%53 = getelementptr inbounds [3 x i64], [3 x i64]* %51, i64 %52
%54 = getelementptr inbounds [3 x i64], [3 x i64]* %53, i64 0, i64 1
%55 = load i64, i64* %54
%56 = load [3 x i64]*, [3 x i64]** %13
%57 = load i64, i64* %17
%58 = getelementptr inbounds [3 x i64], [3 x i64]* %56, i64 %57
%59 = getelementptr inbounds [3 x i64], [3 x i64]* %58, i64 0, i64 2
%60 = load i64, i64* %59
%61 = load double**, double*** %16
%62 = call i32 @dGdp_dangle5_pseq(double** %45, i64 %50, i64 %55, i64 %60, double** %61)
br label %63
63: ; preds = %44
%64 = load i64, i64* %17
%65 = add i64 %64, 1
store i64 %65, i64* %17
br label %40
66: ; preds = %40
store i64 0, i64* %17
br label %67
67: ; preds = %90, %66
%68 = load i64, i64* %17
%69 = load i64, i64* %14
%70 = icmp ult i64 %68, %69
br i1 %70, label %71, label %93
71: ; preds = %67
%72 = load double**, double*** %9
%73 = load [3 x i64]*, [3 x i64]** %15
%74 = load i64, i64* %17
%75 = getelementptr inbounds [3 x i64], [3 x i64]* %73, i64 %74
%76 = getelementptr inbounds [3 x i64], [3 x i64]* %75, i64 0, i64 0
%77 = load i64, i64* %76
%78 = load [3 x i64]*, [3 x i64]** %15
%79 = load i64, i64* %17
%80 = getelementptr inbounds [3 x i64], [3 x i64]* %78, i64 %79
%81 = getelementptr inbounds [3 x i64], [3 x i64]* %80, i64 0, i64 1
%82 = load i64, i64* %81
%83 = load [3 x i64]*, [3 x i64]** %15
%84 = load i64, i64* %17
%85 = getelementptr inbounds [3 x i64], [3 x i64]* %83, i64 %84
%86 = getelementptr inbounds [3 x i64], [3 x i64]* %85, i64 0, i64 2
%87 = load i64, i64* %86
%88 = load double**, double*** %16
%89 = call i32 @dGdp_dangle3_pseq(double** %72, i64 %77, i64 %82, i64 %87, double** %88)
br label %90
90: ; preds = %71
%91 = load i64, i64* %17
%92 = add i64 %91, 1
store i64 %92, i64* %17
br label %67
93: ; preds = %67
ret void
}

LLVM IR (-O2):
define void @dGdp_extloop_multiloop_pseq(double** %0, i64 %1, [2 x i64]* nocapture %2, i64 %3, [3 x i64]* nocapture %4, i64 %5, [3 x i64]* nocapture %6, double** %7) {
%9 = icmp eq i64 %1, 0
br i1 %9, label %10, label %12
10: ; preds = %12, %8
%11 = icmp eq i64 %3, 0
br i1 %11, label %21, label %23
12: ; preds = %8, %12
%13 = phi i64 [ %19, %12 ], [ 0, %8 ]
%14 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 %13, i64 0
%15 = load i64, i64* %14
%16 = getelementptr inbounds [2 x i64], [2 x i64]* %2, i64 %13, i64 1
%17 = load i64, i64* %16
%18 = tail call i32 @dGdp_non_gc_penalty_pseq(double** %0, i64 %15, i64 %17, double** %7)
%19 = add nuw i64 %13, 1
%20 = icmp eq i64 %19, %1
br i1 %20, label %10, label %12
21: ; preds = %23, %10
%22 = icmp eq i64 %5, 0
br i1 %22, label %45, label %34
23: ; preds = %10, %23
%24 = phi i64 [ %32, %23 ], [ 0, %10 ]
%25 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 %24, i64 0
%26 = load i64, i64* %25
%27 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 %24, i64 1
%28 = load i64, i64* %27
%29 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 %24, i64 2
%30 = load i64, i64* %29
%31 = tail call i32 @dGdp_dangle5_pseq(double** %0, i64 %26, i64 %28, i64 %30, double** %7)
%32 = add nuw i64 %24, 1
%33 = icmp eq i64 %32, %3
br i1 %33, label %21, label %23
34: ; preds = %21, %34
%35 = phi i64 [ %43, %34 ], [ 0, %21 ]
%36 = getelementptr inbounds [3 x i64], [3 x i64]* %6, i64 %35, i64 0
%37 = load i64, i64* %36
%38 = getelementptr inbounds [3 x i64], [3 x i64]* %6, i64 %35, i64 1
%39 = load i64, i64* %38
%40 = getelementptr inbounds [3 x i64], [3 x i64]* %6, i64 %35, i64 2
%41 = load i64, i64* %40
%42 = tail call i32 @dGdp_dangle3_pseq(double** %0, i64 %37, i64 %39, i64 %41, double** %7)
%43 = add nuw i64 %35, 1
%44 = icmp eq i64 %43, %5
br i1 %44, label %45, label %34
45: ; preds = %34, %21
ret void
}