#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*/ clear_screen();
int /*<<< orphan*/ disp_craters();
int /*<<< orphan*/ disp_hex(int, int, char);
int /*<<< orphan*/ off_map(int, int);
int /*<<< orphan*/ tc_setup();
init_screen() {
  int a, b;
  tc_setup();
  clear_screen();
  for (a = 1; a <= 28; a++) {
    for (b = 1; b <= 28; b++) {
      if (!off_map(a, b)) {
        disp_hex(a, b, '.');
      }
    }
  }
  disp_craters();
}


x86 assembly (clang, -O0):
<init_screen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <tc_setup@plt>
mov    $0x0,%al
call   1060 <clear_screen@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1c,-0x8(%rbp)
jg     11d2 <init_screen+0x82>
movl   $0x1,-0xc(%rbp)
cmpl   $0x1c,-0xc(%rbp)
jg     11bf <init_screen+0x6f>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1050 <off_map@plt>
cmp    $0x0,%eax
jne    11ac <init_screen+0x5c>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x2e,%edx
call   1030 <disp_hex@plt>
jmp    11b1 <init_screen+0x61>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    117e <init_screen+0x2e>
jmp    11c4 <init_screen+0x74>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    116d <init_screen+0x1d>
mov    $0x0,%al
call   1070 <disp_craters@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init_screen>:
push   %rbp
push   %rbx
push   %rax
xor    %eax,%eax
call   1040 <tc_setup@plt>
xor    %eax,%eax
call   1060 <clear_screen@plt>
mov    $0x1,%ebx
jmp    1178 <init_screen+0x28>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x1d,%ebx
je     11a5 <init_screen+0x55>
mov    $0x1,%ebp
jmp    1188 <init_screen+0x38>
nop
add    $0x1,%ebp
cmp    $0x1d,%ebp
je     1170 <init_screen+0x20>
mov    %ebx,%edi
mov    %ebp,%esi
call   1050 <off_map@plt>
test   %eax,%eax
jne    1180 <init_screen+0x30>
mov    %ebx,%edi
mov    %ebp,%esi
mov    $0x2e,%edx
call   1030 <disp_hex@plt>
jmp    1180 <init_screen+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1070 <disp_craters@plt>

LLVM IR (-O0):
define i32 @init_screen() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @tc_setup()
%5 = call i32 (...) @clear_screen()
store i32 1, i32* %2
br label %6
6: ; preds = %27, %0
%7 = load i32, i32* %2
%8 = icmp sle i32 %7, 28
br i1 %8, label %9, label %30
9: ; preds = %6
store i32 1, i32* %3
br label %10
10: ; preds = %23, %9
%11 = load i32, i32* %3
%12 = icmp sle i32 %11, 28
br i1 %12, label %13, label %26
13: ; preds = %10
%14 = load i32, i32* %2
%15 = load i32, i32* %3
%16 = call i32 @off_map(i32 %14, i32 %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %22, label %18
18: ; preds = %13
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @disp_hex(i32 %19, i32 %20, i8 signext 46)
br label %22
22: ; preds = %18, %13
br label %23
23: ; preds = %22
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
br label %10
26: ; preds = %10
br label %27
27: ; preds = %26
%28 = load i32, i32* %2
%29 = add nsw i32 %28, 1
store i32 %29, i32* %2
br label %6
30: ; preds = %6
%31 = call i32 (...) @disp_craters()
%32 = load i32, i32* %1
ret i32 %32
}

LLVM IR (-O2):
define i32 @init_screen() {
%1 = tail call i32 (...) @tc_setup()
%2 = tail call i32 (...) @clear_screen()
br label %3
3: ; preds = %0, %14
%4 = phi i32 [ 1, %0 ], [ %15, %14 ]
br label %5
5: ; preds = %3, %11
%6 = phi i32 [ 1, %3 ], [ %12, %11 ]
%7 = tail call i32 @off_map(i32 %4, i32 %6)
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 @disp_hex(i32 %4, i32 %6, i8 signext 46)
br label %11
11: ; preds = %5, %9
%12 = add nuw nsw i32 %6, 1
%13 = icmp eq i32 %12, 29
br i1 %13, label %14, label %5
14: ; preds = %11
%15 = add nuw nsw i32 %4, 1
%16 = icmp eq i32 %15, 29
br i1 %16, label %17, label %3
17: ; preds = %14
%18 = tail call i32 (...) @disp_craters()
ret i32 undef
}