#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 getpary(int /*<<< orphan*/ *);
int /*<<< orphan*/ mvderwin(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wresize(int /*<<< orphan*/ *, int, int);
void wmvresize(WINDOW *win, int top, int left, int rows, int cols) {
  int y = getpary(win);
  if (top < y)
    mvderwin(win, top, left);
  wresize(win, rows, cols);
  if (top > y)
    mvderwin(win, top, left);
}


x86 assembly (clang, -O0):
<wmvresize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <getpary@plt>
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1170 <wmvresize+0x40>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <mvderwin@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
call   1030 <wresize@plt>
mov    -0xc(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jle    119a <wmvresize+0x6a>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1040 <mvderwin@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wmvresize>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r8d,%r15d
mov    %ecx,%r12d
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <getpary@plt>
mov    %eax,%r13d
cmp    %ebp,%eax
jle    1162 <wmvresize+0x32>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1040 <mvderwin@plt>
mov    %rbx,%rdi
mov    %r12d,%esi
mov    %r15d,%edx
call   1030 <wresize@plt>
cmp    %ebp,%r13d
jge    1190 <wmvresize+0x60>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <mvderwin@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @wmvresize(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32* %0, i32** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%12 = load i32*, i32** %6
%13 = call i32 @getpary(i32* %12)
store i32 %13, i32* %11
%14 = load i32, i32* %7
%15 = load i32, i32* %11
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %22
17: ; preds = %5
%18 = load i32*, i32** %6
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = call i32 @mvderwin(i32* %18, i32 %19, i32 %20)
br label %22
22: ; preds = %17, %5
%23 = load i32*, i32** %6
%24 = load i32, i32* %9
%25 = load i32, i32* %10
%26 = call i32 @wresize(i32* %23, i32 %24, i32 %25)
%27 = load i32, i32* %7
%28 = load i32, i32* %11
%29 = icmp sgt i32 %27, %28
br i1 %29, label %30, label %35
30: ; preds = %22
%31 = load i32*, i32** %6
%32 = load i32, i32* %7
%33 = load i32, i32* %8
%34 = call i32 @mvderwin(i32* %31, i32 %32, i32 %33)
br label %35
35: ; preds = %30, %22
ret void
}

LLVM IR (-O2):
define void @wmvresize(i32* %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = tail call i32 @getpary(i32* %0)
%7 = icmp sgt i32 %6, %1
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = tail call i32 @mvderwin(i32* %0, i32 %1, i32 %2)
br label %10
10: ; preds = %8, %5
%11 = tail call i32 @wresize(i32* %0, i32 %3, i32 %4)
%12 = icmp slt i32 %6, %1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @mvderwin(i32* %0, i32 %1, i32 %2)
br label %15
15: ; preds = %13, %10
ret void
}