#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*/ move(int /*<<< orphan*/, int);
int /*<<< orphan*/ prints(char *);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ screen_clear();
int /*<<< orphan*/ winsh0(int, int);
int winrefresh() {
  int x, y;
  screen_clear();
  move(0, 22);
  prints("[1;32m\xa1\xee\xbc\xfc\xc5\xcc\xc9\xa8\xc0\xd7\xa1\xee[0;1m "
         "[[35m\xb0\xef\xd6\xfa: H[37m] [[36m\xcd\xcb\xb3\xf6: Q[37m] "
         "[[35m\xb4\xf2\xbf\xaa: F[37m] [[36m\xb1\xea\xc0\xd7: S][m\n\r");
  prints("[v1.00 by zhch.nju 00.3] press \'[1;32mH[m\' to get help, "
         "\'[1;32mCtrl+C[m\' to exit.");
  for (y = 1; y <= 16; y++) {
    move(0, y - 1);
    for (x = 1; x <= 30; x++)
      winsh0(x, y);
  }
  refresh();
}


x86 assembly (clang, -O0):
<winrefresh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1050 <screen_clear@plt>
xor    %edi,%edi
mov    $0x16,%esi
call   1070 <move@plt>
lea    0xe8e(%rip),%rdi
call   1040 <prints@plt>
lea    0xeec(%rip),%rdi
call   1040 <prints@plt>
movl   $0x1,-0xc(%rbp)
cmpl   $0x10,-0xc(%rbp)
jg     11de <winrefresh+0x8e>
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
xor    %edi,%edi
call   1070 <move@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x1e,-0x8(%rbp)
jg     11cb <winrefresh+0x7b>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1030 <winsh0@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    11a8 <winrefresh+0x58>
jmp    11d0 <winrefresh+0x80>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    118a <winrefresh+0x3a>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<winrefresh>:
push   %r14
push   %rbx
push   %rax
xor    %r14d,%r14d
xor    %eax,%eax
call   1050 <screen_clear@plt>
xor    %edi,%edi
mov    $0x16,%esi
call   1070 <move@plt>
lea    0xe8f(%rip),%rdi
call   1040 <prints@plt>
lea    0xeed(%rip),%rdi
call   1040 <prints@plt>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0x1(%r14),%ebx
xor    %edi,%edi
mov    %r14d,%esi
call   1070 <move@plt>
mov    $0x1,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x2,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x3,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x4,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x5,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x6,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x7,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x8,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x9,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0xa,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0xb,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0xc,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0xd,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0xe,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0xf,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x10,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x11,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x12,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x13,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x14,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x15,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x16,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x17,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x18,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x19,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x1a,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x1b,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x1c,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x1d,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    $0x1e,%edi
mov    %ebx,%esi
call   1030 <winsh0@plt>
mov    %ebx,%r14d
cmp    $0x10,%ebx
jne    1190 <winrefresh+0x40>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <refresh@plt>

