int main() {
  int weekCount = -1;
  char weekDays[7][12] = {"Sunday",   "Monday", "Tuesday", "Wednesday",
                          "Thursday", "Friday", "Saturday"};
  while (weekCount++ < 6) {
    printf("%s\n", weekDays[weekCount]);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
lea    -0x60(%rbp),%rdi
lea    0xebf(%rip),%rsi
mov    $0x54,%edx
call   1040 <memcpy@plt>
mov    -0x8(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0x8(%rbp)
cmp    $0x6,%eax
jge    1181 <main+0x61>
movslq -0x8(%rbp),%rax
lea    -0x60(%rbp),%rsi
imul   $0xc,%rax,%rax
add    %rax,%rsi
lea    0xedf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114b <main+0x2b>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x60,%rsp
mov    0xf35(%rip),%eax
mov    %eax,0x50(%rsp)
movaps 0xf1a(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xefe(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xee2(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xec6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xeaa(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0x30(%rsp),%rbx
mov    %rsp,%rdi
call   1030 <puts@plt>
lea    0xc(%rsp),%rdi
call   1030 <puts@plt>
lea    0x18(%rsp),%rdi
call   1030 <puts@plt>
lea    0x24(%rsp),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1030 <puts@plt>
lea    0x3c(%rsp),%rdi
call   1030 <puts@plt>
lea    0x48(%rsp),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.weekDays = [7 x [12 x i8]] [[12 x i8] c"Sunday\00\00\00\00\00\00", [12 x i8] c"Monday\00\00\00\00\00\00", [12 x i8] c"Tuesday\00\00\00\00\00", [12 x i8] c"Wednesday\00\00\00", [12 x i8] c"Thursday\00\00\00\00", [12 x i8] c"Friday\00\00\00\00\00\00", [12 x i8] c"Saturday\00\00\00\00"]
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [7 x [12 x i8]]
store i32 0, i32* %1
store i32 -1, i32* %2
%4 = bitcast [7 x [12 x i8]]* %3 to i8*
br label %5
5: ; preds = %9, %0
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 1
store i32 %7, i32* %2
%8 = icmp slt i32 %6, 6
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i32, i32* %2
%11 = sext i32 %10 to i64
%12 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %3, i64 0, i64 %11
%13 = getelementptr inbounds [12 x i8], [12 x i8]* %12, i64 0, i64 0
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %5
15: ; preds = %5
ret i32 0
}

LLVM IR (-O2):
@__const.main.weekDays = [7 x [12 x i8]] [[12 x i8] c"Sunday\00\00\00\00\00\00", [12 x i8] c"Monday\00\00\00\00\00\00", [12 x i8] c"Tuesday\00\00\00\00\00", [12 x i8] c"Wednesday\00\00\00", [12 x i8] c"Thursday\00\00\00\00", [12 x i8] c"Friday\00\00\00\00\00\00", [12 x i8] c"Saturday\00\00\00\00"]
define i32 @main() {
%1 = alloca [7 x [12 x i8]]
%2 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %1, i64 0, i64 0, i64 0
%3 = call i32 @puts(i8* %2)
%4 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %1, i64 0, i64 1, i64 0
%5 = call i32 @puts(i8* %4)
%6 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %1, i64 0, i64 2, i64 0
%7 = call i32 @puts(i8* %6)
%8 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %1, i64 0, i64 3, i64 0
%9 = call i32 @puts(i8* %8)
%10 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %1, i64 0, i64 4, i64 0
%11 = call i32 @puts(i8* %10)
%12 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %1, i64 0, i64 5, i64 0
%13 = call i32 @puts(i8* %12)
%14 = getelementptr inbounds [7 x [12 x i8]], [7 x [12 x i8]]* %1, i64 0, i64 6, i64 0
%15 = call i32 @puts(i8* %14)
ret i32 0
}