#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*/ gmul(int, int);
int gsub(int, int /*<<< orphan*/);
void rowMulSub(uint8_t *a, uint8_t *b, uint8_t coeff, int size) {
  if (coeff != 0x00) {
    int i;
    for (i = 0; i < size; i++) {
      a[i] = gsub(a[i], gmul(coeff, b[i]));
    }
  }
}


x86 assembly (clang, -O0):
<rowMulSub>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     119e <rowMulSub+0x7e>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jge    1199 <rowMulSub+0x79>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x20(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1040 <gmul@plt>
mov    -0x20(%rbp),%edi
mov    %eax,%esi
call   1030 <gsub@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1147 <rowMulSub+0x27>
jmp    119e <rowMulSub+0x7e>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rowMulSub>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %edx,%edx
je     1178 <rowMulSub+0x58>
test   %ecx,%ecx
jle    1178 <rowMulSub+0x58>
mov    %edx,%r15d
mov    %rsi,%r14
mov    %rdi,%r13
mov    %ecx,%r12d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    0x0(%r13,%rbx,4),%ebp
mov    (%r14,%rbx,4),%esi
mov    %r15d,%edi
call   1040 <gmul@plt>
mov    %ebp,%edi
mov    %eax,%esi
call   1030 <gsub@plt>
mov    %eax,0x0(%r13,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1150 <rowMulSub+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @rowMulSub(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* %7
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %39
12: ; preds = %4
store i32 0, i32* %9
br label %13
13: ; preds = %35, %12
%14 = load i32, i32* %9
%15 = load i32, i32* %8
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %38
17: ; preds = %13
%18 = load i32*, i32** %5
%19 = load i32, i32* %9
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
%23 = load i32, i32* %7
%24 = load i32*, i32** %6
%25 = load i32, i32* %9
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i32, i32* %24, i64 %26
%28 = load i32, i32* %27
%29 = call i32 @gmul(i32 %23, i32 %28)
%30 = call i32 @gsub(i32 %22, i32 %29)
%31 = load i32*, i32** %5
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32, i32* %31, i64 %33
store i32 %30, i32* %34
br label %35
35: ; preds = %17
%36 = load i32, i32* %9
%37 = add nsw i32 %36, 1
store i32 %37, i32* %9
br label %13
38: ; preds = %13
br label %39
39: ; preds = %38, %4
ret void
}

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