#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 nc_close(int);
int nc_def_dim(int, char *, int, int *);
int nc_def_var(int, char *, int, int, int *, int *);
int nc_enddef(int);
int nc_get_var_int(int, int, int *);
int nc_inq_varid(int, char *, int *);
int nc_open(char *, int, int *);
int nc_put_var_int(int, int, int *);
int nc_redef(int);
char *nc_strerror(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ sprintf(char *, char *, int);
int main(int argc, char **argv) {
  int i, j, err, nerrs = 0, ncid, varid[5], dimid[2];
  int old_buf[3][5], get_buf[3][5], new_buf[1024];
  char *filename;
  filename = argv[1];
  if (argc == 1)
    filename = "tst_pnetcdf.nc";
  err = nc_open(filename, 0x0001, &ncid);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 32, nc_strerror(err));
      nerrs++;
    }
  }
  if (err != 0)
    return 1;
  err = nc_inq_varid(ncid, "fixed_var_1", &varid[0]);
  err = nc_inq_varid(ncid, "fixed_var_3", &varid[1]);
  err = nc_inq_varid(ncid, "fixed_var_5", &varid[2]);
  err = nc_get_var_int(ncid, varid[0], old_buf[0]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 39, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_get_var_int(ncid, varid[1], old_buf[1]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 40, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_get_var_int(ncid, varid[2], old_buf[2]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 41, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_redef(ncid);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 43, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_def_dim(ncid, "new_dim_1", 32, &dimid[0]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 46, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_def_dim(ncid, "new_dim_2", 32, &dimid[1]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 47, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_def_var(ncid, "new_var1", 4, 2, dimid, &varid[3]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 50, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_def_var(ncid, "new_var2", 5, 2, dimid, &varid[4]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 51, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_enddef(ncid);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 52, nc_strerror(err));
      nerrs++;
    }
  }
  for (i = 0; i < 1024; i++)
    new_buf[i] = -1;
  err = nc_put_var_int(ncid, varid[3], new_buf);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 56, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_get_var_int(ncid, varid[0], get_buf[0]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 59, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_get_var_int(ncid, varid[1], get_buf[1]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 60, nc_strerror(err));
      nerrs++;
    }
  }
  err = nc_get_var_int(ncid, varid[2], get_buf[2]);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 61, nc_strerror(err));
      nerrs++;
    }
  }
  for (i = 0; i < 3; i++) {
    char varname[32];
    sprintf(varname, "fixed_var_%d", 2 * i + 1);
    for (j = 0; j < 5; j++) {
      if (get_buf[i][j] != old_buf[i][j]) {
        printf("Error in %s line %d: expecting %s[%d]=%d but got %d\n",
               "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/90jrong/libmesh/refs/heads/"
               "master/contrib/netcdf/netcdf-c-4.6.2/nc_test/tst_addvar.c",
               69, varname, j, old_buf[i][j], get_buf[i][j]);
        nerrs++;
      }
    }
  }
  err = nc_close(ncid);
  {
    if (err != 0) {
      printf("Error at line=%d: %s\n", 75, nc_strerror(err));
      nerrs++;
    }
  }
  return (nerrs > 0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1110,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10d8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1207 <main+0x47>
lea    0xe00(%rip),%rax
mov    %rax,-0x10d8(%rbp)
mov    -0x10d8(%rbp),%rdi
mov    $0x1,%esi
lea    -0x24(%rbp),%rdx
call   10d0 <nc_open@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1250 <main+0x90>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xdd4(%rip),%rdi
mov    $0x20,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1266 <main+0xa6>
movl   $0x1,-0x4(%rbp)
jmp    17ec <main+0x62c>
mov    -0x24(%rbp),%edi
lea    -0x40(%rbp),%rdx
lea    0xdb1(%rip),%rsi
call   1090 <nc_inq_varid@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x40(%rbp),%rdx
add    $0x4,%rdx
lea    0xda3(%rip),%rsi
call   1090 <nc_inq_varid@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x40(%rbp),%rdx
add    $0x8,%rdx
lea    0xd95(%rip),%rsi
call   1090 <nc_inq_varid@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x40(%rbp),%esi
lea    -0x90(%rbp),%rdx
call   1050 <nc_get_var_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     12f6 <main+0x136>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xd2e(%rip),%rdi
mov    $0x27,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x3c(%rbp),%esi
lea    -0x90(%rbp),%rdx
add    $0x14,%rdx
call   1050 <nc_get_var_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1340 <main+0x180>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xce4(%rip),%rdi
mov    $0x28,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x38(%rbp),%esi
lea    -0x90(%rbp),%rdx
add    $0x28,%rdx
call   1050 <nc_get_var_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     138a <main+0x1ca>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xc9a(%rip),%rdi
mov    $0x29,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
call   1080 <nc_redef@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     13c6 <main+0x206>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xc5e(%rip),%rdi
mov    $0x2b,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x48(%rbp),%rcx
lea    0xc75(%rip),%rsi
mov    $0x20,%edx
call   10b0 <nc_def_dim@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1412 <main+0x252>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xc12(%rip),%rdi
mov    $0x2e,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x48(%rbp),%rcx
add    $0x4,%rcx
lea    0xc2f(%rip),%rsi
mov    $0x20,%edx
call   10b0 <nc_def_dim@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1462 <main+0x2a2>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xbc2(%rip),%rdi
mov    $0x2f,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x48(%rbp),%r8
lea    -0x40(%rbp),%r9
add    $0xc,%r9
lea    0xbe5(%rip),%rsi
mov    $0x4,%edx
mov    $0x2,%ecx
call   10a0 <nc_def_var@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     14bb <main+0x2fb>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xb69(%rip),%rdi
mov    $0x32,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x48(%rbp),%r8
lea    -0x40(%rbp),%r9
add    $0x10,%r9
lea    0xb95(%rip),%rsi
mov    $0x5,%edx
mov    $0x2,%ecx
call   10a0 <nc_def_var@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1514 <main+0x354>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xb10(%rip),%rdi
mov    $0x33,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
call   1070 <nc_enddef@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1550 <main+0x390>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xad4(%rip),%rdi
mov    $0x34,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x400,-0x14(%rbp)
jge    1581 <main+0x3c1>
movslq -0x14(%rbp),%rax
movl   $0xffffffff,-0x10d0(%rbp,%rax,4)
ff ff ff ff
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1557 <main+0x397>
mov    -0x24(%rbp),%edi
mov    -0x34(%rbp),%esi
lea    -0x10d0(%rbp),%rdx
call   1030 <nc_put_var_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     15c7 <main+0x407>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xa5d(%rip),%rdi
mov    $0x38,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x40(%rbp),%esi
lea    -0xd0(%rbp),%rdx
call   1050 <nc_get_var_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     160d <main+0x44d>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0xa17(%rip),%rdi
mov    $0x3b,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x3c(%rbp),%esi
lea    -0xd0(%rbp),%rdx
add    $0x14,%rdx
call   1050 <nc_get_var_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1657 <main+0x497>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0x9cd(%rip),%rdi
mov    $0x3c,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x38(%rbp),%esi
lea    -0xd0(%rbp),%rdx
add    $0x28,%rdx
call   1050 <nc_get_var_int@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     16a1 <main+0x4e1>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0x983(%rip),%rdi
mov    $0x3d,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
jge    17a1 <main+0x5e1>
lea    -0x1100(%rbp),%rdi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
add    $0x1,%edx
lea    0x9a6(%rip),%rsi
call   10c0 <sprintf@plt>
movl   $0x0,-0x18(%rbp)
cmpl   $0x5,-0x18(%rbp)
jge    178e <main+0x5ce>
movslq -0x14(%rbp),%rcx
lea    -0xd0(%rbp),%rax
imul   $0x14,%rcx,%rcx
add    %rcx,%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
movslq -0x14(%rbp),%rdx
lea    -0x90(%rbp),%rcx
imul   $0x14,%rdx,%rdx
add    %rdx,%rcx
movslq -0x18(%rbp),%rdx
cmp    (%rcx,%rdx,4),%eax
je     177b <main+0x5bb>
lea    -0x1100(%rbp),%rcx
mov    -0x18(%rbp),%r8d
movslq -0x14(%rbp),%rdx
lea    -0x90(%rbp),%rax
imul   $0x14,%rdx,%rdx
add    %rdx,%rax
movslq -0x18(%rbp),%rdx
mov    (%rax,%rdx,4),%r9d
movslq -0x14(%rbp),%rdx
lea    -0xd0(%rbp),%rax
imul   $0x14,%rdx,%rdx
add    %rdx,%rax
movslq -0x18(%rbp),%rdx
mov    (%rax,%rdx,4),%eax
lea    0x920(%rip),%rdi
lea    0x94e(%rip),%rsi
mov    $0x45,%edx
mov    %eax,(%rsp)
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1780 <main+0x5c0>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    16d5 <main+0x515>
jmp    1793 <main+0x5d3>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    16a8 <main+0x4e8>
mov    -0x24(%rbp),%edi
call   1040 <nc_close@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     17dd <main+0x61d>
mov    -0x1c(%rbp),%edi
call   10e0 <nc_strerror@plt>
mov    %rax,%rdx
lea    0x847(%rip),%rdi
mov    $0x4b,%esi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10d8,%rsp
cmp    $0x1,%edi
je     11ec <main+0x1c>
mov    0x8(%rsi),%rdi
jmp    11f3 <main+0x23>
lea    0xe0d(%rip),%rdi
mov    $0x1,%ebx
lea    0xc(%rsp),%rdx
mov    $0x1,%esi
call   10e0 <nc_open@plt>
test   %eax,%eax
je     122d <main+0x5d>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xdf6(%rip),%rdi
mov    $0x20,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
jmp    16df <main+0x50f>
mov    0xc(%rsp),%edi
lea    0xded(%rip),%rsi
lea    0x10(%rsp),%rdx
call   10a0 <nc_inq_varid@plt>
mov    0xc(%rsp),%edi
lea    0x14(%rsp),%rdx
lea    0xddf(%rip),%rsi
call   10a0 <nc_inq_varid@plt>
mov    0xc(%rsp),%edi
lea    0x18(%rsp),%rdx
lea    0xdd6(%rip),%rsi
call   10a0 <nc_inq_varid@plt>
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%esi
lea    0x70(%rsp),%rdx
call   1050 <nc_get_var_int@plt>
test   %eax,%eax
je     12a6 <main+0xd6>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xd7f(%rip),%rdi
mov    $0x27,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x1,%ebp
jmp    12a8 <main+0xd8>
xor    %ebp,%ebp
mov    0xc(%rsp),%edi
mov    0x14(%rsp),%esi
lea    0x84(%rsp),%rdx
call   1050 <nc_get_var_int@plt>
test   %eax,%eax
je     12e1 <main+0x111>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xd40(%rip),%rdi
mov    $0x28,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
mov    0x18(%rsp),%esi
lea    0x98(%rsp),%rdx
call   1050 <nc_get_var_int@plt>
test   %eax,%eax
je     131a <main+0x14a>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xd07(%rip),%rdi
mov    $0x29,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
call   1090 <nc_redef@plt>
test   %eax,%eax
je     1347 <main+0x177>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xcda(%rip),%rdi
mov    $0x2b,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
lea    0xcf7(%rip),%rsi
lea    0x28(%rsp),%rcx
mov    $0x20,%edx
call   10c0 <nc_def_dim@plt>
test   %eax,%eax
je     1385 <main+0x1b5>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xc9c(%rip),%rdi
mov    $0x2e,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
lea    0x2c(%rsp),%rcx
lea    0xcbe(%rip),%rsi
mov    $0x20,%edx
call   10c0 <nc_def_dim@plt>
test   %eax,%eax
je     13c3 <main+0x1f3>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xc5e(%rip),%rdi
mov    $0x2f,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
lea    0x1c(%rsp),%r9
lea    0xc8a(%rip),%rsi
lea    0x28(%rsp),%r8
mov    $0x4,%edx
mov    $0x2,%ecx
call   10b0 <nc_def_var@plt>
test   %eax,%eax
je     140b <main+0x23b>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xc16(%rip),%rdi
mov    $0x32,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
lea    0x20(%rsp),%r9
lea    0xc4b(%rip),%rsi
lea    0x28(%rsp),%r8
mov    $0x5,%edx
mov    $0x2,%ecx
call   10b0 <nc_def_var@plt>
test   %eax,%eax
je     1453 <main+0x283>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xbce(%rip),%rdi
mov    $0x33,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
call   1070 <nc_enddef@plt>
test   %eax,%eax
je     1480 <main+0x2b0>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xba1(%rip),%rdi
mov    $0x34,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
lea    0xd0(%rsp),%rbx
mov    $0x1000,%edx
mov    %rbx,%rdi
mov    $0xff,%esi
call   1080 <memset@plt>
mov    0xc(%rsp),%edi
mov    0x1c(%rsp),%esi
mov    %rbx,%rdx
call   1030 <nc_put_var_int@plt>
test   %eax,%eax
je     14ce <main+0x2fe>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xb53(%rip),%rdi
mov    $0x38,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
mov    0x10(%rsp),%esi
lea    0x30(%rsp),%rdx
call   1050 <nc_get_var_int@plt>
test   %eax,%eax
je     1504 <main+0x334>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xb1d(%rip),%rdi
mov    $0x3b,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
mov    0x14(%rsp),%esi
lea    0x44(%rsp),%rdx
call   1050 <nc_get_var_int@plt>
test   %eax,%eax
je     153a <main+0x36a>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xae7(%rip),%rdi
mov    $0x3c,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0xc(%rsp),%edi
mov    0x18(%rsp),%esi
lea    0x58(%rsp),%rdx
call   1050 <nc_get_var_int@plt>
test   %eax,%eax
je     1570 <main+0x3a0>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0xab1(%rip),%rdi
mov    $0x3d,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    $0x1,%ebx
lea    0xb0(%rsp),%r15
lea    0xaf8(%rip),%r12
lea    0xb26(%rip),%r13
xor    %r14d,%r14d
jmp    15a1 <main+0x3d1>
add    $0x2,%ebx
add    $0xa,%r14
cmp    $0x1e,%r14
je     16ab <main+0x4db>
mov    %r15,%rdi
lea    0xac4(%rip),%rsi
mov    %ebx,%edx
call   10d0 <sprintf@plt>
mov    0x30(%rsp,%r14,2),%eax
mov    0x70(%rsp,%r14,2),%r9d
cmp    %r9d,%eax
je     15df <main+0x40f>
mov    %eax,(%rsp)
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x45,%edx
mov    %r15,%rcx
xor    %r8d,%r8d
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0x34(%rsp,%r14,2),%eax
mov    0x74(%rsp,%r14,2),%r9d
cmp    %r9d,%eax
je     160f <main+0x43f>
mov    %eax,(%rsp)
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x45,%edx
mov    %r15,%rcx
mov    $0x1,%r8d
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0x38(%rsp,%r14,2),%eax
mov    0x78(%rsp,%r14,2),%r9d
cmp    %r9d,%eax
je     163f <main+0x46f>
mov    %eax,(%rsp)
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x45,%edx
mov    %r15,%rcx
mov    $0x2,%r8d
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0x3c(%rsp,%r14,2),%eax
mov    0x7c(%rsp,%r14,2),%r9d
cmp    %r9d,%eax
je     166f <main+0x49f>
mov    %eax,(%rsp)
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x45,%edx
mov    %r15,%rcx
mov    $0x3,%r8d
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
mov    0x40(%rsp,%r14,2),%eax
mov    0x80(%rsp,%r14,2),%r9d
cmp    %r9d,%eax
je     1590 <main+0x3c0>
mov    %eax,(%rsp)
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x45,%edx
mov    %r15,%rcx
mov    $0x4,%r8d
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
jmp    1590 <main+0x3c0>
mov    0xc(%rsp),%edi
call   1040 <nc_close@plt>
test   %eax,%eax
je     16d8 <main+0x508>
mov    %eax,%edi
call   10f0 <nc_strerror@plt>
lea    0x949(%rip),%rdi
mov    $0x4b,%esi
mov    %rax,%rdx
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%ebp
xor    %ebx,%ebx
test   %ebp,%ebp
setg   %bl
mov    %ebx,%eax
add    $0x10d8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [15 x i8] c"tst_pnetcdf.nc\00"
@.str.1 = [22 x i8] c"Error at line=%d: %s\0A\00"
@.str.2 = [12 x i8] c"fixed_var_1\00"
@.str.3 = [12 x i8] c"fixed_var_3\00"
@.str.4 = [12 x i8] c"fixed_var_5\00"
@.str.5 = [10 x i8] c"new_dim_1\00"
@.str.6 = [10 x i8] c"new_dim_2\00"
@.str.7 = [9 x i8] c"new_var1\00"
@.str.8 = [9 x i8] c"new_var2\00"
@.str.9 = [13 x i8] c"fixed_var_%d\00"
@.str.10 = [53 x i8] c"Error in %s line %d: expecting %s[%d]=%d but got %d\0A\00"
@.str.11 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/90jrong/libmesh/refs/heads/master/contrib/netcdf/netcdf-c-4.6.2/nc_test/tst_addvar.c\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [5 x i32]
%12 = alloca [2 x i32]
%13 = alloca [3 x [5 x i32]]
%14 = alloca [3 x [5 x i32]]
%15 = alloca [1024 x i32]
%16 = alloca i8*
%17 = alloca [32 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %9
%18 = load i8**, i8*** %5
%19 = getelementptr inbounds i8*, i8** %18, i64 1
%20 = load i8*, i8** %19
store i8* %20, i8** %16
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %24
23: ; preds = %2
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8** %16
br label %24
24: ; preds = %23, %2
%25 = load i8*, i8** %16
%26 = call i32 @nc_open(i8* %25, i32 1, i32* %10)
store i32 %26, i32* %8
%27 = load i32, i32* %8
%28 = icmp ne i32 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %24
%30 = load i32, i32* %8
%31 = call i8* @nc_strerror(i32 %30)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 32, i8* %31)
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
store i32 %34, i32* %9
br label %35
35: ; preds = %29, %24
%36 = load i32, i32* %8
%37 = icmp ne i32 %36, 0
br i1 %37, label %38, label %39
38: ; preds = %35
store i32 1, i32* %3
br label %307
39: ; preds = %35
%40 = load i32, i32* %10
%41 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%42 = call i32 @nc_inq_varid(i32 %40, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %41)
store i32 %42, i32* %8
%43 = load i32, i32* %10
%44 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 1
%45 = call i32 @nc_inq_varid(i32 %43, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %44)
store i32 %45, i32* %8
%46 = load i32, i32* %10
%47 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 2
%48 = call i32 @nc_inq_varid(i32 %46, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32* %47)
store i32 %48, i32* %8
%49 = load i32, i32* %10
%50 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%51 = load i32, i32* %50
%52 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %13, i64 0, i64 0
%53 = getelementptr inbounds [5 x i32], [5 x i32]* %52, i64 0, i64 0
%54 = call i32 @nc_get_var_int(i32 %49, i32 %51, i32* %53)
store i32 %54, i32* %8
%55 = load i32, i32* %8
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %63
57: ; preds = %39
%58 = load i32, i32* %8
%59 = call i8* @nc_strerror(i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 39, i8* %59)
%61 = load i32, i32* %9
%62 = add nsw i32 %61, 1
store i32 %62, i32* %9
br label %63
63: ; preds = %57, %39
%64 = load i32, i32* %10
%65 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 1
%66 = load i32, i32* %65
%67 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %13, i64 0, i64 1
%68 = getelementptr inbounds [5 x i32], [5 x i32]* %67, i64 0, i64 0
%69 = call i32 @nc_get_var_int(i32 %64, i32 %66, i32* %68)
store i32 %69, i32* %8
%70 = load i32, i32* %8
%71 = icmp ne i32 %70, 0
br i1 %71, label %72, label %78
72: ; preds = %63
%73 = load i32, i32* %8
%74 = call i8* @nc_strerror(i32 %73)
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* %74)
%76 = load i32, i32* %9
%77 = add nsw i32 %76, 1
store i32 %77, i32* %9
br label %78
78: ; preds = %72, %63
%79 = load i32, i32* %10
%80 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 2
%81 = load i32, i32* %80
%82 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %13, i64 0, i64 2
%83 = getelementptr inbounds [5 x i32], [5 x i32]* %82, i64 0, i64 0
%84 = call i32 @nc_get_var_int(i32 %79, i32 %81, i32* %83)
store i32 %84, i32* %8
%85 = load i32, i32* %8
%86 = icmp ne i32 %85, 0
br i1 %86, label %87, label %93
87: ; preds = %78
%88 = load i32, i32* %8
%89 = call i8* @nc_strerror(i32 %88)
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 41, i8* %89)
%91 = load i32, i32* %9
%92 = add nsw i32 %91, 1
store i32 %92, i32* %9
br label %93
93: ; preds = %87, %78
%94 = load i32, i32* %10
%95 = call i32 @nc_redef(i32 %94)
store i32 %95, i32* %8
%96 = load i32, i32* %8
%97 = icmp ne i32 %96, 0
br i1 %97, label %98, label %104
98: ; preds = %93
%99 = load i32, i32* %8
%100 = call i8* @nc_strerror(i32 %99)
%101 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 43, i8* %100)
%102 = load i32, i32* %9
%103 = add nsw i32 %102, 1
store i32 %103, i32* %9
br label %104
104: ; preds = %98, %93
%105 = load i32, i32* %10
%106 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%107 = call i32 @nc_def_dim(i32 %105, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 32, i32* %106)
store i32 %107, i32* %8
%108 = load i32, i32* %8
%109 = icmp ne i32 %108, 0
br i1 %109, label %110, label %116
110: ; preds = %104
%111 = load i32, i32* %8
%112 = call i8* @nc_strerror(i32 %111)
%113 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 46, i8* %112)
%114 = load i32, i32* %9
%115 = add nsw i32 %114, 1
store i32 %115, i32* %9
br label %116
116: ; preds = %110, %104
%117 = load i32, i32* %10
%118 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 1
%119 = call i32 @nc_def_dim(i32 %117, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 32, i32* %118)
store i32 %119, i32* %8
%120 = load i32, i32* %8
%121 = icmp ne i32 %120, 0
br i1 %121, label %122, label %128
122: ; preds = %116
%123 = load i32, i32* %8
%124 = call i8* @nc_strerror(i32 %123)
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 47, i8* %124)
%126 = load i32, i32* %9
%127 = add nsw i32 %126, 1
store i32 %127, i32* %9
br label %128
128: ; preds = %122, %116
%129 = load i32, i32* %10
%130 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%131 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 3
%132 = call i32 @nc_def_var(i32 %129, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 4, i32 2, i32* %130, i32* %131)
store i32 %132, i32* %8
%133 = load i32, i32* %8
%134 = icmp ne i32 %133, 0
br i1 %134, label %135, label %141
135: ; preds = %128
%136 = load i32, i32* %8
%137 = call i8* @nc_strerror(i32 %136)
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 50, i8* %137)
%139 = load i32, i32* %9
%140 = add nsw i32 %139, 1
store i32 %140, i32* %9
br label %141
141: ; preds = %135, %128
%142 = load i32, i32* %10
%143 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 0
%144 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 4
%145 = call i32 @nc_def_var(i32 %142, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 5, i32 2, i32* %143, i32* %144)
store i32 %145, i32* %8
%146 = load i32, i32* %8
%147 = icmp ne i32 %146, 0
br i1 %147, label %148, label %154
148: ; preds = %141
%149 = load i32, i32* %8
%150 = call i8* @nc_strerror(i32 %149)
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 51, i8* %150)
%152 = load i32, i32* %9
%153 = add nsw i32 %152, 1
store i32 %153, i32* %9
br label %154
154: ; preds = %148, %141
%155 = load i32, i32* %10
%156 = call i32 @nc_enddef(i32 %155)
store i32 %156, i32* %8
%157 = load i32, i32* %8
%158 = icmp ne i32 %157, 0
br i1 %158, label %159, label %165
159: ; preds = %154
%160 = load i32, i32* %8
%161 = call i8* @nc_strerror(i32 %160)
%162 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 52, i8* %161)
%163 = load i32, i32* %9
%164 = add nsw i32 %163, 1
store i32 %164, i32* %9
br label %165
165: ; preds = %159, %154
store i32 0, i32* %6
br label %166
166: ; preds = %173, %165
%167 = load i32, i32* %6
%168 = icmp slt i32 %167, 1024
br i1 %168, label %169, label %176
169: ; preds = %166
%170 = load i32, i32* %6
%171 = sext i32 %170 to i64
%172 = getelementptr inbounds [1024 x i32], [1024 x i32]* %15, i64 0, i64 %171
store i32 -1, i32* %172
br label %173
173: ; preds = %169
%174 = load i32, i32* %6
%175 = add nsw i32 %174, 1
store i32 %175, i32* %6
br label %166
176: ; preds = %166
%177 = load i32, i32* %10
%178 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 3
%179 = load i32, i32* %178
%180 = getelementptr inbounds [1024 x i32], [1024 x i32]* %15, i64 0, i64 0
%181 = call i32 @nc_put_var_int(i32 %177, i32 %179, i32* %180)
store i32 %181, i32* %8
%182 = load i32, i32* %8
%183 = icmp ne i32 %182, 0
br i1 %183, label %184, label %190
184: ; preds = %176
%185 = load i32, i32* %8
%186 = call i8* @nc_strerror(i32 %185)
%187 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 56, i8* %186)
%188 = load i32, i32* %9
%189 = add nsw i32 %188, 1
store i32 %189, i32* %9
br label %190
190: ; preds = %184, %176
%191 = load i32, i32* %10
%192 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 0
%193 = load i32, i32* %192
%194 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %14, i64 0, i64 0
%195 = getelementptr inbounds [5 x i32], [5 x i32]* %194, i64 0, i64 0
%196 = call i32 @nc_get_var_int(i32 %191, i32 %193, i32* %195)
store i32 %196, i32* %8
%197 = load i32, i32* %8
%198 = icmp ne i32 %197, 0
br i1 %198, label %199, label %205
199: ; preds = %190
%200 = load i32, i32* %8
%201 = call i8* @nc_strerror(i32 %200)
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 59, i8* %201)
%203 = load i32, i32* %9
%204 = add nsw i32 %203, 1
store i32 %204, i32* %9
br label %205
205: ; preds = %199, %190
%206 = load i32, i32* %10
%207 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 1
%208 = load i32, i32* %207
%209 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %14, i64 0, i64 1
%210 = getelementptr inbounds [5 x i32], [5 x i32]* %209, i64 0, i64 0
%211 = call i32 @nc_get_var_int(i32 %206, i32 %208, i32* %210)
store i32 %211, i32* %8
%212 = load i32, i32* %8
%213 = icmp ne i32 %212, 0
br i1 %213, label %214, label %220
214: ; preds = %205
%215 = load i32, i32* %8
%216 = call i8* @nc_strerror(i32 %215)
%217 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 60, i8* %216)
%218 = load i32, i32* %9
%219 = add nsw i32 %218, 1
store i32 %219, i32* %9
br label %220
220: ; preds = %214, %205
%221 = load i32, i32* %10
%222 = getelementptr inbounds [5 x i32], [5 x i32]* %11, i64 0, i64 2
%223 = load i32, i32* %222
%224 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %14, i64 0, i64 2
%225 = getelementptr inbounds [5 x i32], [5 x i32]* %224, i64 0, i64 0
%226 = call i32 @nc_get_var_int(i32 %221, i32 %223, i32* %225)
store i32 %226, i32* %8
%227 = load i32, i32* %8
%228 = icmp ne i32 %227, 0
br i1 %228, label %229, label %235
229: ; preds = %220
%230 = load i32, i32* %8
%231 = call i8* @nc_strerror(i32 %230)
%232 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 61, i8* %231)
%233 = load i32, i32* %9
%234 = add nsw i32 %233, 1
store i32 %234, i32* %9
br label %235
235: ; preds = %229, %220
store i32 0, i32* %6
br label %236
236: ; preds = %289, %235
%237 = load i32, i32* %6
%238 = icmp slt i32 %237, 3
br i1 %238, label %239, label %292
239: ; preds = %236
%240 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%241 = load i32, i32* %6
%242 = mul nsw i32 2, %241
%243 = add nsw i32 %242, 1
%244 = call i32 @sprintf(i8* %240, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %243)
store i32 0, i32* %7
br label %245
245: ; preds = %285, %239
%246 = load i32, i32* %7
%247 = icmp slt i32 %246, 5
br i1 %247, label %248, label %288
248: ; preds = %245
%249 = load i32, i32* %6
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %14, i64 0, i64 %250
%252 = load i32, i32* %7
%253 = sext i32 %252 to i64
%254 = getelementptr inbounds [5 x i32], [5 x i32]* %251, i64 0, i64 %253
%255 = load i32, i32* %254
%256 = load i32, i32* %6
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %13, i64 0, i64 %257
%259 = load i32, i32* %7
%260 = sext i32 %259 to i64
%261 = getelementptr inbounds [5 x i32], [5 x i32]* %258, i64 0, i64 %260
%262 = load i32, i32* %261
%263 = icmp ne i32 %255, %262
br i1 %263, label %264, label %284
264: ; preds = %248
%265 = getelementptr inbounds [32 x i8], [32 x i8]* %17, i64 0, i64 0
%266 = load i32, i32* %7
%267 = load i32, i32* %6
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %13, i64 0, i64 %268
%270 = load i32, i32* %7
%271 = sext i32 %270 to i64
%272 = getelementptr inbounds [5 x i32], [5 x i32]* %269, i64 0, i64 %271
%273 = load i32, i32* %272
%274 = load i32, i32* %6
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %14, i64 0, i64 %275
%277 = load i32, i32* %7
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds [5 x i32], [5 x i32]* %276, i64 0, i64 %278
%280 = load i32, i32* %279
%281 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 69, i8* %265, i32 %266, i32 %273, i32 %280)
%282 = load i32, i32* %9
%283 = add nsw i32 %282, 1
store i32 %283, i32* %9
br label %284
284: ; preds = %264, %248
br label %285
285: ; preds = %284
%286 = load i32, i32* %7
%287 = add nsw i32 %286, 1
store i32 %287, i32* %7
br label %245
288: ; preds = %245
br label %289
289: ; preds = %288
%290 = load i32, i32* %6
%291 = add nsw i32 %290, 1
store i32 %291, i32* %6
br label %236
292: ; preds = %236
%293 = load i32, i32* %10
%294 = call i32 @nc_close(i32 %293)
store i32 %294, i32* %8
%295 = load i32, i32* %8
%296 = icmp ne i32 %295, 0
br i1 %296, label %297, label %303
297: ; preds = %292
%298 = load i32, i32* %8
%299 = call i8* @nc_strerror(i32 %298)
%300 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 75, i8* %299)
%301 = load i32, i32* %9
%302 = add nsw i32 %301, 1
store i32 %302, i32* %9
br label %303
303: ; preds = %297, %292
%304 = load i32, i32* %9
%305 = icmp sgt i32 %304, 0
%306 = zext i1 %305 to i32
store i32 %306, i32* %3
br label %307
307: ; preds = %303, %38
%308 = load i32, i32* %3
ret i32 %308
}

