#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*/ AV_COPY128U(int /*<<< orphan*/ *,
                               int /*<<< orphan*/ const *);
void copy_block17(uint8_t *dst, const uint8_t *src, int dstStride,
                  int srcStride, int h) {
  int i;
  for (i = 0; i < h; i++) {
    AV_COPY128U(dst, src);
    dst[16] = src[16];
    dst += dstStride;
    src += srcStride;
  }
}


x86 assembly (clang, -O0):
<copy_block17>:
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    %r8d,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1190 <copy_block17+0x80>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <AV_COPY128U@plt>
mov    -0x10(%rbp),%rax
mov    0x40(%rax),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x40(%rax)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq %ecx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1131 <copy_block17+0x21>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_block17>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %r8d,%r8d
jle    115d <copy_block17+0x4d>
mov    %r8d,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
movslq %edx,%r15
movslq %ecx,%r12
shl    $0x2,%r15
shl    $0x2,%r12
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <AV_COPY128U@plt>
mov    0x40(%rbx),%eax
mov    %eax,0x40(%rbp)
add    %r15,%rbp
add    %r12,%rbx
add    $0xffffffff,%r14d
jne    1140 <copy_block17+0x30>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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