#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*/ exit(int);
int /*<<< orphan*/ feof(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int fread(char *, int, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, char *);
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  char key[10] = "";
  FILE *fp;
  char buffer[81] = "";
  char val[70] = "";
  int i, j, flag = 0;
  if (argc != 3) {
    printf("\nUsage: getkey KEYWORD filename\n");
    printf("         eg) getkey NAXIS1 test.fits\n\n");
    exit(-1);
  }
  sprintf(key, "%-8.8s=", argv[1]);
  fp = fopen(argv[2], "r");
  if (NULL == fp) {
    printf("Cannot find file \"%s\"\n", argv[2]);
  }
  while (!feof(fp)) {
    if (80 != fread(buffer, 1, 80, fp)) {
      exit(-1);
    }
    if (strncmp("END                                                           "
                "          ",
                buffer, 80) == 0)
      exit(0);
    else if (strncmp(key, buffer, 9) == 0) {
      j = 0;
      for (i = 10; i < 79; i++) {
        if ('\'' == buffer[i]) {
          if (flag == 0)
            flag = 1;
          else if ('\'' == buffer[i + 1]) {
            val[j] = '\'';
            j++;
            i++;
          } else {
            val[j] = '\0';
            j--;
            while (j > 0) {
              if (val[j] != ' ')
                break;
              val[j] = '\0';
              j--;
            }
            break;
          }
        } else if (flag == 1) {
          val[j] = buffer[i];
          j++;
        } else if (flag == 2) {
          if (buffer[i] != ' ') {
            val[j] = buffer[i];
            j++;
          } else {
            val[j] = '\0';
            j++;
            break;
          }
        } else {
          if (buffer[i] != ' ') {
            flag = 2;
            val[j] = buffer[i];
            j++;
          }
        }
      }
      printf("%s", val);
      return 0;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x1a(%rbp),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <memset@plt>
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x51,%edx
call   1060 <memset@plt>
lea    -0xd0(%rbp),%rdi
xor    %esi,%esi
mov    $0x46,%edx
call   1060 <memset@plt>
movl   $0x0,-0xdc(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1206 <main+0x86>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xe2c(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
lea    -0x1a(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xe2f(%rip),%rsi
call   1090 <sprintf@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xe23(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    1258 <main+0xd8>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    0xe01(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    125d <main+0xdd>
mov    -0x28(%rbp),%rdi
call   1070 <feof@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    127b <main+0xfb>
jmp    1557 <main+0x3d7>
lea    -0x80(%rbp),%rdi
mov    -0x28(%rbp),%rcx
mov    $0x1,%esi
mov    $0x50,%edx
call   1040 <fread@plt>
mov    %eax,%ecx
mov    $0x50,%eax
cmp    %ecx,%eax
je     12ab <main+0x12b>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>
lea    -0x80(%rbp),%rsi
lea    0xdb3(%rip),%rdi
mov    $0x50,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    12d1 <main+0x151>
xor    %edi,%edi
call   10a0 <exit@plt>
lea    -0x1a(%rbp),%rdi
lea    -0x80(%rbp),%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    154d <main+0x3cd>
movl   $0x0,-0xd8(%rbp)
movl   $0xa,-0xd4(%rbp)
cmpl   $0x4f,-0xd4(%rbp)
jge    152c <main+0x3ac>
movslq -0xd4(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%ecx
mov    $0x27,%eax
cmp    %ecx,%eax
jne    140c <main+0x28c>
cmpl   $0x0,-0xdc(%rbp)
jne    1343 <main+0x1c3>
movl   $0x1,-0xdc(%rbp)
jmp    1407 <main+0x287>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x80(%rbp,%rax,1),%ecx
mov    $0x27,%eax
cmp    %ecx,%eax
jne    1392 <main+0x212>
movslq -0xd8(%rbp),%rax
movb   $0x27,-0xd0(%rbp,%rax,1)
27
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1402 <main+0x282>
movslq -0xd8(%rbp),%rax
movb   $0x0,-0xd0(%rbp,%rax,1)
mov    -0xd8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xd8(%rbp)
cmpl   $0x0,-0xd8(%rbp)
jle    13fd <main+0x27d>
movslq -0xd8(%rbp),%rax
movsbl -0xd0(%rbp,%rax,1),%eax
ff
cmp    $0x20,%eax
je     13da <main+0x25a>
jmp    13fd <main+0x27d>
movslq -0xd8(%rbp),%rax
movb   $0x0,-0xd0(%rbp,%rax,1)
mov    -0xd8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xd8(%rbp)
jmp    13b0 <main+0x230>
jmp    152c <main+0x3ac>
jmp    1407 <main+0x287>
jmp    1513 <main+0x393>
cmpl   $0x1,-0xdc(%rbp)
jne    1446 <main+0x2c6>
movslq -0xd4(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%cl
movslq -0xd8(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    150e <main+0x38e>
cmpl   $0x2,-0xdc(%rbp)
jne    14bd <main+0x33d>
movslq -0xd4(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     1495 <main+0x315>
movslq -0xd4(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%cl
movslq -0xd8(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    14b8 <main+0x338>
movslq -0xd8(%rbp),%rax
movb   $0x0,-0xd0(%rbp,%rax,1)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    152c <main+0x3ac>
jmp    1509 <main+0x389>
movslq -0xd4(%rbp),%rax
movsbl -0x80(%rbp,%rax,1),%eax
cmp    $0x20,%eax
je     1504 <main+0x384>
movl   $0x2,-0xdc(%rbp)
movslq -0xd4(%rbp),%rax
mov    -0x80(%rbp,%rax,1),%cl
movslq -0xd8(%rbp),%rax
mov    %cl,-0xd0(%rbp,%rax,1)
mov    -0xd8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd8(%rbp)
jmp    1509 <main+0x389>
jmp    150e <main+0x38e>
jmp    1513 <main+0x393>
jmp    1518 <main+0x398>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    1301 <main+0x181>
lea    -0xd0(%rbp),%rsi
lea    0xb78(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    155e <main+0x3de>
jmp    1552 <main+0x3d2>
jmp    125d <main+0xdd>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xb8,%rsp
movw   $0x0,0x8(%rsp)
movq   $0x0,(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movb   $0x0,0xb0(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movq   $0x0,0x4e(%rsp)
cmp    $0x3,%edi
jne    136d <main+0x1ed>
mov    %rsi,%r14
mov    0x8(%rsi),%rdx
lea    0xe02(%rip),%rsi
mov    %rsp,%rdi
call   1090 <sprintf@plt>
mov    0x10(%r14),%rdi
lea    0xdf7(%rip),%rsi
call   1080 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1230 <main+0xb0>
mov    0x10(%r14),%rsi
lea    0xde1(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x60(%rsp),%r14
lea    0xde5(%rip),%r15
mov    %rsp,%r12
nop
mov    %rbx,%rdi
call   1070 <feof@plt>
test   %eax,%eax
jne    1355 <main+0x1d5>
mov    %r14,%rdi
mov    $0x1,%esi
mov    $0x50,%edx
mov    %rbx,%rcx
call   1050 <fread@plt>
cmp    $0x50,%eax
jne    1385 <main+0x205>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x50,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     1366 <main+0x1e6>
mov    %r12,%rdi
mov    %r14,%rsi
mov    $0x9,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1240 <main+0xc0>
mov    $0xa,%ecx
xor    %edx,%edx
xor    %eax,%eax
jmp    12db <main+0x15b>
nopw   0x0(%rax,%rax,1)
test   %edx,%edx
je     12fe <main+0x17e>
cmpb   $0x27,0x61(%rsp,%rsi,1)
jne    130c <main+0x18c>
add    $0x1,%rsi
mov    $0x27,%bl
mov    %esi,%ecx
mov    %edx,%esi
movslq %eax,%rdx
mov    %bl,0x10(%rsp,%rdx,1)
add    $0x1,%eax
mov    %esi,%edx
lea    0x1(%rcx),%esi
cmp    $0x4e,%ecx
mov    %esi,%ecx
jge    1342 <main+0x1c2>
movslq %ecx,%rsi
movzbl 0x60(%rsp,%rsi,1),%ebx
cmp    $0x27,%bl
je     12b0 <main+0x130>
cmp    $0x1,%edx
je     12c3 <main+0x143>
mov    $0x2,%esi
cmp    $0x2,%edx
jne    1305 <main+0x185>
cmp    $0x20,%bl
jne    12c5 <main+0x145>
jmp    133b <main+0x1bb>
mov    $0x1,%edx
jmp    12d1 <main+0x151>
cmp    $0x20,%bl
jne    12c5 <main+0x145>
jmp    12d1 <main+0x151>
movslq %eax,%rcx
movb   $0x0,0x10(%rsp,%rcx,1)
cmp    $0x2,%eax
jl     1342 <main+0x1c2>
mov    %eax,%eax
add    $0x1,%rax
nop
lea    -0x2(%rax),%ecx
cmpb   $0x20,0x10(%rsp,%rcx,1)
jne    1342 <main+0x1c2>
movb   $0x0,0x10(%rsp,%rcx,1)
add    $0xffffffffffffffff,%rax
cmp    $0x2,%rax
ja     1320 <main+0x1a0>
jmp    1342 <main+0x1c2>
cltq
movb   $0x0,0x10(%rsp,%rax,1)
lea    0xd21(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0xb8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret
xor    %edi,%edi
call   10a0 <exit@plt>
lea    0xcf9(%rip),%rdi
call   1040 <puts@plt>
lea    0xd0d(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   10a0 <exit@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"\0AUsage: getkey KEYWORD filename\0A\00"
@.str.1 = [39 x i8] c" eg) getkey NAXIS1 test.fits\0A\0A\00"
@.str.2 = [8 x i8] c"%-8.8s=\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [23 x i8] c"Cannot find file \22%s\22\0A\00"
@.str.5 = [73 x i8] c"END \00"
@.str.6 = [3 x i8] c"%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [10 x i8]
%7 = alloca i32*
%8 = alloca [81 x i8]
%9 = alloca [70 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%13 = bitcast [10 x i8]* %6 to i8*
%14 = bitcast [81 x i8]* %8 to i8*
%15 = bitcast [70 x i8]* %9 to i8*
store i32 0, i32* %12
%16 = load i32, i32* %4
%17 = icmp ne i32 %16, 3
br i1 %17, label %18, label %22
18: ; preds = %2
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @exit(i32 -1)
unreachable
22: ; preds = %2
%23 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%24 = load i8**, i8*** %5
%25 = getelementptr inbounds i8*, i8** %24, i64 1
%26 = load i8*, i8** %25
%27 = call i32 @sprintf(i8* %23, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %26)
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 2
%30 = load i8*, i8** %29
%31 = call i32* @fopen(i8* %30, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %31, i32** %7
%32 = load i32*, i32** %7
%33 = icmp eq i32* null, %32
br i1 %33, label %34, label %39
34: ; preds = %22
%35 = load i8**, i8*** %5
%36 = getelementptr inbounds i8*, i8** %35, i64 2
%37 = load i8*, i8** %36
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %37)
br label %39
39: ; preds = %34, %22
br label %40
40: ; preds = %188, %39
%41 = load i32*, i32** %7
%42 = call i32 @feof(i32* %41)
%43 = icmp ne i32 %42, 0
%44 = xor i1 %43, true
br i1 %44, label %45, label %189
45: ; preds = %40
%46 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%47 = load i32*, i32** %7
%48 = call i32 @fread(i8* %46, i32 1, i32 80, i32* %47)
%49 = icmp ne i32 80, %48
br i1 %49, label %50, label %52
50: ; preds = %45
%51 = call i32 @exit(i32 -1)
unreachable
52: ; preds = %45
%53 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%54 = call i64 @strncmp(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.5, i64 0, i64 0), i8* %53, i32 80)
%55 = icmp eq i64 %54, 0
br i1 %55, label %56, label %58
56: ; preds = %52
%57 = call i32 @exit(i32 0)
unreachable
58: ; preds = %52
%59 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%60 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 0
%61 = call i64 @strncmp(i8* %59, i8* %60, i32 9)
%62 = icmp eq i64 %61, 0
br i1 %62, label %63, label %187
63: ; preds = %58
store i32 0, i32* %11
store i32 10, i32* %10
br label %64
64: ; preds = %181, %63
%65 = load i32, i32* %10
%66 = icmp slt i32 %65, 79
br i1 %66, label %67, label %184
67: ; preds = %64
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 %69
%71 = load i8, i8* %70
%72 = sext i8 %71 to i32
%73 = icmp eq i32 39, %72
br i1 %73, label %74, label %120
74: ; preds = %67
%75 = load i32, i32* %12
%76 = icmp eq i32 %75, 0
br i1 %76, label %77, label %78
77: ; preds = %74
store i32 1, i32* %12
br label %119
78: ; preds = %74
%79 = load i32, i32* %10
%80 = add nsw i32 %79, 1
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 %81
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp eq i32 39, %84
br i1 %85, label %86, label %94
86: ; preds = %78
%87 = load i32, i32* %11
%88 = sext i32 %87 to i64
%89 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %88
store i8 39, i8* %89
%90 = load i32, i32* %11
%91 = add nsw i32 %90, 1
store i32 %91, i32* %11
%92 = load i32, i32* %10
%93 = add nsw i32 %92, 1
store i32 %93, i32* %10
br label %118
94: ; preds = %78
%95 = load i32, i32* %11
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %96
store i8 0, i8* %97
%98 = load i32, i32* %11
%99 = add nsw i32 %98, -1
store i32 %99, i32* %11
br label %100
100: ; preds = %111, %94
%101 = load i32, i32* %11
%102 = icmp sgt i32 %101, 0
br i1 %102, label %103, label %117
103: ; preds = %100
%104 = load i32, i32* %11
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %105
%107 = load i8, i8* %106
%108 = sext i8 %107 to i32
%109 = icmp ne i32 %108, 32
br i1 %109, label %110, label %111
110: ; preds = %103
br label %117
111: ; preds = %103
%112 = load i32, i32* %11
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %113
store i8 0, i8* %114
%115 = load i32, i32* %11
%116 = add nsw i32 %115, -1
store i32 %116, i32* %11
br label %100
117: ; preds = %110, %100
br label %184
118: ; preds = %86
br label %119
119: ; preds = %118, %77
br label %180
120: ; preds = %67
%121 = load i32, i32* %12
%122 = icmp eq i32 %121, 1
br i1 %122, label %123, label %133
123: ; preds = %120
%124 = load i32, i32* %10
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 %125
%127 = load i8, i8* %126
%128 = load i32, i32* %11
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %129
store i8 %127, i8* %130
%131 = load i32, i32* %11
%132 = add nsw i32 %131, 1
store i32 %132, i32* %11
br label %179
133: ; preds = %120
%134 = load i32, i32* %12
%135 = icmp eq i32 %134, 2
br i1 %135, label %136, label %160
136: ; preds = %133
%137 = load i32, i32* %10
%138 = sext i32 %137 to i64
%139 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 %138
%140 = load i8, i8* %139
%141 = sext i8 %140 to i32
%142 = icmp ne i32 %141, 32
br i1 %142, label %143, label %153
143: ; preds = %136
%144 = load i32, i32* %10
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 %145
%147 = load i8, i8* %146
%148 = load i32, i32* %11
%149 = sext i32 %148 to i64
%150 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %149
store i8 %147, i8* %150
%151 = load i32, i32* %11
%152 = add nsw i32 %151, 1
store i32 %152, i32* %11
br label %159
153: ; preds = %136
%154 = load i32, i32* %11
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %155
store i8 0, i8* %156
%157 = load i32, i32* %11
%158 = add nsw i32 %157, 1
store i32 %158, i32* %11
br label %184
159: ; preds = %143
br label %178
160: ; preds = %133
%161 = load i32, i32* %10
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 %162
%164 = load i8, i8* %163
%165 = sext i8 %164 to i32
%166 = icmp ne i32 %165, 32
br i1 %166, label %167, label %177
167: ; preds = %160
store i32 2, i32* %12
%168 = load i32, i32* %10
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds [81 x i8], [81 x i8]* %8, i64 0, i64 %169
%171 = load i8, i8* %170
%172 = load i32, i32* %11
%173 = sext i32 %172 to i64
%174 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 %173
store i8 %171, i8* %174
%175 = load i32, i32* %11
%176 = add nsw i32 %175, 1
store i32 %176, i32* %11
br label %177
177: ; preds = %167, %160
br label %178
178: ; preds = %177, %159
br label %179
179: ; preds = %178, %123
br label %180
180: ; preds = %179, %119
br label %181
181: ; preds = %180
%182 = load i32, i32* %10
%183 = add nsw i32 %182, 1
store i32 %183, i32* %10
br label %64
184: ; preds = %153, %117, %64
%185 = getelementptr inbounds [70 x i8], [70 x i8]* %9, i64 0, i64 0
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %185)
store i32 0, i32* %3
br label %190
187: ; preds = %58
br label %188
188: ; preds = %187
br label %40
189: ; preds = %40
store i32 0, i32* %3
br label %190
190: ; preds = %189, %184
%191 = load i32, i32* %3
ret i32 %191
}

LLVM IR (-O2):
@.str.2 = [8 x i8] c"%-8.8s=\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [23 x i8] c"Cannot find file \22%s\22\0A\00"
@.str.5 = [73 x i8] c"END \00"
@.str.6 = [3 x i8] c"%s\00"
@str = [32 x i8] c"\0AUsage: getkey KEYWORD filename\00"
@str.7 = [38 x i8] c" eg) getkey NAXIS1 test.fits\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [10 x i8]
%4 = alloca [81 x i8]
%5 = alloca [70 x i8]
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%7 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 0
%8 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 0
%9 = icmp eq i32 %0, 3
br i1 %9, label %14, label %10
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str.7, i64 0, i64 0))
%13 = tail call i32 @exit(i32 -1)
unreachable
14: ; preds = %2
%15 = getelementptr inbounds i8*, i8** %1, i64 1
%16 = load i8*, i8** %15
%17 = call i32 @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* %16)
%18 = getelementptr inbounds i8*, i8** %1, i64 2
%19 = load i8*, i8** %18
%20 = tail call i32* @fopen(i8* %19, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%21 = icmp eq i32* %20, null
br i1 %21, label %22, label %25
22: ; preds = %14
%23 = load i8*, i8** %18
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0), i8* %23)
br label %25
25: ; preds = %22, %14
br label %26
26: ; preds = %25, %39
%27 = call i32 @feof(i32* %20)
%28 = icmp eq i32 %27, 0
br i1 %28, label %29, label %96
29: ; preds = %26
%30 = call i32 @fread(i8* %7, i32 1, i32 80, i32* %20)
%31 = icmp eq i32 %30, 80
br i1 %31, label %34, label %32
32: ; preds = %29
%33 = call i32 @exit(i32 -1)
unreachable
34: ; preds = %29
%35 = call i64 @strncmp(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str.5, i64 0, i64 0), i8* %7, i32 80)
%36 = icmp eq i64 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %34
%38 = call i32 @exit(i32 0)
unreachable
39: ; preds = %34
%40 = call i64 @strncmp(i8* %6, i8* %7, i32 9)
%41 = icmp eq i64 %40, 0
br i1 %41, label %42, label %26
42: ; preds = %39, %88
%43 = phi i32 [ %91, %88 ], [ 0, %39 ]
%44 = phi i32 [ %90, %88 ], [ 0, %39 ]
%45 = phi i32 [ %92, %88 ], [ 10, %39 ]
%46 = sext i32 %45 to i64
%47 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 %46
%48 = load i8, i8* %47
%49 = icmp eq i8 %48, 39
br i1 %49, label %50, label %73
50: ; preds = %42
%51 = icmp eq i32 %43, 0
br i1 %51, label %88, label %52
52: ; preds = %50
%53 = add nsw i32 %45, 1
%54 = sext i32 %53 to i64
%55 = getelementptr inbounds [81 x i8], [81 x i8]* %4, i64 0, i64 %54
%56 = load i8, i8* %55
%57 = icmp eq i8 %56, 39
br i1 %57, label %81, label %58
58: ; preds = %52
%59 = sext i32 %44 to i64
%60 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 %59
store i8 0, i8* %60
%61 = icmp sgt i32 %44, 1
br i1 %61, label %62, label %94
62: ; preds = %58
%63 = zext i32 %44 to i64
br label %64
64: ; preds = %62, %71
%65 = phi i64 [ %63, %62 ], [ %66, %71 ]
%66 = add nsw i64 %65, -1
%67 = and i64 %66, 4294967295
%68 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 %67
%69 = load i8, i8* %68
%70 = icmp eq i8 %69, 32
br i1 %70, label %71, label %94
71: ; preds = %64
store i8 0, i8* %68
%72 = icmp ugt i64 %65, 2
br i1 %72, label %64, label %94
73: ; preds = %42
switch i32 %43, label %79 [
i32 1, label %81
i32 2, label %74
]
74: ; preds = %73
%75 = icmp eq i8 %48, 32
br i1 %75, label %76, label %81
76: ; preds = %74
%77 = sext i32 %44 to i64
%78 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 %77
store i8 0, i8* %78
br label %94
79: ; preds = %73
%80 = icmp eq i8 %48, 32
br i1 %80, label %88, label %81
81: ; preds = %79, %74, %73, %52
%82 = phi i8 [ 39, %52 ], [ %48, %73 ], [ %48, %74 ], [ %48, %79 ]
%83 = phi i32 [ %53, %52 ], [ %45, %73 ], [ %45, %74 ], [ %45, %79 ]
%84 = phi i32 [ %43, %52 ], [ %43, %73 ], [ 2, %74 ], [ 2, %79 ]
%85 = sext i32 %44 to i64
%86 = getelementptr inbounds [70 x i8], [70 x i8]* %5, i64 0, i64 %85
store i8 %82, i8* %86
%87 = add nsw i32 %44, 1
br label %88
88: ; preds = %81, %50, %79
%89 = phi i32 [ %45, %79 ], [ %45, %50 ], [ %83, %81 ]
%90 = phi i32 [ %44, %79 ], [ %44, %50 ], [ %87, %81 ]
%91 = phi i32 [ %43, %79 ], [ 1, %50 ], [ %84, %81 ]
%92 = add nsw i32 %89, 1
%93 = icmp slt i32 %89, 78
br i1 %93, label %42, label %94
94: ; preds = %88, %64, %71, %58, %76
%95 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i8* %8)
br label %96
96: ; preds = %26, %94
ret i32 0
}