#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*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ A_BOLD;
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *, char);
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ werase(int /*<<< orphan*/ *);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, ...);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void sprintarr(WINDOW *win, int size, char array[size][size], int x, int y) {
  int i, j;
  werase(win);
  wmove(win, 0, 0);
  wprintw(win, "   ");
  for (i = 0; i < size; i++)
    if (i < 10)
      wprintw(win, " %d ", i);
    else
      wprintw(win, "%d ", i);
  for (i = 0; i < size; i++) {
    wprintw(win, "%d", i);
    for (j = 0; j < size; j++) {
      if (i == x && j == y)
        wattron(win, A_BOLD);
      else
        wattroff(win, A_BOLD);
      mvwprintw(win, i + 1, (j * 3) + 3, "[%c]", array[i][j]);
    }
  }
  wrefresh(win);
}


x86 assembly (clang, -O0):
<sprintarr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0xc(%rbp),%eax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rdi
call   1090 <werase@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1080 <wmove@plt>
mov    -0x8(%rbp),%rdi
lea    0xe4e(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1218 <sprintarr+0xa8>
cmpl   $0xa,-0x24(%rbp)
jge    11f0 <sprintarr+0x80>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
jmp    1205 <sprintarr+0x95>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xe07(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
jmp    120a <sprintarr+0x9a>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11c0 <sprintarr+0x50>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12ee <sprintarr+0x17e>
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%edx
lea    0xdd0(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12db <sprintarr+0x16b>
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jne    1282 <sprintarr+0x112>
mov    -0x28(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    1282 <sprintarr+0x112>
mov    -0x8(%rbp),%rdi
mov    0x2d6a(%rip),%rax
mov    (%rax),%esi
call   1070 <wattron@plt>
jmp    1294 <sprintarr+0x124>
mov    -0x8(%rbp),%rdi
mov    0x2d53(%rip),%rax
mov    (%rax),%esi
call   1060 <wattroff@plt>
mov    -0x30(%rbp),%r8
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
add    $0x1,%esi
imul   $0x3,-0x28(%rbp),%edx
add    $0x3,%edx
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
imul   %r8,%rcx
add    %rcx,%rax
movslq -0x28(%rbp),%r8
lea    0xd49(%rip),%rcx
movsbl (%rax,%r8,1),%r8d
call   1050 <mvwprintw@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1247 <sprintarr+0xd7>
jmp    12e0 <sprintarr+0x170>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    121f <sprintarr+0xaf>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sprintarr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,%r14d
mov    %ecx,%r15d
mov    %rdx,0x10(%rsp)
mov    %esi,%r13d
mov    %rdi,%rbx
call   1090 <werase@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <wmove@plt>
lea    0xe59(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <wprintw@plt>
test   %r13d,%r13d
jle    12b3 <sprintarr+0x143>
mov    %r14d,(%rsp)
mov    %r13d,%eax
mov    %rax,0x8(%rsp)
lea    0xe37(%rip),%r14
lea    0xe31(%rip),%r12
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
cmp    $0xa,%ebp
mov    %r12,%rsi
cmovb  %r14,%rsi
mov    %rbx,%rdi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <wprintw@plt>
add    $0x1,%ebp
cmp    %ebp,%r13d
jne    11e0 <sprintarr+0x70>
test   %r13d,%r13d
mov    (%rsp),%eax
jle    12b3 <sprintarr+0x143>
mov    %eax,%eax
mov    %rax,(%rsp)
mov    %r15d,%r14d
xor    %r13d,%r13d
jmp    1236 <sprintarr+0xc6>
nopl   0x0(%rax,%rax,1)
mov    0x8(%rsp),%rax
add    %rax,0x10(%rsp)
mov    %rbp,%r13
cmp    %rax,%rbp
je     12b3 <sprintarr+0x143>
mov    %rbx,%rdi
lea    0xdc9(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1040 <wprintw@plt>
lea    0x1(%r13),%rbp
mov    $0x3,%r15d
xor    %r12d,%r12d
jmp    1295 <sprintarr+0x125>
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1060 <wattroff@plt>
mov    0x10(%rsp),%rax
movsbl (%rax,%r12,1),%r8d
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
lea    0xd8b(%rip),%rcx
call   1050 <mvwprintw@plt>
add    $0x1,%r12
add    $0x3,%r15d
cmp    %r12,0x8(%rsp)
je     1220 <sprintarr+0xb0>
mov    0x2d44(%rip),%rax
mov    (%rax),%esi
cmp    %r14,%r13
jne    1260 <sprintarr+0xf0>
cmp    %r12,(%rsp)
jne    1260 <sprintarr+0xf0>
mov    %rbx,%rdi
call   1070 <wattron@plt>
jmp    1268 <sprintarr+0xf8>
mov    %rbx,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <wrefresh@plt>

LLVM IR (-O0):
@.str = [4 x i8] c" \00"
@.str.1 = [5 x i8] c" %d \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [3 x i8] c"%d\00"
@A_BOLD = global i32 0
@.str.4 = [5 x i8] c"[%c]\00"
define void @sprintarr(i32* %0, i32 %1, i8* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i8* %2, i8** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%13 = load i32, i32* %7
%14 = zext i32 %13 to i64
%15 = load i32, i32* %7
%16 = zext i32 %15 to i64
%17 = load i32*, i32** %6
%18 = call i32 @werase(i32* %17)
%19 = load i32*, i32** %6
%20 = call i32 @wmove(i32* %19, i32 0, i32 0)
%21 = load i32*, i32** %6
%22 = call i32 (i32*, i8*, ...) @wprintw(i32* %21, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store i32 0, i32* %11
br label %23
23: ; preds = %39, %5
%24 = load i32, i32* %11
%25 = load i32, i32* %7
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %42
27: ; preds = %23
%28 = load i32, i32* %11
%29 = icmp slt i32 %28, 10
br i1 %29, label %30, label %34
30: ; preds = %27
%31 = load i32*, i32** %6
%32 = load i32, i32* %11
%33 = call i32 (i32*, i8*, ...) @wprintw(i32* %31, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %38
34: ; preds = %27
%35 = load i32*, i32** %6
%36 = load i32, i32* %11
%37 = call i32 (i32*, i8*, ...) @wprintw(i32* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %36)
br label %38
38: ; preds = %34, %30
br label %39
39: ; preds = %38
%40 = load i32, i32* %11
%41 = add nsw i32 %40, 1
store i32 %41, i32* %11
br label %23
42: ; preds = %23
store i32 0, i32* %11
br label %43
43: ; preds = %92, %42
%44 = load i32, i32* %11
%45 = load i32, i32* %7
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %95
47: ; preds = %43
%48 = load i32*, i32** %6
%49 = load i32, i32* %11
%50 = call i32 (i32*, i8*, ...) @wprintw(i32* %48, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %49)
store i32 0, i32* %12
br label %51
51: ; preds = %88, %47
%52 = load i32, i32* %12
%53 = load i32, i32* %7
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %91
55: ; preds = %51
%56 = load i32, i32* %11
%57 = load i32, i32* %9
%58 = icmp eq i32 %56, %57
br i1 %58, label %59, label %67
59: ; preds = %55
%60 = load i32, i32* %12
%61 = load i32, i32* %10
%62 = icmp eq i32 %60, %61
br i1 %62, label %63, label %67
63: ; preds = %59
%64 = load i32*, i32** %6
%65 = load i32, i32* @A_BOLD
%66 = call i32 @wattron(i32* %64, i32 %65)
br label %71
67: ; preds = %59, %55
%68 = load i32*, i32** %6
%69 = load i32, i32* @A_BOLD
%70 = call i32 @wattroff(i32* %68, i32 %69)
br label %71
71: ; preds = %67, %63
%72 = load i32*, i32** %6
%73 = load i32, i32* %11
%74 = add nsw i32 %73, 1
%75 = load i32, i32* %12
%76 = mul nsw i32 %75, 3
%77 = add nsw i32 %76, 3
%78 = load i8*, i8** %8
%79 = load i32, i32* %11
%80 = sext i32 %79 to i64
%81 = mul nsw i64 %80, %16
%82 = getelementptr inbounds i8, i8* %78, i64 %81
%83 = load i32, i32* %12
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = load i8, i8* %85
%87 = call i32 @mvwprintw(i32* %72, i32 %74, i32 %77, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8 signext %86)
br label %88
88: ; preds = %71
%89 = load i32, i32* %12
%90 = add nsw i32 %89, 1
store i32 %90, i32* %12
br label %51
91: ; preds = %51
br label %92
92: ; preds = %91
%93 = load i32, i32* %11
%94 = add nsw i32 %93, 1
store i32 %94, i32* %11
br label %43
95: ; preds = %43
%96 = load i32*, i32** %6
%97 = call i32 @wrefresh(i32* %96)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c" \00"
@.str.1 = [5 x i8] c" %d \00"
@.str.2 = [4 x i8] c"%d \00"
@.str.3 = [3 x i8] c"%d\00"
@A_BOLD = global i32 0
@.str.4 = [5 x i8] c"[%c]\00"
define void @sprintarr(i32* %0, i32 %1, i8* nocapture %2, i32 %3, i32 %4) {
%6 = zext i32 %1 to i64
%7 = tail call i32 @werase(i32* %0)
%8 = tail call i32 @wmove(i32* %0, i32 0, i32 0)
%9 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%10 = icmp sgt i32 %1, 0
br i1 %10, label %15, label %51
11: ; preds = %15
br i1 %10, label %12, label %51
12: ; preds = %11
%13 = zext i32 %4 to i64
%14 = zext i32 %3 to i64
br label %22
15: ; preds = %5, %15
%16 = phi i32 [ %20, %15 ], [ 0, %5 ]
%17 = icmp ult i32 %16, 10
%18 = select i1 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0)
%19 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* %18, i32 %16)
%20 = add nuw nsw i32 %16, 1
%21 = icmp eq i32 %20, %1
br i1 %21, label %11, label %15
22: ; preds = %49, %12
%23 = phi i64 [ 0, %12 ], [ %27, %49 ]
%24 = trunc i64 %23 to i32
%25 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32 %24)
%26 = icmp eq i64 %23, %14
%27 = add nuw nsw i64 %23, 1
%28 = mul nuw nsw i64 %23, %6
%29 = getelementptr inbounds i8, i8* %2, i64 %28
%30 = trunc i64 %27 to i32
br label %31
31: ; preds = %22, %40
%32 = phi i64 [ 0, %22 ], [ %47, %40 ]
%33 = icmp eq i64 %32, %13
%34 = select i1 %26, i1 %33, i1 false
%35 = load i32, i32* @A_BOLD
br i1 %34, label %36, label %38
36: ; preds = %31
%37 = tail call i32 @wattron(i32* %0, i32 %35)
br label %40
38: ; preds = %31
%39 = tail call i32 @wattroff(i32* %0, i32 %35)
br label %40
40: ; preds = %38, %36
%41 = trunc i64 %32 to i32
%42 = mul nsw i32 %41, 3
%43 = add nuw nsw i32 %42, 3
%44 = getelementptr inbounds i8, i8* %29, i64 %32
%45 = load i8, i8* %44
%46 = tail call i32 @mvwprintw(i32* %0, i32 %30, i32 %43, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i8 signext %45)
%47 = add nuw nsw i64 %32, 1
%48 = icmp eq i64 %47, %6
br i1 %48, label %49, label %31
49: ; preds = %40
%50 = icmp eq i64 %27, %6
br i1 %50, label %51, label %22
51: ; preds = %49, %5, %11
%52 = tail call i32 @wrefresh(i32* %0)
ret void
}