#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 */

/* Variables and functions */
int /*<<< orphan*/ boxfill8(unsigned char *, int, int, int, int, int, int);
int /*<<< orphan*/ make_wtitle8(unsigned char *, int, char *, char);
void make_window8(unsigned char *buf, int xsize, int ysize, char *title,
                  char act) {
  boxfill8(buf, xsize, 8, 0, 0, xsize - 1, 0);
  boxfill8(buf, xsize, 7, 1, 1, xsize - 2, 1);
  boxfill8(buf, xsize, 8, 0, 0, 0, ysize - 1);
  boxfill8(buf, xsize, 7, 1, 1, 1, ysize - 2);
  boxfill8(buf, xsize, 15, xsize - 2, 1, xsize - 2, ysize - 2);
  boxfill8(buf, xsize, 0, xsize - 1, 0, xsize - 1, ysize - 1);
  boxfill8(buf, xsize, 8, 2, 2, xsize - 3, ysize - 3);
  boxfill8(buf, xsize, 15, 1, ysize - 2, xsize - 2, ysize - 2);
  boxfill8(buf, xsize, 0, 0, ysize - 1, xsize - 1, ysize - 1);
  make_wtitle8(buf, xsize, title, act);
  return;
}


x86 assembly (clang, -O0):
<make_window8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %r8b,%al
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
mov    %al,-0x19(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
mov    $0x8,%edx
xor    %r8d,%r8d
mov    %r8d,%ecx
movl   $0x0,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%r9d
sub    $0x2,%r9d
mov    $0x7,%edx
mov    $0x1,%r8d
mov    %r8d,%ecx
movl   $0x1,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
mov    $0x8,%edx
xor    %r9d,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %eax,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    $0x7,%edx
mov    $0x1,%r9d
mov    %r9d,%ecx
mov    %r9d,%r8d
mov    %eax,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%ecx
sub    $0x2,%ecx
mov    -0xc(%rbp),%r9d
sub    $0x2,%r9d
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    $0xf,%edx
mov    $0x1,%r8d
mov    %eax,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
xor    %r8d,%r8d
mov    %r8d,%edx
mov    %eax,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%r9d
sub    $0x3,%r9d
mov    -0x10(%rbp),%eax
sub    $0x3,%eax
mov    $0x8,%edx
mov    $0x2,%r8d
mov    %r8d,%ecx
mov    %eax,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x2,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x2,%r9d
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
mov    $0xf,%edx
mov    $0x1,%ecx
mov    %eax,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%r8d
sub    $0x1,%r8d
mov    -0xc(%rbp),%r9d
sub    $0x1,%r9d
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
xor    %ecx,%ecx
mov    %ecx,%edx
mov    %eax,(%rsp)
call   1040 <boxfill8@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
movsbl -0x19(%rbp),%ecx
call   1030 <make_wtitle8@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_window8>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r8d,0xc(%rsp)
mov    %rcx,0x10(%rsp)
mov    %edx,%r13d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    -0x1(%rbp),%r9d
mov    %r9d,0x8(%rsp)
movl   $0x0,(%rsp)
mov    $0x8,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1040 <boxfill8@plt>
lea    -0x2(%rbp),%r14d
movl   $0x1,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    %r14d,%r9d
call   1040 <boxfill8@plt>
lea    -0x1(%r13),%r15d
mov    %r15d,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x8,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1040 <boxfill8@plt>
lea    -0x2(%r13),%r12d
mov    %r12d,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x7,%edx
mov    $0x1,%ecx
mov    $0x1,%r8d
mov    $0x1,%r9d
call   1040 <boxfill8@plt>
mov    %r12d,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xf,%edx
mov    %r14d,%ecx
mov    $0x1,%r8d
mov    %r14d,%r9d
call   1040 <boxfill8@plt>
mov    %r15d,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
mov    0x8(%rsp),%ecx
xor    %r8d,%r8d
mov    %ecx,%r9d
call   1040 <boxfill8@plt>
lea    -0x3(%rbp),%r9d
add    $0xfffffffd,%r13d
mov    %r13d,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x8,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
call   1040 <boxfill8@plt>
mov    %r12d,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0xf,%edx
mov    $0x1,%ecx
mov    %r12d,%r8d
mov    %r14d,%r9d
call   1040 <boxfill8@plt>
mov    %r15d,(%rsp)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    %r15d,%r8d
mov    0x8(%rsp),%r9d
call   1040 <boxfill8@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    0x10(%rsp),%rdx
mov    0xc(%rsp),%ecx
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <make_wtitle8@plt>

LLVM IR (-O0):
define void @make_window8(i8* %0, i32 %1, i32 %2, i8* %3, i8 signext %4) {
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8
store i8* %0, i8** %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8 %4, i8* %10
%11 = load i8*, i8** %6
%12 = load i32, i32* %7
%13 = load i32, i32* %7
%14 = sub nsw i32 %13, 1
%15 = call i32 @boxfill8(i8* %11, i32 %12, i32 8, i32 0, i32 0, i32 %14, i32 0)
%16 = load i8*, i8** %6
%17 = load i32, i32* %7
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 2
%20 = call i32 @boxfill8(i8* %16, i32 %17, i32 7, i32 1, i32 1, i32 %19, i32 1)
%21 = load i8*, i8** %6
%22 = load i32, i32* %7
%23 = load i32, i32* %8
%24 = sub nsw i32 %23, 1
%25 = call i32 @boxfill8(i8* %21, i32 %22, i32 8, i32 0, i32 0, i32 0, i32 %24)
%26 = load i8*, i8** %6
%27 = load i32, i32* %7
%28 = load i32, i32* %8
%29 = sub nsw i32 %28, 2
%30 = call i32 @boxfill8(i8* %26, i32 %27, i32 7, i32 1, i32 1, i32 1, i32 %29)
%31 = load i8*, i8** %6
%32 = load i32, i32* %7
%33 = load i32, i32* %7
%34 = sub nsw i32 %33, 2
%35 = load i32, i32* %7
%36 = sub nsw i32 %35, 2
%37 = load i32, i32* %8
%38 = sub nsw i32 %37, 2
%39 = call i32 @boxfill8(i8* %31, i32 %32, i32 15, i32 %34, i32 1, i32 %36, i32 %38)
%40 = load i8*, i8** %6
%41 = load i32, i32* %7
%42 = load i32, i32* %7
%43 = sub nsw i32 %42, 1
%44 = load i32, i32* %7
%45 = sub nsw i32 %44, 1
%46 = load i32, i32* %8
%47 = sub nsw i32 %46, 1
%48 = call i32 @boxfill8(i8* %40, i32 %41, i32 0, i32 %43, i32 0, i32 %45, i32 %47)
%49 = load i8*, i8** %6
%50 = load i32, i32* %7
%51 = load i32, i32* %7
%52 = sub nsw i32 %51, 3
%53 = load i32, i32* %8
%54 = sub nsw i32 %53, 3
%55 = call i32 @boxfill8(i8* %49, i32 %50, i32 8, i32 2, i32 2, i32 %52, i32 %54)
%56 = load i8*, i8** %6
%57 = load i32, i32* %7
%58 = load i32, i32* %8
%59 = sub nsw i32 %58, 2
%60 = load i32, i32* %7
%61 = sub nsw i32 %60, 2
%62 = load i32, i32* %8
%63 = sub nsw i32 %62, 2
%64 = call i32 @boxfill8(i8* %56, i32 %57, i32 15, i32 1, i32 %59, i32 %61, i32 %63)
%65 = load i8*, i8** %6
%66 = load i32, i32* %7
%67 = load i32, i32* %8
%68 = sub nsw i32 %67, 1
%69 = load i32, i32* %7
%70 = sub nsw i32 %69, 1
%71 = load i32, i32* %8
%72 = sub nsw i32 %71, 1
%73 = call i32 @boxfill8(i8* %65, i32 %66, i32 0, i32 0, i32 %68, i32 %70, i32 %72)
%74 = load i8*, i8** %6
%75 = load i32, i32* %7
%76 = load i8*, i8** %9
%77 = load i8, i8* %10
%78 = call i32 @make_wtitle8(i8* %74, i32 %75, i8* %76, i8 signext %77)
ret void
}

LLVM IR (-O2):
define void @make_window8(i8* %0, i32 %1, i32 %2, i8* %3, i8 signext %4) {
%6 = add nsw i32 %1, -1
%7 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 8, i32 0, i32 0, i32 %6, i32 0)
%8 = add nsw i32 %1, -2
%9 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 7, i32 1, i32 1, i32 %8, i32 1)
%10 = add nsw i32 %2, -1
%11 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 8, i32 0, i32 0, i32 0, i32 %10)
%12 = add nsw i32 %2, -2
%13 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 7, i32 1, i32 1, i32 1, i32 %12)
%14 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 15, i32 %8, i32 1, i32 %8, i32 %12)
%15 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 0, i32 %6, i32 0, i32 %6, i32 %10)
%16 = add nsw i32 %1, -3
%17 = add nsw i32 %2, -3
%18 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 8, i32 2, i32 2, i32 %16, i32 %17)
%19 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 15, i32 1, i32 %12, i32 %8, i32 %12)
%20 = tail call i32 @boxfill8(i8* %0, i32 %1, i32 0, i32 0, i32 %10, i32 %6, i32 %10)
%21 = tail call i32 @make_wtitle8(i8* %0, i32 %1, i8* %3, i8 signext %4)
ret void
}