#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();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ mvaddch(int, int, char);
int /*<<< orphan*/ printw(char *, char *);
int /*<<< orphan*/ refresh();
void drawScreen(char *field, int row, int col, char *name) {
  int x = 0;
  int y = 0;
  clear();
  for (y = 0; y < row; y++) {
    for (x = 0; x < col; x++) {
      if (field[y * col + x] == 1) {
        mvaddch(y, x, '*');
      }
    }
  }
  move(15, 50);
  printw("!!! %s ARE WIN !!!", name);
  refresh();
}


x86 assembly (clang, -O0):
<drawScreen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    $0x0,%al
call   1060 <clear@plt>
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11f5 <drawScreen+0xa5>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    11e2 <drawScreen+0x92>
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%ecx
imul   -0x10(%rbp),%ecx
add    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x1,%eax
jne    11cf <drawScreen+0x7f>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    $0x2a,%edx
call   1050 <mvaddch@plt>
jmp    11d4 <drawScreen+0x84>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1195 <drawScreen+0x45>
jmp    11e7 <drawScreen+0x97>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1182 <drawScreen+0x32>
mov    $0xf,%edi
mov    $0x32,%esi
call   1070 <move@plt>
mov    -0x18(%rbp),%rsi
lea    0xdf1(%rip),%rdi
call   1030 <printw@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drawScreen>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,0x10(%rsp)
mov    %edx,0xc(%rsp)
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1060 <clear@plt>
test   %ebp,%ebp
jle    11d0 <drawScreen+0x80>
movslq 0xc(%rsp),%r13
mov    %ebp,%r14d
mov    %r13d,%r15d
xor    %r12d,%r12d
jmp    119c <drawScreen+0x4c>
nopw   0x0(%rax,%rax,1)
add    $0x1,%r12
add    %r13,%rbx
cmp    %r14,%r12
je     11d0 <drawScreen+0x80>
cmpl   $0x0,0xc(%rsp)
jle    1190 <drawScreen+0x40>
xor    %ebp,%ebp
jmp    11b9 <drawScreen+0x69>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    %rbp,%r15
je     1190 <drawScreen+0x40>
cmpb   $0x1,(%rbx,%rbp,1)
jne    11b0 <drawScreen+0x60>
mov    %r12d,%edi
mov    %ebp,%esi
mov    $0x2a,%edx
call   1050 <mvaddch@plt>
jmp    11b0 <drawScreen+0x60>
mov    $0xf,%edi
mov    $0x32,%esi
call   1070 <move@plt>
lea    0xe1a(%rip),%rdi
mov    0x10(%rsp),%rsi
call   1030 <printw@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@.str = [19 x i8] c"!!! %s ARE WIN !!!\00"
define void @drawScreen(i8* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
store i32 0, i32* %9
store i32 0, i32* %10
%11 = call i32 (...) @clear()
store i32 0, i32* %10
br label %12
12: ; preds = %42, %4
%13 = load i32, i32* %10
%14 = load i32, i32* %6
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %45
16: ; preds = %12
store i32 0, i32* %9
br label %17
17: ; preds = %38, %16
%18 = load i32, i32* %9
%19 = load i32, i32* %7
%20 = icmp slt i32 %18, %19
br i1 %20, label %21, label %41
21: ; preds = %17
%22 = load i8*, i8** %5
%23 = load i32, i32* %10
%24 = load i32, i32* %7
%25 = mul nsw i32 %23, %24
%26 = load i32, i32* %9
%27 = add nsw i32 %25, %26
%28 = sext i32 %27 to i64
%29 = getelementptr inbounds i8, i8* %22, i64 %28
%30 = load i8, i8* %29
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %37
33: ; preds = %21
%34 = load i32, i32* %10
%35 = load i32, i32* %9
%36 = call i32 @mvaddch(i32 %34, i32 %35, i8 signext 42)
br label %37
37: ; preds = %33, %21
br label %38
38: ; preds = %37
%39 = load i32, i32* %9
%40 = add nsw i32 %39, 1
store i32 %40, i32* %9
br label %17
41: ; preds = %17
br label %42
42: ; preds = %41
%43 = load i32, i32* %10
%44 = add nsw i32 %43, 1
store i32 %44, i32* %10
br label %12
45: ; preds = %12
%46 = call i32 @move(i32 15, i32 50)
%47 = load i8*, i8** %8
%48 = call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %47)
%49 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"!!! %s ARE WIN !!!\00"
define void @drawScreen(i8* nocapture %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 (...) @clear()
%6 = icmp sgt i32 %1, 0
br i1 %6, label %7, label %32
7: ; preds = %4
%8 = icmp sgt i32 %2, 0
%9 = sext i32 %2 to i64
%10 = zext i32 %1 to i64
%11 = zext i32 %2 to i64
br label %12
12: ; preds = %7, %29
%13 = phi i64 [ 0, %7 ], [ %30, %29 ]
br i1 %8, label %14, label %29
14: ; preds = %12
%15 = mul nsw i64 %13, %9
%16 = trunc i64 %13 to i32
br label %17
17: ; preds = %14, %26
%18 = phi i64 [ 0, %14 ], [ %27, %26 ]
%19 = add nsw i64 %18, %15
%20 = getelementptr inbounds i8, i8* %0, i64 %19
%21 = load i8, i8* %20
%22 = icmp eq i8 %21, 1
br i1 %22, label %23, label %26
23: ; preds = %17
%24 = trunc i64 %18 to i32
%25 = tail call i32 @mvaddch(i32 %16, i32 %24, i8 signext 42)
br label %26
26: ; preds = %17, %23
%27 = add nuw nsw i64 %18, 1
%28 = icmp eq i64 %27, %11
br i1 %28, label %29, label %17
29: ; preds = %26, %12
%30 = add nuw nsw i64 %13, 1
%31 = icmp eq i64 %30, %10
br i1 %31, label %32, label %12
32: ; preds = %29, %4
%33 = tail call i32 @move(i32 15, i32 50)
%34 = tail call i32 @printw(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %3)
%35 = tail call i32 (...) @refresh()
ret void
}