#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*/ u_int8_t;

/* Variables and functions */
int /*<<< orphan*/ eblend(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void EDirectAlphaRowRGBA32(u_int8_t *src, u_int8_t *dst, u_int8_t a,
                           int width) {
  while (width--) {
    dst[0] = eblend(a, src[0], dst[0]);
    dst[1] = eblend(a, src[1], dst[1]);
    dst[2] = eblend(a, src[2], dst[2]);
    src += 4;
    dst += 4;
  }
}


x86 assembly (clang, -O0):
<EDirectAlphaRowRGBA32>:
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
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x18(%rbp)
cmp    $0x0,%eax
je     11b1 <EDirectAlphaRowRGBA32+0xa1>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
call   1030 <eblend@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%edx
call   1030 <eblend@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%esi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%edx
call   1030 <eblend@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x8(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x10(%rbp)
jmp    1126 <EDirectAlphaRowRGBA32+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EDirectAlphaRowRGBA32>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %ecx,%ecx
je     1178 <EDirectAlphaRowRGBA32+0x68>
mov    %ecx,%r12d
mov    %edx,%r14d
mov    %rsi,%rbp
mov    %rdi,%r15
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
mov    (%r15,%rbx,1),%esi
mov    0x0(%rbp,%rbx,1),%edx
mov    %r14d,%edi
call   1030 <eblend@plt>
mov    %eax,0x0(%rbp,%rbx,1)
mov    0x4(%r15,%rbx,1),%esi
mov    0x4(%rbp,%rbx,1),%edx
mov    %r14d,%edi
call   1030 <eblend@plt>
mov    %eax,0x4(%rbp,%rbx,1)
mov    0x8(%r15,%rbx,1),%esi
mov    0x8(%rbp,%rbx,1),%edx
mov    %r14d,%edi
call   1030 <eblend@plt>
mov    %eax,0x8(%rbp,%rbx,1)
add    $0x10,%rbx
add    $0xffffffff,%r12d
jne    1130 <EDirectAlphaRowRGBA32+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @EDirectAlphaRowRGBA32(i32* %0, i32* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i32* %1, i32** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
br label %9
9: ; preds = %13, %4
%10 = load i32, i32* %8
%11 = add nsw i32 %10, -1
store i32 %11, i32* %8
%12 = icmp ne i32 %10, 0
br i1 %12, label %13, label %48
13: ; preds = %9
%14 = load i32, i32* %7
%15 = load i32*, i32** %5
%16 = getelementptr inbounds i32, i32* %15, i64 0
%17 = load i32, i32* %16
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 0
%20 = load i32, i32* %19
%21 = call i32 @eblend(i32 %14, i32 %17, i32 %20)
%22 = load i32*, i32** %6
%23 = getelementptr inbounds i32, i32* %22, i64 0
store i32 %21, i32* %23
%24 = load i32, i32* %7
%25 = load i32*, i32** %5
%26 = getelementptr inbounds i32, i32* %25, i64 1
%27 = load i32, i32* %26
%28 = load i32*, i32** %6
%29 = getelementptr inbounds i32, i32* %28, i64 1
%30 = load i32, i32* %29
%31 = call i32 @eblend(i32 %24, i32 %27, i32 %30)
%32 = load i32*, i32** %6
%33 = getelementptr inbounds i32, i32* %32, i64 1
store i32 %31, i32* %33
%34 = load i32, i32* %7
%35 = load i32*, i32** %5
%36 = getelementptr inbounds i32, i32* %35, i64 2
%37 = load i32, i32* %36
%38 = load i32*, i32** %6
%39 = getelementptr inbounds i32, i32* %38, i64 2
%40 = load i32, i32* %39
%41 = call i32 @eblend(i32 %34, i32 %37, i32 %40)
%42 = load i32*, i32** %6
%43 = getelementptr inbounds i32, i32* %42, i64 2
store i32 %41, i32* %43
%44 = load i32*, i32** %5
%45 = getelementptr inbounds i32, i32* %44, i64 4
store i32* %45, i32** %5
%46 = load i32*, i32** %6
%47 = getelementptr inbounds i32, i32* %46, i64 4
store i32* %47, i32** %6
br label %9
48: ; preds = %9
ret void
}

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