#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_vect_mul_init(int /*<<< orphan*/, int /*<<< orphan*/ *);
void ec_init_tables(int k, int rows, uint8_t *a, uint8_t *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    1195 <ec_init_tables+0x85>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1182 <ec_init_tables+0x72>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
call   1030 <gf_vect_mul_init@plt>
mov    -0x18(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1140 <ec_init_tables+0x30>
jmp    1187 <ec_init_tables+0x77>
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    1169 <ec_init_tables+0x59>
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     1169 <ec_init_tables+0x59>
test   %r12d,%r12d
jle    1130 <ec_init_tables+0x20>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    (%rbx),%edi
add    $0x4,%rbx
mov    %r14,%rsi
call   1030 <gf_vect_mul_init@plt>
sub    $0xffffffffffffff80,%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, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32* %2, i32** %7
store i32* %3, i32** %8
store i32 0, i32* %9
br label %11
11: ; preds = %32, %4
%12 = load i32, i32* %9
%13 = load i32, i32* %6
%14 = icmp slt i32 %12, %13
br i1 %14, label %15, label %35
15: ; preds = %11
store i32 0, i32* %10
br label %16
16: ; preds = %28, %15
%17 = load i32, i32* %10
%18 = load i32, i32* %5
%19 = icmp slt i32 %17, %18
br i1 %19, label %20, label %31
20: ; preds = %16
%21 = load i32*, i32** %7
%22 = getelementptr inbounds i32, i32* %21, i32 1
store i32* %22, i32** %7
%23 = load i32, i32* %21
%24 = load i32*, i32** %8
%25 = call i32 @gf_vect_mul_init(i32 %23, i32* %24)
%26 = load i32*, i32** %8
%27 = getelementptr inbounds i32, i32* %26, i64 32
store i32* %27, i32** %8
br label %28
28: ; preds = %20
%29 = load i32, i32* %10
%30 = add nsw i32 %29, 1
store i32 %30, i32* %10
br label %16
31: ; preds = %16
br label %32
32: ; preds = %31
%33 = load i32, i32* %9
%34 = add nsw i32 %33, 1
store i32 %34, i32* %9
br label %11
35: ; preds = %11
ret void
}

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