#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*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ strncmp(char const *, char *, int);
int /*<<< orphan*/ strncpy(char *, char const *, int);
char *qfits_getvalue(const char *line) {
  static char value[81];
  int i;
  int from, to;
  int inq;
  if (line == NULL) {
    return NULL;
  }
  if (!strncmp(line, "END ", 4)) {
    return NULL;
  }
  memset(value, 0, 81);
  if (!strncmp(line, "HISTORY ", 8) || !strncmp(line, "        ", 8)) {
    i = 7;
    while (line[i] == ' ' && i < 80)
      i++;
    if (i >= 80)
      return NULL;
    from = i;
    to = 79;
    while (line[to] == ' ')
      to--;
    strncpy(value, line + from, to - from + 1);
    value[to - from + 1] = (char)0;
    return value;
  } else if (!strncmp(line, "COMMENT ", 8)) {
    i = 7;
    while (line[i] == ' ' && i < 80)
      i++;
    if (i >= 80)
      return NULL;
    from = i;
    to = 79;
    while (line[to] == ' ')
      to--;
    if (to < from) {
      return NULL;
    }
    strncpy(value, line + from, to - from + 1);
    value[to - from + 1] = (char)0;
    return value;
  }
  i = 0;
  while (line[i] != '=' && i < 80)
    i++;
  if (i > 80) {
    return NULL;
  }
  i++;
  while (line[i] == ' ' && i < 80)
    i++;
  if (i > 80) {
    return NULL;
  }
  from = i;
  inq = 0;
  while (i < 80) {
    if (line[i] == '\'')
      inq = !inq;
    if (line[i] == '/')
      if (!inq)
        break;
    i++;
  }
  i--;
  while (line[i] == ' ' && i >= 0)
    i--;
  if (i < 0) {
    return NULL;
  }
  to = i;
  if (to < from) {
    return NULL;
  }
  strncpy(value, line + from, to - from + 1);
  value[to - from + 1] = (char)0;
  return value;
}


