#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*/ mvwaddstr(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ mvwchgat(int /*<<< orphan*/ *, int, int /*<<< orphan*/, int,
                            int, int, int /*<<< orphan*/);
int /*<<< orphan*/ wattrset(int /*<<< orphan*/ *, int);
void draw_lines(WINDOW *helppad, char *text, int y, int x) {
  if (!helppad)
    return;
  wattrset(helppad, (7 + 1) << 8);
  mvwchgat(helppad, y, 0, -1, (7 + 1) << 8, (7 + 1), 0);
  mvwaddstr(helppad, y, x, text);
}


x86 assembly (clang, -O0):
<draw_lines>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1156 <draw_lines+0x26>
jmp    119d <draw_lines+0x6d>
mov    -0x8(%rbp),%rdi
mov    $0x800,%esi
call   1040 <wattrset@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    $0x800,%r8d
mov    $0x8,%r9d
movl   $0x0,(%rsp)
call   1030 <mvwchgat@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
mov    -0x10(%rbp),%rcx
call   1050 <mvwaddstr@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw_lines>:
test   %rdi,%rdi
je     118f <draw_lines+0x5f>
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %edx,%ebp
mov    %rsi,%r15
mov    %rdi,%rbx
mov    $0x800,%esi
call   1040 <wattrset@plt>
movl   $0x0,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
mov    $0xffffffff,%ecx
mov    $0x800,%r8d
mov    $0x8,%r9d
call   1030 <mvwchgat@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
mov    %r15,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <mvwaddstr@plt>
ret

LLVM IR (-O0):
define void @draw_lines(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32*, i32** %5
%10 = icmp ne i32* %9, null
br i1 %10, label %12, label %11
11: ; preds = %4
br label %23
12: ; preds = %4
%13 = load i32*, i32** %5
%14 = call i32 @wattrset(i32* %13, i32 2048)
%15 = load i32*, i32** %5
%16 = load i32, i32* %7
%17 = call i32 @mvwchgat(i32* %15, i32 %16, i32 0, i32 -1, i32 2048, i32 8, i32 0)
%18 = load i32*, i32** %5
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = load i8*, i8** %6
%22 = call i32 @mvwaddstr(i32* %18, i32 %19, i32 %20, i8* %21)
br label %23
23: ; preds = %12, %11
ret void
}

LLVM IR (-O2):
define void @draw_lines(i32* %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32* %0, null
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = tail call i32 @wattrset(i32* %0, i32 2048)
%8 = tail call i32 @mvwchgat(i32* %0, i32 %2, i32 0, i32 -1, i32 2048, i32 8, i32 0)
%9 = tail call i32 @mvwaddstr(i32* %0, i32 %2, i32 %3, i8* %1)
br label %10
10: ; preds = %4, %6
ret void
}