#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*/ putchar(char);
int /*<<< orphan*/ schreibe_int_array(int *, int, int, char *, _Bool);
void schreibe_2dim_int_array(int zeilen, int spalten,
                             int array[zeilen][spalten], int breite,
                             char *trenner, _Bool am_ende) {
  for (int i = 0; i < zeilen; i++) {
    schreibe_int_array(array[i], spalten, breite, trenner, am_ende);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<schreibe_2dim_int_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r9b,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
and    $0x1,%al
mov    %al,-0x21(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x30(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11a2 <schreibe_2dim_int_array+0x82>
mov    -0x30(%rbp),%rcx
mov    -0x10(%rbp),%rdi
movslq -0x28(%rbp),%rax
imul   %rcx,%rax
shl    $0x2,%rax
add    %rax,%rdi
mov    -0x8(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x21(%rbp),%al
and    $0x1,%al
movzbl %al,%r8d
call   1040 <schreibe_int_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    114f <schreibe_2dim_int_array+0x2f>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<schreibe_2dim_int_array>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,0x4(%rsp)
test   %edi,%edi
jle    1178 <schreibe_2dim_int_array+0x58>
mov    %r8,%r15
mov    %ecx,%r12d
mov    %rdx,%rbx
mov    0x4(%rsp),%r13d
mov    %edi,%r14d
shl    $0x2,%r13
movzbl %r9b,%ebp
nopl   0x0(%rax)
mov    %rbx,%rdi
mov    0x4(%rsp),%esi
mov    %r12d,%edx
mov    %r15,%rcx
mov    %ebp,%r8d
call   1040 <schreibe_int_array@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    %r13,%rbx
add    $0xffffffffffffffff,%r14
jne    1150 <schreibe_2dim_int_array+0x30>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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