#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 main() {
  int y = 2020;
  int m = 2;
  int d = 1;
  int w;
  printf("%d/%d/%d is ", y, m, d);
  if (m == 1 || m == 2) {
    y--;
    m += 12;
  }
  w = y + (y / 4) - (y / 100) + (y / 400) + (((13 * m) + 8) / 5) + d;
  w %= 7;
  switch (w) {
  case 0:
    printf("Sunday");
    break;
  case 1:
    printf("Monday");
    break;
  case 2:
    printf("Tuesday");
    break;
  case 3:
    printf("Wednesday");
    break;
  case 4:
    printf("Thursday");
    break;
  case 5:
    printf("Friday");
    break;
  case 6:
    printf("Saturday");
    break;
  }
  printf(".\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x7e4,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0xc(%rbp)
je     115f <main+0x4f>
cmpl   $0x2,-0xc(%rbp)
jne    1171 <main+0x61>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xc,%eax
mov    %eax,-0xc(%rbp)
movslq -0x8(%rbp),%rcx
mov    %ecx,%eax
mov    %eax,%esi
add    $0x3,%esi
test   %eax,%eax
mov    %eax,%edx
cmovs  %esi,%edx
sar    $0x2,%edx
add    %edx,%eax
imul   $0x51eb851f,%rcx,%rdx
mov    %rdx,%rcx
shr    $0x20,%rcx
mov    %ecx,%esi
sar    $0x5,%esi
shr    $0x3f,%rdx
add    %edx,%esi
sub    %esi,%eax
sar    $0x7,%ecx
add    %edx,%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%edx
mov    %edx,%ecx
lea    (%rcx,%rcx,2),%esi
mov    %esi,%edx
lea    0x8(%rcx,%rdx,4),%ecx
movslq %ecx,%rcx
imul   $0x66666667,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    %ecx
add    %edx,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rcx
mov    %ecx,%eax
imul   $0xffffffff92492493,%rcx,%rcx
shr    $0x20,%rcx
add    %eax,%ecx
mov    %ecx,%edx
shr    $0x1f,%edx
sar    $0x2,%ecx
add    %edx,%ecx
mov    %ecx,%edx
shl    $0x3,%edx
sub    %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %rax,-0x20(%rbp)
sub    $0x6,%rax
ja     12a9 <main+0x199>
mov    -0x20(%rbp),%rax
lea    0xde0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xded(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xde1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xdd6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xdcd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12a9 <main+0x199>
lea    0xdb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
mov    $0x7e4,%esi
mov    $0x2,%edx
mov    $0x1,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec8(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"%d/%d/%d is \00"
@.str.1 = [7 x i8] c"Sunday\00"
@.str.2 = [7 x i8] c"Monday\00"
@.str.3 = [8 x i8] c"Tuesday\00"
@.str.4 = [10 x i8] c"Wednesday\00"
@.str.5 = [9 x i8] c"Thursday\00"
@.str.6 = [7 x i8] c"Friday\00"
@.str.7 = [9 x i8] c"Saturday\00"
@.str.8 = [3 x i8] c".\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store i32 2020, i32* %2
store i32 2, i32* %3
store i32 1, i32* %4
%6 = load i32, i32* %2
%7 = load i32, i32* %3
%8 = load i32, i32* %4
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %7, i32 %8)
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 1
br i1 %11, label %15, label %12
12: ; preds = %0
%13 = load i32, i32* %3
%14 = icmp eq i32 %13, 2
br i1 %14, label %15, label %20
15: ; preds = %12, %0
%16 = load i32, i32* %2
%17 = add nsw i32 %16, -1
store i32 %17, i32* %2
%18 = load i32, i32* %3
%19 = add nsw i32 %18, 12
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %12
%21 = load i32, i32* %2
%22 = load i32, i32* %2
%23 = sdiv i32 %22, 4
%24 = add nsw i32 %21, %23
%25 = load i32, i32* %2
%26 = sdiv i32 %25, 100
%27 = sub nsw i32 %24, %26
%28 = load i32, i32* %2
%29 = sdiv i32 %28, 400
%30 = add nsw i32 %27, %29
%31 = load i32, i32* %3
%32 = mul nsw i32 13, %31
%33 = add nsw i32 %32, 8
%34 = sdiv i32 %33, 5
%35 = add nsw i32 %30, %34
%36 = load i32, i32* %4
%37 = add nsw i32 %35, %36
store i32 %37, i32* %5
%38 = load i32, i32* %5
%39 = srem i32 %38, 7
store i32 %39, i32* %5
%40 = load i32, i32* %5
switch i32 %40, label %55 [
i32 0, label %41
i32 1, label %43
i32 2, label %45
i32 3, label %47
i32 4, label %49
i32 5, label %51
i32 6, label %53
]
41: ; preds = %20
%42 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %55
43: ; preds = %20
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0))
br label %55
45: ; preds = %20
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
br label %55
47: ; preds = %20
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %55
49: ; preds = %20
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %55
51: ; preds = %20
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
br label %55
53: ; preds = %20
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
br label %55
55: ; preds = %20, %53, %51, %49, %47, %45, %43, %41
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"%d/%d/%d is \00"
@.str.7 = [9 x i8] c"Saturday\00"
@str = [2 x i8] c".\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 2020, i32 2, i32 1)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret i32 0
}