#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*/ check_year(int, int, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ isnum(char *);
int /*<<< orphan*/ stderr;
int strtoul(char *, int /*<<< orphan*/ *, int);
void check_arg(char *str, int b, int a, int *y) {
  if (!isnum(str)) {
    fprintf(stderr, "%s: not a valid year %s\n", "easter", str);
    exit(1);
  }
  check_year(*y = strtoul(str, NULL, 10), a, b);
}


x86 assembly (clang, -O0):
<check_arg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <isnum@plt>
cmp    $0x0,%eax
jne    11a2 <check_arg+0x52>
mov    0x2e61(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rcx
lea    0xe74(%rip),%rsi
lea    0xe86(%rip),%rdx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1060 <strtoul@plt>
mov    %eax,%edi
mov    -0x18(%rbp),%rax
mov    %edi,(%rax)
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <check_year@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_arg>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%rbp
mov    %edx,%r15d
mov    %esi,%r14d
mov    %rdi,%rbx
call   1050 <isnum@plt>
test   %eax,%eax
je     1195 <check_arg+0x45>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1060 <strtoul@plt>
mov    %eax,0x0(%rbp)
mov    %eax,%edi
mov    %r15d,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <check_year@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0xe5b(%rip),%rsi
lea    0xe6d(%rip),%rdx
mov    %rbx,%rcx
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [25 x i8] c"%s: not a valid year %s\0A\00"
@.str.1 = [7 x i8] c"easter\00"
define void @check_arg(i8* %0, i32 %1, i32 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32* %3, i32** %8
%9 = load i8*, i8** %5
%10 = call i32 @isnum(i8* %9)
%11 = icmp ne i32 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %4
%13 = load i32, i32* @stderr
%14 = load i8*, i8** %5
%15 = call i32 @fprintf(i32 %13, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %14)
%16 = call i32 @exit(i32 1)
unreachable
17: ; preds = %4
%18 = load i8*, i8** %5
%19 = call i32 @strtoul(i8* %18, i32* null, i32 10)
%20 = load i32*, i32** %8
store i32 %19, i32* %20
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = call i32 @check_year(i32 %19, i32 %21, i32 %22)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [25 x i8] c"%s: not a valid year %s\0A\00"
@.str.1 = [7 x i8] c"easter\00"
define void @check_arg(i8* %0, i32 %1, i32 %2, i32* nocapture writeonly %3) {
%5 = tail call i32 @isnum(i8* %0)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%10 = tail call i32 @exit(i32 1)
unreachable
11: ; preds = %4
%12 = tail call i32 @strtoul(i8* nocapture %0, i32* null, i32 10)
store i32 %12, i32* %3
%13 = tail call i32 @check_year(i32 %12, i32 %2, i32 %1)
ret void
}