#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*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void display_table(const int *board_array, int size) {
  int i, j;
  for (i = 0; i < size; i++) {
    for (j = 0; j < size; j++) {
      if (board_array[i] == (size - j - 1))
        fprintf(stderr, "x ");
      else
        fprintf(stderr, "- ");
    }
    fprintf(stderr, "\n");
  }
  fprintf(stderr, "\n");
}


x86 assembly (clang, -O0):
<display_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11c6 <display_table+0xb6>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11a3 <display_table+0x93>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
sub    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jne    117b <display_table+0x6b>
mov    0x2e78(%rip),%rax
mov    (%rax),%edi
lea    0xe8f(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1190 <display_table+0x80>
mov    0x2e5e(%rip),%rax
mov    (%rax),%edi
lea    0xe78(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1195 <display_table+0x85>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <display_table+0x29>
mov    0x2e36(%rip),%rax
mov    (%rax),%edi
lea    0xe53(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display_table+0x16>
mov    0x2e13(%rip),%rax
mov    (%rax),%edi
lea    0xe30(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_table>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    1195 <display_table+0x85>
mov    %rdi,%rbx
mov    %esi,%eax
mov    %esi,%ecx
mov    %rcx,0x10(%rsp)
add    $0xffffffff,%eax
mov    %eax,0xc(%rsp)
xor    %ebp,%ebp
mov    0x2ea2(%rip),%r13
lea    0xebb(%rip),%r14
lea    0xeb7(%rip),%r15
nopl   0x0(%rax)
mov    0xc(%rsp),%r12d
cs nopw 0x0(%rax,%rax,1)
nop
cmp    (%rbx,%rbp,4),%r12d
mov    0x0(%r13),%edi
mov    %r15,%rsi
cmove  %r14,%rsi
call   1030 <fprintf@plt>
add    $0xffffffff,%r12d
jb     1160 <display_table+0x50>
mov    0x0(%r13),%edi
lea    0xe81(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbp
cmp    0x10(%rsp),%rbp
jne    1150 <display_table+0x40>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0xe61(%rip),%rsi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [3 x i8] c"x \00"
@.str.1 = [3 x i8] c"- \00"
@.str.2 = [2 x i8] c"\0A\00"
define void @display_table(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %25
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %20, %4
%7 = phi i64 [ 0, %4 ], [ %23, %20 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
br label %9
9: ; preds = %6, %9
%10 = phi i32 [ 0, %6 ], [ %18, %9 ]
%11 = load i32, i32* %8
%12 = xor i32 %10, -1
%13 = add i32 %12, %1
%14 = icmp eq i32 %11, %13
%15 = load i32, i32* @stderr
%16 = select i1 %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0)
%17 = tail call i32 @fprintf(i32 %15, i8* %16)
%18 = add nuw nsw i32 %10, 1
%19 = icmp eq i32 %18, %1
br i1 %19, label %20, label %9
20: ; preds = %9
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%23 = add nuw nsw i64 %7, 1
%24 = icmp eq i64 %23, %5
br i1 %24, label %25, label %6
25: ; preds = %20, %2
%26 = load i32, i32* @stderr
%27 = tail call i32 @fprintf(i32 %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}