#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 */

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int *calloc(int, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, long, ...);
int /*<<< orphan*/ free(int *);
int /*<<< orphan*/ heron_cleanup();
long heron_highwater();
long heron_memuse();
int /*<<< orphan*/ heron_print_off();
int /*<<< orphan*/ heron_print_on();
int *malloc(int);
int *realloc(int *, int);
int /*<<< orphan*/ stderr;
int main() {
  int *p1;
  int *p2;
  int *p3;
  int num[3] = {1000, 10000000, 3223};
  long use;
  heron_print_off();
  p1 = malloc(num[0] * sizeof(double));
  assert(p1 != NULL);
  p2 = calloc(num[1], sizeof(float));
  assert(p2 != NULL);
  heron_print_on();
  p3 = malloc(num[2] * sizeof(float));
  assert(p3 != NULL);
  use = heron_memuse();
  if (use !=
      num[0] * sizeof(double) + num[1] * sizeof(float) + num[2] * sizeof(float))
    fprintf(stderr, "ERROR %ld, should be %ld\n\n", use,
            num[0] * sizeof(double) + num[1] * sizeof(float) +
                num[2] * sizeof(float));
  free(p2);
  use = heron_memuse();
  if (use != num[0] * sizeof(double) + num[2] * sizeof(float))
    fprintf(stderr, "ERROR %ld, should be %ld\n\n", use,
            num[0] * sizeof(double) + num[2] * sizeof(float));
  p3 = realloc(p3, num[2] * sizeof(double));
  use = heron_memuse();
  if (use != num[0] * sizeof(double) + num[2] * sizeof(double))
    fprintf(stderr, "ERROR: %ld, should be %ld\n\n", use,
            num[0] * sizeof(double) + num[2] * sizeof(double));
  free(p1);
  free(p3);
  use = heron_memuse();
  if (use != 0)
    fprintf(stderr, "ERROR %ld, should be 0\n\n", use);
  use = heron_highwater();
  if (use !=
      num[0] * sizeof(double) + num[1] * sizeof(float) + num[2] * sizeof(float))
    fprintf(stderr, "ERROR %ld, should be %ld\n\n", use,
            num[0] * sizeof(double) + num[1] * sizeof(float) +
                num[2] * sizeof(float));
  heron_cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xe3a(%rip),%rax
mov    %rax,-0x2c(%rbp)
mov    0xe38(%rip),%eax
mov    %eax,-0x24(%rbp)
mov    $0x0,%al
call   10b0 <heron_print_off@plt>
movslq -0x2c(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x28(%rbp),%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x0,%al
call   10c0 <heron_print_on@plt>
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    $0x0,%al
call   10d0 <heron_memuse@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x28(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x24(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
je     12bd <main+0x10d>
mov    0x2d55(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xd56(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   10d0 <heron_memuse@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x24(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
je     131f <main+0x16f>
mov    0x2ce8(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xcf4(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x20(%rbp),%rdi
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%esi
call   10a0 <realloc@plt>
mov    %rax,-0x20(%rbp)
mov    $0x0,%al
call   10d0 <heron_memuse@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x24(%rbp),%rdx
shl    $0x3,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
je     138f <main+0x1df>
mov    0x2c78(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x24(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
lea    0xc9f(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0x0,%al
call   10d0 <heron_memuse@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     13d2 <main+0x222>
mov    0x2c22(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
lea    0xc78(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1040 <heron_highwater@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x28(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
movslq -0x24(%rbp),%rdx
shl    $0x2,%rdx
add    %rdx,%rcx
cmp    %rcx,%rax
je     1441 <main+0x291>
mov    0x2bd1(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
movslq -0x2c(%rbp),%rcx
shl    $0x3,%rcx
movslq -0x28(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
movslq -0x24(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rcx
lea    0xbd2(%rip),%rsi
mov    $0x0,%al
call   1070 <fprintf@plt>
mov    $0x0,%al
call   1090 <heron_cleanup@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   10b0 <heron_print_off@plt>
mov    $0x1f40,%edi
call   1080 <malloc@plt>
mov    %rax,%r14
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <assert@plt>
mov    $0x989680,%edi
mov    $0x4,%esi
call   1050 <calloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <assert@plt>
xor    %eax,%eax
call   10c0 <heron_print_on@plt>
mov    $0x325c,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1060 <assert@plt>
xor    %eax,%eax
call   10d0 <heron_memuse@plt>
cmp    $0x262ab9c,%rax
je     1247 <main+0x97>
mov    0x2db1(%rip),%rcx
mov    (%rcx),%edi
lea    0xdc8(%rip),%rsi
mov    $0x262ab9c,%ecx
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   10d0 <heron_memuse@plt>
cmp    $0x519c,%rax
je     127d <main+0xcd>
mov    0x2d7b(%rip),%rcx
mov    (%rcx),%edi
lea    0xd92(%rip),%rsi
mov    $0x519c,%ecx
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r15,%rdi
mov    $0x64b8,%esi
call   10a0 <realloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   10d0 <heron_memuse@plt>
cmp    $0x83f8,%rax
je     12bb <main+0x10b>
mov    0x2d3d(%rip),%rcx
mov    (%rcx),%edi
lea    0xd6f(%rip),%rsi
mov    $0x83f8,%ecx
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %eax,%eax
call   10d0 <heron_memuse@plt>
test   %rax,%rax
je     12f1 <main+0x141>
mov    0x2d02(%rip),%rcx
mov    (%rcx),%edi
lea    0xd50(%rip),%rsi
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1040 <heron_highwater@plt>
cmp    $0x262ab9c,%rax
je     131f <main+0x16f>
mov    0x2cd9(%rip),%rcx
mov    (%rcx),%edi
lea    0xcf0(%rip),%rsi
mov    $0x262ab9c,%ecx
mov    %rax,%rdx
xor    %eax,%eax
call   1070 <fprintf@plt>
xor    %eax,%eax
call   1090 <heron_cleanup@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.main.num = [3 x i32] [i32 1000, i32 10000000, i32 3223]
@stderr = global i32 0
@.str = [27 x i8] c"ERROR %ld, should be %ld\0A\0A\00"
@.str.1 = [28 x i8] c"ERROR: %ld, should be %ld\0A\0A\00"
@.str.2 = [25 x i8] c"ERROR %ld, should be 0\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [3 x i32]
%6 = alloca i64
store i32 0, i32* %1
%7 = bitcast [3 x i32]* %5 to i8*
%8 = call i32 (...) @heron_print_off()
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%10 = load i32, i32* %9
%11 = sext i32 %10 to i64
%12 = mul i64 %11, 8
%13 = trunc i64 %12 to i32
%14 = call i32* @malloc(i32 %13)
store i32* %14, i32** %2
%15 = load i32*, i32** %2
%16 = icmp ne i32* %15, null
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%20 = load i32, i32* %19
%21 = call i32* @calloc(i32 %20, i32 4)
store i32* %21, i32** %3
%22 = load i32*, i32** %3
%23 = icmp ne i32* %22, null
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 (...) @heron_print_on()
%27 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%28 = load i32, i32* %27
%29 = sext i32 %28 to i64
%30 = mul i64 %29, 4
%31 = trunc i64 %30 to i32
%32 = call i32* @malloc(i32 %31)
store i32* %32, i32** %4
%33 = load i32*, i32** %4
%34 = icmp ne i32* %33, null
%35 = zext i1 %34 to i32
%36 = call i32 @assert(i32 %35)
%37 = call i64 (...) @heron_memuse()
store i64 %37, i64* %6
%38 = load i64, i64* %6
%39 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%40 = load i32, i32* %39
%41 = sext i32 %40 to i64
%42 = mul i64 %41, 8
%43 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%44 = load i32, i32* %43
%45 = sext i32 %44 to i64
%46 = mul i64 %45, 4
%47 = add i64 %42, %46
%48 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%49 = load i32, i32* %48
%50 = sext i32 %49 to i64
%51 = mul i64 %50, 4
%52 = add i64 %47, %51
%53 = icmp ne i64 %38, %52
br i1 %53, label %54, label %72
54: ; preds = %0
%55 = load i32, i32* @stderr
%56 = load i64, i64* %6
%57 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%58 = load i32, i32* %57
%59 = sext i32 %58 to i64
%60 = mul i64 %59, 8
%61 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%62 = load i32, i32* %61
%63 = sext i32 %62 to i64
%64 = mul i64 %63, 4
%65 = add i64 %60, %64
%66 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%67 = load i32, i32* %66
%68 = sext i32 %67 to i64
%69 = mul i64 %68, 4
%70 = add i64 %65, %69
%71 = call i32 (i32, i8*, i64, ...) @fprintf(i32 %55, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %56, i64 %70)
br label %72
72: ; preds = %54, %0
%73 = load i32*, i32** %3
%74 = call i32 @free(i32* %73)
%75 = call i64 (...) @heron_memuse()
store i64 %75, i64* %6
%76 = load i64, i64* %6
%77 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%78 = load i32, i32* %77
%79 = sext i32 %78 to i64
%80 = mul i64 %79, 8
%81 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%82 = load i32, i32* %81
%83 = sext i32 %82 to i64
%84 = mul i64 %83, 4
%85 = add i64 %80, %84
%86 = icmp ne i64 %76, %85
br i1 %86, label %87, label %100
87: ; preds = %72
%88 = load i32, i32* @stderr
%89 = load i64, i64* %6
%90 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%91 = load i32, i32* %90
%92 = sext i32 %91 to i64
%93 = mul i64 %92, 8
%94 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%95 = load i32, i32* %94
%96 = sext i32 %95 to i64
%97 = mul i64 %96, 4
%98 = add i64 %93, %97
%99 = call i32 (i32, i8*, i64, ...) @fprintf(i32 %88, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %89, i64 %98)
br label %100
100: ; preds = %87, %72
%101 = load i32*, i32** %4
%102 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%103 = load i32, i32* %102
%104 = sext i32 %103 to i64
%105 = mul i64 %104, 8
%106 = trunc i64 %105 to i32
%107 = call i32* @realloc(i32* %101, i32 %106)
store i32* %107, i32** %4
%108 = call i64 (...) @heron_memuse()
store i64 %108, i64* %6
%109 = load i64, i64* %6
%110 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%111 = load i32, i32* %110
%112 = sext i32 %111 to i64
%113 = mul i64 %112, 8
%114 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%115 = load i32, i32* %114
%116 = sext i32 %115 to i64
%117 = mul i64 %116, 8
%118 = add i64 %113, %117
%119 = icmp ne i64 %109, %118
br i1 %119, label %120, label %133
120: ; preds = %100
%121 = load i32, i32* @stderr
%122 = load i64, i64* %6
%123 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%124 = load i32, i32* %123
%125 = sext i32 %124 to i64
%126 = mul i64 %125, 8
%127 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%128 = load i32, i32* %127
%129 = sext i32 %128 to i64
%130 = mul i64 %129, 8
%131 = add i64 %126, %130
%132 = call i32 (i32, i8*, i64, ...) @fprintf(i32 %121, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i64 %122, i64 %131)
br label %133
133: ; preds = %120, %100
%134 = load i32*, i32** %2
%135 = call i32 @free(i32* %134)
%136 = load i32*, i32** %4
%137 = call i32 @free(i32* %136)
%138 = call i64 (...) @heron_memuse()
store i64 %138, i64* %6
%139 = load i64, i64* %6
%140 = icmp ne i64 %139, 0
br i1 %140, label %141, label %145
141: ; preds = %133
%142 = load i32, i32* @stderr
%143 = load i64, i64* %6
%144 = call i32 (i32, i8*, i64, ...) @fprintf(i32 %142, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 %143)
br label %145
145: ; preds = %141, %133
%146 = call i64 (...) @heron_highwater()
store i64 %146, i64* %6
%147 = load i64, i64* %6
%148 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%149 = load i32, i32* %148
%150 = sext i32 %149 to i64
%151 = mul i64 %150, 8
%152 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%153 = load i32, i32* %152
%154 = sext i32 %153 to i64
%155 = mul i64 %154, 4
%156 = add i64 %151, %155
%157 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%158 = load i32, i32* %157
%159 = sext i32 %158 to i64
%160 = mul i64 %159, 4
%161 = add i64 %156, %160
%162 = icmp ne i64 %147, %161
br i1 %162, label %163, label %181
163: ; preds = %145
%164 = load i32, i32* @stderr
%165 = load i64, i64* %6
%166 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 0
%167 = load i32, i32* %166
%168 = sext i32 %167 to i64
%169 = mul i64 %168, 8
%170 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 1
%171 = load i32, i32* %170
%172 = sext i32 %171 to i64
%173 = mul i64 %172, 4
%174 = add i64 %169, %173
%175 = getelementptr inbounds [3 x i32], [3 x i32]* %5, i64 0, i64 2
%176 = load i32, i32* %175
%177 = sext i32 %176 to i64
%178 = mul i64 %177, 4
%179 = add i64 %174, %178
%180 = call i32 (i32, i8*, i64, ...) @fprintf(i32 %164, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %165, i64 %179)
br label %181
181: ; preds = %163, %145
%182 = call i32 (...) @heron_cleanup()
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"ERROR %ld, should be %ld\0A\0A\00"
@.str.1 = [28 x i8] c"ERROR: %ld, should be %ld\0A\0A\00"
@.str.2 = [25 x i8] c"ERROR %ld, should be 0\0A\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @heron_print_off()
%2 = tail call i32* @malloc(i32 8000)
%3 = icmp ne i32* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32* @calloc(i32 10000000, i32 4)
%7 = icmp ne i32* %6, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 (...) @heron_print_on()
%11 = tail call i32* @malloc(i32 12892)
%12 = icmp ne i32* %11, null
%13 = zext i1 %12 to i32
%14 = tail call i32 @assert(i32 %13)
%15 = tail call i64 (...) @heron_memuse()
%16 = icmp eq i64 %15, 40020892
br i1 %16, label %20, label %17
17: ; preds = %0
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, i64, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %15, i64 40020892)
br label %20
20: ; preds = %17, %0
%21 = tail call i32 @free(i32* %6)
%22 = tail call i64 (...) @heron_memuse()
%23 = icmp eq i64 %22, 20892
br i1 %23, label %27, label %24
24: ; preds = %20
%25 = load i32, i32* @stderr
%26 = tail call i32 (i32, i8*, i64, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %22, i64 20892)
br label %27
27: ; preds = %24, %20
%28 = tail call i32* @realloc(i32* %11, i32 25784)
%29 = tail call i64 (...) @heron_memuse()
%30 = icmp eq i64 %29, 33784
br i1 %30, label %34, label %31
31: ; preds = %27
%32 = load i32, i32* @stderr
%33 = tail call i32 (i32, i8*, i64, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.1, i64 0, i64 0), i64 %29, i64 33784)
br label %34
34: ; preds = %31, %27
%35 = tail call i32 @free(i32* %2)
%36 = tail call i32 @free(i32* %28)
%37 = tail call i64 (...) @heron_memuse()
%38 = icmp eq i64 %37, 0
br i1 %38, label %42, label %39
39: ; preds = %34
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, i64, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.2, i64 0, i64 0), i64 %37)
br label %42
42: ; preds = %39, %34
%43 = tail call i64 (...) @heron_highwater()
%44 = icmp eq i64 %43, 40020892
br i1 %44, label %48, label %45
45: ; preds = %42
%46 = load i32, i32* @stderr
%47 = tail call i32 (i32, i8*, i64, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i64 %43, i64 40020892)
br label %48
48: ; preds = %45, %42
%49 = tail call i32 (...) @heron_cleanup()
ret i32 0
}