#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 */
struct asn_bstruct {
  int dummy;
};

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ chk_asn_buf(struct asn_bstruct *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int, ...);
unsigned char *get_pssm_freqs(struct asn_bstruct *, double **, int, int,
                              int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
unsigned char *get_pssm2_intermed(struct asn_bstruct *asnp, double ***wfreqs,
                                  double ***freqs, int n_rows, int n_cols) {
  int i;
  double **my_freqs, **my_wfreqs;
  int **my_iscores;
  if ((my_freqs = (double **)calloc(n_cols, sizeof(double *))) == NULL) {
    fprintf(stderr, "*** ERROR [%s:%d] - cannot allocate freq cols - %d\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/"
            "server/wsgi/bmrbapi/submodules/fasta36/src/pssm_asn_subs.c",
            1407, n_cols);
    exit(1);
  }
  if ((my_wfreqs = (double **)calloc(n_cols, sizeof(double *))) == NULL) {
    fprintf(stderr, "*** ERROR [%s:%d] - cannot allocate wfreq cols - %d\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/"
            "server/wsgi/bmrbapi/submodules/fasta36/src/pssm_asn_subs.c",
            1412, n_cols);
    exit(1);
  }
  if ((my_freqs[0] = (double *)calloc(n_cols * n_rows, sizeof(double))) ==
      NULL) {
    fprintf(stderr,
            "*** ERROR [%s:%d] - cannot allocate freq rows * cols - %d * %d\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/"
            "server/wsgi/bmrbapi/submodules/fasta36/src/pssm_asn_subs.c",
            1417, n_rows, n_cols);
    exit(1);
  }
  if ((my_wfreqs[0] = (double *)calloc(n_cols * n_rows, sizeof(double))) ==
      NULL) {
    fprintf(stderr,
            "*** ERROR [%s:%d] - cannot allocate freq rows * cols - %d * %d\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/"
            "server/wsgi/bmrbapi/submodules/fasta36/src/pssm_asn_subs.c",
            1422, n_rows, n_cols);
    exit(1);
  }
  for (i = 1; i < n_cols; i++) {
    my_freqs[i] = my_freqs[i - 1] + n_rows;
    my_wfreqs[i] = my_wfreqs[i - 1] + n_rows;
  }
  *wfreqs = my_wfreqs;
  *freqs = my_freqs;
  chk_asn_buf(asnp, 16);
  return get_pssm_freqs(asnp, my_freqs, n_rows, n_cols, 0);
}


x86 assembly (clang, -O0):
<get_pssm2_intermed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x30(%rbp)
cmp    $0x0,%rax
jne    11b7 <get_pssm2_intermed+0x67>
mov    0x2e53(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%r8d
lea    0xe66(%rip),%rsi
lea    0xe93(%rip),%rdx
mov    $0x57f,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x20(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    1203 <get_pssm2_intermed+0xb3>
mov    0x2e07(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%r8d
lea    0xf05(%rip),%rsi
lea    0xe47(%rip),%rdx
mov    $0x584,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x20(%rbp),%edi
imul   -0x1c(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    -0x30(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    125a <get_pssm2_intermed+0x10a>
mov    0x2db4(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xee3(%rip),%rsi
lea    0xdf0(%rip),%rdx
mov    $0x589,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x20(%rbp),%edi
imul   -0x1c(%rbp),%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    -0x38(%rbp),%rcx
mov    %rax,(%rcx)
cmp    $0x0,%rax
jne    12b1 <get_pssm2_intermed+0x161>
mov    0x2d5d(%rip),%rax
mov    (%rax),%edi
mov    -0x1c(%rbp),%r8d
mov    -0x20(%rbp),%r9d
lea    0xe8c(%rip),%rsi
lea    0xd99(%rip),%rdx
mov    $0x58e,%ecx
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1322 <get_pssm2_intermed+0x1d2>
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x30(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x38(%rbp),%rax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,8),%rdx
movslq -0x1c(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdx
mov    -0x38(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12b8 <get_pssm2_intermed+0x168>
mov    -0x38(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
mov    $0x10,%esi
call   1050 <chk_asn_buf@plt>
mov    -0x8(%rbp),%rdi
mov    -0x30(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
xor    %r8d,%r8d
call   1060 <get_pssm_freqs@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_pssm2_intermed>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %r8d,%r14d
mov    %ecx,%r12d
mov    %rdx,0x38(%rsp)
mov    %rsi,0x30(%rsp)
mov    %rdi,%r13
mov    %r8d,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1446 <get_pssm2_intermed+0x2f6>
mov    %rax,%rbp
mov    %r14d,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
test   %rax,%rax
je     1464 <get_pssm2_intermed+0x314>
mov    %rax,%r15
mov    %r14d,%ebx
imul   %r12d,%ebx
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,0x0(%rbp)
test   %rax,%rax
je     1494 <get_pssm2_intermed+0x344>
mov    %ebx,%edi
mov    $0x8,%esi
call   1030 <calloc@plt>
mov    %rax,(%r15)
test   %rax,%rax
je     14b2 <get_pssm2_intermed+0x362>
cmp    $0x2,%r14d
jl     1407 <get_pssm2_intermed+0x2b7>
movslq %r12d,%r8
mov    %r14d,%edi
lea    (%r15,%rdi,8),%rax
cmp    %rax,%rbp
jae    12ad <get_pssm2_intermed+0x15d>
lea    0x0(,%rdi,8),%rax
add    %rbp,%rax
cmp    %rax,%r15
jae    12ad <get_pssm2_intermed+0x15d>
add    $0xffffffffffffffff,%rdi
mov    $0x1,%ecx
cmp    $0x2,%r14d
je     1284 <get_pssm2_intermed+0x134>
mov    %rdi,%rax
and    $0xfffffffffffffffe,%rax
neg    %rax
mov    $0x1,%ecx
lea    0x0(,%r8,8),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    -0x8(%rbp,%rcx,8),%rsi
add    %rdx,%rsi
mov    %rsi,0x0(%rbp,%rcx,8)
mov    -0x8(%r15,%rcx,8),%rsi
add    %rdx,%rsi
mov    %rsi,(%r15,%rcx,8)
mov    0x0(%rbp,%rcx,8),%rsi
add    %rdx,%rsi
mov    %rsi,0x8(%rbp,%rcx,8)
mov    (%r15,%rcx,8),%rsi
add    %rdx,%rsi
mov    %rsi,0x8(%r15,%rcx,8)
lea    (%rax,%rcx,1),%rsi
add    $0x2,%rsi
add    $0x2,%rcx
cmp    $0x1,%rsi
jne    1240 <get_pssm2_intermed+0xf0>
test   $0x1,%dil
je     1407 <get_pssm2_intermed+0x2b7>
shl    $0x3,%r8
mov    -0x8(%rbp,%rcx,8),%rax
add    %r8,%rax
mov    %rax,0x0(%rbp,%rcx,8)
add    -0x8(%r15,%rcx,8),%r8
mov    %r8,(%r15,%rcx,8)
jmp    1407 <get_pssm2_intermed+0x2b7>
mov    0x0(%rbp),%r10
mov    (%r15),%rsi
lea    -0x1(%rdi),%rbx
add    $0xfffffffffffffffe,%rdi
mov    %rbx,0x8(%rsp)
and    $0x3,%ebx
mov    $0x1,%edx
cmp    $0x3,%rdi
jb     13c1 <get_pssm2_intermed+0x271>
mov    %rbx,0x20(%rsp)
mov    %r13,0x28(%rsp)
mov    %r12d,(%rsp)
mov    %r14d,0x4(%rsp)
andq   $0xfffffffffffffffc,0x8(%rsp)
mov    %r8,%rdi
shl    $0x5,%rdi
lea    (%rsi,%rdi,1),%rax
mov    %rax,0x40(%rsp)
lea    0x0(,%r8,8),%rax
lea    (%rax,%rax,2),%rbx
lea    (%rsi,%rbx,1),%rcx
mov    %r8,%rax
shl    $0x4,%rax
lea    (%rsi,%rax,1),%r9
mov    %rsi,0x10(%rsp)
lea    (%rsi,%r8,8),%r14
lea    (%r10,%rdi,1),%r12
add    %r10,%rbx
add    %r10,%rax
mov    %r10,0x18(%rsp)
lea    (%r10,%r8,8),%r10
xor    %r13d,%r13d
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
lea    (%r10,%r13,1),%r11
mov    %r11,0x8(%rbp,%rdx,8)
lea    (%r14,%r13,1),%rsi
mov    %rsi,0x8(%r15,%rdx,8)
lea    (%rax,%r13,1),%rsi
mov    %rsi,0x10(%rbp,%rdx,8)
lea    (%r9,%r13,1),%rsi
mov    %rsi,0x10(%r15,%rdx,8)
lea    (%rbx,%r13,1),%rsi
mov    %rsi,0x18(%rbp,%rdx,8)
lea    (%rcx,%r13,1),%rsi
mov    %rsi,0x18(%r15,%rdx,8)
lea    (%r12,%r13,1),%rsi
mov    %rsi,0x20(%rbp,%rdx,8)
mov    0x40(%rsp),%rsi
add    %r13,%rsi
mov    %rsi,0x20(%r15,%rdx,8)
add    $0x4,%rdx
add    %rdi,%r13
cmp    %rdx,0x8(%rsp)
jne    1340 <get_pssm2_intermed+0x1f0>
mov    0x10(%rsp),%rsi
add    %r13,%rsi
mov    0x18(%rsp),%r10
add    %r13,%r10
add    $0x1,%rdx
mov    0x4(%rsp),%r14d
mov    (%rsp),%r12d
mov    0x28(%rsp),%r13
mov    0x20(%rsp),%rbx
test   %rbx,%rbx
je     1407 <get_pssm2_intermed+0x2b7>
lea    (%rsi,%r8,8),%rax
lea    (%r10,%r8,8),%rcx
shl    $0x3,%r8
lea    (%r15,%rdx,8),%rsi
lea    0x0(,%rdx,8),%rdx
add    %rbp,%rdx
xor    %edi,%edi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rcx,(%rdx,%rdi,8)
mov    %rax,(%rsi,%rdi,8)
add    $0x1,%rdi
add    %r8,%rax
add    %r8,%rcx
cmp    %rdi,%rbx
jne    13f0 <get_pssm2_intermed+0x2a0>
mov    0x30(%rsp),%rax
mov    %r15,(%rax)
mov    0x38(%rsp),%rax
mov    %rbp,(%rax)
mov    %r13,%rdi
mov    $0x10,%esi
call   1050 <chk_asn_buf@plt>
mov    %r13,%rdi
mov    %rbp,%rsi
mov    %r12d,%edx
mov    %r14d,%ecx
xor    %r8d,%r8d
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <get_pssm_freqs@plt>
mov    0x2b93(%rip),%rax
mov    (%rax),%edi
lea    0xbaa(%rip),%rsi
lea    0xbd7(%rip),%rdx
mov    $0x57f,%ecx
jmp    1480 <get_pssm2_intermed+0x330>
mov    0x2b75(%rip),%rax
mov    (%rax),%edi
lea    0xc77(%rip),%rsi
lea    0xbb9(%rip),%rdx
mov    $0x584,%ecx
mov    %r14d,%r8d
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    0x2b45(%rip),%rax
mov    (%rax),%edi
lea    0xc7c(%rip),%rsi
lea    0xb89(%rip),%rdx
mov    $0x589,%ecx
jmp    14ce <get_pssm2_intermed+0x37e>
mov    0x2b27(%rip),%rax
mov    (%rax),%edi
lea    0xc5e(%rip),%rsi
lea    0xb6b(%rip),%rdx
mov    $0x58e,%ecx
mov    %r12d,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
%struct.asn_bstruct = type { i32 }
@stderr = global i32 0
@.str = [52 x i8] c"*** ERROR [%s:%d] - cannot allocate freq cols - %d\0A\00"
@.str.1 = [183 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/server/wsgi/bmrbapi/submodules/fasta36/src/pssm_asn_subs.c\00"
@.str.2 = [53 x i8] c"*** ERROR [%s:%d] - cannot allocate wfreq cols - %d\0A\00"
@.str.3 = [64 x i8] c"*** ERROR [%s:%d] - cannot allocate freq rows * cols - %d * %d\0A\00"
define i8* @get_pssm2_intermed(%struct.asn_bstruct* %0, double*** %1, double*** %2, i32 %3, i32 %4) {
%6 = alloca %struct.asn_bstruct*
%7 = alloca double***
%8 = alloca double***
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca double**
%13 = alloca double**
%14 = alloca i32**
store %struct.asn_bstruct* %0, %struct.asn_bstruct** %6
store double*** %1, double**** %7
store double*** %2, double**** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%15 = load i32, i32* %10
%16 = call i64 @calloc(i32 %15, i32 8)
%17 = inttoptr i64 %16 to double**
store double** %17, double*** %12
%18 = icmp eq double** %17, null
br i1 %18, label %19, label %24
19: ; preds = %5
%20 = load i32, i32* @stderr
%21 = load i32, i32* %10
%22 = call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1407, i32 %21)
%23 = call i32 @exit(i32 1)
unreachable
24: ; preds = %5
%25 = load i32, i32* %10
%26 = call i64 @calloc(i32 %25, i32 8)
%27 = inttoptr i64 %26 to double**
store double** %27, double*** %13
%28 = icmp eq double** %27, null
br i1 %28, label %29, label %34
29: ; preds = %24
%30 = load i32, i32* @stderr
%31 = load i32, i32* %10
%32 = call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1412, i32 %31)
%33 = call i32 @exit(i32 1)
unreachable
34: ; preds = %24
%35 = load i32, i32* %10
%36 = load i32, i32* %9
%37 = mul nsw i32 %35, %36
%38 = call i64 @calloc(i32 %37, i32 8)
%39 = inttoptr i64 %38 to double*
%40 = load double**, double*** %12
%41 = getelementptr inbounds double*, double** %40, i64 0
store double* %39, double** %41
%42 = icmp eq double* %39, null
br i1 %42, label %43, label %49
43: ; preds = %34
%44 = load i32, i32* @stderr
%45 = load i32, i32* %9
%46 = load i32, i32* %10
%47 = call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %44, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1417, i32 %45, i32 %46)
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %34
%50 = load i32, i32* %10
%51 = load i32, i32* %9
%52 = mul nsw i32 %50, %51
%53 = call i64 @calloc(i32 %52, i32 8)
%54 = inttoptr i64 %53 to double*
%55 = load double**, double*** %13
%56 = getelementptr inbounds double*, double** %55, i64 0
store double* %54, double** %56
%57 = icmp eq double* %54, null
br i1 %57, label %58, label %64
58: ; preds = %49
%59 = load i32, i32* @stderr
%60 = load i32, i32* %9
%61 = load i32, i32* %10
%62 = call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %59, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1422, i32 %60, i32 %61)
%63 = call i32 @exit(i32 1)
unreachable
64: ; preds = %49
store i32 1, i32* %11
br label %65
65: ; preds = %96, %64
%66 = load i32, i32* %11
%67 = load i32, i32* %10
%68 = icmp slt i32 %66, %67
br i1 %68, label %69, label %99
69: ; preds = %65
%70 = load double**, double*** %12
%71 = load i32, i32* %11
%72 = sub nsw i32 %71, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds double*, double** %70, i64 %73
%75 = load double*, double** %74
%76 = load i32, i32* %9
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds double, double* %75, i64 %77
%79 = load double**, double*** %12
%80 = load i32, i32* %11
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds double*, double** %79, i64 %81
store double* %78, double** %82
%83 = load double**, double*** %13
%84 = load i32, i32* %11
%85 = sub nsw i32 %84, 1
%86 = sext i32 %85 to i64
%87 = getelementptr inbounds double*, double** %83, i64 %86
%88 = load double*, double** %87
%89 = load i32, i32* %9
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
%92 = load double**, double*** %13
%93 = load i32, i32* %11
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds double*, double** %92, i64 %94
store double* %91, double** %95
br label %96
96: ; preds = %69
%97 = load i32, i32* %11
%98 = add nsw i32 %97, 1
store i32 %98, i32* %11
br label %65
99: ; preds = %65
%100 = load double**, double*** %13
%101 = load double***, double**** %7
store double** %100, double*** %101
%102 = load double**, double*** %12
%103 = load double***, double**** %8
store double** %102, double*** %103
%104 = load %struct.asn_bstruct*, %struct.asn_bstruct** %6
%105 = call i32 @chk_asn_buf(%struct.asn_bstruct* %104, i32 16)
%106 = load %struct.asn_bstruct*, %struct.asn_bstruct** %6
%107 = load double**, double*** %12
%108 = load i32, i32* %9
%109 = load i32, i32* %10
%110 = call i8* @get_pssm_freqs(%struct.asn_bstruct* %106, double** %107, i32 %108, i32 %109, i32 0)
ret i8* %110
}

LLVM IR (-O2):
%struct.asn_bstruct = type { i32 }
@stderr = global i32 0
@.str = [52 x i8] c"*** ERROR [%s:%d] - cannot allocate freq cols - %d\0A\00"
@.str.1 = [183 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/uwbmrb/BMRB-API/refs/heads/master/server/wsgi/bmrbapi/submodules/fasta36/src/pssm_asn_subs.c\00"
@.str.2 = [53 x i8] c"*** ERROR [%s:%d] - cannot allocate wfreq cols - %d\0A\00"
@.str.3 = [64 x i8] c"*** ERROR [%s:%d] - cannot allocate freq rows * cols - %d * %d\0A\00"
define i8* @get_pssm2_intermed(%struct.asn_bstruct* %0, double*** nocapture writeonly %1, double*** nocapture writeonly %2, i32 %3, i32 %4) {
%6 = tail call i64 @calloc(i32 %4, i32 8)
%7 = inttoptr i64 %6 to double**
%8 = inttoptr i64 %6 to i8*
%9 = icmp eq i64 %6, 0
br i1 %9, label %10, label %14
10: ; preds = %5
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1407, i32 %4)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %5
%15 = tail call i64 @calloc(i32 %4, i32 8)
%16 = inttoptr i64 %15 to double**
%17 = inttoptr i64 %15 to i8*
%18 = icmp eq i64 %15, 0
br i1 %18, label %19, label %23
19: ; preds = %14
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1412, i32 %4)
%22 = tail call i32 @exit(i32 1)
unreachable
23: ; preds = %14
%24 = mul nsw i32 %4, %3
%25 = tail call i64 @calloc(i32 %24, i32 8)
%26 = inttoptr i64 %25 to double*
store double* %26, double** %7
%27 = icmp eq i64 %25, 0
br i1 %27, label %28, label %32
28: ; preds = %23
%29 = load i32, i32* @stderr
%30 = tail call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %29, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1417, i32 %3, i32 %4)
%31 = tail call i32 @exit(i32 1)
unreachable
32: ; preds = %23
%33 = tail call i64 @calloc(i32 %24, i32 8)
%34 = inttoptr i64 %33 to double*
store double* %34, double** %16
%35 = icmp eq i64 %33, 0
br i1 %35, label %87, label %36
36: ; preds = %32
%37 = icmp sgt i32 %4, 1
br i1 %37, label %38, label %148
38: ; preds = %36
%39 = sext i32 %3 to i64
%40 = zext i32 %4 to i64
%41 = getelementptr double*, double** %7, i64 %40
%42 = bitcast double** %41 to i8*
%43 = getelementptr double*, double** %16, i64 %40
%44 = bitcast double** %43 to i8*
%45 = icmp ult i8* %8, %44
%46 = icmp ult i8* %17, %42
%47 = and i1 %45, %46
br i1 %47, label %48, label %78
48: ; preds = %38
%49 = add nsw i64 %40, -1
%50 = and i64 %49, 1
%51 = icmp eq i32 %4, 2
br i1 %51, label %118, label %52
52: ; preds = %48
%53 = and i64 %49, -2
br label %54
54: ; preds = %54, %52
%55 = phi i64 [ 1, %52 ], [ %75, %54 ]
%56 = phi i64 [ 0, %52 ], [ %76, %54 ]
%57 = add nsw i64 %55, -1
%58 = getelementptr inbounds double*, double** %7, i64 %57
%59 = load double*, double** %58
%60 = getelementptr inbounds double, double* %59, i64 %39
%61 = getelementptr inbounds double*, double** %7, i64 %55
store double* %60, double** %61
%62 = getelementptr inbounds double*, double** %16, i64 %57
%63 = load double*, double** %62
%64 = getelementptr inbounds double, double* %63, i64 %39
%65 = getelementptr inbounds double*, double** %16, i64 %55
store double* %64, double** %65
%66 = add nuw nsw i64 %55, 1
%67 = getelementptr inbounds double*, double** %7, i64 %55
%68 = load double*, double** %67
%69 = getelementptr inbounds double, double* %68, i64 %39
%70 = getelementptr inbounds double*, double** %7, i64 %66
store double* %69, double** %70
%71 = getelementptr inbounds double*, double** %16, i64 %55
%72 = load double*, double** %71
%73 = getelementptr inbounds double, double* %72, i64 %39
%74 = getelementptr inbounds double*, double** %16, i64 %66
store double* %73, double** %74
%75 = add nuw nsw i64 %55, 2
%76 = add nuw i64 %56, 2
%77 = icmp eq i64 %76, %53
br i1 %77, label %118, label %54
78: ; preds = %38
%79 = load double*, double** %7
%80 = load double*, double** %16
%81 = add nsw i64 %40, -1
%82 = add nsw i64 %40, -2
%83 = and i64 %81, 3
%84 = icmp ult i64 %82, 3
br i1 %84, label %131, label %85
85: ; preds = %78
%86 = and i64 %81, -4
br label %91
87: ; preds = %32
%88 = load i32, i32* @stderr
%89 = tail call i32 (i32, i8*, i8*, i32, i32, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([183 x i8], [183 x i8]* @.str.1, i64 0, i64 0), i32 1422, i32 %3, i32 %4)
%90 = tail call i32 @exit(i32 1)
unreachable
91: ; preds = %91, %85
%92 = phi double* [ %80, %85 ], [ %113, %91 ]
%93 = phi double* [ %79, %85 ], [ %111, %91 ]
%94 = phi i64 [ 1, %85 ], [ %115, %91 ]
%95 = phi i64 [ 0, %85 ], [ %116, %91 ]
%96 = getelementptr inbounds double, double* %93, i64 %39
%97 = getelementptr inbounds double*, double** %7, i64 %94
store double* %96, double** %97
%98 = getelementptr inbounds double, double* %92, i64 %39
%99 = getelementptr inbounds double*, double** %16, i64 %94
store double* %98, double** %99
%100 = add nuw nsw i64 %94, 1
%101 = getelementptr inbounds double, double* %96, i64 %39
%102 = getelementptr inbounds double*, double** %7, i64 %100
store double* %101, double** %102
%103 = getelementptr inbounds double, double* %98, i64 %39
%104 = getelementptr inbounds double*, double** %16, i64 %100
store double* %103, double** %104
%105 = add nuw nsw i64 %94, 2
%106 = getelementptr inbounds double, double* %101, i64 %39
%107 = getelementptr inbounds double*, double** %7, i64 %105
store double* %106, double** %107
%108 = getelementptr inbounds double, double* %103, i64 %39
%109 = getelementptr inbounds double*, double** %16, i64 %105
store double* %108, double** %109
%110 = add nuw nsw i64 %94, 3
%111 = getelementptr inbounds double, double* %106, i64 %39
%112 = getelementptr inbounds double*, double** %7, i64 %110
store double* %111, double** %112
%113 = getelementptr inbounds double, double* %108, i64 %39
%114 = getelementptr inbounds double*, double** %16, i64 %110
store double* %113, double** %114
%115 = add nuw nsw i64 %94, 4
%116 = add i64 %95, 4
%117 = icmp eq i64 %116, %86
br i1 %117, label %131, label %91
118: ; preds = %54, %48
%119 = phi i64 [ 1, %48 ], [ %75, %54 ]
%120 = icmp eq i64 %50, 0
br i1 %120, label %148, label %121
121: ; preds = %118
%122 = add nsw i64 %119, -1
%123 = getelementptr inbounds double*, double** %7, i64 %122
%124 = load double*, double** %123
%125 = getelementptr inbounds double, double* %124, i64 %39
%126 = getelementptr inbounds double*, double** %7, i64 %119
store double* %125, double** %126
%127 = getelementptr inbounds double*, double** %16, i64 %122
%128 = load double*, double** %127
%129 = getelementptr inbounds double, double* %128, i64 %39
%130 = getelementptr inbounds double*, double** %16, i64 %119
store double* %129, double** %130
br label %148
131: ; preds = %91, %78
%132 = phi double* [ %80, %78 ], [ %113, %91 ]
%133 = phi double* [ %79, %78 ], [ %111, %91 ]
%134 = phi i64 [ 1, %78 ], [ %115, %91 ]
%135 = icmp eq i64 %83, 0
br i1 %135, label %148, label %136
136: ; preds = %131, %136
%137 = phi double* [ %143, %136 ], [ %132, %131 ]
%138 = phi double* [ %141, %136 ], [ %133, %131 ]
%139 = phi i64 [ %145, %136 ], [ %134, %131 ]
%140 = phi i64 [ %146, %136 ], [ 0, %131 ]
%141 = getelementptr inbounds double, double* %138, i64 %39
%142 = getelementptr inbounds double*, double** %7, i64 %139
store double* %141, double** %142
%143 = getelementptr inbounds double, double* %137, i64 %39
%144 = getelementptr inbounds double*, double** %16, i64 %139
store double* %143, double** %144
%145 = add nuw nsw i64 %139, 1
%146 = add i64 %140, 1
%147 = icmp eq i64 %146, %83
br i1 %147, label %148, label %136
148: ; preds = %131, %136, %121, %118, %36
store double** %16, double*** %1
store double** %7, double*** %2
%149 = tail call i32 @chk_asn_buf(%struct.asn_bstruct* %0, i32 16)
%150 = tail call i8* @get_pssm_freqs(%struct.asn_bstruct* %0, double** %7, i32 %3, i32 %4, i32 0)
ret i8* %150
}