#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 *, ...);
void output_map(unsigned map[24][80]) {
  int x;
  int y;
  for (y = 0; y < 24; ++y) {
    for (x = 0; x < 80; ++x) {
      printf("%c", map[y][x] ? '.' : '#');
    }
    printf("\n");
  }
}


x86 assembly (clang, -O0):
<output_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x18,-0x10(%rbp)
jge    119f <output_map+0x8f>
movl   $0x0,-0xc(%rbp)
cmpl   $0x50,-0xc(%rbp)
jge    1183 <output_map+0x73>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
imul   $0x140,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
mov    $0x23,%esi
mov    $0x2e,%eax
cmp    $0x0,%ecx
cmovne %eax,%esi
lea    0xe92(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1134 <output_map+0x24>
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1123 <output_map+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_map>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
xor    %r14d,%r14d
jmp    113b <output_map+0x2b>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14
add    $0x140,%r15
cmp    $0x18,%r14
je     1162 <output_map+0x52>
xor    %ebx,%ebx
jmp    114f <output_map+0x3f>
nop
call   1030 <putchar@plt>
add    $0x1,%rbx
cmp    $0x50,%rbx
je     1120 <output_map+0x10>
cmpl   $0x0,(%r15,%rbx,4)
mov    $0x23,%edi
je     1140 <output_map+0x30>
mov    $0x2e,%edi
jmp    1140 <output_map+0x30>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%c\00"
@.str.1 = [2 x i8] c"\0A\00"
define void @output_map([80 x i32]* %0) {
%2 = alloca [80 x i32]*
%3 = alloca i32
%4 = alloca i32
store [80 x i32]* %0, [80 x i32]** %2
store i32 0, i32* %4
br label %5
5: ; preds = %30, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 24
br i1 %7, label %8, label %33
8: ; preds = %5
store i32 0, i32* %3
br label %9
9: ; preds = %25, %8
%10 = load i32, i32* %3
%11 = icmp slt i32 %10, 80
br i1 %11, label %12, label %28
12: ; preds = %9
%13 = load [80 x i32]*, [80 x i32]** %2
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [80 x i32], [80 x i32]* %13, i64 %15
%17 = load i32, i32* %3
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds [80 x i32], [80 x i32]* %16, i64 0, i64 %18
%20 = load i32, i32* %19
%21 = icmp ne i32 %20, 0
%22 = zext i1 %21 to i64
%23 = select i1 %21, i32 46, i32 35
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %23)
br label %25
25: ; preds = %12
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %9
28: ; preds = %9
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %5
33: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @output_map([80 x i32]* nocapture %0) {
br label %2
2: ; preds = %1, %13
%3 = phi i64 [ 0, %1 ], [ %15, %13 ]
br label %4
4: ; preds = %2, %4
%5 = phi i64 [ 0, %2 ], [ %11, %4 ]
%6 = getelementptr inbounds [80 x i32], [80 x i32]* %0, i64 %3, i64 %5
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 0
%9 = select i1 %8, i32 35, i32 46
%10 = tail call i32 @putchar(i32 %9)
%11 = add nuw nsw i64 %5, 1
%12 = icmp eq i64 %11, 80
br i1 %12, label %13, label %4
13: ; preds = %4
%14 = tail call i32 @putchar(i32 10)
%15 = add nuw nsw i64 %3, 1
%16 = icmp eq i64 %15, 24
br i1 %16, label %17, label %2
17: ; preds = %13
ret void
}