#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*/ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ COLOR_PAIR(int);
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ move(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ print_xcenter(int /*<<< orphan*/ *, int /*<<< orphan*/,
                                 int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void draw_msg_simple(WINDOW *msg_win, int msg_y, const char **message) {
  box(msg_win, 0, 0);
  while (**message)
    print_xcenter(msg_win, msg_y++, *message++, COLOR_PAIR(1));
  move(0, 0);
  wrefresh(msg_win);
}


x86 assembly (clang, -O0):
<draw_msg_simple>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <box@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
cmpb   $0x0,(%rax)
je     11c9 <draw_msg_simple+0x79>
mov    -0x8(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x20(%rbp)
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%rax
mov    %eax,-0x1c(%rbp)
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    %eax,%ecx
call   1060 <print_xcenter@plt>
jmp    1170 <draw_msg_simple+0x20>
xor    %esi,%esi
mov    %esi,%edi
call   1070 <move@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_msg_simple>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r15d
mov    %rdi,%r14
xor    %esi,%esi
xor    %edx,%edx
call   1040 <box@plt>
mov    (%rbx),%r12
cmpb   $0x0,(%r12)
je     11af <draw_msg_simple+0x5f>
add    $0x8,%rbx
nopl   0x0(%rax,%rax,1)
lea    0x1(%r15),%ebp
mov    $0x1,%edi
call   1050 <COLOR_PAIR@plt>
mov    %r14,%rdi
mov    %r15d,%esi
mov    %r12d,%edx
mov    %eax,%ecx
call   1060 <print_xcenter@plt>
mov    (%rbx),%r12
add    $0x8,%rbx
cmpb   $0x0,(%r12)
mov    %ebp,%r15d
jne    1180 <draw_msg_simple+0x30>
xor    %edi,%edi
xor    %esi,%esi
call   1070 <move@plt>
mov    %r14,%rdi
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <wrefresh@plt>

LLVM IR (-O0):
define void @draw_msg_simple(i32* %0, i32 %1, i8** %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i8**
store i32* %0, i32** %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32*, i32** %4
%8 = call i32 @box(i32* %7, i32 0, i32 0)
br label %9
9: ; preds = %14, %3
%10 = load i8**, i8*** %6
%11 = load i8*, i8** %10
%12 = load i8, i8* %11
%13 = icmp ne i8 %12, 0
br i1 %13, label %14, label %24
14: ; preds = %9
%15 = load i32*, i32** %4
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
%18 = load i8**, i8*** %6
%19 = getelementptr inbounds i8*, i8** %18, i32 1
store i8** %19, i8*** %6
%20 = load i8*, i8** %18
%21 = ptrtoint i8* %20 to i32
%22 = call i32 @COLOR_PAIR(i32 1)
%23 = call i32 @print_xcenter(i32* %15, i32 %16, i32 %21, i32 %22)
br label %9
24: ; preds = %9
%25 = call i32 @move(i32 0, i32 0)
%26 = load i32*, i32** %4
%27 = call i32 @wrefresh(i32* %26)
ret void
}

LLVM IR (-O2):
define void @draw_msg_simple(i32* %0, i32 %1, i8** nocapture %2) {
%4 = tail call i32 @box(i32* %0, i32 0, i32 0)
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %21, label %8
8: ; preds = %3, %8
%9 = phi i8* [ %18, %8 ], [ %5, %3 ]
%10 = phi i8** [ %13, %8 ], [ %2, %3 ]
%11 = phi i32 [ %12, %8 ], [ %1, %3 ]
%12 = add nsw i32 %11, 1
%13 = getelementptr inbounds i8*, i8** %10, i64 1
%14 = ptrtoint i8* %9 to i64
%15 = trunc i64 %14 to i32
%16 = tail call i32 @COLOR_PAIR(i32 1)
%17 = tail call i32 @print_xcenter(i32* %0, i32 %11, i32 %15, i32 %16)
%18 = load i8*, i8** %13
%19 = load i8, i8* %18
%20 = icmp eq i8 %19, 0
br i1 %20, label %21, label %8
21: ; preds = %8, %3
%22 = tail call i32 @move(i32 0, i32 0)
%23 = tail call i32 @wrefresh(i32* %0)
ret void
}