#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 const *, char *);
int /*<<< orphan*/ free(char *);
char *get_line(int /*<<< orphan*/ *);
scalar_t__ isspace(char);
int sscanf(char *, char *, ...);
int /*<<< orphan*/ vrna_message_warning(char *);
int vrna_file_SHAPE_read(const char *file_name, int length,
                         double default_value, char *sequence, double *values) {
  FILE *fp;
  char *line;
  int i;
  int count = 0;
  if (!file_name)
    return 0;
  if (!(fp = fopen(file_name, "r"))) {
    vrna_message_warning("SHAPE data file could not be opened");
    return 0;
  }
  for (i = 0; i < length; ++i) {
    sequence[i] = 'N';
    values[i + 1] = default_value;
  }
  sequence[length] = '\0';
  while ((line = get_line(fp))) {
    int position;
    unsigned char nucleotide = 'N';
    double reactivity = default_value;
    char *second_entry = 0;
    char *third_entry = 0;
    char *c;
    if (sscanf(line, "%d", &position) != 1) {
      free(line);
      continue;
    }
    if (position <= 0 || position > length) {
      vrna_message_warning("Provided SHAPE data outside of sequence scope");
      fclose(fp);
      free(line);
      return 0;
    }
    for (c = line + 1; *c; ++c) {
      if (isspace(*(c - 1)) && !isspace(*c)) {
        if (!second_entry) {
          second_entry = c;
        } else {
          third_entry = c;
          break;
        }
      }
    }
    if (second_entry) {
      if (third_entry) {
        sscanf(second_entry, "%c", &nucleotide);
        sscanf(third_entry, "%lf", &reactivity);
      } else if (sscanf(second_entry, "%lf", &reactivity) != 1)
        sscanf(second_entry, "%c", &nucleotide);
    }
    sequence[position - 1] = nucleotide;
    values[position] = reactivity;
    ++count;
    free(line);
  }
  fclose(fp);
  if (!count) {
    vrna_message_warning("SHAPE data file is empty");
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<vrna_file_SHAPE_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movsd  %xmm0,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
movl   $0x0,-0x48(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    11aa <vrna_file_SHAPE_read+0x3a>
movl   $0x0,-0x4(%rbp)
jmp    144c <vrna_file_SHAPE_read+0x2dc>
mov    -0x10(%rbp),%rdi
lea    0xe4b(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x38(%rbp)
cmp    $0x0,%rax
jne    11e0 <vrna_file_SHAPE_read+0x70>
lea    0xe33(%rip),%rdi
call   1080 <vrna_message_warning@plt>
movl   $0x0,-0x4(%rbp)
jmp    144c <vrna_file_SHAPE_read+0x2dc>
movl   $0x0,-0x44(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1224 <vrna_file_SHAPE_read+0xb4>
mov    -0x28(%rbp),%rax
movslq -0x44(%rbp),%rcx
movb   $0x4e,(%rax,%rcx,1)
movsd  -0x20(%rbp),%xmm0
mov    -0x30(%rbp),%rax
mov    -0x44(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    11e7 <vrna_file_SHAPE_read+0x77>
mov    -0x28(%rbp),%rax
movslq -0x14(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x38(%rbp),%rdi
call   1040 <get_line@plt>
mov    %rax,-0x40(%rbp)
cmp    $0x0,%rax
je     141a <vrna_file_SHAPE_read+0x2aa>
movb   $0x4e,-0x4d(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movq   $0x0,-0x60(%rbp)
movq   $0x0,-0x68(%rbp)
mov    -0x40(%rbp),%rdi
lea    0xdb6(%rip),%rsi
lea    -0x4c(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x1,%eax
je     1292 <vrna_file_SHAPE_read+0x122>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    1230 <vrna_file_SHAPE_read+0xc0>
cmpl   $0x0,-0x4c(%rbp)
jle    12a8 <vrna_file_SHAPE_read+0x138>
mov    -0x4c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jle    12d2 <vrna_file_SHAPE_read+0x162>
lea    0xd7a(%rip),%rdi
call   1080 <vrna_message_warning@plt>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
jmp    144c <vrna_file_SHAPE_read+0x2dc>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
mov    -0x70(%rbp),%rax
cmpb   $0x0,(%rax)
je     1358 <vrna_file_SHAPE_read+0x1e8>
mov    -0x70(%rbp),%rax
movsbl -0x1(%rax),%edi
call   1060 <isspace@plt>
cmp    $0x0,%rax
je     1342 <vrna_file_SHAPE_read+0x1d2>
mov    -0x70(%rbp),%rax
movsbl (%rax),%edi
call   1060 <isspace@plt>
cmp    $0x0,%rax
jne    1342 <vrna_file_SHAPE_read+0x1d2>
cmpq   $0x0,-0x60(%rbp)
jne    1330 <vrna_file_SHAPE_read+0x1c0>
mov    -0x70(%rbp),%rax
mov    %rax,-0x60(%rbp)
jmp    133d <vrna_file_SHAPE_read+0x1cd>
mov    -0x70(%rbp),%rax
mov    %rax,-0x68(%rbp)
jmp    1358 <vrna_file_SHAPE_read+0x1e8>
jmp    1342 <vrna_file_SHAPE_read+0x1d2>
jmp    1347 <vrna_file_SHAPE_read+0x1d7>
mov    -0x70(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x70(%rbp)
jmp    12de <vrna_file_SHAPE_read+0x16e>
cmpq   $0x0,-0x60(%rbp)
je     13de <vrna_file_SHAPE_read+0x26e>
cmpq   $0x0,-0x68(%rbp)
je     139f <vrna_file_SHAPE_read+0x22f>
mov    -0x60(%rbp),%rdi
lea    0xcde(%rip),%rsi
lea    -0x4d(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
mov    -0x68(%rbp),%rdi
lea    0xccb(%rip),%rsi
lea    -0x58(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
jmp    13d9 <vrna_file_SHAPE_read+0x269>
mov    -0x60(%rbp),%rdi
lea    0xcb0(%rip),%rsi
lea    -0x58(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmp    $0x1,%eax
je     13d4 <vrna_file_SHAPE_read+0x264>
mov    -0x60(%rbp),%rdi
lea    0xc8e(%rip),%rsi
lea    -0x4d(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
jmp    13d9 <vrna_file_SHAPE_read+0x269>
jmp    13de <vrna_file_SHAPE_read+0x26e>
mov    -0x4d(%rbp),%dl
mov    -0x28(%rbp),%rax
mov    -0x4c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %dl,(%rax,%rcx,1)
movsd  -0x58(%rbp),%xmm0
mov    -0x30(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
jmp    1230 <vrna_file_SHAPE_read+0xc0>
mov    -0x38(%rbp),%rdi
call   1050 <fclose@plt>
cmpl   $0x0,-0x48(%rbp)
jne    1445 <vrna_file_SHAPE_read+0x2d5>
lea    0xc2a(%rip),%rdi
call   1080 <vrna_message_warning@plt>
movl   $0x0,-0x4(%rbp)
jmp    144c <vrna_file_SHAPE_read+0x2dc>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vrna_file_SHAPE_read>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
xor    %ebp,%ebp
test   %rdi,%rdi
je     1537 <vrna_file_SHAPE_read+0x3c7>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %esi,%r12d
movaps %xmm0,0x30(%rsp)
lea    0xe62(%rip),%rsi
call   1090 <fopen@plt>
test   %rax,%rax
je     1261 <vrna_file_SHAPE_read+0xf1>
mov    %rax,%r13
test   %r12d,%r12d
movaps 0x30(%rsp),%xmm1
jle    1352 <vrna_file_SHAPE_read+0x1e2>
mov    %r12d,%eax
cmp    $0x4,%r12d
jb     11e8 <vrna_file_SHAPE_read+0x78>
lea    (%r14,%rax,8),%rcx
add    $0x8,%rcx
cmp    %r15,%rcx
jbe    1272 <vrna_file_SHAPE_read+0x102>
lea    (%r15,%rax,1),%rcx
lea    0x8(%r14),%rdx
cmp    %rdx,%rcx
jbe    1272 <vrna_file_SHAPE_read+0x102>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
mov    %rax,%rsi
and    $0x3,%rsi
je     1216 <vrna_file_SHAPE_read+0xa6>
nopl   0x0(%rax)
movb   $0x4e,(%r15,%rcx,1)
movsd  %xmm1,0x8(%r14,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1200 <vrna_file_SHAPE_read+0x90>
cmp    $0x3,%rdx
jb     1352 <vrna_file_SHAPE_read+0x1e2>
movb   $0x4e,(%r15,%rcx,1)
movsd  %xmm1,0x8(%r14,%rcx,8)
movb   $0x4e,0x1(%r15,%rcx,1)
movsd  %xmm1,0x10(%r14,%rcx,8)
movb   $0x4e,0x2(%r15,%rcx,1)
movsd  %xmm1,0x18(%r14,%rcx,8)
movb   $0x4e,0x3(%r15,%rcx,1)
movsd  %xmm1,0x20(%r14,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1220 <vrna_file_SHAPE_read+0xb0>
jmp    1352 <vrna_file_SHAPE_read+0x1e2>
lea    0xd9a(%rip),%rdi
call   1080 <vrna_message_warning@plt>
jmp    1537 <vrna_file_SHAPE_read+0x3c7>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
movaps %xmm1,%xmm0
movlhps %xmm1,%xmm0
lea    -0x4(%rcx),%rsi
mov    %rsi,%rdi
shr    $0x2,%rdi
add    $0x1,%rdi
mov    %edi,%edx
and    $0x3,%edx
cmp    $0xc,%rsi
jae    129b <vrna_file_SHAPE_read+0x12b>
xor    %esi,%esi
jmp    130d <vrna_file_SHAPE_read+0x19d>
and    $0xfffffffffffffffc,%rdi
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movl   $0x4e4e4e4e,(%r15,%rsi,1)
4e
movups %xmm0,0x8(%r14,%rsi,8)
movups %xmm0,0x18(%r14,%rsi,8)
movl   $0x4e4e4e4e,0x4(%r15,%rsi,1)
4e 4e
movups %xmm0,0x28(%r14,%rsi,8)
movups %xmm0,0x38(%r14,%rsi,8)
movl   $0x4e4e4e4e,0x8(%r15,%rsi,1)
4e 4e
movups %xmm0,0x48(%r14,%rsi,8)
movups %xmm0,0x58(%r14,%rsi,8)
movl   $0x4e4e4e4e,0xc(%r15,%rsi,1)
4e 4e
movups %xmm0,0x68(%r14,%rsi,8)
movups %xmm0,0x78(%r14,%rsi,8)
add    $0x10,%rsi
add    $0xfffffffffffffffc,%rdi
jne    12b0 <vrna_file_SHAPE_read+0x140>
test   %rdx,%rdx
je     1349 <vrna_file_SHAPE_read+0x1d9>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movl   $0x4e4e4e4e,(%r15,%rsi,1)
4e
lea    0x0(,%rsi,8),%rdi
or     $0x8,%rdi
movups %xmm0,(%r14,%rdi,1)
movups %xmm0,0x10(%r14,%rdi,1)
add    $0x4,%rsi
add    $0xffffffffffffffff,%rdx
jne    1320 <vrna_file_SHAPE_read+0x1b0>
cmp    %rax,%rcx
jne    11ea <vrna_file_SHAPE_read+0x7a>
movslq %r12d,%rax
movb   $0x0,(%r15,%rax,1)
mov    %r13,%rdi
call   1040 <get_line@plt>
test   %rax,%rax
je     1503 <vrna_file_SHAPE_read+0x393>
mov    %rax,%rbp
lea    0xcb1(%rip),%rbx
movl   $0x0,0x10(%rsp)
mov    %r12d,0xc(%rsp)
mov    %r13,0x20(%rsp)
mov    %r15,0x28(%rsp)
jmp    13d0 <vrna_file_SHAPE_read+0x260>
xchg   %ax,%ax
mov    0xb(%rsp),%al
movslq 0x14(%rsp),%rcx
mov    0x28(%rsp),%r15
mov    %al,-0x1(%rcx,%r15,1)
movsd  0x18(%rsp),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
addl   $0x1,0x10(%rsp)
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r13,%rdi
call   1040 <get_line@plt>
mov    %rax,%rbp
test   %rax,%rax
je     14ed <vrna_file_SHAPE_read+0x37d>
movb   $0x4e,0xb(%rsp)
movaps 0x30(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %rbp,%rdi
mov    %rbx,%rsi
lea    0x14(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x1,%eax
jne    13b4 <vrna_file_SHAPE_read+0x244>
mov    0x14(%rsp),%eax
test   %eax,%eax
jle    1519 <vrna_file_SHAPE_read+0x3a9>
cmp    %r12d,%eax
jg     1519 <vrna_file_SHAPE_read+0x3a9>
cmpb   $0x0,0x1(%rbp)
je     1390 <vrna_file_SHAPE_read+0x220>
lea    0x1(%rbp),%r13
xor    %r15d,%r15d
jmp    142e <vrna_file_SHAPE_read+0x2be>
nop
mov    %r12,%r15
cmpb   $0x0,0x1(%r13)
lea    0x1(%r13),%r13
je     14a0 <vrna_file_SHAPE_read+0x330>
mov    %r15,%r12
movsbl -0x1(%r13),%edi
call   1060 <isspace@plt>
test   %rax,%rax
je     1420 <vrna_file_SHAPE_read+0x2b0>
movsbl 0x0(%r13),%edi
call   1060 <isspace@plt>
test   %rax,%rax
jne    1420 <vrna_file_SHAPE_read+0x2b0>
mov    %r13,%r15
test   %r12,%r12
je     1423 <vrna_file_SHAPE_read+0x2b3>
mov    %r12,%rdi
lea    0xbf6(%rip),%rsi
lea    0xb(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    %r13,%rdi
lea    0xbe3(%rip),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
mov    0xc(%rsp),%r12d
mov    0x20(%rsp),%r13
jmp    1390 <vrna_file_SHAPE_read+0x220>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
test   %r15,%r15
mov    0xc(%rsp),%r12d
mov    0x20(%rsp),%r13
je     1390 <vrna_file_SHAPE_read+0x220>
mov    %r15,%rdi
lea    0xb9d(%rip),%rsi
lea    0x18(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
cmp    $0x1,%eax
je     1390 <vrna_file_SHAPE_read+0x220>
mov    %r15,%rdi
lea    0xb7b(%rip),%rsi
lea    0xb(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
jmp    1390 <vrna_file_SHAPE_read+0x220>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    $0x1,%ebp
cmpl   $0x0,0x10(%rsp)
jne    1537 <vrna_file_SHAPE_read+0x3c7>
jmp    150b <vrna_file_SHAPE_read+0x39b>
mov    %r13,%rdi
call   1050 <fclose@plt>
lea    0xb4c(%rip),%rdi
call   1080 <vrna_message_warning@plt>
jmp    1535 <vrna_file_SHAPE_read+0x3c5>
lea    0xb09(%rip),%rdi
call   1080 <vrna_message_warning@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [2 x i8] c"r\00"
@.str.1 = [36 x i8] c"SHAPE data file could not be opened\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [46 x i8] c"Provided SHAPE data outside of sequence scope\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [4 x i8] c"%lf\00"
@.str.6 = [25 x i8] c"SHAPE data file is empty\00"
define i32 @vrna_file_SHAPE_read(i8* %0, i32 %1, double %2, i8* %3, double* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca double
%10 = alloca i8*
%11 = alloca double*
%12 = alloca i32*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i8
%18 = alloca double
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
store i8* %0, i8** %7
store i32 %1, i32* %8
store double %2, double* %9
store i8* %3, i8** %10
store double* %4, double** %11
store i32 0, i32* %15
%22 = load i8*, i8** %7
%23 = icmp ne i8* %22, null
br i1 %23, label %25, label %24
24: ; preds = %5
store i32 0, i32* %6
br label %154
25: ; preds = %5
%26 = load i8*, i8** %7
%27 = call i32* @fopen(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %27, i32** %12
%28 = icmp ne i32* %27, null
br i1 %28, label %31, label %29
29: ; preds = %25
%30 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
store i32 0, i32* %6
br label %154
31: ; preds = %25
store i32 0, i32* %14
br label %32
32: ; preds = %47, %31
%33 = load i32, i32* %14
%34 = load i32, i32* %8
%35 = icmp slt i32 %33, %34
br i1 %35, label %36, label %50
36: ; preds = %32
%37 = load i8*, i8** %10
%38 = load i32, i32* %14
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds i8, i8* %37, i64 %39
store i8 78, i8* %40
%41 = load double, double* %9
%42 = load double*, double** %11
%43 = load i32, i32* %14
%44 = add nsw i32 %43, 1
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds double, double* %42, i64 %45
store double %41, double* %46
br label %47
47: ; preds = %36
%48 = load i32, i32* %14
%49 = add nsw i32 %48, 1
store i32 %49, i32* %14
br label %32
50: ; preds = %32
%51 = load i8*, i8** %10
%52 = load i32, i32* %8
%53 = sext i32 %52 to i64
%54 = getelementptr inbounds i8, i8* %51, i64 %53
store i8 0, i8* %54
br label %55
55: ; preds = %130, %64, %50
%56 = load i32*, i32** %12
%57 = call i8* @get_line(i32* %56)
store i8* %57, i8** %13
%58 = icmp ne i8* %57, null
br i1 %58, label %59, label %146
59: ; preds = %55
store i8 78, i8* %17
%60 = load double, double* %9
store double %60, double* %18
store i8* null, i8** %19
store i8* null, i8** %20
%61 = load i8*, i8** %13
%62 = call i32 (i8*, i8*, ...) @sscanf(i8* %61, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %16)
%63 = icmp ne i32 %62, 1
br i1 %63, label %64, label %67
64: ; preds = %59
%65 = load i8*, i8** %13
%66 = call i32 @free(i8* %65)
br label %55
67: ; preds = %59
%68 = load i32, i32* %16
%69 = icmp sle i32 %68, 0
br i1 %69, label %74, label %70
70: ; preds = %67
%71 = load i32, i32* %16
%72 = load i32, i32* %8
%73 = icmp sgt i32 %71, %72
br i1 %73, label %74, label %80
74: ; preds = %70, %67
%75 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%76 = load i32*, i32** %12
%77 = call i32 @fclose(i32* %76)
%78 = load i8*, i8** %13
%79 = call i32 @free(i8* %78)
store i32 0, i32* %6
br label %154
80: ; preds = %70
%81 = load i8*, i8** %13
%82 = getelementptr inbounds i8, i8* %81, i64 1
store i8* %82, i8** %21
br label %83
83: ; preds = %107, %80
%84 = load i8*, i8** %21
%85 = load i8, i8* %84
%86 = icmp ne i8 %85, 0
br i1 %86, label %87, label %110
87: ; preds = %83
%88 = load i8*, i8** %21
%89 = getelementptr inbounds i8, i8* %88, i64 -1
%90 = load i8, i8* %89
%91 = call i64 @isspace(i8 signext %90)
%92 = icmp ne i64 %91, 0
br i1 %92, label %93, label %106
93: ; preds = %87
%94 = load i8*, i8** %21
%95 = load i8, i8* %94
%96 = call i64 @isspace(i8 signext %95)
%97 = icmp ne i64 %96, 0
br i1 %97, label %106, label %98
98: ; preds = %93
%99 = load i8*, i8** %19
%100 = icmp ne i8* %99, null
br i1 %100, label %103, label %101
101: ; preds = %98
%102 = load i8*, i8** %21
store i8* %102, i8** %19
br label %105
103: ; preds = %98
%104 = load i8*, i8** %21
store i8* %104, i8** %20
br label %110
105: ; preds = %101
br label %106
106: ; preds = %105, %93, %87
br label %107
107: ; preds = %106
%108 = load i8*, i8** %21
%109 = getelementptr inbounds i8, i8* %108, i32 1
store i8* %109, i8** %21
br label %83
110: ; preds = %103, %83
%111 = load i8*, i8** %19
%112 = icmp ne i8* %111, null
br i1 %112, label %113, label %130
113: ; preds = %110
%114 = load i8*, i8** %20
%115 = icmp ne i8* %114, null
br i1 %115, label %116, label %121
116: ; preds = %113
%117 = load i8*, i8** %19
%118 = call i32 (i8*, i8*, ...) @sscanf(i8* %117, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %17)
%119 = load i8*, i8** %20
%120 = call i32 (i8*, i8*, ...) @sscanf(i8* %119, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %18)
br label %129
121: ; preds = %113
%122 = load i8*, i8** %19
%123 = call i32 (i8*, i8*, ...) @sscanf(i8* %122, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %18)
%124 = icmp ne i32 %123, 1
br i1 %124, label %125, label %128
125: ; preds = %121
%126 = load i8*, i8** %19
%127 = call i32 (i8*, i8*, ...) @sscanf(i8* %126, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %17)
br label %128
128: ; preds = %125, %121
br label %129
129: ; preds = %128, %116
br label %130
130: ; preds = %129, %110
%131 = load i8, i8* %17
%132 = load i8*, i8** %10
%133 = load i32, i32* %16
%134 = sub nsw i32 %133, 1
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds i8, i8* %132, i64 %135
store i8 %131, i8* %136
%137 = load double, double* %18
%138 = load double*, double** %11
%139 = load i32, i32* %16
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %138, i64 %140
store double %137, double* %141
%142 = load i32, i32* %15
%143 = add nsw i32 %142, 1
store i32 %143, i32* %15
%144 = load i8*, i8** %13
%145 = call i32 @free(i8* %144)
br label %55
146: ; preds = %55
%147 = load i32*, i32** %12
%148 = call i32 @fclose(i32* %147)
%149 = load i32, i32* %15
%150 = icmp ne i32 %149, 0
br i1 %150, label %153, label %151
151: ; preds = %146
%152 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
store i32 0, i32* %6
br label %154
153: ; preds = %146
store i32 1, i32* %6
br label %154
154: ; preds = %153, %151, %74, %29, %24
%155 = load i32, i32* %6
ret i32 %155
}

LLVM IR (-O2):
@.str = [2 x i8] c"r\00"
@.str.1 = [36 x i8] c"SHAPE data file could not be opened\00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [46 x i8] c"Provided SHAPE data outside of sequence scope\00"
@.str.4 = [3 x i8] c"%c\00"
@.str.5 = [4 x i8] c"%lf\00"
@.str.6 = [25 x i8] c"SHAPE data file is empty\00"
define i32 @vrna_file_SHAPE_read(i8* %0, i32 %1, double %2, i8* nocapture writeonly %3, double* nocapture writeonly %4) {
%6 = alloca i32
%7 = alloca i8
%8 = alloca double
%9 = icmp eq i8* %0, null
br i1 %9, label %216, label %10
10: ; preds = %5
%11 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i32* %11, null
br i1 %12, label %123, label %13
13: ; preds = %10
%14 = icmp sgt i32 %1, 0
br i1 %14, label %15, label %140
15: ; preds = %13
%16 = zext i32 %1 to i64
%17 = icmp ult i32 %1, 4
br i1 %17, label %106, label %18
18: ; preds = %15
%19 = getelementptr i8, i8* %3, i64 %16
%20 = getelementptr double, double* %4, i64 1
%21 = bitcast double* %20 to i8*
%22 = add nuw nsw i64 %16, 1
%23 = getelementptr double, double* %4, i64 %22
%24 = bitcast double* %23 to i8*
%25 = icmp ugt i8* %24, %3
%26 = icmp ugt i8* %19, %21
%27 = and i1 %25, %26
br i1 %27, label %106, label %28
28: ; preds = %18
%29 = and i64 %16, 4294967292
%30 = insertelement <2 x double> poison, double %2, i64 0
%31 = shufflevector <2 x double> %30, <2 x double> poison, <2 x i32> zeroinitializer
%32 = insertelement <2 x double> poison, double %2, i64 0
%33 = shufflevector <2 x double> %32, <2 x double> poison, <2 x i32> zeroinitializer
%34 = add nsw i64 %29, -4
%35 = lshr exact i64 %34, 2
%36 = add nuw nsw i64 %35, 1
%37 = and i64 %36, 3
%38 = icmp ult i64 %34, 12
br i1 %38, label %86, label %39
39: ; preds = %28
%40 = and i64 %36, 9223372036854775804
br label %41
41: ; preds = %41, %39
%42 = phi i64 [ 0, %39 ], [ %83, %41 ]
%43 = phi i64 [ 0, %39 ], [ %84, %41 ]
%44 = getelementptr inbounds i8, i8* %3, i64 %42
%45 = bitcast i8* %44 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %45
%46 = getelementptr inbounds i8, i8* %44, i64 2
%47 = bitcast i8* %46 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %47
%48 = or i64 %42, 1
%49 = getelementptr inbounds double, double* %4, i64 %48
%50 = bitcast double* %49 to <2 x double>*
store <2 x double> %31, <2 x double>* %50
%51 = getelementptr inbounds double, double* %49, i64 2
%52 = bitcast double* %51 to <2 x double>*
store <2 x double> %33, <2 x double>* %52
%53 = or i64 %42, 4
%54 = getelementptr inbounds i8, i8* %3, i64 %53
%55 = bitcast i8* %54 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %55
%56 = getelementptr inbounds i8, i8* %54, i64 2
%57 = bitcast i8* %56 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %57
%58 = or i64 %42, 5
%59 = getelementptr inbounds double, double* %4, i64 %58
%60 = bitcast double* %59 to <2 x double>*
store <2 x double> %31, <2 x double>* %60
%61 = getelementptr inbounds double, double* %59, i64 2
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %33, <2 x double>* %62
%63 = or i64 %42, 8
%64 = getelementptr inbounds i8, i8* %3, i64 %63
%65 = bitcast i8* %64 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %65
%66 = getelementptr inbounds i8, i8* %64, i64 2
%67 = bitcast i8* %66 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %67
%68 = or i64 %42, 9
%69 = getelementptr inbounds double, double* %4, i64 %68
%70 = bitcast double* %69 to <2 x double>*
store <2 x double> %31, <2 x double>* %70
%71 = getelementptr inbounds double, double* %69, i64 2
%72 = bitcast double* %71 to <2 x double>*
store <2 x double> %33, <2 x double>* %72
%73 = or i64 %42, 12
%74 = getelementptr inbounds i8, i8* %3, i64 %73
%75 = bitcast i8* %74 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %75
%76 = getelementptr inbounds i8, i8* %74, i64 2
%77 = bitcast i8* %76 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %77
%78 = or i64 %42, 13
%79 = getelementptr inbounds double, double* %4, i64 %78
%80 = bitcast double* %79 to <2 x double>*
store <2 x double> %31, <2 x double>* %80
%81 = getelementptr inbounds double, double* %79, i64 2
%82 = bitcast double* %81 to <2 x double>*
store <2 x double> %33, <2 x double>* %82
%83 = add nuw i64 %42, 16
%84 = add nuw i64 %43, 4
%85 = icmp eq i64 %84, %40
br i1 %85, label %86, label %41
86: ; preds = %41, %28
%87 = phi i64 [ 0, %28 ], [ %83, %41 ]
%88 = icmp eq i64 %37, 0
br i1 %88, label %104, label %89
89: ; preds = %86, %89
%90 = phi i64 [ %101, %89 ], [ %87, %86 ]
%91 = phi i64 [ %102, %89 ], [ 0, %86 ]
%92 = getelementptr inbounds i8, i8* %3, i64 %90
%93 = bitcast i8* %92 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %93
%94 = getelementptr inbounds i8, i8* %92, i64 2
%95 = bitcast i8* %94 to <2 x i8>*
store <2 x i8> <i8 78, i8 78>, <2 x i8>* %95
%96 = or i64 %90, 1
%97 = getelementptr inbounds double, double* %4, i64 %96
%98 = bitcast double* %97 to <2 x double>*
store <2 x double> %31, <2 x double>* %98
%99 = getelementptr inbounds double, double* %97, i64 2
%100 = bitcast double* %99 to <2 x double>*
store <2 x double> %33, <2 x double>* %100
%101 = add nuw i64 %90, 4
%102 = add i64 %91, 1
%103 = icmp eq i64 %102, %37
br i1 %103, label %104, label %89
104: ; preds = %89, %86
%105 = icmp eq i64 %29, %16
br i1 %105, label %140, label %106
106: ; preds = %18, %15, %104
%107 = phi i64 [ 0, %18 ], [ 0, %15 ], [ %29, %104 ]
%108 = xor i64 %107, -1
%109 = add nsw i64 %108, %16
%110 = and i64 %16, 3
%111 = icmp eq i64 %110, 0
br i1 %111, label %120, label %112
112: ; preds = %106, %112
%113 = phi i64 [ %116, %112 ], [ %107, %106 ]
%114 = phi i64 [ %118, %112 ], [ 0, %106 ]
%115 = getelementptr inbounds i8, i8* %3, i64 %113
store i8 78, i8* %115
%116 = add nuw nsw i64 %113, 1
%117 = getelementptr inbounds double, double* %4, i64 %116
store double %2, double* %117
%118 = add i64 %114, 1
%119 = icmp eq i64 %118, %110
br i1 %119, label %120, label %112
120: ; preds = %112, %106
%121 = phi i64 [ %107, %106 ], [ %116, %112 ]
%122 = icmp ult i64 %109, 3
br i1 %122, label %140, label %125
123: ; preds = %10
%124 = tail call i32 @vrna_message_warning(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.1, i64 0, i64 0))
br label %216
125: ; preds = %120, %125
%126 = phi i64 [ %137, %125 ], [ %121, %120 ]
%127 = getelementptr inbounds i8, i8* %3, i64 %126
store i8 78, i8* %127
%128 = add nuw nsw i64 %126, 1
%129 = getelementptr inbounds double, double* %4, i64 %128
store double %2, double* %129
%130 = getelementptr inbounds i8, i8* %3, i64 %128
store i8 78, i8* %130
%131 = add nuw nsw i64 %126, 2
%132 = getelementptr inbounds double, double* %4, i64 %131
store double %2, double* %132
%133 = getelementptr inbounds i8, i8* %3, i64 %131
store i8 78, i8* %133
%134 = add nuw nsw i64 %126, 3
%135 = getelementptr inbounds double, double* %4, i64 %134
store double %2, double* %135
%136 = getelementptr inbounds i8, i8* %3, i64 %134
store i8 78, i8* %136
%137 = add nuw nsw i64 %126, 4
%138 = getelementptr inbounds double, double* %4, i64 %137
store double %2, double* %138
%139 = icmp eq i64 %137, %16
br i1 %139, label %140, label %125
140: ; preds = %120, %125, %104, %13
%141 = sext i32 %1 to i64
%142 = getelementptr inbounds i8, i8* %3, i64 %141
store i8 0, i8* %142
%143 = call i8* @get_line(i32* %11)
%144 = icmp eq i8* %143, null
br i1 %144, label %145, label %147
145: ; preds = %140
%146 = call i32 @fclose(i32* %11)
br label %214
147: ; preds = %140
%148 = bitcast i32* %6 to i8*
%149 = bitcast double* %8 to i8*
br label %150
150: ; preds = %147, %206
%151 = phi i8* [ %143, %147 ], [ %209, %206 ]
%152 = phi i32 [ 0, %147 ], [ %207, %206 ]
store i8 78, i8* %7
store double %2, double* %8
%153 = call i32 (i8*, i8*, ...) @sscanf(i8* %151, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %6)
%154 = icmp eq i32 %153, 1
br i1 %154, label %155, label %206
155: ; preds = %150
%156 = load i32, i32* %6
%157 = icmp slt i32 %156, 1
%158 = icmp sgt i32 %156, %1
%159 = or i1 %157, %158
br i1 %159, label %164, label %160
160: ; preds = %155
%161 = getelementptr inbounds i8, i8* %151, i64 1
%162 = load i8, i8* %161
%163 = icmp eq i8 %162, 0
br i1 %163, label %196, label %168
164: ; preds = %155
%165 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.3, i64 0, i64 0))
%166 = call i32 @fclose(i32* %11)
%167 = call i32 @free(i8* %151)
br label %216
168: ; preds = %160, %181
%169 = phi i8* [ %183, %181 ], [ %161, %160 ]
%170 = phi i8* [ %169, %181 ], [ %151, %160 ]
%171 = phi i8* [ %182, %181 ], [ null, %160 ]
%172 = load i8, i8* %170
%173 = call i64 @isspace(i8 signext %172)
%174 = icmp eq i64 %173, 0
br i1 %174, label %181, label %175
175: ; preds = %168
%176 = load i8, i8* %169
%177 = call i64 @isspace(i8 signext %176)
%178 = icmp eq i64 %177, 0
br i1 %178, label %179, label %181
179: ; preds = %175
%180 = icmp eq i8* %171, null
br i1 %180, label %181, label %188
181: ; preds = %179, %168, %175
%182 = phi i8* [ %171, %175 ], [ %171, %168 ], [ %169, %179 ]
%183 = getelementptr inbounds i8, i8* %169, i64 1
%184 = load i8, i8* %183
%185 = icmp eq i8 %184, 0
br i1 %185, label %186, label %168
186: ; preds = %181
%187 = icmp eq i8* %182, null
br i1 %187, label %196, label %191
188: ; preds = %179
%189 = call i32 (i8*, i8*, ...) @sscanf(i8* %171, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7)
%190 = call i32 (i8*, i8*, ...) @sscanf(i8* %169, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %8)
br label %196
191: ; preds = %186
%192 = call i32 (i8*, i8*, ...) @sscanf(i8* %182, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), double* %8)
%193 = icmp eq i32 %192, 1
br i1 %193, label %196, label %194
194: ; preds = %191
%195 = call i32 (i8*, i8*, ...) @sscanf(i8* %182, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %7)
br label %196
196: ; preds = %160, %188, %194, %191, %186
%197 = load i8, i8* %7
%198 = load i32, i32* %6
%199 = add nsw i32 %198, -1
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i8, i8* %3, i64 %200
store i8 %197, i8* %201
%202 = load double, double* %8
%203 = sext i32 %198 to i64
%204 = getelementptr inbounds double, double* %4, i64 %203
store double %202, double* %204
%205 = add nsw i32 %152, 1
br label %206
206: ; preds = %150, %196
%207 = phi i32 [ %205, %196 ], [ %152, %150 ]
%208 = call i32 @free(i8* %151)
%209 = call i8* @get_line(i32* %11)
%210 = icmp eq i8* %209, null
br i1 %210, label %211, label %150
211: ; preds = %206
%212 = call i32 @fclose(i32* %11)
%213 = icmp eq i32 %207, 0
br i1 %213, label %214, label %216
214: ; preds = %145, %211
%215 = call i32 @vrna_message_warning(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0))
br label %216
216: ; preds = %164, %211, %5, %214, %123
%217 = phi i32 [ 0, %214 ], [ 0, %123 ], [ 0, %5 ], [ 1, %211 ], [ 0, %164 ]
ret i32 %217
}