void Rtc_Init(void) {
  int wYear, wMonth, wDay, wDayOfWeek, wHour, wMinute, wSecond;
  wYear = 2008;
  wMonth = 8;
  wDay = 1;
  wDayOfWeek = 5;
  wHour = 0;
  wMinute = 0;
  wSecond = 0;
  (*((volatile unsigned long *)((0xE2800000) + 0x40))) = 1;
  (*((volatile unsigned long *)((0xE2800000) + 0x88))) = 13;
  (*((volatile unsigned long *)((0xE2800000) + 0x84))) =
      (unsigned char)((((wMonth) / 10) << 4) | ((wMonth) % 10));
  (*((volatile unsigned long *)((0xE2800000) + 0x80))) =
      (unsigned char)((((wDay) / 10) << 4) | ((wDay) % 10));
  (*((volatile unsigned long *)((0xE2800000) + 0x7c))) = wDayOfWeek + 1;
  (*((volatile unsigned long *)((0xE2800000) + 0x78))) =
      (unsigned char)((((wHour) / 10) << 4) | ((wHour) % 10));
  (*((volatile unsigned long *)((0xE2800000) + 0x74))) =
      (unsigned char)((((wMinute) / 10) << 4) | ((wMinute) % 10));
  (*((volatile unsigned long *)((0xE2800000) + 0x70))) =
      (unsigned char)((((wSecond) / 10) << 4) | ((wSecond) % 10));
  (*((volatile unsigned long *)((0xE2800000) + 0x40))) &= ~1;
}


x86 assembly (clang, -O0):
<Rtc_Init>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7d8,-0x4(%rbp)
movl   $0x8,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x5,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    $0xe2800040,%eax
movq   $0x1,(%rax)
mov    $0xe2800088,%eax
movq   $0xd,(%rax)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x30(%rbp),%eax
or     %edx,%eax
movzbl %al,%eax
mov    %eax,%ecx
mov    $0xe2800084,%eax
mov    %rcx,(%rax)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x2c(%rbp),%eax
or     %edx,%eax
movzbl %al,%eax
mov    %eax,%ecx
mov    $0xe2800080,%eax
mov    %rcx,(%rax)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
movslq %eax,%rcx
mov    $0xe280007c,%eax
mov    %rcx,(%rax)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x28(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x28(%rbp),%eax
or     %edx,%eax
movzbl %al,%eax
mov    %eax,%ecx
mov    $0xe2800078,%eax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x24(%rbp),%eax
or     %edx,%eax
movzbl %al,%eax
mov    %eax,%ecx
mov    $0xe2800074,%eax
mov    %rcx,(%rax)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
shl    $0x4,%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x20(%rbp),%eax
or     %edx,%eax
movzbl %al,%eax
mov    %eax,%ecx
mov    $0xe2800070,%eax
mov    %rcx,(%rax)
mov    $0xe2800040,%eax
mov    (%rax),%rcx
and    $0xfffffffffffffffe,%rcx
mov    $0xe2800040,%eax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rtc_Init>:
mov    $0xe2800040,%eax
movq   $0x1,(%rax)
movq   $0xd,0x48(%rax)
movq   $0x8,0x44(%rax)
movq   $0x1,0x40(%rax)
movq   $0x6,0x3c(%rax)
movq   $0x0,0x38(%rax)
movq   $0x0,0x34(%rax)
movq   $0x0,0x30(%rax)
andq   $0xfffffffffffffffe,(%rax)
ret

LLVM IR (-O0):
define void @Rtc_Init() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 2008, i32* %1
store i32 8, i32* %2
store i32 1, i32* %3
store i32 5, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store volatile i64 1, i64* inttoptr (i64 3800039488 to i64*)
store volatile i64 13, i64* inttoptr (i64 3800039560 to i64*)
%8 = load i32, i32* %2
%9 = sdiv i32 %8, 10
%10 = shl i32 %9, 4
%11 = load i32, i32* %2
%12 = srem i32 %11, 10
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
%15 = zext i8 %14 to i64
store volatile i64 %15, i64* inttoptr (i64 3800039556 to i64*)
%16 = load i32, i32* %3
%17 = sdiv i32 %16, 10
%18 = shl i32 %17, 4
%19 = load i32, i32* %3
%20 = srem i32 %19, 10
%21 = or i32 %18, %20
%22 = trunc i32 %21 to i8
%23 = zext i8 %22 to i64
store volatile i64 %23, i64* inttoptr (i64 3800039552 to i64*)
%24 = load i32, i32* %4
%25 = add nsw i32 %24, 1
%26 = sext i32 %25 to i64
store volatile i64 %26, i64* inttoptr (i64 3800039548 to i64*)
%27 = load i32, i32* %5
%28 = sdiv i32 %27, 10
%29 = shl i32 %28, 4
%30 = load i32, i32* %5
%31 = srem i32 %30, 10
%32 = or i32 %29, %31
%33 = trunc i32 %32 to i8
%34 = zext i8 %33 to i64
store volatile i64 %34, i64* inttoptr (i64 3800039544 to i64*)
%35 = load i32, i32* %6
%36 = sdiv i32 %35, 10
%37 = shl i32 %36, 4
%38 = load i32, i32* %6
%39 = srem i32 %38, 10
%40 = or i32 %37, %39
%41 = trunc i32 %40 to i8
%42 = zext i8 %41 to i64
store volatile i64 %42, i64* inttoptr (i64 3800039540 to i64*)
%43 = load i32, i32* %7
%44 = sdiv i32 %43, 10
%45 = shl i32 %44, 4
%46 = load i32, i32* %7
%47 = srem i32 %46, 10
%48 = or i32 %45, %47
%49 = trunc i32 %48 to i8
%50 = zext i8 %49 to i64
store volatile i64 %50, i64* inttoptr (i64 3800039536 to i64*)
%51 = load volatile i64, i64* inttoptr (i64 3800039488 to i64*)
%52 = and i64 %51, -2
store volatile i64 %52, i64* inttoptr (i64 3800039488 to i64*)
ret void
}

LLVM IR (-O2):
define void @Rtc_Init() {
store volatile i64 1, i64* inttoptr (i64 3800039488 to i64*)
store volatile i64 13, i64* inttoptr (i64 3800039560 to i64*)
store volatile i64 8, i64* inttoptr (i64 3800039556 to i64*)
store volatile i64 1, i64* inttoptr (i64 3800039552 to i64*)
store volatile i64 6, i64* inttoptr (i64 3800039548 to i64*)
store volatile i64 0, i64* inttoptr (i64 3800039544 to i64*)
store volatile i64 0, i64* inttoptr (i64 3800039540 to i64*)
store volatile i64 0, i64* inttoptr (i64 3800039536 to i64*)
%1 = load volatile i64, i64* inttoptr (i64 3800039488 to i64*)
%2 = and i64 %1, -2
store volatile i64 %2, i64* inttoptr (i64 3800039488 to i64*)
ret void
}