#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 /*<<< orphan*/);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ fscanf(int /*<<< orphan*/ *, char *, char *, ...);
int /*<<< orphan*/ make_mask(float **, float **, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ read_fraction(char *, float **, int, int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strcpy(char *, char *);
void main(int argc, char *argv[]) {
  FILE *fp;
  char frac1[400];
  float FR1[500][500];
  float NEW[500][500];
  int rows, cols, void_nr;
  int i, j;
  char junk[50];
  float xllcorner, yllcorner, resolution;
  if (argc != 2) {
    fprintf(stderr, "Usage: %s <fraction file>\n", argv[0]);
    fprintf(stderr, "\t<fraction file> is the routing fraction file for the "
                    "current model resolution WITH AN ARC/INFO HEADER.\n");
    fprintf(stderr, "\tOutput is to stdout.\n");
    exit(0);
  }
  strcpy(frac1, argv[1]);
  if ((fp = fopen(frac1, "r")) == NULL) {
    printf("Cannot open file maskfile %s \n", frac1);
    exit(0);
  }
  fscanf(fp, "%s %d", junk, &cols);
  printf("%s      %d\n", junk, cols / 2);
  fscanf(fp, "%s %d", junk, &rows);
  printf("%s      %d\n", junk, rows / 2);
  fscanf(fp, "%s %f", junk, &xllcorner);
  printf("%s      %.4f\n", junk, xllcorner);
  fscanf(fp, "%s %f", junk, &yllcorner);
  printf("%s      %.4f\n", junk, yllcorner);
  fscanf(fp, "%s %f", junk, &resolution);
  printf("%s      %.4f\n", junk, resolution * 2.0);
  fscanf(fp, "%s %d", junk, &void_nr);
  printf("%s      %d\n", junk, void_nr);
  fclose(fp);
  read_fraction(frac1, FR1, rows, cols);
  make_mask(FR1, NEW, rows, cols);
  for (i = 0; i < (rows / 2); i++) {
    for (j = 0; j < (cols / 2); j++)
      printf("%.3f ", NEW[i][j]);
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1e86a0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x4(%rbp)
je     11ff <main+0x6f>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xe45(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2e0f(%rip),%rax
mov    (%rax),%edi
lea    0xe49(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
mov    0x2df8(%rip),%rax
mov    (%rax),%edi
lea    0xe9b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
lea    -0x1b0(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcpy@plt>
lea    -0x1b0(%rbp),%rdi
lea    0xe82(%rip),%rsi
call   10a0 <fopen@plt>
mov    %rax,-0x18(%rbp)
cmp    $0x0,%rax
jne    1250 <main+0xc0>
lea    -0x1b0(%rbp),%rsi
lea    0xe63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %edi,%edi
call   10b0 <exit@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8680(%rbp),%rdx
lea    0xe62(%rip),%rsi
lea    -0x1e8638(%rbp),%rcx
mov    $0x0,%al
call   1080 <fscanf@plt>
lea    -0x1e8680(%rbp),%rsi
mov    -0x1e8638(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xe3c(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8680(%rbp),%rdx
lea    0xe1d(%rip),%rsi
lea    -0x1e8634(%rbp),%rcx
mov    $0x0,%al
call   1080 <fscanf@plt>
lea    -0x1e8680(%rbp),%rsi
mov    -0x1e8634(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
lea    0xdf7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8680(%rbp),%rdx
lea    0xdea(%rip),%rsi
lea    -0x1e8684(%rbp),%rcx
mov    $0x0,%al
call   1080 <fscanf@plt>
lea    -0x1e8680(%rbp),%rsi
movss  -0x1e8684(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xdc8(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8680(%rbp),%rdx
lea    0xda9(%rip),%rsi
lea    -0x1e8688(%rbp),%rcx
mov    $0x0,%al
call   1080 <fscanf@plt>
lea    -0x1e8680(%rbp),%rsi
movss  -0x1e8688(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
lea    0xd87(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8680(%rbp),%rdx
lea    0xd68(%rip),%rsi
lea    -0x1e868c(%rbp),%rcx
mov    $0x0,%al
call   1080 <fscanf@plt>
lea    -0x1e8680(%rbp),%rsi
movss  -0x1e868c(%rbp),%xmm0
ff
cvtss2sd %xmm0,%xmm0
movsd  0xc69(%rip),%xmm1
mulsd  %xmm1,%xmm0
lea    0xd3a(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
lea    -0x1e8680(%rbp),%rdx
lea    0xd09(%rip),%rsi
lea    -0x1e863c(%rbp),%rcx
mov    $0x0,%al
call   1080 <fscanf@plt>
lea    -0x1e8680(%rbp),%rsi
mov    -0x1e863c(%rbp),%edx
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x18(%rbp),%rdi
call   1050 <fclose@plt>
lea    -0x1b0(%rbp),%rdi
lea    -0xf43f0(%rbp),%rsi
mov    -0x1e8634(%rbp),%edx
mov    -0x1e8638(%rbp),%ecx
call   1030 <read_fraction@plt>
lea    -0xf43f0(%rbp),%rdi
lea    -0x1e8630(%rbp),%rsi
mov    -0x1e8634(%rbp),%edx
mov    -0x1e8638(%rbp),%ecx
call   1070 <make_mask@plt>
movl   $0x0,-0x1e8640(%rbp)
mov    -0x1e8640(%rbp),%eax
mov    %eax,-0x1e8690(%rbp)
mov    -0x1e8634(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1e8690(%rbp),%eax
cmp    %ecx,%eax
jge    14ff <main+0x36f>
movl   $0x0,-0x1e8644(%rbp)
mov    -0x1e8644(%rbp),%eax
mov    %eax,-0x1e8694(%rbp)
mov    -0x1e8638(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x1e8694(%rbp),%eax
cmp    %ecx,%eax
jge    14dd <main+0x34d>
movslq -0x1e8640(%rbp),%rcx
lea    -0x1e8630(%rbp),%rax
imul   $0x7d0,%rcx,%rcx
add    %rcx,%rax
movslq -0x1e8644(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xc28(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x1e8644(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e8644(%rbp)
jmp    1469 <main+0x2d9>
lea    0xbde(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x1e8640(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e8640(%rbp)
jmp    1435 <main+0x2a5>
add    $0x1e86a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1e8678,%rsp
cmp    $0x2,%edi
jne    13f0 <main+0x250>
mov    0x8(%rsi),%rsi
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <strcpy@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
call   10b0 <fopen@plt>
test   %rax,%rax
je     1431 <main+0x291>
mov    %rax,%rbx
lea    0xecf(%rip),%r15
lea    0x20(%rsp),%r14
lea    0x8(%rsp),%rcx
mov    %rax,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fscanf@plt>
mov    0x8(%rsp),%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
lea    0xea7(%rip),%r12
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc(%rsp),%rcx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fscanf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%edx
shr    $0x1f,%edx
add    %eax,%edx
sar    %edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe70(%rip),%r13
lea    0x18(%rsp),%rcx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fscanf@plt>
movss  0x18(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe50(%rip),%rbp
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0x14(%rsp),%rcx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fscanf@plt>
movss  0x14(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0x10(%rsp),%rcx
mov    %rbx,%rdi
mov    %r13,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fscanf@plt>
movss  0x10(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
addsd  %xmm0,%xmm0
mov    %rbp,%rdi
mov    %r14,%rsi
mov    $0x1,%al
call   1070 <printf@plt>
lea    0x1c(%rsp),%rcx
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <fscanf@plt>
mov    0x1c(%rsp),%edx
mov    %r12,%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
call   1060 <fclose@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0x60(%rsp),%rdi
lea    0xf4430(%rsp),%rbp
mov    %rbp,%rsi
call   1030 <read_fraction@plt>
mov    0xc(%rsp),%edx
mov    0x8(%rsp),%ecx
lea    0x1f0(%rsp),%rbx
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <make_mask@plt>
cmpl   $0x2,0xc(%rsp)
jl     13de <main+0x23e>
xor    %r15d,%r15d
lea    0xd7a(%rip),%r14
jmp    139a <main+0x1fa>
nopw   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1040 <putchar@plt>
add    $0x1,%r15
mov    0xc(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
add    $0x7d0,%rbx
cmp    %rax,%r15
jge    13de <main+0x23e>
cmpl   $0x2,0x8(%rsp)
jl     1370 <main+0x1d0>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movss  (%rbx,%rbp,4),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r14,%rdi
mov    $0x1,%al
call   1070 <printf@plt>
add    $0x1,%rbp
mov    0x8(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rax
cmp    %rax,%rbp
jl     13b0 <main+0x210>
jmp    1370 <main+0x1d0>
add    $0x1e8678,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2be9(%rip),%rbx
mov    (%rbx),%edi
mov    (%rsi),%rdx
lea    0xbfd(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc08(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
mov    (%rbx),%edi
lea    0xc61(%rip),%rsi
xor    %eax,%eax
call   10a0 <fprintf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>
lea    0xc65(%rip),%rdi
lea    0x60(%rsp),%rsi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %edi,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s <fraction file>\0A\00"
@.str.1 = [105 x i8] c"\09<fraction file> is the routing fraction file for the current model resolution WITH AN ARC/INFO HEADER.\0A\00"
@.str.2 = [23 x i8] c"\09Output is to stdout.\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [31 x i8] c"Cannot open file maskfile %s \0A\00"
@.str.5 = [6 x i8] c"%s %d\00"
@.str.6 = [12 x i8] c"%s %d\0A\00"
@.str.7 = [6 x i8] c"%s %f\00"
@.str.8 = [14 x i8] c"%s %.4f\0A\00"
@.str.9 = [6 x i8] c"%.3f \00"
@.str.10 = [2 x i8] c"\0A\00"
define void @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32*
%6 = alloca [400 x i8]
%7 = alloca [500 x [500 x float]]
%8 = alloca [500 x [500 x float]]
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca [50 x i8]
%15 = alloca float
%16 = alloca float
%17 = alloca float
store i32 %0, i32* %3
store i8** %1, i8*** %4
%18 = load i32, i32* %3
%19 = icmp ne i32 %18, 2
br i1 %19, label %20, label %31
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = load i8**, i8*** %4
%23 = getelementptr inbounds i8*, i8** %22, i64 0
%24 = load i8*, i8** %23
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %24)
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.1, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%30 = call i32 @exit(i32 0)
unreachable
31: ; preds = %2
%32 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%33 = load i8**, i8*** %4
%34 = getelementptr inbounds i8*, i8** %33, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcpy(i8* %32, i8* %35)
%37 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%38 = call i32* @fopen(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
store i32* %38, i32** %5
%39 = icmp eq i32* %38, null
br i1 %39, label %40, label %44
40: ; preds = %31
%41 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %41)
%43 = call i32 @exit(i32 0)
unreachable
44: ; preds = %31
%45 = load i32*, i32** %5
%46 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%47 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %46, i32* %10)
%48 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%49 = load i32, i32* %10
%50 = sdiv i32 %49, 2
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %48, i32 %50)
%52 = load i32*, i32** %5
%53 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%54 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %52, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %53, i32* %9)
%55 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%56 = load i32, i32* %9
%57 = sdiv i32 %56, 2
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %55, i32 %57)
%59 = load i32*, i32** %5
%60 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%61 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %59, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %60, float* %15)
%62 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%63 = load float, float* %15
%64 = fpext float %63 to double
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %62, double %64)
%66 = load i32*, i32** %5
%67 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%68 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %66, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %67, float* %16)
%69 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%70 = load float, float* %16
%71 = fpext float %70 to double
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %69, double %71)
%73 = load i32*, i32** %5
%74 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%75 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %73, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %74, float* %17)
%76 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%77 = load float, float* %17
%78 = fpext float %77 to double
%79 = fmul double %78, 2.000000e+00
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %76, double %79)
%81 = load i32*, i32** %5
%82 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%83 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %81, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %82, i32* %11)
%84 = getelementptr inbounds [50 x i8], [50 x i8]* %14, i64 0, i64 0
%85 = load i32, i32* %11
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %84, i32 %85)
%87 = load i32*, i32** %5
%88 = call i32 @fclose(i32* %87)
%89 = getelementptr inbounds [400 x i8], [400 x i8]* %6, i64 0, i64 0
%90 = getelementptr inbounds [500 x [500 x float]], [500 x [500 x float]]* %7, i64 0, i64 0
%91 = bitcast [500 x float]* %90 to float**
%92 = load i32, i32* %9
%93 = load i32, i32* %10
%94 = call i32 @read_fraction(i8* %89, float** %91, i32 %92, i32 %93)
%95 = getelementptr inbounds [500 x [500 x float]], [500 x [500 x float]]* %7, i64 0, i64 0
%96 = bitcast [500 x float]* %95 to float**
%97 = getelementptr inbounds [500 x [500 x float]], [500 x [500 x float]]* %8, i64 0, i64 0
%98 = bitcast [500 x float]* %97 to float**
%99 = load i32, i32* %9
%100 = load i32, i32* %10
%101 = call i32 @make_mask(float** %96, float** %98, i32 %99, i32 %100)
store i32 0, i32* %12
br label %102
102: ; preds = %128, %44
%103 = load i32, i32* %12
%104 = load i32, i32* %9
%105 = sdiv i32 %104, 2
%106 = icmp slt i32 %103, %105
br i1 %106, label %107, label %131
107: ; preds = %102
store i32 0, i32* %13
br label %108
108: ; preds = %123, %107
%109 = load i32, i32* %13
%110 = load i32, i32* %10
%111 = sdiv i32 %110, 2
%112 = icmp slt i32 %109, %111
br i1 %112, label %113, label %126
113: ; preds = %108
%114 = load i32, i32* %12
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds [500 x [500 x float]], [500 x [500 x float]]* %8, i64 0, i64 %115
%117 = load i32, i32* %13
%118 = sext i32 %117 to i64
%119 = getelementptr inbounds [500 x float], [500 x float]* %116, i64 0, i64 %118
%120 = load float, float* %119
%121 = fpext float %120 to double
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), double %121)
br label %123
123: ; preds = %113
%124 = load i32, i32* %13
%125 = add nsw i32 %124, 1
store i32 %125, i32* %13
br label %108
126: ; preds = %108
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
br label %128
128: ; preds = %126
%129 = load i32, i32* %12
%130 = add nsw i32 %129, 1
store i32 %130, i32* %12
br label %102
131: ; preds = %102
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"Usage: %s <fraction file>\0A\00"
@.str.1 = [105 x i8] c"\09<fraction file> is the routing fraction file for the current model resolution WITH AN ARC/INFO HEADER.\0A\00"
@.str.2 = [23 x i8] c"\09Output is to stdout.\0A\00"
@.str.3 = [2 x i8] c"r\00"
@.str.4 = [31 x i8] c"Cannot open file maskfile %s \0A\00"
@.str.5 = [6 x i8] c"%s %d\00"
@.str.6 = [12 x i8] c"%s %d\0A\00"
@.str.7 = [6 x i8] c"%s %f\00"
@.str.8 = [14 x i8] c"%s %.4f\0A\00"
@.str.9 = [6 x i8] c"%.3f \00"
define void @main(i32 %0, i8** nocapture %1) {
%3 = alloca [400 x i8]
%4 = alloca [500 x [500 x float]]
%5 = alloca [500 x [500 x float]]
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [50 x i8]
%10 = alloca float
%11 = alloca float
%12 = alloca float
%13 = getelementptr inbounds [400 x i8], [400 x i8]* %3, i64 0, i64 0
%14 = bitcast [500 x [500 x float]]* %4 to i8*
%15 = bitcast [500 x [500 x float]]* %5 to i8*
%16 = bitcast i32* %6 to i8*
%17 = bitcast i32* %7 to i8*
%18 = bitcast i32* %8 to i8*
%19 = getelementptr inbounds [50 x i8], [50 x i8]* %9, i64 0, i64 0
%20 = bitcast float* %10 to i8*
%21 = bitcast float* %11 to i8*
%22 = bitcast float* %12 to i8*
%23 = icmp eq i32 %0, 2
br i1 %23, label %33, label %24
24: ; preds = %2
%25 = load i32, i32* @stderr
%26 = load i8*, i8** %1
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %26)
%28 = load i32, i32* @stderr
%29 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([105 x i8], [105 x i8]* @.str.1, i64 0, i64 0))
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%32 = tail call i32 @exit(i32 0)
unreachable
33: ; preds = %2
%34 = getelementptr inbounds i8*, i8** %1, i64 1
%35 = load i8*, i8** %34
%36 = call i32 @strcpy(i8* %13, i8* %35)
%37 = call i32* @fopen(i8* %13, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %42
39: ; preds = %33
%40 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%41 = call i32 @exit(i32 0)
unreachable
42: ; preds = %33
%43 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %19, i32* %7)
%44 = load i32, i32* %7
%45 = sdiv i32 %44, 2
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %19, i32 %45)
%47 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %19, i32* %6)
%48 = load i32, i32* %6
%49 = sdiv i32 %48, 2
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %19, i32 %49)
%51 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %19, float* %10)
%52 = load float, float* %10
%53 = fpext float %52 to double
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %19, double %53)
%55 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %19, float* %11)
%56 = load float, float* %11
%57 = fpext float %56 to double
%58 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %19, double %57)
%59 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %19, float* %12)
%60 = load float, float* %12
%61 = fpext float %60 to double
%62 = fmul double %61, 2.000000e+00
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.8, i64 0, i64 0), i8* %19, double %62)
%64 = call i32 (i32*, i8*, i8*, ...) @fscanf(i32* %37, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %19, i32* %8)
%65 = load i32, i32* %8
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %19, i32 %65)
%67 = call i32 @fclose(i32* %37)
%68 = bitcast [500 x [500 x float]]* %4 to float**
%69 = load i32, i32* %6
%70 = load i32, i32* %7
%71 = call i32 @read_fraction(i8* %13, float** %68, i32 %69, i32 %70)
%72 = bitcast [500 x [500 x float]]* %5 to float**
%73 = load i32, i32* %6
%74 = load i32, i32* %7
%75 = call i32 @make_mask(float** %68, float** %72, i32 %73, i32 %74)
%76 = load i32, i32* %6
%77 = icmp sgt i32 %76, 1
br i1 %77, label %78, label %100
78: ; preds = %42, %93
%79 = phi i64 [ %95, %93 ], [ 0, %42 ]
%80 = load i32, i32* %7
%81 = icmp sgt i32 %80, 1
br i1 %81, label %82, label %93
82: ; preds = %78, %82
%83 = phi i64 [ %88, %82 ], [ 0, %78 ]
%84 = getelementptr inbounds [500 x [500 x float]], [500 x [500 x float]]* %5, i64 0, i64 %79, i64 %83
%85 = load float, float* %84
%86 = fpext float %85 to double
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.9, i64 0, i64 0), double %86)
%88 = add nuw nsw i64 %83, 1
%89 = load i32, i32* %7
%90 = sdiv i32 %89, 2
%91 = sext i32 %90 to i64
%92 = icmp slt i64 %88, %91
br i1 %92, label %82, label %93
93: ; preds = %82, %78
%94 = call i32 @putchar(i32 10)
%95 = add nuw nsw i64 %79, 1
%96 = load i32, i32* %6
%97 = sdiv i32 %96, 2
%98 = sext i32 %97 to i64
%99 = icmp slt i64 %95, %98
br i1 %99, label %78, label %100
100: ; preds = %93, %42
ret void
}