#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*/ A_UNDERLINE;
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char const *);
void wprintw_ping_effects(WINDOW *ncurses_win, const char *outstr,
                          char was_pingged, char new_content) {
  if (new_content == 1) {
    if (was_pingged == 1) {
      wattron(ncurses_win, A_BOLD);
    }
    wattron(ncurses_win, A_UNDERLINE);
    wprintw(ncurses_win, outstr);
    wattroff(ncurses_win, A_UNDERLINE);
    if (was_pingged == 1) {
      wattroff(ncurses_win, A_BOLD);
    }
  } else {
    wprintw(ncurses_win, outstr);
  }
}


x86 assembly (clang, -O0):
<wprintw_ping_effects>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %cl,%al
mov    %dl,%cl
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %cl,-0x11(%rbp)
mov    %al,-0x12(%rbp)
movsbl -0x12(%rbp),%eax
cmp    $0x1,%eax
jne    11cb <wprintw_ping_effects+0x9b>
movsbl -0x11(%rbp),%eax
cmp    $0x1,%eax
jne    1176 <wprintw_ping_effects+0x46>
mov    -0x8(%rbp),%rdi
mov    0x2e71(%rip),%rax
mov    (%rax),%esi
call   1050 <wattron@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e57(%rip),%rax
mov    (%rax),%esi
call   1050 <wattron@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wprintw@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e38(%rip),%rax
mov    (%rax),%esi
call   1040 <wattroff@plt>
movsbl -0x11(%rbp),%eax
cmp    $0x1,%eax
jne    11c6 <wprintw_ping_effects+0x96>
mov    -0x8(%rbp),%rdi
mov    0x2e21(%rip),%rax
mov    (%rax),%esi
call   1040 <wattroff@plt>
jmp    11d8 <wprintw_ping_effects+0xa8>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <wprintw@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wprintw_ping_effects>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
cmp    $0x1,%cl
jne    1186 <wprintw_ping_effects+0x56>
cmp    $0x1,%dl
jne    119c <wprintw_ping_effects+0x6c>
mov    0x2e91(%rip),%r15
mov    (%r15),%esi
mov    %rbx,%rdi
call   1050 <wattron@plt>
mov    0x2e77(%rip),%r12
mov    (%r12),%esi
mov    %rbx,%rdi
call   1050 <wattron@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <wprintw@plt>
mov    (%r12),%esi
mov    %rbx,%rdi
call   1040 <wattroff@plt>
jmp    11b9 <wprintw_ping_effects+0x89>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <wprintw@plt>
mov    0x2e35(%rip),%r15
mov    (%r15),%esi
mov    %rbx,%rdi
call   1050 <wattron@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <wprintw@plt>
mov    (%r15),%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1040 <wattroff@plt>

LLVM IR (-O0):
@A_BOLD = global i32 0
@A_UNDERLINE = global i32 0
define void @wprintw_ping_effects(i32* %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8
%8 = alloca i8
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8 %2, i8* %7
store i8 %3, i8* %8
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp eq i32 %10, 1
br i1 %11, label %12, label %38
12: ; preds = %4
%13 = load i8, i8* %7
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 1
br i1 %15, label %16, label %20
16: ; preds = %12
%17 = load i32*, i32** %5
%18 = load i32, i32* @A_BOLD
%19 = call i32 @wattron(i32* %17, i32 %18)
br label %20
20: ; preds = %16, %12
%21 = load i32*, i32** %5
%22 = load i32, i32* @A_UNDERLINE
%23 = call i32 @wattron(i32* %21, i32 %22)
%24 = load i32*, i32** %5
%25 = load i8*, i8** %6
%26 = call i32 @wprintw(i32* %24, i8* %25)
%27 = load i32*, i32** %5
%28 = load i32, i32* @A_UNDERLINE
%29 = call i32 @wattroff(i32* %27, i32 %28)
%30 = load i8, i8* %7
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 1
br i1 %32, label %33, label %37
33: ; preds = %20
%34 = load i32*, i32** %5
%35 = load i32, i32* @A_BOLD
%36 = call i32 @wattroff(i32* %34, i32 %35)
br label %37
37: ; preds = %33, %20
br label %42
38: ; preds = %4
%39 = load i32*, i32** %5
%40 = load i8*, i8** %6
%41 = call i32 @wprintw(i32* %39, i8* %40)
br label %42
42: ; preds = %38, %37
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@A_UNDERLINE = global i32 0
define void @wprintw_ping_effects(i32* %0, i8* %1, i8 signext %2, i8 signext %3) {
%5 = icmp eq i8 %3, 1
br i1 %5, label %6, label %18
6: ; preds = %4
%7 = icmp eq i8 %2, 1
br i1 %7, label %8, label %20
8: ; preds = %6
%9 = load i32, i32* @A_BOLD
%10 = tail call i32 @wattron(i32* %0, i32 %9)
%11 = load i32, i32* @A_UNDERLINE
%12 = tail call i32 @wattron(i32* %0, i32 %11)
%13 = tail call i32 @wprintw(i32* %0, i8* %1)
%14 = load i32, i32* @A_UNDERLINE
%15 = tail call i32 @wattroff(i32* %0, i32 %14)
%16 = load i32, i32* @A_BOLD
%17 = tail call i32 @wattroff(i32* %0, i32 %16)
br label %26
18: ; preds = %4
%19 = tail call i32 @wprintw(i32* %0, i8* %1)
br label %26
20: ; preds = %6
%21 = load i32, i32* @A_UNDERLINE
%22 = tail call i32 @wattron(i32* %0, i32 %21)
%23 = tail call i32 @wprintw(i32* %0, i8* %1)
%24 = load i32, i32* @A_UNDERLINE
%25 = tail call i32 @wattroff(i32* %0, i32 %24)
br label %26
26: ; preds = %20, %8, %18
ret void
}