#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*/ print_flick(int);
int /*<<< orphan*/ print_number(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ putchar(char);
void c_show_map(int **map, int length, int x, int y) {
  int row, col;
  printf("show_map\n");
  for (row = 0; row < length; row++) {
    for (col = 0; col < length; col++) {
      printf("\033[31;1m|\033[0m");
      if (row == x && col == y) {
        print_flick(*(*(map + row) + col));
      } else {
        print_number(*(*(map + row) + col));
      }
    }
    printf("\033[31;1m|\033[0m");
    putchar('\n');
  }
}


x86 assembly (clang, -O0):
<c_show_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
lea    0xea4(%rip),%rdi
call   1040 <printf@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1217 <c_show_map+0xd7>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f3 <c_show_map+0xb3>
lea    0xe7c(%rip),%rdi
call   1040 <printf@plt>
mov    -0x18(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    11c8 <c_show_map+0x88>
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11c8 <c_show_map+0x88>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1060 <print_flick@plt>
jmp    11e0 <c_show_map+0xa0>
mov    -0x8(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <print_number@plt>
jmp    11e5 <c_show_map+0xa5>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    117b <c_show_map+0x3b>
lea    0xe10(%rip),%rdi
call   1040 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1168 <c_show_map+0x28>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_show_map>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %ecx,%r15d
mov    %edx,%r14d
mov    %esi,%r12d
mov    %rdi,%r13
lea    0xe9f(%rip),%rdi
call   1040 <puts@plt>
test   %r12d,%r12d
jle    11f7 <c_show_map+0xa7>
mov    %r15d,%ebp
mov    %r14d,%r15d
mov    %r12d,%r12d
xor    %ebx,%ebx
jmp    11af <c_show_map+0x5f>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0xe69(%rip),%rdi
call   1050 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    %r12,%rbx
je     11f7 <c_show_map+0xa7>
xor    %r14d,%r14d
jmp    11d2 <c_show_map+0x82>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    (%rax,%r14,4),%edi
call   1060 <print_number@plt>
add    $0x1,%r14
cmp    %r14,%r12
je     1190 <c_show_map+0x40>
lea    0xe27(%rip),%rdi
call   1050 <printf@plt>
mov    0x0(%r13,%rbx,8),%rax
cmp    %r15,%rbx
jne    11c0 <c_show_map+0x70>
cmp    %r14,%rbp
jne    11c0 <c_show_map+0x70>
mov    (%rax,%rbp,4),%edi
call   1070 <print_flick@plt>
jmp    11c9 <c_show_map+0x79>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"show_map\0A\00"
@.str.1 = [13 x i8] c"\1B[31;1m|\1B[0m\00"
define void @c_show_map(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 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %9
br label %12
12: ; preds = %59, %4
%13 = load i32, i32* %9
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %62
16: ; preds = %12
store i32 0, i32* %10
br label %17
17: ; preds = %53, %16
%18 = load i32, i32* %10
%19 = load i32, i32* %6
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %56
21: ; preds = %17
%22 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%23 = load i32, i32* %9
%24 = load i32, i32* %7
%25 = icmp eq i32 %23, %24
br i1 %25, label %26, label %41
26: ; preds = %21
%27 = load i32, i32* %10
%28 = load i32, i32* %8
%29 = icmp eq i32 %27, %28
br i1 %29, label %30, label %41
30: ; preds = %26
%31 = load i32**, i32*** %5
%32 = load i32, i32* %9
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds i32*, i32** %31, i64 %33
%35 = load i32*, i32** %34
%36 = load i32, i32* %10
%37 = sext i32 %36 to i64
%38 = getelementptr inbounds i32, i32* %35, i64 %37
%39 = load i32, i32* %38
%40 = call i32 @print_flick(i32 %39)
br label %52
41: ; preds = %26, %21
%42 = load i32**, i32*** %5
%43 = load i32, i32* %9
%44 = sext i32 %43 to i64
%45 = getelementptr inbounds i32*, i32** %42, i64 %44
%46 = load i32*, i32** %45
%47 = load i32, i32* %10
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = load i32, i32* %49
%51 = call i32 @print_number(i32 %50)
br label %52
52: ; preds = %41, %30
br label %53
53: ; preds = %52
%54 = load i32, i32* %10
%55 = add nsw i32 %54, 1
store i32 %55, i32* %10
br label %17
56: ; preds = %17
%57 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%58 = call i32 @putchar(i8 signext 10)
br label %59
59: ; preds = %56
%60 = load i32, i32* %9
%61 = add nsw i32 %60, 1
store i32 %61, i32* %9
br label %12
62: ; preds = %12
ret void
}

LLVM IR (-O2):
@.str.1 = [13 x i8] c"\1B[31;1m|\1B[0m\00"
@str = [9 x i8] c"show_map\00"
define void @c_show_map(i32** nocapture %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %37
7: ; preds = %4
%8 = zext i32 %3 to i64
%9 = zext i32 %2 to i64
%10 = zext i32 %1 to i64
br label %11
11: ; preds = %32, %7
%12 = phi i64 [ 0, %7 ], [ %35, %32 ]
%13 = icmp eq i64 %12, %9
%14 = getelementptr inbounds i32*, i32** %0, i64 %12
br label %15
15: ; preds = %11, %29
%16 = phi i64 [ 0, %11 ], [ %30, %29 ]
%17 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %16, %8
%19 = select i1 %13, i1 %18, i1 false
%20 = load i32*, i32** %14
br i1 %19, label %21, label %25
21: ; preds = %15
%22 = getelementptr inbounds i32, i32* %20, i64 %8
%23 = load i32, i32* %22
%24 = tail call i32 @print_flick(i32 %23)
br label %29
25: ; preds = %15
%26 = getelementptr inbounds i32, i32* %20, i64 %16
%27 = load i32, i32* %26
%28 = tail call i32 @print_number(i32 %27)
br label %29
29: ; preds = %21, %25
%30 = add nuw nsw i64 %16, 1
%31 = icmp eq i64 %30, %10
br i1 %31, label %32, label %15
32: ; preds = %29
%33 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%34 = tail call i32 @putchar(i8 signext 10)
%35 = add nuw nsw i64 %12, 1
%36 = icmp eq i64 %35, %10
br i1 %36, label %37, label %11
37: ; preds = %32, %4
ret void
}