#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*/ assert(int);
int /*<<< orphan*/ printf(char *, int const);
int /*<<< orphan*/ putchar(char);
void put_maze(int w, int h, const int *maze) {
  assert(w > 1);
  assert(h > 1);
  assert(w <= 100);
  assert(h <= 100);
  assert(maze != NULL);
  for (int y = 0; y < h; ++y) {
    for (int x = 0; x < w; ++x)
      printf("%2d ", maze[y * w + x]);
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<put_maze>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x1,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x64,-0x4(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpl   $0x64,-0x8(%rbp)
setle  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1204 <put_maze+0xd4>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    11ec <put_maze+0xbc>
mov    -0x10(%rbp),%rax
mov    -0x14(%rbp),%ecx
imul   -0x4(%rbp),%ecx
add    -0x18(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe27(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11b2 <put_maze+0x82>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    119f <put_maze+0x6f>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<put_maze>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %edi,%edi
cmp    $0x2,%ebp
setge  %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x2,%r14d
setge  %dil
call   1050 <assert@plt>
xor    %edi,%edi
mov    %ebp,0xc(%rsp)
cmp    $0x65,%ebp
setl   %dil
call   1050 <assert@plt>
xor    %edi,%edi
cmp    $0x65,%r14d
setl   %dil
call   1050 <assert@plt>
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <assert@plt>
test   %r14d,%r14d
jle    1207 <put_maze+0xd7>
mov    0xc(%rsp),%eax
movslq %eax,%r12
mov    %r14d,%ecx
mov    %rcx,0x10(%rsp)
mov    %eax,%ebp
shl    $0x2,%r12
xor    %r15d,%r15d
lea    0xe4a(%rip),%r13
jmp    11d8 <put_maze+0xa8>
nopl   0x0(%rax,%rax,1)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r15
add    %r12,%rbx
cmp    0x10(%rsp),%r15
je     1207 <put_maze+0xd7>
cmpl   $0x0,0xc(%rsp)
jle    11c0 <put_maze+0x90>
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    (%rbx,%r14,4),%esi
mov    %r13,%rdi
call   1040 <printf@plt>
add    $0x1,%r14
cmp    %r14,%rbp
jne    11f0 <put_maze+0xc0>
jmp    11c0 <put_maze+0x90>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%2d \00"
define void @put_maze(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%9 = load i32, i32* %4
%10 = icmp sgt i32 %9, 1
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i32, i32* %5
%14 = icmp sgt i32 %13, 1
%15 = zext i1 %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load i32, i32* %4
%18 = icmp sle i32 %17, 100
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load i32, i32* %5
%22 = icmp sle i32 %21, 100
%23 = zext i1 %22 to i32
%24 = call i32 @assert(i32 %23)
%25 = load i32*, i32** %6
%26 = icmp ne i32* %25, null
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
store i32 0, i32* %7
br label %29
29: ; preds = %54, %3
%30 = load i32, i32* %7
%31 = load i32, i32* %5
%32 = icmp slt i32 %30, %31
br i1 %32, label %33, label %57
33: ; preds = %29
store i32 0, i32* %8
br label %34
34: ; preds = %49, %33
%35 = load i32, i32* %8
%36 = load i32, i32* %4
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %52
38: ; preds = %34
%39 = load i32*, i32** %6
%40 = load i32, i32* %7
%41 = load i32, i32* %4
%42 = mul nsw i32 %40, %41
%43 = load i32, i32* %8
%44 = add nsw i32 %42, %43
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds i32, i32* %39, i64 %45
%47 = load i32, i32* %46
%48 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %47)
br label %49
49: ; preds = %38
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
br label %34
52: ; preds = %34
%53 = call i32 @putchar(i8 signext 10)
br label %54
54: ; preds = %52
%55 = load i32, i32* %7
%56 = add nsw i32 %55, 1
store i32 %56, i32* %7
br label %29
57: ; preds = %29
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"%2d \00"
define void @put_maze(i32 %0, i32 %1, i32* %2) {
%4 = icmp sgt i32 %0, 1
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = icmp sgt i32 %1, 1
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = icmp slt i32 %0, 101
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = icmp slt i32 %1, 101
%14 = zext i1 %13 to i32
%15 = tail call i32 @assert(i32 %14)
%16 = icmp ne i32* %2, null
%17 = zext i1 %16 to i32
%18 = tail call i32 @assert(i32 %17)
%19 = icmp sgt i32 %1, 0
br i1 %19, label %20, label %29
20: ; preds = %3
%21 = icmp sgt i32 %0, 0
%22 = sext i32 %0 to i64
%23 = zext i32 %1 to i64
%24 = zext i32 %0 to i64
br label %25
25: ; preds = %20, %30
%26 = phi i64 [ 0, %20 ], [ %32, %30 ]
br i1 %21, label %27, label %30
27: ; preds = %25
%28 = mul nsw i64 %26, %22
br label %34
29: ; preds = %30, %3
ret void
30: ; preds = %34, %25
%31 = tail call i32 @putchar(i8 signext 10)
%32 = add nuw nsw i64 %26, 1
%33 = icmp eq i64 %32, %23
br i1 %33, label %29, label %25
34: ; preds = %27, %34
%35 = phi i64 [ 0, %27 ], [ %40, %34 ]
%36 = add nsw i64 %35, %28
%37 = getelementptr inbounds i32, i32* %2, i64 %36
%38 = load i32, i32* %37
%39 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %38)
%40 = add nuw nsw i64 %35, 1
%41 = icmp eq i64 %40, %24
br i1 %41, label %30, label %34
}