#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*/ doupdate();
int /*<<< orphan*/ fill_line_blank(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ update_panels();
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
void print_status_msg(WINDOW *statuswin, int *location, char *msg) {
  void scrollstatuswin(WINDOW *, int);
  if (*location > 12) {
    scrollstatuswin(statuswin, 0);
    wmove(statuswin, 12, 0);
    fill_line_blank(statuswin, 12);
    mvwprintw(statuswin, 12, 2, msg);
  } else {
    wmove(statuswin, *location, 0);
    fill_line_blank(statuswin, *location);
    mvwprintw(statuswin, *location, 2, msg);
  }
  *location = *location + 1;
  update_panels();
  doupdate();
}


x86 assembly (clang, -O0):
<print_status_msg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpl   $0xc,(%rax)
jle    11c6 <print_status_msg+0x66>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1070 <scrollstatuswin@plt>
mov    -0x8(%rbp),%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1080 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    $0xc,%esi
call   1040 <fill_line_blank@plt>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0xc,%esi
mov    $0x2,%edx
call   1050 <mvwprintw@plt>
jmp    11fe <print_status_msg+0x9e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1080 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <fill_line_blank@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rcx
mov    $0x2,%edx
call   1050 <mvwprintw@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <update_panels@plt>
mov    $0x0,%al
call   1060 <doupdate@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_status_msg>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
mov    (%rsi),%esi
cmp    $0xd,%esi
jl     11a1 <print_status_msg+0x41>
xor    %esi,%esi
call   1070 <scrollstatuswin@plt>
mov    $0xc,%ebp
mov    %rbx,%rdi
mov    $0xc,%esi
xor    %edx,%edx
call   1080 <wmove@plt>
mov    %rbx,%rdi
mov    $0xc,%esi
call   1040 <fill_line_blank@plt>
jmp    11b6 <print_status_msg+0x56>
xor    %edx,%edx
call   1080 <wmove@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1040 <fill_line_blank@plt>
mov    (%r15),%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
mov    %r14,%rcx
call   1050 <mvwprintw@plt>
addl   $0x1,(%r15)
xor    %eax,%eax
call   1030 <update_panels@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <doupdate@plt>

LLVM IR (-O0):
define void @print_status_msg(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** %5
%8 = load i32, i32* %7
%9 = icmp sgt i32 %8, 12
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load i32*, i32** %4
%12 = load i32*, i32** %4
%13 = call i32 @wmove(i32* %12, i32 12, i32 0)
%14 = load i32*, i32** %4
%15 = call i32 @fill_line_blank(i32* %14, i32 12)
%16 = load i32*, i32** %4
%17 = load i8*, i8** %6
%18 = call i32 @mvwprintw(i32* %16, i32 12, i32 2, i8* %17)
br label %33
19: ; preds = %3
%20 = load i32*, i32** %4
%21 = load i32*, i32** %5
%22 = load i32, i32* %21
%23 = call i32 @wmove(i32* %20, i32 %22, i32 0)
%24 = load i32*, i32** %4
%25 = load i32*, i32** %5
%26 = load i32, i32* %25
%27 = call i32 @fill_line_blank(i32* %24, i32 %26)
%28 = load i32*, i32** %4
%29 = load i32*, i32** %5
%30 = load i32, i32* %29
%31 = load i8*, i8** %6
%32 = call i32 @mvwprintw(i32* %28, i32 %30, i32 2, i8* %31)
br label %33
33: ; preds = %19, %10
%34 = load i32*, i32** %5
%35 = load i32, i32* %34
%36 = add nsw i32 %35, 1
%37 = load i32*, i32** %5
store i32 %36, i32* %37
%38 = call i32 (...) @update_panels()
%39 = call i32 (...) @doupdate()
ret void
}

LLVM IR (-O2):
define void @print_status_msg(i32* %0, i32* nocapture %1, i8* %2) {
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 12
br i1 %5, label %6, label %9
6: ; preds = %3
tail call void @scrollstatuswin(i32* %0, i32 0)
%7 = tail call i32 @wmove(i32* %0, i32 12, i32 0)
%8 = tail call i32 @fill_line_blank(i32* %0, i32 12)
br label %14
9: ; preds = %3
%10 = tail call i32 @wmove(i32* %0, i32 %4, i32 0)
%11 = load i32, i32* %1
%12 = tail call i32 @fill_line_blank(i32* %0, i32 %11)
%13 = load i32, i32* %1
br label %14
14: ; preds = %9, %6
%15 = phi i32 [ %13, %9 ], [ 12, %6 ]
%16 = tail call i32 @mvwprintw(i32* %0, i32 %15, i32 2, i8* %2)
%17 = load i32, i32* %1
%18 = add nsw i32 %17, 1
store i32 %18, i32* %1
%19 = tail call i32 (...) @update_panels()
%20 = tail call i32 (...) @doupdate()
ret void
}