#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*/ baseinfo(char, long, char, char *, char, int, char *);
int /*<<< orphan*/ bp_context1(long, long **, double, double **, long **,
                               long **, long *);
int /*<<< orphan*/ check_zdna(long *, long **, long *, double **);
double **dmatrix(int, long, int, int);
int /*<<< orphan*/ five2three(long, long *, long **, long *, double **, long **,
                              double **);
int /*<<< orphan*/ free_dmatrix(double **, int, long, int, int);
int /*<<< orphan*/ free_lmatrix(long **, int, long, int, int);
long **lmatrix(int, long, int, int);
int /*<<< orphan*/ locate_helix1(long, long **, long, long *, long **, long **,
                                 long *, long *);
int /*<<< orphan*/ sprintf(char *, char *, char, char);
void re_ordering(long num_bp, long **base_pairs, long *bp_idx,
                 long *helix_marker, long **helix_idx, double *BPRS,
                 long *num_helix, double **o3_p, char *bseq, long **seidx,
                 char **ResName, char *ChainID, long *ResSeq, char **Miscs) {
  char b1[512], b2[512], wc[3];
  double **bp_xyz;
  long i, i_order, j, j_order, num_ends = 0;
  long **bp_order, **end_list;
  for (i = 1; i <= num_bp; i++) {
    sprintf(wc, "%c%c", (base_pairs[i][3] == 2) ? '-' : '*',
            (base_pairs[i][3] > 0) ? '-' : '*');
    i_order = base_pairs[i][1];
    j_order = base_pairs[i][2];
    j = seidx[i_order][1];
    baseinfo(ChainID[j], ResSeq[j], Miscs[j][2], ResName[j], bseq[i_order], 1,
             b1);
    j = seidx[j_order][1];
    baseinfo(ChainID[j], ResSeq[j], Miscs[j][2], ResName[j], bseq[j_order], 2,
             b2);
  }
  bp_xyz = dmatrix(1, num_bp, 1, 9);
  for (i = 1; i <= num_bp; i++)
    for (j = 1; j <= 9; j++)
      bp_xyz[i][j] = base_pairs[i][j + 8] / 10000.0;
  bp_order = lmatrix(1, num_bp, 1, 3);
  end_list = lmatrix(1, num_bp, 1, 3);
  bp_context1(num_bp, base_pairs, BPRS[6], bp_xyz, bp_order, end_list,
              &num_ends);
  locate_helix1(num_bp, helix_idx, num_ends, num_helix, end_list, bp_order,
                bp_idx, helix_marker);
  five2three(num_bp, num_helix, helix_idx, bp_idx, bp_xyz, base_pairs, o3_p);
  check_zdna(num_helix, helix_idx, bp_idx, bp_xyz);
  free_dmatrix(bp_xyz, 1, num_bp, 1, 9);
  free_lmatrix(bp_order, 1, num_bp, 1, 3);
  free_lmatrix(end_list, 1, num_bp, 1, 3);
}


