#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*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ free(char *);
char *get_line(int /*<<< orphan*/ *);
int sscanf(char *, char *, float *, float *, float *, float *, float *,
           float *);
scalar_t__ vrna_alloc(int);
float **readribosum(char *name) {
  float **dm;
  char *line;
  FILE *fp;
  int i = 0;
  int who = 0;
  float a, b, c, d, e, f;
  int translator[7] = {0, 5, 1, 2, 3, 6, 4};
  fp = fopen(name, "r");
  dm = (float **)vrna_alloc(7 * sizeof(float *));
  for (i = 0; i < 7; i++) {
    dm[i] = (float *)vrna_alloc(7 * sizeof(float));
  }
  while (1) {
    line = get_line(fp);
    if (*line == '#')
      continue;
    i = 0;
    i = sscanf(line, "%f %f %f %f %f %f", &a, &b, &c, &d, &e, &f);
    if (i == 0)
      break;
    dm[translator[++who]][translator[1]] = a;
    dm[translator[who]][translator[2]] = b;
    dm[translator[who]][translator[3]] = c;
    dm[translator[who]][translator[4]] = d;
    dm[translator[who]][translator[5]] = e;
    dm[translator[who]][translator[6]] = f;
    free(line);
    if (who == 6)
      break;
  }
  fclose(fp);
  return dm;
}


