#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 *);
int main(void) {
  int SJ = 0, monat = 0, tag = 0, jahr = 0, A = 0, B = 0, C = 0, E = 0;
  int H = 0, M = 0, T = 0, k = 0;
  printf("\n\n\t\tBitte geben Sie ein Jahr ein (Beispiel: 2017):\n\n\t\t--> ");
  scanf("%4d", &jahr);
  SJ = 1 / (1 + jahr % 4) - 1 / (1 + jahr % 100) + 1 / (1 + jahr % 400);
  printf("\n\t\tIst \"%4d\" ein Schaltjahr? %s\n", jahr,
         SJ == 0 ? "Computer sagt: \"Nein...\"" : "Computer sagt: \"Ja...\"");
  k = jahr / 100 - jahr / 400 - 1;
  M = 16 + k - (jahr / 100 * 8 + 13) / 25;
  H = jahr % 19;
  A = (M + H * 19) % 30;
  T = (A + H / 11) / 29;
  B = 120 + A - T;
  C = (B + jahr + jahr / 4 - k) % 7;
  E = B - C;
  tag = 1 + E % 31;
  monat = E / 31;
  printf("\n\t\tOstersonntag faellt im Jahr \"%4d\" auf das Tagesdatum: "
         "%0d.%0d.%d\n",
         jahr, tag, monat, jahr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-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)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
lea    0xe76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea3(%rip),%rdi
lea    -0x14(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,-0x4c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x48(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %edx,%ecx
add    $0x1,%ecx
mov    $0x1,%eax
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x48(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x8(%rbp),%ecx
lea    0xe6c(%rip),%rdx
lea    0xe4c(%rip),%rax
cmp    $0x0,%ecx
cmove  %rax,%rdx
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,-0x44(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
sub    %ecx,%eax
sub    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
add    $0x10,%eax
mov    %eax,-0x40(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
shl    $0x3,%eax
add    $0xd,%eax
mov    $0x19,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x40(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x13,%ecx
cltd
idiv   %ecx
mov    %edx,-0x28(%rbp)
mov    -0x2c(%rbp),%eax
imul   $0x13,-0x28(%rbp),%ecx
add    %ecx,%eax
mov    $0x1e,%ecx
cltd
idiv   %ecx
mov    %edx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%eax
mov    $0xb,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
add    %ecx,%eax
mov    $0x1d,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    -0x18(%rbp),%eax
add    $0x78,%eax
sub    -0x30(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
add    %ecx,%eax
sub    -0x34(%rbp),%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
mov    -0x24(%rbp),%eax
mov    $0x1f,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%r8d
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
lea    0xece(%rip),%rdi
xor    %ebp,%ebp
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef9(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
movslq 0x4(%rsp),%rsi
lea    0x3(%rsi),%ecx
test   %esi,%esi
cmovns %esi,%ecx
and    $0xfffffffc,%ecx
mov    %esi,%eax
sub    %ecx,%eax
add    $0x1,%eax
neg    %ecx
add    %esi,%ecx
add    $0x2,%ecx
cmp    $0x3,%ecx
cmovae %ebp,%eax
imul   $0x51eb851f,%rsi,%rcx
mov    %rcx,%rdx
shr    $0x20,%rdx
mov    %edx,%edi
sar    $0x5,%edi
shr    $0x3f,%rcx
add    %ecx,%edi
imul   $0x64,%edi,%edi
mov    %esi,%ebx
sub    %edi,%ebx
not    %ebx
neg    %edi
add    %esi,%edi
add    $0x2,%edi
cmp    $0x3,%edi
cmovae %ebp,%ebx
add    %eax,%ebx
sar    $0x7,%edx
add    %ecx,%edx
imul   $0x190,%edx,%eax
mov    %esi,%ecx
sub    %eax,%ecx
not    %ecx
neg    %eax
add    %esi,%eax
add    $0x2,%eax
cmp    $0x3,%eax
cmovae %ebp,%ecx
cmp    %ecx,%ebx
lea    0xe98(%rip),%rax
lea    0xeaa(%rip),%rdx
cmove  %rax,%rdx
lea    0xe65(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movslq 0x4(%rsp),%rsi
imul   $0x51eb851f,%rsi,%rcx
mov    %rcx,%rax
shr    $0x3f,%rax
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %eax,%ecx
imul   $0xffffffffae147ae1,%rsi,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
sar    $0x7,%eax
add    %edx,%eax
add    %ecx,%eax
imul   $0x6bca1af3,%rsi,%rdx
mov    %rdx,%rdi
shr    $0x3f,%rdi
shr    $0x20,%rdx
sar    $0x3,%edx
add    %edi,%edx
lea    (%rdx,%rdx,8),%edi
lea    (%rdx,%rdi,2),%edi
mov    %esi,%edx
sub    %edi,%edx
lea    (%rdx,%rdx,8),%edi
lea    (%rdx,%rdi,2),%edi
add    %eax,%edi
lea    0xd(,%rcx,8),%ecx
movslq %ecx,%rcx
imul   $0xffffffffae147ae1,%rcx,%rcx
mov    %rcx,%rbp
shr    $0x3f,%rbp
shr    $0x20,%rcx
sar    $0x3,%ecx
add    %ebp,%ecx
lea    (%rdi,%rcx,1),%ebp
add    $0xf,%ebp
add    %ecx,%edi
movslq %ebp,%rcx
imul   $0xffffffff88888889,%rcx,%rbp
shr    $0x20,%rbp
add    %edi,%ebp
add    $0xf,%ebp
mov    %ebp,%edi
shr    $0x1f,%edi
sar    $0x4,%ebp
add    %edi,%ebp
mov    %ebp,%ebx
shl    $0x5,%ebx
mov    %ebp,%edi
sub    %ebx,%edi
add    %ebp,%edi
add    %edi,%ecx
movsbl %dl,%edi
imul   $0xffffffbb,%edi,%edi
shr    $0x8,%edi
add    %dl,%dil
mov    %edi,%edx
shr    $0x7,%dl
sar    $0x3,%dil
add    %dl,%dil
lea    (%rcx,%rdi,1),%edx
movsbl %dl,%edx
imul   $0xffffffb9,%edx,%edx
movzwl %dx,%edx
mov    %edx,%edi
shr    $0xf,%edi
shr    $0x8,%edx
sar    $0x3,%dl
add    %dil,%dl
movsbl %dl,%edx
add    %ecx,%edx
lea    0x3(%rsi),%ecx
test   %rsi,%rsi
cmovns %esi,%ecx
sar    $0x2,%ecx
add    %esi,%ecx
sub    %eax,%ecx
lea    (%rcx,%rdx,1),%eax
add    $0x1,%eax
add    %ecx,%edx
add    $0x79,%edx
add    $0x1,%ecx
movslq %edx,%rdx
imul   $0xffffffff92492493,%rdx,%rdx
shr    $0x20,%rdx
add    %edx,%eax
add    $0x78,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %eax,%edx
sub    %ecx,%edx
movzbl %dl,%eax
lea    (%rax,%rax,8),%ecx
shr    $0x8,%ecx
mov    %eax,%edx
sub    %cl,%dl
shr    %dl
add    %cl,%dl
shr    $0x4,%dl
movzbl %dl,%ecx
mov    %ecx,%edx
shl    $0x5,%edx
sub    %ecx,%edx
sub    %dl,%al
add    $0x1,%al
movzbl %al,%edx
lea    0xd55(%rip),%rdi
mov    %esi,%r8d
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [59 x i8] c"\0A\0A\09\09Bitte geben Sie ein Jahr ein (Beispiel: 2017):\0A\0A\09\09--> \00"
@.str.1 = [4 x i8] c"%4d\00"
@.str.2 = [33 x i8] c"\0A\09\09Ist \22%4d\22 ein Schaltjahr? %s\0A\00"
@.str.3 = [25 x i8] c"Computer sagt: \22Nein...\22\00"
@.str.4 = [23 x i8] c"Computer sagt: \22Ja...\22\00"
@.str.5 = [69 x i8] c"\0A\09\09Ostersonntag faellt im Jahr \22%4d\22 auf das Tagesdatum: %0d.%0d.%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
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
store i32 0, i32* %10
store i32 0, i32* %11
store i32 0, i32* %12
store i32 0, i32* %13
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str, i64 0, i64 0))
%15 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32* %5)
%16 = load i32, i32* %5
%17 = srem i32 %16, 4
%18 = add nsw i32 1, %17
%19 = sdiv i32 1, %18
%20 = load i32, i32* %5
%21 = srem i32 %20, 100
%22 = add nsw i32 1, %21
%23 = sdiv i32 1, %22
%24 = sub nsw i32 %19, %23
%25 = load i32, i32* %5
%26 = srem i32 %25, 400
%27 = add nsw i32 1, %26
%28 = sdiv i32 1, %27
%29 = add nsw i32 %24, %28
store i32 %29, i32* %2
%30 = load i32, i32* %5
%31 = load i32, i32* %2
%32 = icmp eq i32 %31, 0
%33 = zext i1 %32 to i64
%34 = select i1 %32, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0)
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %30, i8* %34)
%36 = load i32, i32* %5
%37 = sdiv i32 %36, 100
%38 = load i32, i32* %5
%39 = sdiv i32 %38, 400
%40 = sub nsw i32 %37, %39
%41 = sub nsw i32 %40, 1
store i32 %41, i32* %13
%42 = load i32, i32* %13
%43 = add nsw i32 16, %42
%44 = load i32, i32* %5
%45 = sdiv i32 %44, 100
%46 = mul nsw i32 %45, 8
%47 = add nsw i32 %46, 13
%48 = sdiv i32 %47, 25
%49 = sub nsw i32 %43, %48
store i32 %49, i32* %11
%50 = load i32, i32* %5
%51 = srem i32 %50, 19
store i32 %51, i32* %10
%52 = load i32, i32* %11
%53 = load i32, i32* %10
%54 = mul nsw i32 %53, 19
%55 = add nsw i32 %52, %54
%56 = srem i32 %55, 30
store i32 %56, i32* %6
%57 = load i32, i32* %6
%58 = load i32, i32* %10
%59 = sdiv i32 %58, 11
%60 = add nsw i32 %57, %59
%61 = sdiv i32 %60, 29
store i32 %61, i32* %12
%62 = load i32, i32* %6
%63 = add nsw i32 120, %62
%64 = load i32, i32* %12
%65 = sub nsw i32 %63, %64
store i32 %65, i32* %7
%66 = load i32, i32* %7
%67 = load i32, i32* %5
%68 = add nsw i32 %66, %67
%69 = load i32, i32* %5
%70 = sdiv i32 %69, 4
%71 = add nsw i32 %68, %70
%72 = load i32, i32* %13
%73 = sub nsw i32 %71, %72
%74 = srem i32 %73, 7
store i32 %74, i32* %8
%75 = load i32, i32* %7
%76 = load i32, i32* %8
%77 = sub nsw i32 %75, %76
store i32 %77, i32* %9
%78 = load i32, i32* %9
%79 = srem i32 %78, 31
%80 = add nsw i32 1, %79
store i32 %80, i32* %4
%81 = load i32, i32* %9
%82 = sdiv i32 %81, 31
store i32 %82, i32* %3
%83 = load i32, i32* %5
%84 = load i32, i32* %4
%85 = load i32, i32* %3
%86 = load i32, i32* %5
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0), i32 %83, i32 %84, i32 %85, i32 %86)
ret i32 0
}

LLVM IR (-O2):
@.str = [59 x i8] c"\0A\0A\09\09Bitte geben Sie ein Jahr ein (Beispiel: 2017):\0A\0A\09\09--> \00"
@.str.1 = [4 x i8] c"%4d\00"
@.str.2 = [33 x i8] c"\0A\09\09Ist \22%4d\22 ein Schaltjahr? %s\0A\00"
@.str.3 = [25 x i8] c"Computer sagt: \22Nein...\22\00"
@.str.4 = [23 x i8] c"Computer sagt: \22Ja...\22\00"
@.str.5 = [69 x i8] c"\0A\09\09Ostersonntag faellt im Jahr \22%4d\22 auf das Tagesdatum: %0d.%0d.%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 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), i32* %1)
%5 = load i32, i32* %1
%6 = srem i32 %5, 4
%7 = add nsw i32 %6, 1
%8 = add nsw i32 %6, 2
%9 = icmp ult i32 %8, 3
%10 = select i1 %9, i32 %7, i32 0
%11 = srem i32 %5, 100
%12 = xor i32 %11, -1
%13 = add nsw i32 %11, 2
%14 = icmp ult i32 %13, 3
%15 = select i1 %14, i32 %12, i32 0
%16 = add nsw i32 %15, %10
%17 = srem i32 %5, 400
%18 = xor i32 %17, -1
%19 = add nsw i32 %17, 2
%20 = icmp ult i32 %19, 3
%21 = select i1 %20, i32 %18, i32 0
%22 = icmp eq i32 %16, %21
%23 = select i1 %22, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.2, i64 0, i64 0), i32 %5, i8* %23)
%25 = load i32, i32* %1
%26 = sdiv i32 %25, 100
%27 = sdiv i32 %25, -400
%28 = add nsw i32 %27, %26
%29 = add nsw i32 %28, 15
%30 = shl nsw i32 %26, 3
%31 = add nsw i32 %30, 13
%32 = sdiv i32 %31, -25
%33 = srem i32 %25, 19
%34 = mul nsw i32 %33, 19
%35 = add nsw i32 %29, %34
%36 = add nsw i32 %35, %32
%37 = srem i32 %36, 30
%38 = trunc i32 %33 to i8
%39 = sdiv i8 %38, 11
%40 = trunc i32 %37 to i8
%41 = add nsw i8 %39, %40
%42 = sdiv i8 %41, -29
%43 = sext i8 %42 to i32
%44 = add nsw i32 %37, 120
%45 = add nsw i32 %44, %43
%46 = sdiv i32 %25, 4
%47 = add i32 %25, 1
%48 = add i32 %47, %46
%49 = sub i32 %48, %28
%50 = add i32 %49, %45
%51 = srem i32 %50, 7
%52 = sub nsw i32 %45, %51
%53 = trunc i32 %52 to i8
%54 = urem i8 %53, 31
%55 = add nuw nsw i8 %54, 1
%56 = zext i8 %55 to i32
%57 = udiv i8 %53, 31
%58 = zext i8 %57 to i32
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.5, i64 0, i64 0), i32 %25, i32 %56, i32 %58, i32 %25)
ret i32 0
}