#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 */
float atof(char *);
void *atoi(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, ...);
int read_line(int /*<<< orphan*/ *, char *);
int import_file(FILE *file, int *ms, int *nj, unsigned *uxj, float *cjr,
                float *dcjr) {
  int ret = -1;
  int i, nx = -1, nc = -1, nd = -1;
  if (file) {
    char line[(256)];
    do {
      ret = read_line(file, line);
      if (ret == (-2)) {
        printf("EOF.\n");
        break;
      } else if (ret == (-1)) {
        printf("FORMAT_ERROR_TRACE\n");
        break;
      } else if (ret == (4)) {
        *ms = atoi(line);
        printf("ms=%d", *ms);
      } else if (ret == (1)) {
        i = 0;
        printf("\nFORMAT_RAW_TRACE\n");
        while (fgets(line, (256), file) != NULL) {
          if (line[0] == '\n') {
            printf("empty string, break section\n");
            break;
          }
          cjr[i] = atof(line);
          i++;
        }
        nc = i;
      } else if (ret == (2)) {
        i = 0;
        printf("\nFORMAT_DETREND_TRACE\n");
        while (fgets(line, (256), file) != NULL) {
          if (line[0] == '\n') {
            printf("empty string, break section\n");
            break;
          }
          dcjr[i] = atof(line);
          i++;
        }
        nd = i;
      } else if (ret == (3)) {
        i = 0;
        printf("\nFORMAT_ELAPSED_TIME\n");
        while (fgets(line, (256), file) != NULL) {
          if (line[0] == '\n') {
            printf("empty string, break section\n");
            break;
          }
          uxj[i] = atoi(line);
          i++;
        }
        nx = i;
      }
    } while ((nx == -1) || (nd == -1) || (nc == -1));
    fclose(file);
  }
  if ((nx != nd) || (nx != nc) || (nd != nc)) {
    printf("error:nx=%d, nc=%d, nd=%d\n", nx, nc, nd);
  } else {
    *nj = nx;
    ret = 0;
    printf("nj=%d\n", *nj);
  }
  return ret;
}


