#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
void jgyear() {
  int year, judge;
  printf("+-------*--------*--------*--------*-------+\n");
  printf("JudgeAYear!\n please input a year: ");
  scanf("%d", &year);
  if (year % 4 == 0 && year % 400 != 0 || year % 400 == 0)
    judge = 1;
  else
    judge = 0;
  printf("%d is ", year);
  if (judge == 0)
    printf("not");
  printf(" a leap year!\n");
  printf("+-------*--------*--------*--------*-------+\n");
}


x86 assembly (clang, -O0):
<jgyear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf06(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    117c <jgyear+0x5c>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1190 <jgyear+0x70>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    119c <jgyear+0x7c>
movl   $0x1,-0x8(%rbp)
jmp    11a3 <jgyear+0x83>
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0x8(%rbp)
jne    11cc <jgyear+0xac>
lea    0xe96(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe8c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jgyear>:
push   %rbx
sub    $0x10,%rsp
lea    0xf03(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xecd(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1050 <scanf@plt>
movslq 0xc(%rsp),%rbx
lea    0xeba(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
test   $0x3,%bl
je     11a6 <jgyear+0x76>
imul   $0x51eb851f,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x27,%rax
add    %ecx,%eax
imul   $0x190,%eax,%eax
sub    %eax,%ebx
je     11a6 <jgyear+0x76>
lea    0xe8e(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
call   1030 <puts@plt>
lea    0xe86(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"+-------*--------*--------*--------*-------+\0A\00"
@.str.1 = [35 x i8] c"JudgeAYear!\0A please input a year: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [7 x i8] c"%d is \00"
@.str.4 = [4 x i8] c"not\00"
@.str.5 = [15 x i8] c" a leap year!\0A\00"
define void @jgyear() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = srem i32 %6, 4
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %0
%10 = load i32, i32* %1
%11 = srem i32 %10, 400
%12 = icmp ne i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %9, %0
%14 = load i32, i32* %1
%15 = srem i32 %14, 400
%16 = icmp eq i32 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13, %9
store i32 1, i32* %2
br label %19
18: ; preds = %13
store i32 0, i32* %2
br label %19
19: ; preds = %18, %17
%20 = load i32, i32* %1
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = icmp eq i32 %22, 0
br i1 %23, label %24, label %26
24: ; preds = %19
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %26
26: ; preds = %24, %19
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.1 = [35 x i8] c"JudgeAYear!\0A please input a year: \00"
@.str.2 = [3 x i8] c"%d\00"
@.str.3 = [7 x i8] c"%d is \00"
@.str.4 = [4 x i8] c"not\00"
@str.6 = [14 x i8] c" a leap year!\00"
@str.7 = [45 x i8] c"+-------*--------*--------*--------*-------+\00"
define void @jgyear() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32* %1)
%6 = load i32, i32* %1
%7 = and i32 %6, 3
%8 = icmp eq i32 %7, 0
%9 = srem i32 %6, 400
%10 = icmp eq i32 %9, 0
%11 = or i1 %8, %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), i32 %6)
br i1 %11, label %15, label %13
13: ; preds = %0
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0))
br label %15
15: ; preds = %0, %13
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.6, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([45 x i8], [45 x i8]* @str.7, i64 0, i64 0))
ret void
}