#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 */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, int *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
int /*<<< orphan*/ sscanf(char *, char *, ...);
void read_arcinfo_mask(FILE *fmask, int *Ncells, float **cell_lat,
                       float **cell_lng, int **cell_row, int **cell_col) {
  char tmpstr[512];
  int ncol, nrow, NoData_value;
  int cell, i, j;
  int tmpvalue;
  float ll_lat, ll_lng, cellsize;
  float tmp_lat, tmp_lng;
  for (i = 0; i < 6; i++) {
    fgets(tmpstr, 512, fmask);
    if (i == 0)
      sscanf(tmpstr, "%*s %i", &ncol);
    if (i == 1)
      sscanf(tmpstr, "%*s %i", &nrow);
    if (i == 2)
      sscanf(tmpstr, "%*s %f", &ll_lat);
    if (i == 3)
      sscanf(tmpstr, "%*s %f", &ll_lng);
    if (i == 4)
      sscanf(tmpstr, "%*s %f", &cellsize);
    if (i == 5)
      sscanf(tmpstr, "%*s %i", &NoData_value);
  }
  (*Ncells) = 0;
  for (j = 0; j < nrow; j++) {
    for (i = 0; i < ncol; i++) {
      fscanf(fmask, "%i", &tmpvalue);
      if (tmpvalue > 0 && tmpvalue != NoData_value)
        (*Ncells)++;
    }
  }
  (*cell_lat) = (float *)calloc((*Ncells), sizeof(float));
  (*cell_lng) = (float *)calloc((*Ncells), sizeof(float));
  (*cell_row) = (int *)calloc((*Ncells), sizeof(int));
  (*cell_col) = (int *)calloc((*Ncells), sizeof(int));
  rewind(fmask);
  for (i = 0; i < 6; i++)
    fgets(tmpstr, 512, fmask);
  cell = 0;
  for (j = 0; j < nrow; j++) {
    tmp_lat = ll_lat + (float)(nrow - j - 0.5) * cellsize;
    for (i = 0; i < ncol; i++) {
      tmp_lng = ll_lng + (float)(i + 0.5) * cellsize;
      fscanf(fmask, "%i", &tmpvalue);
      if (tmpvalue > 0 && tmpvalue != NoData_value) {
        (*cell_lat)[cell] = tmp_lat;
        (*cell_lng)[cell] = tmp_lng;
        (*cell_row)[cell] = j;
        (*cell_col)[cell] = i;
        cell++;
      }
    }
  }
}