x86 assembly (clang, -O0):
<import_file>:
push   %rbp
mov    %rsp,%rbp
sub    $0x160,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0xffffffff,-0x34(%rbp)
movl   $0xffffffff,-0x3c(%rbp)
movl   $0xffffffff,-0x40(%rbp)
movl   $0xffffffff,-0x44(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     144d <import_file+0x2ed>
jmp    11af <import_file+0x4f>
mov    -0x8(%rbp),%rdi
lea    -0x150(%rbp),%rsi
call   1070 <read_line@plt>
mov    %eax,-0x34(%rbp)
cmpl   $0xfffffffe,-0x34(%rbp)
jne    11df <import_file+0x7f>
lea    0xe2d(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1444 <import_file+0x2e4>
cmpl   $0xffffffff,-0x34(%rbp)
jne    11fc <import_file+0x9c>
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    1444 <import_file+0x2e4>
cmpl   $0x4,-0x34(%rbp)
jne    1233 <import_file+0xd3>
lea    -0x150(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
lea    0xdf3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13f6 <import_file+0x296>
cmpl   $0x1,-0x34(%rbp)
jne    12c6 <import_file+0x166>
movl   $0x0,-0x38(%rbp)
lea    0xdd5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     12bb <import_file+0x15b>
movsbl -0x150(%rbp),%eax
cmp    $0xa,%eax
jne    1294 <import_file+0x134>
lea    0xdab(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    12bb <import_file+0x15b>
lea    -0x150(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x28(%rbp),%rax
movslq -0x38(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1252 <import_file+0xf2>
mov    -0x38(%rbp),%eax
mov    %eax,-0x40(%rbp)
jmp    13f1 <import_file+0x291>
cmpl   $0x2,-0x34(%rbp)
jne    1359 <import_file+0x1f9>
movl   $0x0,-0x38(%rbp)
lea    0xd72(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     134e <import_file+0x1ee>
movsbl -0x150(%rbp),%eax
cmp    $0xa,%eax
jne    1327 <import_file+0x1c7>
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    134e <import_file+0x1ee>
lea    -0x150(%rbp),%rdi
call   1030 <atof@plt>
mov    -0x30(%rbp),%rax
movslq -0x38(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    12e5 <import_file+0x185>
mov    -0x38(%rbp),%eax
mov    %eax,-0x44(%rbp)
jmp    13ec <import_file+0x28c>
cmpl   $0x3,-0x34(%rbp)
jne    13e7 <import_file+0x287>
movl   $0x0,-0x38(%rbp)
lea    0xcf6(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    -0x150(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x100,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     13e1 <import_file+0x281>
movsbl -0x150(%rbp),%eax
cmp    $0xa,%eax
jne    13ba <import_file+0x25a>
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    13e1 <import_file+0x281>
lea    -0x150(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,%edx
mov    -0x20(%rbp),%rax
movslq -0x38(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1378 <import_file+0x218>
mov    -0x38(%rbp),%eax
mov    %eax,-0x3c(%rbp)
jmp    13ec <import_file+0x28c>
jmp    13f1 <import_file+0x291>
jmp    13f6 <import_file+0x296>
jmp    13fb <import_file+0x29b>
jmp    1400 <import_file+0x2a0>
jmp    1405 <import_file+0x2a5>
mov    $0x1,%al
cmpl   $0xffffffff,-0x3c(%rbp)
mov    %al,-0x151(%rbp)
je     1436 <import_file+0x2d6>
mov    $0x1,%al
cmpl   $0xffffffff,-0x44(%rbp)
mov    %al,-0x151(%rbp)
je     1436 <import_file+0x2d6>
cmpl   $0xffffffff,-0x40(%rbp)
sete   %al
mov    %al,-0x151(%rbp)
mov    -0x151(%rbp),%al
test   $0x1,%al
jne    11af <import_file+0x4f>
mov    -0x8(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x3c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jne    1471 <import_file+0x311>
mov    -0x3c(%rbp),%eax
cmp    -0x40(%rbp),%eax
jne    1471 <import_file+0x311>
mov    -0x44(%rbp),%eax
cmp    -0x40(%rbp),%eax
je     148d <import_file+0x32d>
mov    -0x3c(%rbp),%esi
mov    -0x40(%rbp),%edx
mov    -0x44(%rbp),%ecx
lea    0xbfc(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    14b1 <import_file+0x351>
mov    -0x3c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x0,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%esi
lea    0xbee(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x34(%rbp),%eax
add    $0x160,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<import_file>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x138,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,0x20(%rsp)
mov    %rsi,0x10(%rsp)
test   %rdi,%rdi
je     1375 <import_file+0x205>
mov    %rcx,%r14
mov    %rdi,%r13
mov    %rdx,0x8(%rsp)
mov    $0xffffffff,%r12d
lea    0x30(%rsp),%r15
mov    $0xffffffff,%ebx
mov    $0xffffffff,%ebp
nopl   0x0(%rax)
mov    %r13,%rdi
mov    %r15,%rsi
call   1080 <read_line@plt>
mov    %rax,0x18(%rsp)
add    $0x2,%eax
cmp    $0x6,%eax
ja     1340 <import_file+0x1d0>
lea    0xe1d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe7c(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     1340 <import_file+0x1d0>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmpb   $0xa,0x30(%rsp)
je     135e <import_file+0x1ee>
mov    %r15,%rdi
call   1040 <atof@plt>
mov    0x20(%rsp),%rax
movss  %xmm0,(%rax,%rbx,4)
add    $0x1,%rbx
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    1220 <import_file+0xb0>
jmp    1340 <import_file+0x1d0>
lea    0xdf7(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
xor    %ebp,%ebp
test   %rax,%rax
je     1340 <import_file+0x1d0>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0xa,0x30(%rsp)
je     135e <import_file+0x1ee>
mov    %r15,%rdi
call   1040 <atof@plt>
mov    0x28(%rsp),%rax
movss  %xmm0,(%rax,%rbp,4)
add    $0x1,%rbp
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    1290 <import_file+0x120>
jmp    1340 <import_file+0x1d0>
lea    0xd75(%rip),%rdi
call   1030 <puts@plt>
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
xor    %r12d,%r12d
test   %rax,%rax
je     1340 <import_file+0x1d0>
nopl   0x0(%rax)
cmpb   $0xa,0x30(%rsp)
je     135e <import_file+0x1ee>
mov    %r15,%rdi
call   1090 <atoi@plt>
mov    %eax,(%r14,%r12,4)
add    $0x1,%r12
mov    %r15,%rdi
mov    $0x100,%esi
mov    %r13,%rdx
call   1070 <fgets@plt>
test   %rax,%rax
jne    12f0 <import_file+0x180>
jmp    1340 <import_file+0x1d0>
mov    %r15,%rdi
call   1090 <atoi@plt>
mov    0x10(%rsp),%rcx
mov    %eax,(%rcx)
lea    0xce8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
nopl   (%rax)
cmp    $0xffffffff,%r12d
je     11c0 <import_file+0x50>
cmp    $0xffffffff,%ebp
je     11c0 <import_file+0x50>
cmp    $0xffffffff,%ebx
je     11c0 <import_file+0x50>
jmp    13a7 <import_file+0x237>
lea    0xd1c(%rip),%rdi
call   1030 <puts@plt>
cmp    $0xffffffff,%r12d
jne    134a <import_file+0x1da>
jmp    11c0 <import_file+0x50>
mov    $0xffffffff,%r14d
mov    $0xffffffff,%r12d
mov    $0xffffffff,%ebx
mov    $0xffffffff,%ebp
cmp    %ebp,%r12d
je     13be <import_file+0x24e>
jmp    13e0 <import_file+0x270>
lea    0xd17(%rip),%rdi
jmp    13a2 <import_file+0x232>
lea    0xcfb(%rip),%rdi
call   1030 <puts@plt>
mov    %r13,%rdi
call   1050 <fclose@plt>
mov    0x8(%rsp),%rdx
mov    0x18(%rsp),%r14
cmp    %ebp,%r12d
jne    13e0 <import_file+0x270>
cmp    %ebx,%r12d
jne    13e0 <import_file+0x270>
cmp    %ebx,%ebp
jne    13e0 <import_file+0x270>
mov    %r12d,(%rdx)
lea    0xc6c(%rip),%rdi
xor    %r14d,%r14d
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    13f5 <import_file+0x285>
lea    0xc3b(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    %ebp,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%eax
add    $0x138,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"EOF.\0A\00"
@.str.1 = [20 x i8] c"FORMAT_ERROR_TRACE\0A\00"
@.str.2 = [6 x i8] c"ms=%d\00"
@.str.3 = [19 x i8] c"\0AFORMAT_RAW_TRACE\0A\00"
@.str.4 = [29 x i8] c"empty string, break section\0A\00"
@.str.5 = [23 x i8] c"\0AFORMAT_DETREND_TRACE\0A\00"
@.str.6 = [22 x i8] c"\0AFORMAT_ELAPSED_TIME\0A\00"
@.str.7 = [27 x i8] c"error:nx=%d, nc=%d, nd=%d\0A\00"
@.str.8 = [7 x i8] c"nj=%d\0A\00"
define i32 @import_file(i32* %0, i32* %1, i32* %2, i32* %3, float* %4, float* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca float*
%12 = alloca float*
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca [256 x i8]
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store float* %4, float** %11
store float* %5, float** %12
store i32 -1, i32* %13
store i32 -1, i32* %15
store i32 -1, i32* %16
store i32 -1, i32* %17
%19 = load i32*, i32** %7
%20 = icmp ne i32* %19, null
br i1 %20, label %21, label %151
21: ; preds = %6
br label %22
22: ; preds = %146, %21
%23 = load i32*, i32** %7
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%25 = call i32 @read_line(i32* %23, i8* %24)
store i32 %25, i32* %13
%26 = load i32, i32* %13
%27 = icmp eq i32 %26, -2
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %148
30: ; preds = %22
%31 = load i32, i32* %13
%32 = icmp eq i32 %31, -1
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0))
br label %148
35: ; preds = %30
%36 = load i32, i32* %13
%37 = icmp eq i32 %36, 4
br i1 %37, label %38, label %46
38: ; preds = %35
%39 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%40 = call i8* @atoi(i8* %39)
%41 = ptrtoint i8* %40 to i32
%42 = load i32*, i32** %8
store i32 %41, i32* %42
%43 = load i32*, i32** %8
%44 = load i32, i32* %43
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %44)
br label %134
46: ; preds = %35
%47 = load i32, i32* %13
%48 = icmp eq i32 %47, 1
br i1 %48, label %49, label %74
49: ; preds = %46
store i32 0, i32* %14
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0))
br label %51
51: ; preds = %63, %49
%52 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%53 = load i32*, i32** %7
%54 = call i32* @fgets(i8* %52, i32 256, i32* %53)
%55 = icmp ne i32* %54, null
br i1 %55, label %56, label %72
56: ; preds = %51
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = icmp eq i32 %59, 10
br i1 %60, label %61, label %63
61: ; preds = %56
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %72
63: ; preds = %56
%64 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%65 = call float @atof(i8* %64)
%66 = load float*, float** %11
%67 = load i32, i32* %14
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds float, float* %66, i64 %68
store float %65, float* %69
%70 = load i32, i32* %14
%71 = add nsw i32 %70, 1
store i32 %71, i32* %14
br label %51
72: ; preds = %61, %51
%73 = load i32, i32* %14
store i32 %73, i32* %16
br label %133
74: ; preds = %46
%75 = load i32, i32* %13
%76 = icmp eq i32 %75, 2
br i1 %76, label %77, label %102
77: ; preds = %74
store i32 0, i32* %14
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.5, i64 0, i64 0))
br label %79
79: ; preds = %91, %77
%80 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%81 = load i32*, i32** %7
%82 = call i32* @fgets(i8* %80, i32 256, i32* %81)
%83 = icmp ne i32* %82, null
br i1 %83, label %84, label %100
84: ; preds = %79
%85 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%86 = load i8, i8* %85
%87 = sext i8 %86 to i32
%88 = icmp eq i32 %87, 10
br i1 %88, label %89, label %91
89: ; preds = %84
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %100
91: ; preds = %84
%92 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%93 = call float @atof(i8* %92)
%94 = load float*, float** %12
%95 = load i32, i32* %14
%96 = sext i32 %95 to i64
%97 = getelementptr inbounds float, float* %94, i64 %96
store float %93, float* %97
%98 = load i32, i32* %14
%99 = add nsw i32 %98, 1
store i32 %99, i32* %14
br label %79
100: ; preds = %89, %79
%101 = load i32, i32* %14
store i32 %101, i32* %17
br label %132
102: ; preds = %74
%103 = load i32, i32* %13
%104 = icmp eq i32 %103, 3
br i1 %104, label %105, label %131
105: ; preds = %102
store i32 0, i32* %14
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.6, i64 0, i64 0))
br label %107
107: ; preds = %119, %105
%108 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%109 = load i32*, i32** %7
%110 = call i32* @fgets(i8* %108, i32 256, i32* %109)
%111 = icmp ne i32* %110, null
br i1 %111, label %112, label %129
112: ; preds = %107
%113 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 10
br i1 %116, label %117, label %119
117: ; preds = %112
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.4, i64 0, i64 0))
br label %129
119: ; preds = %112
%120 = getelementptr inbounds [256 x i8], [256 x i8]* %18, i64 0, i64 0
%121 = call i8* @atoi(i8* %120)
%122 = ptrtoint i8* %121 to i32
%123 = load i32*, i32** %10
%124 = load i32, i32* %14
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds i32, i32* %123, i64 %125
store i32 %122, i32* %126
%127 = load i32, i32* %14
%128 = add nsw i32 %127, 1
store i32 %128, i32* %14
br label %107
129: ; preds = %117, %107
%130 = load i32, i32* %14
store i32 %130, i32* %15
br label %131
131: ; preds = %129, %102
br label %132
132: ; preds = %131, %100
br label %133
133: ; preds = %132, %72
br label %134
134: ; preds = %133, %38
br label %135
135: ; preds = %134
br label %136
136: ; preds = %135
br label %137
137: ; preds = %136
%138 = load i32, i32* %15
%139 = icmp eq i32 %138, -1
br i1 %139, label %146, label %140
140: ; preds = %137
%141 = load i32, i32* %17
%142 = icmp eq i32 %141, -1
br i1 %142, label %146, label %143
143: ; preds = %140
%144 = load i32, i32* %16
%145 = icmp eq i32 %144, -1
br label %146
146: ; preds = %143, %140, %137
%147 = phi i1 [ true, %140 ], [ true, %137 ], [ %145, %143 ]
br i1 %147, label %22, label %148
148: ; preds = %146, %33, %28
%149 = load i32*, i32** %7
%150 = call i32 @fclose(i32* %149)
br label %151
151: ; preds = %148, %6
%152 = load i32, i32* %15
%153 = load i32, i32* %17
%154 = icmp ne i32 %152, %153
br i1 %154, label %163, label %155
155: ; preds = %151
%156 = load i32, i32* %15
%157 = load i32, i32* %16
%158 = icmp ne i32 %156, %157
br i1 %158, label %163, label %159
159: ; preds = %155
%160 = load i32, i32* %17
%161 = load i32, i32* %16
%162 = icmp ne i32 %160, %161
br i1 %162, label %163, label %168
163: ; preds = %159, %155, %151
%164 = load i32, i32* %15
%165 = load i32, i32* %16
%166 = load i32, i32* %17
%167 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %164, i32 %165, i32 %166)
br label %174
168: ; preds = %159
%169 = load i32, i32* %15
%170 = load i32*, i32** %9
store i32 %169, i32* %170
store i32 0, i32* %13
%171 = load i32*, i32** %9
%172 = load i32, i32* %171
%173 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %172)
br label %174
174: ; preds = %168, %163
%175 = load i32, i32* %13
ret i32 %175
}

LLVM IR (-O2):
@.str.2 = [6 x i8] c"ms=%d\00"
@.str.7 = [27 x i8] c"error:nx=%d, nc=%d, nd=%d\0A\00"
@.str.8 = [7 x i8] c"nj=%d\0A\00"
@str = [21 x i8] c"\0AFORMAT_ELAPSED_TIME\00"
@str.10 = [22 x i8] c"\0AFORMAT_DETREND_TRACE\00"
@str.12 = [18 x i8] c"\0AFORMAT_RAW_TRACE\00"
@str.13 = [28 x i8] c"empty string, break section\00"
@str.14 = [19 x i8] c"FORMAT_ERROR_TRACE\00"
@str.15 = [5 x i8] c"EOF.\00"
define i32 @import_file(i32* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, float* nocapture writeonly %4, float* nocapture writeonly %5) {
%7 = alloca [256 x i8]
%8 = icmp eq i32* %0, null
br i1 %8, label %98, label %9
9: ; preds = %6
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 0
br label %11
11: ; preds = %80, %9
%12 = phi i32 [ -1, %9 ], [ %81, %80 ]
%13 = phi i32 [ -1, %9 ], [ %82, %80 ]
%14 = phi i32 [ -1, %9 ], [ %83, %80 ]
%15 = call i32 @read_line(i32* %0, i8* %10)
switch i32 %15, label %80 [
i32 -2, label %90
i32 -1, label %89
i32 4, label %16
i32 1, label %21
i32 2, label %38
i32 3, label %55
]
16: ; preds = %11
%17 = call i8* @atoi(i8* %10)
%18 = ptrtoint i8* %17 to i64
%19 = trunc i64 %18 to i32
store i32 %19, i32* %1
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %19)
br label %80
21: ; preds = %11
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.12, i64 0, i64 0))
%23 = call i32* @fgets(i8* %10, i32 256, i32* %0)
%24 = icmp eq i32* %23, null
br i1 %24, label %80, label %25
25: ; preds = %21, %32
%26 = phi i64 [ %35, %32 ], [ 0, %21 ]
%27 = load i8, i8* %10
%28 = icmp eq i8 %27, 10
br i1 %28, label %29, label %32
29: ; preds = %25
%30 = trunc i64 %26 to i32
%31 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
br label %80
32: ; preds = %25
%33 = call float @atof(i8* %10)
%34 = getelementptr inbounds float, float* %4, i64 %26
store float %33, float* %34
%35 = add nuw i64 %26, 1
%36 = call i32* @fgets(i8* %10, i32 256, i32* %0)
%37 = icmp eq i32* %36, null
br i1 %37, label %74, label %25
38: ; preds = %11
%39 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str.10, i64 0, i64 0))
%40 = call i32* @fgets(i8* %10, i32 256, i32* %0)
%41 = icmp eq i32* %40, null
br i1 %41, label %80, label %42
42: ; preds = %38, %49
%43 = phi i64 [ %52, %49 ], [ 0, %38 ]
%44 = load i8, i8* %10
%45 = icmp eq i8 %44, 10
br i1 %45, label %46, label %49
46: ; preds = %42
%47 = trunc i64 %43 to i32
%48 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
br label %80
49: ; preds = %42
%50 = call float @atof(i8* %10)
%51 = getelementptr inbounds float, float* %5, i64 %43
store float %50, float* %51
%52 = add nuw i64 %43, 1
%53 = call i32* @fgets(i8* %10, i32 256, i32* %0)
%54 = icmp eq i32* %53, null
br i1 %54, label %76, label %42
55: ; preds = %11
%56 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str, i64 0, i64 0))
%57 = call i32* @fgets(i8* %10, i32 256, i32* %0)
%58 = icmp eq i32* %57, null
br i1 %58, label %80, label %59
59: ; preds = %55, %66
%60 = phi i64 [ %71, %66 ], [ 0, %55 ]
%61 = load i8, i8* %10
%62 = icmp eq i8 %61, 10
br i1 %62, label %63, label %66
63: ; preds = %59
%64 = trunc i64 %60 to i32
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.13, i64 0, i64 0))
br label %80
66: ; preds = %59
%67 = call i8* @atoi(i8* %10)
%68 = ptrtoint i8* %67 to i64
%69 = trunc i64 %68 to i32
%70 = getelementptr inbounds i32, i32* %3, i64 %60
store i32 %69, i32* %70
%71 = add nuw i64 %60, 1
%72 = call i32* @fgets(i8* %10, i32 256, i32* %0)
%73 = icmp eq i32* %72, null
br i1 %73, label %78, label %59
74: ; preds = %32
%75 = trunc i64 %35 to i32
br label %80
76: ; preds = %49
%77 = trunc i64 %52 to i32
br label %80
78: ; preds = %66
%79 = trunc i64 %71 to i32
br label %80
80: ; preds = %78, %76, %74, %55, %38, %21, %63, %11, %46, %29, %16
%81 = phi i32 [ %12, %16 ], [ %12, %29 ], [ %12, %46 ], [ %12, %11 ], [ %64, %63 ], [ %12, %21 ], [ %12, %38 ], [ 0, %55 ], [ %12, %74 ], [ %12, %76 ], [ %79, %78 ]
%82 = phi i32 [ %13, %16 ], [ %30, %29 ], [ %13, %46 ], [ %13, %11 ], [ %13, %63 ], [ 0, %21 ], [ %13, %38 ], [ %13, %55 ], [ %75, %74 ], [ %13, %76 ], [ %13, %78 ]
%83 = phi i32 [ %14, %16 ], [ %14, %29 ], [ %47, %46 ], [ %14, %11 ], [ %14, %63 ], [ %14, %21 ], [ 0, %38 ], [ %14, %55 ], [ %14, %74 ], [ %77, %76 ], [ %14, %78 ]
%84 = icmp eq i32 %81, -1
%85 = icmp eq i32 %83, -1
%86 = select i1 %84, i1 true, i1 %85
%87 = icmp eq i32 %82, -1
%88 = select i1 %86, i1 true, i1 %87
br i1 %88, label %11, label %93
89: ; preds = %11
br label %90
90: ; preds = %11, %89
%91 = phi i8* [ getelementptr inbounds ([19 x i8], [19 x i8]* @str.14, i64 0, i64 0), %89 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @str.15, i64 0, i64 0), %11 ]
%92 = call i32 @puts(i8* dereferenceable(1) %91)
br label %93
93: ; preds = %80, %90
%94 = phi i32 [ %12, %90 ], [ %81, %80 ]
%95 = phi i32 [ %13, %90 ], [ %82, %80 ]
%96 = phi i32 [ %14, %90 ], [ %83, %80 ]
%97 = call i32 @fclose(i32* %0)
br label %98
98: ; preds = %93, %6
%99 = phi i32 [ %15, %93 ], [ -1, %6 ]
%100 = phi i32 [ %94, %93 ], [ -1, %6 ]
%101 = phi i32 [ %95, %93 ], [ -1, %6 ]
%102 = phi i32 [ %96, %93 ], [ -1, %6 ]
%103 = icmp eq i32 %100, %102
%104 = icmp eq i32 %100, %101
%105 = select i1 %103, i1 %104, i1 false
%106 = icmp eq i32 %102, %101
%107 = select i1 %105, i1 %106, i1 false
br i1 %107, label %110, label %108
108: ; preds = %98
%109 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.7, i64 0, i64 0), i32 %100, i32 %101, i32 %102)
br label %112
110: ; preds = %98
store i32 %100, i32* %2
%111 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0), i32 %100)
br label %112
112: ; preds = %110, %108
%113 = phi i32 [ %99, %108 ], [ 0, %110 ]
ret i32 %113
}