#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*/ A_BOLD;
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ whline(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, ...);
void show_operation(WINDOW *win, const char *oper) {
  wmove(win, 1, 1);
  wattron(win, A_BOLD);
  wprintw(win, "Program Status\n");
  wattroff(win, A_BOLD);
  wmove(win, 2, 1);
  whline(win, 0, 5000);
  if (oper != NULL) {
    wmove(win, 3, 1);
    wprintw(win, "%s\n", oper);
  }
}


x86 assembly (clang, -O0):
<show_operation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e65(%rip),%rax
mov    (%rax),%esi
call   1060 <wattron@plt>
mov    -0x8(%rbp),%rdi
lea    0xe73(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e41(%rip),%rax
mov    (%rax),%esi
call   1050 <wattroff@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1388,%edx
call   1030 <whline@plt>
cmpq   $0x0,-0x10(%rbp)
je     11fd <show_operation+0xad>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe1a(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_operation>:
push   %r15
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x1,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    0x2e6f(%rip),%r15
mov    (%r15),%esi
mov    %rbx,%rdi
call   1060 <wattron@plt>
lea    0xe7d(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <wprintw@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
call   1050 <wattroff@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1388,%edx
call   1030 <whline@plt>
test   %r14,%r14
je     11e9 <show_operation+0x99>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
lea    0xe39(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <wprintw@plt>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@A_BOLD = global i32 0
@.str = [16 x i8] c"Program Status\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @show_operation(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
store i32* %0, i32** %3
store i8* %1, i8** %4
%5 = load i32*, i32** %3
%6 = call i32 @wmove(i32* %5, i32 1, i32 1)
%7 = load i32*, i32** %3
%8 = load i32, i32* @A_BOLD
%9 = call i32 @wattron(i32* %7, i32 %8)
%10 = load i32*, i32** %3
%11 = call i32 (i32*, i8*, ...) @wprintw(i32* %10, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%12 = load i32*, i32** %3
%13 = load i32, i32* @A_BOLD
%14 = call i32 @wattroff(i32* %12, i32 %13)
%15 = load i32*, i32** %3
%16 = call i32 @wmove(i32* %15, i32 2, i32 1)
%17 = load i32*, i32** %3
%18 = call i32 @whline(i32* %17, i32 0, i32 5000)
%19 = load i8*, i8** %4
%20 = icmp ne i8* %19, null
br i1 %20, label %21, label %27
21: ; preds = %2
%22 = load i32*, i32** %3
%23 = call i32 @wmove(i32* %22, i32 3, i32 1)
%24 = load i32*, i32** %3
%25 = load i8*, i8** %4
%26 = call i32 (i32*, i8*, ...) @wprintw(i32* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %25)
br label %27
27: ; preds = %21, %2
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@.str = [16 x i8] c"Program Status\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define void @show_operation(i32* %0, i8* %1) {
%3 = tail call i32 @wmove(i32* %0, i32 1, i32 1)
%4 = load i32, i32* @A_BOLD
%5 = tail call i32 @wattron(i32* %0, i32 %4)
%6 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%7 = load i32, i32* @A_BOLD
%8 = tail call i32 @wattroff(i32* %0, i32 %7)
%9 = tail call i32 @wmove(i32* %0, i32 2, i32 1)
%10 = tail call i32 @whline(i32* %0, i32 0, i32 5000)
%11 = icmp eq i8* %1, null
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = tail call i32 @wmove(i32* %0, i32 3, i32 1)
%14 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %15
15: ; preds = %12, %2
ret void
}