#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*/ ivclear(int *, int, int);
void iclear2D(int ***xx, int numrows, int numcols, int val) {
  int **array;
  int i;
  array = *xx;
  for (i = numrows - 1; i >= 0; i--) {
    ivclear(array[i], val, numcols);
  }
}


x86 assembly (clang, -O0):
<iclear2D>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1168 <iclear2D+0x58>
mov    -0x20(%rbp),%rax
movslq -0x24(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x14(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <ivclear@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1139 <iclear2D+0x29>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iclear2D>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    114c <iclear2D+0x3c>
mov    %ecx,%r14d
mov    %edx,%r15d
mov    (%rdi),%rbx
mov    %esi,%ebp
add    $0x1,%rbp
nopw   0x0(%rax,%rax,1)
lea    -0x2(%rbp),%eax
mov    (%rbx,%rax,8),%rdi
mov    %r14d,%esi
mov    %r15d,%edx
call   1030 <ivclear@plt>
add    $0xffffffffffffffff,%rbp
cmp    $0x1,%rbp
ja     1130 <iclear2D+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @iclear2D(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
%11 = load i32***, i32**** %5
%12 = load i32**, i32*** %11
store i32** %12, i32*** %9
%13 = load i32, i32* %6
%14 = sub nsw i32 %13, 1
store i32 %14, i32* %10
br label %15
15: ; preds = %27, %4
%16 = load i32, i32* %10
%17 = icmp sge i32 %16, 0
br i1 %17, label %18, label %30
18: ; preds = %15
%19 = load i32**, i32*** %9
%20 = load i32, i32* %10
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32*, i32** %19, i64 %21
%23 = load i32*, i32** %22
%24 = load i32, i32* %8
%25 = load i32, i32* %7
%26 = call i32 @ivclear(i32* %23, i32 %24, i32 %25)
br label %27
27: ; preds = %18
%28 = load i32, i32* %10
%29 = add nsw i32 %28, -1
store i32 %29, i32* %10
br label %15
30: ; preds = %15
ret void
}

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