#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*/ fprintf(int /*<<< orphan*/, char *);
int grb2_get_data(float *, int);
int grb2_get_lonlat(float *, float *, int);
int grb2_inqVA(char *, char *, int, char *, int /*<<< orphan*/ *);
int grb2_mk_inv(char *, char *);
int /*<<< orphan*/ grb2_wrtVA(char *, char *, int, float *, unsigned int,
                              char *, char *, char *, char *, ...);
scalar_t__ malloc(int);
int /*<<< orphan*/ printf(char *, int, ...);
int /*<<< orphan*/ stderr;
int main() {
  char *grb, *inv;
  float *data, *lat, *lon;
  int i, ndata;
  float new_data[1679];
  grb = "../examples/merc.g2";
  inv = "merc.inv";
  i = grb2_mk_inv(grb, inv);
  printf("mk_inv=  i=%i\n", i);
  ndata = grb2_inqVA(grb, inv, 2 | 4, "TMP", NULL);
  printf("ndata=%i\n", ndata);
  data = (float *)malloc(ndata * 4);
  lat = (float *)malloc(ndata * 4);
  lon = (float *)malloc(ndata * 4);
  i = grb2_get_data(data, ndata);
  printf("err=%d data[0[=%f\n", i, data[0]);
  i = grb2_get_lonlat(lon, lat, ndata);
  printf("err=%d lon/lat[0[=%f %f\n", i, lon[0], lat[0]);
  ndata = 1679;
  for (i = 0; i < 1679; i++)
    data[i] = 10.0;
  data[0] = 0.0;
  fprintf(stderr, "now the grb2_wrt section\n");
  grb2_wrtVA("new.grb", grb, 2, data, (unsigned int)ndata, "lev", "201 mb",
             "grib_type", "s", "ftime", "0-1 hour ave fcst", "var", "UFLX",
             "bin_prec", 7, "date", 20880112010259LL, NULL);
  data[0] = 2.0;
  grb2_wrtVA("new.grb", grb, 2, data, (unsigned int)ndata, "lev",
             "2 m above ground", "set", "center", 255, "grib_type", "a",
             "ftime", "10 sec fcst", "var", "VFLX", "bin_prec", 7, "percentile",
             50, NULL);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1b28,%rsp
movl   $0x0,-0x2c(%rbp)
lea    0xe66(%rip),%rax
mov    %rax,-0x38(%rbp)
lea    0xe6f(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1040 <grb2_mk_inv@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%esi
lea    0xe5a(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x38(%rbp),%rdi
mov    -0x40(%rbp),%rsi
mov    $0x6,%edx
lea    0xe4e(%rip),%rcx
xor    %eax,%eax
mov    %eax,%r8d
call   1030 <grb2_inqVA@plt>
mov    %eax,-0x60(%rbp)
mov    -0x60(%rbp),%esi
lea    0xe3b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x60(%rbp),%edi
shl    $0x2,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x60(%rbp),%edi
shl    $0x2,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x50(%rbp)
mov    -0x60(%rbp),%edi
shl    $0x2,%edi
call   10a0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x48(%rbp),%rdi
mov    -0x60(%rbp),%esi
call   1090 <grb2_get_data@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%esi
mov    -0x48(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdec(%rip),%rdi
mov    $0x1,%al
call   1060 <printf@plt>
mov    -0x58(%rbp),%rdi
mov    -0x50(%rbp),%rsi
mov    -0x60(%rbp),%edx
call   1080 <grb2_get_lonlat@plt>
mov    %eax,-0x5c(%rbp)
mov    -0x5c(%rbp),%esi
mov    -0x58(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x50(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xdc3(%rip),%rdi
mov    $0x2,%al
call   1060 <printf@plt>
movl   $0x68f,-0x60(%rbp)
movl   $0x0,-0x5c(%rbp)
cmpl   $0x68f,-0x5c(%rbp)
jge    12d7 <main+0x157>
mov    -0x48(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movss  0xd40(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    12a7 <main+0x127>
mov    -0x48(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    0x2cf7(%rip),%rax
mov    (%rax),%edi
lea    0xd7c(%rip),%rsi
call   1070 <fprintf@plt>
mov    -0x38(%rbp),%rsi
mov    -0x48(%rbp),%rcx
mov    -0x60(%rbp),%r8d
lea    0xd7e(%rip),%rdi
mov    $0x2,%edx
lea    0xd7a(%rip),%r9
lea    0xd77(%rip),%rax
mov    %rax,-0x1ad8(%rbp)
lea    0xd70(%rip),%rax
mov    %rax,-0x1ad0(%rbp)
lea    0xd6c(%rip),%r13
lea    0xd67(%rip),%r12
lea    0xd66(%rip),%r15
lea    0xd71(%rip),%r14
lea    0xd6e(%rip),%rbx
lea    0xd6c(%rip),%r11
lea    0xd6e(%rip),%r10
movabs $0x12fd87a8c413,%rax
mov    %rax,-0x1ac8(%rbp)
xor    %eax,%eax
mov    -0x1ad8(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x1ad0(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x1ac8(%rbp),%rax
mov    %r13,0x10(%rsp)
mov    %r12,0x18(%rsp)
mov    %r15,0x20(%rsp)
mov    %r14,0x28(%rsp)
mov    %rbx,0x30(%rsp)
mov    %r11,0x38(%rsp)
movl   $0x7,0x40(%rsp)
mov    %r10,0x48(%rsp)
mov    %rax,0x50(%rsp)
movq   $0x0,0x58(%rsp)
mov    $0x0,%al
call   1050 <grb2_wrtVA@plt>
mov    -0x48(%rbp),%rax
movss  0xc20(%rip),%xmm0
movss  %xmm0,(%rax)
mov    -0x38(%rbp),%rsi
mov    -0x48(%rbp),%rcx
mov    -0x60(%rbp),%r8d
lea    0xc91(%rip),%rdi
mov    $0x2,%edx
lea    0xc8d(%rip),%r9
lea    0xccc(%rip),%rax
mov    %rax,-0x1ac0(%rbp)
lea    0xccf(%rip),%rax
mov    %rax,-0x1ab8(%rbp)
lea    0xcc5(%rip),%rax
mov    %rax,-0x1ab0(%rbp)
lea    0xc67(%rip),%r13
lea    0xcb7(%rip),%r12
lea    0xc65(%rip),%r15
lea    0xcab(%rip),%r14
lea    0xc6f(%rip),%rbx
lea    0xca9(%rip),%r11
lea    0xc6a(%rip),%r10
lea    0xca0(%rip),%rax
mov    %rax,-0x1aa8(%rbp)
xor    %eax,%eax
mov    -0x1ac0(%rbp),%rax
mov    %rax,(%rsp)
mov    -0x1ab8(%rbp),%rax
mov    %rax,0x8(%rsp)
mov    -0x1ab0(%rbp),%rax
mov    %rax,0x10(%rsp)
mov    -0x1aa8(%rbp),%rax
movl   $0xff,0x18(%rsp)
mov    %r13,0x20(%rsp)
mov    %r12,0x28(%rsp)
mov    %r15,0x30(%rsp)
mov    %r14,0x38(%rsp)
mov    %rbx,0x40(%rsp)
mov    %r11,0x48(%rsp)
mov    %r10,0x50(%rsp)
movl   $0x7,0x58(%rsp)
mov    %rax,0x60(%rsp)
movl   $0x32,0x68(%rsp)
movq   $0x0,0x70(%rsp)
mov    $0x0,%al
call   1050 <grb2_wrtVA@plt>
xor    %eax,%eax
add    $0x1b28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xe7e(%rip),%rbx
lea    0xe8b(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <grb2_mk_inv@plt>
lea    0xe82(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe81(%rip),%rcx
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x6,%edx
xor    %r8d,%r8d
call   1030 <grb2_inqVA@plt>
mov    %eax,%r14d
lea    0xe68(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x0(,%r14,4),%ebp
mov    %ebp,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   10a0 <malloc@plt>
mov    %rax,%r15
mov    %ebp,%edi
call   10a0 <malloc@plt>
mov    %rax,%rbp
mov    %rbx,%rdi
mov    %r14d,%esi
call   1090 <grb2_get_data@plt>
movss  (%rbx),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe29(%rip),%rdi
mov    %eax,%esi
mov    $0x1,%al
call   1060 <printf@plt>
mov    %rbp,%rdi
mov    %r15,%rsi
mov    %r14d,%edx
call   1080 <grb2_get_lonlat@plt>
movss  0x0(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%r15),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe0c(%rip),%rdi
mov    %eax,%esi
mov    $0x2,%al
call   1060 <printf@plt>
mov    $0x3c,%eax
movaps 0xd9a(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
movups %xmm0,-0xf0(%rbx,%rax,4)
ff
movups %xmm0,-0xe0(%rbx,%rax,4)
ff
cmp    $0x6bc,%rax
je     12e2 <main+0x162>
movups %xmm0,-0xd0(%rbx,%rax,4)
ff
movups %xmm0,-0xc0(%rbx,%rax,4)
ff
movups %xmm0,-0xb0(%rbx,%rax,4)
ff
movups %xmm0,-0xa0(%rbx,%rax,4)
ff
movups %xmm0,-0x90(%rbx,%rax,4)
ff
movups %xmm0,-0x80(%rbx,%rax,4)
movups %xmm0,-0x70(%rbx,%rax,4)
movups %xmm0,-0x60(%rbx,%rax,4)
movups %xmm0,-0x50(%rbx,%rax,4)
movups %xmm0,-0x40(%rbx,%rax,4)
movups %xmm0,-0x30(%rbx,%rax,4)
movups %xmm0,-0x20(%rbx,%rax,4)
movups %xmm0,-0x10(%rbx,%rax,4)
movups %xmm0,(%rbx,%rax,4)
add    $0x40,%rax
jmp    1270 <main+0xf0>
movups %xmm0,0x1a20(%rbx)
movabs $0x4120000041200000,%rax
mov    %rax,0x1a30(%rbx)
movl   $0x41200000,0x1a38(%rbx)
movl   $0x0,(%rbx)
mov    0x2ccf(%rip),%rax
mov    (%rax),%edi
lea    0xd5c(%rip),%rsi
call   1070 <fprintf@plt>
movabs $0x12fd87a8c413,%r14
lea    0xda0(%rip),%rbp
lea    0xd90(%rip),%r10
lea    0xd71(%rip),%r11
lea    0xd5e(%rip),%r13
lea    0xd44(%rip),%r15
lea    0xcbd(%rip),%r12
lea    0xd3e(%rip),%r9
mov    %r12,%rsi
mov    $0x2,%edx
mov    %rbx,%rcx
xor    %eax,%eax
mov    %r15,%rdi
mov    $0x68f,%r8d
push   $0x0
push   %r14
lea    0xd5e(%rip),%r14
push   %r14
push   $0x7
push   %rbp
lea    0xd44(%rip),%rbp
push   %rbp
push   %r10
lea    0xd24(%rip),%rbp
push   %rbp
push   %r11
lea    0xd12(%rip),%rbp
push   %rbp
push   %r13
lea    0xcf7(%rip),%rbp
push   %rbp
call   1050 <grb2_wrtVA@plt>
add    $0x60,%rsp
movl   $0x40000000,(%rbx)
sub    $0x8,%rsp
lea    0xd4d(%rip),%rbp
lea    0xd41(%rip),%r10
lea    0xd2e(%rip),%r11
lea    0xd25(%rip),%r13
mov    %r15,%rdi
mov    %r12,%rsi
mov    $0x2,%edx
mov    %rbx,%rcx
mov    $0x68f,%r8d
lea    0xca8(%rip),%r9
mov    $0x0,%eax
push   $0x0
push   $0x32
push   %rbp
push   $0x7
lea    0xccd(%rip),%rbx
push   %rbx
push   %r10
lea    0xcba(%rip),%rbp
push   %rbp
push   %r11
lea    0xc98(%rip),%rbp
push   %rbp
push   %r13
lea    0xc82(%rip),%rbp
push   %rbp
push   $0xff
lea    0xcc5(%rip),%rbp
push   %rbp
lea    0xcb9(%rip),%rbp
push   %rbp
lea    0xca0(%rip),%rbp
push   %rbp
call   1050 <grb2_wrtVA@plt>
add    $0x80,%rsp
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [20 x i8] c"../examples/merc.g2\00"
@.str.1 = [9 x i8] c"merc.inv\00"
@.str.2 = [15 x i8] c"mk_inv= i=%i\0A\00"
@.str.3 = [4 x i8] c"TMP\00"
@.str.4 = [10 x i8] c"ndata=%i\0A\00"
@.str.5 = [19 x i8] c"err=%d data[0[=%f\0A\00"
@.str.6 = [25 x i8] c"err=%d lon/lat[0[=%f %f\0A\00"
@stderr = global i32 0
@.str.7 = [26 x i8] c"now the grb2_wrt section\0A\00"
@.str.8 = [8 x i8] c"new.grb\00"
@.str.9 = [4 x i8] c"lev\00"
@.str.10 = [7 x i8] c"201 mb\00"
@.str.11 = [10 x i8] c"grib_type\00"
@.str.12 = [2 x i8] c"s\00"
@.str.13 = [6 x i8] c"ftime\00"
@.str.14 = [18 x i8] c"0-1 hour ave fcst\00"
@.str.15 = [4 x i8] c"var\00"
@.str.16 = [5 x i8] c"UFLX\00"
@.str.17 = [9 x i8] c"bin_prec\00"
@.str.18 = [5 x i8] c"date\00"
@.str.19 = [17 x i8] c"2 m above ground\00"
@.str.20 = [4 x i8] c"set\00"
@.str.21 = [7 x i8] c"center\00"
@.str.22 = [2 x i8] c"a\00"
@.str.23 = [12 x i8] c"10 sec fcst\00"
@.str.24 = [5 x i8] c"VFLX\00"
@.str.25 = [11 x i8] c"percentile\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca float*
%5 = alloca float*
%6 = alloca float*
%7 = alloca i32
%8 = alloca i32
%9 = alloca [1679 x float]
store i32 0, i32* %1
store i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8** %2
store i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8** %3
%10 = load i8*, i8** %2
%11 = load i8*, i8** %3
%12 = call i32 @grb2_mk_inv(i8* %10, i8* %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %13)
%15 = load i8*, i8** %2
%16 = load i8*, i8** %3
%17 = call i32 @grb2_inqVA(i8* %15, i8* %16, i32 6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* null)
store i32 %17, i32* %8
%18 = load i32, i32* %8
%19 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %8
%21 = mul nsw i32 %20, 4
%22 = call i64 @malloc(i32 %21)
%23 = inttoptr i64 %22 to float*
store float* %23, float** %4
%24 = load i32, i32* %8
%25 = mul nsw i32 %24, 4
%26 = call i64 @malloc(i32 %25)
%27 = inttoptr i64 %26 to float*
store float* %27, float** %5
%28 = load i32, i32* %8
%29 = mul nsw i32 %28, 4
%30 = call i64 @malloc(i32 %29)
%31 = inttoptr i64 %30 to float*
store float* %31, float** %6
%32 = load float*, float** %4
%33 = load i32, i32* %8
%34 = call i32 @grb2_get_data(float* %32, i32 %33)
store i32 %34, i32* %7
%35 = load i32, i32* %7
%36 = load float*, float** %4
%37 = getelementptr inbounds float, float* %36, i64 0
%38 = load float, float* %37
%39 = fpext float %38 to double
%40 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %35, double %39)
%41 = load float*, float** %6
%42 = load float*, float** %5
%43 = load i32, i32* %8
%44 = call i32 @grb2_get_lonlat(float* %41, float* %42, i32 %43)
store i32 %44, i32* %7
%45 = load i32, i32* %7
%46 = load float*, float** %6
%47 = getelementptr inbounds float, float* %46, i64 0
%48 = load float, float* %47
%49 = fpext float %48 to double
%50 = load float*, float** %5
%51 = getelementptr inbounds float, float* %50, i64 0
%52 = load float, float* %51
%53 = fpext float %52 to double
%54 = call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %45, double %49, double %53)
store i32 1679, i32* %8
store i32 0, i32* %7
br label %55
55: ; preds = %63, %0
%56 = load i32, i32* %7
%57 = icmp slt i32 %56, 1679
br i1 %57, label %58, label %66
58: ; preds = %55
%59 = load float*, float** %4
%60 = load i32, i32* %7
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds float, float* %59, i64 %61
store float 1.000000e+01, float* %62
br label %63
63: ; preds = %58
%64 = load i32, i32* %7
%65 = add nsw i32 %64, 1
store i32 %65, i32* %7
br label %55
66: ; preds = %55
%67 = load float*, float** %4
%68 = getelementptr inbounds float, float* %67, i64 0
store float 0.000000e+00, float* %68
%69 = load i32, i32* @stderr
%70 = call i32 @fprintf(i32 %69, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%71 = load i8*, i8** %2
%72 = load float*, float** %4
%73 = load i32, i32* %8
%74 = call i32 (i8*, i8*, i32, float*, i32, i8*, i8*, i8*, i8*, ...) @grb2_wrtVA(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %71, i32 2, float* %72, i32 %73, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i64 20880112010259, i8* null)
%75 = load float*, float** %4
%76 = getelementptr inbounds float, float* %75, i64 0
store float 2.000000e+00, float* %76
%77 = load i8*, i8** %2
%78 = load float*, float** %4
%79 = load i32, i32* %8
%80 = call i32 (i8*, i8*, i32, float*, i32, i8*, i8*, i8*, i8*, ...) @grb2_wrtVA(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* %77, i32 2, float* %78, i32 %79, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.25, i64 0, i64 0), i32 50, i8* null)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"../examples/merc.g2\00"
@.str.1 = [9 x i8] c"merc.inv\00"
@.str.2 = [15 x i8] c"mk_inv= i=%i\0A\00"
@.str.3 = [4 x i8] c"TMP\00"
@.str.4 = [10 x i8] c"ndata=%i\0A\00"
@.str.5 = [19 x i8] c"err=%d data[0[=%f\0A\00"
@.str.6 = [25 x i8] c"err=%d lon/lat[0[=%f %f\0A\00"
@stderr = global i32 0
@.str.7 = [26 x i8] c"now the grb2_wrt section\0A\00"
@.str.8 = [8 x i8] c"new.grb\00"
@.str.9 = [4 x i8] c"lev\00"
@.str.10 = [7 x i8] c"201 mb\00"
@.str.11 = [10 x i8] c"grib_type\00"
@.str.12 = [2 x i8] c"s\00"
@.str.13 = [6 x i8] c"ftime\00"
@.str.14 = [18 x i8] c"0-1 hour ave fcst\00"
@.str.15 = [4 x i8] c"var\00"
@.str.16 = [5 x i8] c"UFLX\00"
@.str.17 = [9 x i8] c"bin_prec\00"
@.str.18 = [5 x i8] c"date\00"
@.str.19 = [17 x i8] c"2 m above ground\00"
@.str.20 = [4 x i8] c"set\00"
@.str.21 = [7 x i8] c"center\00"
@.str.22 = [2 x i8] c"a\00"
@.str.23 = [12 x i8] c"10 sec fcst\00"
@.str.24 = [5 x i8] c"VFLX\00"
@.str.25 = [11 x i8] c"percentile\00"
define i32 @main() {
%1 = tail call i32 @grb2_mk_inv(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %1)
%3 = tail call i32 @grb2_inqVA(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 6, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32* null)
%4 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i32 %3)
%5 = shl nsw i32 %3, 2
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to float*
%8 = tail call i64 @malloc(i32 %5)
%9 = inttoptr i64 %8 to float*
%10 = tail call i64 @malloc(i32 %5)
%11 = inttoptr i64 %10 to float*
%12 = tail call i32 @grb2_get_data(float* %7, i32 %3)
%13 = load float, float* %7
%14 = fpext float %13 to double
%15 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.5, i64 0, i64 0), i32 %12, double %14)
%16 = tail call i32 @grb2_get_lonlat(float* %11, float* %9, i32 %3)
%17 = load float, float* %11
%18 = fpext float %17 to double
%19 = load float, float* %9
%20 = fpext float %19 to double
%21 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.6, i64 0, i64 0), i32 %16, double %18, double %20)
br label %22
22: ; preds = %30, %0
%23 = phi i64 [ 0, %0 ], [ %65, %30 ]
%24 = getelementptr inbounds float, float* %7, i64 %23
%25 = bitcast float* %24 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %25
%26 = getelementptr inbounds float, float* %24, i64 4
%27 = bitcast float* %26 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %27
%28 = or i64 %23, 8
%29 = icmp eq i64 %28, 1672
br i1 %29, label %66, label %30
30: ; preds = %22
%31 = getelementptr inbounds float, float* %7, i64 %28
%32 = bitcast float* %31 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %32
%33 = getelementptr inbounds float, float* %31, i64 4
%34 = bitcast float* %33 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %34
%35 = or i64 %23, 16
%36 = getelementptr inbounds float, float* %7, i64 %35
%37 = bitcast float* %36 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %37
%38 = getelementptr inbounds float, float* %36, i64 4
%39 = bitcast float* %38 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %39
%40 = or i64 %23, 24
%41 = getelementptr inbounds float, float* %7, i64 %40
%42 = bitcast float* %41 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %42
%43 = getelementptr inbounds float, float* %41, i64 4
%44 = bitcast float* %43 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %44
%45 = or i64 %23, 32
%46 = getelementptr inbounds float, float* %7, i64 %45
%47 = bitcast float* %46 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %47
%48 = getelementptr inbounds float, float* %46, i64 4
%49 = bitcast float* %48 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %49
%50 = or i64 %23, 40
%51 = getelementptr inbounds float, float* %7, i64 %50
%52 = bitcast float* %51 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %52
%53 = getelementptr inbounds float, float* %51, i64 4
%54 = bitcast float* %53 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %54
%55 = or i64 %23, 48
%56 = getelementptr inbounds float, float* %7, i64 %55
%57 = bitcast float* %56 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %57
%58 = getelementptr inbounds float, float* %56, i64 4
%59 = bitcast float* %58 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %59
%60 = or i64 %23, 56
%61 = getelementptr inbounds float, float* %7, i64 %60
%62 = bitcast float* %61 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %62
%63 = getelementptr inbounds float, float* %61, i64 4
%64 = bitcast float* %63 to <4 x float>*
store <4 x float> <float 1.000000e+01, float 1.000000e+01, float 1.000000e+01, float 1.000000e+01>, <4 x float>* %64
%65 = add nuw nsw i64 %23, 64
br label %22
66: ; preds = %22
%67 = getelementptr inbounds float, float* %7, i64 1672
store float 1.000000e+01, float* %67
%68 = getelementptr inbounds float, float* %7, i64 1673
store float 1.000000e+01, float* %68
%69 = getelementptr inbounds float, float* %7, i64 1674
store float 1.000000e+01, float* %69
%70 = getelementptr inbounds float, float* %7, i64 1675
store float 1.000000e+01, float* %70
%71 = getelementptr inbounds float, float* %7, i64 1676
store float 1.000000e+01, float* %71
%72 = getelementptr inbounds float, float* %7, i64 1677
store float 1.000000e+01, float* %72
%73 = getelementptr inbounds float, float* %7, i64 1678
store float 1.000000e+01, float* %73
store float 0.000000e+00, float* %7
%74 = load i32, i32* @stderr
%75 = tail call i32 @fprintf(i32 %74, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
%76 = tail call i32 (i8*, i8*, i32, float*, i32, i8*, i8*, i8*, i8*, ...) @grb2_wrtVA(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2, float* %7, i32 1679, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.18, i64 0, i64 0), i64 20880112010259, i8* null)
store float 2.000000e+00, float* %7
%77 = tail call i32 (i8*, i8*, i32, float*, i32, i8*, i8*, i8*, i8*, ...) @grb2_wrtVA(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 2, float* %7, i32 1679, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.9, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.21, i64 0, i64 0), i32 255, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.13, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.23, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.24, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.25, i64 0, i64 0), i32 50, i8* null)
ret i32 0
}