#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 *, long *);
int main(void) {
  long int AKTUELLES_JAHR, SCHALTJAHR;
  printf("\n\n\t\tBitte geben Sie ein Jahr ein (Beispiel: 2021 - max. "
         "9999):\n\n\t\t> ");
  scanf("%ld", &AKTUELLES_JAHR);
  if (AKTUELLES_JAHR < 10000) {
    SCHALTJAHR = 1 / (1 + AKTUELLES_JAHR % 4) - 1 / (1 + AKTUELLES_JAHR % 100) +
                 1 / (1 + AKTUELLES_JAHR % 400);
    printf("\n\t\tIst \"%ld\" ein Schaltjahr? %s\n\n", AKTUELLES_JAHR,
           SCHALTJAHR == 0 ? "\n\n\t\tComputer sagt: \"Nein...\"\n"
                           : "\n\t\tComputer sagt: \"Ja...\"\n");
  } else {
    printf("\n\t\tEingabe ist zu lang! \n\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf01(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmpq   $0x2710,-0x10(%rbp)
jge    1209 <main+0xe9>
mov    -0x10(%rbp),%rax
mov    $0x4,%ecx
cqto
idiv   %rcx
mov    %rdx,%rcx
add    $0x1,%rcx
mov    $0x1,%eax
cqto
idiv   %rcx
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x64,%ecx
cqto
idiv   %rcx
mov    %rdx,%rcx
add    $0x1,%rcx
mov    $0x1,%eax
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
sub    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x190,%ecx
cqto
idiv   %rcx
mov    %rdx,%rcx
add    $0x1,%rcx
mov    $0x1,%eax
cqto
idiv   %rcx
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
lea    0xea2(%rip),%rdx
lea    0xe7d(%rip),%rax
cmp    $0x0,%rcx
cmove  %rax,%rdx
lea    0xe4c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1217 <main+0xf7>
lea    0xe94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeff(%rip),%rdi
mov    %rsp,%rsi
call   1050 <scanf@plt>
mov    (%rsp),%rcx
cmp    $0x270f,%rcx
jg     1224 <main+0xf4>
lea    0x3(%rcx),%rax
test   %rcx,%rcx
cmovns %rcx,%rax
and    $0xfffffffffffffffc,%rax
mov    %rcx,%rdi
sub    %rax,%rdi
add    $0x1,%rdi
neg    %rax
add    %rcx,%rax
add    $0x2,%rax
xor    %r8d,%r8d
cmp    $0x3,%rax
cmovae %r8,%rdi
movabs $0xa3d70a3d70a3d70b,%rdx
0a d7 a3
mov    %rcx,%rax
imul   %rdx
add    %rcx,%rdx
mov    %rdx,%rax
sar    $0x6,%rax
mov    %rdx,%r9
shr    $0x3f,%r9
add    %r9,%rax
imul   $0x64,%rax,%rax
mov    %rcx,%rsi
sub    %rax,%rsi
not    %rsi
neg    %rax
add    %rcx,%rax
add    $0x2,%rax
cmp    $0x3,%rax
cmovae %r8,%rsi
add    %rdi,%rsi
sar    $0x8,%rdx
add    %r9,%rdx
imul   $0x190,%rdx,%rax
mov    %rcx,%rdx
sub    %rax,%rdx
not    %rdx
neg    %rax
add    %rcx,%rax
add    $0x2,%rax
cmp    $0x3,%rax
cmovae %r8,%rdx
cmp    %rdx,%rsi
lea    0xe65(%rip),%rax
lea    0xe7c(%rip),%rdx
cmove  %rax,%rdx
lea    0xe31(%rip),%rdi
mov    %rcx,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1230 <main+0x100>
lea    0xe79(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [69 x i8] c"\0A\0A\09\09Bitte geben Sie ein Jahr ein (Beispiel: 2021 - max. 9999):\0A\0A\09\09> \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [34 x i8] c"\0A\09\09Ist \22%ld\22 ein Schaltjahr? %s\0A\0A\00"
@.str.3 = [30 x i8] c"\0A\0A\09\09Computer sagt: \22Nein...\22\0A\00"
@.str.4 = [27 x i8] c"\0A\09\09Computer sagt: \22Ja...\22\0A\00"
@.str.5 = [27 x i8] c"\0A\09\09Eingabe ist zu lang! \0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
%3 = alloca i64
store i32 0, i32* %1
%4 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %2)
%6 = load i64, i64* %2
%7 = icmp slt i64 %6, 10000
br i1 %7, label %8, label %29
8: ; preds = %0
%9 = load i64, i64* %2
%10 = srem i64 %9, 4
%11 = add nsw i64 1, %10
%12 = sdiv i64 1, %11
%13 = load i64, i64* %2
%14 = srem i64 %13, 100
%15 = add nsw i64 1, %14
%16 = sdiv i64 1, %15
%17 = sub nsw i64 %12, %16
%18 = load i64, i64* %2
%19 = srem i64 %18, 400
%20 = add nsw i64 1, %19
%21 = sdiv i64 1, %20
%22 = add nsw i64 %17, %21
store i64 %22, i64* %3
%23 = load i64, i64* %2
%24 = load i64, i64* %3
%25 = icmp eq i64 %24, 0
%26 = zext i1 %25 to i64
%27 = select i1 %25, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0)
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %23, i8* %27)
br label %31
29: ; preds = %0
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.5, i64 0, i64 0))
br label %31
31: ; preds = %29, %8
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
@.str = [69 x i8] c"\0A\0A\09\09Bitte geben Sie ein Jahr ein (Beispiel: 2021 - max. 9999):\0A\0A\09\09> \00"
@.str.1 = [4 x i8] c"%ld\00"
@.str.2 = [34 x i8] c"\0A\09\09Ist \22%ld\22 ein Schaltjahr? %s\0A\0A\00"
@.str.3 = [30 x i8] c"\0A\0A\09\09Computer sagt: \22Nein...\22\0A\00"
@.str.4 = [27 x i8] c"\0A\09\09Computer sagt: \22Ja...\22\0A\00"
@str = [26 x i8] c"\0A\09\09Eingabe ist zu lang! \0A\00"
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i64* %1)
%5 = load i64, i64* %1
%6 = icmp slt i64 %5, 10000
br i1 %6, label %7, label %27
7: ; preds = %0
%8 = srem i64 %5, 4
%9 = add nsw i64 %8, 1
%10 = add nsw i64 %8, 2
%11 = icmp ult i64 %10, 3
%12 = select i1 %11, i64 %9, i64 0
%13 = srem i64 %5, 100
%14 = xor i64 %13, -1
%15 = add nsw i64 %13, 2
%16 = icmp ult i64 %15, 3
%17 = select i1 %16, i64 %14, i64 0
%18 = add nsw i64 %17, %12
%19 = srem i64 %5, 400
%20 = xor i64 %19, -1
%21 = add nsw i64 %19, 2
%22 = icmp ult i64 %21, 3
%23 = select i1 %22, i64 %20, i64 0
%24 = icmp eq i64 %18, %23
%25 = select i1 %24, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.2, i64 0, i64 0), i64 %5, i8* %25)
br label %29
27: ; preds = %0
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
br label %29
29: ; preds = %27, %7
ret i32 0
}