#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 */
typedef int dstStartYear2;
typedef int dstStartYear1;
typedef int dstEndYear2;
typedef int dstEndYear1;

/* Variables and functions */
int dstEndDayOfYear(int);
int dstStartDayOfYear(int);
int /*<<< orphan*/ printf(char *, ...);
void printAssembler(void) {
  printf("\tradix decimal\n");
  printf("\n");
  printf("Clock code\n");
  printf("\tglobal daylightSavingsTimeLookupTable\n");
  printf("\n");
  printf("daylightSavingsTimeLookupTable:\n");
  for (int i = 0; i < 100; i += 2) {
    int year1 = 2000 + i, year2 = 2000 + i + 1;
    int dstStartYear1 = dstStartDayOfYear(year1);
    int dstEndYear1 = dstEndDayOfYear(year1);
    unsigned char dstYear1 =
        ((unsigned char)((((dstStartYear1)-83) & 0x07) << 4) |
         (((dstEndYear1)-296) & 0x07));
    int dstStartYear2 = dstStartDayOfYear(year2);
    int dstEndYear2 = dstEndDayOfYear(year2);
    unsigned char dstYear2 =
        ((unsigned char)((((dstStartYear2)-83) & 0x07) << 4) |
         (((dstEndYear2)-296) & 0x07));
    printf("\tdw 0x%.4x ; %d = %d -> %d, %d = %d -> %d\n",
           (((unsigned int)dstYear1) << 7) | ((unsigned int)dstYear2), year1,
           dstStartYear1, dstEndYear1, year2, dstStartYear2, dstEndYear2);
  }
  printf("\n\tend\n");
}


