#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 */
char ACS_VLINE;
int A_ALTCHARSET;
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ printw(char *, ...);
int /*<<< orphan*/ refresh();
int main(void) {
  int counter, line = 0;
  initscr();
  for (counter = 43; counter < 256; counter++) {
    printw("%3d = ", counter);
    addch(counter | A_ALTCHARSET);
    if (line < 7) {
      addch(' ');
      addch(ACS_VLINE);
      printw(" ");
    }
    line++;
    if (line > 7) {
      addch('\n');
      line = 0;
    }
    switch (counter) {
    case 46:
      counter = 47;
      break;
    case 48:
      counter = 95;
      break;
    case 97:
      counter = 101;
      break;
    case 126:
      counter = 127;
      break;
    case 128:
      counter = 160;
      break;
    case 172:
      counter = 173;
    }
  }
  refresh();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
movl   $0x2b,-0x8(%rbp)
cmpl   $0x100,-0x8(%rbp)
jge    12ae <main+0x16e>
mov    -0x8(%rbp),%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    -0x8(%rbp),%eax
mov    0x2e5c(%rip),%rcx
or     (%rcx),%eax
movsbl %al,%edi
call   1050 <addch@plt>
cmpl   $0x7,-0xc(%rbp)
jge    11c7 <main+0x87>
mov    $0x20,%edi
call   1050 <addch@plt>
mov    0x2e27(%rip),%rax
movsbl (%rax),%edi
call   1050 <addch@plt>
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1040 <printw@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7,-0xc(%rbp)
jle    11eb <main+0xab>
mov    $0xa,%edi
call   1050 <addch@plt>
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
sub    $0x2e,%eax
je     1258 <main+0x118>
jmp    11ff <main+0xbf>
mov    -0x10(%rbp),%eax
sub    $0x30,%eax
je     1264 <main+0x124>
jmp    1210 <main+0xd0>
mov    -0x10(%rbp),%eax
sub    $0x61,%eax
je     1270 <main+0x130>
jmp    1221 <main+0xe1>
mov    -0x10(%rbp),%eax
sub    $0x7e,%eax
je     127c <main+0x13c>
jmp    1232 <main+0xf2>
mov    -0x10(%rbp),%eax
sub    $0x80,%eax
je     1288 <main+0x148>
jmp    1245 <main+0x105>
mov    -0x10(%rbp),%eax
sub    $0xac,%eax
je     1294 <main+0x154>
jmp    129b <main+0x15b>
movl   $0x2f,-0x8(%rbp)
jmp    129b <main+0x15b>
movl   $0x5f,-0x8(%rbp)
jmp    129b <main+0x15b>
movl   $0x65,-0x8(%rbp)
jmp    129b <main+0x15b>
movl   $0x7f,-0x8(%rbp)
jmp    129b <main+0x15b>
movl   $0xa0,-0x8(%rbp)
jmp    129b <main+0x15b>
movl   $0xad,-0x8(%rbp)
jmp    12a0 <main+0x160>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1164 <main+0x24>
mov    $0x0,%al
call   1060 <refresh@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
mov    $0x2b,%ebx
lea    0xea2(%rip),%r15
mov    0x2e83(%rip),%r12
mov    0x2e6c(%rip),%r13
lea    0xe92(%rip),%r14
xor    %ebp,%ebp
jmp    1191 <main+0x51>
mov    $0xa0,%ebx
nopl   0x0(%rax)
lea    0x1(%rbx),%eax
cmp    $0xff,%ebx
mov    %eax,%ebx
jge    1246 <main+0x106>
mov    %r15,%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1040 <printw@plt>
mov    (%r12),%eax
or     %ebx,%eax
movsbl %al,%edi
call   1050 <addch@plt>
cmp    $0x6,%ebp
jg     11f0 <main+0xb0>
mov    $0x20,%edi
call   1050 <addch@plt>
movsbl 0x0(%r13),%edi
call   1050 <addch@plt>
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printw@plt>
add    $0x1,%ebp
cmp    $0x7d,%ebx
jg     1201 <main+0xc1>
cmp    $0x2e,%ebx
je     1228 <main+0xe8>
cmp    $0x30,%ebx
je     1232 <main+0xf2>
cmp    $0x61,%ebx
jne    1180 <main+0x40>
mov    $0x65,%ebx
jmp    1180 <main+0x40>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1050 <addch@plt>
xor    %ebp,%ebp
cmp    $0x7d,%ebx
jle    11d6 <main+0x96>
cmp    $0x7e,%ebx
je     123c <main+0xfc>
cmp    $0x80,%ebx
je     1177 <main+0x37>
cmp    $0xac,%ebx
jne    1180 <main+0x40>
mov    $0xad,%ebx
jmp    1180 <main+0x40>
mov    $0x2f,%ebx
jmp    1180 <main+0x40>
mov    $0x5f,%ebx
jmp    1180 <main+0x40>
mov    $0x7f,%ebx
jmp    1180 <main+0x40>
xor    %eax,%eax
call   1060 <refresh@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"%3d = \00"
@A_ALTCHARSET = global i32 0
@ACS_VLINE = global i8 0
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %3
%4 = call i32 (...) @initscr()
store i32 43, i32* %2
br label %5
5: ; preds = %39, %0
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 256
br i1 %7, label %8, label %42
8: ; preds = %5
%9 = load i32, i32* %2
%10 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %2
%12 = load i32, i32* @A_ALTCHARSET
%13 = or i32 %11, %12
%14 = trunc i32 %13 to i8
%15 = call i32 @addch(i8 signext %14)
%16 = load i32, i32* %3
%17 = icmp slt i32 %16, 7
br i1 %17, label %18, label %23
18: ; preds = %8
%19 = call i32 @addch(i8 signext 32)
%20 = load i8, i8* @ACS_VLINE
%21 = call i32 @addch(i8 signext %20)
%22 = call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %23
23: ; preds = %18, %8
%24 = load i32, i32* %3
%25 = add nsw i32 %24, 1
store i32 %25, i32* %3
%26 = load i32, i32* %3
%27 = icmp sgt i32 %26, 7
br i1 %27, label %28, label %30
28: ; preds = %23
%29 = call i32 @addch(i8 signext 10)
store i32 0, i32* %3
br label %30
30: ; preds = %28, %23
%31 = load i32, i32* %2
switch i32 %31, label %38 [
i32 46, label %32
i32 48, label %33
i32 97, label %34
i32 126, label %35
i32 128, label %36
i32 172, label %37
]
32: ; preds = %30
store i32 47, i32* %2
br label %38
33: ; preds = %30
store i32 95, i32* %2
br label %38
34: ; preds = %30
store i32 101, i32* %2
br label %38
35: ; preds = %30
store i32 127, i32* %2
br label %38
36: ; preds = %30
store i32 160, i32* %2
br label %38
37: ; preds = %30
store i32 173, i32* %2
br label %38
38: ; preds = %37, %30, %36, %35, %34, %33, %32
br label %39
39: ; preds = %38
%40 = load i32, i32* %2
%41 = add nsw i32 %40, 1
store i32 %41, i32* %2
br label %5
42: ; preds = %5
%43 = call i32 (...) @refresh()
ret i32 0
}

