#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*/ find_probabilities(double *, double *, double);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ generate_sequence(char *, int, double *);
scalar_t__ malloc(int);
double score(char *, int, double *, int *, int *, int);
int score_orf_random(char *orf, int n, double *sc, double *thr, int t,
                     double maxscore, int rep) {
  int i, k, nuc[4] = {0}, sig_pos, from, to, rt = 0, rm = 0, n1 = 0;
  char *seq;
  double fr[5] = {0.0}, pr[4] = {0.0}, q[4], delta = 0.0000001, rs, s;
  double maxs, mins;
  seq = (char *)malloc(n * sizeof(char));
  for (i = 0; i < n; i++) {
    if (orf[i] >= 0 && orf[i] < 4) {
      ++n1;
      ++fr[orf[i]];
      ++fr[4];
    }
  }
  for (i = 0; i < 3; ++i)
    fr[i] /= fr[4];
  fr[3] = 1.0 - fr[0] - fr[1] - fr[2];
  find_probabilities(fr, pr, delta);
  q[0] = pr[0];
  q[1] = q[0] + pr[1];
  q[2] = q[1] + pr[2];
  q[3] = 1.0;
  maxs = 0.0;
  for (k = 0; k < rep; k++) {
    generate_sequence(seq, n, q);
    rs = score(seq, n, sc, &from, &to, 1);
    if (rs > maxs)
      maxs = rs;
    if (rs >= thr[t])
      ++rt;
    if (rs >= maxscore)
      ++rm;
  }
  free(seq);
  thr[t] = maxs;
  return (rm);
}