x86 assembly (clang, -O0):
<printAssembler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xf16(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb5(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeb3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
cmpl   $0x64,-0x4(%rbp)
jge    1268 <printAssembler+0x138>
mov    -0x4(%rbp),%eax
add    $0x7d0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    $0x7d0,%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <dstStartDayOfYear@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <dstEndDayOfYear@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sub    $0x53,%eax
and    $0x7,%eax
shl    $0x4,%eax
movzbl %al,%eax
mov    -0x14(%rbp),%ecx
sub    $0x128,%ecx
and    $0x7,%ecx
or     %ecx,%eax
mov    %al,-0x15(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <dstStartDayOfYear@plt>
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
call   1040 <dstEndDayOfYear@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
sub    $0x53,%eax
and    $0x7,%eax
shl    $0x4,%eax
movzbl %al,%eax
mov    -0x20(%rbp),%ecx
sub    $0x128,%ecx
and    $0x7,%ecx
or     %ecx,%eax
mov    %al,-0x21(%rbp)
movzbl -0x15(%rbp),%esi
shl    $0x7,%esi
movzbl -0x21(%rbp),%eax
or     %eax,%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0xc(%rbp),%r9d
mov    -0x1c(%rbp),%r10d
mov    -0x20(%rbp),%eax
lea    0xe1a(%rip),%rdi
mov    %r10d,(%rsp)
mov    %eax,0x8(%rsp)
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x4(%rbp)
jmp    1193 <printAssembler+0x63>
lea    0xe21(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printAssembler>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xec9(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xec2(%rip),%rdi
call   1040 <puts@plt>
lea    0xec1(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xed2(%rip),%rdi
call   1040 <puts@plt>
mov    $0xfffffffe,%r14d
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x7d2(%r14),%ebx
lea    0x7d3(%r14),%r15d
mov    %ebx,%edi
call   1050 <dstStartDayOfYear@plt>
mov    %eax,%ebp
mov    %eax,0x4(%rsp)
mov    %ebx,%edi
call   1060 <dstEndDayOfYear@plt>
mov    %eax,%r12d
mov    %eax,(%rsp)
shl    $0x4,%ebp
add    $0x50,%ebp
and    $0x70,%ebp
and    $0x7,%r12d
or     %ebp,%r12d
mov    %r15d,%edi
call   1050 <dstStartDayOfYear@plt>
mov    %eax,%r13d
mov    %r15d,%edi
call   1060 <dstEndDayOfYear@plt>
mov    %eax,%ebp
mov    %r13d,%eax
shl    $0x4,%eax
add    $0x50,%eax
and    $0x70,%eax
mov    %ebp,%ecx
and    $0x7,%ecx
or     %eax,%ecx
shl    $0x7,%r12d
or     %ecx,%r12d
lea    0xde2(%rip),%rdi
mov    %r12d,%esi
mov    %ebx,%edx
mov    0x4(%rsp),%ecx
mov    (%rsp),%r8d
mov    %r15d,%r9d
xor    %eax,%eax
push   %rbp
push   %r13
call   1070 <printf@plt>
add    $0x10,%rsp
add    $0x2,%r14d
cmp    $0x62,%r14d
jb     11b0 <printAssembler+0x60>
lea    0xe3b(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [16 x i8] c"\09radix decimal\0A\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [12 x i8] c"Clock code\0A\00"
@.str.3 = [40 x i8] c"\09global daylightSavingsTimeLookupTable\0A\00"
@.str.4 = [33 x i8] c"daylightSavingsTimeLookupTable:\0A\00"
@.str.5 = [43 x i8] c"\09dw 0x%.4x ; %d = %d -> %d, %d = %d -> %d\0A\00"
@.str.6 = [7 x i8] c"\0A\09end\0A\00"
define void @printAssembler() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %1
br label %16
16: ; preds = %68, %0
%17 = load i32, i32* %1
%18 = icmp slt i32 %17, 100
br i1 %18, label %19, label %71
19: ; preds = %16
%20 = load i32, i32* %1
%21 = add nsw i32 2000, %20
store i32 %21, i32* %2
%22 = load i32, i32* %1
%23 = add nsw i32 2000, %22
%24 = add nsw i32 %23, 1
store i32 %24, i32* %3
%25 = load i32, i32* %2
%26 = call i32 @dstStartDayOfYear(i32 %25)
store i32 %26, i32* %4
%27 = load i32, i32* %2
%28 = call i32 @dstEndDayOfYear(i32 %27)
store i32 %28, i32* %5
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 83
%31 = and i32 %30, 7
%32 = shl i32 %31, 4
%33 = trunc i32 %32 to i8
%34 = zext i8 %33 to i32
%35 = load i32, i32* %5
%36 = sub nsw i32 %35, 296
%37 = and i32 %36, 7
%38 = or i32 %34, %37
%39 = trunc i32 %38 to i8
store i8 %39, i8* %6
%40 = load i32, i32* %3
%41 = call i32 @dstStartDayOfYear(i32 %40)
store i32 %41, i32* %7
%42 = load i32, i32* %3
%43 = call i32 @dstEndDayOfYear(i32 %42)
store i32 %43, i32* %8
%44 = load i32, i32* %7
%45 = sub nsw i32 %44, 83
%46 = and i32 %45, 7
%47 = shl i32 %46, 4
%48 = trunc i32 %47 to i8
%49 = zext i8 %48 to i32
%50 = load i32, i32* %8
%51 = sub nsw i32 %50, 296
%52 = and i32 %51, 7
%53 = or i32 %49, %52
%54 = trunc i32 %53 to i8
store i8 %54, i8* %9
%55 = load i8, i8* %6
%56 = zext i8 %55 to i32
%57 = shl i32 %56, 7
%58 = load i8, i8* %9
%59 = zext i8 %58 to i32
%60 = or i32 %57, %59
%61 = load i32, i32* %2
%62 = load i32, i32* %4
%63 = load i32, i32* %5
%64 = load i32, i32* %3
%65 = load i32, i32* %7
%66 = load i32, i32* %8
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %60, i32 %61, i32 %62, i32 %63, i32 %64, i32 %65, i32 %66)
br label %68
68: ; preds = %19
%69 = load i32, i32* %1
%70 = add nsw i32 %69, 2
store i32 %70, i32* %1
br label %16
71: ; preds = %16
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str.5 = [43 x i8] c"\09dw 0x%.4x ; %d = %d -> %d, %d = %d -> %d\0A\00"
@str = [15 x i8] c"\09radix decimal\00"
@str.7 = [11 x i8] c"Clock code\00"
@str.8 = [39 x i8] c"\09global daylightSavingsTimeLookupTable\00"
@str.9 = [32 x i8] c"daylightSavingsTimeLookupTable:\00"
@str.10 = [6 x i8] c"\0A\09end\00"
define void @printAssembler() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @putchar(i32 10)
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.7, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.8, i64 0, i64 0))
%5 = tail call i32 @putchar(i32 10)
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.9, i64 0, i64 0))
br label %9
7: ; preds = %9
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str.10, i64 0, i64 0))
ret void
9: ; preds = %0, %9
%10 = phi i32 [ 0, %0 ], [ %30, %9 ]
%11 = add nuw nsw i32 %10, 2000
%12 = add nuw nsw i32 %10, 2001
%13 = tail call i32 @dstStartDayOfYear(i32 %11)
%14 = tail call i32 @dstEndDayOfYear(i32 %11)
%15 = shl i32 %13, 4
%16 = add i32 %15, 80
%17 = and i32 %16, 112
%18 = and i32 %14, 7
%19 = or i32 %17, %18
%20 = tail call i32 @dstStartDayOfYear(i32 %12)
%21 = tail call i32 @dstEndDayOfYear(i32 %12)
%22 = shl i32 %20, 4
%23 = add i32 %22, 80
%24 = and i32 %23, 112
%25 = and i32 %21, 7
%26 = or i32 %25, %24
%27 = shl nuw nsw i32 %19, 7
%28 = or i32 %26, %27
%29 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.5, i64 0, i64 0), i32 %28, i32 %11, i32 %13, i32 %14, i32 %12, i32 %20, i32 %21)
%30 = add nuw nsw i32 %10, 2
%31 = icmp ult i32 %10, 98
br i1 %31, label %9, label %7
}