#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*/ initialisiere_int_array(int *, int, int);
void initialisiere_2dim_int_array(int zeilen, int spalten,
                                  int array[zeilen][spalten], int initialwert) {
  for (int i = 0; i < zeilen; i++)
    initialisiere_int_array(array[i], spalten, initialwert);
}


x86 assembly (clang, -O0):
<initialisiere_2dim_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x20(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    116f <initialisiere_2dim_int_array+0x5f>
mov    -0x20(%rbp),%rcx
mov    -0x10(%rbp),%rdi
movslq -0x18(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1030 <initialisiere_int_array@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1133 <initialisiere_2dim_int_array+0x23>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialisiere_2dim_int_array>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
test   %edi,%edi
jle    1147 <initialisiere_2dim_int_array+0x37>
mov    %ecx,%r14d
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %esi,%r12d
mov    %edi,%ebp
shl    $0x2,%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %r14d,%edx
call   1030 <initialisiere_int_array@plt>
add    %r12,%rbx
add    $0xffffffffffffffff,%rbp
jne    1130 <initialisiere_2dim_int_array+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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