#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 void *int64_t;

/* Variables and functions */
void aligned_block_copy_backwards(int64_t *__restrict dst_,
                                  int64_t *__restrict src, int size) {
  volatile int64_t *dst = dst_;
  int64_t t1, t2, t3, t4;
  src += size / 8 - 1;
  dst += size / 8 - 1;
  while ((size -= 64) >= 0) {
    t1 = *src--;
    t2 = *src--;
    t3 = *src--;
    t4 = *src--;
    *dst-- = t1;
    *dst-- = t2;
    *dst-- = t3;
    *dst-- = t4;
    t1 = *src--;
    t2 = *src--;
    t3 = *src--;
    t4 = *src--;
    *dst-- = t1;
    *dst-- = t2;
    *dst-- = t3;
    *dst-- = t4;
  }
}


x86 assembly (clang, -O0):
<aligned_block_copy_backwards>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x8,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
sub    $0x1,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x14(%rbp),%eax
sub    $0x40,%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jl     12d2 <aligned_block_copy_backwards+0x1d2>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x38(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0xfffffffffffffff8,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%rax
mov    %rax,-0x40(%rbp)
mov    -0x28(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x30(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x38(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
mov    -0x40(%rbp),%rcx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0xfffffffffffffff8,%rdx
mov    %rdx,-0x20(%rbp)
mov    %rcx,(%rax)
jmp    115b <aligned_block_copy_backwards+0x5b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<aligned_block_copy_backwards>:
lea    0x7(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
cmp    $0x40,%edx
jl     118a <aligned_block_copy_backwards+0x8a>
sar    $0x3,%eax
add    $0xffffffff,%eax
movslq %eax,%rcx
lea    (%rdi,%rcx,8),%rax
lea    (%rsi,%rcx,8),%rcx
add    $0x40,%edx
xor    %esi,%esi
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rcx,%rsi,1),%r10
mov    -0x8(%rcx,%rsi,1),%r8
mov    -0x18(%rcx,%rsi,1),%r9
mov    -0x10(%rcx,%rsi,1),%rdi
mov    %r10,(%rax,%rsi,1)
mov    %r8,-0x8(%rax,%rsi,1)
mov    %rdi,-0x10(%rax,%rsi,1)
mov    %r9,-0x18(%rax,%rsi,1)
mov    -0x20(%rcx,%rsi,1),%r10
mov    -0x28(%rcx,%rsi,1),%r8
mov    -0x38(%rcx,%rsi,1),%r9
mov    -0x30(%rcx,%rsi,1),%rdi
mov    %r10,-0x20(%rax,%rsi,1)
mov    %r8,-0x28(%rax,%rsi,1)
mov    %rdi,-0x30(%rax,%rsi,1)
mov    %r9,-0x38(%rax,%rsi,1)
add    $0xffffffffffffffc0,%rsi
lea    (%rdx,%rsi,1),%edi
cmp    $0x7f,%edi
ja     1130 <aligned_block_copy_backwards+0x30>
ret

LLVM IR (-O0):
define void @aligned_block_copy_backwards(i8** noalias %0, i8** noalias %1, i32 %2) {
%4 = alloca i8**
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i8**
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
store i8** %0, i8*** %4
store i8** %1, i8*** %5
store i32 %2, i32* %6
%12 = load i8**, i8*** %4
store i8** %12, i8*** %7
%13 = load i32, i32* %6
%14 = sdiv i32 %13, 8
%15 = sub nsw i32 %14, 1
%16 = load i8**, i8*** %5
%17 = sext i32 %15 to i64
%18 = getelementptr inbounds i8*, i8** %16, i64 %17
store i8** %18, i8*** %5
%19 = load i32, i32* %6
%20 = sdiv i32 %19, 8
%21 = sub nsw i32 %20, 1
%22 = load i8**, i8*** %7
%23 = sext i32 %21 to i64
%24 = getelementptr inbounds i8*, i8** %22, i64 %23
store i8** %24, i8*** %7
br label %25
25: ; preds = %29, %3
%26 = load i32, i32* %6
%27 = sub nsw i32 %26, 64
store i32 %27, i32* %6
%28 = icmp sge i32 %27, 0
br i1 %28, label %29, label %78
29: ; preds = %25
%30 = load i8**, i8*** %5
%31 = getelementptr inbounds i8*, i8** %30, i32 -1
store i8** %31, i8*** %5
%32 = load i8*, i8** %30
store i8* %32, i8** %8
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i32 -1
store i8** %34, i8*** %5
%35 = load i8*, i8** %33
store i8* %35, i8** %9
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i32 -1
store i8** %37, i8*** %5
%38 = load i8*, i8** %36
store i8* %38, i8** %10
%39 = load i8**, i8*** %5
%40 = getelementptr inbounds i8*, i8** %39, i32 -1
store i8** %40, i8*** %5
%41 = load i8*, i8** %39
store i8* %41, i8** %11
%42 = load i8*, i8** %8
%43 = load i8**, i8*** %7
%44 = getelementptr inbounds i8*, i8** %43, i32 -1
store i8** %44, i8*** %7
store volatile i8* %42, i8** %43
%45 = load i8*, i8** %9
%46 = load i8**, i8*** %7
%47 = getelementptr inbounds i8*, i8** %46, i32 -1
store i8** %47, i8*** %7
store volatile i8* %45, i8** %46
%48 = load i8*, i8** %10
%49 = load i8**, i8*** %7
%50 = getelementptr inbounds i8*, i8** %49, i32 -1
store i8** %50, i8*** %7
store volatile i8* %48, i8** %49
%51 = load i8*, i8** %11
%52 = load i8**, i8*** %7
%53 = getelementptr inbounds i8*, i8** %52, i32 -1
store i8** %53, i8*** %7
store volatile i8* %51, i8** %52
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i32 -1
store i8** %55, i8*** %5
%56 = load i8*, i8** %54
store i8* %56, i8** %8
%57 = load i8**, i8*** %5
%58 = getelementptr inbounds i8*, i8** %57, i32 -1
store i8** %58, i8*** %5
%59 = load i8*, i8** %57
store i8* %59, i8** %9
%60 = load i8**, i8*** %5
%61 = getelementptr inbounds i8*, i8** %60, i32 -1
store i8** %61, i8*** %5
%62 = load i8*, i8** %60
store i8* %62, i8** %10
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i32 -1
store i8** %64, i8*** %5
%65 = load i8*, i8** %63
store i8* %65, i8** %11
%66 = load i8*, i8** %8
%67 = load i8**, i8*** %7
%68 = getelementptr inbounds i8*, i8** %67, i32 -1
store i8** %68, i8*** %7
store volatile i8* %66, i8** %67
%69 = load i8*, i8** %9
%70 = load i8**, i8*** %7
%71 = getelementptr inbounds i8*, i8** %70, i32 -1
store i8** %71, i8*** %7
store volatile i8* %69, i8** %70
%72 = load i8*, i8** %10
%73 = load i8**, i8*** %7
%74 = getelementptr inbounds i8*, i8** %73, i32 -1
store i8** %74, i8*** %7
store volatile i8* %72, i8** %73
%75 = load i8*, i8** %11
%76 = load i8**, i8*** %7
%77 = getelementptr inbounds i8*, i8** %76, i32 -1
store i8** %77, i8*** %7
store volatile i8* %75, i8** %76
br label %25
78: ; preds = %25
ret void
}

LLVM IR (-O2):
define void @aligned_block_copy_backwards(i8** noalias %0, i8** noalias nocapture %1, i32 %2) {
%4 = sdiv i32 %2, 8
%5 = add nsw i32 %4, -1
%6 = sext i32 %5 to i64
%7 = icmp sgt i32 %2, 63
br i1 %7, label %8, label %41
8: ; preds = %3
%9 = getelementptr inbounds i8*, i8** %0, i64 %6
%10 = getelementptr inbounds i8*, i8** %1, i64 %6
br label %11
11: ; preds = %8, %11
%12 = phi i8** [ %34, %11 ], [ %10, %8 ]
%13 = phi i32 [ %15, %11 ], [ %2, %8 ]
%14 = phi i8** [ %39, %11 ], [ %9, %8 ]
%15 = add nsw i32 %13, -64
%16 = getelementptr inbounds i8*, i8** %12, i64 -1
%17 = load i8*, i8** %12
%18 = getelementptr inbounds i8*, i8** %12, i64 -2
%19 = load i8*, i8** %16
%20 = getelementptr inbounds i8*, i8** %12, i64 -3
%21 = load i8*, i8** %18
%22 = getelementptr inbounds i8*, i8** %12, i64 -4
%23 = load i8*, i8** %20
%24 = getelementptr inbounds i8*, i8** %14, i64 -1
store volatile i8* %17, i8** %14
%25 = getelementptr inbounds i8*, i8** %14, i64 -2
store volatile i8* %19, i8** %24
%26 = getelementptr inbounds i8*, i8** %14, i64 -3
store volatile i8* %21, i8** %25
%27 = getelementptr inbounds i8*, i8** %14, i64 -4
store volatile i8* %23, i8** %26
%28 = getelementptr inbounds i8*, i8** %12, i64 -5
%29 = load i8*, i8** %22
%30 = getelementptr inbounds i8*, i8** %12, i64 -6
%31 = load i8*, i8** %28
%32 = getelementptr inbounds i8*, i8** %12, i64 -7
%33 = load i8*, i8** %30
%34 = getelementptr inbounds i8*, i8** %12, i64 -8
%35 = load i8*, i8** %32
%36 = getelementptr inbounds i8*, i8** %14, i64 -5
store volatile i8* %29, i8** %27
%37 = getelementptr inbounds i8*, i8** %14, i64 -6
store volatile i8* %31, i8** %36
%38 = getelementptr inbounds i8*, i8** %14, i64 -7
store volatile i8* %33, i8** %37
%39 = getelementptr inbounds i8*, i8** %14, i64 -8
store volatile i8* %35, i8** %38
%40 = icmp ugt i32 %13, 127
br i1 %40, label %11, label %41
41: ; preds = %11, %3
ret void
}