#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*/ gf_mul(int /*<<< orphan*/, int /*<<< orphan*/);
void gf_vect_mul_base(int len, uint8_t *a, uint8_t *src, uint8_t *dest) {
  uint8_t c = a[1];
  while (len-- > 0)
    *dest++ = gf_mul(c, *src++);
}


x86 assembly (clang, -O0):
<gf_vect_mul_base>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x4(%rbp)
cmp    $0x0,%eax
jle    1176 <gf_vect_mul_base+0x66>
mov    -0x24(%rbp),%edi
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%esi
call   1030 <gf_mul@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
mov    %rax,%rdx
add    $0x4,%rdx
mov    %rdx,-0x20(%rbp)
mov    %ecx,(%rax)
jmp    1131 <gf_vect_mul_base+0x21>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf_vect_mul_base>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    114c <gf_vect_mul_base+0x3c>
mov    %rcx,%r14
mov    %rdx,%r15
mov    %edi,%ebp
mov    0x4(%rsi),%r12d
add    $0x1,%ebp
xor    %ebx,%ebx
nopl   (%rax)
mov    (%r15,%rbx,1),%esi
mov    %r12d,%edi
call   1030 <gf_mul@plt>
mov    %eax,(%r14,%rbx,1)
add    $0xffffffff,%ebp
add    $0x4,%rbx
cmp    $0x1,%ebp
ja     1130 <gf_vect_mul_base+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @gf_vect_mul_base(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 1
%12 = load i32, i32* %11
store i32 %12, i32* %9
br label %13
13: ; preds = %17, %4
%14 = load i32, i32* %5
%15 = add nsw i32 %14, -1
store i32 %15, i32* %5
%16 = icmp sgt i32 %14, 0
br i1 %16, label %17, label %25
17: ; preds = %13
%18 = load i32, i32* %9
%19 = load i32*, i32** %7
%20 = getelementptr inbounds i32, i32* %19, i32 1
store i32* %20, i32** %7
%21 = load i32, i32* %19
%22 = call i32 @gf_mul(i32 %18, i32 %21)
%23 = load i32*, i32** %8
%24 = getelementptr inbounds i32, i32* %23, i32 1
store i32* %24, i32** %8
store i32 %22, i32* %23
br label %13
25: ; preds = %13
ret void
}

LLVM IR (-O2):
define void @gf_vect_mul_base(i32 %0, i32* nocapture %1, i32* nocapture %2, i32* nocapture writeonly %3) {
%5 = getelementptr inbounds i32, i32* %1, i64 1
%6 = load i32, i32* %5
%7 = icmp sgt i32 %0, 0
br i1 %7, label %8, label %18
8: ; preds = %4, %8
%9 = phi i32 [ %12, %8 ], [ %0, %4 ]
%10 = phi i32* [ %16, %8 ], [ %3, %4 ]
%11 = phi i32* [ %13, %8 ], [ %2, %4 ]
%12 = add nsw i32 %9, -1
%13 = getelementptr inbounds i32, i32* %11, i64 1
%14 = load i32, i32* %11
%15 = tail call i32 @gf_mul(i32 %6, i32 %14)
%16 = getelementptr inbounds i32, i32* %10, i64 1
store i32 %15, i32* %10
%17 = icmp ugt i32 %9, 1
br i1 %17, label %8, label %18
18: ; preds = %8, %4
ret void
}