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

/* Variables and functions */
scalar_t__ LINES;
int /*<<< orphan*/ beep();
int /*<<< orphan*/ clrtobot();
int /*<<< orphan*/ move(scalar_t__, int /*<<< orphan*/);
int /*<<< orphan*/ mvprintw(scalar_t__, int, char *, char *);
int /*<<< orphan*/ refresh();
void error(char *msg) {
  move(LINES - 1, 0);
  clrtobot();
  mvprintw(LINES - 1, 10, "%s", msg);
  if (msg != "")
    beep();
  refresh();
}


x86 assembly (clang, -O0):
<error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e85(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
xor    %esi,%esi
call   1070 <move@plt>
mov    $0x0,%al
call   1030 <clrtobot@plt>
mov    0x2e69(%rip),%rax
mov    (%rax),%rdi
sub    $0x1,%rdi
mov    -0x8(%rbp),%rcx
mov    $0xa,%esi
lea    0xe6a(%rip),%rdx
call   1060 <mvprintw@plt>
lea    0xe60(%rip),%rax
cmp    %rax,-0x8(%rbp)
je     11b3 <error+0x63>
mov    $0x0,%al
call   1040 <beep@plt>
mov    $0x0,%al
call   1050 <refresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<error>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2e8a(%rip),%r14
mov    (%r14),%rdi
add    $0xffffffffffffffff,%rdi
xor    %esi,%esi
call   1070 <move@plt>
xor    %eax,%eax
call   1030 <clrtobot@plt>
mov    (%r14),%rdi
add    $0xffffffffffffffff,%rdi
lea    0xe7f(%rip),%rdx
mov    $0xa,%esi
mov    %rbx,%rcx
call   1060 <mvprintw@plt>
lea    0xe6d(%rip),%rax
cmp    %rax,%rbx
je     11a1 <error+0x51>
xor    %eax,%eax
call   1040 <beep@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <refresh@plt>

LLVM IR (-O0):
@LINES = global i64 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @error(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i64, i64* @LINES
%4 = sub nsw i64 %3, 1
%5 = call i32 @move(i64 %4, i32 0)
%6 = call i32 (...) @clrtobot()
%7 = load i64, i64* @LINES
%8 = sub nsw i64 %7, 1
%9 = load i8*, i8** %2
%10 = call i32 @mvprintw(i64 %8, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
%11 = load i8*, i8** %2
%12 = icmp ne i8* %11, getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = call i32 (...) @beep()
br label %15
15: ; preds = %13, %1
%16 = call i32 (...) @refresh()
ret void
}

LLVM IR (-O2):
@LINES = global i64 0
@.str = [3 x i8] c"%s\00"
@.str.1 = [1 x i8] zeroinitializer
define void @error(i8* %0) {
%2 = load i64, i64* @LINES
%3 = add nsw i64 %2, -1
%4 = tail call i32 @move(i64 %3, i32 0)
%5 = tail call i32 (...) @clrtobot()
%6 = load i64, i64* @LINES
%7 = add nsw i64 %6, -1
%8 = tail call i32 @mvprintw(i64 %7, i32 10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%9 = icmp eq i8* %0, getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
br i1 %9, label %12, label %10
10: ; preds = %1
%11 = tail call i32 (...) @beep()
br label %12
12: ; preds = %10, %1
%13 = tail call i32 (...) @refresh()
ret void
}