#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 */

/* Variables and functions */
int /*<<< orphan*/ _Block_assign_default(void *, void **);
void _Block_memmove_gc_broken(void *dest, void *src, unsigned long size) {
  void **destp = (void **)dest;
  void **srcp = (void **)src;
  while (size) {
    _Block_assign_default(*srcp, destp);
    destp++;
    srcp++;
    size -= sizeof(void *);
  }
}


x86 assembly (clang, -O0):
<_Block_memmove_gc_broken>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1178 <_Block_memmove_gc_broken+0x68>
mov    -0x28(%rbp),%rax
mov    (%rax),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <_Block_assign_default@plt>
mov    -0x20(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x20(%rbp)
mov    -0x28(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
sub    $0x8,%rax
mov    %rax,-0x18(%rbp)
jmp    1134 <_Block_memmove_gc_broken+0x24>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_Block_memmove_gc_broken>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %rdx,%rdx
je     1146 <_Block_memmove_gc_broken+0x36>
mov    %rdx,%r12
mov    %rsi,%r14
mov    %rdi,%r15
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
lea    (%r15,%rbx,1),%rsi
mov    (%r14,%rbx,1),%rdi
call   1030 <_Block_assign_default@plt>
add    $0x8,%rbx
cmp    %rbx,%r12
jne    1130 <_Block_memmove_gc_broken+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @_Block_memmove_gc_broken(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8**
%8 = alloca i8**
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %7
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %8
br label %13
13: ; preds = %16, %3
%14 = load i64, i64* %6
%15 = icmp ne i64 %14, 0
br i1 %15, label %16, label %27
16: ; preds = %13
%17 = load i8**, i8*** %8
%18 = load i8*, i8** %17
%19 = load i8**, i8*** %7
%20 = call i32 @_Block_assign_default(i8* %18, i8** %19)
%21 = load i8**, i8*** %7
%22 = getelementptr inbounds i8*, i8** %21, i32 1
store i8** %22, i8*** %7
%23 = load i8**, i8*** %8
%24 = getelementptr inbounds i8*, i8** %23, i32 1
store i8** %24, i8*** %8
%25 = load i64, i64* %6
%26 = sub i64 %25, 8
store i64 %26, i64* %6
br label %13
27: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @_Block_memmove_gc_broken(i8* %0, i8* nocapture %1, i64 %2) {
%4 = icmp eq i64 %2, 0
br i1 %4, label %18, label %5
5: ; preds = %3
%6 = bitcast i8* %1 to i8**
%7 = bitcast i8* %0 to i8**
br label %8
8: ; preds = %5, %8
%9 = phi i8** [ %15, %8 ], [ %6, %5 ]
%10 = phi i8** [ %14, %8 ], [ %7, %5 ]
%11 = phi i64 [ %16, %8 ], [ %2, %5 ]
%12 = load i8*, i8** %9
%13 = tail call i32 @_Block_assign_default(i8* %12, i8** %10)
%14 = getelementptr inbounds i8*, i8** %10, i64 1
%15 = getelementptr inbounds i8*, i8** %9, i64 1
%16 = add i64 %11, -8
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %8
18: ; preds = %8, %3
ret void
}