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

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
int copy16x32(uint8_t *ptr_out, uint8_t *ptr_in, uint16_t Stride) {
  int line;
  for (line = 0; line < 16; line++) {
    memcpy(ptr_out + (line * 32), ptr_in + (line * Stride), 32);
  }
  return line;
}


x86 assembly (clang, -O0):
<copy16x32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x10,-0x18(%rbp)
jge    1173 <copy16x32+0x63>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%eax
shl    $0x5,%eax
cltq
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
cltq
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    112a <copy16x32+0x1a>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy16x32>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movslq %edx,%r12
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x80(%rbx),%rdi
lea    (%r14,%r12,4),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x100(%rbx),%rdi
lea    (%r14,%r12,8),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x180(%rbx),%rdi
lea    (%r12,%r12,2),%r15
lea    (%r14,%r15,4),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x200(%rbx),%rdi
mov    %r12,%rsi
shl    $0x4,%rsi
add    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x280(%rbx),%rdi
lea    (%r12,%r12,4),%r13
lea    (%r14,%r13,4),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x300(%rbx),%rdi
lea    (%r14,%r15,8),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x380(%rbx),%rdi
lea    (%r12,%r12,8),%rbp
lea    0x0(,%rbp,2),%rsi
add    %rbp,%rsi
add    %r12,%rsi
add    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x400(%rbx),%rdi
mov    %r12,%rsi
shl    $0x5,%rsi
add    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x480(%rbx),%rdi
lea    (%r14,%rbp,4),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x500(%rbx),%rdi
lea    (%r14,%r13,8),%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x580(%rbx),%rdi
imul   $0x2c,%r12,%rsi
add    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x600(%rbx),%rdi
shl    $0x4,%r15
add    %r14,%r15
mov    %r15,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x680(%rbx),%rdi
imul   $0x34,%r12,%rsi
add    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
lea    0x700(%rbx),%rdi
imul   $0x38,%r12,%rsi
add    %r14,%rsi
mov    $0x20,%edx
call   1030 <memcpy@plt>
add    $0x780,%rbx
imul   $0x3c,%r12,%rsi
add    %r14,%rsi
mov    %rbx,%rdi
mov    $0x20,%edx
call   1030 <memcpy@plt>
mov    $0x10,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @copy16x32(i32* %0, i32* %1, i32 %2) {
%4 = sext i32 %2 to i64
%5 = tail call i32 @memcpy(i32* %0, i32* %1, i32 32)
%6 = getelementptr inbounds i32, i32* %0, i64 32
%7 = getelementptr inbounds i32, i32* %1, i64 %4
%8 = tail call i32 @memcpy(i32* %6, i32* %7, i32 32)
%9 = getelementptr inbounds i32, i32* %0, i64 64
%10 = shl nsw i64 %4, 1
%11 = getelementptr inbounds i32, i32* %1, i64 %10
%12 = tail call i32 @memcpy(i32* %9, i32* %11, i32 32)
%13 = getelementptr inbounds i32, i32* %0, i64 96
%14 = mul nsw i64 %4, 3
%15 = getelementptr inbounds i32, i32* %1, i64 %14
%16 = tail call i32 @memcpy(i32* %13, i32* %15, i32 32)
%17 = getelementptr inbounds i32, i32* %0, i64 128
%18 = shl nsw i64 %4, 2
%19 = getelementptr inbounds i32, i32* %1, i64 %18
%20 = tail call i32 @memcpy(i32* %17, i32* %19, i32 32)
%21 = getelementptr inbounds i32, i32* %0, i64 160
%22 = mul nsw i64 %4, 5
%23 = getelementptr inbounds i32, i32* %1, i64 %22
%24 = tail call i32 @memcpy(i32* %21, i32* %23, i32 32)
%25 = getelementptr inbounds i32, i32* %0, i64 192
%26 = mul nsw i64 %4, 6
%27 = getelementptr inbounds i32, i32* %1, i64 %26
%28 = tail call i32 @memcpy(i32* %25, i32* %27, i32 32)
%29 = getelementptr inbounds i32, i32* %0, i64 224
%30 = mul nsw i64 %4, 7
%31 = getelementptr inbounds i32, i32* %1, i64 %30
%32 = tail call i32 @memcpy(i32* %29, i32* %31, i32 32)
%33 = getelementptr inbounds i32, i32* %0, i64 256
%34 = shl nsw i64 %4, 3
%35 = getelementptr inbounds i32, i32* %1, i64 %34
%36 = tail call i32 @memcpy(i32* %33, i32* %35, i32 32)
%37 = getelementptr inbounds i32, i32* %0, i64 288
%38 = mul nsw i64 %4, 9
%39 = getelementptr inbounds i32, i32* %1, i64 %38
%40 = tail call i32 @memcpy(i32* %37, i32* %39, i32 32)
%41 = getelementptr inbounds i32, i32* %0, i64 320
%42 = mul nsw i64 %4, 10
%43 = getelementptr inbounds i32, i32* %1, i64 %42
%44 = tail call i32 @memcpy(i32* %41, i32* %43, i32 32)
%45 = getelementptr inbounds i32, i32* %0, i64 352
%46 = mul nsw i64 %4, 11
%47 = getelementptr inbounds i32, i32* %1, i64 %46
%48 = tail call i32 @memcpy(i32* %45, i32* %47, i32 32)
%49 = getelementptr inbounds i32, i32* %0, i64 384
%50 = mul nsw i64 %4, 12
%51 = getelementptr inbounds i32, i32* %1, i64 %50
%52 = tail call i32 @memcpy(i32* %49, i32* %51, i32 32)
%53 = getelementptr inbounds i32, i32* %0, i64 416
%54 = mul nsw i64 %4, 13
%55 = getelementptr inbounds i32, i32* %1, i64 %54
%56 = tail call i32 @memcpy(i32* %53, i32* %55, i32 32)
%57 = getelementptr inbounds i32, i32* %0, i64 448
%58 = mul nsw i64 %4, 14
%59 = getelementptr inbounds i32, i32* %1, i64 %58
%60 = tail call i32 @memcpy(i32* %57, i32* %59, i32 32)
%61 = getelementptr inbounds i32, i32* %0, i64 480
%62 = mul nsw i64 %4, 15
%63 = getelementptr inbounds i32, i32* %1, i64 %62
%64 = tail call i32 @memcpy(i32* %61, i32* %63, i32 32)
ret i32 16
}