#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*/ ffpmsg(char *);
scalar_t__ isdigit(int);
long strtol(char *, char **, int);
int ffrwrg(char *rowlist, long maxrows, int maxranges, int *numranges,
           long *minrow, long *maxrow, int *status) {
  char *next;
  long minval, maxval;
  if (*status > 0)
    return (*status);
  if (maxrows <= 0) {
    *status = 126;
    ffpmsg("Input maximum range value is <= 0 (fits_parse_ranges)");
    return (*status);
  }
  next = rowlist;
  *numranges = 0;
  while (*next == ' ')
    next++;
  while (*next != '\0') {
    if (*next == '-') {
      minval = 1;
    } else if (isdigit((int)*next)) {
      minval = strtol(next, &next, 10);
    } else {
      *status = 126;
      ffpmsg("Syntax error in this row range list:");
      ffpmsg(rowlist);
      return (*status);
    }
    while (*next == ' ')
      next++;
    if (*next == '-') {
      next++;
      while (*next == ' ')
        next++;
      if (isdigit((int)*next)) {
        maxval = strtol(next, &next, 10);
      } else if (*next == ',' || *next == '\0') {
        maxval = maxrows;
      } else {
        *status = 126;
        ffpmsg("Syntax error in this row range list:");
        ffpmsg(rowlist);
        return (*status);
      }
    } else if (*next == ',' || *next == '\0') {
      maxval = minval;
    } else {
      *status = 126;
      ffpmsg("Syntax error in this row range list:");
      ffpmsg(rowlist);
      return (*status);
    }
    if (*numranges + 1 > maxranges) {
      *status = 126;
      ffpmsg("Overflowed maximum number of ranges (fits_parse_ranges)");
      return (*status);
    }
    if (minval < 1) {
      *status = 126;
      ffpmsg("Syntax error in this row range list: row number < 1");
      ffpmsg(rowlist);
      return (*status);
    }
    if (maxval < minval) {
      *status = 126;
      ffpmsg("Syntax error in this row range list: min > max");
      ffpmsg(rowlist);
      return (*status);
    }
    if (*numranges > 0) {
      if (minval <= maxrow[(*numranges) - 1]) {
        *status = 126;
        ffpmsg("Syntax error in this row range list.  Range minimum is");
        ffpmsg("  less than or equal to previous range maximum");
        ffpmsg(rowlist);
        return (*status);
      }
    }
    if (minval <= maxrows) {
      if (maxval > maxrows)
        maxval = maxrows;
      minrow[*numranges] = minval;
      maxrow[*numranges] = maxval;
      (*numranges)++;
    }
    while (*next == ' ')
      next++;
    if (*next == ',') {
      next++;
      while (*next == ' ')
        next++;
    }
  }
  if (*numranges == 0) {
    minrow[0] = 1;
    maxrow[0] = maxrows;
    *numranges = 1;
  }
  return (*status);
}


