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

/* Variables and functions */
int /*<<< orphan*/ cvt_bin32_31x6p5(int const *, int);
void cvt_bin64_31x13(uint32_t *bv0, uint32_t *bv1, const uint8_t *gfv) {
  uint8_t gfv0, gfv1;
  gfv1 = gfv[12] / 5;
  gfv0 = gfv[12] - (gfv1 * 5);
  *bv0 = cvt_bin32_31x6p5(gfv, gfv0);
  *bv1 = cvt_bin32_31x6p5(&gfv[6], gfv1);
}


x86 assembly (clang, -O0):
<cvt_bin64_31x13>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%eax
imul   $0x5,-0x20(%rbp),%ecx
sub    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1030 <cvt_bin32_31x6p5@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x18(%rbp),%rdi
add    $0x18,%rdi
mov    -0x20(%rbp),%esi
call   1030 <cvt_bin32_31x6p5@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cvt_bin64_31x13>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
movslq 0x30(%rdx),%rsi
imul   $0x66666667,%rsi,%rbx
mov    %rbx,%rax
shr    $0x3f,%rax
sar    $0x21,%rbx
add    %eax,%ebx
lea    (%rbx,%rbx,4),%eax
sub    %eax,%esi
mov    %rdx,%rdi
call   1030 <cvt_bin32_31x6p5@plt>
mov    %eax,(%r15)
add    $0x18,%r12
mov    %r12,%rdi
mov    %ebx,%esi
call   1030 <cvt_bin32_31x6p5@plt>
mov    %eax,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @cvt_bin64_31x13(i32* %0, i32* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %6
%10 = getelementptr inbounds i32, i32* %9, i64 12
%11 = load i32, i32* %10
%12 = sdiv i32 %11, 5
store i32 %12, i32* %8
%13 = load i32*, i32** %6
%14 = getelementptr inbounds i32, i32* %13, i64 12
%15 = load i32, i32* %14
%16 = load i32, i32* %8
%17 = mul nsw i32 %16, 5
%18 = sub nsw i32 %15, %17
store i32 %18, i32* %7
%19 = load i32*, i32** %6
%20 = load i32, i32* %7
%21 = call i32 @cvt_bin32_31x6p5(i32* %19, i32 %20)
%22 = load i32*, i32** %4
store i32 %21, i32* %22
%23 = load i32*, i32** %6
%24 = getelementptr inbounds i32, i32* %23, i64 6
%25 = load i32, i32* %8
%26 = call i32 @cvt_bin32_31x6p5(i32* %24, i32 %25)
%27 = load i32*, i32** %5
store i32 %26, i32* %27
ret void
}

LLVM IR (-O2):
define void @cvt_bin64_31x13(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32* %2) {
%4 = getelementptr inbounds i32, i32* %2, i64 12
%5 = load i32, i32* %4
%6 = sdiv i32 %5, 5
%7 = mul nsw i32 %6, -5
%8 = add i32 %7, %5
%9 = tail call i32 @cvt_bin32_31x6p5(i32* %2, i32 %8)
store i32 %9, i32* %0
%10 = getelementptr inbounds i32, i32* %2, i64 6
%11 = tail call i32 @cvt_bin32_31x6p5(i32* %10, i32 %6)
store i32 %11, i32* %1
ret void
}