#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 dayOfWeek(int, int /*<<< orphan*/, int);
int dstEndDayOfYear(int);
int dstStartDayOfYear(int);
int /*<<< orphan*/ printf(char *, ...);
void printSpreadsheet(void) {
  printf("Year\tDOW 1 Jan\tDST Start\tDST End\n");
  for (int i = 0; i < 100; i++) {
    printf("%.2d\t%d\t%d\t%d\n", i, dayOfWeek(1, 0, 2000 + i),
           dstStartDayOfYear(2000 + i), dstEndDayOfYear(2000 + i));
  }
}


x86 assembly (clang, -O0):
<printSpreadsheet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xeb1(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    11cc <printSpreadsheet+0x8c>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%edx
add    $0x7d0,%edx
mov    $0x1,%edi
xor    %esi,%esi
call   1050 <dayOfWeek@plt>
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
add    $0x7d0,%edi
call   1030 <dstStartDayOfYear@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%edi
add    $0x7d0,%edi
call   1040 <dstEndDayOfYear@plt>
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    %eax,%r8d
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    115d <printSpreadsheet+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printSpreadsheet>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
lea    0xeb0(%rip),%rdi
call   1030 <puts@plt>
lea    0xe95(%rip),%r14
xor    %ebx,%ebx
nopl   (%rax)
lea    0x7d0(%rbx),%ebp
mov    $0x1,%edi
xor    %esi,%esi
mov    %ebp,%edx
call   1060 <dayOfWeek@plt>
mov    %eax,%r15d
mov    %ebp,%edi
call   1040 <dstStartDayOfYear@plt>
mov    %eax,%r12d
mov    %ebp,%edi
call   1050 <dstEndDayOfYear@plt>
mov    %r14,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r12d,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1070 <printf@plt>
add    $0x1,%ebx
cmp    $0x64,%ebx
jne    1170 <printSpreadsheet+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"Year\09DOW 1 Jan\09DST Start\09DST End\0A\00"
@.str.1 = [15 x i8] c"%.2d\09%d\09%d\09%d\0A\00"
define void @printSpreadsheet() {
%1 = alloca i32
%2 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %1
br label %3
3: ; preds = %18, %0
%4 = load i32, i32* %1
%5 = icmp slt i32 %4, 100
br i1 %5, label %6, label %21
6: ; preds = %3
%7 = load i32, i32* %1
%8 = load i32, i32* %1
%9 = add nsw i32 2000, %8
%10 = call i32 @dayOfWeek(i32 1, i32 0, i32 %9)
%11 = load i32, i32* %1
%12 = add nsw i32 2000, %11
%13 = call i32 @dstStartDayOfYear(i32 %12)
%14 = load i32, i32* %1
%15 = add nsw i32 2000, %14
%16 = call i32 @dstEndDayOfYear(i32 %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %7, i32 %10, i32 %13, i32 %16)
br label %18
18: ; preds = %6
%19 = load i32, i32* %1
%20 = add nsw i32 %19, 1
store i32 %20, i32* %1
br label %3
21: ; preds = %3
ret void
}

LLVM IR (-O2):
@.str.1 = [15 x i8] c"%.2d\09%d\09%d\09%d\0A\00"
@str = [33 x i8] c"Year\09DOW 1 Jan\09DST Start\09DST End\00"
define void @printSpreadsheet() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
br label %3
2: ; preds = %3
ret void
3: ; preds = %0, %3
%4 = phi i32 [ 0, %0 ], [ %10, %3 ]
%5 = add nuw nsw i32 %4, 2000
%6 = tail call i32 @dayOfWeek(i32 1, i32 0, i32 %5)
%7 = tail call i32 @dstStartDayOfYear(i32 %5)
%8 = tail call i32 @dstEndDayOfYear(i32 %5)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), i32 %4, i32 %6, i32 %7, i32 %8)
%10 = add nuw nsw i32 %4, 1
%11 = icmp eq i32 %10, 100
br i1 %11, label %2, label %3
}