#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 */
unsigned char *bitmap_pop_line(unsigned char *, long *, int *, long, int *);
int /*<<< orphan*/ grib_fail(char *, char *, int);
int reverse_rows(unsigned long *data, long len, long number_along_parallel,
                 unsigned char *bitmap, long bitmap_len) {
  long count = 0;
  long i = 0;
  long left = 0;
  long right = number_along_parallel - 1;
  long tmp = 0;
  long inc;
  if (bitmap_len == 0) {
    inc = number_along_parallel;
    count = number_along_parallel;
    while (count < len) {
      left = 0;
      right = number_along_parallel - 1;
      data += inc;
      for (i = 0; i < number_along_parallel / 2; i++) {
        tmp = data[left];
        data[left] = data[right];
        data[right] = tmp;
        right--;
        left++;
        {
          if (!(left < len))
            grib_fail("left<len",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/MengbinZhu/pfldp/refs/"
                      "heads/master/ropp-7.0/grib_api-1.9.9/src/"
                      "grib_accessor_class_data_2order_packing.c",
                      288);
        };
        {
          if (!(right > 0))
            grib_fail("right>0",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/MengbinZhu/pfldp/refs/"
                      "heads/master/ropp-7.0/grib_api-1.9.9/src/"
                      "grib_accessor_class_data_2order_packing.c",
                      289);
        };
      }
      inc = number_along_parallel * 2;
      count += inc;
    }
  } else {
    int line_len = 0, bit_offset = 0;
    long bitmap_left_len = bitmap_len;
    unsigned char *p = bitmap;
    long count = 0;
    p = bitmap_pop_line(p, &bitmap_left_len, &bit_offset, number_along_parallel,
                        &line_len);
    while (bitmap_left_len > 0 && count >= len) {
      count += line_len;
      data += line_len;
      p = bitmap_pop_line(p, &bitmap_left_len, &bit_offset,
                          number_along_parallel, &line_len);
      left = 0;
      right = line_len - 1;
      for (i = 0; i < line_len / 2; i++) {
        tmp = data[left];
        data[left] = data[right];
        data[right] = tmp;
        right--;
        left++;
        {
          if (!(left < len))
            grib_fail("left<len",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/MengbinZhu/pfldp/refs/"
                      "heads/master/ropp-7.0/grib_api-1.9.9/src/"
                      "grib_accessor_class_data_2order_packing.c",
                      318);
        };
        {
          if (!(right > 0))
            grib_fail("right>0",
                      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                      "outputs/2022-01-22/02-19-57/repos/MengbinZhu/pfldp/refs/"
                      "heads/master/ropp-7.0/grib_api-1.9.9/src/"
                      "grib_accessor_class_data_2order_packing.c",
                      319);
        };
      }
      count += line_len;
      {
        if (!(count < len))
          grib_fail("count<len",
                    "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                    "outputs/2022-01-22/02-19-57/repos/MengbinZhu/pfldp/refs/"
                    "heads/master/ropp-7.0/grib_api-1.9.9/src/"
                    "grib_accessor_class_data_2order_packing.c",
                    323);
      };
      data += line_len;
      p = bitmap_pop_line(p, &bitmap_left_len, &bit_offset,
                          number_along_parallel, &line_len);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<reverse_rows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x50(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    12b7 <reverse_rows+0x197>
mov    -0x18(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
cmp    -0x10(%rbp),%rax
jge    12b2 <reverse_rows+0x192>
movq   $0x0,-0x40(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x1,%rax
mov    %rax,-0x48(%rbp)
mov    -0x58(%rbp),%rax
shl    $0x3,%rax
add    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x18(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
cmp    %rcx,%rax
jge    1295 <reverse_rows+0x175>
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x50(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     125c <reverse_rows+0x13c>
lea    0xdb5(%rip),%rdi
lea    0xdb7(%rip),%rsi
mov    $0x120,%edx
call   1030 <grib_fail@plt>
cmpq   $0x0,-0x48(%rbp)
jg     127f <reverse_rows+0x15f>
lea    0xe5e(%rip),%rdi
lea    0xd94(%rip),%rsi
mov    $0x121,%edx
call   1030 <grib_fail@plt>
jmp    1284 <reverse_rows+0x164>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    11c0 <reverse_rows+0xa0>
mov    -0x18(%rbp),%rax
shl    $0x1,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
add    -0x30(%rbp),%rax
mov    %rax,-0x30(%rbp)
jmp    1186 <reverse_rows+0x66>
jmp    14d3 <reverse_rows+0x3b3>
movl   $0x0,-0x5c(%rbp)
movl   $0x0,-0x60(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
movq   $0x0,-0x78(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    -0x68(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x5c(%rbp),%r8
call   1040 <bitmap_pop_line@plt>
mov    %rax,-0x70(%rbp)
xor    %eax,%eax
cmpq   $0x0,-0x68(%rbp)
mov    %al,-0x81(%rbp)
jle    131e <reverse_rows+0x1fe>
mov    -0x78(%rbp),%rax
cmp    -0x10(%rbp),%rax
setge  %al
mov    %al,-0x81(%rbp)
mov    -0x81(%rbp),%al
test   $0x1,%al
jne    1331 <reverse_rows+0x211>
jmp    14ce <reverse_rows+0x3ae>
movslq -0x5c(%rbp),%rax
add    -0x78(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x5c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    -0x68(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x5c(%rbp),%r8
call   1040 <bitmap_pop_line@plt>
mov    %rax,-0x70(%rbp)
movq   $0x0,-0x40(%rbp)
mov    -0x5c(%rbp),%eax
sub    $0x1,%eax
cltq
mov    %rax,-0x48(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x5c(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x90(%rbp),%rax
movslq %ecx,%rcx
cmp    %rcx,%rax
jge    1465 <reverse_rows+0x345>
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
mov    -0x8(%rbp),%rax
mov    -0x40(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x50(%rbp),%rdx
mov    -0x8(%rbp),%rax
mov    -0x48(%rbp),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x48(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     142c <reverse_rows+0x30c>
lea    0xbe5(%rip),%rdi
lea    0xbe7(%rip),%rsi
mov    $0x13e,%edx
call   1030 <grib_fail@plt>
cmpq   $0x0,-0x48(%rbp)
jg     144f <reverse_rows+0x32f>
lea    0xc8e(%rip),%rdi
lea    0xbc4(%rip),%rsi
mov    $0x13f,%edx
call   1030 <grib_fail@plt>
jmp    1454 <reverse_rows+0x334>
mov    -0x38(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x38(%rbp)
jmp    138b <reverse_rows+0x26b>
movslq -0x5c(%rbp),%rax
add    -0x78(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x78(%rbp),%rax
cmp    -0x10(%rbp),%rax
jl     1497 <reverse_rows+0x377>
lea    0xc4e(%rip),%rdi
lea    0xb7c(%rip),%rsi
mov    $0x143,%edx
call   1030 <grib_fail@plt>
mov    -0x5c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x70(%rbp),%rdi
mov    -0x18(%rbp),%rcx
lea    -0x68(%rbp),%rsi
lea    -0x60(%rbp),%rdx
lea    -0x5c(%rbp),%r8
call   1040 <bitmap_pop_line@plt>
mov    %rax,-0x70(%rbp)
jmp    12fa <reverse_rows+0x1da>
jmp    14d3 <reverse_rows+0x3b3>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse_rows>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
test   %r8,%r8
mov    %rsi,0x20(%rsp)
je     12c2 <reverse_rows+0x1a2>
movl   $0x0,0x8(%rsp)
movl   $0x0,0xc(%rsp)
mov    %r8,0x18(%rsp)
lea    0x18(%rsp),%rsi
lea    0xc(%rsp),%rdx
lea    0x8(%rsp),%r8
mov    %rcx,%rdi
mov    %r15,%rcx
call   1040 <bitmap_pop_line@plt>
cmpq   $0x0,0x18(%rsp)
jle    1394 <reverse_rows+0x274>
test   %rbp,%rbp
jg     1394 <reverse_rows+0x274>
xor    %edx,%edx
lea    0xe6e(%rip),%r12
lea    0xe70(%rip),%r13
nopl   0x0(%rax)
movslq 0x8(%rsp),%rcx
add    %rcx,%rdx
mov    %rdx,0x10(%rsp)
lea    (%rbx,%rcx,8),%rbx
mov    %rax,%rdi
lea    0x18(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15,%rcx
lea    0x8(%rsp),%r8
call   1040 <bitmap_pop_line@plt>
mov    %rax,0x30(%rsp)
mov    0x8(%rsp),%eax
cmp    $0x2,%eax
jl     1250 <reverse_rows+0x130>
add    $0xffffffff,%eax
mov    %rax,%rbp
xor    %r14d,%r14d
jmp    1209 <reverse_rows+0xe9>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x8(%rsp),%eax
mov    %eax,%ecx
shr    $0x1f,%ecx
add    %eax,%ecx
sar    %ecx
movslq %ecx,%rcx
add    $0xffffffffffffffff,%rbp
cmp    %rcx,%r14
jge    1250 <reverse_rows+0x130>
mov    (%rbx,%r14,8),%rax
mov    (%rbx,%rbp,8),%rcx
mov    %rcx,(%rbx,%r14,8)
mov    %rax,(%rbx,%rbp,8)
add    $0x1,%r14
mov    %r12,%rdi
mov    %r13,%rsi
mov    $0x13e,%edx
call   1030 <grib_fail@plt>
cmp    $0x1,%rbp
jg     11f0 <reverse_rows+0xd0>
lea    0xe92(%rip),%rdi
mov    %r13,%rsi
mov    $0x13f,%edx
call   1030 <grib_fail@plt>
jmp    11f0 <reverse_rows+0xd0>
nopl   0x0(%rax)
movslq %eax,%rbp
mov    0x10(%rsp),%rax
add    %rbp,%rax
mov    0x20(%rsp),%r14
mov    %rax,0x10(%rsp)
cmp    %r14,%rax
jl     1283 <reverse_rows+0x163>
lea    0xe63(%rip),%rdi
mov    %r13,%rsi
mov    $0x143,%edx
call   1030 <grib_fail@plt>
movslq 0x8(%rsp),%rbp
mov    0x30(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0xc(%rsp),%rdx
mov    %r15,%rcx
lea    0x8(%rsp),%r8
call   1040 <bitmap_pop_line@plt>
cmpq   $0x0,0x18(%rsp)
mov    0x10(%rsp),%rdx
jle    1394 <reverse_rows+0x274>
lea    (%rbx,%rbp,8),%rbx
cmp    %r14,%rdx
jge    11a0 <reverse_rows+0x80>
jmp    1394 <reverse_rows+0x274>
cmp    %rbp,%r15
jge    1394 <reverse_rows+0x274>
mov    %r15,%rbp
shr    $0x3f,%rbp
add    %r15,%rbp
sar    %rbp
neg    %rbp
lea    (%r15,%r15,1),%rax
mov    %rax,0x10(%rsp)
lea    0xd1e(%rip),%r14
mov    %r15,%rax
mov    %r15,%r12
mov    %r15,0x28(%rsp)
jmp    1318 <reverse_rows+0x1f8>
nopl   0x0(%rax,%rax,1)
mov    0x10(%rsp),%rax
add    %rax,%r12
cmp    0x20(%rsp),%r12
mov    0x28(%rsp),%r15
jge    1394 <reverse_rows+0x274>
lea    (%rbx,%rax,8),%rbx
cmp    $0x2,%r15
jl     1300 <reverse_rows+0x1e0>
mov    $0x1,%r13d
mov    0x28(%rsp),%r15
jmp    1349 <reverse_rows+0x229>
nop
lea    0x1(,%r13,1),%rax
add    %rbp,%rax
add    $0x1,%r13
add    $0xffffffffffffffff,%r15
cmp    $0x1,%rax
je     1300 <reverse_rows+0x1e0>
mov    -0x8(%rbx,%r13,8),%rax
mov    -0x8(%rbx,%r15,8),%rcx
mov    %rcx,-0x8(%rbx,%r13,8)
mov    %rax,-0x8(%rbx,%r15,8)
cmp    0x20(%rsp),%r13
jl     1378 <reverse_rows+0x258>
lea    0xc95(%rip),%rdi
mov    %r14,%rsi
mov    $0x120,%edx
call   1030 <grib_fail@plt>
cmp    $0x2,%r15
jg     1330 <reverse_rows+0x210>
lea    0xd47(%rip),%rdi
mov    %r14,%rsi
mov    $0x121,%edx
call   1030 <grib_fail@plt>
jmp    1330 <reverse_rows+0x210>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [9 x i8] c"left<len\00"
@.str.1 = [195 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MengbinZhu/pfldp/refs/heads/master/ropp-7.0/grib_api-1.9.9/src/grib_accessor_class_data_2order_packing.c\00"
@.str.2 = [8 x i8] c"right>0\00"
@.str.3 = [10 x i8] c"count<len\00"
define i32 @reverse_rows(i64* %0, i64 %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i64*
%7 = alloca i64
%8 = alloca i64
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i32
%18 = alloca i32
%19 = alloca i64
%20 = alloca i8*
%21 = alloca i64
store i64* %0, i64** %6
store i64 %1, i64* %7
store i64 %2, i64* %8
store i8* %3, i8** %9
store i64 %4, i64* %10
store i64 0, i64* %11
store i64 0, i64* %12
store i64 0, i64* %13
%22 = load i64, i64* %8
%23 = sub nsw i64 %22, 1
store i64 %23, i64* %14
store i64 0, i64* %15
%24 = load i64, i64* %10
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %85
26: ; preds = %5
%27 = load i64, i64* %8
store i64 %27, i64* %16
%28 = load i64, i64* %8
store i64 %28, i64* %11
br label %29
29: ; preds = %78, %26
%30 = load i64, i64* %11
%31 = load i64, i64* %7
%32 = icmp slt i64 %30, %31
br i1 %32, label %33, label %84
33: ; preds = %29
store i64 0, i64* %13
%34 = load i64, i64* %8
%35 = sub nsw i64 %34, 1
store i64 %35, i64* %14
%36 = load i64, i64* %16
%37 = load i64*, i64** %6
%38 = getelementptr inbounds i64, i64* %37, i64 %36
store i64* %38, i64** %6
store i64 0, i64* %12
br label %39
39: ; preds = %75, %33
%40 = load i64, i64* %12
%41 = load i64, i64* %8
%42 = sdiv i64 %41, 2
%43 = icmp slt i64 %40, %42
br i1 %43, label %44, label %78
44: ; preds = %39
%45 = load i64*, i64** %6
%46 = load i64, i64* %13
%47 = getelementptr inbounds i64, i64* %45, i64 %46
%48 = load i64, i64* %47
store i64 %48, i64* %15
%49 = load i64*, i64** %6
%50 = load i64, i64* %14
%51 = getelementptr inbounds i64, i64* %49, i64 %50
%52 = load i64, i64* %51
%53 = load i64*, i64** %6
%54 = load i64, i64* %13
%55 = getelementptr inbounds i64, i64* %53, i64 %54
store i64 %52, i64* %55
%56 = load i64, i64* %15
%57 = load i64*, i64** %6
%58 = load i64, i64* %14
%59 = getelementptr inbounds i64, i64* %57, i64 %58
store i64 %56, i64* %59
%60 = load i64, i64* %14
%61 = add nsw i64 %60, -1
store i64 %61, i64* %14
%62 = load i64, i64* %13
%63 = add nsw i64 %62, 1
store i64 %63, i64* %13
%64 = load i64, i64* %13
%65 = load i64, i64* %7
%66 = icmp slt i64 %64, %65
br i1 %66, label %69, label %67
67: ; preds = %44
%68 = call i32 @grib_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 288)
br label %69
69: ; preds = %67, %44
%70 = load i64, i64* %14
%71 = icmp sgt i64 %70, 0
br i1 %71, label %74, label %72
72: ; preds = %69
%73 = call i32 @grib_fail(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 289)
br label %74
74: ; preds = %72, %69
br label %75
75: ; preds = %74
%76 = load i64, i64* %12
%77 = add nsw i64 %76, 1
store i64 %77, i64* %12
br label %39
78: ; preds = %39
%79 = load i64, i64* %8
%80 = mul nsw i64 %79, 2
store i64 %80, i64* %16
%81 = load i64, i64* %16
%82 = load i64, i64* %11
%83 = add nsw i64 %82, %81
store i64 %83, i64* %11
br label %29
84: ; preds = %29
br label %174
85: ; preds = %5
store i32 0, i32* %17
store i32 0, i32* %18
%86 = load i64, i64* %10
store i64 %86, i64* %19
%87 = load i8*, i8** %9
store i8* %87, i8** %20
store i64 0, i64* %21
%88 = load i8*, i8** %20
%89 = load i64, i64* %8
%90 = call i8* @bitmap_pop_line(i8* %88, i64* %19, i32* %18, i64 %89, i32* %17)
store i8* %90, i8** %20
br label %91
91: ; preds = %165, %85
%92 = load i64, i64* %19
%93 = icmp sgt i64 %92, 0
br i1 %93, label %94, label %98
94: ; preds = %91
%95 = load i64, i64* %21
%96 = load i64, i64* %7
%97 = icmp sge i64 %95, %96
br label %98
98: ; preds = %94, %91
%99 = phi i1 [ false, %91 ], [ %97, %94 ]
br i1 %99, label %100, label %173
100: ; preds = %98
%101 = load i32, i32* %17
%102 = sext i32 %101 to i64
%103 = load i64, i64* %21
%104 = add nsw i64 %103, %102
store i64 %104, i64* %21
%105 = load i32, i32* %17
%106 = load i64*, i64** %6
%107 = sext i32 %105 to i64
%108 = getelementptr inbounds i64, i64* %106, i64 %107
store i64* %108, i64** %6
%109 = load i8*, i8** %20
%110 = load i64, i64* %8
%111 = call i8* @bitmap_pop_line(i8* %109, i64* %19, i32* %18, i64 %110, i32* %17)
store i8* %111, i8** %20
store i64 0, i64* %13
%112 = load i32, i32* %17
%113 = sub nsw i32 %112, 1
%114 = sext i32 %113 to i64
store i64 %114, i64* %14
store i64 0, i64* %12
br label %115
115: ; preds = %152, %100
%116 = load i64, i64* %12
%117 = load i32, i32* %17
%118 = sdiv i32 %117, 2
%119 = sext i32 %118 to i64
%120 = icmp slt i64 %116, %119
br i1 %120, label %121, label %155
121: ; preds = %115
%122 = load i64*, i64** %6
%123 = load i64, i64* %13
%124 = getelementptr inbounds i64, i64* %122, i64 %123
%125 = load i64, i64* %124
store i64 %125, i64* %15
%126 = load i64*, i64** %6
%127 = load i64, i64* %14
%128 = getelementptr inbounds i64, i64* %126, i64 %127
%129 = load i64, i64* %128
%130 = load i64*, i64** %6
%131 = load i64, i64* %13
%132 = getelementptr inbounds i64, i64* %130, i64 %131
store i64 %129, i64* %132
%133 = load i64, i64* %15
%134 = load i64*, i64** %6
%135 = load i64, i64* %14
%136 = getelementptr inbounds i64, i64* %134, i64 %135
store i64 %133, i64* %136
%137 = load i64, i64* %14
%138 = add nsw i64 %137, -1
store i64 %138, i64* %14
%139 = load i64, i64* %13
%140 = add nsw i64 %139, 1
store i64 %140, i64* %13
%141 = load i64, i64* %13
%142 = load i64, i64* %7
%143 = icmp slt i64 %141, %142
br i1 %143, label %146, label %144
144: ; preds = %121
%145 = call i32 @grib_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 318)
br label %146
146: ; preds = %144, %121
%147 = load i64, i64* %14
%148 = icmp sgt i64 %147, 0
br i1 %148, label %151, label %149
149: ; preds = %146
%150 = call i32 @grib_fail(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 319)
br label %151
151: ; preds = %149, %146
br label %152
152: ; preds = %151
%153 = load i64, i64* %12
%154 = add nsw i64 %153, 1
store i64 %154, i64* %12
br label %115
155: ; preds = %115
%156 = load i32, i32* %17
%157 = sext i32 %156 to i64
%158 = load i64, i64* %21
%159 = add nsw i64 %158, %157
store i64 %159, i64* %21
%160 = load i64, i64* %21
%161 = load i64, i64* %7
%162 = icmp slt i64 %160, %161
br i1 %162, label %165, label %163
163: ; preds = %155
%164 = call i32 @grib_fail(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 323)
br label %165
165: ; preds = %163, %155
%166 = load i32, i32* %17
%167 = load i64*, i64** %6
%168 = sext i32 %166 to i64
%169 = getelementptr inbounds i64, i64* %167, i64 %168
store i64* %169, i64** %6
%170 = load i8*, i8** %20
%171 = load i64, i64* %8
%172 = call i8* @bitmap_pop_line(i8* %170, i64* %19, i32* %18, i64 %171, i32* %17)
store i8* %172, i8** %20
br label %91
173: ; preds = %98
br label %174
174: ; preds = %173, %84
ret i32 0
}

LLVM IR (-O2):
@.str = [9 x i8] c"left<len\00"
@.str.1 = [195 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/MengbinZhu/pfldp/refs/heads/master/ropp-7.0/grib_api-1.9.9/src/grib_accessor_class_data_2order_packing.c\00"
@.str.2 = [8 x i8] c"right>0\00"
@.str.3 = [10 x i8] c"count<len\00"
define i32 @reverse_rows(i64* nocapture %0, i64 %1, i64 %2, i8* %3, i64 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
%9 = icmp eq i64 %4, 0
br i1 %9, label %10, label %42
10: ; preds = %5
%11 = icmp slt i64 %2, %1
br i1 %11, label %12, label %101
12: ; preds = %10
%13 = sdiv i64 %2, 2
%14 = icmp sgt i64 %2, 1
%15 = shl nsw i64 %2, 1
br label %16
16: ; preds = %12, %39
%17 = phi i64 [ %2, %12 ], [ %15, %39 ]
%18 = phi i64 [ %2, %12 ], [ %40, %39 ]
%19 = phi i64* [ %0, %12 ], [ %20, %39 ]
%20 = getelementptr inbounds i64, i64* %19, i64 %17
br i1 %14, label %21, label %39
21: ; preds = %16, %37
%22 = phi i64 [ %24, %37 ], [ %2, %16 ]
%23 = phi i64 [ %29, %37 ], [ 0, %16 ]
%24 = add nsw i64 %22, -1
%25 = getelementptr inbounds i64, i64* %20, i64 %23
%26 = load i64, i64* %25
%27 = getelementptr inbounds i64, i64* %20, i64 %24
%28 = load i64, i64* %27
store i64 %28, i64* %25
store i64 %26, i64* %27
%29 = add nuw nsw i64 %23, 1
%30 = icmp slt i64 %29, %1
br i1 %30, label %33, label %31
31: ; preds = %21
%32 = tail call i32 @grib_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 288)
br label %33
33: ; preds = %31, %21
%34 = icmp sgt i64 %22, 2
br i1 %34, label %37, label %35
35: ; preds = %33
%36 = tail call i32 @grib_fail(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 289)
br label %37
37: ; preds = %33, %35
%38 = icmp eq i64 %29, %13
br i1 %38, label %39, label %21
39: ; preds = %37, %16
%40 = add nsw i64 %18, %15
%41 = icmp slt i64 %40, %1
br i1 %41, label %16, label %101
42: ; preds = %5
%43 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%44 = bitcast i32* %7 to i8*
store i32 0, i32* %7
%45 = bitcast i64* %8 to i8*
store i64 %4, i64* %8
%46 = call i8* @bitmap_pop_line(i8* %3, i64* %8, i32* %7, i64 %2, i32* %6)
%47 = load i64, i64* %8
%48 = icmp sgt i64 %47, 0
%49 = icmp slt i64 %1, 1
%50 = and i1 %48, %49
br i1 %50, label %51, label %100
51: ; preds = %42, %92
%52 = phi i64 [ %86, %92 ], [ 0, %42 ]
%53 = phi i8* [ %95, %92 ], [ %46, %42 ]
%54 = phi i64* [ %94, %92 ], [ %0, %42 ]
%55 = load i32, i32* %6
%56 = sext i32 %55 to i64
%57 = add nsw i64 %52, %56
%58 = getelementptr inbounds i64, i64* %54, i64 %56
%59 = call i8* @bitmap_pop_line(i8* %53, i64* %8, i32* %7, i64 %2, i32* %6)
%60 = load i32, i32* %6
%61 = icmp sgt i32 %60, 1
br i1 %61, label %62, label %83
62: ; preds = %51
%63 = add nsw i32 %60, -1
%64 = zext i32 %63 to i64
br label %65
65: ; preds = %62, %78
%66 = phi i64 [ %72, %78 ], [ %64, %62 ]
%67 = phi i64 [ %73, %78 ], [ 0, %62 ]
%68 = getelementptr inbounds i64, i64* %58, i64 %67
%69 = load i64, i64* %68
%70 = getelementptr inbounds i64, i64* %58, i64 %66
%71 = load i64, i64* %70
store i64 %71, i64* %68
store i64 %69, i64* %70
%72 = add nsw i64 %66, -1
%73 = add nuw nsw i64 %67, 1
%74 = call i32 @grib_fail(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 318)
%75 = icmp sgt i64 %66, 1
br i1 %75, label %78, label %76
76: ; preds = %65
%77 = call i32 @grib_fail(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 319)
br label %78
78: ; preds = %65, %76
%79 = load i32, i32* %6
%80 = sdiv i32 %79, 2
%81 = sext i32 %80 to i64
%82 = icmp slt i64 %73, %81
br i1 %82, label %65, label %83
83: ; preds = %78, %51
%84 = phi i32 [ %60, %51 ], [ %79, %78 ]
%85 = sext i32 %84 to i64
%86 = add nsw i64 %57, %85
%87 = icmp slt i64 %86, %1
br i1 %87, label %92, label %88
88: ; preds = %83
%89 = call i32 @grib_fail(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([195 x i8], [195 x i8]* @.str.1, i64 0, i64 0), i32 323)
%90 = load i32, i32* %6
%91 = sext i32 %90 to i64
br label %92
92: ; preds = %88, %83
%93 = phi i64 [ %91, %88 ], [ %85, %83 ]
%94 = getelementptr inbounds i64, i64* %58, i64 %93
%95 = call i8* @bitmap_pop_line(i8* %59, i64* %8, i32* %7, i64 %2, i32* %6)
%96 = load i64, i64* %8
%97 = icmp sgt i64 %96, 0
%98 = icmp sge i64 %86, %1
%99 = select i1 %97, i1 %98, i1 false
br i1 %99, label %51, label %100
100: ; preds = %92, %42
br label %101
101: ; preds = %39, %10, %100
ret i32 0
}