LLVM IR (-O2):
@.str = [7 x i8] c"%3d = \00"
@A_ALTCHARSET = global i32 0
@ACS_VLINE = global i8 0
@.str.1 = [2 x i8] c" \00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
br label %2
2: ; preds = %0, %27
%3 = phi i32 [ 0, %0 ], [ %20, %27 ]
%4 = phi i32 [ 43, %0 ], [ %29, %27 ]
%5 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* @A_ALTCHARSET
%7 = or i32 %6, %4
%8 = trunc i32 %7 to i8
%9 = tail call i32 @addch(i8 signext %8)
%10 = icmp slt i32 %3, 7
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = tail call i32 @addch(i8 signext 32)
%13 = load i8, i8* @ACS_VLINE
%14 = tail call i32 @addch(i8 signext %13)
%15 = tail call i32 (i8*, ...) @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%16 = add nsw i32 %3, 1
br label %19
17: ; preds = %2
%18 = tail call i32 @addch(i8 signext 10)
br label %19
19: ; preds = %11, %17
%20 = phi i32 [ 0, %17 ], [ %16, %11 ]
switch i32 %4, label %27 [
i32 46, label %21
i32 48, label %22
i32 97, label %23
i32 126, label %24
i32 128, label %25
i32 172, label %26
]
21: ; preds = %19
br label %27
22: ; preds = %19
br label %27
23: ; preds = %19
br label %27
24: ; preds = %19
br label %27
25: ; preds = %19
br label %27
26: ; preds = %19
br label %27
27: ; preds = %21, %22, %23, %24, %25, %19, %26
%28 = phi i32 [ %4, %19 ], [ 173, %26 ], [ 160, %25 ], [ 127, %24 ], [ 101, %23 ], [ 95, %22 ], [ 47, %21 ]
%29 = add nsw i32 %28, 1
%30 = icmp slt i32 %28, 255
br i1 %30, label %2, label %31
31: ; preds = %27
%32 = tail call i32 (...) @refresh()
ret i32 0
}