LLVM IR (-O0):
@.str = [106 x i8] c"\1B[1;32m\A1\EE\BC\FC\C5\CC\C9\A8\C0\D7\A1\EE\1B[0;1m [\1B[35m\B0\EF\D6\FA: H\1B[37m] [\1B[36m\CD\CB\B3\F6: Q\1B[37m] [\1B[35m\B4\F2\BF\AA: F\1B[37m] [\1B[36m\B1\EA\C0\D7: S]\1B[m\0A\0D\00"
@.str.1 = [86 x i8] c"[v1.00 by zhch.nju 00.3] press '\1B[1;32mH\1B[m' to get help, '\1B[1;32mCtrl+C\1B[m' to exit.\00"
define i32 @winrefresh() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 (...) @screen_clear()
%5 = call i32 @move(i32 0, i32 22)
%6 = call i32 @prints(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @prints(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %3
br label %8
8: ; preds = %26, %0
%9 = load i32, i32* %3
%10 = icmp sle i32 %9, 16
br i1 %10, label %11, label %29
11: ; preds = %8
%12 = load i32, i32* %3
%13 = sub nsw i32 %12, 1
%14 = call i32 @move(i32 0, i32 %13)
store i32 1, i32* %2
br label %15
15: ; preds = %22, %11
%16 = load i32, i32* %2
%17 = icmp sle i32 %16, 30
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load i32, i32* %2
%20 = load i32, i32* %3
%21 = call i32 @winsh0(i32 %19, i32 %20)
br label %22
22: ; preds = %18
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %15
25: ; preds = %15
br label %26
26: ; preds = %25
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %8
29: ; preds = %8
%30 = call i32 (...) @refresh()
%31 = load i32, i32* %1
ret i32 %31
}

LLVM IR (-O2):
@.str = [106 x i8] c"\1B[1;32m\A1\EE\BC\FC\C5\CC\C9\A8\C0\D7\A1\EE\1B[0;1m [\1B[35m\B0\EF\D6\FA: H\1B[37m] [\1B[36m\CD\CB\B3\F6: Q\1B[37m] [\1B[35m\B4\F2\BF\AA: F\1B[37m] [\1B[36m\B1\EA\C0\D7: S]\1B[m\0A\0D\00"
@.str.1 = [86 x i8] c"[v1.00 by zhch.nju 00.3] press '\1B[1;32mH\1B[m' to get help, '\1B[1;32mCtrl+C\1B[m' to exit.\00"
define i32 @winrefresh() {
%1 = tail call i32 (...) @screen_clear()
%2 = tail call i32 @move(i32 0, i32 22)
%3 = tail call i32 @prints(i8* getelementptr inbounds ([106 x i8], [106 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @prints(i8* getelementptr inbounds ([86 x i8], [86 x i8]* @.str.1, i64 0, i64 0))
br label %5
5: ; preds = %0, %5
%6 = phi i32 [ 1, %0 ], [ %39, %5 ]
%7 = add nsw i32 %6, -1
%8 = tail call i32 @move(i32 0, i32 %7)
%9 = tail call i32 @winsh0(i32 1, i32 %6)
%10 = tail call i32 @winsh0(i32 2, i32 %6)
%11 = tail call i32 @winsh0(i32 3, i32 %6)
%12 = tail call i32 @winsh0(i32 4, i32 %6)
%13 = tail call i32 @winsh0(i32 5, i32 %6)
%14 = tail call i32 @winsh0(i32 6, i32 %6)
%15 = tail call i32 @winsh0(i32 7, i32 %6)
%16 = tail call i32 @winsh0(i32 8, i32 %6)
%17 = tail call i32 @winsh0(i32 9, i32 %6)
%18 = tail call i32 @winsh0(i32 10, i32 %6)
%19 = tail call i32 @winsh0(i32 11, i32 %6)
%20 = tail call i32 @winsh0(i32 12, i32 %6)
%21 = tail call i32 @winsh0(i32 13, i32 %6)
%22 = tail call i32 @winsh0(i32 14, i32 %6)
%23 = tail call i32 @winsh0(i32 15, i32 %6)
%24 = tail call i32 @winsh0(i32 16, i32 %6)
%25 = tail call i32 @winsh0(i32 17, i32 %6)
%26 = tail call i32 @winsh0(i32 18, i32 %6)
%27 = tail call i32 @winsh0(i32 19, i32 %6)
%28 = tail call i32 @winsh0(i32 20, i32 %6)
%29 = tail call i32 @winsh0(i32 21, i32 %6)
%30 = tail call i32 @winsh0(i32 22, i32 %6)
%31 = tail call i32 @winsh0(i32 23, i32 %6)
%32 = tail call i32 @winsh0(i32 24, i32 %6)
%33 = tail call i32 @winsh0(i32 25, i32 %6)
%34 = tail call i32 @winsh0(i32 26, i32 %6)
%35 = tail call i32 @winsh0(i32 27, i32 %6)
%36 = tail call i32 @winsh0(i32 28, i32 %6)
%37 = tail call i32 @winsh0(i32 29, i32 %6)
%38 = tail call i32 @winsh0(i32 30, i32 %6)
%39 = add nuw nsw i32 %6, 1
%40 = icmp eq i32 %39, 17
br i1 %40, label %41, label %5
41: ; preds = %5
%42 = tail call i32 (...) @refresh()
ret i32 undef
}