#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*/ delwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ getbegyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ *newwin(int, int, int, int);
int /*<<< orphan*/ touchwin(int /*<<< orphan*/ *);
int /*<<< orphan*/ wclear(int /*<<< orphan*/ *);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void repaint(WINDOW *w) {
  WINDOW *r;
  int begx, maxx, begy, maxy;
  getbegyx(w, begy, begx);
  getmaxyx(w, maxy, maxx);
  r = newwin(maxy, maxx, begy, begx);
  wclear(r);
  wrefresh(r);
  delwin(r);
  touchwin(w);
  wrefresh(w);
}


x86 assembly (clang, -O0):
<repaint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x14(%rbp),%edx
call   1070 <getbegyx@plt>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1060 <getmaxyx@plt>
mov    -0x20(%rbp),%edi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
call   1050 <newwin@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1090 <wclear@plt>
mov    -0x10(%rbp),%rdi
call   1040 <wrefresh@plt>
mov    -0x10(%rbp),%rdi
call   1080 <delwin@plt>
mov    -0x8(%rbp),%rdi
call   1030 <touchwin@plt>
mov    -0x8(%rbp),%rdi
call   1040 <wrefresh@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<repaint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1070 <getbegyx@plt>
mov    %r14,%rdi
call   1060 <getmaxyx@plt>
call   1050 <newwin@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1090 <wclear@plt>
mov    %rbx,%rdi
call   1040 <wrefresh@plt>
mov    %rbx,%rdi
call   1080 <delwin@plt>
mov    %r14,%rdi
call   1030 <touchwin@plt>
mov    %r14,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <wrefresh@plt>

LLVM IR (-O0):
define void @repaint(i32* %0) {
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %2
%8 = load i32*, i32** %2
%9 = load i32, i32* %6
%10 = load i32, i32* %4
%11 = call i32 @getbegyx(i32* %8, i32 %9, i32 %10)
%12 = load i32*, i32** %2
%13 = load i32, i32* %7
%14 = load i32, i32* %5
%15 = call i32 @getmaxyx(i32* %12, i32 %13, i32 %14)
%16 = load i32, i32* %7
%17 = load i32, i32* %5
%18 = load i32, i32* %6
%19 = load i32, i32* %4
%20 = call i32* @newwin(i32 %16, i32 %17, i32 %18, i32 %19)
store i32* %20, i32** %3
%21 = load i32*, i32** %3
%22 = call i32 @wclear(i32* %21)
%23 = load i32*, i32** %3
%24 = call i32 @wrefresh(i32* %23)
%25 = load i32*, i32** %3
%26 = call i32 @delwin(i32* %25)
%27 = load i32*, i32** %2
%28 = call i32 @touchwin(i32* %27)
%29 = load i32*, i32** %2
%30 = call i32 @wrefresh(i32* %29)
ret void
}

LLVM IR (-O2):
define void @repaint(i32* %0) {
%2 = tail call i32 @getbegyx(i32* %0, i32 undef, i32 undef)
%3 = tail call i32 @getmaxyx(i32* %0, i32 undef, i32 undef)
%4 = tail call i32* @newwin(i32 undef, i32 undef, i32 undef, i32 undef)
%5 = tail call i32 @wclear(i32* %4)
%6 = tail call i32 @wrefresh(i32* %4)
%7 = tail call i32 @delwin(i32* %4)
%8 = tail call i32 @touchwin(i32* %0)
%9 = tail call i32 @wrefresh(i32* %0)
ret void
}