#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*/ closescreen();
int /*<<< orphan*/ draw(int **);
int /*<<< orphan*/ initscreen();
int /*<<< orphan*/ sleep(int);
int main() {
  initscreen();
  int matrix[64][32] = {0};
  matrix[1][1] = 1;
  matrix[1][2] = 1;
  draw(matrix);
  sleep(3);
  matrix[1][3] = 1;
  draw(matrix);
  sleep(3);
  closescreen();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2010,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscreen@plt>
lea    -0x2010(%rbp),%rdi
xor    %esi,%esi
mov    $0x2000,%edx
call   1050 <memset@plt>
movl   $0x1,-0x1f8c(%rbp)
movl   $0x1,-0x1f88(%rbp)
lea    -0x2010(%rbp),%rdi
call   1040 <draw@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
movl   $0x1,-0x1f84(%rbp)
lea    -0x2010(%rbp),%rdi
call   1040 <draw@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
mov    $0x0,%al
call   1060 <closescreen@plt>
xor    %eax,%eax
add    $0x2010,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x2000,%rsp
xor    %eax,%eax
call   1030 <initscreen@plt>
mov    %rsp,%rbx
mov    $0x2000,%edx
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <memset@plt>
movabs $0x100000001,%rax
mov    %rax,0x84(%rsp)
mov    %rbx,%rdi
call   1040 <draw@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
movl   $0x1,0x8c(%rsp)
mov    %rbx,%rdi
call   1040 <draw@plt>
mov    $0x3,%edi
call   1070 <sleep@plt>
xor    %eax,%eax
call   1060 <closescreen@plt>
xor    %eax,%eax
add    $0x2000,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [64 x [32 x i32]]
store i32 0, i32* %1
%3 = call i32 (...) @initscreen()
%4 = bitcast [64 x [32 x i32]]* %2 to i8*
%5 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %2, i64 0, i64 1
%6 = getelementptr inbounds [32 x i32], [32 x i32]* %5, i64 0, i64 1
store i32 1, i32* %6
%7 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %2, i64 0, i64 1
%8 = getelementptr inbounds [32 x i32], [32 x i32]* %7, i64 0, i64 2
store i32 1, i32* %8
%9 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %2, i64 0, i64 0
%10 = bitcast [32 x i32]* %9 to i32**
%11 = call i32 @draw(i32** %10)
%12 = call i32 @sleep(i32 3)
%13 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %2, i64 0, i64 1
%14 = getelementptr inbounds [32 x i32], [32 x i32]* %13, i64 0, i64 3
store i32 1, i32* %14
%15 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %2, i64 0, i64 0
%16 = bitcast [32 x i32]* %15 to i32**
%17 = call i32 @draw(i32** %16)
%18 = call i32 @sleep(i32 3)
%19 = call i32 (...) @closescreen()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [64 x [32 x i32]]
%2 = tail call i32 (...) @initscreen()
%3 = bitcast [64 x [32 x i32]]* %1 to i8*
%4 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %1, i64 0, i64 1, i64 1
store i32 1, i32* %4
%5 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %1, i64 0, i64 1, i64 2
store i32 1, i32* %5
%6 = bitcast [64 x [32 x i32]]* %1 to i32**
%7 = call i32 @draw(i32** %6)
%8 = call i32 @sleep(i32 3)
%9 = getelementptr inbounds [64 x [32 x i32]], [64 x [32 x i32]]* %1, i64 0, i64 1, i64 3
store i32 1, i32* %9
%10 = call i32 @draw(i32** %6)
%11 = call i32 @sleep(i32 3)
%12 = call i32 (...) @closescreen()
ret i32 0
}