x86 assembly (clang, -O0):
<qfits_getvalue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <qfits_getvalue+0x24>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x10(%rbp),%rdi
lea    0xea1(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    117f <qfits_getvalue+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
lea    0x2eca(%rip),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1050 <memset@plt>
mov    -0x10(%rbp),%rdi
lea    0xe68(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
je     11ce <qfits_getvalue+0x9e>
mov    -0x10(%rbp),%rdi
lea    0xe53(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    12a5 <qfits_getvalue+0x175>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x21(%rbp)
jne    11f9 <qfits_getvalue+0xc9>
cmpl   $0x50,-0x14(%rbp)
setl   %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    1209 <qfits_getvalue+0xd9>
jmp    1217 <qfits_getvalue+0xe7>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11d5 <qfits_getvalue+0xa5>
cmpl   $0x50,-0x14(%rbp)
jl     122e <qfits_getvalue+0xfe>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x4f,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    125e <qfits_getvalue+0x12e>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    123b <qfits_getvalue+0x10b>
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
sub    -0x18(%rbp),%edx
add    $0x1,%edx
lea    0x2dd7(%rip),%rdi
call   1030 <strncpy@plt>
mov    -0x1c(%rbp),%eax
sub    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2dbf(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2db4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x10(%rbp),%rdi
lea    0xd67(%rip),%rsi
mov    $0x8,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%eax
jne    13b3 <qfits_getvalue+0x283>
movl   $0x7,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x22(%rbp)
jne    12ee <qfits_getvalue+0x1be>
cmpl   $0x50,-0x14(%rbp)
setl   %al
mov    %al,-0x22(%rbp)
mov    -0x22(%rbp),%al
test   $0x1,%al
jne    12fe <qfits_getvalue+0x1ce>
jmp    130c <qfits_getvalue+0x1dc>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12ca <qfits_getvalue+0x19a>
cmpl   $0x50,-0x14(%rbp)
jl     1323 <qfits_getvalue+0x1f3>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x4f,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1353 <qfits_getvalue+0x223>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
jmp    1330 <qfits_getvalue+0x200>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    136c <qfits_getvalue+0x23c>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
sub    -0x18(%rbp),%edx
add    $0x1,%edx
lea    0x2cc9(%rip),%rdi
call   1030 <strncpy@plt>
mov    -0x1c(%rbp),%eax
sub    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2cb1(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2ca6(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
jmp    13b8 <qfits_getvalue+0x288>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x3d,%ecx
mov    %al,-0x23(%rbp)
je     13e3 <qfits_getvalue+0x2b3>
cmpl   $0x50,-0x14(%rbp)
setl   %al
mov    %al,-0x23(%rbp)
mov    -0x23(%rbp),%al
test   $0x1,%al
jne    13f3 <qfits_getvalue+0x2c3>
jmp    1401 <qfits_getvalue+0x2d1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13bf <qfits_getvalue+0x28f>
cmpl   $0x50,-0x14(%rbp)
jle    1418 <qfits_getvalue+0x2e8>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x24(%rbp)
jne    1445 <qfits_getvalue+0x315>
cmpl   $0x50,-0x14(%rbp)
setl   %al
mov    %al,-0x24(%rbp)
mov    -0x24(%rbp),%al
test   $0x1,%al
jne    1455 <qfits_getvalue+0x325>
jmp    1463 <qfits_getvalue+0x333>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1421 <qfits_getvalue+0x2f1>
cmpl   $0x50,-0x14(%rbp)
jle    147a <qfits_getvalue+0x34a>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x50,-0x14(%rbp)
jge    14ee <qfits_getvalue+0x3be>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x27,%eax
jne    14b7 <qfits_getvalue+0x387>
cmpl   $0x0,-0x20(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
jne    14e0 <qfits_getvalue+0x3b0>
cmpl   $0x0,-0x20(%rbp)
jne    14db <qfits_getvalue+0x3ab>
jmp    14ee <qfits_getvalue+0x3be>
jmp    14e0 <qfits_getvalue+0x3b0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1487 <qfits_getvalue+0x357>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    $0x20,%ecx
mov    %al,-0x25(%rbp)
jne    151b <qfits_getvalue+0x3eb>
cmpl   $0x0,-0x14(%rbp)
setge  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    152b <qfits_getvalue+0x3fb>
jmp    1539 <qfits_getvalue+0x409>
mov    -0x14(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    14f7 <qfits_getvalue+0x3c7>
cmpl   $0x0,-0x14(%rbp)
jge    1550 <qfits_getvalue+0x420>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x14(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    156f <qfits_getvalue+0x43f>
movq   $0x0,-0x8(%rbp)
jmp    15b1 <qfits_getvalue+0x481>
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
sub    -0x18(%rbp),%edx
add    $0x1,%edx
lea    0x2ac6(%rip),%rdi
call   1030 <strncpy@plt>
mov    -0x1c(%rbp),%eax
sub    -0x18(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
lea    0x2aae(%rip),%rax
movb   $0x0,(%rax,%rcx,1)
lea    0x2aa3(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qfits_getvalue>:
push   %rbp
push   %r14
push   %rbx
test   %rdi,%rdi
je     1394 <qfits_getvalue+0x264>
mov    %rdi,%rbx
lea    0xeb9(%rip),%rsi
mov    $0x4,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1394 <qfits_getvalue+0x264>
lea    0x2ef0(%rip),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1050 <memset@plt>
lea    0xe8f(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     12cd <qfits_getvalue+0x19d>
lea    0xe7c(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     12cd <qfits_getvalue+0x19d>
lea    0xe69(%rip),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <strncmp@plt>
test   %eax,%eax
je     1337 <qfits_getvalue+0x207>
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rax),%rdx
cmpb   $0x3d,(%rbx,%rax,1)
je     11fd <qfits_getvalue+0xcd>
cmp    $0x50,%rax
mov    %rdx,%rax
jb     11d0 <qfits_getvalue+0xa0>
jmp    11fd <qfits_getvalue+0xcd>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0xffffffffffffffff,%rdx
cmp    $0x4f,%rdx
mov    %rax,%rdx
jae    120a <qfits_getvalue+0xda>
movzbl (%rbx,%rdx,1),%ecx
lea    0x1(%rdx),%rax
cmp    $0x20,%cl
je     11f0 <qfits_getvalue+0xc0>
lea    -0x2(%rax),%edx
cmp    $0x4f,%edx
ja     1394 <qfits_getvalue+0x264>
lea    -0x1(%rax),%r8
mov    %r8,%rdx
cmp    $0x51,%eax
je     1289 <qfits_getvalue+0x159>
cmp    $0x50,%r8d
mov    $0x4f,%r9d
mov    $0x4f,%edx
cmovae %r8d,%edx
mov    %r8,%rbp
cmp    $0x2f,%cl
je     1287 <qfits_getvalue+0x157>
add    $0x1,%edx
xor    %edi,%edi
cmp    $0x27,%cl
sete   %dil
lea    -0x1(%rax),%ecx
cmp    $0x50,%ecx
cmovae %ecx,%r9d
add    $0x1,%r9d
neg    %r9
mov    %r8,%rbp
lea    (%r9,%rbp,1),%rcx
cmp    $0xffffffffffffffff,%rcx
je     1289 <qfits_getvalue+0x159>
movzbl 0x1(%rbx,%rbp,1),%ecx
xor    %esi,%esi
test   %edi,%edi
sete   %sil
cmp    $0x27,%cl
cmove  %esi,%edi
add    $0x1,%rbp
cmp    $0x2f,%cl
jne    125d <qfits_getvalue+0x12d>
test   %edi,%edi
jne    125d <qfits_getvalue+0x12d>
mov    %ebp,%edx
lea    (%rbx,%rax,1),%rsi
add    $0xffffffffffffffff,%rsi
mov    %edx,%ebp
sub    %eax,%ebp
add    $0x2,%ebp
nopl   0x0(%rax,%rax,1)
lea    -0x1(%rdx),%rcx
add    $0xffffffff,%ebp
cmpb   $0x20,-0x1(%rbx,%rdx,1)
jne    12b6 <qfits_getvalue+0x186>
test   %rdx,%rdx
mov    %rcx,%rdx
jg     12a0 <qfits_getvalue+0x170>
add    $0x1,%ecx
xor    %eax,%eax
test   %ecx,%ecx
jle    1396 <qfits_getvalue+0x266>
cmp    %r8d,%ecx
jg     131c <qfits_getvalue+0x1ec>
jmp    1396 <qfits_getvalue+0x266>
lea    0x6(%rbx),%rsi
mov    $0x4b,%ebp
mov    $0x6,%eax
nopl   0x0(%rax,%rax,1)
add    $0x1,%rax
add    $0xffffffff,%ebp
cmpb   $0x20,0x1(%rsi)
lea    0x1(%rsi),%rsi
jne    12f7 <qfits_getvalue+0x1c7>
cmp    $0x50,%rax
jb     12e0 <qfits_getvalue+0x1b0>
cmp    $0x4f,%eax
ja     1394 <qfits_getvalue+0x264>
add    $0x4f,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
add    $0xffffffff,%ebp
cmpb   $0x20,(%rbx)
lea    -0x1(%rbx),%rbx
je     1310 <qfits_getvalue+0x1e0>
lea    0x2d2d(%rip),%rdi
mov    %ebp,%edx
call   1030 <strncpy@plt>
movslq %ebp,%rax
movb   $0x0,(%rax,%r14,1)
mov    %r14,%rax
jmp    1396 <qfits_getvalue+0x266>
lea    0x6(%rbx),%rsi
mov    $0x4b,%ebp
mov    $0x6,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%rax
add    $0xffffffff,%ebp
cmpb   $0x20,0x1(%rsi)
lea    0x1(%rsi),%rsi
jne    1367 <qfits_getvalue+0x237>
cmp    $0x50,%rax
jb     1350 <qfits_getvalue+0x220>
cmp    $0x4f,%eax
ja     1394 <qfits_getvalue+0x264>
mov    $0x4f,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xffffffff,%ebp
cmpb   $0x20,(%rbx,%rcx,1)
lea    -0x1(%rcx),%rcx
je     1380 <qfits_getvalue+0x250>
add    $0x1,%ecx
cmp    %eax,%ecx
jge    131c <qfits_getvalue+0x1ec>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@qfits_getvalue.value = internal global [81 x i8] zeroinitializer
@.str = [5 x i8] c"END \00"
@.str.1 = [9 x i8] c"HISTORY \00"
@.str.2 = [9 x i8] c" \00"
@.str.3 = [9 x i8] c"COMMENT \00"
define i8* @qfits_getvalue(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %11
10: ; preds = %1
store i8* null, i8** %2
br label %258
11: ; preds = %1
%12 = load i8*, i8** %3
%13 = call i32 @strncmp(i8* %12, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%14 = icmp ne i32 %13, 0
br i1 %14, label %16, label %15
15: ; preds = %11
store i8* null, i8** %2
br label %258
16: ; preds = %11
%17 = call i32 @memset(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i32 0, i32 81)
%18 = load i8*, i8** %3
%19 = call i32 @strncmp(i8* %18, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%20 = icmp ne i32 %19, 0
br i1 %20, label %21, label %25
21: ; preds = %16
%22 = load i8*, i8** %3
%23 = call i32 @strncmp(i8* %22, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%24 = icmp ne i32 %23, 0
br i1 %24, label %75, label %25
25: ; preds = %21, %16
store i32 7, i32* %4
br label %26
26: ; preds = %39, %25
%27 = load i8*, i8** %3
%28 = load i32, i32* %4
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds i8, i8* %27, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp eq i32 %32, 32
br i1 %33, label %34, label %37
34: ; preds = %26
%35 = load i32, i32* %4
%36 = icmp slt i32 %35, 80
br label %37
37: ; preds = %34, %26
%38 = phi i1 [ false, %26 ], [ %36, %34 ]
br i1 %38, label %39, label %42
39: ; preds = %37
%40 = load i32, i32* %4
%41 = add nsw i32 %40, 1
store i32 %41, i32* %4
br label %26
42: ; preds = %37
%43 = load i32, i32* %4
%44 = icmp sge i32 %43, 80
br i1 %44, label %45, label %46
45: ; preds = %42
store i8* null, i8** %2
br label %258
46: ; preds = %42
%47 = load i32, i32* %4
store i32 %47, i32* %5
store i32 79, i32* %6
br label %48
48: ; preds = %56, %46
%49 = load i8*, i8** %3
%50 = load i32, i32* %6
%51 = sext i32 %50 to i64
%52 = getelementptr inbounds i8, i8* %49, i64 %51
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 32
br i1 %55, label %56, label %59
56: ; preds = %48
%57 = load i32, i32* %6
%58 = add nsw i32 %57, -1
store i32 %58, i32* %6
br label %48
59: ; preds = %48
%60 = load i8*, i8** %3
%61 = load i32, i32* %5
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds i8, i8* %60, i64 %62
%64 = load i32, i32* %6
%65 = load i32, i32* %5
%66 = sub nsw i32 %64, %65
%67 = add nsw i32 %66, 1
%68 = call i32 @strncpy(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8* %63, i32 %67)
%69 = load i32, i32* %6
%70 = load i32, i32* %5
%71 = sub nsw i32 %69, %70
%72 = add nsw i32 %71, 1
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 %73
store i8 0, i8* %74
store i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8** %2
br label %258
75: ; preds = %21
%76 = load i8*, i8** %3
%77 = call i32 @strncmp(i8* %76, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 8)
%78 = icmp ne i32 %77, 0
br i1 %78, label %134, label %79
79: ; preds = %75
store i32 7, i32* %4
br label %80
80: ; preds = %93, %79
%81 = load i8*, i8** %3
%82 = load i32, i32* %4
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
%85 = load i8, i8* %84
%86 = sext i8 %85 to i32
%87 = icmp eq i32 %86, 32
br i1 %87, label %88, label %91
88: ; preds = %80
%89 = load i32, i32* %4
%90 = icmp slt i32 %89, 80
br label %91
91: ; preds = %88, %80
%92 = phi i1 [ false, %80 ], [ %90, %88 ]
br i1 %92, label %93, label %96
93: ; preds = %91
%94 = load i32, i32* %4
%95 = add nsw i32 %94, 1
store i32 %95, i32* %4
br label %80
96: ; preds = %91
%97 = load i32, i32* %4
%98 = icmp sge i32 %97, 80
br i1 %98, label %99, label %100
99: ; preds = %96
store i8* null, i8** %2
br label %258
100: ; preds = %96
%101 = load i32, i32* %4
store i32 %101, i32* %5
store i32 79, i32* %6
br label %102
102: ; preds = %110, %100
%103 = load i8*, i8** %3
%104 = load i32, i32* %6
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds i8, i8* %103, i64 %105
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp eq i32 %108, 32
br i1 %109, label %110, label %113
110: ; preds = %102
%111 = load i32, i32* %6
%112 = add nsw i32 %111, -1
store i32 %112, i32* %6
br label %102
113: ; preds = %102
%114 = load i32, i32* %6
%115 = load i32, i32* %5
%116 = icmp slt i32 %114, %115
br i1 %116, label %117, label %118
117: ; preds = %113
store i8* null, i8** %2
br label %258
118: ; preds = %113
%119 = load i8*, i8** %3
%120 = load i32, i32* %5
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds i8, i8* %119, i64 %121
%123 = load i32, i32* %6
%124 = load i32, i32* %5
%125 = sub nsw i32 %123, %124
%126 = add nsw i32 %125, 1
%127 = call i32 @strncpy(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8* %122, i32 %126)
%128 = load i32, i32* %6
%129 = load i32, i32* %5
%130 = sub nsw i32 %128, %129
%131 = add nsw i32 %130, 1
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 %132
store i8 0, i8* %133
store i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8** %2
br label %258
134: ; preds = %75
br label %135
135: ; preds = %134
store i32 0, i32* %4
br label %136
136: ; preds = %149, %135
%137 = load i8*, i8** %3
%138 = load i32, i32* %4
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds i8, i8* %137, i64 %139
%141 = load i8, i8* %140
%142 = sext i8 %141 to i32
%143 = icmp ne i32 %142, 61
br i1 %143, label %144, label %147
144: ; preds = %136
%145 = load i32, i32* %4
%146 = icmp slt i32 %145, 80
br label %147
147: ; preds = %144, %136
%148 = phi i1 [ false, %136 ], [ %146, %144 ]
br i1 %148, label %149, label %152
149: ; preds = %147
%150 = load i32, i32* %4
%151 = add nsw i32 %150, 1
store i32 %151, i32* %4
br label %136
152: ; preds = %147
%153 = load i32, i32* %4
%154 = icmp sgt i32 %153, 80
br i1 %154, label %155, label %156
155: ; preds = %152
store i8* null, i8** %2
br label %258
156: ; preds = %152
%157 = load i32, i32* %4
%158 = add nsw i32 %157, 1
store i32 %158, i32* %4
br label %159
159: ; preds = %172, %156
%160 = load i8*, i8** %3
%161 = load i32, i32* %4
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds i8, i8* %160, i64 %162
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = icmp eq i32 %165, 32
br i1 %166, label %167, label %170
167: ; preds = %159
%168 = load i32, i32* %4
%169 = icmp slt i32 %168, 80
br label %170
170: ; preds = %167, %159
%171 = phi i1 [ false, %159 ], [ %169, %167 ]
br i1 %171, label %172, label %175
172: ; preds = %170
%173 = load i32, i32* %4
%174 = add nsw i32 %173, 1
store i32 %174, i32* %4
br label %159
175: ; preds = %170
%176 = load i32, i32* %4
%177 = icmp sgt i32 %176, 80
br i1 %177, label %178, label %179
178: ; preds = %175
store i8* null, i8** %2
br label %258
179: ; preds = %175
%180 = load i32, i32* %4
store i32 %180, i32* %5
store i32 0, i32* %7
br label %181
181: ; preds = %210, %179
%182 = load i32, i32* %4
%183 = icmp slt i32 %182, 80
br i1 %183, label %184, label %213
184: ; preds = %181
%185 = load i8*, i8** %3
%186 = load i32, i32* %4
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds i8, i8* %185, i64 %187
%189 = load i8, i8* %188
%190 = sext i8 %189 to i32
%191 = icmp eq i32 %190, 39
br i1 %191, label %192, label %197
192: ; preds = %184
%193 = load i32, i32* %7
%194 = icmp ne i32 %193, 0
%195 = xor i1 %194, true
%196 = zext i1 %195 to i32
store i32 %196, i32* %7
br label %197
197: ; preds = %192, %184
%198 = load i8*, i8** %3
%199 = load i32, i32* %4
%200 = sext i32 %199 to i64
%201 = getelementptr inbounds i8, i8* %198, i64 %200
%202 = load i8, i8* %201
%203 = sext i8 %202 to i32
%204 = icmp eq i32 %203, 47
br i1 %204, label %205, label %210
205: ; preds = %197
%206 = load i32, i32* %7
%207 = icmp ne i32 %206, 0
br i1 %207, label %209, label %208
208: ; preds = %205
br label %213
209: ; preds = %205
br label %210
210: ; preds = %209, %197
%211 = load i32, i32* %4
%212 = add nsw i32 %211, 1
store i32 %212, i32* %4
br label %181
213: ; preds = %208, %181
%214 = load i32, i32* %4
%215 = add nsw i32 %214, -1
store i32 %215, i32* %4
br label %216
216: ; preds = %229, %213
%217 = load i8*, i8** %3
%218 = load i32, i32* %4
%219 = sext i32 %218 to i64
%220 = getelementptr inbounds i8, i8* %217, i64 %219
%221 = load i8, i8* %220
%222 = sext i8 %221 to i32
%223 = icmp eq i32 %222, 32
br i1 %223, label %224, label %227
224: ; preds = %216
%225 = load i32, i32* %4
%226 = icmp sge i32 %225, 0
br label %227
227: ; preds = %224, %216
%228 = phi i1 [ false, %216 ], [ %226, %224 ]
br i1 %228, label %229, label %232
229: ; preds = %227
%230 = load i32, i32* %4
%231 = add nsw i32 %230, -1
store i32 %231, i32* %4
br label %216
232: ; preds = %227
%233 = load i32, i32* %4
%234 = icmp slt i32 %233, 0
br i1 %234, label %235, label %236
235: ; preds = %232
store i8* null, i8** %2
br label %258
236: ; preds = %232
%237 = load i32, i32* %4
store i32 %237, i32* %6
%238 = load i32, i32* %6
%239 = load i32, i32* %5
%240 = icmp slt i32 %238, %239
br i1 %240, label %241, label %242
241: ; preds = %236
store i8* null, i8** %2
br label %258
242: ; preds = %236
%243 = load i8*, i8** %3
%244 = load i32, i32* %5
%245 = sext i32 %244 to i64
%246 = getelementptr inbounds i8, i8* %243, i64 %245
%247 = load i32, i32* %6
%248 = load i32, i32* %5
%249 = sub nsw i32 %247, %248
%250 = add nsw i32 %249, 1
%251 = call i32 @strncpy(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8* %246, i32 %250)
%252 = load i32, i32* %6
%253 = load i32, i32* %5
%254 = sub nsw i32 %252, %253
%255 = add nsw i32 %254, 1
%256 = sext i32 %255 to i64
%257 = getelementptr inbounds [81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 %256
store i8 0, i8* %257
store i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8** %2
br label %258
258: ; preds = %242, %241, %235, %178, %155, %118, %117, %99, %59, %45, %15, %10
%259 = load i8*, i8** %2
ret i8* %259
}

LLVM IR (-O2):
@qfits_getvalue.value = internal global [81 x i8] zeroinitializer
@.str = [5 x i8] c"END \00"
@.str.1 = [9 x i8] c"HISTORY \00"
@.str.2 = [9 x i8] c" \00"
@.str.3 = [9 x i8] c"COMMENT \00"
define i8* @qfits_getvalue(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %139, label %3
3: ; preds = %1
%4 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 4)
%5 = icmp eq i32 %4, 0
br i1 %5, label %139, label %6
6: ; preds = %3
%7 = tail call i32 @memset(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i32 0, i32 81)
%8 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 8)
%9 = icmp eq i32 %8, 0
br i1 %9, label %13, label %10
10: ; preds = %6
%11 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 8)
%12 = icmp eq i32 %11, 0
br i1 %12, label %13, label %37
13: ; preds = %10, %6
br label %14
14: ; preds = %13, %14
%15 = phi i64 [ %21, %14 ], [ 7, %13 ]
%16 = getelementptr inbounds i8, i8* %0, i64 %15
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 32
%19 = icmp ult i64 %15, 80
%20 = select i1 %18, i1 %19, i1 false
%21 = add nuw nsw i64 %15, 1
br i1 %20, label %14, label %22
22: ; preds = %14
%23 = trunc i64 %15 to i32
%24 = getelementptr inbounds i8, i8* %0, i64 %15
%25 = icmp ugt i32 %23, 79
br i1 %25, label %139, label %26
26: ; preds = %22, %26
%27 = phi i64 [ %31, %26 ], [ 79, %22 ]
%28 = getelementptr inbounds i8, i8* %0, i64 %27
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 32
%31 = add i64 %27, -1
br i1 %30, label %26, label %32
32: ; preds = %26
%33 = trunc i64 %27 to i32
%34 = sub nsw i32 %33, %23
%35 = add nsw i32 %34, 1
%36 = tail call i32 @strncpy(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8* %24, i32 %35)
br label %135
37: ; preds = %10
%38 = tail call i32 @strncmp(i8* %0, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 8)
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %65
40: ; preds = %37, %40
%41 = phi i64 [ %47, %40 ], [ 7, %37 ]
%42 = getelementptr inbounds i8, i8* %0, i64 %41
%43 = load i8, i8* %42
%44 = icmp eq i8 %43, 32
%45 = icmp ult i64 %41, 80
%46 = select i1 %44, i1 %45, i1 false
%47 = add nuw nsw i64 %41, 1
br i1 %46, label %40, label %48
48: ; preds = %40
%49 = trunc i64 %41 to i32
%50 = getelementptr inbounds i8, i8* %0, i64 %41
%51 = icmp ugt i32 %49, 79
br i1 %51, label %139, label %52
52: ; preds = %48, %52
%53 = phi i64 [ %57, %52 ], [ 79, %48 ]
%54 = getelementptr inbounds i8, i8* %0, i64 %53
%55 = load i8, i8* %54
%56 = icmp eq i8 %55, 32
%57 = add i64 %53, -1
br i1 %56, label %52, label %58
58: ; preds = %52
%59 = trunc i64 %53 to i32
%60 = icmp slt i32 %59, %49
br i1 %60, label %139, label %61
61: ; preds = %58
%62 = sub nsw i32 %59, %49
%63 = add nsw i32 %62, 1
%64 = tail call i32 @strncpy(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8* %50, i32 %63)
br label %135
65: ; preds = %37, %65
%66 = phi i64 [ %72, %65 ], [ 0, %37 ]
%67 = getelementptr inbounds i8, i8* %0, i64 %66
%68 = load i8, i8* %67
%69 = icmp ne i8 %68, 61
%70 = icmp ult i64 %66, 80
%71 = select i1 %69, i1 %70, i1 false
%72 = add nuw nsw i64 %66, 1
br i1 %71, label %65, label %73
73: ; preds = %65, %73
%74 = phi i64 [ %75, %73 ], [ %66, %65 ]
%75 = add nuw nsw i64 %74, 1
%76 = getelementptr inbounds i8, i8* %0, i64 %75
%77 = load i8, i8* %76
%78 = icmp eq i8 %77, 32
%79 = icmp ult i64 %74, 79
%80 = select i1 %78, i1 %79, i1 false
br i1 %80, label %73, label %81
81: ; preds = %73
%82 = trunc i64 %74 to i32
%83 = trunc i64 %75 to i32
%84 = and i64 %75, 4294967295
%85 = getelementptr inbounds i8, i8* %0, i64 %84
%86 = icmp ugt i32 %82, 79
br i1 %86, label %139, label %87
87: ; preds = %81
%88 = icmp eq i32 %82, 79
br i1 %88, label %89, label %91
89: ; preds = %102, %99, %87
%90 = phi i64 [ %101, %99 ], [ %84, %87 ], [ %94, %102 ]
br label %117
91: ; preds = %87
%92 = call i32 @llvm.umax.i32(i32 %83, i32 79)
%93 = add nuw nsw i32 %92, 1
%94 = zext i32 %93 to i64
%95 = icmp eq i8 %77, 47
br i1 %95, label %99, label %96
96: ; preds = %91
%97 = icmp eq i8 %77, 39
%98 = zext i1 %97 to i32
br label %102
99: ; preds = %107, %91
%100 = phi i64 [ %75, %91 ], [ %105, %107 ]
%101 = and i64 %100, 4294967295
br label %89
102: ; preds = %96, %107
%103 = phi i32 [ %98, %96 ], [ %113, %107 ]
%104 = phi i64 [ %75, %96 ], [ %105, %107 ]
%105 = add nuw nsw i64 %104, 1
%106 = icmp eq i64 %105, %94
br i1 %106, label %89, label %107
107: ; preds = %102
%108 = getelementptr inbounds i8, i8* %0, i64 %105
%109 = load i8, i8* %108
%110 = icmp eq i8 %109, 39
%111 = icmp eq i32 %103, 0
%112 = zext i1 %111 to i32
%113 = select i1 %110, i32 %112, i32 %103
%114 = icmp ne i8 %109, 47
%115 = icmp ne i32 %113, 0
%116 = select i1 %114, i1 true, i1 %115
br i1 %116, label %102, label %99
117: ; preds = %89, %117
%118 = phi i64 [ %119, %117 ], [ %90, %89 ]
%119 = add nsw i64 %118, -1
%120 = getelementptr inbounds i8, i8* %0, i64 %119
%121 = load i8, i8* %120
%122 = icmp eq i8 %121, 32
%123 = icmp sgt i64 %118, 0
%124 = select i1 %122, i1 %123, i1 false
br i1 %124, label %117, label %125
125: ; preds = %117
%126 = trunc i64 %118 to i32
%127 = icmp sgt i32 %126, 0
%128 = icmp sgt i32 %126, %83
%129 = select i1 %127, i1 %128, i1 false
br i1 %129, label %130, label %139
130: ; preds = %125
%131 = trunc i64 %119 to i32
%132 = sub nsw i32 %131, %83
%133 = add nsw i32 %132, 1
%134 = tail call i32 @strncpy(i8* getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), i8* %85, i32 %133)
br label %135
135: ; preds = %32, %61, %130
%136 = phi i32 [ %133, %130 ], [ %63, %61 ], [ %35, %32 ]
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds [81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 %137
store i8 0, i8* %138
br label %139
139: ; preds = %135, %125, %81, %58, %48, %22, %3, %1
%140 = phi i8* [ null, %1 ], [ null, %3 ], [ null, %22 ], [ null, %48 ], [ null, %58 ], [ null, %81 ], [ null, %125 ], [ getelementptr inbounds ([81 x i8], [81 x i8]* @qfits_getvalue.value, i64 0, i64 0), %135 ]
ret i8* %140
}