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


x86 assembly (clang, -O0):
<display_table2>:
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    11cf <display_table2+0xbf>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11ac <display_table2+0x9c>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0xc(%rbp),%ecx
sub    -0x14(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
cmp    %ecx,%eax
jne    1184 <display_table2+0x74>
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
lea    0xe86(%rip),%rsi
call   1030 <fprintf@plt>
jmp    1199 <display_table2+0x89>
mov    0x2e55(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
call   1030 <fprintf@plt>
jmp    119e <display_table2+0x8e>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1139 <display_table2+0x29>
mov    0x2e2d(%rip),%rax
mov    (%rax),%edi
lea    0xe4a(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <display_table2+0x16>
mov    0x2e0a(%rip),%rax
mov    (%rax),%edi
lea    0xe27(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<display_table2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
test   %esi,%esi
jle    119c <display_table2+0x8c>
mov    %rdi,%r13
mov    %esi,%eax
mov    %esi,%ecx
mov    %rcx,0x10(%rsp)
add    $0xffffffff,%eax
mov    %eax,0xc(%rsp)
xor    %ebx,%ebx
mov    0x2ea2(%rip),%r14
lea    0xebb(%rip),%r12
lea    0xeb7(%rip),%r15
nopl   0x0(%rax)
mov    0xc(%rsp),%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%eax
mov    %ebp,%ecx
shl    %cl,%eax
cmp    %eax,0x0(%r13,%rbx,4)
mov    (%r14),%edi
mov    %r15,%rsi
cmove  %r12,%rsi
call   1030 <fprintf@plt>
add    $0xffffffff,%ebp
jb     1160 <display_table2+0x50>
mov    (%r14),%edi
lea    0xe7a(%rip),%rsi
call   1030 <fprintf@plt>
add    $0x1,%rbx
cmp    0x10(%rsp),%rbx
jne    1150 <display_table2+0x40>
mov    0x2e3d(%rip),%rax
mov    (%rax),%edi
lea    0xe5a(%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_table2(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 = %41, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %44
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %35, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %38
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 = shl i32 1, %25
%27 = icmp eq i32 %21, %26
br i1 %27, label %28, label %31
28: ; preds = %16
%29 = load i32, i32* @stderr
%30 = call i32 @fprintf(i32 %29, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %34
31: ; preds = %16
%32 = load i32, i32* @stderr
%33 = call i32 @fprintf(i32 %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
br label %34
34: ; preds = %31, %28
br label %35
35: ; preds = %34
%36 = load i32, i32* %6
%37 = add nsw i32 %36, 1
store i32 %37, i32* %6
br label %12
38: ; preds = %12
%39 = load i32, i32* @stderr
%40 = call i32 @fprintf(i32 %39, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %41
41: ; preds = %38
%42 = load i32, i32* %5
%43 = add nsw i32 %42, 1
store i32 %43, i32* %5
br label %7
44: ; preds = %7
%45 = load i32, i32* @stderr
%46 = call i32 @fprintf(i32 %45, 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_table2(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %26
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %21, %4
%7 = phi i64 [ 0, %4 ], [ %24, %21 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
br label %9
9: ; preds = %6, %9
%10 = phi i32 [ 0, %6 ], [ %19, %9 ]
%11 = load i32, i32* %8
%12 = xor i32 %10, -1
%13 = add i32 %12, %1
%14 = shl nuw i32 1, %13
%15 = icmp eq i32 %11, %14
%16 = load i32, i32* @stderr
%17 = select i1 %15, 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)
%18 = tail call i32 @fprintf(i32 %16, i8* %17)
%19 = add nuw nsw i32 %10, 1
%20 = icmp eq i32 %19, %1
br i1 %20, label %21, label %9
21: ; preds = %9
%22 = load i32, i32* @stderr
%23 = tail call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%24 = add nuw nsw i64 %7, 1
%25 = icmp eq i64 %24, %5
br i1 %25, label %26, label %6
26: ; preds = %21, %2
%27 = load i32, i32* @stderr
%28 = tail call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret void
}