#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_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ WINDOW;
struct TYPE_3__ {
  scalar_t__ user;
  int /*<<< orphan*/ *win;
};
typedef TYPE_1__ PANEL;

/* Variables and functions */
int /*<<< orphan*/ box(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/);
int /*<<< orphan*/ getmaxyx(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ mvwaddch(int /*<<< orphan*/ *, int, int, char);
int /*<<< orphan*/ mvwprintw(int /*<<< orphan*/ *, int, int, char *, char);
void fill_panel(PANEL *pan) {
  WINDOW *win = pan->win;
  char num = *((char *)pan->user + 1);
  int y, x, maxy, maxx;
  box(win, 0, 0);
  mvwprintw(win, 1, 1, "-pan%c-", num);
  getmaxyx(win, maxy, maxx);
  for (y = 2; y < maxy - 1; y++)
    for (x = 1; x < maxx - 1; x++)
      mvwaddch(win, y, x, num);
}


x86 assembly (clang, -O0):
<fill_panel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    0x1(%rax),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <box@plt>
mov    -0x10(%rbp),%rdi
mov    $0x1,%edx
lea    0xe7e(%rip),%rcx
mov    %edx,%esi
movsbl -0x11(%rbp),%r8d
call   1050 <mvwprintw@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    -0x24(%rbp),%edx
call   1030 <getmaxyx@plt>
movl   $0x2,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1201 <fill_panel+0xc1>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x24(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11ee <fill_panel+0xae>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
movsbl -0x11(%rbp),%ecx
call   1060 <mvwaddch@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11bc <fill_panel+0x7c>
jmp    11f3 <fill_panel+0xb3>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11a4 <fill_panel+0x64>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fill_panel>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%rax
mov    0x8(%rdi),%rbx
movsbl 0x1(%rax),%ebp
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <box@plt>
lea    0xeaf(%rip),%rcx
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    %ebp,%r8d
call   1050 <mvwprintw@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <getmaxyx@plt>

LLVM IR (-O0):
%struct.TYPE_3__ = type { i64, i32* }
@.str = [8 x i8] c"-pan%c-\00"
define void @fill_panel(%struct.TYPE_3__* %0) {
%2 = alloca %struct.TYPE_3__*
%3 = alloca i32*
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store %struct.TYPE_3__* %0, %struct.TYPE_3__** %2
%9 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 1
%11 = load i32*, i32** %10
store i32* %11, i32** %3
%12 = load %struct.TYPE_3__*, %struct.TYPE_3__** %2
%13 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %12, i32 0, i32 0
%14 = load i64, i64* %13
%15 = inttoptr i64 %14 to i8*
%16 = getelementptr inbounds i8, i8* %15, i64 1
%17 = load i8, i8* %16
store i8 %17, i8* %4
%18 = load i32*, i32** %3
%19 = call i32 @box(i32* %18, i32 0, i32 0)
%20 = load i32*, i32** %3
%21 = load i8, i8* %4
%22 = call i32 @mvwprintw(i32* %20, i32 1, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %21)
%23 = load i32*, i32** %3
%24 = load i32, i32* %7
%25 = load i32, i32* %8
%26 = call i32 @getmaxyx(i32* %23, i32 %24, i32 %25)
store i32 2, i32* %5
br label %27
27: ; preds = %48, %1
%28 = load i32, i32* %5
%29 = load i32, i32* %7
%30 = sub nsw i32 %29, 1
%31 = icmp slt i32 %28, %30
br i1 %31, label %32, label %51
32: ; preds = %27
store i32 1, i32* %6
br label %33
33: ; preds = %44, %32
%34 = load i32, i32* %6
%35 = load i32, i32* %8
%36 = sub nsw i32 %35, 1
%37 = icmp slt i32 %34, %36
br i1 %37, label %38, label %47
38: ; preds = %33
%39 = load i32*, i32** %3
%40 = load i32, i32* %5
%41 = load i32, i32* %6
%42 = load i8, i8* %4
%43 = call i32 @mvwaddch(i32* %39, i32 %40, i32 %41, i8 signext %42)
br label %44
44: ; preds = %38
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %33
47: ; preds = %33
br label %48
48: ; preds = %47
%49 = load i32, i32* %5
%50 = add nsw i32 %49, 1
store i32 %50, i32* %5
br label %27
51: ; preds = %27
ret void
}

LLVM IR (-O2):
%struct.TYPE_3__ = type { i64, i32* }
@.str = [8 x i8] c"-pan%c-\00"
define void @fill_panel(%struct.TYPE_3__* nocapture %0) {
%2 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 1
%3 = load i32*, i32** %2
%4 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %0, i64 0, i32 0
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = tail call i32 @box(i32* %3, i32 0, i32 0)
%10 = tail call i32 @mvwprintw(i32* %3, i32 1, i32 1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8 signext %8)
%11 = tail call i32 @getmaxyx(i32* %3, i32 undef, i32 undef)
ret void
}