#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*/ COLOR_PAIR(int);
int /*<<< orphan*/ addch(char);
int /*<<< orphan*/ attroff(int);
int /*<<< orphan*/ attron(int);
int /*<<< orphan*/ attrset(int /*<<< orphan*/);
int /*<<< orphan*/ move(int, int);
int /*<<< orphan*/ napms(int);
int /*<<< orphan*/ refresh();
int strlen(char *);
void print_text(int x, int y, char *text, int color, int style, int align,
                int display_speed) {
  if (align == 1)
    x = (x - strlen(text)) / 2;
  move(y, x);
  while (*text) {
    attrset(COLOR_PAIR(color));
    if (style != 0)
      attron(style);
    addch(*text);
    text++;
    if (display_speed != 0) {
      refresh();
      napms(display_speed);
    }
  }
  attrset(COLOR_PAIR(color));
  if (style != 0)
    attroff(style);
}


x86 assembly (clang, -O0):
<print_text>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
jne    11db <print_text+0x4b>
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%eax
sub    %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x4(%rbp),%esi
call   10b0 <move@plt>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     124a <print_text+0xba>
mov    -0x14(%rbp),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
cmpl   $0x0,-0x18(%rbp)
je     1214 <print_text+0x84>
mov    -0x18(%rbp),%edi
call   1050 <attron@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%edi
call   1070 <addch@plt>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x0,0x10(%rbp)
je     1245 <print_text+0xb5>
mov    $0x0,%al
call   1080 <refresh@plt>
mov    0x10(%rbp),%edi
call   10a0 <napms@plt>
jmp    11e6 <print_text+0x56>
mov    -0x14(%rbp),%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
cmpl   $0x0,-0x18(%rbp)
je     126b <print_text+0xdb>
mov    -0x18(%rbp),%edi
call   1030 <attroff@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_text>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %esi,%r12d
mov    %edi,%r13d
mov    0x40(%rsp),%ebx
cmp    $0x1,%r9d
jne    11cd <print_text+0x3d>
mov    %rbp,%rdi
call   1040 <strlen@plt>
sub    %eax,%r13d
mov    %r13d,%eax
shr    $0x1f,%eax
add    %r13d,%eax
sar    %eax
mov    %eax,%r13d
mov    %r12d,%edi
mov    %r13d,%esi
call   10b0 <move@plt>
cmpb   $0x0,0x0(%rbp)
je     1233 <print_text+0xa3>
add    $0x1,%rbp
jmp    11fa <print_text+0x6a>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
cmpb   $0x0,0x0(%rbp)
lea    0x1(%rbp),%rbp
je     1233 <print_text+0xa3>
mov    %r14d,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
test   %r15d,%r15d
je     1216 <print_text+0x86>
mov    %r15d,%edi
call   1050 <attron@plt>
movsbl -0x1(%rbp),%edi
call   1070 <addch@plt>
test   %ebx,%ebx
je     11f0 <print_text+0x60>
xor    %eax,%eax
call   1080 <refresh@plt>
mov    %ebx,%edi
call   10a0 <napms@plt>
jmp    11f0 <print_text+0x60>
mov    %r14d,%edi
call   1060 <COLOR_PAIR@plt>
mov    %eax,%edi
call   1090 <attrset@plt>
test   %r15d,%r15d
je     125d <print_text+0xcd>
mov    %r15d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <attroff@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @print_text(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %13
%16 = icmp eq i32 %15, 1
br i1 %16, label %17, label %23
17: ; preds = %7
%18 = load i32, i32* %8
%19 = load i8*, i8** %10
%20 = call i32 @strlen(i8* %19)
%21 = sub nsw i32 %18, %20
%22 = sdiv i32 %21, 2
store i32 %22, i32* %8
br label %23
23: ; preds = %17, %7
%24 = load i32, i32* %9
%25 = load i32, i32* %8
%26 = call i32 @move(i32 %24, i32 %25)
br label %27
27: ; preds = %52, %23
%28 = load i8*, i8** %10
%29 = load i8, i8* %28
%30 = icmp ne i8 %29, 0
br i1 %30, label %31, label %53
31: ; preds = %27
%32 = load i32, i32* %11
%33 = call i32 @COLOR_PAIR(i32 %32)
%34 = call i32 @attrset(i32 %33)
%35 = load i32, i32* %12
%36 = icmp ne i32 %35, 0
br i1 %36, label %37, label %40
37: ; preds = %31
%38 = load i32, i32* %12
%39 = call i32 @attron(i32 %38)
br label %40
40: ; preds = %37, %31
%41 = load i8*, i8** %10
%42 = load i8, i8* %41
%43 = call i32 @addch(i8 signext %42)
%44 = load i8*, i8** %10
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %10
%46 = load i32, i32* %14
%47 = icmp ne i32 %46, 0
br i1 %47, label %48, label %52
48: ; preds = %40
%49 = call i32 (...) @refresh()
%50 = load i32, i32* %14
%51 = call i32 @napms(i32 %50)
br label %52
52: ; preds = %48, %40
br label %27
53: ; preds = %27
%54 = load i32, i32* %11
%55 = call i32 @COLOR_PAIR(i32 %54)
%56 = call i32 @attrset(i32 %55)
%57 = load i32, i32* %12
%58 = icmp ne i32 %57, 0
br i1 %58, label %59, label %62
59: ; preds = %53
%60 = load i32, i32* %12
%61 = call i32 @attroff(i32 %60)
br label %62
62: ; preds = %59, %53
ret void
}

LLVM IR (-O2):
define void @print_text(i32 %0, i32 %1, i8* %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = icmp eq i32 %5, 1
br i1 %8, label %9, label %13
9: ; preds = %7
%10 = tail call i32 @strlen(i8* %2)
%11 = sub nsw i32 %0, %10
%12 = sdiv i32 %11, 2
br label %13
13: ; preds = %9, %7
%14 = phi i32 [ %12, %9 ], [ %0, %7 ]
%15 = tail call i32 @move(i32 %1, i32 %14)
%16 = load i8, i8* %2
%17 = icmp eq i8 %16, 0
br i1 %17, label %37, label %18
18: ; preds = %13
%19 = icmp eq i32 %4, 0
%20 = icmp eq i32 %6, 0
br label %21
21: ; preds = %18, %34
%22 = phi i8* [ %2, %18 ], [ %30, %34 ]
%23 = tail call i32 @COLOR_PAIR(i32 %3)
%24 = tail call i32 @attrset(i32 %23)
br i1 %19, label %27, label %25
25: ; preds = %21
%26 = tail call i32 @attron(i32 %4)
br label %27
27: ; preds = %25, %21
%28 = load i8, i8* %22
%29 = tail call i32 @addch(i8 signext %28)
%30 = getelementptr inbounds i8, i8* %22, i64 1
br i1 %20, label %34, label %31
31: ; preds = %27
%32 = tail call i32 (...) @refresh()
%33 = tail call i32 @napms(i32 %6)
br label %34
34: ; preds = %31, %27
%35 = load i8, i8* %30
%36 = icmp eq i8 %35, 0
br i1 %36, label %37, label %21
37: ; preds = %34, %13
%38 = tail call i32 @COLOR_PAIR(i32 %3)
%39 = tail call i32 @attrset(i32 %38)
%40 = icmp eq i32 %4, 0
br i1 %40, label %43, label %41
41: ; preds = %37
%42 = tail call i32 @attroff(i32 %4)
br label %43
43: ; preds = %41, %37
ret void
}