#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 /*<<< orphan*/ uint8_t;
typedef int uint32_t;

/* Variables and functions */
int /*<<< orphan*/ cvt_31x5_bin24(int /*<<< orphan*/ *, int const);
void cvt_31x20_bin96(uint8_t *gfv, const uint32_t *bv) {
  uint32_t t =
      (bv[0] >> 24) | ((bv[1] >> 16) & 0xff00) | ((bv[2] >> 8) & 0xff0000);
  cvt_31x5_bin24(gfv, bv[0]);
  cvt_31x5_bin24(gfv + 5, bv[1]);
  cvt_31x5_bin24(gfv + 10, bv[2]);
  cvt_31x5_bin24(gfv + 15, t);
}


x86 assembly (clang, -O0):
<cvt_31x20_bin96>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
sar    $0x18,%eax
mov    -0x10(%rbp),%rcx
mov    0x4(%rcx),%ecx
sar    $0x10,%ecx
and    $0xff00,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%rcx
mov    0x8(%rcx),%ecx
sar    $0x8,%ecx
and    $0xff0000,%ecx
or     %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1030 <cvt_31x5_bin24@plt>
mov    -0x8(%rbp),%rdi
add    $0x14,%rdi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%esi
call   1030 <cvt_31x5_bin24@plt>
mov    -0x8(%rbp),%rdi
add    $0x28,%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%esi
call   1030 <cvt_31x5_bin24@plt>
mov    -0x8(%rbp),%rdi
add    $0x3c,%rdi
mov    -0x14(%rbp),%esi
call   1030 <cvt_31x5_bin24@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_31x20_bin96>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rsi),%esi
mov    0x8(%r14),%ebp
mov    %esi,%eax
sar    $0x18,%eax
movzbl 0x7(%r14),%ecx
shl    $0x8,%ecx
or     %eax,%ecx
shr    $0x8,%ebp
and    $0xff0000,%ebp
or     %ecx,%ebp
call   1030 <cvt_31x5_bin24@plt>
lea    0x14(%rbx),%rdi
mov    0x4(%r14),%esi
call   1030 <cvt_31x5_bin24@plt>
lea    0x28(%rbx),%rdi
mov    0x8(%r14),%esi
call   1030 <cvt_31x5_bin24@plt>
add    $0x3c,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <cvt_31x5_bin24@plt>

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

LLVM IR (-O2):
define void @cvt_31x20_bin96(i32* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = ashr i32 %3, 24
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = lshr i32 %6, 16
%8 = and i32 %7, 65280
%9 = or i32 %8, %4
%10 = getelementptr inbounds i32, i32* %1, i64 2
%11 = load i32, i32* %10
%12 = lshr i32 %11, 8
%13 = and i32 %12, 16711680
%14 = or i32 %9, %13
%15 = tail call i32 @cvt_31x5_bin24(i32* %0, i32 %3)
%16 = getelementptr inbounds i32, i32* %0, i64 5
%17 = load i32, i32* %5
%18 = tail call i32 @cvt_31x5_bin24(i32* %16, i32 %17)
%19 = getelementptr inbounds i32, i32* %0, i64 10
%20 = load i32, i32* %10
%21 = tail call i32 @cvt_31x5_bin24(i32* %19, i32 %20)
%22 = getelementptr inbounds i32, i32* %0, i64 15
%23 = tail call i32 @cvt_31x5_bin24(i32* %22, i32 %14)
ret void
}