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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
void copyTile(uint8_t *dst, uint8_t **src, int wTiles) {
  int loop = 0;
  for (loop = 0; loop < 32; loop++) {
    memcpy(dst, *src, 64 * sizeof(uint8_t));
    *src = *src + 64;
    dst = dst + (wTiles * 64);
  }
}


x86 assembly (clang, -O0):
<copyTile>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x20,-0x18(%rbp)
jge    118b <copyTile+0x7b>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x100,%edx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x100,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
shl    $0x6,%ecx
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1131 <copyTile+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyTile>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
shl    $0x6,%edx
movslq %edx,%r15
mov    (%rsi),%rsi
shl    $0x2,%r15
mov    $0x20,%ebp
mov    $0x100,%r12d
cs nopw 0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x100,%edx
call   1030 <memcpy@plt>
mov    (%r14),%rsi
add    %r12,%rsi
mov    %rsi,(%r14)
add    %r15,%rbx
add    $0xffffffff,%ebp
jne    1140 <copyTile+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @copyTile(i32* %0, i32** %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32**
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32** %1, i32*** %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i32 0, i32* %7
br label %8
8: ; preds = %25, %3
%9 = load i32, i32* %7
%10 = icmp slt i32 %9, 32
br i1 %10, label %11, label %28
11: ; preds = %8
%12 = load i32*, i32** %4
%13 = load i32**, i32*** %5
%14 = load i32*, i32** %13
%15 = call i32 @memcpy(i32* %12, i32* %14, i32 256)
%16 = load i32**, i32*** %5
%17 = load i32*, i32** %16
%18 = getelementptr inbounds i32, i32* %17, i64 64
%19 = load i32**, i32*** %5
store i32* %18, i32** %19
%20 = load i32*, i32** %4
%21 = load i32, i32* %6
%22 = mul nsw i32 %21, 64
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i32, i32* %20, i64 %23
store i32* %24, i32** %4
br label %25
25: ; preds = %11
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
br label %8
28: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @copyTile(i32* %0, i32** nocapture %1, i32 %2) {
%4 = shl nsw i32 %2, 6
%5 = sext i32 %4 to i64
%6 = load i32*, i32** %1
br label %7
7: ; preds = %3, %7
%8 = phi i32* [ %6, %3 ], [ %13, %7 ]
%9 = phi i32 [ 0, %3 ], [ %15, %7 ]
%10 = phi i32* [ %0, %3 ], [ %14, %7 ]
%11 = tail call i32 @memcpy(i32* %10, i32* %8, i32 256)
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i64 64
store i32* %13, i32** %1
%14 = getelementptr inbounds i32, i32* %10, i64 %5
%15 = add nuw nsw i32 %9, 1
%16 = icmp eq i32 %15, 32
br i1 %16, label %17, label %7
17: ; preds = %7
ret void
}