unsigned int rtcGetDateTime(unsigned int *year, unsigned int *month,
                            unsigned int *day, unsigned int *hour,
                            unsigned int *minute, unsigned int *second) {
  while ((*((volatile unsigned int *const)((0x40010000 + 0) + 0x48))))
    ;
  ;
  unsigned int tim0 = (*((volatile unsigned int *const)(0x40010a00 + 0x20)));
  unsigned int tim1 = (*((volatile unsigned int *const)(0x40010a00 + 0x24)));
  *year = tim1 >> 16;
  *month = (tim1 >> 8) & 0x0f;
  *day = (tim0 >> 24) & 0x1f;
  *hour = (tim0 >> 16) & 0x1f;
  *minute = (tim0 >> 8) & 0x3f;
  *second = tim0 & 0x3f;
  return 0;
}


x86 assembly (clang, -O0):
<rtcGetDateTime>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    $0x40010048,%eax
mov    (%rax),%eax
cmp    $0x0,%eax
je     1131 <rtcGetDateTime+0x31>
jmp    111c <rtcGetDateTime+0x1c>
mov    $0x40010a20,%eax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    $0x40010a24,%eax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%ecx
shr    $0x10,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x38(%rbp),%ecx
shr    $0x8,%ecx
and    $0xf,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
shr    $0x18,%ecx
and    $0x1f,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
shr    $0x10,%ecx
and    $0x1f,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
shr    $0x8,%ecx
and    $0x3f,%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x34(%rbp),%ecx
and    $0x3f,%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rtcGetDateTime>:
cmpl   $0x0,0x40010048
jne    1100 <rtcGetDateTime>
mov    0x40010a20,%r10d
40
mov    0x40010a24,%r11d
40
mov    %r11d,%eax
shr    $0x10,%eax
mov    %eax,(%rdi)
shr    $0x8,%r11d
and    $0xf,%r11d
mov    %r11d,(%rsi)
mov    %r10d,%eax
shr    $0x18,%eax
and    $0x1f,%eax
mov    %eax,(%rdx)
mov    %r10d,%eax
shr    $0x10,%eax
and    $0x1f,%eax
mov    %eax,(%rcx)
mov    %r10d,%eax
shr    $0x8,%eax
and    $0x3f,%eax
mov    %eax,(%r8)
and    $0x3f,%r10d
mov    %r10d,(%r9)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @rtcGetDateTime(i32* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5) {
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32
%14 = alloca i32
store i32* %0, i32** %7
store i32* %1, i32** %8
store i32* %2, i32** %9
store i32* %3, i32** %10
store i32* %4, i32** %11
store i32* %5, i32** %12
br label %15
15: ; preds = %18, %6
%16 = load volatile i32, i32* inttoptr (i64 1073807432 to i32*)
%17 = icmp ne i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15
br label %15
19: ; preds = %15
%20 = load volatile i32, i32* inttoptr (i64 1073809952 to i32*)
store i32 %20, i32* %13
%21 = load volatile i32, i32* inttoptr (i64 1073809956 to i32*)
store i32 %21, i32* %14
%22 = load i32, i32* %14
%23 = lshr i32 %22, 16
%24 = load i32*, i32** %7
store i32 %23, i32* %24
%25 = load i32, i32* %14
%26 = lshr i32 %25, 8
%27 = and i32 %26, 15
%28 = load i32*, i32** %8
store i32 %27, i32* %28
%29 = load i32, i32* %13
%30 = lshr i32 %29, 24
%31 = and i32 %30, 31
%32 = load i32*, i32** %9
store i32 %31, i32* %32
%33 = load i32, i32* %13
%34 = lshr i32 %33, 16
%35 = and i32 %34, 31
%36 = load i32*, i32** %10
store i32 %35, i32* %36
%37 = load i32, i32* %13
%38 = lshr i32 %37, 8
%39 = and i32 %38, 63
%40 = load i32*, i32** %11
store i32 %39, i32* %40
%41 = load i32, i32* %13
%42 = and i32 %41, 63
%43 = load i32*, i32** %12
store i32 %42, i32* %43
ret i32 0
}

LLVM IR (-O2):
define i32 @rtcGetDateTime(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5) {
br label %7
7: ; preds = %7, %6
%8 = load volatile i32, i32* inttoptr (i64 1073807432 to i32*)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %7
10: ; preds = %7
%11 = load volatile i32, i32* inttoptr (i64 1073809952 to i32*)
%12 = load volatile i32, i32* inttoptr (i64 1073809956 to i32*)
%13 = lshr i32 %12, 16
store i32 %13, i32* %0
%14 = lshr i32 %12, 8
%15 = and i32 %14, 15
store i32 %15, i32* %1
%16 = lshr i32 %11, 24
%17 = and i32 %16, 31
store i32 %17, i32* %2
%18 = lshr i32 %11, 16
%19 = and i32 %18, 31
store i32 %19, i32* %3
%20 = lshr i32 %11, 8
%21 = and i32 %20, 63
store i32 %21, i32* %4
%22 = and i32 %11, 63
store i32 %22, i32* %5
ret i32 0
}