int get_time(unsigned char *p, int *year, int *month, int *day, int *hour,
             int *minute, int *second) {
  *year = (p[0] << 8) | p[1];
  p += 2;
  *month = (int)*p++;
  *day = (int)*p++;
  *hour = (int)*p++;
  *minute = (int)*p++;
  *second = (int)*p;
  return 0;
}


x86 assembly (clang, -O0):
<get_time>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%rax
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    -0x8(%rbp),%rax
movzbl (%rax),%ecx
shl    $0x8,%ecx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
or     %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%ecx
mov    -0x28(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%ecx
mov    -0x30(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
movzbl (%rax),%ecx
mov    0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time>:
mov    0x8(%rsp),%r10
movzwl (%rdi),%eax
shl    $0x10,%eax
bswap  %eax
mov    %eax,(%rsi)
movzbl 0x2(%rdi),%eax
mov    %eax,(%rdx)
movzbl 0x3(%rdi),%eax
mov    %eax,(%rcx)
movzbl 0x4(%rdi),%eax
mov    %eax,(%r8)
movzbl 0x5(%rdi),%eax
mov    %eax,(%r9)
movzbl 0x6(%rdi),%eax
mov    %eax,(%r10)
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @get_time(i8* %0, i32* %1, i32* %2, i32* %3, i32* %4, i32* %5, i32* %6) {
%8 = alloca i8*
%9 = alloca i32*
%10 = alloca i32*
%11 = alloca i32*
%12 = alloca i32*
%13 = alloca i32*
%14 = alloca i32*
store i8* %0, i8** %8
store i32* %1, i32** %9
store i32* %2, i32** %10
store i32* %3, i32** %11
store i32* %4, i32** %12
store i32* %5, i32** %13
store i32* %6, i32** %14
%15 = load i8*, i8** %8
%16 = getelementptr inbounds i8, i8* %15, i64 0
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = shl i32 %18, 8
%20 = load i8*, i8** %8
%21 = getelementptr inbounds i8, i8* %20, i64 1
%22 = load i8, i8* %21
%23 = zext i8 %22 to i32
%24 = or i32 %19, %23
%25 = load i32*, i32** %9
store i32 %24, i32* %25
%26 = load i8*, i8** %8
%27 = getelementptr inbounds i8, i8* %26, i64 2
store i8* %27, i8** %8
%28 = load i8*, i8** %8
%29 = getelementptr inbounds i8, i8* %28, i32 1
store i8* %29, i8** %8
%30 = load i8, i8* %28
%31 = zext i8 %30 to i32
%32 = load i32*, i32** %10
store i32 %31, i32* %32
%33 = load i8*, i8** %8
%34 = getelementptr inbounds i8, i8* %33, i32 1
store i8* %34, i8** %8
%35 = load i8, i8* %33
%36 = zext i8 %35 to i32
%37 = load i32*, i32** %11
store i32 %36, i32* %37
%38 = load i8*, i8** %8
%39 = getelementptr inbounds i8, i8* %38, i32 1
store i8* %39, i8** %8
%40 = load i8, i8* %38
%41 = zext i8 %40 to i32
%42 = load i32*, i32** %12
store i32 %41, i32* %42
%43 = load i8*, i8** %8
%44 = getelementptr inbounds i8, i8* %43, i32 1
store i8* %44, i8** %8
%45 = load i8, i8* %43
%46 = zext i8 %45 to i32
%47 = load i32*, i32** %13
store i32 %46, i32* %47
%48 = load i8*, i8** %8
%49 = load i8, i8* %48
%50 = zext i8 %49 to i32
%51 = load i32*, i32** %14
store i32 %50, i32* %51
ret i32 0
}

LLVM IR (-O2):
define i32 @get_time(i8* nocapture %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3, i32* nocapture writeonly %4, i32* nocapture writeonly %5, i32* nocapture writeonly %6) {
%8 = load i8, i8* %0
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 8
%11 = getelementptr inbounds i8, i8* %0, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
store i32 %14, i32* %1
%15 = getelementptr inbounds i8, i8* %0, i64 2
%16 = getelementptr inbounds i8, i8* %0, i64 3
%17 = load i8, i8* %15
%18 = zext i8 %17 to i32
store i32 %18, i32* %2
%19 = getelementptr inbounds i8, i8* %0, i64 4
%20 = load i8, i8* %16
%21 = zext i8 %20 to i32
store i32 %21, i32* %3
%22 = getelementptr inbounds i8, i8* %0, i64 5
%23 = load i8, i8* %19
%24 = zext i8 %23 to i32
store i32 %24, i32* %4
%25 = getelementptr inbounds i8, i8* %0, i64 6
%26 = load i8, i8* %22
%27 = zext i8 %26 to i32
store i32 %27, i32* %5
%28 = load i8, i8* %25
%29 = zext i8 %28 to i32
store i32 %29, i32* %6
ret i32 0
}