#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 */
int /*<<< orphan*/ clearbox(int, int, int /*<<< orphan*/, int);
int /*<<< orphan*/ drawbox(int, int, int, int, void *);
int /*<<< orphan*/ inputsetup_menu(int, int, int);
int /*<<< orphan*/ printhelp(int, int);
int /*<<< orphan*/ printmenuitem(char *, int);
int /*<<< orphan*/ setcurs(int, int);
void inputsetup_box(int pl, int x, int y) {
  int h = 8;
  clearbox(x - 1, y, 0, h + 4);
  printhelp(x + 2, y + h + 2);
  setcurs(x, y);
  printmenuitem("Input Setup", 1);
  drawbox(x, y + 1, 31, h, (void *)0);
  inputsetup_menu(pl, x + 1, y + 2);
  clearbox(x, y, 0, h + 4);
}


x86 assembly (clang, -O0):
<inputsetup_box>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
add    $0x4,%ecx
xor    %edx,%edx
call   1050 <clearbox@plt>
mov    -0x8(%rbp),%edi
add    $0x2,%edi
mov    -0xc(%rbp),%esi
add    -0x10(%rbp),%esi
add    $0x2,%esi
call   1070 <printhelp@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
call   1040 <setcurs@plt>
lea    0xe4c(%rip),%rdi
mov    $0x1,%esi
call   1080 <printmenuitem@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%ecx
mov    $0x1f,%edx
xor    %eax,%eax
mov    %eax,%r8d
call   1060 <drawbox@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
add    $0x1,%esi
mov    -0xc(%rbp),%edx
add    $0x2,%edx
call   1030 <inputsetup_menu@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%ecx
add    $0x4,%ecx
xor    %edx,%edx
call   1050 <clearbox@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inputsetup_box>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%ebp
lea    -0x1(%rbx),%edi
mov    %edx,%esi
xor    %edx,%edx
mov    $0xc,%ecx
call   1050 <clearbox@plt>
lea    0x2(%rbx),%edi
lea    0xa(%r14),%esi
call   1070 <printhelp@plt>
mov    %ebx,%edi
mov    %r14d,%esi
call   1040 <setcurs@plt>
lea    0xe67(%rip),%rdi
mov    $0x1,%esi
call   1080 <printmenuitem@plt>
lea    0x1(%r14),%esi
mov    %ebx,%edi
mov    $0x1f,%edx
mov    $0x8,%ecx
xor    %r8d,%r8d
call   1060 <drawbox@plt>
lea    0x1(%rbx),%esi
lea    0x2(%r14),%edx
mov    %ebp,%edi
call   1030 <inputsetup_menu@plt>
mov    %ebx,%edi
mov    %r14d,%esi
xor    %edx,%edx
mov    $0xc,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <clearbox@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"Input Setup\00"
define void @inputsetup_box(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 8, i32* %7
%8 = load i32, i32* %5
%9 = sub nsw i32 %8, 1
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = add nsw i32 %11, 4
%13 = call i32 @clearbox(i32 %9, i32 %10, i32 0, i32 %12)
%14 = load i32, i32* %5
%15 = add nsw i32 %14, 2
%16 = load i32, i32* %6
%17 = load i32, i32* %7
%18 = add nsw i32 %16, %17
%19 = add nsw i32 %18, 2
%20 = call i32 @printhelp(i32 %15, i32 %19)
%21 = load i32, i32* %5
%22 = load i32, i32* %6
%23 = call i32 @setcurs(i32 %21, i32 %22)
%24 = call i32 @printmenuitem(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%25 = load i32, i32* %5
%26 = load i32, i32* %6
%27 = add nsw i32 %26, 1
%28 = load i32, i32* %7
%29 = call i32 @drawbox(i32 %25, i32 %27, i32 31, i32 %28, i8* null)
%30 = load i32, i32* %4
%31 = load i32, i32* %5
%32 = add nsw i32 %31, 1
%33 = load i32, i32* %6
%34 = add nsw i32 %33, 2
%35 = call i32 @inputsetup_menu(i32 %30, i32 %32, i32 %34)
%36 = load i32, i32* %5
%37 = load i32, i32* %6
%38 = load i32, i32* %7
%39 = add nsw i32 %38, 4
%40 = call i32 @clearbox(i32 %36, i32 %37, i32 0, i32 %39)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"Input Setup\00"
define void @inputsetup_box(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, -1
%5 = tail call i32 @clearbox(i32 %4, i32 %2, i32 0, i32 12)
%6 = add nsw i32 %1, 2
%7 = add nsw i32 %2, 10
%8 = tail call i32 @printhelp(i32 %6, i32 %7)
%9 = tail call i32 @setcurs(i32 %1, i32 %2)
%10 = tail call i32 @printmenuitem(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 1)
%11 = add nsw i32 %2, 1
%12 = tail call i32 @drawbox(i32 %1, i32 %11, i32 31, i32 8, i8* null)
%13 = add nsw i32 %1, 1
%14 = add nsw i32 %2, 2
%15 = tail call i32 @inputsetup_menu(i32 %0, i32 %13, i32 %14)
%16 = tail call i32 @clearbox(i32 %1, i32 %2, i32 0, i32 12)
ret void
}