#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 LINES;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ clear();
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ refresh();
int /*<<< orphan*/ sleep(int);
int /*<<< orphan*/ standend();
int /*<<< orphan*/ standout();
int main(int argc, char *argv[]) {
  int i;
  initscr();
  clear();
  for (i = 0; i < LINES; ++i) {
    move(i, i + i);
    if (i % 2 == 1)
      standout();
    addstr("Hello, world");
    if (i % 2 == 1)
      standend();
    refresh();
    sleep(1);
    move(i, i + i);
    addstr("            ");
  }
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <initscr@plt>
mov    $0x0,%al
call   1090 <clear@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e23(%rip),%rcx
cmp    (%rcx),%eax
jge    1256 <main+0xc6>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
add    -0x14(%rbp),%esi
call   10b0 <move@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    11f6 <main+0x66>
mov    $0x0,%al
call   1050 <standout@plt>
lea    0xe03(%rip),%rdi
call   1080 <addstr@plt>
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x1,%edx
jne    121d <main+0x8d>
mov    $0x0,%al
call   1030 <standend@plt>
mov    $0x0,%al
call   1060 <refresh@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    -0x14(%rbp),%edi
mov    -0x14(%rbp),%esi
add    -0x14(%rbp),%esi
call   10b0 <move@plt>
lea    0xdca(%rip),%rdi
call   1080 <addstr@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bb <main+0x2b>
mov    $0x0,%al
call   1070 <endwin@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
xor    %eax,%eax
call   1040 <initscr@plt>
xor    %eax,%eax
call   1090 <clear@plt>
mov    0x2e3b(%rip),%r12
cmpl   $0x0,(%r12)
jle    122c <main+0x9c>
lea    0xe45(%rip),%r14
lea    0xe4b(%rip),%r15
xor    %ebp,%ebp
xor    %ebx,%ebx
jmp    1206 <main+0x76>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1080 <addstr@plt>
xor    %eax,%eax
call   1060 <refresh@plt>
mov    $0x1,%edi
call   10a0 <sleep@plt>
mov    %ebx,%edi
mov    %ebp,%esi
call   10b0 <move@plt>
mov    %r15,%rdi
call   1080 <addstr@plt>
add    $0x1,%ebx
add    $0x2,%ebp
cmp    (%r12),%ebx
jge    122c <main+0x9c>
mov    %ebx,%edi
mov    %ebp,%esi
call   10b0 <move@plt>
test   $0x1,%bl
je     11d0 <main+0x40>
xor    %eax,%eax
call   1050 <standout@plt>
mov    %r14,%rdi
call   1080 <addstr@plt>
xor    %eax,%eax
call   1030 <standend@plt>
jmp    11d8 <main+0x48>
xor    %eax,%eax
call   1070 <endwin@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@LINES = global i32 0
@.str = [13 x i8] c"Hello, world\00"
@.str.1 = [13 x i8] c" \00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = call i32 (...) @initscr()
%8 = call i32 (...) @clear()
store i32 0, i32* %6
br label %9
9: ; preds = %40, %2
%10 = load i32, i32* %6
%11 = load i32, i32* @LINES
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %43
13: ; preds = %9
%14 = load i32, i32* %6
%15 = load i32, i32* %6
%16 = load i32, i32* %6
%17 = add nsw i32 %15, %16
%18 = call i32 @move(i32 %14, i32 %17)
%19 = load i32, i32* %6
%20 = srem i32 %19, 2
%21 = icmp eq i32 %20, 1
br i1 %21, label %22, label %24
22: ; preds = %13
%23 = call i32 (...) @standout()
br label %24
24: ; preds = %22, %13
%25 = call i32 @addstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%26 = load i32, i32* %6
%27 = srem i32 %26, 2
%28 = icmp eq i32 %27, 1
br i1 %28, label %29, label %31
29: ; preds = %24
%30 = call i32 (...) @standend()
br label %31
31: ; preds = %29, %24
%32 = call i32 (...) @refresh()
%33 = call i32 @sleep(i32 1)
%34 = load i32, i32* %6
%35 = load i32, i32* %6
%36 = load i32, i32* %6
%37 = add nsw i32 %35, %36
%38 = call i32 @move(i32 %34, i32 %37)
%39 = call i32 @addstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
br label %40
40: ; preds = %31
%41 = load i32, i32* %6
%42 = add nsw i32 %41, 1
store i32 %42, i32* %6
br label %9
43: ; preds = %9
%44 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@LINES = global i32 0
@.str = [13 x i8] c"Hello, world\00"
@.str.1 = [13 x i8] c" \00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @initscr()
%4 = tail call i32 (...) @clear()
%5 = load i32, i32* @LINES
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %27
7: ; preds = %2, %19
%8 = phi i32 [ %24, %19 ], [ 0, %2 ]
%9 = shl nuw nsw i32 %8, 1
%10 = tail call i32 @move(i32 %8, i32 %9)
%11 = and i32 %8, 1
%12 = icmp eq i32 %11, 0
br i1 %12, label %17, label %13
13: ; preds = %7
%14 = tail call i32 (...) @standout()
%15 = tail call i32 @addstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%16 = tail call i32 (...) @standend()
br label %19
17: ; preds = %7
%18 = tail call i32 @addstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
br label %19
19: ; preds = %17, %13
%20 = tail call i32 (...) @refresh()
%21 = tail call i32 @sleep(i32 1)
%22 = tail call i32 @move(i32 %8, i32 %9)
%23 = tail call i32 @addstr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0))
%24 = add nuw nsw i32 %8, 1
%25 = load i32, i32* @LINES
%26 = icmp slt i32 %24, %25
br i1 %26, label %7, label %27
27: ; preds = %19, %2
%28 = tail call i32 (...) @endwin()
ret i32 0
}