#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 */

/* Variables and functions */
double hmst2sec(unsigned char, unsigned char, unsigned char, unsigned char);
double short2sec(unsigned char pos[]) {
  unsigned char hours = pos[2] & 0x7f;
  unsigned char minutes = pos[1] & 0x3f;
  unsigned char seconds = pos[0] & 0x3f;
  unsigned char tenths = ((pos[1] & 0xc0) >> 4) | ((pos[0] & 0xc0) >> 6);
  return hmst2sec(hours, minutes, seconds, tenths);
}


x86 assembly (clang, -O0):
<short2sec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
and    $0x7f,%eax
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0x3f,%eax
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x3f,%eax
mov    %al,-0xb(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%eax
and    $0xc0,%eax
sar    $0x4,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
and    $0xc0,%ecx
sar    $0x6,%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x9(%rbp),%dl
mov    -0xa(%rbp),%cl
mov    -0xb(%rbp),%al
movzbl %dl,%edi
movzbl %cl,%esi
movzbl %al,%edx
movzbl -0xc(%rbp),%ecx
call   1030 <hmst2sec@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<short2sec>:
movzbl 0x2(%rdi),%r8d
movzbl 0x1(%rdi),%esi
movzbl (%rdi),%edx
mov    %esi,%ecx
shr    $0x4,%cl
and    $0xc,%cl
mov    %edx,%eax
shr    $0x6,%al
or     %cl,%al
movzbl %al,%ecx
and    $0x7f,%r8d
and    $0x3f,%esi
and    $0x3f,%edx
mov    %r8d,%edi
jmp    1030 <hmst2sec@plt>

LLVM IR (-O0):
define double @short2sec(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = getelementptr inbounds i8, i8* %7, i64 2
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, 127
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8*, i8** %2
%14 = getelementptr inbounds i8, i8* %13, i64 1
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = and i32 %16, 63
%18 = trunc i32 %17 to i8
store i8 %18, i8* %4
%19 = load i8*, i8** %2
%20 = getelementptr inbounds i8, i8* %19, i64 0
%21 = load i8, i8* %20
%22 = zext i8 %21 to i32
%23 = and i32 %22, 63
%24 = trunc i32 %23 to i8
store i8 %24, i8* %5
%25 = load i8*, i8** %2
%26 = getelementptr inbounds i8, i8* %25, i64 1
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = and i32 %28, 192
%30 = ashr i32 %29, 4
%31 = load i8*, i8** %2
%32 = getelementptr inbounds i8, i8* %31, i64 0
%33 = load i8, i8* %32
%34 = zext i8 %33 to i32
%35 = and i32 %34, 192
%36 = ashr i32 %35, 6
%37 = or i32 %30, %36
%38 = trunc i32 %37 to i8
store i8 %38, i8* %6
%39 = load i8, i8* %3
%40 = load i8, i8* %4
%41 = load i8, i8* %5
%42 = load i8, i8* %6
%43 = call double @hmst2sec(i8 zeroext %39, i8 zeroext %40, i8 zeroext %41, i8 zeroext %42)
ret double %43
}

LLVM IR (-O2):
define double @short2sec(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 2
%3 = load i8, i8* %2
%4 = and i8 %3, 127
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = and i8 %6, 63
%8 = load i8, i8* %0
%9 = and i8 %8, 63
%10 = lshr i8 %6, 4
%11 = and i8 %10, 12
%12 = lshr i8 %8, 6
%13 = or i8 %11, %12
%14 = tail call double @hmst2sec(i8 zeroext %4, i8 zeroext %7, i8 zeroext %9, i8 zeroext %13)
ret double %14
}