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

/* Variables and functions */
int /*<<< orphan*/ gf_vect_mul_init(int /*<<< orphan*/, unsigned char *);
void ec_init_tables(int k, int rows, unsigned char *a, unsigned char *g_tbls) {
  int i, j;
  for (i = 0; i < rows; i++) {
    for (j = 0; j < k; j++) {
      gf_vect_mul_init(*a++, g_tbls);
      g_tbls += 32;
    }
  }
}


x86 assembly (clang, -O0):
<ec_init_tables>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1194 <ec_init_tables+0x84>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1181 <ec_init_tables+0x71>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
movzbl (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1030 <gf_vect_mul_init@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1140 <ec_init_tables+0x30>
jmp    1186 <ec_init_tables+0x76>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    112d <ec_init_tables+0x1d>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ec_init_tables>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    116a <ec_init_tables+0x5a>
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %edi,%r12d
xor    %r13d,%r13d
jmp    1139 <ec_init_tables+0x29>
add    $0x1,%r13d
cmp    %r15d,%r13d
je     116a <ec_init_tables+0x5a>
test   %r12d,%r12d
jle    1130 <ec_init_tables+0x20>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%rbx),%edi
add    $0x1,%rbx
mov    %r14,%rsi
call   1030 <gf_vect_mul_init@plt>
add    $0x20,%r14
add    $0xffffffff,%ebp
jne    1150 <ec_init_tables+0x40>
jmp    1130 <ec_init_tables+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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