#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 */
typedef int /*<<< orphan*/ tabla;

/* Variables and functions */
int /*<<< orphan*/ clear();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ win_end();
int /*<<< orphan*/ win_init();
int /*<<< orphan*/ win_print(char ***, int, int);
int main() {
  short i, j;
  char tabla[6][7];
  for (i = 0; i < 6; i++) {
    for (j = 0; j < 7; j++)
      tabla[i][j] = 'O';
  }
  win_init();
  win_print(&tabla, sizeof(tabla) / sizeof(tabla[1]), sizeof(tabla[1]));
  getch();
  tabla[5][3] = 'X';
  refresh();
  clear();
  win_print(&tabla, sizeof(tabla) / sizeof(tabla[1]), sizeof(tabla[1]));
  win_end();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
movw   $0x0,-0x6(%rbp)
movswl -0x6(%rbp),%eax
cmp    $0x6,%eax
jge    11d5 <main+0x75>
movw   $0x0,-0x8(%rbp)
movswl -0x8(%rbp),%eax
cmp    $0x7,%eax
jge    11bf <main+0x5f>
movswq -0x6(%rbp),%rcx
lea    -0x40(%rbp),%rax
imul   $0x7,%rcx,%rcx
add    %rcx,%rax
movswq -0x8(%rbp),%rcx
movb   $0x4f,(%rax,%rcx,1)
mov    -0x8(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x8(%rbp)
jmp    1188 <main+0x28>
jmp    11c4 <main+0x64>
mov    -0x6(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x6(%rbp)
jmp    1175 <main+0x15>
mov    $0x0,%al
call   1040 <win_init@plt>
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
mov    $0x7,%edx
call   1050 <win_print@plt>
mov    $0x0,%al
call   1070 <getch@plt>
movb   $0x58,-0x1a(%rbp)
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x0,%al
call   1080 <clear@plt>
lea    -0x40(%rbp),%rdi
mov    $0x6,%esi
mov    $0x7,%edx
call   1050 <win_print@plt>
mov    $0x0,%al
call   1030 <win_end@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x30,%rsp
movaps 0xe94(%rip),%xmm0
movups %xmm0,0x1a(%rsp)
movaps %xmm0,0x10(%rsp)
movaps %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <win_init@plt>
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x7,%edx
call   1050 <win_print@plt>
xor    %eax,%eax
call   1070 <getch@plt>
movb   $0x58,0x26(%rsp)
xor    %eax,%eax
call   1060 <refresh@plt>
xor    %eax,%eax
call   1080 <clear@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
mov    $0x7,%edx
call   1050 <win_print@plt>
xor    %eax,%eax
call   1030 <win_end@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i16
%3 = alloca i16
%4 = alloca [6 x [7 x i8]]
store i32 0, i32* %1
store i16 0, i16* %2
br label %5
5: ; preds = %25, %0
%6 = load i16, i16* %2
%7 = sext i16 %6 to i32
%8 = icmp slt i32 %7, 6
br i1 %8, label %9, label %28
9: ; preds = %5
store i16 0, i16* %3
br label %10
10: ; preds = %21, %9
%11 = load i16, i16* %3
%12 = sext i16 %11 to i32
%13 = icmp slt i32 %12, 7
br i1 %13, label %14, label %24
14: ; preds = %10
%15 = load i16, i16* %2
%16 = sext i16 %15 to i64
%17 = getelementptr inbounds [6 x [7 x i8]], [6 x [7 x i8]]* %4, i64 0, i64 %16
%18 = load i16, i16* %3
%19 = sext i16 %18 to i64
%20 = getelementptr inbounds [7 x i8], [7 x i8]* %17, i64 0, i64 %19
store i8 79, i8* %20
br label %21
21: ; preds = %14
%22 = load i16, i16* %3
%23 = add i16 %22, 1
store i16 %23, i16* %3
br label %10
24: ; preds = %10
br label %25
25: ; preds = %24
%26 = load i16, i16* %2
%27 = add i16 %26, 1
store i16 %27, i16* %2
br label %5
28: ; preds = %5
%29 = call i32 (...) @win_init()
%30 = bitcast [6 x [7 x i8]]* %4 to i8***
%31 = call i32 @win_print(i8*** %30, i32 6, i32 7)
%32 = call i32 (...) @getch()
%33 = getelementptr inbounds [6 x [7 x i8]], [6 x [7 x i8]]* %4, i64 0, i64 5
%34 = getelementptr inbounds [7 x i8], [7 x i8]* %33, i64 0, i64 3
store i8 88, i8* %34
%35 = call i32 (...) @refresh()
%36 = call i32 (...) @clear()
%37 = bitcast [6 x [7 x i8]]* %4 to i8***
%38 = call i32 @win_print(i8*** %37, i32 6, i32 7)
%39 = call i32 (...) @win_end()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [6 x [7 x i8]]
%2 = getelementptr inbounds [6 x [7 x i8]], [6 x [7 x i8]]* %1, i64 0, i64 0, i64 0
%3 = getelementptr inbounds [6 x [7 x i8]], [6 x [7 x i8]]* %1, i64 0, i64 0, i64 0
%4 = tail call i32 (...) @win_init()
%5 = bitcast [6 x [7 x i8]]* %1 to i8***
%6 = call i32 @win_print(i8*** %5, i32 6, i32 7)
%7 = call i32 (...) @getch()
%8 = getelementptr inbounds [6 x [7 x i8]], [6 x [7 x i8]]* %1, i64 0, i64 5, i64 3
store i8 88, i8* %8
%9 = call i32 (...) @refresh()
%10 = call i32 (...) @clear()
%11 = call i32 @win_print(i8*** %5, i32 6, i32 7)
%12 = call i32 (...) @win_end()
ret i32 0
}