#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 */
typedef int /*<<< orphan*/ textToPrint;

/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char const *);
int /*<<< orphan*/ printw(char *);
int /*<<< orphan*/ refresh();
void textevent(const char textToPrint[]) {
  size_t i, len;
  mvprintw(12, 5, textToPrint);
  len = sizeof(&textToPrint) / sizeof(textToPrint[0]);
  for (i = 0; i < 50 - len; i++)
    printw(" ");
  refresh();
}


x86 assembly (clang, -O0):
<textevent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0xc,%edi
mov    $0x5,%esi
call   1050 <mvprintw@plt>
movq   $0x8,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    $0x32,%ecx
sub    -0x18(%rbp),%rcx
cmp    %rcx,%rax
jae    1192 <textevent+0x62>
lea    0xe84(%rip),%rdi
call   1030 <printw@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    115f <textevent+0x2f>
mov    $0x0,%al
call   1040 <refresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<textevent>:
push   %rbx
mov    %rdi,%rdx
mov    $0xc,%edi
mov    $0x5,%esi
call   1050 <mvprintw@plt>
lea    0xeb6(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
mov    %rbx,%rdi
call   1030 <printw@plt>
xor    %eax,%eax
pop    %rbx
jmp    1040 <refresh@plt>

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
define void @textevent(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @mvprintw(i32 12, i32 5, i8* %5)
store i64 8, i64* %4
store i64 0, i64* %3
br label %7
7: ; preds = %14, %1
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = sub i64 50, %9
%11 = icmp ult i64 %8, %10
br i1 %11, label %12, label %17
12: ; preds = %7
%13 = call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %12
%15 = load i64, i64* %3
%16 = add i64 %15, 1
store i64 %16, i64* %3
br label %7
17: ; preds = %7
%18 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @textevent(i8* %0) {
%2 = tail call i32 @mvprintw(i32 12, i32 5, i8* %0)
%3 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%11 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%12 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%15 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%16 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%17 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%18 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%19 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%20 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%21 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%23 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%24 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%25 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%26 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%27 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%28 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%29 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%30 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%31 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%32 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%33 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%34 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%35 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%36 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%37 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%38 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%39 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%40 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%41 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%42 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%43 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%44 = tail call i32 @printw(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%45 = tail call i32 (...) @refresh()
ret void
}