#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 */
char ACS_LTEE;
int /*<<< orphan*/ ACS_RTEE;
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int /*<<< orphan*/, int,
                            int /*<<< orphan*/);
int strlen(char const *);
int /*<<< orphan*/ waddch(int /*<<< orphan*/ *, char);
int /*<<< orphan*/ waddstr(int /*<<< orphan*/ *, char const *);
void wCenterTitle(WINDOW *pwin, const char *title, WINDOW *parent) {
  int x, maxy, maxx, stringsize;
  getmaxyx(pwin, maxy, maxx);
  stringsize = 4 + strlen(title);
  x = (maxx - stringsize) / 2;
  mvwaddch(pwin, 0, x, ACS_RTEE);
  waddch(pwin, ' ');
  waddstr(pwin, title);
  waddch(pwin, ' ');
  waddch(pwin, ACS_LTEE);
}


x86 assembly (clang, -O0):
<wCenterTitle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1060 <getmaxyx@plt>
mov    -0x10(%rbp),%rdi
call   1050 <strlen@plt>
add    $0x4,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x28(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%edx
mov    0x2e37(%rip),%rax
mov    (%rax),%ecx
xor    %esi,%esi
call   1070 <mvwaddch@plt>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1040 <waddch@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <waddstr@plt>
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
call   1040 <waddch@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e0a(%rip),%rax
movsbl (%rax),%esi
call   1040 <waddch@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wCenterTitle>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1060 <getmaxyx@plt>
mov    %r14,%rdi
call   1050 <strlen@plt>
mov    0x2e6a(%rip),%rax
mov    (%rax),%ecx
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <mvwaddch@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <waddch@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <waddstr@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <waddch@plt>
mov    0x2e40(%rip),%rax
movsbl (%rax),%esi
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <waddch@plt>

LLVM IR (-O0):
@ACS_RTEE = global i32 0
@ACS_LTEE = global i8 0
define void @wCenterTitle(i32* %0, i8* %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%11 = load i32*, i32** %4
%12 = load i32, i32* %8
%13 = load i32, i32* %9
%14 = call i32 @getmaxyx(i32* %11, i32 %12, i32 %13)
%15 = load i8*, i8** %5
%16 = call i32 @strlen(i8* %15)
%17 = add nsw i32 4, %16
store i32 %17, i32* %10
%18 = load i32, i32* %9
%19 = load i32, i32* %10
%20 = sub nsw i32 %18, %19
%21 = sdiv i32 %20, 2
store i32 %21, i32* %7
%22 = load i32*, i32** %4
%23 = load i32, i32* %7
%24 = load i32, i32* @ACS_RTEE
%25 = call i32 @mvwaddch(i32* %22, i32 0, i32 %23, i32 %24)
%26 = load i32*, i32** %4
%27 = call i32 @waddch(i32* %26, i8 signext 32)
%28 = load i32*, i32** %4
%29 = load i8*, i8** %5
%30 = call i32 @waddstr(i32* %28, i8* %29)
%31 = load i32*, i32** %4
%32 = call i32 @waddch(i32* %31, i8 signext 32)
%33 = load i32*, i32** %4
%34 = load i8, i8* @ACS_LTEE
%35 = call i32 @waddch(i32* %33, i8 signext %34)
ret void
}

LLVM IR (-O2):
@ACS_RTEE = global i32 0
@ACS_LTEE = global i8 0
define void @wCenterTitle(i32* %0, i8* %1, i32* nocapture readnone %2) {
%4 = tail call i32 @getmaxyx(i32* %0, i32 undef, i32 undef)
%5 = tail call i32 @strlen(i8* %1)
%6 = load i32, i32* @ACS_RTEE
%7 = tail call i32 @mvwaddch(i32* %0, i32 0, i32 0, i32 %6)
%8 = tail call i32 @waddch(i32* %0, i8 signext 32)
%9 = tail call i32 @waddstr(i32* %0, i8* %1)
%10 = tail call i32 @waddch(i32* %0, i8 signext 32)
%11 = load i8, i8* @ACS_LTEE
%12 = tail call i32 @waddch(i32* %0, i8 signext %11)
ret void
}