#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 */
typedef struct TYPE_7__ TYPE_1__;

/* Type definitions */
struct TYPE_7__ {
  int /*<<< orphan*/ _maxx;
};
typedef TYPE_1__ WINDOW;

/* Variables and functions */
int /*<<< orphan*/ mvwprintw(TYPE_1__ *, int /*<<< orphan*/, int /*<<< orphan*/,
                             char *, int /*<<< orphan*/);
int /*<<< orphan*/ padstr(char *, int /*<<< orphan*/);
int /*<<< orphan*/ werase(TYPE_1__ *);
int /*<<< orphan*/ wmove(TYPE_1__ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ wrefresh(TYPE_1__ *);
void repainteditbox(WINDOW *win, int x, char *buf) {
  werase(win);
  mvwprintw(win, 0, 0, "%s", padstr(buf, win->_maxx));
  wmove(win, 0, x);
  wrefresh(win);
}


x86 assembly (clang, -O0):
<repainteditbox>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1070 <werase@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%esi
call   1040 <padstr@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%r8d
xor    %edx,%edx
lea    0xe6d(%rip),%rcx
mov    %edx,%esi
call   1050 <mvwprintw@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1060 <wmove@plt>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repainteditbox>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%rbx
mov    %esi,%r14d
mov    %rdi,%rbp
call   1070 <werase@plt>
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   1040 <padstr@plt>
lea    0xe8c(%rip),%rcx
mov    %rbp,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    %eax,%r8d
call   1050 <mvwprintw@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %r14d,%edx
call   1060 <wmove@plt>
mov    %rbp,%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <wrefresh@plt>

LLVM IR (-O0):
%struct.TYPE_7__ = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @repainteditbox(%struct.TYPE_7__* %0, i32 %1, i8* %2) {
%4 = alloca %struct.TYPE_7__*
%5 = alloca i32
%6 = alloca i8*
store %struct.TYPE_7__* %0, %struct.TYPE_7__** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%8 = call i32 @werase(%struct.TYPE_7__* %7)
%9 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%10 = load i8*, i8** %6
%11 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%12 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %11, i32 0, i32 0
%13 = load i32, i32* %12
%14 = call i32 @padstr(i8* %10, i32 %13)
%15 = call i32 @mvwprintw(%struct.TYPE_7__* %9, i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%17 = load i32, i32* %5
%18 = call i32 @wmove(%struct.TYPE_7__* %16, i32 0, i32 %17)
%19 = load %struct.TYPE_7__*, %struct.TYPE_7__** %4
%20 = call i32 @wrefresh(%struct.TYPE_7__* %19)
ret void
}

LLVM IR (-O2):
%struct.TYPE_7__ = type { i32 }
@.str = [3 x i8] c"%s\00"
define void @repainteditbox(%struct.TYPE_7__* %0, i32 %1, i8* %2) {
%4 = tail call i32 @werase(%struct.TYPE_7__* %0)
%5 = getelementptr inbounds %struct.TYPE_7__, %struct.TYPE_7__* %0, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @padstr(i8* %2, i32 %6)
%8 = tail call i32 @mvwprintw(%struct.TYPE_7__* %0, i32 0, i32 0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @wmove(%struct.TYPE_7__* %0, i32 0, i32 %1)
%10 = tail call i32 @wrefresh(%struct.TYPE_7__* %0)
ret void
}