LLVM IR (-O2):
@.str = [15 x i8] c"tst_pnetcdf.nc\00"
@.str.1 = [22 x i8] c"Error at line=%d: %s\0A\00"
@.str.2 = [12 x i8] c"fixed_var_1\00"
@.str.3 = [12 x i8] c"fixed_var_3\00"
@.str.4 = [12 x i8] c"fixed_var_5\00"
@.str.5 = [10 x i8] c"new_dim_1\00"
@.str.6 = [10 x i8] c"new_dim_2\00"
@.str.7 = [9 x i8] c"new_var1\00"
@.str.8 = [9 x i8] c"new_var2\00"
@.str.9 = [13 x i8] c"fixed_var_%d\00"
@.str.10 = [53 x i8] c"Error in %s line %d: expecting %s[%d]=%d but got %d\0A\00"
@.str.11 = [175 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/90jrong/libmesh/refs/heads/master/contrib/netcdf/netcdf-c-4.6.2/nc_test/tst_addvar.c\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca [5 x i32]
%5 = alloca [2 x i32]
%6 = alloca [3 x [5 x i32]]
%7 = alloca [3 x [5 x i32]]
%8 = alloca [1024 x i32]
%9 = bitcast [1024 x i32]* %8 to i8*
%10 = alloca [32 x i8]
%11 = bitcast i32* %3 to i8*
%12 = bitcast [5 x i32]* %4 to i8*
%13 = bitcast [2 x i32]* %5 to i8*
%14 = bitcast [3 x [5 x i32]]* %6 to i8*
%15 = bitcast [3 x [5 x i32]]* %7 to i8*
%16 = getelementptr inbounds i8*, i8** %1, i64 1
%17 = load i8*, i8** %16
%18 = icmp eq i32 %0, 1
%19 = select i1 %18, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* %17
%20 = call i32 @nc_open(i8* %19, i32 1, i32* %3)
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %2
%23 = call i8* @nc_strerror(i32 %20)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 32, i8* %23)
br label %241
25: ; preds = %2
%26 = load i32, i32* %3
%27 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 0
%28 = call i32 @nc_inq_varid(i32 %26, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0), i32* %27)
%29 = load i32, i32* %3
%30 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 1
%31 = call i32 @nc_inq_varid(i32 %29, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32* %30)
%32 = load i32, i32* %3
%33 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 2
%34 = call i32 @nc_inq_varid(i32 %32, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32* %33)
%35 = load i32, i32* %3
%36 = load i32, i32* %27
%37 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 0, i64 0
%38 = call i32 @nc_get_var_int(i32 %35, i32 %36, i32* %37)
%39 = icmp eq i32 %38, 0
br i1 %39, label %43, label %40
40: ; preds = %25
%41 = call i8* @nc_strerror(i32 %38)
%42 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 39, i8* %41)
br label %43
43: ; preds = %40, %25
%44 = phi i32 [ 1, %40 ], [ 0, %25 ]
%45 = load i32, i32* %3
%46 = load i32, i32* %30
%47 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 1, i64 0
%48 = call i32 @nc_get_var_int(i32 %45, i32 %46, i32* %47)
%49 = icmp eq i32 %48, 0
br i1 %49, label %54, label %50
50: ; preds = %43
%51 = call i8* @nc_strerror(i32 %48)
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 40, i8* %51)
%53 = add nuw nsw i32 %44, 1
br label %54
54: ; preds = %50, %43
%55 = phi i32 [ %53, %50 ], [ %44, %43 ]
%56 = load i32, i32* %3
%57 = load i32, i32* %33
%58 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 2, i64 0
%59 = call i32 @nc_get_var_int(i32 %56, i32 %57, i32* %58)
%60 = icmp eq i32 %59, 0
br i1 %60, label %65, label %61
61: ; preds = %54
%62 = call i8* @nc_strerror(i32 %59)
%63 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 41, i8* %62)
%64 = add nuw nsw i32 %55, 1
br label %65
65: ; preds = %61, %54
%66 = phi i32 [ %64, %61 ], [ %55, %54 ]
%67 = load i32, i32* %3
%68 = call i32 @nc_redef(i32 %67)
%69 = icmp eq i32 %68, 0
br i1 %69, label %74, label %70
70: ; preds = %65
%71 = call i8* @nc_strerror(i32 %68)
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 43, i8* %71)
%73 = add nuw nsw i32 %66, 1
br label %74
74: ; preds = %70, %65
%75 = phi i32 [ %73, %70 ], [ %66, %65 ]
%76 = load i32, i32* %3
%77 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 0
%78 = call i32 @nc_def_dim(i32 %76, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 32, i32* %77)
%79 = icmp eq i32 %78, 0
br i1 %79, label %84, label %80
80: ; preds = %74
%81 = call i8* @nc_strerror(i32 %78)
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 46, i8* %81)
%83 = add nuw nsw i32 %75, 1
br label %84
84: ; preds = %80, %74
%85 = phi i32 [ %83, %80 ], [ %75, %74 ]
%86 = load i32, i32* %3
%87 = getelementptr inbounds [2 x i32], [2 x i32]* %5, i64 0, i64 1
%88 = call i32 @nc_def_dim(i32 %86, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0), i32 32, i32* %87)
%89 = icmp eq i32 %88, 0
br i1 %89, label %94, label %90
90: ; preds = %84
%91 = call i8* @nc_strerror(i32 %88)
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 47, i8* %91)
%93 = add nuw nsw i32 %85, 1
br label %94
94: ; preds = %90, %84
%95 = phi i32 [ %93, %90 ], [ %85, %84 ]
%96 = load i32, i32* %3
%97 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 3
%98 = call i32 @nc_def_var(i32 %96, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), i32 4, i32 2, i32* %77, i32* %97)
%99 = icmp eq i32 %98, 0
br i1 %99, label %104, label %100
100: ; preds = %94
%101 = call i8* @nc_strerror(i32 %98)
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 50, i8* %101)
%103 = add nuw nsw i32 %95, 1
br label %104
104: ; preds = %100, %94
%105 = phi i32 [ %103, %100 ], [ %95, %94 ]
%106 = load i32, i32* %3
%107 = getelementptr inbounds [5 x i32], [5 x i32]* %4, i64 0, i64 4
%108 = call i32 @nc_def_var(i32 %106, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), i32 5, i32 2, i32* %77, i32* %107)
%109 = icmp eq i32 %108, 0
br i1 %109, label %114, label %110
110: ; preds = %104
%111 = call i8* @nc_strerror(i32 %108)
%112 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 51, i8* %111)
%113 = add nuw nsw i32 %105, 1
br label %114
114: ; preds = %110, %104
%115 = phi i32 [ %113, %110 ], [ %105, %104 ]
%116 = load i32, i32* %3
%117 = call i32 @nc_enddef(i32 %116)
%118 = icmp eq i32 %117, 0
br i1 %118, label %123, label %119
119: ; preds = %114
%120 = call i8* @nc_strerror(i32 %117)
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 52, i8* %120)
%122 = add nuw nsw i32 %115, 1
br label %123
123: ; preds = %119, %114
%124 = phi i32 [ %122, %119 ], [ %115, %114 ]
%125 = load i32, i32* %3
%126 = load i32, i32* %97
%127 = getelementptr inbounds [1024 x i32], [1024 x i32]* %8, i64 0, i64 0
%128 = call i32 @nc_put_var_int(i32 %125, i32 %126, i32* %127)
%129 = icmp eq i32 %128, 0
br i1 %129, label %134, label %130
130: ; preds = %123
%131 = call i8* @nc_strerror(i32 %128)
%132 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 56, i8* %131)
%133 = add nuw nsw i32 %124, 1
br label %134
134: ; preds = %130, %123
%135 = phi i32 [ %133, %130 ], [ %124, %123 ]
%136 = load i32, i32* %3
%137 = load i32, i32* %27
%138 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 0, i64 0
%139 = call i32 @nc_get_var_int(i32 %136, i32 %137, i32* %138)
%140 = icmp eq i32 %139, 0
br i1 %140, label %145, label %141
141: ; preds = %134
%142 = call i8* @nc_strerror(i32 %139)
%143 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 59, i8* %142)
%144 = add nuw nsw i32 %135, 1
br label %145
145: ; preds = %141, %134
%146 = phi i32 [ %144, %141 ], [ %135, %134 ]
%147 = load i32, i32* %3
%148 = load i32, i32* %30
%149 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 1, i64 0
%150 = call i32 @nc_get_var_int(i32 %147, i32 %148, i32* %149)
%151 = icmp eq i32 %150, 0
br i1 %151, label %156, label %152
152: ; preds = %145
%153 = call i8* @nc_strerror(i32 %150)
%154 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 60, i8* %153)
%155 = add nuw nsw i32 %146, 1
br label %156
156: ; preds = %152, %145
%157 = phi i32 [ %155, %152 ], [ %146, %145 ]
%158 = load i32, i32* %3
%159 = load i32, i32* %33
%160 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 2, i64 0
%161 = call i32 @nc_get_var_int(i32 %158, i32 %159, i32* %160)
%162 = icmp eq i32 %161, 0
br i1 %162, label %167, label %163
163: ; preds = %156
%164 = call i8* @nc_strerror(i32 %161)
%165 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 61, i8* %164)
%166 = add nuw nsw i32 %157, 1
br label %167
167: ; preds = %163, %156
%168 = phi i32 [ %166, %163 ], [ %157, %156 ]
%169 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
br label %170
170: ; preds = %167, %225
%171 = phi i64 [ 0, %167 ], [ %227, %225 ]
%172 = phi i32 [ %168, %167 ], [ %226, %225 ]
%173 = trunc i64 %171 to i32
%174 = shl i32 %173, 1
%175 = or i32 %174, 1
%176 = call i32 @sprintf(i8* %169, i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.9, i64 0, i64 0), i32 %175)
%177 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 %171, i64 0
%178 = load i32, i32* %177
%179 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 %171, i64 0
%180 = load i32, i32* %179
%181 = icmp eq i32 %178, %180
br i1 %181, label %185, label %182
182: ; preds = %170
%183 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 69, i8* %169, i32 0, i32 %180, i32 %178)
%184 = add nsw i32 %172, 1
br label %185
185: ; preds = %170, %182
%186 = phi i32 [ %184, %182 ], [ %172, %170 ]
%187 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 %171, i64 1
%188 = load i32, i32* %187
%189 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 %171, i64 1
%190 = load i32, i32* %189
%191 = icmp eq i32 %188, %190
br i1 %191, label %195, label %192
192: ; preds = %185
%193 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 69, i8* %169, i32 1, i32 %190, i32 %188)
%194 = add nsw i32 %186, 1
br label %195
195: ; preds = %192, %185
%196 = phi i32 [ %194, %192 ], [ %186, %185 ]
%197 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 %171, i64 2
%198 = load i32, i32* %197
%199 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 %171, i64 2
%200 = load i32, i32* %199
%201 = icmp eq i32 %198, %200
br i1 %201, label %205, label %202
202: ; preds = %195
%203 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 69, i8* %169, i32 2, i32 %200, i32 %198)
%204 = add nsw i32 %196, 1
br label %205
205: ; preds = %202, %195
%206 = phi i32 [ %204, %202 ], [ %196, %195 ]
%207 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 %171, i64 3
%208 = load i32, i32* %207
%209 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 %171, i64 3
%210 = load i32, i32* %209
%211 = icmp eq i32 %208, %210
br i1 %211, label %215, label %212
212: ; preds = %205
%213 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 69, i8* %169, i32 3, i32 %210, i32 %208)
%214 = add nsw i32 %206, 1
br label %215
215: ; preds = %212, %205
%216 = phi i32 [ %214, %212 ], [ %206, %205 ]
%217 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %7, i64 0, i64 %171, i64 4
%218 = load i32, i32* %217
%219 = getelementptr inbounds [3 x [5 x i32]], [3 x [5 x i32]]* %6, i64 0, i64 %171, i64 4
%220 = load i32, i32* %219
%221 = icmp eq i32 %218, %220
br i1 %221, label %225, label %222
222: ; preds = %215
%223 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([53 x i8], [53 x i8]* @.str.10, i64 0, i64 0), i8* getelementptr inbounds ([175 x i8], [175 x i8]* @.str.11, i64 0, i64 0), i32 69, i8* %169, i32 4, i32 %220, i32 %218)
%224 = add nsw i32 %216, 1
br label %225
225: ; preds = %222, %215
%226 = phi i32 [ %224, %222 ], [ %216, %215 ]
%227 = add nuw nsw i64 %171, 1
%228 = icmp eq i64 %227, 3
br i1 %228, label %229, label %170
229: ; preds = %225
%230 = load i32, i32* %3
%231 = call i32 @nc_close(i32 %230)
%232 = icmp eq i32 %231, 0
br i1 %232, label %237, label %233
233: ; preds = %229
%234 = call i8* @nc_strerror(i32 %231)
%235 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 75, i8* %234)
%236 = add nsw i32 %226, 1
br label %237
237: ; preds = %233, %229
%238 = phi i32 [ %236, %233 ], [ %226, %229 ]
%239 = icmp sgt i32 %238, 0
%240 = zext i1 %239 to i32
br label %241
241: ; preds = %22, %237
%242 = phi i32 [ %240, %237 ], [ 1, %22 ]
ret i32 %242
}