#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 int32_t;

/* Variables and functions */
void convert_time(int32_t *date, const unsigned char *buffer) {
  date[0] = (buffer[0] & 0b00111111);
  date[1] = ((buffer[0] & 0b11000000) >> 6) + ((buffer[1] & 0b00001111) << 2);
  date[2] = ((buffer[1] & 0b11110000) >> 4) + ((buffer[2] & 0b00000001) << 4);
  date[3] = ((buffer[2] & 0b00111110) >> 1);
  date[4] = ((buffer[2] & 0b11000000) >> 6) + ((buffer[3] & 0b00000011) << 2);
  date[5] = 2000 + ((buffer[3] & 0b11111100) >> 2);
}


x86 assembly (clang, -O0):
<convert_time>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
and    $0x3f,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movzbl (%rax),%ecx
and    $0xc0,%ecx
sar    $0x6,%ecx
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0xf,%eax
shl    $0x2,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%ecx
and    $0xf0,%ecx
sar    $0x4,%ecx
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
and    $0x1,%eax
shl    $0x4,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%ecx
and    $0x3e,%ecx
sar    $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0xc(%rax)
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%ecx
and    $0xc0,%ecx
sar    $0x6,%ecx
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
and    $0x3,%eax
shl    $0x2,%eax
add    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%ecx
and    $0xfc,%ecx
sar    $0x2,%ecx
add    $0x7d0,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x14(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_time>:
movzbl (%rsi),%eax
and    $0x3f,%eax
mov    %eax,(%rdi)
movzbl (%rsi),%eax
shr    $0x6,%eax
movzbl 0x1(%rsi),%ecx
and    $0xf,%ecx
lea    (%rax,%rcx,4),%eax
mov    %eax,0x4(%rdi)
movzbl 0x1(%rsi),%eax
shr    $0x4,%eax
movzbl 0x2(%rsi),%ecx
shl    $0x4,%ecx
and    $0x10,%ecx
or     %eax,%ecx
mov    %ecx,0x8(%rdi)
movzbl 0x2(%rsi),%eax
shr    %eax
and    $0x1f,%eax
mov    %eax,0xc(%rdi)
movzbl 0x2(%rsi),%eax
shr    $0x6,%eax
movzbl 0x3(%rsi),%ecx
and    $0x3,%ecx
lea    (%rax,%rcx,4),%eax
mov    %eax,0x10(%rdi)
movzbl 0x3(%rsi),%eax
shr    $0x2,%eax
add    $0x7d0,%eax
mov    %eax,0x14(%rdi)
ret

LLVM IR (-O0):
define void @convert_time(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = and i32 %8, 63
%10 = load i32*, i32** %3
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i8*, i8** %4
%13 = getelementptr inbounds i8, i8* %12, i64 0
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = and i32 %15, 192
%17 = ashr i32 %16, 6
%18 = load i8*, i8** %4
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = and i32 %21, 15
%23 = shl i32 %22, 2
%24 = add nsw i32 %17, %23
%25 = load i32*, i32** %3
%26 = getelementptr inbounds i32, i32* %25, i64 1
store i32 %24, i32* %26
%27 = load i8*, i8** %4
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = zext i8 %29 to i32
%31 = and i32 %30, 240
%32 = ashr i32 %31, 4
%33 = load i8*, i8** %4
%34 = getelementptr inbounds i8, i8* %33, i64 2
%35 = load i8, i8* %34
%36 = zext i8 %35 to i32
%37 = and i32 %36, 1
%38 = shl i32 %37, 4
%39 = add nsw i32 %32, %38
%40 = load i32*, i32** %3
%41 = getelementptr inbounds i32, i32* %40, i64 2
store i32 %39, i32* %41
%42 = load i8*, i8** %4
%43 = getelementptr inbounds i8, i8* %42, i64 2
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = and i32 %45, 62
%47 = ashr i32 %46, 1
%48 = load i32*, i32** %3
%49 = getelementptr inbounds i32, i32* %48, i64 3
store i32 %47, i32* %49
%50 = load i8*, i8** %4
%51 = getelementptr inbounds i8, i8* %50, i64 2
%52 = load i8, i8* %51
%53 = zext i8 %52 to i32
%54 = and i32 %53, 192
%55 = ashr i32 %54, 6
%56 = load i8*, i8** %4
%57 = getelementptr inbounds i8, i8* %56, i64 3
%58 = load i8, i8* %57
%59 = zext i8 %58 to i32
%60 = and i32 %59, 3
%61 = shl i32 %60, 2
%62 = add nsw i32 %55, %61
%63 = load i32*, i32** %3
%64 = getelementptr inbounds i32, i32* %63, i64 4
store i32 %62, i32* %64
%65 = load i8*, i8** %4
%66 = getelementptr inbounds i8, i8* %65, i64 3
%67 = load i8, i8* %66
%68 = zext i8 %67 to i32
%69 = and i32 %68, 252
%70 = ashr i32 %69, 2
%71 = add nsw i32 2000, %70
%72 = load i32*, i32** %3
%73 = getelementptr inbounds i32, i32* %72, i64 5
store i32 %71, i32* %73
ret void
}

LLVM IR (-O2):
define void @convert_time(i32* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = and i8 %3, 63
%5 = zext i8 %4 to i32
store i32 %5, i32* %0
%6 = load i8, i8* %1
%7 = lshr i8 %6, 6
%8 = getelementptr inbounds i8, i8* %1, i64 1
%9 = load i8, i8* %8
%10 = shl i8 %9, 2
%11 = and i8 %10, 60
%12 = or i8 %11, %7
%13 = zext i8 %12 to i32
%14 = getelementptr inbounds i32, i32* %0, i64 1
store i32 %13, i32* %14
%15 = load i8, i8* %8
%16 = lshr i8 %15, 4
%17 = getelementptr inbounds i8, i8* %1, i64 2
%18 = load i8, i8* %17
%19 = shl i8 %18, 4
%20 = and i8 %19, 16
%21 = or i8 %20, %16
%22 = zext i8 %21 to i32
%23 = getelementptr inbounds i32, i32* %0, i64 2
store i32 %22, i32* %23
%24 = load i8, i8* %17
%25 = lshr i8 %24, 1
%26 = and i8 %25, 31
%27 = zext i8 %26 to i32
%28 = getelementptr inbounds i32, i32* %0, i64 3
store i32 %27, i32* %28
%29 = load i8, i8* %17
%30 = lshr i8 %29, 6
%31 = getelementptr inbounds i8, i8* %1, i64 3
%32 = load i8, i8* %31
%33 = shl i8 %32, 2
%34 = and i8 %33, 12
%35 = or i8 %34, %30
%36 = zext i8 %35 to i32
%37 = getelementptr inbounds i32, i32* %0, i64 4
store i32 %36, i32* %37
%38 = load i8, i8* %31
%39 = lshr i8 %38, 2
%40 = zext i8 %39 to i32
%41 = add nuw nsw i32 %40, 2000
%42 = getelementptr inbounds i32, i32* %0, i64 5
store i32 %41, i32* %42
ret void
}