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

/* Variables and functions */
int /*<<< orphan*/ copySlice(int *, int *, int);
int blockFrame(uint8_t *ptr_out, uint8_t *ptr_in, uint8_t rows, uint8_t cols) {
  int sliceSize = (32 * 16) * 2 * 2 * cols;
  int slice;
  for (slice = 0; slice < rows; slice++) {
    copySlice(ptr_out + sliceSize * slice, ptr_in + sliceSize * slice, cols);
  }
  return 1;
}


x86 assembly (clang, -O0):
<blockFrame>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
shl    $0xb,%eax
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1180 <blockFrame+0x70>
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x1c(%rbp),%eax
imul   -0x20(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    -0x18(%rbp),%edx
call   1030 <copySlice@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1136 <blockFrame+0x26>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blockFrame>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edx,%edx
jle    115a <blockFrame+0x4a>
mov    %ecx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %ecx,%eax
shl    $0xb,%eax
movslq %eax,%r15
mov    %edx,%r12d
shl    $0x2,%r15
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %rbx,%rsi
mov    %r14d,%edx
call   1030 <copySlice@plt>
add    %r15,%rbp
add    %r15,%rbx
add    $0xffffffffffffffff,%r12
jne    1140 <blockFrame+0x30>
mov    $0x1,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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