#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 cvt_bin24_31x5(int /*<<< orphan*/ const *);
void cvt_bin96_31x20(uint32_t *bv, const uint8_t *gfv) {
  uint32_t r;
  bv[0] = cvt_bin24_31x5(gfv);
  bv[1] = cvt_bin24_31x5(gfv + 5);
  bv[2] = cvt_bin24_31x5(gfv + 10);
  r = cvt_bin24_31x5(gfv + 15);
  bv[0] |= r << 24;
  bv[1] |= (r & 0xff00) << 16;
  bv[2] |= (r & 0xff0000) << 8;
}


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

x86 assembly (clang, -O2):
<cvt_bin96_31x20>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <cvt_bin24_31x5@plt>
mov    %eax,(%r14)
lea    0x14(%rbx),%rdi
call   1030 <cvt_bin24_31x5@plt>
mov    %eax,0x4(%r14)
lea    0x28(%rbx),%rdi
call   1030 <cvt_bin24_31x5@plt>
mov    %eax,0x8(%r14)
add    $0x3c,%rbx
mov    %rbx,%rdi
call   1030 <cvt_bin24_31x5@plt>
mov    %eax,%ecx
shl    $0x18,%ecx
or     %ecx,(%r14)
mov    %eax,%ecx
shl    $0x10,%ecx
and    $0xff000000,%ecx
or     %ecx,0x4(%r14)
shl    $0x8,%eax
and    $0xff000000,%eax
or     %eax,0x8(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

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