#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*/ exit(int);
double fabs(float);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ free(float *);
int fscanf(int /*<<< orphan*/ *, char *, float *, float *, ...);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stderr;
main(int argc, char **argv) {
  float *lat, *lon;
  float llt, lln, value[3], junk;
  int i, j, istart;
  FILE *fp, *fp2, *fp3, *fp4;
  char nomatch;
  nomatch = !0;
  if (argc != 3) {
    printf("Wrong command line arguments: enter <inputfile> <outputfile>  .\n");
    exit(0);
  }
  lat = (float *)calloc(1961, sizeof(float));
  lon = (float *)calloc(1961, sizeof(float));
  if (lat == NULL || lon == NULL) {
    fprintf(stderr, "Error allocaing\n");
    exit(-1);
  }
  fp3 = fopen("zb_025.ll", "r");
  if (fp3 == NULL) {
    fprintf(stderr, "NULL   \n");
    exit(3);
  }
  for (j = 0; j < 1961; j++) {
    if (fscanf(fp3, "%f %f\n", &lat[j], &lon[j]) != 2) {
      fprintf(stderr, "error reading listcell\n");
      exit(-1);
    }
  }
  fclose(fp3);
  fp = fopen(argv[1], "r");
  fprintf(stderr, "opening inputfile\n");
  if (fp == NULL) {
    fprintf(stderr, "NULL  %s \n", argv[1]);
    exit(1);
  }
  fp2 = fopen(argv[2], "w");
  if (fp2 == NULL) {
    fprintf(stderr, "NULL   %s \n", argv[2]);
    exit(2);
  }
  fp4 = fopen("zb_box_latlon", "r");
  if (fp4 == NULL) {
    fprintf(stderr, "NULL   lonlat \n");
    exit(4);
  }
  for (j = 0; j < 4480; j++) {
    if (fscanf(fp4, "%f %f\n", &lln, &llt) != 2) {
      fprintf(stderr, "Error readind zb_box_latlon\n");
      exit(-1);
    }
    if (fscanf(fp, "%f %f %f\n", &value[0], &value[1], &value[2]) != 3) {
      fprintf(stderr, "error reading %s at %d\n", argv[1], j);
      exit(3);
    }
    nomatch = !0;
    i = -1;
    while (i < 1961 && nomatch) {
      i++;
      if (fabs(llt - lat[i]) < 0.001 && fabs(lln - lon[i]) < 0.001) {
        fprintf(fp2, " %.4f %.4f %.4f \n", value[0], value[1], value[2]);
        nomatch = 0;
      }
    }
  }
  fclose(fp2);
  fclose(fp);
  fclose(fp4);
  free(lat);
  free(lon);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x1,-0x69(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     11c7 <main+0x37>
lea    0xe4d(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    $0x7a9,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x7a9,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1203 <main+0x73>
cmpq   $0x0,-0x20(%rbp)
jne    1225 <main+0x95>
mov    0x2dd6(%rip),%rax
movslq (%rax),%rdi
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
lea    0xe2e(%rip),%rdi
lea    0xe31(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x60(%rbp)
cmpq   $0x0,-0x60(%rbp)
jne    1269 <main+0xd9>
mov    0x2d92(%rip),%rax
movslq (%rax),%rdi
lea    0xe0e(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10b0 <exit@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0x7a9,-0x40(%rbp)
jge    12eb <main+0x15b>
mov    -0x60(%rbp),%rdi
mov    -0x18(%rbp),%rdx
movslq -0x40(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdx
mov    -0x20(%rbp),%rcx
movslq -0x40(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xe4b(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
cmp    $0x2,%eax
je     12d8 <main+0x148>
mov    0x2d23(%rip),%rax
movslq (%rax),%rdi
lea    0xda8(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
jmp    12dd <main+0x14d>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    1270 <main+0xe0>
mov    -0x60(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xd61(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x50(%rbp)
mov    0x2ccd(%rip),%rax
movslq (%rax),%rdi
lea    0xd6a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
cmpq   $0x0,-0x50(%rbp)
jne    1359 <main+0x1c9>
mov    0x2caa(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
lea    0xd52(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xd3d(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x58(%rbp)
jne    13a6 <main+0x216>
mov    0x2c5d(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdx
lea    0xd12(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x2,%edi
call   10b0 <exit@plt>
lea    0xd06(%rip),%rdi
lea    0xcb0(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x68(%rbp)
cmpq   $0x0,-0x68(%rbp)
jne    13ea <main+0x25a>
mov    0x2c11(%rip),%rax
movslq (%rax),%rdi
lea    0xce8(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x4,%edi
call   10b0 <exit@plt>
movl   $0x0,-0x40(%rbp)
cmpl   $0x1180,-0x40(%rbp)
jge    1583 <main+0x3f3>
mov    -0x68(%rbp),%rdi
lea    0xce8(%rip),%rsi
lea    -0x28(%rbp),%rdx
lea    -0x24(%rbp),%rcx
mov    $0x0,%al
call   1060 <fscanf@plt>
cmp    $0x2,%eax
je     1443 <main+0x2b3>
mov    0x2bb8(%rip),%rax
movslq (%rax),%rdi
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
mov    -0x50(%rbp),%rdi
lea    -0x34(%rbp),%rdx
lea    -0x34(%rbp),%rcx
add    $0x4,%rcx
lea    -0x34(%rbp),%r8
add    $0x8,%r8
lea    0xc8c(%rip),%rsi
mov    $0x0,%al
call   1060 <fscanf@plt>
cmp    $0x3,%eax
je     149f <main+0x30f>
mov    0x2b67(%rip),%rax
movslq (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x40(%rbp),%ecx
lea    0xc6a(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10b0 <exit@plt>
movb   $0x1,-0x69(%rbp)
movl   $0xffffffff,-0x3c(%rbp)
xor    %eax,%eax
cmpl   $0x7a9,-0x3c(%rbp)
mov    %al,-0x6a(%rbp)
jge    14c9 <main+0x339>
movsbl -0x69(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x6a(%rbp)
mov    -0x6a(%rbp),%al
test   $0x1,%al
jne    14d9 <main+0x349>
jmp    1570 <main+0x3e0>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
movss  -0x24(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
call   1080 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xafc(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    156b <main+0x3db>
movss  -0x28(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x3c(%rbp),%rcx
subss  (%rax,%rcx,4),%xmm0
call   1080 <fabs@plt>
movaps %xmm0,%xmm1
movsd  0xad0(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    156b <main+0x3db>
mov    -0x58(%rbp),%rdi
movss  -0x34(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x30(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x2c(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xbb0(%rip),%rsi
mov    $0x3,%al
call   1090 <fprintf@plt>
movb   $0x0,-0x69(%rbp)
jmp    14aa <main+0x31a>
jmp    1575 <main+0x3e5>
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
jmp    13f1 <main+0x261>
mov    -0x58(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x50(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x68(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
cmp    $0x3,%edi
jne    14c5 <main+0x325>
mov    %rsi,%rbp
mov    $0x7a9,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
mov    %rax,%rbx
mov    $0x7a9,%edi
mov    $0x4,%esi
call   1070 <calloc@plt>
test   %rbx,%rbx
je     14d8 <main+0x338>
mov    %rax,%r15
test   %rax,%rax
je     14d8 <main+0x338>
mov    %rbp,0x18(%rsp)
lea    0xe1d(%rip),%rdi
lea    0xe20(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     14f0 <main+0x350>
mov    %rax,%r12
lea    0xe95(%rip),%r14
xor    %ebp,%ebp
nopl   (%rax)
lea    (%rbx,%rbp,1),%rdx
lea    (%r15,%rbp,1),%rcx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1060 <fscanf@plt>
cmp    $0x2,%eax
jne    1455 <main+0x2b5>
add    $0x4,%rbp
cmp    $0x1ea4,%rbp
jne    1220 <main+0x80>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    0x18(%rsp),%rbp
mov    0x8(%rbp),%rdi
lea    0xdc0(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,%r12
mov    0x2d6e(%rip),%r14
movslq (%r14),%rcx
lea    0xdca(%rip),%rdi
mov    $0x12,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
test   %r12,%r12
je     151a <main+0x37a>
mov    0x10(%rbp),%rdi
lea    0xdc5(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,0x20(%rsp)
test   %rax,%rax
je     1539 <main+0x399>
lea    0xdb9(%rip),%rdi
lea    0xd63(%rip),%rsi
call   10a0 <fopen@plt>
test   %rax,%rax
je     1558 <main+0x3b8>
mov    %rax,%rbp
xor    %r14d,%r14d
jmp    1322 <main+0x182>
cs nopw 0x0(%rax,%rax,1)
movss  0xc(%rsp),%xmm0
movss  0x10(%rsp),%xmm1
cvtss2sd %xmm0,%xmm0
cvtss2sd %xmm1,%xmm1
movss  0x14(%rsp),%xmm2
cvtss2sd %xmm2,%xmm2
mov    0x20(%rsp),%rdi
lea    0xdc5(%rip),%rsi
mov    $0x3,%al
call   1090 <fprintf@plt>
add    $0x1,%r14d
cmp    $0x1180,%r14d
je     141a <main+0x27a>
mov    %rbp,%rdi
lea    0xd84(%rip),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
xor    %eax,%eax
call   1060 <fscanf@plt>
cmp    $0x2,%eax
jne    146d <main+0x2cd>
mov    %r12,%rdi
lea    0xd5d(%rip),%rsi
lea    0xc(%rsp),%rdx
lea    0x10(%rsp),%rcx
lea    0x14(%rsp),%r8
xor    %eax,%eax
call   1060 <fscanf@plt>
cmp    $0x3,%eax
jne    1497 <main+0x2f7>
mov    $0xfffffffffffffffe,%r13
jmp    138d <main+0x1ed>
nopl   0x0(%rax,%rax,1)
add    $0x2,%r13
cmp    $0x7a8,%r13
jae    1311 <main+0x171>
movss  0x8(%rsp),%xmm0
subss  0x8(%rbx,%r13,4),%xmm0
call   1080 <fabs@plt>
movsd  0xc59(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    13d1 <main+0x231>
movss  0x4(%rsp),%xmm0
subss  0x8(%r15,%r13,4),%xmm0
call   1080 <fabs@plt>
movsd  0xc39(%rip),%xmm1
ucomisd %xmm0,%xmm1
ja     12e0 <main+0x140>
movss  0x8(%rsp),%xmm0
subss  0xc(%rbx,%r13,4),%xmm0
call   1080 <fabs@plt>
movsd  0xc15(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1380 <main+0x1e0>
movss  0x4(%rsp),%xmm0
subss  0xc(%r15,%r13,4),%xmm0
call   1080 <fabs@plt>
movsd  0xbf5(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1380 <main+0x1e0>
jmp    12e0 <main+0x140>
mov    0x20(%rsp),%rdi
call   1050 <fclose@plt>
mov    %r12,%rdi
call   1050 <fclose@plt>
mov    %rbp,%rdi
call   1050 <fclose@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15,%rdi
call   1030 <free@plt>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b84(%rip),%rax
movslq (%rax),%rcx
lea    0xbc8(%rip),%rdi
mov    $0x17,%esi
jmp    1483 <main+0x2e3>
mov    0x2b6c(%rip),%rax
movslq (%rax),%rcx
lea    0xc12(%rip),%rdi
mov    $0x1c,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    $0xffffffff,%edi
call   10b0 <exit@plt>
mov    0x2b42(%rip),%rax
movslq (%rax),%rdi
mov    0x18(%rsp),%rax
mov    0x8(%rax),%rdx
lea    0xc06(%rip),%rsi
mov    %r14d,%ecx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x3,%edi
call   10b0 <exit@plt>
lea    0xc15(%rip),%rdi
call   1040 <puts@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    0x2b01(%rip),%rax
movslq (%rax),%rcx
lea    0xb1f(%rip),%rdi
mov    $0x10,%esi
jmp    1483 <main+0x2e3>
mov    0x2ae9(%rip),%rax
movslq (%rax),%rcx
lea    0xb24(%rip),%rdi
mov    $0x8,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    $0x3,%edi
call   10b0 <exit@plt>
movslq (%r14),%rdi
mov    0x8(%rbp),%rdx
lea    0xb31(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   10b0 <exit@plt>
movslq (%r14),%rdi
mov    0x10(%rbp),%rdx
lea    0xb1f(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x2,%edi
call   10b0 <exit@plt>
mov    0x2a81(%rip),%rax
movslq (%rax),%rcx
lea    0xb17(%rip),%rdi
mov    $0xf,%esi
mov    $0x1,%edx
call   10c0 <fwrite@plt>
mov    $0x4,%edi
call   10b0 <exit@plt>

LLVM IR (-O0):
@.str = [65 x i8] c"Wrong command line arguments: enter <inputfile> <outputfile> .\0A\00"
@stderr = global i32 0
@.str.1 = [17 x i8] c"Error allocaing\0A\00"
@.str.2 = [10 x i8] c"zb_025.ll\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [9 x i8] c"NULL \0A\00"
@.str.5 = [7 x i8] c"%f %f\0A\00"
@.str.6 = [24 x i8] c"error reading listcell\0A\00"
@.str.7 = [19 x i8] c"opening inputfile\0A\00"
@.str.8 = [11 x i8] c"NULL %s \0A\00"
@.str.9 = [2 x i8] c"w\00"
@.str.10 = [12 x i8] c"NULL %s \0A\00"
@.str.11 = [14 x i8] c"zb_box_latlon\00"
@.str.12 = [16 x i8] c"NULL lonlat \0A\00"
@.str.13 = [29 x i8] c"Error readind zb_box_latlon\0A\00"
@.str.14 = [10 x i8] c"%f %f %f\0A\00"
@.str.15 = [24 x i8] c"error reading %s at %d\0A\00"
@.str.16 = [18 x i8] c" %.4f %.4f %.4f \0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca float*
%7 = alloca float*
%8 = alloca float
%9 = alloca float
%10 = alloca [3 x float]
%11 = alloca float
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32*
%16 = alloca i32*
%17 = alloca i32*
%18 = alloca i32*
%19 = alloca i8
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 1, i8* %19
%20 = load i32, i32* %4
%21 = icmp ne i32 %20, 3
br i1 %21, label %22, label %25
22: ; preds = %2
%23 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @exit(i32 0)
unreachable
25: ; preds = %2
%26 = call i64 @calloc(i32 1961, i32 4)
%27 = inttoptr i64 %26 to float*
store float* %27, float** %6
%28 = call i64 @calloc(i32 1961, i32 4)
%29 = inttoptr i64 %28 to float*
store float* %29, float** %7
%30 = load float*, float** %6
%31 = icmp eq float* %30, null
br i1 %31, label %35, label %32
32: ; preds = %25
%33 = load float*, float** %7
%34 = icmp eq float* %33, null
br i1 %34, label %35, label %41
35: ; preds = %32, %25
%36 = load i32, i32* @stderr
%37 = sext i32 %36 to i64
%38 = inttoptr i64 %37 to i32*
%39 = call i32 (i32*, i8*, ...) @fprintf(i32* %38, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%40 = call i32 @exit(i32 -1)
unreachable
41: ; preds = %32
%42 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %42, i32** %17
%43 = load i32*, i32** %17
%44 = icmp eq i32* %43, null
br i1 %44, label %45, label %51
45: ; preds = %41
%46 = load i32, i32* @stderr
%47 = sext i32 %46 to i64
%48 = inttoptr i64 %47 to i32*
%49 = call i32 (i32*, i8*, ...) @fprintf(i32* %48, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%50 = call i32 @exit(i32 3)
unreachable
51: ; preds = %41
store i32 0, i32* %13
br label %52
52: ; preds = %74, %51
%53 = load i32, i32* %13
%54 = icmp slt i32 %53, 1961
br i1 %54, label %55, label %77
55: ; preds = %52
%56 = load i32*, i32** %17
%57 = load float*, float** %6
%58 = load i32, i32* %13
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds float, float* %57, i64 %59
%61 = load float*, float** %7
%62 = load i32, i32* %13
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds float, float* %61, i64 %63
%65 = call i32 (i32*, i8*, float*, float*, ...) @fscanf(i32* %56, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float* %60, float* %64)
%66 = icmp ne i32 %65, 2
br i1 %66, label %67, label %73
67: ; preds = %55
%68 = load i32, i32* @stderr
%69 = sext i32 %68 to i64
%70 = inttoptr i64 %69 to i32*
%71 = call i32 (i32*, i8*, ...) @fprintf(i32* %70, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0))
%72 = call i32 @exit(i32 -1)
unreachable
73: ; preds = %55
br label %74
74: ; preds = %73
%75 = load i32, i32* %13
%76 = add nsw i32 %75, 1
store i32 %76, i32* %13
br label %52
77: ; preds = %52
%78 = load i32*, i32** %17
%79 = call i32 @fclose(i32* %78)
%80 = load i8**, i8*** %5
%81 = getelementptr inbounds i8*, i8** %80, i64 1
%82 = load i8*, i8** %81
%83 = call i32* @fopen(i8* %82, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %83, i32** %15
%84 = load i32, i32* @stderr
%85 = sext i32 %84 to i64
%86 = inttoptr i64 %85 to i32*
%87 = call i32 (i32*, i8*, ...) @fprintf(i32* %86, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0))
%88 = load i32*, i32** %15
%89 = icmp eq i32* %88, null
br i1 %89, label %90, label %99
90: ; preds = %77
%91 = load i32, i32* @stderr
%92 = sext i32 %91 to i64
%93 = inttoptr i64 %92 to i32*
%94 = load i8**, i8*** %5
%95 = getelementptr inbounds i8*, i8** %94, i64 1
%96 = load i8*, i8** %95
%97 = call i32 (i32*, i8*, ...) @fprintf(i32* %93, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %96)
%98 = call i32 @exit(i32 1)
unreachable
99: ; preds = %77
%100 = load i8**, i8*** %5
%101 = getelementptr inbounds i8*, i8** %100, i64 2
%102 = load i8*, i8** %101
%103 = call i32* @fopen(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
store i32* %103, i32** %16
%104 = load i32*, i32** %16
%105 = icmp eq i32* %104, null
br i1 %105, label %106, label %115
106: ; preds = %99
%107 = load i32, i32* @stderr
%108 = sext i32 %107 to i64
%109 = inttoptr i64 %108 to i32*
%110 = load i8**, i8*** %5
%111 = getelementptr inbounds i8*, i8** %110, i64 2
%112 = load i8*, i8** %111
%113 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %112)
%114 = call i32 @exit(i32 2)
unreachable
115: ; preds = %99
%116 = call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %116, i32** %18
%117 = load i32*, i32** %18
%118 = icmp eq i32* %117, null
br i1 %118, label %119, label %125
119: ; preds = %115
%120 = load i32, i32* @stderr
%121 = sext i32 %120 to i64
%122 = inttoptr i64 %121 to i32*
%123 = call i32 (i32*, i8*, ...) @fprintf(i32* %122, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0))
%124 = call i32 @exit(i32 4)
unreachable
125: ; preds = %115
store i32 0, i32* %13
br label %126
126: ; preds = %202, %125
%127 = load i32, i32* %13
%128 = icmp slt i32 %127, 4480
br i1 %128, label %129, label %205
129: ; preds = %126
%130 = load i32*, i32** %18
%131 = call i32 (i32*, i8*, float*, float*, ...) @fscanf(i32* %130, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float* %9, float* %8)
%132 = icmp ne i32 %131, 2
br i1 %132, label %133, label %139
133: ; preds = %129
%134 = load i32, i32* @stderr
%135 = sext i32 %134 to i64
%136 = inttoptr i64 %135 to i32*
%137 = call i32 (i32*, i8*, ...) @fprintf(i32* %136, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0))
%138 = call i32 @exit(i32 -1)
unreachable
139: ; preds = %129
%140 = load i32*, i32** %15
%141 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%142 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 1
%143 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 2
%144 = call i32 (i32*, i8*, float*, float*, ...) @fscanf(i32* %140, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), float* %141, float* %142, float* %143)
%145 = icmp ne i32 %144, 3
br i1 %145, label %146, label %156
146: ; preds = %139
%147 = load i32, i32* @stderr
%148 = sext i32 %147 to i64
%149 = inttoptr i64 %148 to i32*
%150 = load i8**, i8*** %5
%151 = getelementptr inbounds i8*, i8** %150, i64 1
%152 = load i8*, i8** %151
%153 = load i32, i32* %13
%154 = call i32 (i32*, i8*, ...) @fprintf(i32* %149, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %152, i32 %153)
%155 = call i32 @exit(i32 3)
unreachable
156: ; preds = %139
store i8 1, i8* %19
store i32 -1, i32* %12
br label %157
157: ; preds = %200, %156
%158 = load i32, i32* %12
%159 = icmp slt i32 %158, 1961
br i1 %159, label %160, label %164
160: ; preds = %157
%161 = load i8, i8* %19
%162 = sext i8 %161 to i32
%163 = icmp ne i32 %162, 0
br label %164
164: ; preds = %160, %157
%165 = phi i1 [ false, %157 ], [ %163, %160 ]
br i1 %165, label %166, label %201
166: ; preds = %164
%167 = load i32, i32* %12
%168 = add nsw i32 %167, 1
store i32 %168, i32* %12
%169 = load float, float* %8
%170 = load float*, float** %6
%171 = load i32, i32* %12
%172 = sext i32 %171 to i64
%173 = getelementptr inbounds float, float* %170, i64 %172
%174 = load float, float* %173
%175 = fsub float %169, %174
%176 = call double @fabs(float %175)
%177 = fcmp olt double %176, 1.000000e-03
br i1 %177, label %178, label %200
178: ; preds = %166
%179 = load float, float* %9
%180 = load float*, float** %7
%181 = load i32, i32* %12
%182 = sext i32 %181 to i64
%183 = getelementptr inbounds float, float* %180, i64 %182
%184 = load float, float* %183
%185 = fsub float %179, %184
%186 = call double @fabs(float %185)
%187 = fcmp olt double %186, 1.000000e-03
br i1 %187, label %188, label %200
188: ; preds = %178
%189 = load i32*, i32** %16
%190 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 0
%191 = load float, float* %190
%192 = fpext float %191 to double
%193 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 1
%194 = load float, float* %193
%195 = fpext float %194 to double
%196 = getelementptr inbounds [3 x float], [3 x float]* %10, i64 0, i64 2
%197 = load float, float* %196
%198 = fpext float %197 to double
%199 = call i32 (i32*, i8*, ...) @fprintf(i32* %189, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), double %192, double %195, double %198)
store i8 0, i8* %19
br label %200
200: ; preds = %188, %178, %166
br label %157
201: ; preds = %164
br label %202
202: ; preds = %201
%203 = load i32, i32* %13
%204 = add nsw i32 %203, 1
store i32 %204, i32* %13
br label %126
205: ; preds = %126
%206 = load i32*, i32** %16
%207 = call i32 @fclose(i32* %206)
%208 = load i32*, i32** %15
%209 = call i32 @fclose(i32* %208)
%210 = load i32*, i32** %18
%211 = call i32 @fclose(i32* %210)
%212 = load float*, float** %6
%213 = call i32 @free(float* %212)
%214 = load float*, float** %7
%215 = call i32 @free(float* %214)
%216 = load i32, i32* %3
ret i32 %216
}

LLVM IR (-O2):
@stderr = global i32 0
@.str.1 = [17 x i8] c"Error allocaing\0A\00"
@.str.2 = [10 x i8] c"zb_025.ll\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [9 x i8] c"NULL \0A\00"
@.str.5 = [7 x i8] c"%f %f\0A\00"
@.str.6 = [24 x i8] c"error reading listcell\0A\00"
@.str.7 = [19 x i8] c"opening inputfile\0A\00"
@.str.8 = [11 x i8] c"NULL %s \0A\00"
@.str.9 = [2 x i8] c"w\00"
@.str.10 = [12 x i8] c"NULL %s \0A\00"
@.str.11 = [14 x i8] c"zb_box_latlon\00"
@.str.12 = [16 x i8] c"NULL lonlat \0A\00"
@.str.13 = [29 x i8] c"Error readind zb_box_latlon\0A\00"
@.str.14 = [10 x i8] c"%f %f %f\0A\00"
@.str.15 = [24 x i8] c"error reading %s at %d\0A\00"
@.str.16 = [18 x i8] c" %.4f %.4f %.4f \0A\00"
@str = [64 x i8] c"Wrong command line arguments: enter <inputfile> <outputfile> .\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca [3 x float]
%6 = bitcast float* %3 to i8*
%7 = bitcast float* %4 to i8*
%8 = bitcast [3 x float]* %5 to i8*
%9 = icmp eq i32 %0, 3
br i1 %9, label %13, label %10
10: ; preds = %2
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @str, i64 0, i64 0))
%12 = tail call i32 @exit(i32 0)
unreachable
13: ; preds = %2
%14 = tail call i64 @calloc(i32 1961, i32 4)
%15 = inttoptr i64 %14 to float*
%16 = tail call i64 @calloc(i32 1961, i32 4)
%17 = inttoptr i64 %16 to float*
%18 = icmp eq i64 %14, 0
%19 = icmp eq i64 %16, 0
%20 = select i1 %18, i1 true, i1 %19
br i1 %20, label %21, label %27
21: ; preds = %13
%22 = load i32, i32* @stderr
%23 = sext i32 %22 to i64
%24 = inttoptr i64 %23 to i32*
%25 = tail call i64 @fwrite(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i64 16, i64 1, i32* %24)
%26 = tail call i32 @exit(i32 -1)
unreachable
27: ; preds = %13
%28 = tail call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%29 = icmp eq i32* %28, null
br i1 %29, label %30, label %39
30: ; preds = %27
%31 = load i32, i32* @stderr
%32 = sext i32 %31 to i64
%33 = inttoptr i64 %32 to i32*
%34 = tail call i64 @fwrite(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i64 8, i64 1, i32* %33)
%35 = tail call i32 @exit(i32 3)
unreachable
36: ; preds = %39
%37 = add nuw nsw i64 %40, 1
%38 = icmp eq i64 %37, 1961
br i1 %38, label %51, label %39
39: ; preds = %27, %36
%40 = phi i64 [ %37, %36 ], [ 0, %27 ]
%41 = getelementptr inbounds float, float* %15, i64 %40
%42 = getelementptr inbounds float, float* %17, i64 %40
%43 = tail call i32 (i32*, i8*, float*, float*, ...) @fscanf(i32* %28, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float* %41, float* %42)
%44 = icmp eq i32 %43, 2
br i1 %44, label %36, label %45
45: ; preds = %39
%46 = load i32, i32* @stderr
%47 = sext i32 %46 to i64
%48 = inttoptr i64 %47 to i32*
%49 = tail call i64 @fwrite(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.6, i64 0, i64 0), i64 23, i64 1, i32* %48)
%50 = tail call i32 @exit(i32 -1)
unreachable
51: ; preds = %36
%52 = tail call i32 @fclose(i32* %28)
%53 = getelementptr inbounds i8*, i8** %1, i64 1
%54 = load i8*, i8** %53
%55 = tail call i32* @fopen(i8* %54, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%56 = load i32, i32* @stderr
%57 = sext i32 %56 to i64
%58 = inttoptr i64 %57 to i32*
%59 = tail call i64 @fwrite(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.7, i64 0, i64 0), i64 18, i64 1, i32* %58)
%60 = icmp eq i32* %55, null
br i1 %60, label %61, label %68
61: ; preds = %51
%62 = load i32, i32* @stderr
%63 = sext i32 %62 to i64
%64 = inttoptr i64 %63 to i32*
%65 = load i8*, i8** %53
%66 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %64, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.8, i64 0, i64 0), i8* %65)
%67 = tail call i32 @exit(i32 1)
unreachable
68: ; preds = %51
%69 = getelementptr inbounds i8*, i8** %1, i64 2
%70 = load i8*, i8** %69
%71 = tail call i32* @fopen(i8* %70, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.9, i64 0, i64 0))
%72 = icmp eq i32* %71, null
br i1 %72, label %73, label %80
73: ; preds = %68
%74 = load i32, i32* @stderr
%75 = sext i32 %74 to i64
%76 = inttoptr i64 %75 to i32*
%77 = load i8*, i8** %69
%78 = tail call i32 (i32*, i8*, ...) @fprintf(i32* %76, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.10, i64 0, i64 0), i8* %77)
%79 = tail call i32 @exit(i32 2)
unreachable
80: ; preds = %68
%81 = tail call i32* @fopen(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%82 = icmp eq i32* %81, null
br i1 %82, label %87, label %83
83: ; preds = %80
%84 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%85 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 1
%86 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 2
br label %93
87: ; preds = %80
%88 = load i32, i32* @stderr
%89 = sext i32 %88 to i64
%90 = inttoptr i64 %89 to i32*
%91 = tail call i64 @fwrite(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.12, i64 0, i64 0), i64 15, i64 1, i32* %90)
%92 = tail call i32 @exit(i32 4)
unreachable
93: ; preds = %83, %154
%94 = phi i32 [ 0, %83 ], [ %155, %154 ]
%95 = call i32 (i32*, i8*, float*, float*, ...) @fscanf(i32* %81, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), float* %4, float* %3)
%96 = icmp eq i32 %95, 2
br i1 %96, label %103, label %97
97: ; preds = %93
%98 = load i32, i32* @stderr
%99 = sext i32 %98 to i64
%100 = inttoptr i64 %99 to i32*
%101 = call i64 @fwrite(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.13, i64 0, i64 0), i64 28, i64 1, i32* %100)
%102 = call i32 @exit(i32 -1)
unreachable
103: ; preds = %93
%104 = call i32 (i32*, i8*, float*, float*, ...) @fscanf(i32* %55, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0), float* %84, float* %85, float* %86)
%105 = icmp eq i32 %104, 3
br i1 %105, label %113, label %106
106: ; preds = %103
%107 = load i32, i32* @stderr
%108 = sext i32 %107 to i64
%109 = inttoptr i64 %108 to i32*
%110 = load i8*, i8** %53
%111 = call i32 (i32*, i8*, ...) @fprintf(i32* %109, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.15, i64 0, i64 0), i8* %110, i32 %94)
%112 = call i32 @exit(i32 3)
unreachable
113: ; preds = %103, %152
%114 = phi i64 [ %138, %152 ], [ -1, %103 ]
%115 = add nsw i64 %114, 1
%116 = load float, float* %3
%117 = getelementptr inbounds float, float* %15, i64 %115
%118 = load float, float* %117
%119 = fsub float %116, %118
%120 = call double @fabs(float %119)
%121 = fcmp olt double %120, 1.000000e-03
br i1 %121, label %122, label %137
122: ; preds = %113
%123 = load float, float* %4
%124 = getelementptr inbounds float, float* %17, i64 %115
%125 = load float, float* %124
%126 = fsub float %123, %125
%127 = call double @fabs(float %126)
%128 = fcmp olt double %127, 1.000000e-03
br i1 %128, label %129, label %137
129: ; preds = %145, %122
%130 = load float, float* %84
%131 = fpext float %130 to double
%132 = load float, float* %85
%133 = fpext float %132 to double
%134 = load float, float* %86
%135 = fpext float %134 to double
%136 = call i32 (i32*, i8*, ...) @fprintf(i32* %71, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.16, i64 0, i64 0), double %131, double %133, double %135)
br label %154
137: ; preds = %122, %113
%138 = add nsw i64 %114, 2
%139 = load float, float* %3
%140 = getelementptr inbounds float, float* %15, i64 %138
%141 = load float, float* %140
%142 = fsub float %139, %141
%143 = call double @fabs(float %142)
%144 = fcmp olt double %143, 1.000000e-03
br i1 %144, label %145, label %152
145: ; preds = %137
%146 = load float, float* %4
%147 = getelementptr inbounds float, float* %17, i64 %138
%148 = load float, float* %147
%149 = fsub float %146, %148
%150 = call double @fabs(float %149)
%151 = fcmp olt double %150, 1.000000e-03
br i1 %151, label %129, label %152
152: ; preds = %145, %137
%153 = icmp ult i64 %115, 1960
br i1 %153, label %113, label %154
154: ; preds = %152, %129
%155 = add nuw nsw i32 %94, 1
%156 = icmp eq i32 %155, 4480
br i1 %156, label %157, label %93
157: ; preds = %154
%158 = call i32 @fclose(i32* %71)
%159 = call i32 @fclose(i32* %55)
%160 = call i32 @fclose(i32* %81)
%161 = call i32 @free(float* %15)
%162 = call i32 @free(float* %17)
ret i32 0
}