#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, int, int, int);
int /*<<< orphan*/ stderr;
void check_year(int y, int b, int a) {
  int year;
  if (((year = y - b) < 1) || ((year = y + a) > 9999)) {
    fprintf(stderr, "%s: year `%d' not in range %d..%d\n", "easter", year, 1,
            9999);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<check_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x1,%eax
jl     1157 <check_year+0x37>
mov    -0x4(%rbp),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmp    $0x270f,%eax
jle    118c <check_year+0x6c>
mov    0x2e82(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%ecx
lea    0xe96(%rip),%rsi
lea    0xeb2(%rip),%rdx
mov    $0x1,%r8d
mov    $0x270f,%r9d
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_year>:
mov    %edi,%ecx
sub    %esi,%ecx
jle    1133 <check_year+0x13>
add    %edi,%edx
mov    %edx,%ecx
cmp    $0x2710,%edx
jge    1133 <check_year+0x13>
ret
push   %rax
mov    0x2ea5(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
lea    0xed8(%rip),%rdx
mov    $0x1,%r8d
mov    $0x270f,%r9d
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"%s: year `%d' not in range %d..%d\0A\00"
@.str.1 = [7 x i8] c"easter\00"
define void @check_year(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %4
%9 = load i32, i32* %5
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %7
%11 = icmp slt i32 %10, 1
br i1 %11, label %17, label %12
12: ; preds = %3
%13 = load i32, i32* %4
%14 = load i32, i32* %6
%15 = add nsw i32 %13, %14
store i32 %15, i32* %7
%16 = icmp sgt i32 %15, 9999
br i1 %16, label %17, label %22
17: ; preds = %12, %3
%18 = load i32, i32* @stderr
%19 = load i32, i32* %7
%20 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %19, i32 1, i32 9999)
%21 = call i32 @exit(i32 1)
unreachable
22: ; preds = %12
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"%s: year `%d' not in range %d..%d\0A\00"
@.str.1 = [7 x i8] c"easter\00"
define void @check_year(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %0, %1
%5 = icmp slt i32 %4, 1
br i1 %5, label %9, label %6
6: ; preds = %3
%7 = add nsw i32 %2, %0
%8 = icmp sgt i32 %7, 9999
br i1 %8, label %9, label %14
9: ; preds = %6, %3
%10 = phi i32 [ %4, %3 ], [ %7, %6 ]
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 1, i32 9999)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %6
ret void
}