#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*/ printf(char *, char);
void print_map(char map[10][20]) {
  int i, j, rowLimit = 10, colLimit = 20;
  for (size_t i = 0; i < rowLimit; i++) {
    for (size_t j = 0; j < colLimit; j++) {
      if (j == colLimit - 1)
        printf("%c\n", map[i][j]);
      else
        printf("%c", map[i][j]);
    }
  }
  return;
}


x86 assembly (clang, -O0):
<print_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0xa,-0x14(%rbp)
movl   $0x14,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmp    %rcx,%rax
jae    11e3 <print_map+0xd3>
movq   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x18(%rbp),%rcx
cmp    %rcx,%rax
jae    11cd <print_map+0xbd>
mov    -0x28(%rbp),%rax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
jne    1197 <print_map+0x87>
mov    -0x8(%rbp),%rax
imul   $0x14,-0x20(%rbp),%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
lea    0xe77(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
jmp    11b7 <print_map+0xa7>
mov    -0x8(%rbp),%rax
imul   $0x14,-0x20(%rbp),%rcx
add    %rcx,%rax
mov    -0x28(%rbp),%rcx
lea    0xe56(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1030 <printf@plt>
jmp    11bc <print_map+0xac>
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    114b <print_map+0x3b>
jmp    11d2 <print_map+0xc2>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1132 <print_map+0x22>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_map>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdi,%r12
mov    $0x13,%ebx
lea    0xedd(%rip),%r14
lea    0xed2(%rip),%r15
xchg   %ax,%ax
movsbl -0x13(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x12(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x11(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x10(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0xf(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0xe(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0xd(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0xc(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0xb(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0xa(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x9(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x8(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x7(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x6(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x5(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x4(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x3(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x2(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl -0x1(%r12,%rbx,1),%esi
mov    %r14,%rdi
call   1030 <printf@plt>
movsbl (%r12,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <printf@plt>
add    $0x14,%rbx
cmp    $0xdb,%rbx
jne    1130 <print_map+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%c\0A\00"
@.str.1 = [3 x i8] c"%c\00"
define void @print_map([20 x i8]* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = phi i64 [ 0, %1 ], [ %64, %2 ]
%4 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 19
%5 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 0
%6 = load i8, i8* %5
%7 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %6)
%8 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 1
%9 = load i8, i8* %8
%10 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %9)
%11 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 2
%12 = load i8, i8* %11
%13 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %12)
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 3
%15 = load i8, i8* %14
%16 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %15)
%17 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 4
%18 = load i8, i8* %17
%19 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %18)
%20 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 5
%21 = load i8, i8* %20
%22 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %21)
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 6
%24 = load i8, i8* %23
%25 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %24)
%26 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 7
%27 = load i8, i8* %26
%28 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %27)
%29 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 8
%30 = load i8, i8* %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %30)
%32 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 9
%33 = load i8, i8* %32
%34 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %33)
%35 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 10
%36 = load i8, i8* %35
%37 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %36)
%38 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 11
%39 = load i8, i8* %38
%40 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %39)
%41 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 12
%42 = load i8, i8* %41
%43 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %42)
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 13
%45 = load i8, i8* %44
%46 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %45)
%47 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 14
%48 = load i8, i8* %47
%49 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %48)
%50 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 15
%51 = load i8, i8* %50
%52 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %51)
%53 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 16
%54 = load i8, i8* %53
%55 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %54)
%56 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 17
%57 = load i8, i8* %56
%58 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %57)
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %0, i64 %3, i64 18
%60 = load i8, i8* %59
%61 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8 signext %60)
%62 = load i8, i8* %4
%63 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8 signext %62)
%64 = add nuw nsw i64 %3, 1
%65 = icmp eq i64 %64, 10
br i1 %65, label %66, label %2
66: ; preds = %2
ret void
}