x86 assembly (clang, -O0):
<read_arcinfo_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x260,%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   $0x0,-0x244(%rbp)
cmpl   $0x6,-0x244(%rbp)
jge    12ae <read_arcinfo_mask+0x15e>
lea    -0x230(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1050 <fgets@plt>
cmpl   $0x0,-0x244(%rbp)
jne    11c8 <read_arcinfo_mask+0x78>
lea    -0x230(%rbp),%rdi
lea    0xe4e(%rip),%rsi
lea    -0x234(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmpl   $0x1,-0x244(%rbp)
jne    11f1 <read_arcinfo_mask+0xa1>
lea    -0x230(%rbp),%rdi
lea    0xe25(%rip),%rsi
lea    -0x238(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmpl   $0x2,-0x244(%rbp)
jne    121a <read_arcinfo_mask+0xca>
lea    -0x230(%rbp),%rdi
lea    0xe03(%rip),%rsi
lea    -0x250(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmpl   $0x3,-0x244(%rbp)
jne    1243 <read_arcinfo_mask+0xf3>
lea    -0x230(%rbp),%rdi
lea    0xdda(%rip),%rsi
lea    -0x254(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmpl   $0x4,-0x244(%rbp)
jne    126c <read_arcinfo_mask+0x11c>
lea    -0x230(%rbp),%rdi
lea    0xdb1(%rip),%rsi
lea    -0x258(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
cmpl   $0x5,-0x244(%rbp)
jne    1295 <read_arcinfo_mask+0x145>
lea    -0x230(%rbp),%rdi
lea    0xd81(%rip),%rsi
lea    -0x23c(%rbp),%rdx
mov    $0x0,%al
call   1070 <sscanf@plt>
jmp    129a <read_arcinfo_mask+0x14a>
mov    -0x244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x244(%rbp)
jmp    117d <read_arcinfo_mask+0x2d>
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x248(%rbp)
mov    -0x248(%rbp),%eax
cmp    -0x238(%rbp),%eax
jge    1363 <read_arcinfo_mask+0x213>
movl   $0x0,-0x244(%rbp)
mov    -0x244(%rbp),%eax
cmp    -0x234(%rbp),%eax
jge    134a <read_arcinfo_mask+0x1fa>
mov    -0x8(%rbp),%rdi
lea    0xd11(%rip),%rsi
lea    -0x24c(%rbp),%rdx
call   1040 <fscanf@plt>
cmpl   $0x0,-0x24c(%rbp)
jle    1331 <read_arcinfo_mask+0x1e1>
mov    -0x24c(%rbp),%eax
cmp    -0x23c(%rbp),%eax
je     1331 <read_arcinfo_mask+0x1e1>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1336 <read_arcinfo_mask+0x1e6>
mov    -0x244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x244(%rbp)
jmp    12de <read_arcinfo_mask+0x18e>
jmp    134f <read_arcinfo_mask+0x1ff>
mov    -0x248(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x248(%rbp)
jmp    12c2 <read_arcinfo_mask+0x172>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
movl   $0x0,-0x244(%rbp)
cmpl   $0x6,-0x244(%rbp)
jge    1414 <read_arcinfo_mask+0x2c4>
lea    -0x230(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    $0x200,%esi
call   1050 <fgets@plt>
mov    -0x244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x244(%rbp)
jmp    13de <read_arcinfo_mask+0x28e>
movl   $0x0,-0x240(%rbp)
movl   $0x0,-0x248(%rbp)
mov    -0x248(%rbp),%eax
cmp    -0x238(%rbp),%eax
jge    15a9 <read_arcinfo_mask+0x459>
movss  -0x250(%rbp),%xmm1
ff
mov    -0x238(%rbp),%eax
sub    -0x248(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xba6(%rip),%xmm2
subsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x258(%rbp),%xmm2
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x25c(%rbp)
ff
movl   $0x0,-0x244(%rbp)
mov    -0x244(%rbp),%eax
cmp    -0x234(%rbp),%eax
jge    1590 <read_arcinfo_mask+0x440>
movss  -0x254(%rbp),%xmm1
ff
cvtsi2sdl -0x244(%rbp),%xmm0
ff
movsd  0xb52(%rip),%xmm2
addsd  %xmm2,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  -0x258(%rbp),%xmm2
ff
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x260(%rbp)
ff
mov    -0x8(%rbp),%rdi
lea    0xb33(%rip),%rsi
lea    -0x24c(%rbp),%rdx
call   1040 <fscanf@plt>
cmpl   $0x0,-0x24c(%rbp)
jle    1577 <read_arcinfo_mask+0x427>
mov    -0x24c(%rbp),%eax
cmp    -0x23c(%rbp),%eax
je     1577 <read_arcinfo_mask+0x427>
movss  -0x25c(%rbp),%xmm0
ff
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movslq -0x240(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
movss  -0x260(%rbp),%xmm0
ff
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
movslq -0x240(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x248(%rbp),%edx
mov    -0x28(%rbp),%rax
mov    (%rax),%rax
movslq -0x240(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x244(%rbp),%edx
mov    -0x30(%rbp),%rax
mov    (%rax),%rax
movslq -0x240(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x240(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x240(%rbp)
jmp    157c <read_arcinfo_mask+0x42c>
mov    -0x244(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x244(%rbp)
jmp    1484 <read_arcinfo_mask+0x334>
jmp    1595 <read_arcinfo_mask+0x445>
mov    -0x248(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x248(%rbp)
jmp    1428 <read_arcinfo_mask+0x2d8>
add    $0x260,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_arcinfo_mask>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x258,%rsp
mov    %r9,0x48(%rsp)
mov    %r8,0x40(%rsp)
mov    %rcx,0x38(%rsp)
mov    %rdx,0x30(%rsp)
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0x50(%rsp),%r12
lea    0xe89(%rip),%r15
lea    0xe9a(%rip),%r13
xor    %ebp,%ebp
jmp    11ba <read_arcinfo_mask+0x6a>
mov    %r12,%rdi
lea    0xe93(%rip),%rsi
lea    0x18(%rsp),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1070 <sscanf@plt>
add    $0x1,%ebp
mov    %r12,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
cmp    $0x5,%ebp
ja     11b7 <read_arcinfo_mask+0x67>
mov    %ebp,%eax
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
mov    %r12,%rdi
mov    %r13,%rsi
lea    0xc(%rsp),%rdx
jmp    11b0 <read_arcinfo_mask+0x60>
mov    %r12,%rdi
mov    %r13,%rsi
lea    0x8(%rsp),%rdx
jmp    11b0 <read_arcinfo_mask+0x60>
mov    %r12,%rdi
lea    0xe31(%rip),%rsi
lea    0x2c(%rsp),%rdx
jmp    11b0 <read_arcinfo_mask+0x60>
mov    %r12,%rdi
lea    0xe20(%rip),%rsi
lea    0x28(%rsp),%rdx
jmp    11b0 <read_arcinfo_mask+0x60>
lea    0xe0b(%rip),%rsi
xor    %ebp,%ebp
lea    0x50(%rsp),%rdi
lea    0x1c(%rsp),%rdx
xor    %eax,%eax
call   1070 <sscanf@plt>
movl   $0x0,(%r14)
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    12b0 <read_arcinfo_mask+0x160>
xor    %r12d,%r12d
mov    0xc(%rsp),%ecx
lea    0xddf(%rip),%r13
lea    0x10(%rsp),%r15
jmp    126d <read_arcinfo_mask+0x11d>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rsp),%eax
add    $0x1,%r12d
cmp    %eax,%r12d
jge    12ad <read_arcinfo_mask+0x15d>
test   %ecx,%ecx
jle    1264 <read_arcinfo_mask+0x114>
xor    %ebp,%ebp
jmp    128b <read_arcinfo_mask+0x13b>
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%ebp
mov    0xc(%rsp),%ecx
cmp    %ecx,%ebp
jge    1260 <read_arcinfo_mask+0x110>
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r15,%rdx
call   1040 <fscanf@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    1280 <read_arcinfo_mask+0x130>
cmp    0x1c(%rsp),%eax
je     1280 <read_arcinfo_mask+0x130>
addl   $0x1,(%r14)
jmp    1280 <read_arcinfo_mask+0x130>
mov    (%r14),%ebp
mov    %ebp,%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    0x30(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%r14),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    0x38(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%r14),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    0x40(%rsp),%rcx
mov    %rax,(%rcx)
mov    (%r14),%edi
mov    $0x4,%esi
call   1060 <calloc@plt>
mov    0x48(%rsp),%rcx
mov    %rax,(%rcx)
mov    %rbx,%rdi
call   1030 <rewind@plt>
lea    0x50(%rsp),%rbp
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    %rbp,%rdi
mov    $0x200,%esi
mov    %rbx,%rdx
call   1050 <fgets@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    149a <read_arcinfo_mask+0x34a>
xor    %ebp,%ebp
mov    0xc(%rsp),%ecx
lea    0xca3(%rip),%r15
lea    0x10(%rsp),%r14
xor    %r12d,%r12d
jmp    13b1 <read_arcinfo_mask+0x261>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    0x8(%rsp),%eax
add    $0x1,%r12d
cmp    %r12d,%eax
jle    149a <read_arcinfo_mask+0x34a>
mov    %eax,%edx
sub    %r12d,%edx
xorps  %xmm0,%xmm0
cvtsi2sd %edx,%xmm0
addsd  0xc3b(%rip),%xmm0
test   %ecx,%ecx
jle    13a4 <read_arcinfo_mask+0x254>
cvtsd2ss %xmm0,%xmm0
movss  0x18(%rsp),%xmm1
movss  %xmm1,0x14(%rsp)
mulss  %xmm1,%xmm0
addss  0x2c(%rsp),%xmm0
movss  %xmm0,0x20(%rsp)
mov    $0x1,%r13d
nop
movss  0x28(%rsp),%xmm0
movss  %xmm0,0x24(%rsp)
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1040 <fscanf@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
jle    1478 <read_arcinfo_mask+0x328>
cmp    0x1c(%rsp),%eax
je     1478 <read_arcinfo_mask+0x328>
lea    -0x1(%r13),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xbdd(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  0x14(%rsp),%xmm0
addss  0x24(%rsp),%xmm0
mov    0x30(%rsp),%rcx
mov    (%rcx),%rcx
movslq %ebp,%rbp
movss  0x20(%rsp),%xmm1
movss  %xmm1,(%rcx,%rbp,4)
mov    0x38(%rsp),%rcx
mov    (%rcx),%rcx
movss  %xmm0,(%rcx,%rbp,4)
mov    0x40(%rsp),%rcx
mov    (%rcx),%rcx
mov    %r12d,(%rcx,%rbp,4)
mov    0x48(%rsp),%rcx
mov    (%rcx),%rcx
mov    %eax,(%rcx,%rbp,4)
add    $0x1,%ebp
mov    0xc(%rsp),%ecx
cmp    %ecx,%r13d
jge    13a0 <read_arcinfo_mask+0x250>
movss  0x18(%rsp),%xmm0
movss  %xmm0,0x14(%rsp)
add    $0x1,%r13d
jmp    13f0 <read_arcinfo_mask+0x2a0>
add    $0x258,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%*s %i\00"
@.str.1 = [7 x i8] c"%*s %f\00"
@.str.2 = [3 x i8] c"%i\00"
define void @read_arcinfo_mask(i32* %0, i32* %1, float** %2, float** %3, i32** %4, i32** %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca float**
%10 = alloca float**
%11 = alloca i32**
%12 = alloca i32**
%13 = alloca [512 x i8]
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca float
%22 = alloca float
%23 = alloca float
%24 = alloca float
%25 = alloca float
store i32* %0, i32** %7
store i32* %1, i32** %8
store float** %2, float*** %9
store float** %3, float*** %10
store i32** %4, i32*** %11
store i32** %5, i32*** %12
store i32 0, i32* %18
br label %26
26: ; preds = %69, %6
%27 = load i32, i32* %18
%28 = icmp slt i32 %27, 6
br i1 %28, label %29, label %72
29: ; preds = %26
%30 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%31 = load i32*, i32** %7
%32 = call i32 @fgets(i8* %30, i32 512, i32* %31)
%33 = load i32, i32* %18
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %38
35: ; preds = %29
%36 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%37 = call i32 (i8*, i8*, ...) @sscanf(i8* %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %14)
br label %38
38: ; preds = %35, %29
%39 = load i32, i32* %18
%40 = icmp eq i32 %39, 1
br i1 %40, label %41, label %44
41: ; preds = %38
%42 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%43 = call i32 (i8*, i8*, ...) @sscanf(i8* %42, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %15)
br label %44
44: ; preds = %41, %38
%45 = load i32, i32* %18
%46 = icmp eq i32 %45, 2
br i1 %46, label %47, label %50
47: ; preds = %44
%48 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%49 = call i32 (i8*, i8*, ...) @sscanf(i8* %48, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %21)
br label %50
50: ; preds = %47, %44
%51 = load i32, i32* %18
%52 = icmp eq i32 %51, 3
br i1 %52, label %53, label %56
53: ; preds = %50
%54 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%55 = call i32 (i8*, i8*, ...) @sscanf(i8* %54, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %22)
br label %56
56: ; preds = %53, %50
%57 = load i32, i32* %18
%58 = icmp eq i32 %57, 4
br i1 %58, label %59, label %62
59: ; preds = %56
%60 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%61 = call i32 (i8*, i8*, ...) @sscanf(i8* %60, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %23)
br label %62
62: ; preds = %59, %56
%63 = load i32, i32* %18
%64 = icmp eq i32 %63, 5
br i1 %64, label %65, label %68
65: ; preds = %62
%66 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%67 = call i32 (i8*, i8*, ...) @sscanf(i8* %66, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %16)
br label %68
68: ; preds = %65, %62
br label %69
69: ; preds = %68
%70 = load i32, i32* %18
%71 = add nsw i32 %70, 1
store i32 %71, i32* %18
br label %26
72: ; preds = %26
%73 = load i32*, i32** %8
store i32 0, i32* %73
store i32 0, i32* %19
br label %74
74: ; preds = %101, %72
%75 = load i32, i32* %19
%76 = load i32, i32* %15
%77 = icmp slt i32 %75, %76
br i1 %77, label %78, label %104
78: ; preds = %74
store i32 0, i32* %18
br label %79
79: ; preds = %97, %78
%80 = load i32, i32* %18
%81 = load i32, i32* %14
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %100
83: ; preds = %79
%84 = load i32*, i32** %7
%85 = call i32 @fscanf(i32* %84, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %20)
%86 = load i32, i32* %20
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %96
88: ; preds = %83
%89 = load i32, i32* %20
%90 = load i32, i32* %16
%91 = icmp ne i32 %89, %90
br i1 %91, label %92, label %96
92: ; preds = %88
%93 = load i32*, i32** %8
%94 = load i32, i32* %93
%95 = add nsw i32 %94, 1
store i32 %95, i32* %93
br label %96
96: ; preds = %92, %88, %83
br label %97
97: ; preds = %96
%98 = load i32, i32* %18
%99 = add nsw i32 %98, 1
store i32 %99, i32* %18
br label %79
100: ; preds = %79
br label %101
101: ; preds = %100
%102 = load i32, i32* %19
%103 = add nsw i32 %102, 1
store i32 %103, i32* %19
br label %74
104: ; preds = %74
%105 = load i32*, i32** %8
%106 = load i32, i32* %105
%107 = call i64 @calloc(i32 %106, i32 4)
%108 = inttoptr i64 %107 to float*
%109 = load float**, float*** %9
store float* %108, float** %109
%110 = load i32*, i32** %8
%111 = load i32, i32* %110
%112 = call i64 @calloc(i32 %111, i32 4)
%113 = inttoptr i64 %112 to float*
%114 = load float**, float*** %10
store float* %113, float** %114
%115 = load i32*, i32** %8
%116 = load i32, i32* %115
%117 = call i64 @calloc(i32 %116, i32 4)
%118 = inttoptr i64 %117 to i32*
%119 = load i32**, i32*** %11
store i32* %118, i32** %119
%120 = load i32*, i32** %8
%121 = load i32, i32* %120
%122 = call i64 @calloc(i32 %121, i32 4)
%123 = inttoptr i64 %122 to i32*
%124 = load i32**, i32*** %12
store i32* %123, i32** %124
%125 = load i32*, i32** %7
%126 = call i32 @rewind(i32* %125)
store i32 0, i32* %18
br label %127
127: ; preds = %134, %104
%128 = load i32, i32* %18
%129 = icmp slt i32 %128, 6
br i1 %129, label %130, label %137
130: ; preds = %127
%131 = getelementptr inbounds [512 x i8], [512 x i8]* %13, i64 0, i64 0
%132 = load i32*, i32** %7
%133 = call i32 @fgets(i8* %131, i32 512, i32* %132)
br label %134
134: ; preds = %130
%135 = load i32, i32* %18
%136 = add nsw i32 %135, 1
store i32 %136, i32* %18
br label %127
137: ; preds = %127
store i32 0, i32* %17
store i32 0, i32* %19
br label %138
138: ; preds = %204, %137
%139 = load i32, i32* %19
%140 = load i32, i32* %15
%141 = icmp slt i32 %139, %140
br i1 %141, label %142, label %207
142: ; preds = %138
%143 = load float, float* %21
%144 = load i32, i32* %15
%145 = load i32, i32* %19
%146 = sub nsw i32 %144, %145
%147 = sitofp i32 %146 to double
%148 = fsub double %147, 5.000000e-01
%149 = fptrunc double %148 to float
%150 = load float, float* %23
%151 = call float @llvm.fmuladd.f32(float %149, float %150, float %143)
store float %151, float* %24
store i32 0, i32* %18
br label %152
152: ; preds = %200, %142
%153 = load i32, i32* %18
%154 = load i32, i32* %14
%155 = icmp slt i32 %153, %154
br i1 %155, label %156, label %203
156: ; preds = %152
%157 = load float, float* %22
%158 = load i32, i32* %18
%159 = sitofp i32 %158 to double
%160 = fadd double %159, 5.000000e-01
%161 = fptrunc double %160 to float
%162 = load float, float* %23
%163 = call float @llvm.fmuladd.f32(float %161, float %162, float %157)
store float %163, float* %25
%164 = load i32*, i32** %7
%165 = call i32 @fscanf(i32* %164, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %20)
%166 = load i32, i32* %20
%167 = icmp sgt i32 %166, 0
br i1 %167, label %168, label %199
168: ; preds = %156
%169 = load i32, i32* %20
%170 = load i32, i32* %16
%171 = icmp ne i32 %169, %170
br i1 %171, label %172, label %199
172: ; preds = %168
%173 = load float, float* %24
%174 = load float**, float*** %9
%175 = load float*, float** %174
%176 = load i32, i32* %17
%177 = sext i32 %176 to i64
%178 = getelementptr inbounds float, float* %175, i64 %177
store float %173, float* %178
%179 = load float, float* %25
%180 = load float**, float*** %10
%181 = load float*, float** %180
%182 = load i32, i32* %17
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds float, float* %181, i64 %183
store float %179, float* %184
%185 = load i32, i32* %19
%186 = load i32**, i32*** %11
%187 = load i32*, i32** %186
%188 = load i32, i32* %17
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds i32, i32* %187, i64 %189
store i32 %185, i32* %190
%191 = load i32, i32* %18
%192 = load i32**, i32*** %12
%193 = load i32*, i32** %192
%194 = load i32, i32* %17
%195 = sext i32 %194 to i64
%196 = getelementptr inbounds i32, i32* %193, i64 %195
store i32 %191, i32* %196
%197 = load i32, i32* %17
%198 = add nsw i32 %197, 1
store i32 %198, i32* %17
br label %199
199: ; preds = %172, %168, %156
br label %200
200: ; preds = %199
%201 = load i32, i32* %18
%202 = add nsw i32 %201, 1
store i32 %202, i32* %18
br label %152
203: ; preds = %152
br label %204
204: ; preds = %203
%205 = load i32, i32* %19
%206 = add nsw i32 %205, 1
store i32 %206, i32* %19
br label %138
207: ; preds = %138
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%*s %i\00"
@.str.1 = [7 x i8] c"%*s %f\00"
@.str.2 = [3 x i8] c"%i\00"
define void @read_arcinfo_mask(i32* nocapture %0, i32* nocapture %1, float** nocapture %2, float** nocapture %3, i32** nocapture %4, i32** nocapture %5) {
%7 = alloca [512 x i8]
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca float
%13 = alloca float
%14 = alloca float
%15 = getelementptr inbounds [512 x i8], [512 x i8]* %7, i64 0, i64 0
%16 = bitcast i32* %8 to i8*
%17 = bitcast i32* %9 to i8*
%18 = bitcast i32* %10 to i8*
%19 = bitcast i32* %11 to i8*
%20 = bitcast float* %12 to i8*
%21 = bitcast float* %13 to i8*
%22 = bitcast float* %14 to i8*
br label %23
23: ; preds = %36, %6
%24 = phi i32 [ 0, %6 ], [ %37, %36 ]
%25 = call i32 @fgets(i8* %15, i32 512, i32* %0)
switch i32 %24, label %36 [
i32 0, label %26
i32 1, label %28
i32 2, label %30
i32 3, label %32
i32 4, label %34
i32 5, label %38
]
26: ; preds = %23
%27 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %8)
br label %36
28: ; preds = %23
%29 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %9)
br label %36
30: ; preds = %23
%31 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %12)
br label %36
32: ; preds = %23
%33 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %13)
br label %36
34: ; preds = %23
%35 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), float* %14)
br label %36
36: ; preds = %34, %32, %30, %28, %26, %23
%37 = add nuw nsw i32 %24, 1
br label %23
38: ; preds = %23
%39 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32* %10)
store i32 0, i32* %1
%40 = load i32, i32* %9
%41 = icmp sgt i32 %40, 0
br i1 %41, label %42, label %73
42: ; preds = %38
%43 = load i32, i32* %8
br label %44
44: ; preds = %42, %66
%45 = phi i32 [ %67, %66 ], [ %40, %42 ]
%46 = phi i32 [ %68, %66 ], [ %43, %42 ]
%47 = phi i32 [ %69, %66 ], [ 0, %42 ]
%48 = icmp sgt i32 %46, 0
br i1 %48, label %49, label %66
49: ; preds = %44, %60
%50 = phi i32 [ %61, %60 ], [ 0, %44 ]
%51 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%52 = load i32, i32* %11
%53 = icmp slt i32 %52, 1
%54 = load i32, i32* %10
%55 = icmp eq i32 %52, %54
%56 = select i1 %53, i1 true, i1 %55
br i1 %56, label %60, label %57
57: ; preds = %49
%58 = load i32, i32* %1
%59 = add nsw i32 %58, 1
store i32 %59, i32* %1
br label %60
60: ; preds = %49, %57
%61 = add nuw nsw i32 %50, 1
%62 = load i32, i32* %8
%63 = icmp slt i32 %61, %62
br i1 %63, label %49, label %64
64: ; preds = %60
%65 = load i32, i32* %9
br label %66
66: ; preds = %64, %44
%67 = phi i32 [ %65, %64 ], [ %45, %44 ]
%68 = phi i32 [ %62, %64 ], [ %46, %44 ]
%69 = add nuw nsw i32 %47, 1
%70 = icmp slt i32 %69, %67
br i1 %70, label %44, label %71
71: ; preds = %66
%72 = load i32, i32* %1
br label %73
73: ; preds = %71, %38
%74 = phi i32 [ %72, %71 ], [ 0, %38 ]
%75 = call i64 @calloc(i32 %74, i32 4)
%76 = inttoptr i64 %75 to float*
store float* %76, float** %2
%77 = load i32, i32* %1
%78 = call i64 @calloc(i32 %77, i32 4)
%79 = inttoptr i64 %78 to float*
store float* %79, float** %3
%80 = load i32, i32* %1
%81 = call i64 @calloc(i32 %80, i32 4)
%82 = inttoptr i64 %81 to i32*
store i32* %82, i32** %4
%83 = load i32, i32* %1
%84 = call i64 @calloc(i32 %83, i32 4)
%85 = inttoptr i64 %84 to i32*
store i32* %85, i32** %5
%86 = call i32 @rewind(i32* %0)
%87 = call i32 @fgets(i8* %15, i32 512, i32* %0)
%88 = call i32 @fgets(i8* %15, i32 512, i32* %0)
%89 = call i32 @fgets(i8* %15, i32 512, i32* %0)
%90 = call i32 @fgets(i8* %15, i32 512, i32* %0)
%91 = call i32 @fgets(i8* %15, i32 512, i32* %0)
%92 = call i32 @fgets(i8* %15, i32 512, i32* %0)
%93 = load i32, i32* %9
%94 = icmp sgt i32 %93, 0
br i1 %94, label %95, label %151
95: ; preds = %73
%96 = load i32, i32* %8
br label %97
97: ; preds = %95, %145
%98 = phi i32 [ %146, %145 ], [ %93, %95 ]
%99 = phi i32 [ %147, %145 ], [ %96, %95 ]
%100 = phi i32 [ %148, %145 ], [ 0, %95 ]
%101 = phi i32 [ %149, %145 ], [ 0, %95 ]
%102 = load float, float* %12
%103 = sub nsw i32 %98, %101
%104 = sitofp i32 %103 to double
%105 = fadd double %104, -5.000000e-01
%106 = fptrunc double %105 to float
%107 = load float, float* %14
%108 = call float @llvm.fmuladd.f32(float %106, float %107, float %102)
%109 = icmp sgt i32 %99, 0
br i1 %109, label %110, label %145
110: ; preds = %97, %141
%111 = phi float [ %142, %141 ], [ %107, %97 ]
%112 = phi i32 [ %137, %141 ], [ %100, %97 ]
%113 = phi i32 [ %138, %141 ], [ 0, %97 ]
%114 = load float, float* %13
%115 = call i32 @fscanf(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %11)
%116 = load i32, i32* %11
%117 = icmp slt i32 %116, 1
%118 = load i32, i32* %10
%119 = icmp eq i32 %116, %118
%120 = select i1 %117, i1 true, i1 %119
br i1 %120, label %136, label %121
121: ; preds = %110
%122 = sitofp i32 %113 to double
%123 = fadd double %122, 5.000000e-01
%124 = fptrunc double %123 to float
%125 = call float @llvm.fmuladd.f32(float %124, float %111, float %114)
%126 = load float*, float** %2
%127 = sext i32 %112 to i64
%128 = getelementptr inbounds float, float* %126, i64 %127
store float %108, float* %128
%129 = load float*, float** %3
%130 = getelementptr inbounds float, float* %129, i64 %127
store float %125, float* %130
%131 = load i32*, i32** %4
%132 = getelementptr inbounds i32, i32* %131, i64 %127
store i32 %101, i32* %132
%133 = load i32*, i32** %5
%134 = getelementptr inbounds i32, i32* %133, i64 %127
store i32 %113, i32* %134
%135 = add nsw i32 %112, 1
br label %136
136: ; preds = %110, %121
%137 = phi i32 [ %135, %121 ], [ %112, %110 ]
%138 = add nuw nsw i32 %113, 1
%139 = load i32, i32* %8
%140 = icmp slt i32 %138, %139
br i1 %140, label %141, label %143
141: ; preds = %136
%142 = load float, float* %14
br label %110
143: ; preds = %136
%144 = load i32, i32* %9
br label %145
145: ; preds = %143, %97
%146 = phi i32 [ %98, %97 ], [ %144, %143 ]
%147 = phi i32 [ %99, %97 ], [ %139, %143 ]
%148 = phi i32 [ %100, %97 ], [ %137, %143 ]
%149 = add nuw nsw i32 %101, 1
%150 = icmp sgt i32 %146, %149
br i1 %150, label %97, label %151
151: ; preds = %145, %73
ret void
}