#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*/ lcd_display_map_bit(int, int, unsigned char);
void lcd_display_map(unsigned char grid[48][84]) {
  int y, x;
  for (y = 0; y < 48; y++)
    for (x = 0; x < 84; x++)
      lcd_display_map_bit(y, x, grid[y][x]);
}


x86 assembly (clang, -O0):
<lcd_display_map>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x30,-0xc(%rbp)
jge    1181 <lcd_display_map+0x71>
movl   $0x0,-0x10(%rbp)
cmpl   $0x54,-0x10(%rbp)
jge    116e <lcd_display_map+0x5e>
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x54,%rcx,%rcx
add    %rcx,%rax
movslq -0x10(%rbp),%rcx
movzbl (%rax,%rcx,1),%edx
call   1030 <lcd_display_map_bit@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1134 <lcd_display_map+0x24>
jmp    1173 <lcd_display_map+0x63>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <lcd_display_map+0x13>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lcd_display_map>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%r14,%rbx,1),%edx
mov    %r15d,%edi
mov    %ebx,%esi
call   1030 <lcd_display_map_bit@plt>
add    $0x1,%rbx
cmp    $0x54,%rbx
jne    1130 <lcd_display_map+0x20>
add    $0x1,%r15
add    $0x54,%r14
cmp    $0x30,%r15
jne    1120 <lcd_display_map+0x10>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @lcd_display_map([84 x i8]* %0) {
%2 = alloca [84 x i8]*
%3 = alloca i32
%4 = alloca i32
store [84 x i8]* %0, [84 x i8]** %2
store i32 0, i32* %3
br label %5
5: ; preds = %28, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 48
br i1 %7, label %8, label %31
8: ; preds = %5
store i32 0, i32* %4
br label %9
9: ; preds = %24, %8
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 84
br i1 %11, label %12, label %27
12: ; preds = %9
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = load [84 x i8]*, [84 x i8]** %2
%16 = load i32, i32* %3
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [84 x i8], [84 x i8]* %15, i64 %17
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds [84 x i8], [84 x i8]* %18, i64 0, i64 %20
%22 = load i8, i8* %21
%23 = call i32 @lcd_display_map_bit(i32 %13, i32 %14, i8 zeroext %22)
br label %24
24: ; preds = %12
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %9
27: ; preds = %9
br label %28
28: ; preds = %27
%29 = load i32, i32* %3
%30 = add nsw i32 %29, 1
store i32 %30, i32* %3
br label %5
31: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @lcd_display_map([84 x i8]* nocapture %0) {
br label %2
2: ; preds = %1, %13
%3 = phi i64 [ 0, %1 ], [ %14, %13 ]
%4 = trunc i64 %3 to i32
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ 0, %2 ], [ %11, %5 ]
%7 = getelementptr inbounds [84 x i8], [84 x i8]* %0, i64 %3, i64 %6
%8 = load i8, i8* %7
%9 = trunc i64 %6 to i32
%10 = tail call i32 @lcd_display_map_bit(i32 %4, i32 %9, i8 zeroext %8)
%11 = add nuw nsw i64 %6, 1
%12 = icmp eq i64 %11, 84
br i1 %12, label %13, label %5
13: ; preds = %5
%14 = add nuw nsw i64 %3, 1
%15 = icmp eq i64 %14, 48
br i1 %15, label %16, label %2
16: ; preds = %13
ret void
}