x86 assembly (clang, -O0):
<readribosum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    0xe7f(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xe7c(%rip),%rax
mov    %rax,-0x58(%rbp)
mov    0xe79(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xe77(%rip),%eax
mov    %eax,-0x48(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe6d(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x20(%rbp)
mov    $0x38,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x7,-0x24(%rbp)
jge    11fe <readribosum+0x9e>
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,%rdx
mov    -0x10(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11cd <readribosum+0x6d>
jmp    1203 <readribosum+0xa3>
mov    -0x20(%rbp),%rdi
call   1040 <get_line@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1225 <readribosum+0xc5>
jmp    1203 <readribosum+0xa3>
movl   $0x0,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
lea    0xde7(%rip),%rsi
lea    -0x2c(%rbp),%rdx
lea    -0x30(%rbp),%rcx
lea    -0x34(%rbp),%r8
lea    -0x38(%rbp),%r9
lea    -0x3c(%rbp),%r10
lea    -0x40(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1060 <sscanf@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jne    126f <readribosum+0x10f>
jmp    134e <readribosum+0x1ee>
movss  -0x2c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
mov    -0x28(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,-0x28(%rbp)
movslq %ecx,%rcx
movslq -0x60(%rbp,%rcx,4),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x5c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x30(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq -0x60(%rbp,%rcx,4),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x58(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x34(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq -0x60(%rbp,%rcx,4),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x54(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x38(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq -0x60(%rbp,%rcx,4),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x50(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x3c(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq -0x60(%rbp,%rcx,4),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x4c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x40(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x28(%rbp),%rcx
movslq -0x60(%rbp,%rcx,4),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x48(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
cmpl   $0x6,-0x28(%rbp)
jne    1349 <readribosum+0x1e9>
jmp    134e <readribosum+0x1ee>
jmp    1203 <readribosum+0xa3>
mov    -0x20(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readribosum>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xea7(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
mov    $0x38,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,%r14
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,(%r14)
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,0x8(%r14)
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,0x10(%r14)
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,0x18(%r14)
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,0x20(%r14)
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,0x28(%r14)
mov    $0x1c,%edi
call   1070 <vrna_alloc@plt>
mov    %rax,0x30(%r14)
xor    %r13d,%r13d
lea    0xc(%rsp),%rbp
lea    0x8(%rsp),%r15
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1040 <get_line@plt>
cmpb   $0x23,(%rax)
je     1200 <readribosum+0xa0>
mov    %rax,%r12
mov    %rax,%rdi
lea    0xe04(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x10(%rsp),%rcx
mov    %rbp,%r8
mov    %r15,%r9
mov    %rsp,%rax
push   %rax
lea    0xc(%rsp),%rax
push   %rax
call   1060 <sscanf@plt>
add    $0x10,%rsp
test   %eax,%eax
je     12a8 <readribosum+0x148>
movss  0x14(%rsp),%xmm0
lea    0xdb2(%rip),%rax
movslq 0x4(%rax,%r13,4),%rax
add    $0x1,%r13
mov    (%r14,%rax,8),%rax
movss  %xmm0,0x14(%rax)
movss  0x10(%rsp),%xmm0
movss  %xmm0,0x4(%rax)
movss  0xc(%rsp),%xmm0
movss  %xmm0,0x8(%rax)
movss  0x8(%rsp),%xmm0
movss  %xmm0,0xc(%rax)
movss  0x4(%rsp),%xmm0
movss  %xmm0,0x18(%rax)
movss  (%rsp),%xmm0
movss  %xmm0,0x10(%rax)
mov    %r12,%rdi
call   1030 <free@plt>
cmp    $0x6,%r13
jne    1200 <readribosum+0xa0>
mov    %rbx,%rdi
call   1050 <fclose@plt>
mov    %r14,%rax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.readribosum.translator = [7 x i32] [i32 0, i32 5, i32 1, i32 2, i32 3, i32 6, i32 4]
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"%f %f %f %f %f %f\00"
define float** @readribosum(i8* %0) {
%2 = alloca i8*
%3 = alloca float**
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = alloca float
%14 = alloca [7 x i32]
store i8* %0, i8** %2
store i32 0, i32* %6
store i32 0, i32* %7
%15 = bitcast [7 x i32]* %14 to i8*
%16 = load i8*, i8** %2
%17 = call i32* @fopen(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %17, i32** %5
%18 = call i64 @vrna_alloc(i32 56)
%19 = inttoptr i64 %18 to float**
store float** %19, float*** %3
store i32 0, i32* %6
br label %20
20: ; preds = %30, %1
%21 = load i32, i32* %6
%22 = icmp slt i32 %21, 7
br i1 %22, label %23, label %33
23: ; preds = %20
%24 = call i64 @vrna_alloc(i32 28)
%25 = inttoptr i64 %24 to float*
%26 = load float**, float*** %3
%27 = load i32, i32* %6
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds float*, float** %26, i64 %28
store float* %25, float** %29
br label %30
30: ; preds = %23
%31 = load i32, i32* %6
%32 = add nsw i32 %31, 1
store i32 %32, i32* %6
br label %20
33: ; preds = %20
br label %34
34: ; preds = %33, %41, %133
%35 = load i32*, i32** %5
%36 = call i8* @get_line(i32* %35)
store i8* %36, i8** %4
%37 = load i8*, i8** %4
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 35
br i1 %40, label %41, label %42
41: ; preds = %34
br label %34
42: ; preds = %34
store i32 0, i32* %6
%43 = load i8*, i8** %4
%44 = call i32 @sscanf(i8* %43, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float* %8, float* %9, float* %10, float* %11, float* %12, float* %13)
store i32 %44, i32* %6
%45 = load i32, i32* %6
%46 = icmp eq i32 %45, 0
br i1 %46, label %47, label %48
47: ; preds = %42
br label %134
48: ; preds = %42
%49 = load float, float* %8
%50 = load float**, float*** %3
%51 = load i32, i32* %7
%52 = add nsw i32 %51, 1
store i32 %52, i32* %7
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 %53
%55 = load i32, i32* %54
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds float*, float** %50, i64 %56
%58 = load float*, float** %57
%59 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 1
%60 = load i32, i32* %59
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds float, float* %58, i64 %61
store float %49, float* %62
%63 = load float, float* %9
%64 = load float**, float*** %3
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 %66
%68 = load i32, i32* %67
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds float*, float** %64, i64 %69
%71 = load float*, float** %70
%72 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 2
%73 = load i32, i32* %72
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds float, float* %71, i64 %74
store float %63, float* %75
%76 = load float, float* %10
%77 = load float**, float*** %3
%78 = load i32, i32* %7
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 %79
%81 = load i32, i32* %80
%82 = sext i32 %81 to i64
%83 = getelementptr inbounds float*, float** %77, i64 %82
%84 = load float*, float** %83
%85 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 3
%86 = load i32, i32* %85
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds float, float* %84, i64 %87
store float %76, float* %88
%89 = load float, float* %11
%90 = load float**, float*** %3
%91 = load i32, i32* %7
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 %92
%94 = load i32, i32* %93
%95 = sext i32 %94 to i64
%96 = getelementptr inbounds float*, float** %90, i64 %95
%97 = load float*, float** %96
%98 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 4
%99 = load i32, i32* %98
%100 = sext i32 %99 to i64
%101 = getelementptr inbounds float, float* %97, i64 %100
store float %89, float* %101
%102 = load float, float* %12
%103 = load float**, float*** %3
%104 = load i32, i32* %7
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 %105
%107 = load i32, i32* %106
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds float*, float** %103, i64 %108
%110 = load float*, float** %109
%111 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 5
%112 = load i32, i32* %111
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds float, float* %110, i64 %113
store float %102, float* %114
%115 = load float, float* %13
%116 = load float**, float*** %3
%117 = load i32, i32* %7
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 %118
%120 = load i32, i32* %119
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds float*, float** %116, i64 %121
%123 = load float*, float** %122
%124 = getelementptr inbounds [7 x i32], [7 x i32]* %14, i64 0, i64 6
%125 = load i32, i32* %124
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds float, float* %123, i64 %126
store float %115, float* %127
%128 = load i8*, i8** %4
%129 = call i32 @free(i8* %128)
%130 = load i32, i32* %7
%131 = icmp eq i32 %130, 6
br i1 %131, label %132, label %133
132: ; preds = %48
br label %134
133: ; preds = %48
br label %34
134: ; preds = %132, %47
%135 = load i32*, i32** %5
%136 = call i32 @fclose(i32* %135)
%137 = load float**, float*** %3
ret float** %137
}

LLVM IR (-O2):
@__const.readribosum.translator = [7 x i32] [i32 0, i32 5, i32 1, i32 2, i32 3, i32 6, i32 4]
@.str = [2 x i8] c"r\00"
@.str.1 = [18 x i8] c"%f %f %f %f %f %f\00"
define float** @readribosum(i8* nocapture %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = bitcast float* %2 to i8*
%9 = bitcast float* %3 to i8*
%10 = bitcast float* %4 to i8*
%11 = bitcast float* %5 to i8*
%12 = bitcast float* %6 to i8*
%13 = bitcast float* %7 to i8*
%14 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = tail call i64 @vrna_alloc(i32 56)
%16 = inttoptr i64 %15 to float**
%17 = tail call i64 @vrna_alloc(i32 28)
%18 = inttoptr i64 %17 to float*
store float* %18, float** %16
%19 = tail call i64 @vrna_alloc(i32 28)
%20 = inttoptr i64 %19 to float*
%21 = getelementptr inbounds float*, float** %16, i64 1
store float* %20, float** %21
%22 = tail call i64 @vrna_alloc(i32 28)
%23 = inttoptr i64 %22 to float*
%24 = getelementptr inbounds float*, float** %16, i64 2
store float* %23, float** %24
%25 = tail call i64 @vrna_alloc(i32 28)
%26 = inttoptr i64 %25 to float*
%27 = getelementptr inbounds float*, float** %16, i64 3
store float* %26, float** %27
%28 = tail call i64 @vrna_alloc(i32 28)
%29 = inttoptr i64 %28 to float*
%30 = getelementptr inbounds float*, float** %16, i64 4
store float* %29, float** %30
%31 = tail call i64 @vrna_alloc(i32 28)
%32 = inttoptr i64 %31 to float*
%33 = getelementptr inbounds float*, float** %16, i64 5
store float* %32, float** %33
%34 = tail call i64 @vrna_alloc(i32 28)
%35 = inttoptr i64 %34 to float*
%36 = getelementptr inbounds float*, float** %16, i64 6
store float* %35, float** %36
br label %65
37: ; preds = %65, %37
%38 = call i8* @get_line(i32* %14)
%39 = load i8, i8* %38
%40 = icmp eq i8 %39, 35
br i1 %40, label %37, label %41
41: ; preds = %37
%42 = call i32 @sscanf(i8* %38, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), float* %2, float* %3, float* %4, float* %5, float* %6, float* %7)
%43 = icmp eq i32 %42, 0
br i1 %43, label %67, label %44
44: ; preds = %41
%45 = load float, float* %2
%46 = add nuw nsw i64 %66, 1
%47 = getelementptr inbounds [7 x i32], [7 x i32]* @__const.readribosum.translator, i64 0, i64 %46
%48 = load i32, i32* %47
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float*, float** %16, i64 %49
%51 = load float*, float** %50
%52 = getelementptr inbounds float, float* %51, i64 5
store float %45, float* %52
%53 = load float, float* %3
%54 = getelementptr inbounds float, float* %51, i64 1
store float %53, float* %54
%55 = load float, float* %4
%56 = getelementptr inbounds float, float* %51, i64 2
store float %55, float* %56
%57 = load float, float* %5
%58 = getelementptr inbounds float, float* %51, i64 3
store float %57, float* %58
%59 = load float, float* %6
%60 = getelementptr inbounds float, float* %51, i64 6
store float %59, float* %60
%61 = load float, float* %7
%62 = getelementptr inbounds float, float* %51, i64 4
store float %61, float* %62
%63 = call i32 @free(i8* %38)
%64 = icmp eq i64 %46, 6
br i1 %64, label %67, label %65
65: ; preds = %1, %44
%66 = phi i64 [ 0, %1 ], [ %46, %44 ]
br label %37
67: ; preds = %44, %41
%68 = call i32 @fclose(i32* %14)
ret float** %16
}