x86 assembly (clang, -O0):
<ffrwrg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    0x10(%rbp),%rax
cmpl   $0x0,(%rax)
jle    116e <ffrwrg+0x3e>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
cmpq   $0x0,-0x18(%rbp)
jg     119d <ffrwrg+0x6d>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xe76(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rax
movl   $0x0,(%rax)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    11d0 <ffrwrg+0xa0>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    11af <ffrwrg+0x7f>
jmp    11d5 <ffrwrg+0xa5>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1590 <ffrwrg+0x460>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1202 <ffrwrg+0xd2>
movq   $0x1,-0x48(%rbp)
jmp    1265 <ffrwrg+0x135>
mov    -0x40(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     1233 <ffrwrg+0x103>
mov    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x48(%rbp)
jmp    1260 <ffrwrg+0x130>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xdf2(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
jmp    1265 <ffrwrg+0x135>
jmp    126a <ffrwrg+0x13a>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    128b <ffrwrg+0x15b>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    126a <ffrwrg+0x13a>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    135d <ffrwrg+0x22d>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    12c8 <ffrwrg+0x198>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    12a7 <ffrwrg+0x177>
mov    -0x40(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     12f9 <ffrwrg+0x1c9>
mov    -0x40(%rbp),%rdi
lea    -0x40(%rbp),%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,-0x50(%rbp)
jmp    1358 <ffrwrg+0x228>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     1319 <ffrwrg+0x1e9>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1326 <ffrwrg+0x1f6>
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    1353 <ffrwrg+0x223>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xcff(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
jmp    1358 <ffrwrg+0x228>
jmp    13bc <ffrwrg+0x28c>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
je     137d <ffrwrg+0x24d>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    138a <ffrwrg+0x25a>
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
jmp    13b7 <ffrwrg+0x287>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xc9b(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
jmp    13bc <ffrwrg+0x28c>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
add    $0x1,%eax
cmp    -0x1c(%rbp),%eax
jle    13f2 <ffrwrg+0x2c2>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xc7c(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
cmpq   $0x1,-0x48(%rbp)
jge    142a <ffrwrg+0x2fa>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xc85(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
mov    -0x50(%rbp),%rax
cmp    -0x48(%rbp),%rax
jge    1465 <ffrwrg+0x335>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xc7e(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jle    14ce <ffrwrg+0x39e>
mov    -0x48(%rbp),%rax
mov    -0x38(%rbp),%rcx
mov    -0x28(%rbp),%rdx
mov    (%rdx),%edx
sub    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,8),%rax
jg     14c9 <ffrwrg+0x399>
mov    0x10(%rbp),%rax
movl   $0x7e,(%rax)
lea    0xc55(%rip),%rdi
call   1040 <ffpmsg@plt>
lea    0xc80(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    -0x10(%rbp),%rdi
call   1040 <ffpmsg@plt>
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    15c6 <ffrwrg+0x496>
jmp    14ce <ffrwrg+0x39e>
mov    -0x48(%rbp),%rax
cmp    -0x18(%rbp),%rax
jg     1523 <ffrwrg+0x3f3>
mov    -0x50(%rbp),%rax
cmp    -0x18(%rbp),%rax
jle    14f2 <ffrwrg+0x3c2>
mov    -0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x48(%rbp),%rdx
mov    -0x30(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x50(%rbp),%rdx
mov    -0x38(%rbp),%rax
mov    -0x28(%rbp),%rcx
movslq (%rcx),%rcx
mov    %rdx,(%rax,%rcx,8)
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
jmp    1528 <ffrwrg+0x3f8>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1549 <ffrwrg+0x419>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1528 <ffrwrg+0x3f8>
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2c,%eax
jne    158b <ffrwrg+0x45b>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
jne    1586 <ffrwrg+0x456>
mov    -0x40(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x40(%rbp)
jmp    1565 <ffrwrg+0x435>
jmp    158b <ffrwrg+0x45b>
jmp    11d5 <ffrwrg+0xa5>
mov    -0x28(%rbp),%rax
cmpl   $0x0,(%rax)
jne    15bd <ffrwrg+0x48d>
mov    -0x30(%rbp),%rax
movq   $0x1,(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x28(%rbp),%rax
movl   $0x1,(%rax)
mov    0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffrwrg>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    0x50(%rsp),%rbp
mov    0x0(%rbp),%eax
test   %eax,%eax
jg     1335 <ffrwrg+0x205>
mov    %rsi,%rbx
test   %rsi,%rsi
jle    131f <ffrwrg+0x1ef>
mov    %rcx,%r13
mov    %edx,%r15d
mov    %r8,0x10(%rsp)
movl   $0x0,(%rcx)
mov    %rdi,0x8(%rsp)
lea    -0x1(%rdi),%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x20,0x1(%r12)
lea    0x1(%r12),%r12
je     1180 <ffrwrg+0x50>
xor    %ecx,%ecx
mov    %r12,(%rsp)
movsbl (%r12),%edi
mov    $0x1,%r14d
cmp    $0x2d,%edi
je     11e4 <ffrwrg+0xb4>
test   %dil,%dil
je     1383 <ffrwrg+0x253>
mov    %r9,%rbp
call   1030 <isdigit@plt>
test   %rax,%rax
je     1300 <ffrwrg+0x1d0>
mov    %r12,%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rax,%r14
mov    (%rsp),%r12
mov    %rbp,%r9
jmp    11e4 <ffrwrg+0xb4>
nopl   0x0(%rax)
add    $0x1,%r12
movzbl (%r12),%eax
cmp    $0x20,%al
je     11e0 <ffrwrg+0xb0>
test   %al,%al
je     1250 <ffrwrg+0x120>
cmp    $0x2c,%al
je     1250 <ffrwrg+0x120>
cmp    $0x2d,%al
jne    1300 <ffrwrg+0x1d0>
mov    %r9,%rbp
mov    %r12,(%rsp)
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl 0x1(%r12),%edi
add    $0x1,%r12
cmp    $0x20,%edi
je     1210 <ffrwrg+0xe0>
mov    %r12,(%rsp)
call   1030 <isdigit@plt>
test   %rax,%rax
je     12e2 <ffrwrg+0x1b2>
mov    %r12,%rdi
mov    %rsp,%rsi
mov    $0xa,%edx
call   1050 <strtol@plt>
mov    %rbp,%r9
jmp    1257 <ffrwrg+0x127>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,(%rsp)
mov    %r14,%rax
mov    0x0(%r13),%ecx
cmp    %r15d,%ecx
jge    1344 <ffrwrg+0x214>
test   %r14,%r14
jle    1359 <ffrwrg+0x229>
cmp    %r14,%rax
jl     136e <ffrwrg+0x23e>
test   %ecx,%ecx
jle    1287 <ffrwrg+0x157>
lea    -0x1(%rcx),%edx
cmp    (%r9,%rdx,8),%r14
jle    13a5 <ffrwrg+0x275>
cmp    %rbx,%r14
jg     12aa <ffrwrg+0x17a>
movslq %ecx,%rdx
cmp    %rbx,%rax
cmovg  %rbx,%rax
mov    0x10(%rsp),%rsi
mov    %r14,(%rsi,%rdx,8)
mov    %rax,(%r9,%rdx,8)
add    $0x1,%ecx
mov    %ecx,0x0(%r13)
mov    (%rsp),%r12
xchg   %ax,%ax
movzbl (%r12),%eax
cmp    $0x20,%al
jne    12c0 <ffrwrg+0x190>
add    $0x1,%r12
jmp    12b0 <ffrwrg+0x180>
nop
cmp    $0x2c,%al
jne    118f <ffrwrg+0x5f>
mov    %r12,(%rsp)
nopl   0x0(%rax)
cmpb   $0x20,0x1(%r12)
lea    0x1(%r12),%r12
je     12d0 <ffrwrg+0x1a0>
jmp    118f <ffrwrg+0x5f>
mov    (%r12),%cl
mov    %rbx,%rax
test   %cl,%cl
mov    %rbp,%r9
je     1257 <ffrwrg+0x127>
mov    %rbx,%rax
cmp    $0x2c,%cl
je     1257 <ffrwrg+0x127>
mov    0x50(%rsp),%rbp
movl   $0x7e,0x0(%rbp)
lea    0xd23(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    0x8(%rsp),%rdi
jmp    132d <ffrwrg+0x1fd>
movl   $0x7e,0x0(%rbp)
lea    0xcd3(%rip),%rdi
call   1040 <ffpmsg@plt>
mov    0x0(%rbp),%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x50(%rsp),%rbp
movl   $0x7e,0x0(%rbp)
lea    0xd04(%rip),%rdi
jmp    132d <ffrwrg+0x1fd>
mov    0x50(%rsp),%rbp
movl   $0x7e,0x0(%rbp)
lea    0xd27(%rip),%rdi
jmp    1313 <ffrwrg+0x1e3>
mov    0x50(%rsp),%rbp
movl   $0x7e,0x0(%rbp)
lea    0xd46(%rip),%rdi
jmp    1313 <ffrwrg+0x1e3>
test   %ecx,%ecx
mov    0x50(%rsp),%rbp
jne    1332 <ffrwrg+0x202>
mov    0x10(%rsp),%rax
movq   $0x1,(%rax)
mov    %rbx,(%r9)
movl   $0x1,0x0(%r13)
jmp    1332 <ffrwrg+0x202>
mov    0x50(%rsp),%rbp
movl   $0x7e,0x0(%rbp)
lea    0xd3e(%rip),%rdi
call   1040 <ffpmsg@plt>
lea    0xd69(%rip),%rdi
jmp    1313 <ffrwrg+0x1e3>

LLVM IR (-O0):
@.str = [54 x i8] c"Input maximum range value is <= 0 (fits_parse_ranges)\00"
@.str.1 = [37 x i8] c"Syntax error in this row range list:\00"
@.str.2 = [56 x i8] c"Overflowed maximum number of ranges (fits_parse_ranges)\00"
@.str.3 = [52 x i8] c"Syntax error in this row range list: row number < 1\00"
@.str.4 = [47 x i8] c"Syntax error in this row range list: min > max\00"
@.str.5 = [55 x i8] c"Syntax error in this row range list. Range minimum is\00"
@.str.6 = [47 x i8] c" less than or equal to previous range maximum\00"
define i32 @ffrwrg(i8* %0, i64 %1, i32 %2, i32* %3, i64* %4, i64* %5, i32* %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i64
%11 = alloca i32
%12 = alloca i32*
%13 = alloca i64*
%14 = alloca i64*
%15 = alloca i32*
%16 = alloca i8*
%17 = alloca i64
%18 = alloca i64
store i8* %0, i8** %9
store i64 %1, i64* %10
store i32 %2, i32* %11
store i32* %3, i32** %12
store i64* %4, i64** %13
store i64* %5, i64** %14
store i32* %6, i32** %15
%19 = load i32*, i32** %15
%20 = load i32, i32* %19
%21 = icmp sgt i32 %20, 0
br i1 %21, label %22, label %25
22: ; preds = %7
%23 = load i32*, i32** %15
%24 = load i32, i32* %23
store i32 %24, i32* %8
br label %270
25: ; preds = %7
%26 = load i64, i64* %10
%27 = icmp sle i64 %26, 0
br i1 %27, label %28, label %33
28: ; preds = %25
%29 = load i32*, i32** %15
store i32 126, i32* %29
%30 = call i32 @ffpmsg(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
%31 = load i32*, i32** %15
%32 = load i32, i32* %31
store i32 %32, i32* %8
br label %270
33: ; preds = %25
%34 = load i8*, i8** %9
store i8* %34, i8** %16
%35 = load i32*, i32** %12
store i32 0, i32* %35
br label %36
36: ; preds = %41, %33
%37 = load i8*, i8** %16
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 32
br i1 %40, label %41, label %44
41: ; preds = %36
%42 = load i8*, i8** %16
%43 = getelementptr inbounds i8, i8* %42, i32 1
store i8* %43, i8** %16
br label %36
44: ; preds = %36
br label %45
45: ; preds = %255, %44
%46 = load i8*, i8** %16
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp ne i32 %48, 0
br i1 %49, label %50, label %256
50: ; preds = %45
%51 = load i8*, i8** %16
%52 = load i8, i8* %51
%53 = sext i8 %52 to i32
%54 = icmp eq i32 %53, 45
br i1 %54, label %55, label %56
55: ; preds = %50
store i64 1, i64* %17
br label %73
56: ; preds = %50
%57 = load i8*, i8** %16
%58 = load i8, i8* %57
%59 = sext i8 %58 to i32
%60 = call i64 @isdigit(i32 %59)
%61 = icmp ne i64 %60, 0
br i1 %61, label %62, label %65
62: ; preds = %56
%63 = load i8*, i8** %16
%64 = call i64 @strtol(i8* %63, i8** %16, i32 10)
store i64 %64, i64* %17
br label %72
65: ; preds = %56
%66 = load i32*, i32** %15
store i32 126, i32* %66
%67 = call i32 @ffpmsg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%68 = load i8*, i8** %9
%69 = call i32 @ffpmsg(i8* %68)
%70 = load i32*, i32** %15
%71 = load i32, i32* %70
store i32 %71, i32* %8
br label %270
72: ; preds = %62
br label %73
73: ; preds = %72, %55
br label %74
74: ; preds = %79, %73
%75 = load i8*, i8** %16
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
%78 = icmp eq i32 %77, 32
br i1 %78, label %79, label %82
79: ; preds = %74
%80 = load i8*, i8** %16
%81 = getelementptr inbounds i8, i8* %80, i32 1
store i8* %81, i8** %16
br label %74
82: ; preds = %74
%83 = load i8*, i8** %16
%84 = load i8, i8* %83
%85 = sext i8 %84 to i32
%86 = icmp eq i32 %85, 45
br i1 %86, label %87, label %128
87: ; preds = %82
%88 = load i8*, i8** %16
%89 = getelementptr inbounds i8, i8* %88, i32 1
store i8* %89, i8** %16
br label %90
90: ; preds = %95, %87
%91 = load i8*, i8** %16
%92 = load i8, i8* %91
%93 = sext i8 %92 to i32
%94 = icmp eq i32 %93, 32
br i1 %94, label %95, label %98
95: ; preds = %90
%96 = load i8*, i8** %16
%97 = getelementptr inbounds i8, i8* %96, i32 1
store i8* %97, i8** %16
br label %90
98: ; preds = %90
%99 = load i8*, i8** %16
%100 = load i8, i8* %99
%101 = sext i8 %100 to i32
%102 = call i64 @isdigit(i32 %101)
%103 = icmp ne i64 %102, 0
br i1 %103, label %104, label %107
104: ; preds = %98
%105 = load i8*, i8** %16
%106 = call i64 @strtol(i8* %105, i8** %16, i32 10)
store i64 %106, i64* %18
br label %127
107: ; preds = %98
%108 = load i8*, i8** %16
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 44
br i1 %111, label %117, label %112
112: ; preds = %107
%113 = load i8*, i8** %16
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 0
br i1 %116, label %117, label %119
117: ; preds = %112, %107
%118 = load i64, i64* %10
store i64 %118, i64* %18
br label %126
119: ; preds = %112
%120 = load i32*, i32** %15
store i32 126, i32* %120
%121 = call i32 @ffpmsg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%122 = load i8*, i8** %9
%123 = call i32 @ffpmsg(i8* %122)
%124 = load i32*, i32** %15
%125 = load i32, i32* %124
store i32 %125, i32* %8
br label %270
126: ; preds = %117
br label %127
127: ; preds = %126, %104
br label %148
128: ; preds = %82
%129 = load i8*, i8** %16
%130 = load i8, i8* %129
%131 = sext i8 %130 to i32
%132 = icmp eq i32 %131, 44
br i1 %132, label %138, label %133
133: ; preds = %128
%134 = load i8*, i8** %16
%135 = load i8, i8* %134
%136 = sext i8 %135 to i32
%137 = icmp eq i32 %136, 0
br i1 %137, label %138, label %140
138: ; preds = %133, %128
%139 = load i64, i64* %17
store i64 %139, i64* %18
br label %147
140: ; preds = %133
%141 = load i32*, i32** %15
store i32 126, i32* %141
%142 = call i32 @ffpmsg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%143 = load i8*, i8** %9
%144 = call i32 @ffpmsg(i8* %143)
%145 = load i32*, i32** %15
%146 = load i32, i32* %145
store i32 %146, i32* %8
br label %270
147: ; preds = %138
br label %148
148: ; preds = %147, %127
%149 = load i32*, i32** %12
%150 = load i32, i32* %149
%151 = add nsw i32 %150, 1
%152 = load i32, i32* %11
%153 = icmp sgt i32 %151, %152
br i1 %153, label %154, label %159
154: ; preds = %148
%155 = load i32*, i32** %15
store i32 126, i32* %155
%156 = call i32 @ffpmsg(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
%157 = load i32*, i32** %15
%158 = load i32, i32* %157
store i32 %158, i32* %8
br label %270
159: ; preds = %148
%160 = load i64, i64* %17
%161 = icmp slt i64 %160, 1
br i1 %161, label %162, label %169
162: ; preds = %159
%163 = load i32*, i32** %15
store i32 126, i32* %163
%164 = call i32 @ffpmsg(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%165 = load i8*, i8** %9
%166 = call i32 @ffpmsg(i8* %165)
%167 = load i32*, i32** %15
%168 = load i32, i32* %167
store i32 %168, i32* %8
br label %270
169: ; preds = %159
%170 = load i64, i64* %18
%171 = load i64, i64* %17
%172 = icmp slt i64 %170, %171
br i1 %172, label %173, label %180
173: ; preds = %169
%174 = load i32*, i32** %15
store i32 126, i32* %174
%175 = call i32 @ffpmsg(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%176 = load i8*, i8** %9
%177 = call i32 @ffpmsg(i8* %176)
%178 = load i32*, i32** %15
%179 = load i32, i32* %178
store i32 %179, i32* %8
br label %270
180: ; preds = %169
%181 = load i32*, i32** %12
%182 = load i32, i32* %181
%183 = icmp sgt i32 %182, 0
br i1 %183, label %184, label %203
184: ; preds = %180
%185 = load i64, i64* %17
%186 = load i64*, i64** %14
%187 = load i32*, i32** %12
%188 = load i32, i32* %187
%189 = sub nsw i32 %188, 1
%190 = sext i32 %189 to i64
%191 = getelementptr inbounds i64, i64* %186, i64 %190
%192 = load i64, i64* %191
%193 = icmp sle i64 %185, %192
br i1 %193, label %194, label %202
194: ; preds = %184
%195 = load i32*, i32** %15
store i32 126, i32* %195
%196 = call i32 @ffpmsg(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0))
%197 = call i32 @ffpmsg(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%198 = load i8*, i8** %9
%199 = call i32 @ffpmsg(i8* %198)
%200 = load i32*, i32** %15
%201 = load i32, i32* %200
store i32 %201, i32* %8
br label %270
202: ; preds = %184
br label %203
203: ; preds = %202, %180
%204 = load i64, i64* %17
%205 = load i64, i64* %10
%206 = icmp sle i64 %204, %205
br i1 %206, label %207, label %229
207: ; preds = %203
%208 = load i64, i64* %18
%209 = load i64, i64* %10
%210 = icmp sgt i64 %208, %209
br i1 %210, label %211, label %213
211: ; preds = %207
%212 = load i64, i64* %10
store i64 %212, i64* %18
br label %213
213: ; preds = %211, %207
%214 = load i64, i64* %17
%215 = load i64*, i64** %13
%216 = load i32*, i32** %12
%217 = load i32, i32* %216
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds i64, i64* %215, i64 %218
store i64 %214, i64* %219
%220 = load i64, i64* %18
%221 = load i64*, i64** %14
%222 = load i32*, i32** %12
%223 = load i32, i32* %222
%224 = sext i32 %223 to i64
%225 = getelementptr inbounds i64, i64* %221, i64 %224
store i64 %220, i64* %225
%226 = load i32*, i32** %12
%227 = load i32, i32* %226
%228 = add nsw i32 %227, 1
store i32 %228, i32* %226
br label %229
229: ; preds = %213, %203
br label %230
230: ; preds = %235, %229
%231 = load i8*, i8** %16
%232 = load i8, i8* %231
%233 = sext i8 %232 to i32
%234 = icmp eq i32 %233, 32
br i1 %234, label %235, label %238
235: ; preds = %230
%236 = load i8*, i8** %16
%237 = getelementptr inbounds i8, i8* %236, i32 1
store i8* %237, i8** %16
br label %230
238: ; preds = %230
%239 = load i8*, i8** %16
%240 = load i8, i8* %239
%241 = sext i8 %240 to i32
%242 = icmp eq i32 %241, 44
br i1 %242, label %243, label %255
243: ; preds = %238
%244 = load i8*, i8** %16
%245 = getelementptr inbounds i8, i8* %244, i32 1
store i8* %245, i8** %16
br label %246
246: ; preds = %251, %243
%247 = load i8*, i8** %16
%248 = load i8, i8* %247
%249 = sext i8 %248 to i32
%250 = icmp eq i32 %249, 32
br i1 %250, label %251, label %254
251: ; preds = %246
%252 = load i8*, i8** %16
%253 = getelementptr inbounds i8, i8* %252, i32 1
store i8* %253, i8** %16
br label %246
254: ; preds = %246
br label %255
255: ; preds = %254, %238
br label %45
256: ; preds = %45
%257 = load i32*, i32** %12
%258 = load i32, i32* %257
%259 = icmp eq i32 %258, 0
br i1 %259, label %260, label %267
260: ; preds = %256
%261 = load i64*, i64** %13
%262 = getelementptr inbounds i64, i64* %261, i64 0
store i64 1, i64* %262
%263 = load i64, i64* %10
%264 = load i64*, i64** %14
%265 = getelementptr inbounds i64, i64* %264, i64 0
store i64 %263, i64* %265
%266 = load i32*, i32** %12
store i32 1, i32* %266
br label %267
267: ; preds = %260, %256
%268 = load i32*, i32** %15
%269 = load i32, i32* %268
store i32 %269, i32* %8
br label %270
270: ; preds = %267, %194, %173, %162, %154, %140, %119, %65, %28, %22
%271 = load i32, i32* %8
ret i32 %271
}

LLVM IR (-O2):
@.str = [54 x i8] c"Input maximum range value is <= 0 (fits_parse_ranges)\00"
@.str.1 = [37 x i8] c"Syntax error in this row range list:\00"
@.str.2 = [56 x i8] c"Overflowed maximum number of ranges (fits_parse_ranges)\00"
@.str.3 = [52 x i8] c"Syntax error in this row range list: row number < 1\00"
@.str.4 = [47 x i8] c"Syntax error in this row range list: min > max\00"
@.str.5 = [55 x i8] c"Syntax error in this row range list. Range minimum is\00"
@.str.6 = [47 x i8] c" less than or equal to previous range maximum\00"
define i32 @ffrwrg(i8* %0, i64 %1, i32 %2, i32* nocapture %3, i64* nocapture writeonly %4, i64* nocapture %5, i32* nocapture %6) {
%8 = alloca i8*
%9 = bitcast i8** %8 to i8*
%10 = load i32, i32* %6
%11 = icmp sgt i32 %10, 0
br i1 %11, label %123, label %12
12: ; preds = %7
%13 = icmp slt i64 %1, 1
br i1 %13, label %14, label %16
14: ; preds = %12
store i32 126, i32* %6
%15 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0))
br label %121
16: ; preds = %12
store i32 0, i32* %3
br label %17
17: ; preds = %17, %16
%18 = phi i8* [ %21, %17 ], [ %0, %16 ]
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 32
%21 = getelementptr inbounds i8, i8* %18, i64 1
br i1 %20, label %17, label %24
22: ; preds = %107, %113
%23 = phi i8* [ %115, %113 ], [ %108, %107 ]
br label %24
24: ; preds = %17, %22
%25 = phi i32 [ %105, %22 ], [ 0, %17 ]
%26 = phi i8* [ %23, %22 ], [ %18, %17 ]
store i8* %26, i8** %8
%27 = load i8, i8* %26
switch i8 %27, label %28 [
i8 0, label %118
i8 45, label %38
]
28: ; preds = %24
%29 = sext i8 %27 to i32
%30 = tail call i64 @isdigit(i32 %29)
%31 = icmp eq i64 %30, 0
br i1 %31, label %35, label %32
32: ; preds = %28
%33 = call i64 @strtol(i8* %26, i8** %8, i32 10)
%34 = load i8*, i8** %8
br label %38
35: ; preds = %28
store i32 126, i32* %6
%36 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%37 = tail call i32 @ffpmsg(i8* %0)
br label %121
38: ; preds = %24, %32
%39 = phi i8* [ %34, %32 ], [ %26, %24 ]
%40 = phi i64 [ %33, %32 ], [ 1, %24 ]
br label %41
41: ; preds = %45, %38
%42 = phi i8* [ %46, %45 ], [ %39, %38 ]
%43 = load i8, i8* %42
switch i8 %43, label %63 [
i8 32, label %45
i8 45, label %44
i8 44, label %66
i8 0, label %66
]
44: ; preds = %41
store i8* %42, i8** %8
br label %47
45: ; preds = %41
%46 = getelementptr inbounds i8, i8* %42, i64 1
br label %41
47: ; preds = %44, %47
%48 = phi i8* [ %49, %47 ], [ %42, %44 ]
%49 = getelementptr inbounds i8, i8* %48, i64 1
%50 = load i8, i8* %49
%51 = icmp eq i8 %50, 32
br i1 %51, label %47, label %52
52: ; preds = %47
store i8* %49, i8** %8
%53 = sext i8 %50 to i32
%54 = tail call i64 @isdigit(i32 %53)
%55 = icmp eq i64 %54, 0
br i1 %55, label %58, label %56
56: ; preds = %52
%57 = call i64 @strtol(i8* %49, i8** %8, i32 10)
br label %67
58: ; preds = %52
%59 = load i8, i8* %49
switch i8 %59, label %60 [
i8 44, label %67
i8 0, label %67
]
60: ; preds = %58
store i32 126, i32* %6
%61 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%62 = tail call i32 @ffpmsg(i8* %0)
br label %121
63: ; preds = %41
store i32 126, i32* %6
%64 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%65 = tail call i32 @ffpmsg(i8* %0)
br label %121
66: ; preds = %41, %41
store i8* %42, i8** %8
br label %67
67: ; preds = %66, %58, %58, %56
%68 = phi i64 [ %57, %56 ], [ %1, %58 ], [ %1, %58 ], [ %40, %66 ]
%69 = load i32, i32* %3
%70 = icmp slt i32 %69, %2
br i1 %70, label %73, label %71
71: ; preds = %67
store i32 126, i32* %6
%72 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.2, i64 0, i64 0))
br label %121
73: ; preds = %67
%74 = icmp slt i64 %40, 1
br i1 %74, label %75, label %78
75: ; preds = %73
store i32 126, i32* %6
%76 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.3, i64 0, i64 0))
%77 = tail call i32 @ffpmsg(i8* %0)
br label %121
78: ; preds = %73
%79 = icmp slt i64 %68, %40
br i1 %79, label %80, label %83
80: ; preds = %78
store i32 126, i32* %6
%81 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.4, i64 0, i64 0))
%82 = tail call i32 @ffpmsg(i8* %0)
br label %121
83: ; preds = %78
%84 = icmp sgt i32 %69, 0
br i1 %84, label %85, label %95
85: ; preds = %83
%86 = add nsw i32 %69, -1
%87 = zext i32 %86 to i64
%88 = getelementptr inbounds i64, i64* %5, i64 %87
%89 = load i64, i64* %88
%90 = icmp sgt i64 %40, %89
br i1 %90, label %95, label %91
91: ; preds = %85
store i32 126, i32* %6
%92 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.5, i64 0, i64 0))
%93 = tail call i32 @ffpmsg(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.6, i64 0, i64 0))
%94 = tail call i32 @ffpmsg(i8* %0)
br label %121
95: ; preds = %85, %83
%96 = icmp sgt i64 %40, %1
br i1 %96, label %104, label %97
97: ; preds = %95
%98 = icmp sgt i64 %68, %1
%99 = select i1 %98, i64 %1, i64 %68
%100 = sext i32 %69 to i64
%101 = getelementptr inbounds i64, i64* %4, i64 %100
store i64 %40, i64* %101
%102 = getelementptr inbounds i64, i64* %5, i64 %100
store i64 %99, i64* %102
%103 = add nsw i32 %69, 1
store i32 %103, i32* %3
br label %104
104: ; preds = %97, %95
%105 = phi i32 [ %103, %97 ], [ %69, %95 ]
%106 = load i8*, i8** %8
br label %107
107: ; preds = %111, %104
%108 = phi i8* [ %112, %111 ], [ %106, %104 ]
%109 = load i8, i8* %108
switch i8 %109, label %22 [
i8 32, label %111
i8 44, label %110
]
110: ; preds = %107
store i8* %108, i8** %8
br label %113
111: ; preds = %107
%112 = getelementptr inbounds i8, i8* %108, i64 1
br label %107
113: ; preds = %110, %113
%114 = phi i8* [ %115, %113 ], [ %108, %110 ]
%115 = getelementptr inbounds i8, i8* %114, i64 1
%116 = load i8, i8* %115
%117 = icmp eq i8 %116, 32
br i1 %117, label %113, label %22
118: ; preds = %24
%119 = icmp eq i32 %25, 0
br i1 %119, label %120, label %121
120: ; preds = %118
store i64 1, i64* %4
store i64 %1, i64* %5
store i32 1, i32* %3
br label %121
121: ; preds = %118, %120, %14, %35, %60, %63, %71, %75, %80, %91
%122 = load i32, i32* %6
br label %123
123: ; preds = %121, %7
%124 = phi i32 [ %10, %7 ], [ %122, %121 ]
ret i32 %124
}