#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 int /*<<< orphan*/ buf;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ Die(char *);
scalar_t__ Scalloc(int, size_t);
int /*<<< orphan*/ StrTolower(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ fileno(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ printk(int /*<<< orphan*/, int, char *, char *, char *,
                          char *, char *);
int read(int /*<<< orphan*/, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ stdout;
scalar_t__ strcmp(char *, char *);
float *ReadRnaFoldMat(char *path2mat, char *degapped_orig_seq) {
  const int buflen = 16384;
  FILE *FP_DP_DAT = NULL;
  char buf[buflen];
  int length = 0, rest = 0;
  int dummy = 0;
  char err[buflen];
  char *seq = NULL;
  int seqlen = 0;
  char cmd_str[200];
  float *rnafold_bp_prob_mat = NULL;
  float *rnafold_ptr = NULL;
  int rnafold_bp_prob_mat_dim = 0;
  FP_DP_DAT = fopen(path2mat, "rb");
  if (FP_DP_DAT == NULL) {
    sprintf(err, "Can't open prob matrix file \"%s\"!\n", path2mat);
    Die(err);
  }
  if (read(fileno(FP_DP_DAT), &seqlen, sizeof(int)) != sizeof(int)) {
    sprintf(err, "Can't read sequence length from prob matrix file\"%s\"!\n",
            path2mat);
    Die(err);
  }
  rnafold_bp_prob_mat_dim = (seqlen + 1) * (seqlen + 2) / 2;
  length = sizeof(float) * rnafold_bp_prob_mat_dim;
  rnafold_bp_prob_mat =
      (float *)Scalloc(rnafold_bp_prob_mat_dim, sizeof(float));
  rnafold_ptr = rnafold_bp_prob_mat;
  while (1) {
    rest = (((sizeof(buf)) < (length)) ? (sizeof(buf)) : (length));
    if (read(fileno(FP_DP_DAT), rnafold_ptr, (unsigned)rest) != rest)
      Die("Can't read prob matrix!");
    length -= rest;
    if (length == 0)
      break;
    if (length < 0)
      Die("Can't find end of prob matrix!");
    rnafold_ptr += rest / sizeof(float);
  }
  seq = (char *)Scalloc(1, (size_t)(sizeof(char) * (seqlen + 1)));
  dummy = read(fileno(FP_DP_DAT), seq, sizeof(char) * (seqlen + 1));
  if (dummy != sizeof(char) * (seqlen + 1))
    Die("ERROR: can't read sequence from prob matrix file!");
  StrTolower(seq);
  if (!(strcmp((degapped_orig_seq), (seq)) == 0)) {
    printk(stdout, 1,
           "WARNING(%s): "
           "sequences differ for %s -> \"%s\" != \"%s\"\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/andreas-wilm/construct3/refs/heads/"
           "master/src/cs_wish/bp_prob_mat.c",
           path2mat, seq, degapped_orig_seq);
  }
  dummy = read(fileno(FP_DP_DAT), cmd_str, sizeof(char) * 200);
  if (dummy != sizeof(char) * 200)
    Die("Can't read command from prob matrix file!");
  fclose(FP_DP_DAT);
  free(seq);
  return rnafold_bp_prob_mat;
}


x86 assembly (clang, -O0):
<ReadRnaFoldMat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x8140,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x4000,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
mov    %rsp,%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movq   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movq   $0x0,-0x118(%rbp)
movq   $0x0,-0x120(%rbp)
movl   $0x0,-0x124(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xdd8(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    125f <ReadRnaFoldMat+0xaf>
mov    -0x8(%rbp),%rdx
lea    -0x8130(%rbp),%rdi
lea    0xdb5(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x8130(%rbp),%rdi
call   1090 <Die@plt>
mov    -0x20(%rbp),%rdi
call   1080 <fileno@plt>
mov    %eax,%edi
lea    -0x44(%rbp),%rsi
mov    $0x4,%edx
mov    $0x0,%al
call   1060 <read@plt>
cltq
cmp    $0x4,%rax
je     12a9 <ReadRnaFoldMat+0xf9>
mov    -0x8(%rbp),%rdx
lea    -0x8130(%rbp),%rdi
lea    0xd8e(%rip),%rsi
call   10b0 <sprintf@plt>
lea    -0x8130(%rbp),%rdi
call   1090 <Die@plt>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    -0x44(%rbp),%ecx
add    $0x2,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x124(%rbp)
movslq -0x124(%rbp),%rax
shl    $0x2,%rax
mov    %eax,-0x2c(%rbp)
mov    -0x124(%rbp),%edi
mov    $0x4,%esi
call   10c0 <Scalloc@plt>
mov    %rax,-0x118(%rbp)
mov    -0x118(%rbp),%rax
mov    %rax,-0x120(%rbp)
jmp    12fe <ReadRnaFoldMat+0x14e>
movslq -0x2c(%rbp),%rcx
mov    $0x4000,%eax
cmp    %rcx,%rax
jae    1321 <ReadRnaFoldMat+0x171>
mov    $0x4000,%eax
mov    %rax,-0x8138(%rbp)
jmp    132c <ReadRnaFoldMat+0x17c>
movslq -0x2c(%rbp),%rax
mov    %rax,-0x8138(%rbp)
mov    -0x8138(%rbp),%rax
mov    %eax,-0x30(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <fileno@plt>
mov    %eax,%edi
mov    -0x120(%rbp),%rsi
mov    -0x30(%rbp),%edx
mov    $0x0,%al
call   1060 <read@plt>
cmp    -0x30(%rbp),%eax
je     1367 <ReadRnaFoldMat+0x1b7>
lea    0xcfb(%rip),%rdi
call   1090 <Die@plt>
mov    -0x30(%rbp),%ecx
mov    -0x2c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jne    1381 <ReadRnaFoldMat+0x1d1>
jmp    13b6 <ReadRnaFoldMat+0x206>
cmpl   $0x0,-0x2c(%rbp)
jge    1397 <ReadRnaFoldMat+0x1e7>
lea    0xce3(%rip),%rdi
call   1090 <Die@plt>
movslq -0x30(%rbp),%rax
shr    $0x2,%rax
shl    $0x2,%rax
add    -0x120(%rbp),%rax
mov    %rax,-0x120(%rbp)
jmp    12f9 <ReadRnaFoldMat+0x149>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rsi
shl    $0x0,%rsi
mov    $0x1,%edi
call   10c0 <Scalloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
call   1080 <fileno@plt>
mov    %eax,%edi
mov    -0x40(%rbp),%rsi
mov    -0x44(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rdx
shl    $0x0,%rdx
mov    $0x0,%al
call   1060 <read@plt>
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
shl    $0x0,%rcx
cmp    %rcx,%rax
je     141d <ReadRnaFoldMat+0x26d>
lea    0xc7c(%rip),%rdi
call   1090 <Die@plt>
mov    -0x40(%rbp),%rdi
call   10d0 <StrTolower@plt>
mov    -0x10(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
je     146e <ReadRnaFoldMat+0x2be>
mov    0x2b9c(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%r8
mov    -0x40(%rbp),%r9
mov    -0x10(%rbp),%rax
mov    $0x1,%esi
lea    0xc68(%rip),%rdx
lea    0xc97(%rip),%rcx
mov    %rax,(%rsp)
call   1030 <printk@plt>
mov    -0x20(%rbp),%rdi
call   1080 <fileno@plt>
mov    %eax,%edi
lea    -0x110(%rbp),%rsi
mov    $0xc8,%edx
mov    $0x0,%al
call   1060 <read@plt>
mov    %eax,-0x34(%rbp)
movslq -0x34(%rbp),%rax
cmp    $0xc8,%rax
je     14ab <ReadRnaFoldMat+0x2fb>
lea    0xcf4(%rip),%rdi
call   1090 <Die@plt>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1040 <free@plt>
mov    -0x118(%rbp),%rax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rsp
add    $0x8140,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadRnaFoldMat>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x4108,%rsp
mov    %rsi,0x28(%rsp)
mov    %rdi,%rbp
movl   $0x0,0x14(%rsp)
lea    0xe28(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1207 <ReadRnaFoldMat+0x57>
lea    0xe17(%rip),%rsi
lea    0x100(%rsp),%r14
mov    %r14,%rdi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r14,%rdi
call   1090 <Die@plt>
mov    %rbx,%rdi
call   1080 <fileno@plt>
lea    0x14(%rsp),%rsi
mov    $0x4,%edx
mov    %eax,%edi
xor    %eax,%eax
call   1060 <read@plt>
cmp    $0x4,%eax
je     1249 <ReadRnaFoldMat+0x99>
lea    0xdf8(%rip),%rsi
lea    0x100(%rsp),%r14
mov    %r14,%rdi
mov    %rbp,%rdx
call   10b0 <sprintf@plt>
mov    %r14,%rdi
call   1090 <Die@plt>
mov    %rbp,0x18(%rsp)
mov    0x14(%rsp),%eax
lea    0x1(%rax),%ecx
add    $0x2,%eax
imul   %ecx,%eax
mov    %eax,%edi
shr    $0x1f,%edi
add    %eax,%edi
sar    %edi
lea    0x0(,%rdi,4),%r15d
mov    $0x4,%esi
call   10c0 <Scalloc@plt>
mov    %rax,%r12
lea    0xdf5(%rip),%r13
lea    0xdd6(%rip),%rbp
mov    %rax,0x20(%rsp)
jmp    1297 <ReadRnaFoldMat+0xe7>
xchg   %ax,%ax
and    $0xfffffffc,%r14d
add    %r14,%r12
cmp    $0x4000,%r15d
mov    $0x4000,%r14d
cmovb  %r15d,%r14d
mov    %rbx,%rdi
call   1080 <fileno@plt>
mov    %eax,%edi
mov    %r12,%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1060 <read@plt>
cmp    %r14d,%eax
je     12cc <ReadRnaFoldMat+0x11c>
mov    %rbp,%rdi
call   1090 <Die@plt>
sub    %r14d,%r15d
je     12dd <ReadRnaFoldMat+0x12d>
jns    1290 <ReadRnaFoldMat+0xe0>
mov    %r13,%rdi
call   1090 <Die@plt>
jmp    1290 <ReadRnaFoldMat+0xe0>
movslq 0x14(%rsp),%rsi
add    $0x1,%rsi
mov    $0x1,%edi
call   10c0 <Scalloc@plt>
mov    %rax,%r13
mov    %rbx,%rdi
call   1080 <fileno@plt>
movslq 0x14(%rsp),%rdx
add    $0x1,%rdx
mov    %eax,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1060 <read@plt>
mov    0x14(%rsp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
je     1327 <ReadRnaFoldMat+0x177>
lea    0xd72(%rip),%rdi
call   1090 <Die@plt>
mov    %r13,%rdi
call   10d0 <StrTolower@plt>
mov    0x28(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
call   1070 <strcmp@plt>
test   %rax,%rax
je     1371 <ReadRnaFoldMat+0x1c1>
mov    0x2c95(%rip),%rax
mov    (%rax),%edi
mov    %rbp,(%rsp)
lea    0xd6e(%rip),%rdx
lea    0xd9d(%rip),%rcx
mov    $0x1,%esi
mov    0x18(%rsp),%r8
mov    %r13,%r9
call   1030 <printk@plt>
mov    %rbx,%rdi
call   1080 <fileno@plt>
lea    0x30(%rsp),%rsi
mov    $0xc8,%edx
mov    %eax,%edi
xor    %eax,%eax
call   1060 <read@plt>
cmp    $0xc8,%eax
je     139f <ReadRnaFoldMat+0x1ef>
lea    0xe00(%rip),%rdi
call   1090 <Die@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r13,%rdi
call   1040 <free@plt>
mov    0x20(%rsp),%rax
add    $0x4108,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"rb\00"
@.str.1 = [35 x i8] c"Can't open prob matrix file \22%s\22!\0A\00"
@.str.2 = [55 x i8] c"Can't read sequence length from prob matrix file\22%s\22!\0A\00"
@.str.3 = [24 x i8] c"Can't read prob matrix!\00"
@.str.4 = [31 x i8] c"Can't find end of prob matrix!\00"
@.str.5 = [50 x i8] c"ERROR: can't read sequence from prob matrix file!\00"
@stdout = global i32 0
@.str.6 = [54 x i8] c"WARNING(%s): sequences differ for %s -> \22%s\22 != \22%s\22\0A\00"
@.str.7 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andreas-wilm/construct3/refs/heads/master/src/cs_wish/bp_prob_mat.c\00"
@.str.8 = [42 x i8] c"Can't read command from prob matrix file!\00"
define float* @ReadRnaFoldMat(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca [200 x i8]
%14 = alloca float*
%15 = alloca float*
%16 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 16384, i32* %5
store i32* null, i32** %6
%17 = call i8* @llvm.stacksave()
store i8* %17, i8** %7
%18 = alloca i8, i64 16384
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
%19 = alloca i8, i64 16384
store i8* null, i8** %11
store i32 0, i32* %12
store float* null, float** %14
store float* null, float** %15
store i32 0, i32* %16
%20 = load i8*, i8** %3
%21 = call i32* @fopen(i8* %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
store i32* %21, i32** %6
%22 = load i32*, i32** %6
%23 = icmp eq i32* %22, null
br i1 %23, label %24, label %28
24: ; preds = %2
%25 = load i8*, i8** %3
%26 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %25)
%27 = call i32 @Die(i8* %19)
br label %28
28: ; preds = %24, %2
%29 = load i32*, i32** %6
%30 = call i32 @fileno(i32* %29)
%31 = call i32 (i32, ...) @read(i32 %30, i32* %12, i64 4)
%32 = sext i32 %31 to i64
%33 = icmp ne i64 %32, 4
br i1 %33, label %34, label %38
34: ; preds = %28
%35 = load i8*, i8** %3
%36 = call i32 @sprintf(i8* %19, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %35)
%37 = call i32 @Die(i8* %19)
br label %38
38: ; preds = %34, %28
%39 = load i32, i32* %12
%40 = add nsw i32 %39, 1
%41 = load i32, i32* %12
%42 = add nsw i32 %41, 2
%43 = mul nsw i32 %40, %42
%44 = sdiv i32 %43, 2
store i32 %44, i32* %16
%45 = load i32, i32* %16
%46 = sext i32 %45 to i64
%47 = mul i64 4, %46
%48 = trunc i64 %47 to i32
store i32 %48, i32* %8
%49 = load i32, i32* %16
%50 = call i64 @Scalloc(i32 %49, i64 4)
%51 = inttoptr i64 %50 to float*
store float* %51, float** %14
%52 = load float*, float** %14
store float* %52, float** %15
br label %53
53: ; preds = %86, %38
br label %54
54: ; preds = %53
%55 = load i32, i32* %8
%56 = sext i32 %55 to i64
%57 = icmp ult i64 16384, %56
br i1 %57, label %58, label %59
58: ; preds = %54
br label %62
59: ; preds = %54
%60 = load i32, i32* %8
%61 = sext i32 %60 to i64
br label %62
62: ; preds = %59, %58
%63 = phi i64 [ 16384, %58 ], [ %61, %59 ]
%64 = trunc i64 %63 to i32
store i32 %64, i32* %9
%65 = load i32*, i32** %6
%66 = call i32 @fileno(i32* %65)
%67 = load float*, float** %15
%68 = load i32, i32* %9
%69 = call i32 (i32, ...) @read(i32 %66, float* %67, i32 %68)
%70 = load i32, i32* %9
%71 = icmp ne i32 %69, %70
br i1 %71, label %72, label %74
72: ; preds = %62
%73 = call i32 @Die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %74
74: ; preds = %72, %62
%75 = load i32, i32* %9
%76 = load i32, i32* %8
%77 = sub nsw i32 %76, %75
store i32 %77, i32* %8
%78 = load i32, i32* %8
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %81
80: ; preds = %74
br label %92
81: ; preds = %74
%82 = load i32, i32* %8
%83 = icmp slt i32 %82, 0
br i1 %83, label %84, label %86
84: ; preds = %81
%85 = call i32 @Die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %86
86: ; preds = %84, %81
%87 = load i32, i32* %9
%88 = sext i32 %87 to i64
%89 = udiv i64 %88, 4
%90 = load float*, float** %15
%91 = getelementptr inbounds float, float* %90, i64 %89
store float* %91, float** %15
br label %53
92: ; preds = %80
%93 = load i32, i32* %12
%94 = add nsw i32 %93, 1
%95 = sext i32 %94 to i64
%96 = mul i64 1, %95
%97 = call i64 @Scalloc(i32 1, i64 %96)
%98 = inttoptr i64 %97 to i8*
store i8* %98, i8** %11
%99 = load i32*, i32** %6
%100 = call i32 @fileno(i32* %99)
%101 = load i8*, i8** %11
%102 = load i32, i32* %12
%103 = add nsw i32 %102, 1
%104 = sext i32 %103 to i64
%105 = mul i64 1, %104
%106 = call i32 (i32, ...) @read(i32 %100, i8* %101, i64 %105)
store i32 %106, i32* %10
%107 = load i32, i32* %10
%108 = sext i32 %107 to i64
%109 = load i32, i32* %12
%110 = add nsw i32 %109, 1
%111 = sext i32 %110 to i64
%112 = mul i64 1, %111
%113 = icmp ne i64 %108, %112
br i1 %113, label %114, label %116
114: ; preds = %92
%115 = call i32 @Die(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %116
116: ; preds = %114, %92
%117 = load i8*, i8** %11
%118 = call i32 @StrTolower(i8* %117)
%119 = load i8*, i8** %4
%120 = load i8*, i8** %11
%121 = call i64 @strcmp(i8* %119, i8* %120)
%122 = icmp eq i64 %121, 0
br i1 %122, label %129, label %123
123: ; preds = %116
%124 = load i32, i32* @stdout
%125 = load i8*, i8** %3
%126 = load i8*, i8** %11
%127 = load i8*, i8** %4
%128 = call i32 @printk(i32 %124, i32 1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.7, i64 0, i64 0), i8* %125, i8* %126, i8* %127)
br label %129
129: ; preds = %123, %116
%130 = load i32*, i32** %6
%131 = call i32 @fileno(i32* %130)
%132 = getelementptr inbounds [200 x i8], [200 x i8]* %13, i64 0, i64 0
%133 = call i32 (i32, ...) @read(i32 %131, i8* %132, i64 200)
store i32 %133, i32* %10
%134 = load i32, i32* %10
%135 = sext i32 %134 to i64
%136 = icmp ne i64 %135, 200
br i1 %136, label %137, label %139
137: ; preds = %129
%138 = call i32 @Die(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
br label %139
139: ; preds = %137, %129
%140 = load i32*, i32** %6
%141 = call i32 @fclose(i32* %140)
%142 = load i8*, i8** %11
%143 = call i32 @free(i8* %142)
%144 = load float*, float** %14
%145 = load i8*, i8** %7
ret float* %144
}

LLVM IR (-O2):
@.str = [3 x i8] c"rb\00"
@.str.1 = [35 x i8] c"Can't open prob matrix file \22%s\22!\0A\00"
@.str.2 = [55 x i8] c"Can't read sequence length from prob matrix file\22%s\22!\0A\00"
@.str.3 = [24 x i8] c"Can't read prob matrix!\00"
@.str.4 = [31 x i8] c"Can't find end of prob matrix!\00"
@.str.5 = [50 x i8] c"ERROR: can't read sequence from prob matrix file!\00"
@stdout = global i32 0
@.str.6 = [54 x i8] c"WARNING(%s): sequences differ for %s -> \22%s\22 != \22%s\22\0A\00"
@.str.7 = [158 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/andreas-wilm/construct3/refs/heads/master/src/cs_wish/bp_prob_mat.c\00"
@.str.8 = [42 x i8] c"Can't read command from prob matrix file!\00"
define float* @ReadRnaFoldMat(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca [200 x i8]
%5 = alloca [16384 x i8]
%6 = getelementptr inbounds [16384 x i8], [16384 x i8]* %5, i64 0, i64 0
%7 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%9 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%10 = icmp eq i32* %9, null
br i1 %10, label %11, label %14
11: ; preds = %2
%12 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%13 = call i32 @Die(i8* %6)
br label %14
14: ; preds = %11, %2
%15 = call i32 @fileno(i32* %9)
%16 = call i32 (i32, ...) @read(i32 %15, i32* %3, i64 4)
%17 = icmp eq i32 %16, 4
br i1 %17, label %21, label %18
18: ; preds = %14
%19 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), i8* %0)
%20 = call i32 @Die(i8* %6)
br label %21
21: ; preds = %18, %14
%22 = load i32, i32* %3
%23 = add nsw i32 %22, 1
%24 = add nsw i32 %22, 2
%25 = mul nsw i32 %23, %24
%26 = sdiv i32 %25, 2
%27 = shl i32 %26, 2
%28 = call i64 @Scalloc(i32 %26, i64 4)
%29 = inttoptr i64 %28 to float*
br label %30
30: ; preds = %47, %21
%31 = phi i32 [ %27, %21 ], [ %41, %47 ]
%32 = phi float* [ %29, %21 ], [ %50, %47 ]
%33 = icmp ult i32 %31, 16384
%34 = select i1 %33, i32 %31, i32 16384
%35 = call i32 @fileno(i32* %9)
%36 = call i32 (i32, ...) @read(i32 %35, float* %32, i32 %34)
%37 = icmp eq i32 %36, %34
br i1 %37, label %40, label %38
38: ; preds = %30
%39 = call i32 @Die(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.3, i64 0, i64 0))
br label %40
40: ; preds = %38, %30
%41 = sub nsw i32 %31, %34
%42 = icmp eq i32 %41, 0
br i1 %42, label %51, label %43
43: ; preds = %40
%44 = icmp slt i32 %41, 0
br i1 %44, label %45, label %47
45: ; preds = %43
%46 = call i32 @Die(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %47
47: ; preds = %45, %43
%48 = lshr i32 %34, 2
%49 = zext i32 %48 to i64
%50 = getelementptr inbounds float, float* %32, i64 %49
br label %30
51: ; preds = %40
%52 = load i32, i32* %3
%53 = add nsw i32 %52, 1
%54 = sext i32 %53 to i64
%55 = call i64 @Scalloc(i32 1, i64 %54)
%56 = inttoptr i64 %55 to i8*
%57 = call i32 @fileno(i32* %9)
%58 = load i32, i32* %3
%59 = add nsw i32 %58, 1
%60 = sext i32 %59 to i64
%61 = call i32 (i32, ...) @read(i32 %57, i8* %56, i64 %60)
%62 = load i32, i32* %3
%63 = add nsw i32 %62, 1
%64 = icmp eq i32 %61, %63
br i1 %64, label %67, label %65
65: ; preds = %51
%66 = call i32 @Die(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.5, i64 0, i64 0))
br label %67
67: ; preds = %65, %51
%68 = call i32 @StrTolower(i8* %56)
%69 = call i64 @strcmp(i8* %1, i8* %56)
%70 = icmp eq i64 %69, 0
br i1 %70, label %74, label %71
71: ; preds = %67
%72 = load i32, i32* @stdout
%73 = call i32 @printk(i32 %72, i32 1, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.6, i64 0, i64 0), i8* getelementptr inbounds ([158 x i8], [158 x i8]* @.str.7, i64 0, i64 0), i8* %0, i8* %56, i8* %1)
br label %74
74: ; preds = %71, %67
%75 = call i32 @fileno(i32* %9)
%76 = call i32 (i32, ...) @read(i32 %75, i8* %8, i64 200)
%77 = icmp eq i32 %76, 200
br i1 %77, label %80, label %78
78: ; preds = %74
%79 = call i32 @Die(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
br label %80
80: ; preds = %78, %74
%81 = call i32 @fclose(i32* %9)
%82 = call i32 @free(i8* %56)
ret float* %29
}