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

/* Variables and functions */
int /*<<< orphan*/ copy4x16x32(int *, int *, int);
int copySlice(uint8_t *ptr_out, uint8_t *ptr_in, uint8_t cols) {
  int fourBlockNum;
  uint16_t Stride = cols * (2 * 32);
  for (fourBlockNum = 0; fourBlockNum < cols; fourBlockNum++) {
    copy4x16x32(ptr_out + (32 * 16) * 4 * fourBlockNum,
                ptr_in + (32 * 2) * fourBlockNum, Stride);
  }
  return 1;
}


x86 assembly (clang, -O0):
<copySlice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x6,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    117b <copySlice+0x6b>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%eax
shl    $0xb,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
shl    $0x6,%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x1c(%rbp),%edx
call   1030 <copy4x16x32@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <copySlice+0x23>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copySlice>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1152 <copySlice+0x42>
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %edx,%r15d
shl    $0x6,%r14d
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <copy4x16x32@plt>
add    $0x2000,%rbp
add    $0x100,%rbx
add    $0xffffffffffffffff,%r15
jne    1130 <copySlice+0x20>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @copySlice(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 = mul nsw i32 %9, 64
store i32 %10, i32* %8
store i32 0, i32* %7
br label %11
11: ; preds = %28, %3
%12 = load i32, i32* %7
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %31
15: ; preds = %11
%16 = load i32*, i32** %4
%17 = load i32, i32* %7
%18 = mul nsw i32 2048, %17
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i32, i32* %16, i64 %19
%21 = load i32*, i32** %5
%22 = load i32, i32* %7
%23 = mul nsw i32 64, %22
%24 = sext i32 %23 to i64
%25 = getelementptr inbounds i32, i32* %21, i64 %24
%26 = load i32, i32* %8
%27 = call i32 @copy4x16x32(i32* %20, i32* %25, i32 %26)
br label %28
28: ; preds = %15
%29 = load i32, i32* %7
%30 = add nsw i32 %29, 1
store i32 %30, i32* %7
br label %11
31: ; preds = %11
ret i32 1
}

LLVM IR (-O2):
define i32 @copySlice(i32* %0, i32* %1, i32 %2) {
%4 = shl nsw i32 %2, 6
%5 = icmp sgt i32 %2, 0
br i1 %5, label %6, label %17
6: ; preds = %3
%7 = zext i32 %2 to i64
br label %8
8: ; preds = %6, %8
%9 = phi i64 [ 0, %6 ], [ %15, %8 ]
%10 = shl nsw i64 %9, 11
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = shl nsw i64 %9, 6
%13 = getelementptr inbounds i32, i32* %1, i64 %12
%14 = tail call i32 @copy4x16x32(i32* %11, i32* %13, i32 %4)
%15 = add nuw nsw i64 %9, 1
%16 = icmp eq i64 %15, %7
br i1 %16, label %17, label %8
17: ; preds = %8, %3
ret i32 1
}