#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 int32_t;

/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
int /*<<< orphan*/ base24_printPair(int /*<<< orphan*/, int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int getCustomCount(int);
int /*<<< orphan*/ grcal_dateToOffset(int *, int, int, int);
int /*<<< orphan*/ grcal_offsetToDate(int, int *, int *, int *);
int /*<<< orphan*/ grcal_printDate(int /*<<< orphan*/, int, int, int);
int nelsc_cycle_dayToMonth(int, int /*<<< orphan*/ *);
int nelsc_cycle_monthToDay(int);
int nelsc_cycle_yearToMonth(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int sub_newyear(int argc, char *argv[]) {
  int result = EXIT_SUCCESS;
  int32_t y = 0;
  int32_t d = 0;
  int32_t abs_month = 0;
  int32_t abs_equinox = 0;
  int32_t year_drift = 0;
  int32_t min_drift = 0;
  int32_t max_drift = 0;
  int32_t gr_year = 0;
  int32_t gr_month = 0;
  int32_t gr_day = 0;
  int32_t gr_equinox = 0;
  int32_t earliest_month = -1;
  int32_t earliest_day = -1;
  int32_t latest_month = -1;
  int32_t latest_day = -1;
  if (getCustomCount(argc) != 1) {
    fprintf(stderr, "newyear expects no additional arguments!\n");
    result = EXIT_FAILURE;
  }
  if (result != EXIT_FAILURE) {
    for (y = (-96); y <= (479); y++) {
      if ((y != (-96)) && ((y - (-96)) % 4 == 0)) {
        printf("\n");
      }
      base24_printPair(stdout, y);
      abs_month = nelsc_cycle_yearToMonth(y);
      d = nelsc_cycle_monthToDay(abs_month);
      d += (264773);
      grcal_offsetToDate(d, &gr_year, &gr_month, &gr_day);
      grcal_dateToOffset(&gr_equinox, gr_year, 3, 20);
      if (y > (-96)) {
        abs_equinox = nelsc_cycle_dayToMonth(gr_equinox - (264773), NULL);
      } else {
        abs_equinox = abs_month - 1;
      }
      year_drift = abs_equinox - abs_month;
      if (y == (-96)) {
        min_drift = year_drift;
        max_drift = year_drift;
      } else {
        if (year_drift < min_drift) {
          min_drift = year_drift;
        }
        if (year_drift > max_drift) {
          max_drift = year_drift;
        }
      }
      printf("  ");
      grcal_printDate(stdout, gr_year, gr_month, gr_day);
      printf("  equinox month offset %2d\n", (int)year_drift);
      if (earliest_month == -1) {
        earliest_month = gr_month;
        earliest_day = gr_day;
      }
      if ((earliest_month > gr_month) ||
          ((earliest_month == gr_month) && (earliest_day > gr_day))) {
        earliest_month = gr_month;
        earliest_day = gr_day;
      }
      if (latest_month == -1) {
        latest_month = gr_month;
        latest_day = gr_day;
      }
      if ((latest_month < gr_month) ||
          ((latest_month == gr_month) && (latest_day < gr_day))) {
        latest_month = gr_month;
        latest_day = gr_day;
      }
    }
    printf("\n");
    printf("Range of first day of year:  %02ld-%02ld - "
           "%02ld-%02ld\n",
           (long)earliest_month, (long)earliest_day, (long)latest_month,
           (long)latest_day);
    printf("Range of equinox offsets:    [%d, %d]\n", (int)min_drift,
           (int)max_drift);
  }
  return result;
}


x86 assembly (clang, -O0):
<sub_newyear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2e12(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0xffffffff,-0x44(%rbp)
movl   $0xffffffff,-0x48(%rbp)
movl   $0xffffffff,-0x4c(%rbp)
movl   $0xffffffff,-0x50(%rbp)
mov    -0x4(%rbp),%edi
call   1050 <getCustomCount@plt>
cmp    $0x1,%eax
je     1256 <sub_newyear+0xb6>
mov    0x2da4(%rip),%rax
mov    (%rax),%edi
lea    0xdbb(%rip),%rsi
call   1080 <fprintf@plt>
mov    0x2d87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2d78(%rip),%rcx
cmp    (%rcx),%eax
je     1496 <sub_newyear+0x2f6>
movl   $0xffffffa0,-0x18(%rbp)
cmpl   $0x1df,-0x18(%rbp)
jg     1456 <sub_newyear+0x2b6>
cmpl   $0xffffffa0,-0x18(%rbp)
je     12ab <sub_newyear+0x10b>
mov    -0x18(%rbp),%eax
sub    $0xffffffa0,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    12ab <sub_newyear+0x10b>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2d1e(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
call   10b0 <base24_printPair@plt>
mov    -0x18(%rbp),%edi
call   10a0 <nelsc_cycle_yearToMonth@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
call   1070 <nelsc_cycle_monthToDay@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x40a45,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x34(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x3c(%rbp),%rcx
call   1030 <grcal_offsetToDate@plt>
mov    -0x34(%rbp),%esi
lea    -0x40(%rbp),%rdi
mov    $0x3,%edx
mov    $0x14,%ecx
call   10c0 <grcal_dateToOffset@plt>
cmpl   $0xffffffa0,-0x18(%rbp)
jle    132b <sub_newyear+0x18b>
mov    -0x40(%rbp),%edi
sub    $0x40a45,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1090 <nelsc_cycle_dayToMonth@plt>
mov    %eax,-0x24(%rbp)
jmp    1334 <sub_newyear+0x194>
mov    -0x20(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x28(%rbp)
cmpl   $0xffffffa0,-0x18(%rbp)
jne    1358 <sub_newyear+0x1b8>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    1381 <sub_newyear+0x1e1>
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    136a <sub_newyear+0x1ca>
mov    -0x28(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x30(%rbp),%eax
jle    137c <sub_newyear+0x1dc>
mov    -0x28(%rbp),%eax
mov    %eax,-0x30(%rbp)
jmp    1381 <sub_newyear+0x1e1>
lea    0xca2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    0x2c3a(%rip),%rax
mov    (%rax),%edi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    -0x3c(%rbp),%ecx
call   1040 <grcal_printDate@plt>
mov    -0x28(%rbp),%esi
lea    0xc7d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
cmpl   $0xffffffff,-0x44(%rbp)
jne    13cd <sub_newyear+0x22d>
mov    -0x38(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x44(%rbp),%eax
cmp    -0x38(%rbp),%eax
jg     13f1 <sub_newyear+0x251>
mov    -0x44(%rbp),%eax
cmp    -0x38(%rbp),%eax
jne    13fd <sub_newyear+0x25d>
mov    -0x48(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jle    13fd <sub_newyear+0x25d>
mov    -0x38(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x48(%rbp)
cmpl   $0xffffffff,-0x4c(%rbp)
jne    1413 <sub_newyear+0x273>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x4c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jl     1437 <sub_newyear+0x297>
mov    -0x4c(%rbp),%eax
cmp    -0x38(%rbp),%eax
jne    1443 <sub_newyear+0x2a3>
mov    -0x50(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1443 <sub_newyear+0x2a3>
mov    -0x38(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x50(%rbp)
jmp    1448 <sub_newyear+0x2a8>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    126f <sub_newyear+0xcf>
lea    0xbcb(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movslq -0x44(%rbp),%rsi
movslq -0x48(%rbp),%rdx
movslq -0x4c(%rbp),%rcx
movslq -0x50(%rbp),%r8
lea    0xbce(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
lea    0xbf2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sub_newyear>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    0x2e03(%rip),%rax
mov    (%rax),%ebx
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x18(%rsp)
call   1060 <getCustomCount@plt>
cmp    $0x1,%eax
jne    1396 <sub_newyear+0x1e6>
mov    0x2ddc(%rip),%rax
cmp    (%rax),%ebx
je     13f3 <sub_newyear+0x243>
mov    %ebx,0x1c(%rsp)
mov    $0xffffffa0,%ebp
mov    $0xffffffff,%r13d
mov    $0xffffffff,%r14d
mov    $0xffffffff,%r15d
movl   $0xffffffff,0x8(%rsp)
ff
xor    %ebx,%ebx
xor    %r12d,%r12d
jmp    1249 <sub_newyear+0x99>
xchg   %ax,%ax
mov    %eax,%r14d
mov    %ecx,%r13d
mov    %edx,0x8(%rsp)
add    $0x1,%ebp
cmp    $0x1e0,%ebp
je     13b6 <sub_newyear+0x206>
mov    %r12d,0x24(%rsp)
cmp    $0xffffffa0,%ebp
je     1264 <sub_newyear+0xb4>
mov    %ebp,%eax
and    $0x3,%eax
jne    1264 <sub_newyear+0xb4>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2d65(%rip),%rax
mov    (%rax),%edi
mov    %ebp,%esi
call   10c0 <base24_printPair@plt>
mov    %ebp,%edi
call   10b0 <nelsc_cycle_yearToMonth@plt>
mov    %eax,%r12d
mov    %eax,%edi
call   1080 <nelsc_cycle_monthToDay@plt>
lea    0x40a45(%rax),%edi
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1040 <grcal_offsetToDate@plt>
mov    0x14(%rsp),%esi
lea    0x18(%rsp),%rdi
mov    $0x3,%edx
mov    $0x14,%ecx
call   10d0 <grcal_dateToOffset@plt>
cmp    $0xffffffa1,%ebp
mov    %r14d,0x20(%rsp)
mov    %r13d,%r14d
jl     12e0 <sub_newyear+0x130>
mov    0x18(%rsp),%edi
mov    $0xfffbf5bb,%eax
add    %eax,%edi
xor    %esi,%esi
call   10a0 <nelsc_cycle_dayToMonth@plt>
mov    %eax,%r13d
jmp    12e5 <sub_newyear+0x135>
nopl   0x0(%rax,%rax,1)
lea    -0x1(%r12),%r13d
sub    %r12d,%r13d
mov    0x24(%rsp),%r12d
cmp    %r12d,%r13d
cmovl  %r13d,%r12d
cmp    %ebx,%r13d
cmovg  %r13d,%ebx
cmp    $0xffffffa0,%ebp
cmove  %r13d,%r12d
cmove  %r13d,%ebx
lea    0xd1d(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x2cb5(%rip),%rax
mov    (%rax),%edi
mov    0x14(%rsp),%esi
mov    0x10(%rsp),%edx
mov    0xc(%rsp),%ecx
call   1050 <grcal_printDate@plt>
lea    0xcf8(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x8(%rsp),%edx
cmp    $0xffffffff,%edx
mov    0x10(%rsp),%eax
cmove  %eax,%edx
mov    0xc(%rsp),%ecx
cmove  %ecx,%r15d
cmp    %eax,%edx
mov    %r14d,%r13d
mov    0x20(%rsp),%r14d
jg     1368 <sub_newyear+0x1b8>
jne    136d <sub_newyear+0x1bd>
cmp    %ecx,%r15d
jle    136d <sub_newyear+0x1bd>
mov    %eax,%edx
mov    %ecx,%r15d
cmp    $0xffffffff,%r14d
cmove  %eax,%r14d
cmove  %ecx,%r13d
cmp    %eax,%r14d
jl     1230 <sub_newyear+0x80>
jne    1236 <sub_newyear+0x86>
cmp    %ecx,%r13d
jl     1230 <sub_newyear+0x80>
jmp    1236 <sub_newyear+0x86>
mov    0x2c43(%rip),%rax
mov    (%rax),%edi
lea    0xc5a(%rip),%rsi
call   1090 <fprintf@plt>
mov    0x2c26(%rip),%rax
mov    (%rax),%ebx
jmp    13f3 <sub_newyear+0x243>
mov    $0xa,%edi
call   1030 <putchar@plt>
movslq 0x8(%rsp),%rsi
movslq %r15d,%rdx
movslq %r14d,%rcx
movslq %r13d,%r8
lea    0xc74(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xc9e(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x1c(%rsp),%ebx
mov    %ebx,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [42 x i8] c"newyear expects no additional arguments!\0A\00"
@EXIT_FAILURE = global i32 0
@.str.1 = [2 x i8] c"\0A\00"
@stdout = global i32 0
@.str.2 = [3 x i8] c" \00"
@.str.3 = [28 x i8] c" equinox month offset %2d\0A\00"
@.str.4 = [56 x i8] c"Range of first day of year: %02ld-%02ld - %02ld-%02ld\0A\00"
@.str.5 = [39 x i8] c"Range of equinox offsets: [%d, %d]\0A\00"
define i32 @sub_newyear(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%21 = load i32, i32* @EXIT_SUCCESS
store i32 %21, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 -1, i32* %17
store i32 -1, i32* %18
store i32 -1, i32* %19
store i32 -1, i32* %20
%22 = load i32, i32* %3
%23 = call i32 @getCustomCount(i32 %22)
%24 = icmp ne i32 %23, 1
br i1 %24, label %25, label %29
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* @EXIT_FAILURE
store i32 %28, i32* %5
br label %29
29: ; preds = %25, %2
%30 = load i32, i32* %5
%31 = load i32, i32* @EXIT_FAILURE
%32 = icmp ne i32 %30, %31
br i1 %32, label %33, label %160
33: ; preds = %29
store i32 -96, i32* %6
br label %34
34: ; preds = %143, %33
%35 = load i32, i32* %6
%36 = icmp sle i32 %35, 479
br i1 %36, label %37, label %146
37: ; preds = %34
%38 = load i32, i32* %6
%39 = icmp ne i32 %38, -96
br i1 %39, label %40, label %47
40: ; preds = %37
%41 = load i32, i32* %6
%42 = sub nsw i32 %41, -96
%43 = srem i32 %42, 4
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %47
45: ; preds = %40
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %47
47: ; preds = %45, %40, %37
%48 = load i32, i32* @stdout
%49 = load i32, i32* %6
%50 = call i32 @base24_printPair(i32 %48, i32 %49)
%51 = load i32, i32* %6
%52 = call i32 @nelsc_cycle_yearToMonth(i32 %51)
store i32 %52, i32* %8
%53 = load i32, i32* %8
%54 = call i32 @nelsc_cycle_monthToDay(i32 %53)
store i32 %54, i32* %7
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 264773
store i32 %56, i32* %7
%57 = load i32, i32* %7
%58 = call i32 @grcal_offsetToDate(i32 %57, i32* %13, i32* %14, i32* %15)
%59 = load i32, i32* %13
%60 = call i32 @grcal_dateToOffset(i32* %16, i32 %59, i32 3, i32 20)
%61 = load i32, i32* %6
%62 = icmp sgt i32 %61, -96
br i1 %62, label %63, label %67
63: ; preds = %47
%64 = load i32, i32* %16
%65 = sub nsw i32 %64, 264773
%66 = call i32 @nelsc_cycle_dayToMonth(i32 %65, i32* null)
store i32 %66, i32* %9
br label %70
67: ; preds = %47
%68 = load i32, i32* %8
%69 = sub nsw i32 %68, 1
store i32 %69, i32* %9
br label %70
70: ; preds = %67, %63
%71 = load i32, i32* %9
%72 = load i32, i32* %8
%73 = sub nsw i32 %71, %72
store i32 %73, i32* %10
%74 = load i32, i32* %6
%75 = icmp eq i32 %74, -96
br i1 %75, label %76, label %79
76: ; preds = %70
%77 = load i32, i32* %10
store i32 %77, i32* %11
%78 = load i32, i32* %10
store i32 %78, i32* %12
br label %92
79: ; preds = %70
%80 = load i32, i32* %10
%81 = load i32, i32* %11
%82 = icmp slt i32 %80, %81
br i1 %82, label %83, label %85
83: ; preds = %79
%84 = load i32, i32* %10
store i32 %84, i32* %11
br label %85
85: ; preds = %83, %79
%86 = load i32, i32* %10
%87 = load i32, i32* %12
%88 = icmp sgt i32 %86, %87
br i1 %88, label %89, label %91
89: ; preds = %85
%90 = load i32, i32* %10
store i32 %90, i32* %12
br label %91
91: ; preds = %89, %85
br label %92
92: ; preds = %91, %76
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%94 = load i32, i32* @stdout
%95 = load i32, i32* %13
%96 = load i32, i32* %14
%97 = load i32, i32* %15
%98 = call i32 @grcal_printDate(i32 %94, i32 %95, i32 %96, i32 %97)
%99 = load i32, i32* %10
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %99)
%101 = load i32, i32* %17
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %106
103: ; preds = %92
%104 = load i32, i32* %14
store i32 %104, i32* %17
%105 = load i32, i32* %15
store i32 %105, i32* %18
br label %106
106: ; preds = %103, %92
%107 = load i32, i32* %17
%108 = load i32, i32* %14
%109 = icmp sgt i32 %107, %108
br i1 %109, label %118, label %110
110: ; preds = %106
%111 = load i32, i32* %17
%112 = load i32, i32* %14
%113 = icmp eq i32 %111, %112
br i1 %113, label %114, label %121
114: ; preds = %110
%115 = load i32, i32* %18
%116 = load i32, i32* %15
%117 = icmp sgt i32 %115, %116
br i1 %117, label %118, label %121
118: ; preds = %114, %106
%119 = load i32, i32* %14
store i32 %119, i32* %17
%120 = load i32, i32* %15
store i32 %120, i32* %18
br label %121
121: ; preds = %118, %114, %110
%122 = load i32, i32* %19
%123 = icmp eq i32 %122, -1
br i1 %123, label %124, label %127
124: ; preds = %121
%125 = load i32, i32* %14
store i32 %125, i32* %19
%126 = load i32, i32* %15
store i32 %126, i32* %20
br label %127
127: ; preds = %124, %121
%128 = load i32, i32* %19
%129 = load i32, i32* %14
%130 = icmp slt i32 %128, %129
br i1 %130, label %139, label %131
131: ; preds = %127
%132 = load i32, i32* %19
%133 = load i32, i32* %14
%134 = icmp eq i32 %132, %133
br i1 %134, label %135, label %142
135: ; preds = %131
%136 = load i32, i32* %20
%137 = load i32, i32* %15
%138 = icmp slt i32 %136, %137
br i1 %138, label %139, label %142
139: ; preds = %135, %127
%140 = load i32, i32* %14
store i32 %140, i32* %19
%141 = load i32, i32* %15
store i32 %141, i32* %20
br label %142
142: ; preds = %139, %135, %131
br label %143
143: ; preds = %142
%144 = load i32, i32* %6
%145 = add nsw i32 %144, 1
store i32 %145, i32* %6
br label %34
146: ; preds = %34
%147 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%148 = load i32, i32* %17
%149 = sext i32 %148 to i64
%150 = load i32, i32* %18
%151 = sext i32 %150 to i64
%152 = load i32, i32* %19
%153 = sext i32 %152 to i64
%154 = load i32, i32* %20
%155 = sext i32 %154 to i64
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i64 %149, i64 %151, i64 %153, i64 %155)
%157 = load i32, i32* %11
%158 = load i32, i32* %12
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %157, i32 %158)
br label %160
160: ; preds = %146, %29
%161 = load i32, i32* %5
ret i32 %161
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@stderr = global i32 0
@.str = [42 x i8] c"newyear expects no additional arguments!\0A\00"
@EXIT_FAILURE = global i32 0
@stdout = global i32 0
@.str.2 = [3 x i8] c" \00"
@.str.3 = [28 x i8] c" equinox month offset %2d\0A\00"
@.str.4 = [56 x i8] c"Range of first day of year: %02ld-%02ld - %02ld-%02ld\0A\00"
@.str.5 = [39 x i8] c"Range of equinox offsets: [%d, %d]\0A\00"
define i32 @sub_newyear(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = load i32, i32* @EXIT_SUCCESS
%8 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%9 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%10 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%11 = bitcast i32* %6 to i8*
store i32 0, i32* %6
%12 = tail call i32 @getCustomCount(i32 %0)
%13 = icmp eq i32 %12, 1
br i1 %13, label %18, label %14
14: ; preds = %2
%15 = load i32, i32* @stderr
%16 = tail call i32 @fprintf(i32 %15, i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* @EXIT_FAILURE
br label %104
18: ; preds = %2
%19 = load i32, i32* @EXIT_FAILURE
%20 = icmp eq i32 %7, %19
br i1 %20, label %104, label %21
21: ; preds = %18, %91
%22 = phi i32 [ %93, %91 ], [ -1, %18 ]
%23 = phi i32 [ %92, %91 ], [ -1, %18 ]
%24 = phi i32 [ %81, %91 ], [ -1, %18 ]
%25 = phi i32 [ %80, %91 ], [ -1, %18 ]
%26 = phi i32 [ %60, %91 ], [ 0, %18 ]
%27 = phi i32 [ %58, %91 ], [ 0, %18 ]
%28 = phi i32 [ %94, %91 ], [ -96, %18 ]
%29 = icmp ne i32 %28, -96
%30 = and i32 %28, 3
%31 = icmp eq i32 %30, 0
%32 = and i1 %29, %31
br i1 %32, label %33, label %35
33: ; preds = %21
%34 = call i32 @putchar(i32 10)
br label %35
35: ; preds = %33, %21
%36 = load i32, i32* @stdout
%37 = call i32 @base24_printPair(i32 %36, i32 %28)
%38 = call i32 @nelsc_cycle_yearToMonth(i32 %28)
%39 = call i32 @nelsc_cycle_monthToDay(i32 %38)
%40 = add nsw i32 %39, 264773
%41 = call i32 @grcal_offsetToDate(i32 %40, i32* %3, i32* %4, i32* %5)
%42 = load i32, i32* %3
%43 = call i32 @grcal_dateToOffset(i32* %6, i32 %42, i32 3, i32 20)
%44 = icmp sgt i32 %28, -96
br i1 %44, label %45, label %49
45: ; preds = %35
%46 = load i32, i32* %6
%47 = add nsw i32 %46, -264773
%48 = call i32 @nelsc_cycle_dayToMonth(i32 %47, i32* null)
br label %51
49: ; preds = %35
%50 = add nsw i32 %38, -1
br label %51
51: ; preds = %49, %45
%52 = phi i32 [ %48, %45 ], [ %50, %49 ]
%53 = sub nsw i32 %52, %38
%54 = icmp eq i32 %28, -96
%55 = icmp slt i32 %53, %27
%56 = icmp sgt i32 %53, %26
%57 = select i1 %54, i1 true, i1 %55
%58 = select i1 %57, i32 %53, i32 %27
%59 = select i1 %54, i1 true, i1 %56
%60 = select i1 %59, i32 %53, i32 %26
%61 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0))
%62 = load i32, i32* @stdout
%63 = load i32, i32* %3
%64 = load i32, i32* %4
%65 = load i32, i32* %5
%66 = call i32 @grcal_printDate(i32 %62, i32 %63, i32 %64, i32 %65)
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0), i32 %53)
%68 = icmp eq i32 %25, -1
%69 = load i32, i32* %4
%70 = load i32, i32* %5
%71 = select i1 %68, i32 %69, i32 %25
%72 = select i1 %68, i32 %70, i32 %24
%73 = icmp sgt i32 %71, %69
br i1 %73, label %78, label %74
74: ; preds = %51
%75 = icmp eq i32 %71, %69
%76 = icmp sgt i32 %72, %70
%77 = select i1 %75, i1 %76, i1 false
br i1 %77, label %78, label %79
78: ; preds = %74, %51
br label %79
79: ; preds = %78, %74
%80 = phi i32 [ %69, %78 ], [ %71, %74 ]
%81 = phi i32 [ %70, %78 ], [ %72, %74 ]
%82 = icmp eq i32 %23, -1
%83 = select i1 %82, i32 %69, i32 %23
%84 = select i1 %82, i32 %70, i32 %22
%85 = icmp slt i32 %83, %69
br i1 %85, label %90, label %86
86: ; preds = %79
%87 = icmp eq i32 %83, %69
%88 = icmp slt i32 %84, %70
%89 = select i1 %87, i1 %88, i1 false
br i1 %89, label %90, label %91
90: ; preds = %86, %79
br label %91
91: ; preds = %86, %90
%92 = phi i32 [ %69, %90 ], [ %83, %86 ]
%93 = phi i32 [ %70, %90 ], [ %84, %86 ]
%94 = add nsw i32 %28, 1
%95 = icmp eq i32 %94, 480
br i1 %95, label %96, label %21
96: ; preds = %91
%97 = call i32 @putchar(i32 10)
%98 = sext i32 %80 to i64
%99 = sext i32 %81 to i64
%100 = sext i32 %92 to i64
%101 = sext i32 %93 to i64
%102 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @.str.4, i64 0, i64 0), i64 %98, i64 %99, i64 %100, i64 %101)
%103 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.5, i64 0, i64 0), i32 %58, i32 %60)
br label %104
104: ; preds = %14, %96, %18
%105 = phi i32 [ %17, %14 ], [ %7, %96 ], [ %7, %18 ]
ret i32 %105
}