x86 assembly (clang, -O0):
<re_ordering>:
push   %rbp
mov    %rsp,%rbp
sub    $0x490,%rsp
mov    0x48(%rbp),%rax
mov    0x40(%rbp),%rax
mov    0x38(%rbp),%rax
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
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,-0x468(%rbp)
movq   $0x1,-0x448(%rbp)
mov    -0x448(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     13ca <re_ordering+0x22a>
lea    -0x433(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    -0x448(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x18(%rax),%rdx
mov    $0x2a,%eax
mov    $0x2d,%ecx
cmp    $0x2,%rdx
cmove  %ecx,%eax
mov    %al,%cl
mov    -0x10(%rbp),%rax
mov    -0x448(%rbp),%rdx
mov    (%rax,%rdx,8),%rax
mov    0x18(%rax),%rsi
mov    $0x2a,%eax
mov    $0x2d,%edx
cmp    $0x0,%rsi
cmovg  %edx,%eax
lea    0xda6(%rip),%rsi
movsbl %cl,%edx
movsbl %al,%ecx
call   10a0 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    -0x448(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x450(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x448(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x460(%rbp)
mov    0x28(%rbp),%rax
mov    -0x450(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x458(%rbp)
mov    0x38(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,1),%dil
mov    0x40(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    0x48(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x2(%rax),%dl
mov    0x30(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    0x20(%rbp),%rax
mov    -0x450(%rbp),%r8
mov    (%rax,%r8,1),%r8b
lea    -0x230(%rbp),%rax
mov    $0x1,%r9d
movsbl %dil,%edi
movsbl %dl,%edx
movsbl %r8b,%r8d
mov    %rax,(%rsp)
call   1030 <baseinfo@plt>
mov    0x28(%rbp),%rax
mov    -0x460(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x458(%rbp)
mov    0x38(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,1),%dil
mov    0x40(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
mov    0x48(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    0x2(%rax),%dl
mov    0x30(%rbp),%rax
mov    -0x458(%rbp),%rcx
mov    (%rax,%rcx,8),%rcx
mov    0x20(%rbp),%rax
mov    -0x460(%rbp),%r8
mov    (%rax,%r8,1),%r8b
lea    -0x430(%rbp),%rax
mov    $0x2,%r9d
movsbl %dil,%edi
movsbl %dl,%edx
movsbl %r8b,%r8d
mov    %rax,(%rsp)
call   1030 <baseinfo@plt>
mov    -0x448(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x448(%rbp)
jmp    11f9 <re_ordering+0x59>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    $0x9,%ecx
mov    %edx,%edi
call   1050 <dmatrix@plt>
mov    %rax,-0x440(%rbp)
movq   $0x1,-0x448(%rbp)
mov    -0x448(%rbp),%rax
cmp    -0x8(%rbp),%rax
jg     1495 <re_ordering+0x2f5>
movq   $0x1,-0x458(%rbp)
cmpq   $0x9,-0x458(%rbp)
09
jg     1479 <re_ordering+0x2d9>
mov    -0x10(%rbp),%rax
mov    -0x448(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x458(%rbp),%rcx
cvtsi2sdq 0x40(%rax,%rcx,8),%xmm0
movsd  0xbc0(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x440(%rbp),%rax
mov    -0x448(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    -0x458(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x458(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x458(%rbp)
jmp    140d <re_ordering+0x26d>
jmp    147e <re_ordering+0x2de>
mov    -0x448(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x448(%rbp)
jmp    13f1 <re_ordering+0x251>
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
mov    %edx,%edi
call   1080 <lmatrix@plt>
mov    %rax,-0x470(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
mov    %edx,%edi
call   1080 <lmatrix@plt>
mov    %rax,-0x478(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x30(%rbp),%rax
movsd  0x30(%rax),%xmm0
mov    -0x440(%rbp),%rdx
mov    -0x470(%rbp),%rcx
mov    -0x478(%rbp),%r8
lea    -0x468(%rbp),%r9
call   1040 <bp_context1@plt>
mov    -0x8(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x468(%rbp),%rdx
mov    0x10(%rbp),%rcx
mov    -0x478(%rbp),%r8
mov    -0x470(%rbp),%r9
mov    -0x18(%rbp),%r10
mov    -0x20(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1070 <locate_helix1@plt>
mov    -0x8(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x440(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    0x18(%rbp),%rax
mov    %rax,(%rsp)
call   1060 <five2three@plt>
mov    0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x440(%rbp),%rcx
call   10c0 <check_zdna@plt>
mov    -0x440(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x9,%r8d
mov    %ecx,%esi
call   1090 <free_dmatrix@plt>
mov    -0x470(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    %ecx,%esi
call   10b0 <free_lmatrix@plt>
mov    -0x478(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x1,%ecx
mov    $0x3,%r8d
mov    %ecx,%esi
call   10b0 <free_lmatrix@plt>
add    $0x490,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_ordering>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x448,%rsp
mov    %r9,%r15
mov    %rcx,%r12
mov    %rsi,%r13
mov    %rdi,%rbx
movq   $0x0,0x20(%rsp)
test   %rdi,%rdi
mov    %r8,0x38(%rsp)
mov    %rdx,0x30(%rsp)
jle    1442 <re_ordering+0x2a2>
mov    %r15,0x10(%rsp)
mov    %r12,0x18(%rsp)
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
mov    0x8(%r13,%r15,8),%rax
mov    0x18(%rax),%rax
xor    %ecx,%ecx
cmp    $0x2,%rax
sete   %cl
xor    %esi,%esi
test   %rax,%rax
setg   %sil
lea    (%rcx,%rcx,2),%edx
add    $0x2a,%edx
lea    (%rsi,%rsi,2),%ecx
add    $0x2a,%ecx
lea    0x2d(%rsp),%rdi
lea    0xdf5(%rip),%rsi
call   10a0 <sprintf@plt>
mov    0x8(%r13,%r15,8),%rax
mov    0x8(%rax),%rbp
mov    0x10(%rax),%r12
mov    0x498(%rsp),%rax
mov    (%rax,%rbp,8),%rax
mov    0x8(%rax),%rax
mov    0x4a8(%rsp),%rcx
movsbl (%rcx,%rax,1),%edi
mov    0x4b0(%rsp),%rcx
mov    (%rcx,%rax,8),%rsi
mov    0x4b8(%rsp),%rcx
mov    (%rcx,%rax,8),%rcx
movsbl 0x2(%rcx),%edx
mov    0x4a0(%rsp),%r14
mov    (%r14,%rax,8),%rcx
mov    0x490(%rsp),%rax
movsbl (%rax,%rbp,1),%r8d
mov    %rax,%rbp
lea    0x240(%rsp),%rax
mov    %rax,(%rsp)
mov    $0x1,%r9d
call   1030 <baseinfo@plt>
mov    0x498(%rsp),%rax
mov    (%rax,%r12,8),%rax
mov    0x8(%rax),%rax
mov    0x4a8(%rsp),%rcx
movsbl (%rcx,%rax,1),%edi
mov    0x4b0(%rsp),%rcx
mov    (%rcx,%rax,8),%rsi
mov    0x4b8(%rsp),%rcx
mov    (%rcx,%rax,8),%rcx
movsbl 0x2(%rcx),%edx
mov    (%r14,%rax,8),%rcx
movsbl 0x0(%rbp,%r12,1),%r8d
lea    0x40(%rsp),%rax
mov    %rax,(%rsp)
mov    $0x2,%r9d
call   1030 <baseinfo@plt>
add    $0x1,%r15
cmp    %r15,%rbx
jne    11f0 <re_ordering+0x50>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    $0x9,%ecx
call   1050 <dmatrix@plt>
mov    %rax,%rbp
test   %rbx,%rbx
jle    145e <re_ordering+0x2be>
xor    %eax,%eax
movapd 0xcd0(%rip),%xmm0
movsd  0xcd8(%rip),%xmm1
mov    0x18(%rsp),%r12
mov    0x10(%rsp),%r15
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    0x8(%r13,%rax,8),%rcx
movdqu 0x48(%rcx),%xmm2
movq   %xmm2,%rdx
xorps  %xmm3,%xmm3
cvtsi2sd %rdx,%xmm3
pshufd $0xee,%xmm2,%xmm2
movq   %xmm2,%rdx
xorps  %xmm2,%xmm2
cvtsi2sd %rdx,%xmm2
mov    0x8(%rbp,%rax,8),%rdx
unpcklpd %xmm2,%xmm3
divpd  %xmm0,%xmm3
movupd %xmm3,0x8(%rdx)
movdqu 0x58(%rcx),%xmm2
movq   %xmm2,%rsi
xorps  %xmm3,%xmm3
cvtsi2sd %rsi,%xmm3
pshufd $0xee,%xmm2,%xmm2
movq   %xmm2,%rsi
xorps  %xmm2,%xmm2
cvtsi2sd %rsi,%xmm2
unpcklpd %xmm2,%xmm3
divpd  %xmm0,%xmm3
movupd %xmm3,0x18(%rdx)
movdqu 0x68(%rcx),%xmm2
movq   %xmm2,%rsi
xorps  %xmm3,%xmm3
cvtsi2sd %rsi,%xmm3
pshufd $0xee,%xmm2,%xmm2
movq   %xmm2,%rsi
xorps  %xmm2,%xmm2
cvtsi2sd %rsi,%xmm2
unpcklpd %xmm2,%xmm3
divpd  %xmm0,%xmm3
movupd %xmm3,0x28(%rdx)
movdqu 0x78(%rcx),%xmm2
movq   %xmm2,%rsi
pshufd $0xee,%xmm2,%xmm2
xorps  %xmm3,%xmm3
cvtsi2sd %rsi,%xmm3
movq   %xmm2,%rsi
xorps  %xmm2,%xmm2
cvtsi2sd %rsi,%xmm2
unpcklpd %xmm2,%xmm3
divpd  %xmm0,%xmm3
movupd %xmm3,0x38(%rdx)
xorps  %xmm2,%xmm2
cvtsi2sdq 0x88(%rcx),%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,0x48(%rdx)
add    $0x1,%rax
cmp    %rax,%rbx
jne    1350 <re_ordering+0x1b0>
jmp    1468 <re_ordering+0x2c8>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    $0x9,%ecx
call   1050 <dmatrix@plt>
mov    %rax,%rbp
jmp    1468 <re_ordering+0x2c8>
mov    0x18(%rsp),%r12
mov    0x10(%rsp),%r15
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1080 <lmatrix@plt>
mov    %rax,%r14
mov    %rax,0x10(%rsp)
mov    $0x1,%edi
mov    %rbx,%rsi
mov    $0x1,%edx
mov    $0x3,%ecx
call   1080 <lmatrix@plt>
mov    %rax,0x18(%rsp)
movsd  0x30(%r15),%xmm0
lea    0x20(%rsp),%r9
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %rbp,%rdx
mov    %r14,%rcx
mov    %rax,%r8
call   1040 <bp_context1@plt>
mov    0x20(%rsp),%rdx
mov    %r12,0x8(%rsp)
mov    0x30(%rsp),%r15
mov    %r15,(%rsp)
mov    %rbx,%rdi
mov    0x38(%rsp),%r12
mov    %r12,%rsi
mov    0x480(%rsp),%r14
mov    %r14,%rcx
mov    0x18(%rsp),%r8
mov    0x10(%rsp),%r9
call   1070 <locate_helix1@plt>
mov    0x488(%rsp),%rax
mov    %rax,(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %rbp,%r8
mov    %r13,%r9
call   1060 <five2three@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15,%rdx
mov    %rbp,%rcx
call   10c0 <check_zdna@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
mov    $0x9,%r8d
call   1090 <free_dmatrix@plt>
mov    0x10(%rsp),%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   10b0 <free_lmatrix@plt>
mov    0x18(%rsp),%rdi
mov    $0x1,%esi
mov    %rbx,%rdx
mov    $0x1,%ecx
mov    $0x3,%r8d
call   10b0 <free_lmatrix@plt>
add    $0x448,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%c%c\00"
define void @re_ordering(i64 %0, i64** %1, i64* %2, i64* %3, i64** %4, double* %5, i64* %6, double** %7, i8* %8, i64** %9, i8** %10, i8* %11, i64* %12, i8** %13) {
%15 = alloca i64
%16 = alloca i64**
%17 = alloca i64*
%18 = alloca i64*
%19 = alloca i64**
%20 = alloca double*
%21 = alloca i64*
%22 = alloca double**
%23 = alloca i8*
%24 = alloca i64**
%25 = alloca i8**
%26 = alloca i8*
%27 = alloca i64*
%28 = alloca i8**
%29 = alloca [512 x i8]
%30 = alloca [512 x i8]
%31 = alloca [3 x i8]
%32 = alloca double**
%33 = alloca i64
%34 = alloca i64
%35 = alloca i64
%36 = alloca i64
%37 = alloca i64
%38 = alloca i64**
%39 = alloca i64**
store i64 %0, i64* %15
store i64** %1, i64*** %16
store i64* %2, i64** %17
store i64* %3, i64** %18
store i64** %4, i64*** %19
store double* %5, double** %20
store i64* %6, i64** %21
store double** %7, double*** %22
store i8* %8, i8** %23
store i64** %9, i64*** %24
store i8** %10, i8*** %25
store i8* %11, i8** %26
store i64* %12, i64** %27
store i8** %13, i8*** %28
store i64 0, i64* %37
store i64 1, i64* %33
br label %40
40: ; preds = %139, %14
%41 = load i64, i64* %33
%42 = load i64, i64* %15
%43 = icmp sle i64 %41, %42
br i1 %43, label %44, label %142
44: ; preds = %40
%45 = getelementptr inbounds [3 x i8], [3 x i8]* %31, i64 0, i64 0
%46 = load i64**, i64*** %16
%47 = load i64, i64* %33
%48 = getelementptr inbounds i64*, i64** %46, i64 %47
%49 = load i64*, i64** %48
%50 = getelementptr inbounds i64, i64* %49, i64 3
%51 = load i64, i64* %50
%52 = icmp eq i64 %51, 2
%53 = zext i1 %52 to i64
%54 = select i1 %52, i32 45, i32 42
%55 = trunc i32 %54 to i8
%56 = load i64**, i64*** %16
%57 = load i64, i64* %33
%58 = getelementptr inbounds i64*, i64** %56, i64 %57
%59 = load i64*, i64** %58
%60 = getelementptr inbounds i64, i64* %59, i64 3
%61 = load i64, i64* %60
%62 = icmp sgt i64 %61, 0
%63 = zext i1 %62 to i64
%64 = select i1 %62, i32 45, i32 42
%65 = trunc i32 %64 to i8
%66 = call i32 @sprintf(i8* %45, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %55, i8 signext %65)
%67 = load i64**, i64*** %16
%68 = load i64, i64* %33
%69 = getelementptr inbounds i64*, i64** %67, i64 %68
%70 = load i64*, i64** %69
%71 = getelementptr inbounds i64, i64* %70, i64 1
%72 = load i64, i64* %71
store i64 %72, i64* %34
%73 = load i64**, i64*** %16
%74 = load i64, i64* %33
%75 = getelementptr inbounds i64*, i64** %73, i64 %74
%76 = load i64*, i64** %75
%77 = getelementptr inbounds i64, i64* %76, i64 2
%78 = load i64, i64* %77
store i64 %78, i64* %36
%79 = load i64**, i64*** %24
%80 = load i64, i64* %34
%81 = getelementptr inbounds i64*, i64** %79, i64 %80
%82 = load i64*, i64** %81
%83 = getelementptr inbounds i64, i64* %82, i64 1
%84 = load i64, i64* %83
store i64 %84, i64* %35
%85 = load i8*, i8** %26
%86 = load i64, i64* %35
%87 = getelementptr inbounds i8, i8* %85, i64 %86
%88 = load i8, i8* %87
%89 = load i64*, i64** %27
%90 = load i64, i64* %35
%91 = getelementptr inbounds i64, i64* %89, i64 %90
%92 = load i64, i64* %91
%93 = load i8**, i8*** %28
%94 = load i64, i64* %35
%95 = getelementptr inbounds i8*, i8** %93, i64 %94
%96 = load i8*, i8** %95
%97 = getelementptr inbounds i8, i8* %96, i64 2
%98 = load i8, i8* %97
%99 = load i8**, i8*** %25
%100 = load i64, i64* %35
%101 = getelementptr inbounds i8*, i8** %99, i64 %100
%102 = load i8*, i8** %101
%103 = load i8*, i8** %23
%104 = load i64, i64* %34
%105 = getelementptr inbounds i8, i8* %103, i64 %104
%106 = load i8, i8* %105
%107 = getelementptr inbounds [512 x i8], [512 x i8]* %29, i64 0, i64 0
%108 = call i32 @baseinfo(i8 signext %88, i64 %92, i8 signext %98, i8* %102, i8 signext %106, i32 1, i8* %107)
%109 = load i64**, i64*** %24
%110 = load i64, i64* %36
%111 = getelementptr inbounds i64*, i64** %109, i64 %110
%112 = load i64*, i64** %111
%113 = getelementptr inbounds i64, i64* %112, i64 1
%114 = load i64, i64* %113
store i64 %114, i64* %35
%115 = load i8*, i8** %26
%116 = load i64, i64* %35
%117 = getelementptr inbounds i8, i8* %115, i64 %116
%118 = load i8, i8* %117
%119 = load i64*, i64** %27
%120 = load i64, i64* %35
%121 = getelementptr inbounds i64, i64* %119, i64 %120
%122 = load i64, i64* %121
%123 = load i8**, i8*** %28
%124 = load i64, i64* %35
%125 = getelementptr inbounds i8*, i8** %123, i64 %124
%126 = load i8*, i8** %125
%127 = getelementptr inbounds i8, i8* %126, i64 2
%128 = load i8, i8* %127
%129 = load i8**, i8*** %25
%130 = load i64, i64* %35
%131 = getelementptr inbounds i8*, i8** %129, i64 %130
%132 = load i8*, i8** %131
%133 = load i8*, i8** %23
%134 = load i64, i64* %36
%135 = getelementptr inbounds i8, i8* %133, i64 %134
%136 = load i8, i8* %135
%137 = getelementptr inbounds [512 x i8], [512 x i8]* %30, i64 0, i64 0
%138 = call i32 @baseinfo(i8 signext %118, i64 %122, i8 signext %128, i8* %132, i8 signext %136, i32 2, i8* %137)
br label %139
139: ; preds = %44
%140 = load i64, i64* %33
%141 = add nsw i64 %140, 1
store i64 %141, i64* %33
br label %40
142: ; preds = %40
%143 = load i64, i64* %15
%144 = call double** @dmatrix(i32 1, i64 %143, i32 1, i32 9)
store double** %144, double*** %32
store i64 1, i64* %33
br label %145
145: ; preds = %174, %142
%146 = load i64, i64* %33
%147 = load i64, i64* %15
%148 = icmp sle i64 %146, %147
br i1 %148, label %149, label %177
149: ; preds = %145
store i64 1, i64* %35
br label %150
150: ; preds = %170, %149
%151 = load i64, i64* %35
%152 = icmp sle i64 %151, 9
br i1 %152, label %153, label %173
153: ; preds = %150
%154 = load i64**, i64*** %16
%155 = load i64, i64* %33
%156 = getelementptr inbounds i64*, i64** %154, i64 %155
%157 = load i64*, i64** %156
%158 = load i64, i64* %35
%159 = add nsw i64 %158, 8
%160 = getelementptr inbounds i64, i64* %157, i64 %159
%161 = load i64, i64* %160
%162 = sitofp i64 %161 to double
%163 = fdiv double %162, 1.000000e+04
%164 = load double**, double*** %32
%165 = load i64, i64* %33
%166 = getelementptr inbounds double*, double** %164, i64 %165
%167 = load double*, double** %166
%168 = load i64, i64* %35
%169 = getelementptr inbounds double, double* %167, i64 %168
store double %163, double* %169
br label %170
170: ; preds = %153
%171 = load i64, i64* %35
%172 = add nsw i64 %171, 1
store i64 %172, i64* %35
br label %150
173: ; preds = %150
br label %174
174: ; preds = %173
%175 = load i64, i64* %33
%176 = add nsw i64 %175, 1
store i64 %176, i64* %33
br label %145
177: ; preds = %145
%178 = load i64, i64* %15
%179 = call i64** @lmatrix(i32 1, i64 %178, i32 1, i32 3)
store i64** %179, i64*** %38
%180 = load i64, i64* %15
%181 = call i64** @lmatrix(i32 1, i64 %180, i32 1, i32 3)
store i64** %181, i64*** %39
%182 = load i64, i64* %15
%183 = load i64**, i64*** %16
%184 = load double*, double** %20
%185 = getelementptr inbounds double, double* %184, i64 6
%186 = load double, double* %185
%187 = load double**, double*** %32
%188 = load i64**, i64*** %38
%189 = load i64**, i64*** %39
%190 = call i32 @bp_context1(i64 %182, i64** %183, double %186, double** %187, i64** %188, i64** %189, i64* %37)
%191 = load i64, i64* %15
%192 = load i64**, i64*** %19
%193 = load i64, i64* %37
%194 = load i64*, i64** %21
%195 = load i64**, i64*** %39
%196 = load i64**, i64*** %38
%197 = load i64*, i64** %17
%198 = load i64*, i64** %18
%199 = call i32 @locate_helix1(i64 %191, i64** %192, i64 %193, i64* %194, i64** %195, i64** %196, i64* %197, i64* %198)
%200 = load i64, i64* %15
%201 = load i64*, i64** %21
%202 = load i64**, i64*** %19
%203 = load i64*, i64** %17
%204 = load double**, double*** %32
%205 = load i64**, i64*** %16
%206 = load double**, double*** %22
%207 = call i32 @five2three(i64 %200, i64* %201, i64** %202, i64* %203, double** %204, i64** %205, double** %206)
%208 = load i64*, i64** %21
%209 = load i64**, i64*** %19
%210 = load i64*, i64** %17
%211 = load double**, double*** %32
%212 = call i32 @check_zdna(i64* %208, i64** %209, i64* %210, double** %211)
%213 = load double**, double*** %32
%214 = load i64, i64* %15
%215 = call i32 @free_dmatrix(double** %213, i32 1, i64 %214, i32 1, i32 9)
%216 = load i64**, i64*** %38
%217 = load i64, i64* %15
%218 = call i32 @free_lmatrix(i64** %216, i32 1, i64 %217, i32 1, i32 3)
%219 = load i64**, i64*** %39
%220 = load i64, i64* %15
%221 = call i32 @free_lmatrix(i64** %219, i32 1, i64 %220, i32 1, i32 3)
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%c%c\00"
define void @re_ordering(i64 %0, i64** %1, i64* %2, i64* %3, i64** %4, double* nocapture %5, i64* %6, double** %7, i8* nocapture %8, i64** nocapture %9, i8** nocapture %10, i8* nocapture %11, i64* nocapture %12, i8** nocapture %13) {
%15 = alloca [512 x i8]
%16 = alloca [512 x i8]
%17 = alloca [3 x i8]
%18 = alloca i64
%19 = getelementptr inbounds [512 x i8], [512 x i8]* %15, i64 0, i64 0
%20 = getelementptr inbounds [512 x i8], [512 x i8]* %16, i64 0, i64 0
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %17, i64 0, i64 0
%22 = bitcast i64* %18 to i8*
store i64 0, i64* %18
%23 = icmp slt i64 %0, 1
br i1 %23, label %24, label %26
24: ; preds = %14
%25 = call double** @dmatrix(i32 1, i64 %0, i32 1, i32 9)
br label %121
26: ; preds = %14, %26
%27 = phi i64 [ %76, %26 ], [ 1, %14 ]
%28 = getelementptr inbounds i64*, i64** %1, i64 %27
%29 = load i64*, i64** %28
%30 = getelementptr inbounds i64, i64* %29, i64 3
%31 = load i64, i64* %30
%32 = icmp eq i64 %31, 2
%33 = select i1 %32, i8 45, i8 42
%34 = icmp sgt i64 %31, 0
%35 = select i1 %34, i8 45, i8 42
%36 = call i32 @sprintf(i8* %21, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8 signext %33, i8 signext %35)
%37 = load i64*, i64** %28
%38 = getelementptr inbounds i64, i64* %37, i64 1
%39 = load i64, i64* %38
%40 = getelementptr inbounds i64, i64* %37, i64 2
%41 = load i64, i64* %40
%42 = getelementptr inbounds i64*, i64** %9, i64 %39
%43 = load i64*, i64** %42
%44 = getelementptr inbounds i64, i64* %43, i64 1
%45 = load i64, i64* %44
%46 = getelementptr inbounds i8, i8* %11, i64 %45
%47 = load i8, i8* %46
%48 = getelementptr inbounds i64, i64* %12, i64 %45
%49 = load i64, i64* %48
%50 = getelementptr inbounds i8*, i8** %13, i64 %45
%51 = load i8*, i8** %50
%52 = getelementptr inbounds i8, i8* %51, i64 2
%53 = load i8, i8* %52
%54 = getelementptr inbounds i8*, i8** %10, i64 %45
%55 = load i8*, i8** %54
%56 = getelementptr inbounds i8, i8* %8, i64 %39
%57 = load i8, i8* %56
%58 = call i32 @baseinfo(i8 signext %47, i64 %49, i8 signext %53, i8* %55, i8 signext %57, i32 1, i8* %19)
%59 = getelementptr inbounds i64*, i64** %9, i64 %41
%60 = load i64*, i64** %59
%61 = getelementptr inbounds i64, i64* %60, i64 1
%62 = load i64, i64* %61
%63 = getelementptr inbounds i8, i8* %11, i64 %62
%64 = load i8, i8* %63
%65 = getelementptr inbounds i64, i64* %12, i64 %62
%66 = load i64, i64* %65
%67 = getelementptr inbounds i8*, i8** %13, i64 %62
%68 = load i8*, i8** %67
%69 = getelementptr inbounds i8, i8* %68, i64 2
%70 = load i8, i8* %69
%71 = getelementptr inbounds i8*, i8** %10, i64 %62
%72 = load i8*, i8** %71
%73 = getelementptr inbounds i8, i8* %8, i64 %41
%74 = load i8, i8* %73
%75 = call i32 @baseinfo(i8 signext %64, i64 %66, i8 signext %70, i8* %72, i8 signext %74, i32 2, i8* %20)
%76 = add nuw i64 %27, 1
%77 = icmp eq i64 %27, %0
br i1 %77, label %78, label %26
78: ; preds = %26
%79 = call double** @dmatrix(i32 1, i64 %0, i32 1, i32 9)
br i1 %23, label %121, label %80
80: ; preds = %78, %80
%81 = phi i64 [ %119, %80 ], [ 1, %78 ]
%82 = getelementptr inbounds i64*, i64** %1, i64 %81
%83 = load i64*, i64** %82
%84 = getelementptr inbounds double*, double** %79, i64 %81
%85 = load double*, double** %84
%86 = getelementptr inbounds i64, i64* %83, i64 9
%87 = getelementptr inbounds double, double* %85, i64 1
%88 = bitcast i64* %86 to <2 x i64>*
%89 = load <2 x i64>, <2 x i64>* %88
%90 = sitofp <2 x i64> %89 to <2 x double>
%91 = fdiv <2 x double> %90, <double 1.000000e+04, double 1.000000e+04>
%92 = bitcast double* %87 to <2 x double>*
store <2 x double> %91, <2 x double>* %92
%93 = getelementptr inbounds i64, i64* %83, i64 11
%94 = getelementptr inbounds double, double* %85, i64 3
%95 = bitcast i64* %93 to <2 x i64>*
%96 = load <2 x i64>, <2 x i64>* %95
%97 = sitofp <2 x i64> %96 to <2 x double>
%98 = fdiv <2 x double> %97, <double 1.000000e+04, double 1.000000e+04>
%99 = bitcast double* %94 to <2 x double>*
store <2 x double> %98, <2 x double>* %99
%100 = getelementptr inbounds i64, i64* %83, i64 13
%101 = getelementptr inbounds double, double* %85, i64 5
%102 = bitcast i64* %100 to <2 x i64>*
%103 = load <2 x i64>, <2 x i64>* %102
%104 = sitofp <2 x i64> %103 to <2 x double>
%105 = fdiv <2 x double> %104, <double 1.000000e+04, double 1.000000e+04>
%106 = bitcast double* %101 to <2 x double>*
store <2 x double> %105, <2 x double>* %106
%107 = getelementptr inbounds i64, i64* %83, i64 15
%108 = getelementptr inbounds double, double* %85, i64 7
%109 = bitcast i64* %107 to <2 x i64>*
%110 = load <2 x i64>, <2 x i64>* %109
%111 = sitofp <2 x i64> %110 to <2 x double>
%112 = fdiv <2 x double> %111, <double 1.000000e+04, double 1.000000e+04>
%113 = bitcast double* %108 to <2 x double>*
store <2 x double> %112, <2 x double>* %113
%114 = getelementptr inbounds i64, i64* %83, i64 17
%115 = load i64, i64* %114
%116 = sitofp i64 %115 to double
%117 = fdiv double %116, 1.000000e+04
%118 = getelementptr inbounds double, double* %85, i64 9
store double %117, double* %118
%119 = add nuw i64 %81, 1
%120 = icmp eq i64 %81, %0
br i1 %120, label %121, label %80
121: ; preds = %80, %24, %78
%122 = phi double** [ %25, %24 ], [ %79, %78 ], [ %79, %80 ]
%123 = call i64** @lmatrix(i32 1, i64 %0, i32 1, i32 3)
%124 = call i64** @lmatrix(i32 1, i64 %0, i32 1, i32 3)
%125 = getelementptr inbounds double, double* %5, i64 6
%126 = load double, double* %125
%127 = call i32 @bp_context1(i64 %0, i64** %1, double %126, double** %122, i64** %123, i64** %124, i64* %18)
%128 = load i64, i64* %18
%129 = call i32 @locate_helix1(i64 %0, i64** %4, i64 %128, i64* %6, i64** %124, i64** %123, i64* %2, i64* %3)
%130 = call i32 @five2three(i64 %0, i64* %6, i64** %4, i64* %2, double** %122, i64** %1, double** %7)
%131 = call i32 @check_zdna(i64* %6, i64** %4, i64* %2, double** %122)
%132 = call i32 @free_dmatrix(double** %122, i32 1, i64 %0, i32 1, i32 9)
%133 = call i32 @free_lmatrix(i64** %123, i32 1, i64 %0, i32 1, i32 3)
%134 = call i32 @free_lmatrix(i64** %124, i32 1, i64 %0, i32 1, i32 3)
ret void
}