#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*/ getmaxyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *);
int /*<<< orphan*/ touchwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void printLabel(WINDOW *window, int y, int x, char *text) {
  int maxy, maxx, i;
  getmaxyx(window, maxy, maxx);
  for (i = 1; i < (maxx - 1); i++)
    mvwaddch(window, y, i, ' ');
  mvwprintw(window, y, x, text);
  touchwin(window);
  wrefresh(window);
}


x86 assembly (clang, -O0):
<printLabel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1050 <getmaxyx@plt>
movl   $0x1,-0x24(%rbp)
mov    -0x24(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11af <printLabel+0x5f>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    $0x20,%ecx
call   1070 <mvwaddch@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    117c <printLabel+0x2c>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
call   1060 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
call   1030 <touchwin@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wrefresh@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printLabel>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rcx,%r14
mov    %edx,%r15d
mov    %esi,%ebx
mov    %rdi,%rbp
call   1050 <getmaxyx@plt>
mov    %rbp,%rdi
mov    %ebx,%esi
mov    %r15d,%edx
mov    %r14,%rcx
call   1060 <mvwprintw@plt>
mov    %rbp,%rdi
call   1030 <touchwin@plt>
mov    %rbp,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <wrefresh@plt>

LLVM IR (-O0):
define void @printLabel(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%12 = load i32*, i32** %5
%13 = load i32, i32* %9
%14 = load i32, i32* %10
%15 = call i32 @getmaxyx(i32* %12, i32 %13, i32 %14)
store i32 1, i32* %11
br label %16
16: ; preds = %26, %4
%17 = load i32, i32* %11
%18 = load i32, i32* %10
%19 = sub nsw i32 %18, 1
%20 = icmp slt i32 %17, %19
br i1 %20, label %21, label %29
21: ; preds = %16
%22 = load i32*, i32** %5
%23 = load i32, i32* %6
%24 = load i32, i32* %11
%25 = call i32 @mvwaddch(i32* %22, i32 %23, i32 %24, i8 signext 32)
br label %26
26: ; preds = %21
%27 = load i32, i32* %11
%28 = add nsw i32 %27, 1
store i32 %28, i32* %11
br label %16
29: ; preds = %16
%30 = load i32*, i32** %5
%31 = load i32, i32* %6
%32 = load i32, i32* %7
%33 = load i8*, i8** %8
%34 = call i32 @mvwprintw(i32* %30, i32 %31, i32 %32, i8* %33)
%35 = load i32*, i32** %5
%36 = call i32 @touchwin(i32* %35)
%37 = load i32*, i32** %5
%38 = call i32 @wrefresh(i32* %37)
ret void
}

LLVM IR (-O2):
define void @printLabel(i32* %0, i32 %1, i32 %2, i8* %3) {
%5 = tail call i32 @getmaxyx(i32* %0, i32 undef, i32 undef)
%6 = tail call i32 @mvwprintw(i32* %0, i32 %1, i32 %2, i8* %3)
%7 = tail call i32 @touchwin(i32* %0)
%8 = tail call i32 @wrefresh(i32* %0)
ret void
}