#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 scalar_t__ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ BASIC_convert64(char *, char *);
void BASIC_convert128(char *src, char *dest) {
  uint64_t tmp_src[2];
  uint64_t tmp_dest[2];
  char *ptr = dest;
  tmp_src[0] = *((uint64_t *)src);
  tmp_src[1] = *((uint64_t *)((char *)src + sizeof(uint64_t)));
  BASIC_convert64((char *)&tmp_src[0], (char *)&tmp_dest[0]);
  BASIC_convert64((char *)&tmp_src[1], (char *)&tmp_dest[1]);
  *((uint64_t *)ptr) = tmp_dest[0];
  ptr += sizeof(uint64_t);
  *((uint64_t *)ptr) = tmp_dest[1];
}


x86 assembly (clang, -O0):
<BASIC_convert128>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <BASIC_convert64@plt>
lea    -0x20(%rbp),%rdi
add    $0x8,%rdi
lea    -0x30(%rbp),%rsi
add    $0x8,%rsi
call   1030 <BASIC_convert64@plt>
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x38(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x38(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x38(%rbp),%rax
mov    %rcx,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BASIC_convert128>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
movups (%rdi),%xmm0
lea    0x18(%rsp),%r14
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <BASIC_convert64@plt>
lea    0x8(%rsp),%rsi
mov    %r14,%rdi
call   1030 <BASIC_convert64@plt>
movaps (%rsp),%xmm0
movups %xmm0,(%rbx)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @BASIC_convert128(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca [2 x i64]
%6 = alloca [2 x i64]
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %4
store i8* %8, i8** %7
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i64*
%11 = load i64, i64* %10
%12 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
store i64 %11, i64* %12
%13 = load i8*, i8** %3
%14 = getelementptr inbounds i8, i8* %13, i64 8
%15 = bitcast i8* %14 to i64*
%16 = load i64, i64* %15
%17 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
store i64 %16, i64* %17
%18 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 0
%19 = bitcast i64* %18 to i8*
%20 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 0
%21 = bitcast i64* %20 to i8*
%22 = call i32 @BASIC_convert64(i8* %19, i8* %21)
%23 = getelementptr inbounds [2 x i64], [2 x i64]* %5, i64 0, i64 1
%24 = bitcast i64* %23 to i8*
%25 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 1
%26 = bitcast i64* %25 to i8*
%27 = call i32 @BASIC_convert64(i8* %24, i8* %26)
%28 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 0
%29 = load i64, i64* %28
%30 = load i8*, i8** %7
%31 = bitcast i8* %30 to i64*
store i64 %29, i64* %31
%32 = load i8*, i8** %7
%33 = getelementptr inbounds i8, i8* %32, i64 8
store i8* %33, i8** %7
%34 = getelementptr inbounds [2 x i64], [2 x i64]* %6, i64 0, i64 1
%35 = load i64, i64* %34
%36 = load i8*, i8** %7
%37 = bitcast i8* %36 to i64*
store i64 %35, i64* %37
ret void
}

LLVM IR (-O2):
define void @BASIC_convert128(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = alloca <2 x i64>
%4 = alloca <2 x i64>
%5 = bitcast <2 x i64>* %3 to i8*
%6 = bitcast <2 x i64>* %4 to i8*
%7 = bitcast i8* %0 to <2 x i64>*
%8 = load <2 x i64>, <2 x i64>* %7
%9 = getelementptr inbounds <2 x i64>, <2 x i64>* %3, i64 0, i64 1
store <2 x i64> %8, <2 x i64>* %3
%10 = call i32 @BASIC_convert64(i8* %5, i8* %6)
%11 = bitcast i64* %9 to i8*
%12 = getelementptr inbounds <2 x i64>, <2 x i64>* %4, i64 0, i64 1
%13 = bitcast i64* %12 to i8*
%14 = call i32 @BASIC_convert64(i8* %11, i8* %13)
%15 = load <2 x i64>, <2 x i64>* %4
%16 = bitcast i8* %1 to <2 x i64>*
store <2 x i64> %15, <2 x i64>* %16
ret void
}