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

/* Variables and functions */
scalar_t__ NCURSES_MOUSE_VERSION;
int /*<<< orphan*/ addstr(char *);
int /*<<< orphan*/ endwin();
int /*<<< orphan*/ getch();
int /*<<< orphan*/ initscr();
int /*<<< orphan*/ refresh();
int main(void) {
  mmask_t mmask;
  initscr();
  if (NCURSES_MOUSE_VERSION > 0)
    addstr("This version of NCurses supports the mouse.\n");
  else
    addstr("This version of NCurses does not support the mouse.\n");
  refresh();
  getch();
  endwin();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <initscr@plt>
mov    0x2e73(%rip),%rax
cmpq   $0x0,(%rax)
jle    1188 <main+0x38>
lea    0xe82(%rip),%rdi
call   1070 <addstr@plt>
jmp    1194 <main+0x44>
lea    0xe9e(%rip),%rdi
call   1070 <addstr@plt>
mov    $0x0,%al
call   1040 <refresh@plt>
mov    $0x0,%al
call   1050 <getch@plt>
mov    $0x0,%al
call   1060 <endwin@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <initscr@plt>
mov    0x2e81(%rip),%rax
cmpq   $0x0,(%rax)
lea    0xe96(%rip),%rax
lea    0xebc(%rip),%rdi
cmovg  %rax,%rdi
call   1070 <addstr@plt>
xor    %eax,%eax
call   1040 <refresh@plt>
xor    %eax,%eax
call   1050 <getch@plt>
xor    %eax,%eax
call   1060 <endwin@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@NCURSES_MOUSE_VERSION = global i64 0
@.str = [45 x i8] c"This version of NCurses supports the mouse.\0A\00"
@.str.1 = [53 x i8] c"This version of NCurses does not support the mouse.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @initscr()
%4 = load i64, i64* @NCURSES_MOUSE_VERSION
%5 = icmp sgt i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = call i32 @addstr(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0))
br label %10
8: ; preds = %0
%9 = call i32 @addstr(i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0))
br label %10
10: ; preds = %8, %6
%11 = call i32 (...) @refresh()
%12 = call i32 (...) @getch()
%13 = call i32 (...) @endwin()
ret i32 0
}

LLVM IR (-O2):
@NCURSES_MOUSE_VERSION = global i64 0
@.str = [45 x i8] c"This version of NCurses supports the mouse.\0A\00"
@.str.1 = [53 x i8] c"This version of NCurses does not support the mouse.\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @initscr()
%2 = load i64, i64* @NCURSES_MOUSE_VERSION
%3 = icmp sgt i64 %2, 0
%4 = select i1 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.1, i64 0, i64 0)
%5 = tail call i32 @addstr(i8* %4)
%6 = tail call i32 (...) @refresh()
%7 = tail call i32 (...) @getch()
%8 = tail call i32 (...) @endwin()
ret i32 0
}