#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*/ mvprintw(int, int, char *);
void drawBoard() {
  int i = 0;
  int j = 0;
  for (i = 0; i < 40; i++) {
    for (j = 0; j < 20; j++) {
      if ((j == 0 | j == 20 - 1) | (i == 0 | i == 40 - 1)) {
        mvprintw(j, i, "#");
      }
    }
  }
}


x86 assembly (clang, -O0):
<drawBoard>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x28,-0x4(%rbp)
jge    11c2 <drawBoard+0xb2>
movl   $0x0,-0x8(%rbp)
cmpl   $0x14,-0x8(%rbp)
jge    11af <drawBoard+0x9f>
cmpl   $0x0,-0x8(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpl   $0x13,-0x8(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmpl   $0x0,-0x4(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmpl   $0x27,-0x4(%rbp)
sete   %dl
and    $0x1,%dl
movzbl %dl,%edx
or     %edx,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     119c <drawBoard+0x8c>
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
lea    0xe69(%rip),%rdx
call   1030 <mvprintw@plt>
jmp    11a1 <drawBoard+0x91>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    113e <drawBoard+0x2e>
jmp    11b4 <drawBoard+0xa4>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112d <drawBoard+0x1d>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawBoard>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
xor    %r15d,%r15d
lea    0xedf(%rip),%r14
jmp    113a <drawBoard+0x2a>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0x1,%r15d
cmp    $0x28,%r15d
je     117b <drawBoard+0x6b>
test   %r15d,%r15d
sete   %al
cmp    $0x27,%r15d
sete   %bl
or     %al,%bl
xor    %ebp,%ebp
jmp    1158 <drawBoard+0x48>
nopl   (%rax)
add    $0x1,%ebp
cmp    $0x14,%ebp
je     1130 <drawBoard+0x20>
test   %ebp,%ebp
sete   %al
cmp    $0x13,%ebp
sete   %cl
or     %al,%cl
or     %bl,%cl
cmp    $0x1,%cl
jne    1150 <drawBoard+0x40>
mov    %ebp,%edi
mov    %r15d,%esi
mov    %r14,%rdx
call   1030 <mvprintw@plt>
jmp    1150 <drawBoard+0x40>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"#\00"
define void @drawBoard() {
br label %1
1: ; preds = %0, %17
%2 = phi i32 [ 0, %0 ], [ %18, %17 ]
%3 = icmp eq i32 %2, 0
%4 = icmp eq i32 %2, 39
%5 = or i1 %3, %4
br label %6
6: ; preds = %1, %14
%7 = phi i32 [ 0, %1 ], [ %15, %14 ]
%8 = icmp eq i32 %7, 0
%9 = icmp eq i32 %7, 19
%10 = or i1 %8, %9
%11 = or i1 %5, %10
br i1 %11, label %12, label %14
12: ; preds = %6
%13 = tail call i32 @mvprintw(i32 %7, i32 %2, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %6, %12
%15 = add nuw nsw i32 %7, 1
%16 = icmp eq i32 %15, 20
br i1 %16, label %17, label %6
17: ; preds = %14
%18 = add nuw nsw i32 %2, 1
%19 = icmp eq i32 %18, 40
br i1 %19, label %20, label %1
20: ; preds = %17
ret void
}