x86 assembly (clang, -O0):
<score_orf_random>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
movsd  %xmm0,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
lea    -0x50(%rbp),%rdi
xor    %esi,%esi
mov    $0x10,%edx
call   1040 <memset@plt>
movl   $0x0,-0x60(%rbp)
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
lea    -0xa0(%rbp),%rdi
xor    %esi,%esi
mov    $0x28,%edx
call   1040 <memset@plt>
lea    -0xc0(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1040 <memset@plt>
movsd  0xe26(%rip),%xmm0
movsd  %xmm0,-0xe8(%rbp)
ff
movslq -0xc(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x70(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1287 <score_orf_random+0x127>
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jl     1274 <score_orf_random+0x114>
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x4,%eax
jge    1274 <score_orf_random+0x114>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x38(%rbp),%rcx
movsbq (%rax,%rcx,1),%rax
movsd  0xdb8(%rip),%xmm0
addsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
movsd  0xd9e(%rip),%xmm0
addsd  -0x80(%rbp),%xmm0
movsd  %xmm0,-0x80(%rbp)
jmp    1279 <score_orf_random+0x119>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    11fc <score_orf_random+0x9c>
movl   $0x0,-0x38(%rbp)
cmpl   $0x3,-0x38(%rbp)
jge    12c5 <score_orf_random+0x165>
movsd  -0x80(%rbp),%xmm1
movslq -0x38(%rbp),%rax
movsd  -0xa0(%rbp,%rax,8),%xmm0
ff ff
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp,%rax,8)
ff ff
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    128e <score_orf_random+0x12e>
movsd  0xd3b(%rip),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
subsd  -0x98(%rbp),%xmm0
ff
subsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x88(%rbp)
ff
lea    -0xa0(%rbp),%rdi
lea    -0xc0(%rbp),%rsi
movsd  -0xe8(%rbp),%xmm0
ff
call   1080 <find_probabilities@plt>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xe0(%rbp)
ff
movsd  -0xe0(%rbp),%xmm0
ff
addsd  -0xb8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd8(%rbp)
ff
movsd  -0xd8(%rbp),%xmm0
ff
addsd  -0xb0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  0xcb8(%rip),%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movl   $0x0,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x34(%rbp),%eax
jge    1428 <score_orf_random+0x2c8>
mov    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0xe0(%rbp),%rdx
call   1060 <generate_sequence@plt>
mov    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
lea    -0x58(%rbp),%rcx
lea    -0x5c(%rbp),%r8
mov    $0x1,%r9d
call   1050 <score@plt>
movsd  %xmm0,-0xf0(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
ucomisd -0x100(%rbp),%xmm0
ff
jbe    13d5 <score_orf_random+0x275>
movsd  -0xf0(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
movsd  -0xf0(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
ucomisd (%rax,%rcx,8),%xmm0
jb     13f9 <score_orf_random+0x299>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
movsd  -0xf0(%rbp),%xmm0
ucomisd -0x30(%rbp),%xmm0
jb     1415 <score_orf_random+0x2b5>
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    141a <score_orf_random+0x2ba>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    136a <score_orf_random+0x20a>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
movsd  -0x100(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x64(%rbp),%eax
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<score_orf_random>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
mov    %r9d,%ebx
movsd  %xmm0,0x40(%rsp)
mov    %r8d,0x34(%rsp)
mov    %rcx,0x38(%rsp)
mov    %rdx,%r12
mov    %esi,%r15d
mov    %rdi,%r14
xorpd  %xmm0,%xmm0
movapd %xmm0,0x10(%rsp)
movapd %xmm0,(%rsp)
movq   $0x0,0x20(%rsp)
movapd %xmm0,0x60(%rsp)
movapd %xmm0,0x50(%rsp)
mov    %esi,%edi
call   1060 <malloc@plt>
xorpd  %xmm2,%xmm2
mov    %rax,%r13
xorpd  %xmm1,%xmm1
xorpd  %xmm0,%xmm0
test   %r15d,%r15d
jle    120b <score_orf_random+0xbb>
mov    %r15d,%eax
cmp    $0x1,%r15d
jne    1327 <score_orf_random+0x1d7>
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
test   $0x1,%al
je     1200 <score_orf_random+0xb0>
movzbl (%r14,%rcx,1),%eax
cmp    $0x3,%rax
ja     1200 <score_orf_random+0xb0>
movsd  0xe1a(%rip),%xmm0
movsd  (%rsp,%rax,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%rsp,%rax,8)
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movapd (%rsp),%xmm2
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
unpcklpd %xmm0,%xmm0
divpd  %xmm0,%xmm2
movapd %xmm2,(%rsp)
movsd  %xmm1,0x10(%rsp)
movsd  0xdd6(%rip),%xmm0
subsd  %xmm2,%xmm0
unpckhpd %xmm2,%xmm2
subsd  %xmm2,%xmm0
subsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rsp,%rdi
lea    0x50(%rsp),%rsi
movsd  0xdb8(%rip),%xmm0
call   1070 <find_probabilities@plt>
movsd  0x50(%rsp),%xmm0
movsd  %xmm0,0x70(%rsp)
addsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x78(%rsp)
addsd  0x60(%rsp),%xmm0
movsd  %xmm0,0x80(%rsp)
movabs $0x3ff0000000000000,%rax
mov    %rax,0x88(%rsp)
xor    %ebp,%ebp
test   %ebx,%ebx
jle    12ec <score_orf_random+0x19c>
xorpd  %xmm1,%xmm1
lea    0x48(%rsp),%r14
nopl   (%rax)
movsd  %xmm1,0x28(%rsp)
mov    %r13,%rdi
mov    %r15d,%esi
lea    0x70(%rsp),%rdx
call   1050 <generate_sequence@plt>
mov    %r13,%rdi
mov    %r15d,%esi
mov    %r12,%rdx
lea    0x4c(%rsp),%rcx
mov    %r14,%r8
mov    $0x1,%r9d
call   1040 <score@plt>
ucomisd 0x40(%rsp),%xmm0
maxsd  0x28(%rsp),%xmm0
sbb    $0xffffffff,%ebp
movapd %xmm0,%xmm1
add    $0xffffffff,%ebx
jne    12a0 <score_orf_random+0x150>
jmp    12f0 <score_orf_random+0x1a0>
xorpd  %xmm0,%xmm0
movsd  %xmm0,0x28(%rsp)
mov    %r13,%rdi
call   1030 <free@plt>
movslq 0x34(%rsp),%rax
mov    0x38(%rsp),%rcx
movsd  0x28(%rsp),%xmm0
movsd  %xmm0,(%rcx,%rax,8)
mov    %ebp,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%edx
and    $0xfffffffe,%edx
xorpd  %xmm0,%xmm0
xor    %ecx,%ecx
movsd  0xcc6(%rip),%xmm1
jmp    134d <score_orf_random+0x1fd>
nopl   0x0(%rax)
add    $0x2,%rcx
cmp    %rcx,%rdx
je     11cf <score_orf_random+0x7f>
movzbl (%r14,%rcx,1),%esi
cmp    $0x3,%rsi
ja     1376 <score_orf_random+0x226>
movsd  (%rsp,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp,%rsi,8)
movsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
movzbl 0x1(%r14,%rcx,1),%esi
cmp    $0x3,%rsi
ja     1340 <score_orf_random+0x1f0>
movsd  (%rsp,%rsi,8),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rsp,%rsi,8)
movsd  0x20(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x20(%rsp)
jmp    1340 <score_orf_random+0x1f0>

LLVM IR (-O0):
define i32 @score_orf_random(i8* %0, i32 %1, double* %2, double* %3, i32 %4, double %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i32
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca double
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca [4 x i32]
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i8*
%25 = alloca [5 x double]
%26 = alloca [4 x double]
%27 = alloca [4 x double]
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
%32 = alloca double
store i8* %0, i8** %8
store i32 %1, i32* %9
store double* %2, double** %10
store double* %3, double** %11
store i32 %4, i32* %12
store double %5, double* %13
store i32 %6, i32* %14
%33 = bitcast [4 x i32]* %17 to i8*
store i32 0, i32* %21
store i32 0, i32* %22
store i32 0, i32* %23
%34 = bitcast [5 x double]* %25 to i8*
%35 = bitcast [4 x double]* %26 to i8*
store double 0x3E7AD7F29ABCAF48, double* %28
%36 = load i32, i32* %9
%37 = sext i32 %36 to i64
%38 = mul i64 %37, 1
%39 = trunc i64 %38 to i32
%40 = call i64 @malloc(i32 %39)
%41 = inttoptr i64 %40 to i8*
store i8* %41, i8** %24
store i32 0, i32* %15
br label %42
42: ; preds = %78, %7
%43 = load i32, i32* %15
%44 = load i32, i32* %9
%45 = icmp slt i32 %43, %44
br i1 %45, label %46, label %81
46: ; preds = %42
%47 = load i8*, i8** %8
%48 = load i32, i32* %15
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i8, i8* %47, i64 %49
%51 = load i8, i8* %50
%52 = sext i8 %51 to i32
%53 = icmp sge i32 %52, 0
br i1 %53, label %54, label %77
54: ; preds = %46
%55 = load i8*, i8** %8
%56 = load i32, i32* %15
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds i8, i8* %55, i64 %57
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp slt i32 %60, 4
br i1 %61, label %62, label %77
62: ; preds = %54
%63 = load i32, i32* %23
%64 = add nsw i32 %63, 1
store i32 %64, i32* %23
%65 = load i8*, i8** %8
%66 = load i32, i32* %15
%67 = sext i32 %66 to i64
%68 = getelementptr inbounds i8, i8* %65, i64 %67
%69 = load i8, i8* %68
%70 = sext i8 %69 to i64
%71 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 %70
%72 = load double, double* %71
%73 = fadd double %72, 1.000000e+00
store double %73, double* %71
%74 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 4
%75 = load double, double* %74
%76 = fadd double %75, 1.000000e+00
store double %76, double* %74
br label %77
77: ; preds = %62, %54, %46
br label %78
78: ; preds = %77
%79 = load i32, i32* %15
%80 = add nsw i32 %79, 1
store i32 %80, i32* %15
br label %42
81: ; preds = %42
store i32 0, i32* %15
br label %82
82: ; preds = %93, %81
%83 = load i32, i32* %15
%84 = icmp slt i32 %83, 3
br i1 %84, label %85, label %96
85: ; preds = %82
%86 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 4
%87 = load double, double* %86
%88 = load i32, i32* %15
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 %89
%91 = load double, double* %90
%92 = fdiv double %91, %87
store double %92, double* %90
br label %93
93: ; preds = %85
%94 = load i32, i32* %15
%95 = add nsw i32 %94, 1
store i32 %95, i32* %15
br label %82
96: ; preds = %82
%97 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 0
%98 = load double, double* %97
%99 = fsub double 1.000000e+00, %98
%100 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 1
%101 = load double, double* %100
%102 = fsub double %99, %101
%103 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 2
%104 = load double, double* %103
%105 = fsub double %102, %104
%106 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 3
store double %105, double* %106
%107 = getelementptr inbounds [5 x double], [5 x double]* %25, i64 0, i64 0
%108 = getelementptr inbounds [4 x double], [4 x double]* %26, i64 0, i64 0
%109 = load double, double* %28
%110 = call i32 @find_probabilities(double* %107, double* %108, double %109)
%111 = getelementptr inbounds [4 x double], [4 x double]* %26, i64 0, i64 0
%112 = load double, double* %111
%113 = getelementptr inbounds [4 x double], [4 x double]* %27, i64 0, i64 0
store double %112, double* %113
%114 = getelementptr inbounds [4 x double], [4 x double]* %27, i64 0, i64 0
%115 = load double, double* %114
%116 = getelementptr inbounds [4 x double], [4 x double]* %26, i64 0, i64 1
%117 = load double, double* %116
%118 = fadd double %115, %117
%119 = getelementptr inbounds [4 x double], [4 x double]* %27, i64 0, i64 1
store double %118, double* %119
%120 = getelementptr inbounds [4 x double], [4 x double]* %27, i64 0, i64 1
%121 = load double, double* %120
%122 = getelementptr inbounds [4 x double], [4 x double]* %26, i64 0, i64 2
%123 = load double, double* %122
%124 = fadd double %121, %123
%125 = getelementptr inbounds [4 x double], [4 x double]* %27, i64 0, i64 2
store double %124, double* %125
%126 = getelementptr inbounds [4 x double], [4 x double]* %27, i64 0, i64 3
store double 1.000000e+00, double* %126
store double 0.000000e+00, double* %31
store i32 0, i32* %16
br label %127
127: ; preds = %164, %96
%128 = load i32, i32* %16
%129 = load i32, i32* %14
%130 = icmp slt i32 %128, %129
br i1 %130, label %131, label %167
131: ; preds = %127
%132 = load i8*, i8** %24
%133 = load i32, i32* %9
%134 = getelementptr inbounds [4 x double], [4 x double]* %27, i64 0, i64 0
%135 = call i32 @generate_sequence(i8* %132, i32 %133, double* %134)
%136 = load i8*, i8** %24
%137 = load i32, i32* %9
%138 = load double*, double** %10
%139 = call double @score(i8* %136, i32 %137, double* %138, i32* %19, i32* %20, i32 1)
store double %139, double* %29
%140 = load double, double* %29
%141 = load double, double* %31
%142 = fcmp ogt double %140, %141
br i1 %142, label %143, label %145
143: ; preds = %131
%144 = load double, double* %29
store double %144, double* %31
br label %145
145: ; preds = %143, %131
%146 = load double, double* %29
%147 = load double*, double** %11
%148 = load i32, i32* %12
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds double, double* %147, i64 %149
%151 = load double, double* %150
%152 = fcmp oge double %146, %151
br i1 %152, label %153, label %156
153: ; preds = %145
%154 = load i32, i32* %21
%155 = add nsw i32 %154, 1
store i32 %155, i32* %21
br label %156
156: ; preds = %153, %145
%157 = load double, double* %29
%158 = load double, double* %13
%159 = fcmp oge double %157, %158
br i1 %159, label %160, label %163
160: ; preds = %156
%161 = load i32, i32* %22
%162 = add nsw i32 %161, 1
store i32 %162, i32* %22
br label %163
163: ; preds = %160, %156
br label %164
164: ; preds = %163
%165 = load i32, i32* %16
%166 = add nsw i32 %165, 1
store i32 %166, i32* %16
br label %127
167: ; preds = %127
%168 = load i8*, i8** %24
%169 = call i32 @free(i8* %168)
%170 = load double, double* %31
%171 = load double*, double** %11
%172 = load i32, i32* %12
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds double, double* %171, i64 %173
store double %170, double* %174
%175 = load i32, i32* %22
ret i32 %175
}

LLVM IR (-O2):
define i32 @score_orf_random(i8* nocapture %0, i32 %1, double* %2, double* nocapture %3, i32 %4, double %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca [5 x double]
%11 = alloca [4 x double]
%12 = alloca [4 x double]
%13 = bitcast i32* %8 to i8*
%14 = bitcast i32* %9 to i8*
%15 = bitcast [5 x double]* %10 to i8*
%16 = bitcast [4 x double]* %11 to i8*
%17 = bitcast [4 x double]* %12 to i8*
%18 = tail call i64 @malloc(i32 %1)
%19 = inttoptr i64 %18 to i8*
%20 = icmp sgt i32 %1, 0
br i1 %20, label %21, label %50
21: ; preds = %7
%22 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 4
%23 = zext i32 %1 to i64
%24 = and i64 %23, 1
%25 = icmp eq i32 %1, 1
br i1 %25, label %28, label %26
26: ; preds = %21
%27 = and i64 %23, 4294967294
br label %81
28: ; preds = %108, %21
%29 = phi double [ undef, %21 ], [ %109, %108 ]
%30 = phi double [ 0.000000e+00, %21 ], [ %109, %108 ]
%31 = phi i64 [ 0, %21 ], [ %110, %108 ]
%32 = icmp eq i64 %24, 0
br i1 %32, label %44, label %33
33: ; preds = %28
%34 = getelementptr inbounds i8, i8* %0, i64 %31
%35 = load i8, i8* %34
%36 = icmp ult i8 %35, 4
br i1 %36, label %37, label %44
37: ; preds = %33
%38 = zext i8 %35 to i64
%39 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 %38
%40 = load double, double* %39
%41 = fadd double %40, 1.000000e+00
store double %41, double* %39
%42 = load double, double* %22
%43 = fadd double %42, 1.000000e+00
store double %43, double* %22
br label %44
44: ; preds = %33, %37, %28
%45 = phi double [ %29, %28 ], [ %43, %37 ], [ %30, %33 ]
%46 = bitcast [5 x double]* %10 to <2 x double>*
%47 = load <2 x double>, <2 x double>* %46
%48 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 2
%49 = load double, double* %48
br label %50
50: ; preds = %44, %7
%51 = phi double [ %49, %44 ], [ 0.000000e+00, %7 ]
%52 = phi double [ %45, %44 ], [ 0.000000e+00, %7 ]
%53 = phi <2 x double> [ %47, %44 ], [ zeroinitializer, %7 ]
%54 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 0
%55 = insertelement <2 x double> poison, double %52, i64 0
%56 = shufflevector <2 x double> %55, <2 x double> poison, <2 x i32> zeroinitializer
%57 = fdiv <2 x double> %53, %56
%58 = bitcast [5 x double]* %10 to <2 x double>*
store <2 x double> %57, <2 x double>* %58
%59 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 2
%60 = fdiv double %51, %52
store double %60, double* %59
%61 = extractelement <2 x double> %57, i64 0
%62 = fsub double 1.000000e+00, %61
%63 = extractelement <2 x double> %57, i64 1
%64 = fsub double %62, %63
%65 = fsub double %64, %60
%66 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 3
store double %65, double* %66
%67 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 0
%68 = call i32 @find_probabilities(double* %54, double* %67, double 0x3E7AD7F29ABCAF48)
%69 = load double, double* %67
%70 = getelementptr inbounds [4 x double], [4 x double]* %12, i64 0, i64 0
store double %69, double* %70
%71 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 1
%72 = load double, double* %71
%73 = fadd double %69, %72
%74 = getelementptr inbounds [4 x double], [4 x double]* %12, i64 0, i64 1
store double %73, double* %74
%75 = getelementptr inbounds [4 x double], [4 x double]* %11, i64 0, i64 2
%76 = load double, double* %75
%77 = fadd double %73, %76
%78 = getelementptr inbounds [4 x double], [4 x double]* %12, i64 0, i64 2
store double %77, double* %78
%79 = getelementptr inbounds [4 x double], [4 x double]* %12, i64 0, i64 3
store double 1.000000e+00, double* %79
%80 = icmp sgt i32 %6, 0
br i1 %80, label %113, label %126
81: ; preds = %108, %26
%82 = phi double [ 0.000000e+00, %26 ], [ %109, %108 ]
%83 = phi i64 [ 0, %26 ], [ %110, %108 ]
%84 = phi i64 [ 0, %26 ], [ %111, %108 ]
%85 = getelementptr inbounds i8, i8* %0, i64 %83
%86 = load i8, i8* %85
%87 = icmp ult i8 %86, 4
br i1 %87, label %88, label %95
88: ; preds = %81
%89 = zext i8 %86 to i64
%90 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 %89
%91 = load double, double* %90
%92 = fadd double %91, 1.000000e+00
store double %92, double* %90
%93 = load double, double* %22
%94 = fadd double %93, 1.000000e+00
store double %94, double* %22
br label %95
95: ; preds = %81, %88
%96 = phi double [ %94, %88 ], [ %82, %81 ]
%97 = or i64 %83, 1
%98 = getelementptr inbounds i8, i8* %0, i64 %97
%99 = load i8, i8* %98
%100 = icmp ult i8 %99, 4
br i1 %100, label %101, label %108
101: ; preds = %95
%102 = zext i8 %99 to i64
%103 = getelementptr inbounds [5 x double], [5 x double]* %10, i64 0, i64 %102
%104 = load double, double* %103
%105 = fadd double %104, 1.000000e+00
store double %105, double* %103
%106 = load double, double* %22
%107 = fadd double %106, 1.000000e+00
store double %107, double* %22
br label %108
108: ; preds = %101, %95
%109 = phi double [ %107, %101 ], [ %96, %95 ]
%110 = add nuw nsw i64 %83, 2
%111 = add i64 %84, 2
%112 = icmp eq i64 %111, %27
br i1 %112, label %28, label %81
113: ; preds = %50, %113
%114 = phi double [ %120, %113 ], [ 0.000000e+00, %50 ]
%115 = phi i32 [ %124, %113 ], [ 0, %50 ]
%116 = phi i32 [ %123, %113 ], [ 0, %50 ]
%117 = call i32 @generate_sequence(i8* %19, i32 %1, double* %70)
%118 = call double @score(i8* %19, i32 %1, double* %2, i32* %8, i32* %9, i32 1)
%119 = fcmp ogt double %118, %114
%120 = select i1 %119, double %118, double %114
%121 = fcmp oge double %118, %5
%122 = zext i1 %121 to i32
%123 = add nuw nsw i32 %116, %122
%124 = add nuw nsw i32 %115, 1
%125 = icmp eq i32 %124, %6
br i1 %125, label %126, label %113
126: ; preds = %113, %50
%127 = phi i32 [ 0, %50 ], [ %123, %113 ]
%128 = phi double [ 0.000000e+00, %50 ], [ %120, %113 ]
%129 = call i32 @free(i8* %19)
%130 = sext i32 %4 to i64
%131 = getelementptr inbounds double, double* %3, i64 %130
store double %128, double* %131
ret i32 %127
}