#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 /*<<< orphan*/ abort();
int /*<<< orphan*/ grcal_offsetToDate(int, int *, int *, int *);
int /*<<< orphan*/ grcal_printDate(int /*<<< orphan*/, int, int, int);
int nelsc_cycle_dayToMonth(int, int *);
scalar_t__ nelsc_cycle_isLongMonth(int);
scalar_t__ nelsc_cycle_isLongYear(int);
int nelsc_cycle_monthToYear(int, int *);
int /*<<< orphan*/ nelsc_format_printDate(int /*<<< orphan*/, int, int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void printDayInformation(int32_t day) {
  int32_t year = 0;
  int32_t month_of_year = 0;
  int32_t absolute_month = 0;
  int32_t day_of_month = 0;
  int32_t gr_year = 0;
  int32_t gr_month = 0;
  int32_t gr_day = 0;
  if ((day < (-35364)) || (day > (175020))) {
    abort();
  }
  printf("Day offset:      %ld\n", (long)day);
  absolute_month = nelsc_cycle_dayToMonth(day, &day_of_month);
  year = nelsc_cycle_monthToYear(absolute_month, &month_of_year);
  grcal_offsetToDate((day + (264773)), &gr_year, &gr_month, &gr_day);
  printf("Absolute month:  %ld\n", (long)absolute_month);
  printf("NELSC date:      ");
  nelsc_format_printDate(stdout, year, month_of_year, day_of_month);
  printf("\n");
  printf("Month length:    ");
  if (nelsc_cycle_isLongMonth(absolute_month)) {
    printf("long\n");
  } else {
    printf("short\n");
  }
  printf("Year length:     ");
  if (nelsc_cycle_isLongYear(year)) {
    printf("long\n");
  } else {
    printf("short\n");
  }
  printf("Gregorian date:  ");
  grcal_printDate(stdout, gr_year, gr_month, gr_day);
  printf("\n");
}


x86 assembly (clang, -O0):
<printDayInformation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0xffff75dc,-0x4(%rbp)
jl     11e6 <printDayInformation+0x56>
cmpl   $0x2abac,-0x4(%rbp)
jle    11ed <printDayInformation+0x5d>
mov    $0x0,%al
call   1030 <abort@plt>
movslq -0x4(%rbp),%rsi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x4(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   10a0 <nelsc_cycle_dayToMonth@plt>
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
lea    -0xc(%rbp),%rsi
call   1060 <nelsc_cycle_monthToYear@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x40a45,%edi
lea    -0x18(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1040 <grcal_offsetToDate@plt>
movslq -0x10(%rbp),%rsi
lea    0xdd4(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xddc(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2d82(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   10b0 <nelsc_format_printDate@plt>
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x10(%rbp),%edi
call   1090 <nelsc_cycle_isLongMonth@plt>
cmp    $0x0,%rax
je     12af <printDayInformation+0x11f>
lea    0xdad(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    12bd <printDayInformation+0x12d>
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd99(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    -0x8(%rbp),%edi
call   1080 <nelsc_cycle_isLongYear@plt>
cmp    $0x0,%rax
je     12f0 <printDayInformation+0x160>
lea    0xd6c(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
jmp    12fe <printDayInformation+0x16e>
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
lea    0xd6a(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
mov    0x2ccd(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1050 <grcal_printDate@plt>
lea    0xcea(%rip),%rdi
mov    $0x0,%al
call   1070 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printDayInformation>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebx
movl   $0x0,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x4(%rsp)
lea    -0x2abad(%rbx),%eax
cmp    $0xfffcca2e,%eax
jbe    1313 <printDayInformation+0x163>
movslq %ebx,%rsi
lea    0xe01(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x10(%rsp),%rsi
mov    %ebx,%edi
call   10c0 <nelsc_cycle_dayToMonth@plt>
mov    %eax,%ebp
lea    0x14(%rsp),%rsi
mov    %eax,%edi
call   1080 <nelsc_cycle_monthToYear@plt>
mov    %eax,%r14d
add    $0x40a45,%ebx
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
mov    %ebx,%edi
call   1060 <grcal_offsetToDate@plt>
movslq %ebp,%rbx
lea    0xdcd(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xdd2(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x2d78(%rip),%r15
mov    (%r15),%edi
mov    0x14(%rsp),%edx
mov    0x10(%rsp),%ecx
mov    %r14d,%esi
call   10d0 <nelsc_format_printDate@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdb2(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %ebx,%edi
call   10b0 <nelsc_cycle_isLongMonth@plt>
test   %rax,%rax
lea    0xdd0(%rip),%rbp
lea    0xdcf(%rip),%rbx
mov    %rbx,%rdi
cmove  %rbp,%rdi
call   1050 <puts@plt>
lea    0xd92(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14d,%edi
call   10a0 <nelsc_cycle_isLongYear@plt>
test   %rax,%rax
cmove  %rbp,%rbx
mov    %rbx,%rdi
call   1050 <puts@plt>
lea    0xd7f(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%r15),%edi
mov    0xc(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0x4(%rsp),%ecx
call   1070 <grcal_printDate@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
call   1040 <abort@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"Day offset: %ld\0A\00"
@.str.1 = [22 x i8] c"Absolute month: %ld\0A\00"
@.str.2 = [18 x i8] c"NELSC date: \00"
@stdout = global i32 0
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [18 x i8] c"Month length: \00"
@.str.5 = [6 x i8] c"long\0A\00"
@.str.6 = [7 x i8] c"short\0A\00"
@.str.7 = [18 x i8] c"Year length: \00"
@.str.8 = [18 x i8] c"Gregorian date: \00"
define void @printDayInformation(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
%10 = load i32, i32* %2
%11 = icmp slt i32 %10, -35364
br i1 %11, label %15, label %12
12: ; preds = %1
%13 = load i32, i32* %2
%14 = icmp sgt i32 %13, 175020
br i1 %14, label %15, label %17
15: ; preds = %12, %1
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %12
%18 = load i32, i32* %2
%19 = sext i32 %18 to i64
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %19)
%21 = load i32, i32* %2
%22 = call i32 @nelsc_cycle_dayToMonth(i32 %21, i32* %6)
store i32 %22, i32* %5
%23 = load i32, i32* %5
%24 = call i32 @nelsc_cycle_monthToYear(i32 %23, i32* %4)
store i32 %24, i32* %3
%25 = load i32, i32* %2
%26 = add nsw i32 %25, 264773
%27 = call i32 @grcal_offsetToDate(i32 %26, i32* %7, i32* %8, i32* %9)
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 %29)
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%32 = load i32, i32* @stdout
%33 = load i32, i32* %3
%34 = load i32, i32* %4
%35 = load i32, i32* %6
%36 = call i32 @nelsc_format_printDate(i32 %32, i32 %33, i32 %34, i32 %35)
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%39 = load i32, i32* %5
%40 = call i64 @nelsc_cycle_isLongMonth(i32 %39)
%41 = icmp ne i64 %40, 0
br i1 %41, label %42, label %44
42: ; preds = %17
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %46
44: ; preds = %17
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %46
46: ; preds = %44, %42
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%48 = load i32, i32* %3
%49 = call i64 @nelsc_cycle_isLongYear(i32 %48)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %53
51: ; preds = %46
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0))
br label %55
53: ; preds = %46
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %55
55: ; preds = %53, %51
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%57 = load i32, i32* @stdout
%58 = load i32, i32* %7
%59 = load i32, i32* %8
%60 = load i32, i32* %9
%61 = call i32 @grcal_printDate(i32 %57, i32 %58, i32 %59, i32 %60)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"Day offset: %ld\0A\00"
@.str.1 = [22 x i8] c"Absolute month: %ld\0A\00"
@.str.2 = [18 x i8] c"NELSC date: \00"
@stdout = global i32 0
@.str.4 = [18 x i8] c"Month length: \00"
@.str.7 = [18 x i8] c"Year length: \00"
@.str.8 = [18 x i8] c"Gregorian date: \00"
@str.9 = [6 x i8] c"short\00"
@str.11 = [5 x i8] c"long\00"
define void @printDayInformation(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%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 = add i32 %0, -175021
%13 = icmp ult i32 %12, -210385
br i1 %13, label %14, label %16
14: ; preds = %1
%15 = tail call i32 (...) @abort()
unreachable
16: ; preds = %1
%17 = sext i32 %0 to i64
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i64 %17)
%19 = call i32 @nelsc_cycle_dayToMonth(i32 %0, i32* %3)
%20 = call i32 @nelsc_cycle_monthToYear(i32 %19, i32* %2)
%21 = add nsw i32 %0, 264773
%22 = call i32 @grcal_offsetToDate(i32 %21, i32* %4, i32* %5, i32* %6)
%23 = sext i32 %19 to i64
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i64 %23)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%26 = load i32, i32* @stdout
%27 = load i32, i32* %2
%28 = load i32, i32* %3
%29 = call i32 @nelsc_format_printDate(i32 %26, i32 %20, i32 %27, i32 %28)
%30 = call i32 @putchar(i32 10)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.4, i64 0, i64 0))
%32 = call i64 @nelsc_cycle_isLongMonth(i32 %19)
%33 = icmp eq i64 %32, 0
%34 = select i1 %33, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.11, i64 0, i64 0)
%35 = call i32 @puts(i8* dereferenceable(1) %34)
%36 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%37 = call i64 @nelsc_cycle_isLongYear(i32 %20)
%38 = icmp eq i64 %37, 0
%39 = select i1 %38, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.9, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @str.11, i64 0, i64 0)
%40 = call i32 @puts(i8* dereferenceable(1) %39)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%42 = load i32, i32* @stdout
%43 = load i32, i32* %4
%44 = load i32, i32* %5
%45 = load i32, i32* %6
%46 = call i32 @grcal_printDate(i32 %42, i32 %43, i32 %44, i32 %45)
%47 = call i32 @putchar(i32 10)
ret void
}