#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 */
typedef int /*<<< orphan*/ output;

/* Variables and functions */
int error_handle(unsigned int const, char **);
int /*<<< orphan*/ free(int *);
unsigned int get_limit(int, char **);
int /*<<< orphan*/ help(char *);
int *malloc(int const);
int /*<<< orphan*/ memset(int *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int *realloc(int *, int);
scalar_t__ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  int arg, arg_showseq = 0;
  for (arg = 1; arg < argc; arg++) {
    if (strcmp(argv[arg], "-h") == 0) {
      help(argv[0]);
      return 0;
    } else if (strcmp(argv[arg], "-s") == 0) {
      arg_showseq = 1;
    }
  }
  unsigned int const limit = get_limit(argc, argv);
  int error_check = error_handle(limit, argv);
  if (!error_check) {
    return limit;
  }
  int output[2 * (limit - 1)], div;
  memset(output, 0, sizeof(output));
  for (div = limit; div > 1; div--) {
    int const workarrsize = 2 * div + 9;
    int workindex = 2, *workarr = malloc(workarrsize * sizeof(int));
    workarr[0] = workarr[1] = 1;
    while (!(workarr[workindex - 2] == 1 && workarr[workindex - 1] == 0)) {
      workarr[workindex] =
          (workarr[workindex - 2] + workarr[workindex - 1]) % div;
      if (workarr[workindex] == 0) {
        output[2 * (div - 2)]++;
        if (output[2 * (div - 2) + 1] == 0) {
          output[2 * (div - 2) + 1] = workindex + 1;
        }
      }
      workindex++;
      if (workindex % (workarrsize - 1) == 0) {
        int *newarr = realloc(workarr, (workindex + workarrsize) * sizeof(int));
        if (newarr == NULL) {
          free(workarr);
          printf("Something went tits up. Quitting without dignity.\n");
          return -4;
        } else {
          workarr = newarr;
        }
      }
    }
    if (arg_showseq) {
      printf("%d\t: 1,1,", div);
      int j;
      for (j = 2; j < workindex; j++) {
        if (j != workindex - 1) {
          printf("%d,", workarr[j]);
          if (workarr[j] == 0) {
            printf("\n\t  ");
          }
        } else {
          printf("%d", workarr[j]);
        }
      }
      printf("\n");
    }
  }
  if (arg_showseq) {
    printf("\n");
  }
  int i;
  for (i = 0; i < limit - 1; i++) {
    printf("%d\t: { cc: %d, cl: %d }\n", i + 2, output[2 * i],
           output[2 * i + 1]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    123b <main+0xab>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xe2d(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    11fa <main+0x6a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   10a0 <help@plt>
movl   $0x0,-0x4(%rbp)
jmp    159c <main+0x40c>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
lea    0xdf6(%rip),%rsi
call   1070 <strcmp@plt>
cmp    $0x0,%rax
jne    1223 <main+0x93>
movl   $0x1,-0x18(%rbp)
jmp    1228 <main+0x98>
jmp    122d <main+0x9d>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b4 <main+0x24>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1060 <get_limit@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   10b0 <error_handle@plt>
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x20(%rbp)
jne    126e <main+0xde>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    159c <main+0x40c>
mov    -0x1c(%rbp),%ecx
mov    %ecx,%eax
lea    -0x2(%rax,%rax,1),%eax
mov    %rsp,%rcx
mov    %rcx,-0x28(%rbp)
lea    0xf(,%rax,4),%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rdi
sub    %rcx,%rdi
mov    %rdi,-0x68(%rbp)
mov    %rdi,%rsp
mov    %rax,-0x30(%rbp)
shl    $0x2,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1050 <memset@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
cmpl   $0x1,-0x34(%rbp)
jle    1516 <main+0x386>
mov    -0x34(%rbp),%eax
shl    $0x1,%eax
add    $0x9,%eax
mov    %eax,-0x38(%rbp)
movl   $0x2,-0x3c(%rbp)
movslq -0x38(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
movl   $0x1,0x4(%rax)
mov    -0x48(%rbp),%rax
movl   $0x1,(%rax)
mov    -0x48(%rbp),%rcx
mov    -0x3c(%rbp),%eax
sub    $0x2,%eax
movslq %eax,%rdx
xor    %eax,%eax
cmpl   $0x1,(%rcx,%rdx,4)
mov    %al,-0x69(%rbp)
jne    1326 <main+0x196>
mov    -0x48(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
sete   %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
xor    $0xff,%al
test   $0x1,%al
jne    1338 <main+0x1a8>
jmp    144c <main+0x2bc>
mov    -0x48(%rbp),%rax
mov    -0x3c(%rbp),%ecx
sub    $0x2,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x48(%rbp),%rcx
mov    -0x3c(%rbp),%edx
sub    $0x1,%edx
movslq %edx,%rdx
add    (%rcx,%rdx,4),%eax
cltd
idivl  -0x34(%rbp)
mov    -0x48(%rbp),%rax
movslq -0x3c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x48(%rbp),%rax
movslq -0x3c(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    13cc <main+0x23c>
mov    -0x68(%rbp),%rax
mov    -0x34(%rbp),%ecx
sub    $0x2,%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
add    $0x1,%edx
mov    %edx,(%rax,%rcx,4)
mov    -0x34(%rbp),%ecx
sub    $0x2,%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    13c7 <main+0x237>
mov    -0x68(%rbp),%rax
mov    -0x3c(%rbp),%edx
add    $0x1,%edx
mov    -0x34(%rbp),%ecx
sub    $0x2,%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
jmp    13cc <main+0x23c>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x3c(%rbp),%eax
mov    -0x38(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1447 <main+0x2b7>
mov    -0x48(%rbp),%rdi
mov    -0x3c(%rbp),%eax
add    -0x38(%rbp),%eax
cltq
shl    $0x2,%rax
mov    %eax,%esi
call   1090 <realloc@plt>
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x50(%rbp)
jne    143a <main+0x2aa>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
lea    0xbe6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xfffffffc,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
jmp    1595 <main+0x405>
mov    -0x50(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    1447 <main+0x2b7>
jmp    12f3 <main+0x163>
cmpl   $0x0,-0x18(%rbp)
je     1503 <main+0x373>
mov    -0x34(%rbp),%esi
lea    0xbd9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x2,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    14f5 <main+0x365>
mov    -0x58(%rbp),%eax
mov    -0x3c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
je     14c9 <main+0x339>
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xba6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    14c4 <main+0x334>
lea    0xb8a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14e2 <main+0x352>
mov    -0x48(%rbp),%rax
movslq -0x58(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xb71(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    14e7 <main+0x357>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    146e <main+0x2de>
lea    0xb3b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1508 <main+0x378>
mov    -0x34(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x34(%rbp)
jmp    12ae <main+0x11e>
cmpl   $0x0,-0x18(%rbp)
je     152e <main+0x39e>
lea    0xb10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
mov    -0x1c(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    1587 <main+0x3f7>
mov    -0x68(%rbp),%rax
mov    -0x5c(%rbp),%esi
add    $0x2,%esi
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x5c(%rbp),%ecx
shl    $0x1,%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%ecx
lea    0xadd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1535 <main+0x3a5>
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x54(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,%rbx
movl   $0x0,-0x2c(%rbp)
mov    %edi,-0x38(%rbp)
cmp    $0x2,%edi
jl     123b <main+0x8b>
mov    -0x38(%rbp),%r13d
movl   $0x0,-0x2c(%rbp)
mov    $0x1,%r14d
lea    0xe15(%rip),%r15
mov    $0x1,%r12d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%r14,8),%rdi
mov    %r15,%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1479 <main+0x2c9>
mov    (%rbx,%r14,8),%rdi
lea    0xde3(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
mov    -0x2c(%rbp),%eax
cmove  %r12d,%eax
mov    %eax,-0x2c(%rbp)
add    $0x1,%r14
cmp    %r14,%r13
jne    1200 <main+0x50>
mov    -0x38(%rbp),%edi
mov    %rbx,%rsi
call   1080 <get_limit@plt>
mov    %eax,%r14d
mov    %eax,%edi
mov    %rbx,%rsi
call   10d0 <error_handle@plt>
test   %eax,%eax
je     14f2 <main+0x342>
mov    %rsp,-0x60(%rbp)
lea    (%r14,%r14,1),%eax
add    $0xfffffffe,%eax
lea    0xf(,%rax,4),%rax
and    $0xfffffffffffffff0,%rax
mov    %rsp,%r12
sub    %rax,%r12
mov    %r12,%rsp
lea    -0x8(,%r14,8),%edx
ff
mov    %r12,%rdi
xor    %esi,%esi
call   1070 <memset@plt>
mov    %r14,-0x48(%rbp)
cmp    $0x2,%r14d
jl     1486 <main+0x2d6>
mov    -0x48(%rbp),%rax
mov    %eax,%ecx
lea    0x30(,%rax,8),%ebx
mov    %r12,-0x38(%rbp)
jmp    12d6 <main+0x126>
xchg   %ax,%ax
mov    $0xa,%edi
call   1040 <putchar@plt>
mov    -0x50(%rbp),%rsi
lea    -0x1(%rsi),%rcx
mov    -0x3c(%rbp),%ebx
add    $0xfffffff8,%ebx
cmp    $0x2,%rsi
mov    -0x38(%rbp),%r12
jle    1486 <main+0x2d6>
lea    0x24(,%rcx,8),%edi
mov    %rcx,%r14
call   10a0 <malloc@plt>
mov    %rax,%r15
movabs $0x100000001,%rax
mov    %rax,(%r15)
xor    %eax,%eax
test   %al,%al
mov    %r14,-0x50(%rbp)
mov    %ebx,-0x3c(%rbp)
jne    13f0 <main+0x240>
lea    (%r14,%r14,1),%eax
add    $0xfffffffc,%eax
cltq
mov    %rax,-0x68(%rbp)
lea    -0x3(%r14,%r14,1),%eax
cltq
mov    %rax,-0x58(%rbp)
lea    0x8(%r14,%r14,1),%edi
mov    $0x1,%eax
mov    $0x1,%ecx
mov    %r14,%rsi
mov    $0x2,%r14d
mov    %ebx,%r12d
mov    %r15,%r13
nopl   0x0(%rax)
add    %ecx,%eax
cltd
idiv   %esi
mov    %edx,0x0(%r13,%r14,4)
test   %edx,%edx
jne    1380 <main+0x1d0>
mov    -0x38(%rbp),%rax
mov    -0x68(%rbp),%rcx
addl   $0x1,(%rax,%rcx,4)
mov    -0x58(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
jne    1380 <main+0x1d0>
lea    0x1(%r14),%eax
mov    -0x38(%rbp),%rcx
mov    -0x58(%rbp),%rdx
mov    %eax,(%rcx,%rdx,4)
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0x1(%r14),%rbx
mov    %ebx,%eax
cltd
idiv   %edi
test   %edx,%edx
je     13a0 <main+0x1f0>
mov    %r13,%r15
jmp    13c1 <main+0x211>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %edi,%r15d
mov    %r13,%rdi
mov    %r12d,%esi
call   10b0 <realloc@plt>
mov    %r15d,%edi
mov    -0x50(%rbp),%rsi
mov    %rax,%r15
test   %rax,%rax
je     14d4 <main+0x324>
mov    -0x8(%r15,%rbx,4),%ecx
add    $0x4,%r12d
mov    (%r15,%r14,4),%eax
mov    %r15,%r13
mov    %rbx,%r14
cmp    $0x1,%ecx
jne    1340 <main+0x190>
mov    %r15,%r13
mov    %rbx,%r14
test   %eax,%eax
jne    1340 <main+0x190>
jmp    13f8 <main+0x248>
nopl   (%rax)
mov    $0x2,%ebx
mov    %r14,%rsi
cmpl   $0x0,-0x2c(%rbp)
lea    0xc16(%rip),%r13
je     12be <main+0x10e>
lea    0xbf6(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmp    $0x3,%ebx
jb     12b0 <main+0x100>
lea    -0x1(%rbx),%r14d
mov    %ebx,%r12d
mov    $0x2,%ebx
jmp    144b <main+0x29b>
xchg   %ax,%ax
mov    (%r15,%r14,4),%esi
mov    %r13,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
je     12b0 <main+0x100>
cmp    %rbx,%r14
je     1430 <main+0x280>
mov    (%r15,%rbx,4),%esi
lea    0xbb5(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
cmpl   $0x0,(%r15,%rbx,4)
jne    143e <main+0x28e>
lea    0xba4(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    143e <main+0x28e>
mov    (%rbx),%rdi
call   10c0 <help@plt>
xor    %r14d,%r14d
jmp    14f2 <main+0x342>
mov    -0x48(%rbp),%rbx
add    $0xffffffff,%ebx
cmpl   $0x0,-0x2c(%rbp)
je     149d <main+0x2ed>
mov    $0xa,%edi
call   1040 <putchar@plt>
test   %ebx,%ebx
je     14cf <main+0x31f>
mov    %ebx,%r15d
lea    0xb71(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r12,%rbx,8),%edx
mov    0x4(%r12,%rbx,8),%ecx
lea    0x2(%rbx),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    14b0 <main+0x300>
xor    %r14d,%r14d
jmp    14ee <main+0x33e>
mov    %r13,%rdi
call   1030 <free@plt>
lea    0xb52(%rip),%rdi
call   1050 <puts@plt>
mov    $0xfffffffc,%r14d
mov    -0x60(%rbp),%rsp
mov    %r14d,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"-h\00"
@.str.1 = [3 x i8] c"-s\00"
@.str.3 = [10 x i8] c"%d\09: 1,1,\00"
@.str.4 = [4 x i8] c"%d,\00"
@.str.5 = [5 x i8] c"\0A\09 \00"
@.str.6 = [3 x i8] c"%d\00"
@.str.8 = [25 x i8] c"%d\09: { cc: %d, cl: %d }\0A\00"
@str = [50 x i8] c"Something went tits up. Quitting without dignity.\00"
define i32 @main(i32 %0, i8** %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %23
4: ; preds = %2
%5 = zext i32 %0 to i64
br label %6
6: ; preds = %4, %16
%7 = phi i64 [ 1, %4 ], [ %21, %16 ]
%8 = phi i32 [ 0, %4 ], [ %20, %16 ]
%9 = getelementptr inbounds i8*, i8** %1, i64 %7
%10 = load i8*, i8** %9
%11 = tail call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %6
%14 = load i8*, i8** %1
%15 = tail call i32 @help(i8* %14)
br label %156
16: ; preds = %6
%17 = load i8*, i8** %9
%18 = tail call i64 @strcmp(i8* %17, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i64 %18, 0
%20 = select i1 %19, i32 1, i32 %8
%21 = add nuw nsw i64 %7, 1
%22 = icmp eq i64 %21, %5
br i1 %22, label %23, label %6
23: ; preds = %16, %2
%24 = phi i32 [ 0, %2 ], [ %20, %16 ]
%25 = tail call i32 @get_limit(i32 %0, i8** %1)
%26 = tail call i32 @error_handle(i32 %25, i8** %1)
%27 = icmp eq i32 %26, 0
br i1 %27, label %156, label %28
28: ; preds = %23
%29 = add i32 %25, -1
%30 = shl i32 %29, 1
%31 = zext i32 %30 to i64
%32 = tail call i8* @llvm.stacksave()
%33 = alloca i32, i64 %31
%34 = shl i32 %29, 3
%35 = call i32 @memset(i32* %33, i32 0, i32 %34)
%36 = icmp sgt i32 %25, 1
br i1 %36, label %37, label %133
37: ; preds = %28
%38 = icmp eq i32 %24, 0
%39 = zext i32 %25 to i64
br label %40
40: ; preds = %37, %130
%41 = phi i64 [ %39, %37 ], [ %131, %130 ]
%42 = trunc i64 %41 to i32
%43 = shl nuw nsw i32 %42, 1
%44 = add nsw i32 %43, 9
%45 = shl i32 %44, 2
%46 = call i32* @malloc(i32 %45)
%47 = getelementptr inbounds i32, i32* %46, i64 1
store i32 1, i32* %47
store i32 1, i32* %46
%48 = add i32 %43, -4
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds i32, i32* %33, i64 %49
%51 = add i32 %43, -3
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i32, i32* %33, i64 %52
%54 = add nsw i32 %43, 8
%55 = getelementptr inbounds i32, i32* %46, i64 1
%56 = load i32, i32* %55
%57 = icmp eq i32 %56, 0
br i1 %57, label %99, label %58
58: ; preds = %40, %90
%59 = phi i32 [ %96, %90 ], [ %56, %40 ]
%60 = phi i64 [ %62, %90 ], [ 1, %40 ]
%61 = phi i32* [ %91, %90 ], [ %46, %40 ]
%62 = phi i64 [ %77, %90 ], [ 2, %40 ]
%63 = phi i32 [ %93, %90 ], [ 1, %40 ]
%64 = add nsw i32 %59, %63
%65 = srem i32 %64, %42
%66 = getelementptr inbounds i32, i32* %61, i64 %62
store i32 %65, i32* %66
%67 = icmp eq i32 %65, 0
br i1 %67, label %68, label %76
68: ; preds = %58
%69 = load i32, i32* %50
%70 = add nsw i32 %69, 1
store i32 %70, i32* %50
%71 = load i32, i32* %53
%72 = icmp eq i32 %71, 0
br i1 %72, label %73, label %76
73: ; preds = %68
%74 = trunc i64 %62 to i32
%75 = add i32 %74, 1
store i32 %75, i32* %53
br label %76
76: ; preds = %68, %73, %58
%77 = add nuw i64 %62, 1
%78 = trunc i64 %77 to i32
%79 = srem i32 %78, %54
%80 = icmp eq i32 %79, 0
br i1 %80, label %81, label %90
81: ; preds = %76
%82 = trunc i64 %77 to i32
%83 = add i32 %44, %82
%84 = shl i32 %83, 2
%85 = call i32* @realloc(i32* %61, i32 %84)
%86 = icmp eq i32* %85, null
br i1 %86, label %87, label %90
87: ; preds = %81
%88 = call i32 @free(i32* %61)
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str, i64 0, i64 0))
br label %154
90: ; preds = %81, %76
%91 = phi i32* [ %61, %76 ], [ %85, %81 ]
%92 = getelementptr inbounds i32, i32* %91, i64 %60
%93 = load i32, i32* %92
%94 = icmp eq i32 %93, 1
%95 = getelementptr inbounds i32, i32* %91, i64 %62
%96 = load i32, i32* %95
%97 = icmp eq i32 %96, 0
%98 = select i1 %94, i1 %97, i1 false
br i1 %98, label %99, label %58
99: ; preds = %90, %40
%100 = phi i64 [ 2, %40 ], [ %77, %90 ]
%101 = phi i32* [ %46, %40 ], [ %91, %90 ]
br i1 %38, label %130, label %102
102: ; preds = %99
%103 = trunc i64 %100 to i32
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i32 %42)
%105 = icmp ugt i32 %103, 2
br i1 %105, label %106, label %128
106: ; preds = %102
%107 = add i64 %100, 4294967295
%108 = and i64 %107, 4294967295
%109 = and i64 %100, 4294967295
%110 = getelementptr inbounds i32, i32* %101, i64 %108
br label %111
111: ; preds = %106, %125
%112 = phi i64 [ 2, %106 ], [ %126, %125 ]
%113 = icmp eq i64 %112, %108
br i1 %113, label %122, label %114
114: ; preds = %111
%115 = getelementptr inbounds i32, i32* %101, i64 %112
%116 = load i32, i32* %115
%117 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %116)
%118 = load i32, i32* %115
%119 = icmp eq i32 %118, 0
br i1 %119, label %120, label %125
120: ; preds = %114
%121 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %125
122: ; preds = %111
%123 = load i32, i32* %110
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32 %123)
br label %125
125: ; preds = %122, %120, %114
%126 = add nuw nsw i64 %112, 1
%127 = icmp eq i64 %126, %109
br i1 %127, label %128, label %111
128: ; preds = %125, %102
%129 = call i32 @putchar(i32 10)
br label %130
130: ; preds = %128, %99
%131 = add nsw i64 %41, -1
%132 = icmp sgt i64 %41, 2
br i1 %132, label %40, label %133
133: ; preds = %130, %28
%134 = icmp eq i32 %24, 0
br i1 %134, label %137, label %135
135: ; preds = %133
%136 = call i32 @putchar(i32 10)
br label %137
137: ; preds = %135, %133
%138 = icmp eq i32 %29, 0
br i1 %138, label %154, label %139
139: ; preds = %137
%140 = zext i32 %29 to i64
br label %141
141: ; preds = %139, %141
%142 = phi i64 [ 0, %139 ], [ %152, %141 ]
%143 = shl nuw nsw i64 %142, 1
%144 = getelementptr inbounds i32, i32* %33, i64 %143
%145 = load i32, i32* %144
%146 = or i64 %143, 1
%147 = getelementptr inbounds i32, i32* %33, i64 %146
%148 = load i32, i32* %147
%149 = trunc i64 %142 to i32
%150 = add i32 %149, 2
%151 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i32 %150, i32 %145, i32 %148)
%152 = add nuw nsw i64 %142, 1
%153 = icmp eq i64 %152, %140
br i1 %153, label %154, label %141
154: ; preds = %141, %137, %87
%155 = phi i32 [ -4, %87 ], [ 0, %137 ], [ 0, %141 ]
br label %156
156: ; preds = %154, %23, %13
%157 = phi i32 [ 0, %13 ], [ %155, %154 ], [ %25, %23 ]
ret i32 %157
}