#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*/ chprintarr(int /*<<< orphan*/ *, int, int, char);
int /*<<< orphan*/ wrefresh(int /*<<< orphan*/ *);
void printspecial(WINDOW *win, int size) {
  int i;
  chprintarr(win, (size - 1) / 2, (size - 1) / 2, '*');
  for (i = 1; i <= 4; i++) {
    chprintarr(win, i, i, 'd');
    chprintarr(win, i, size - 1 - i, 'd');
    chprintarr(win, size - 1 - i, i, 'd');
    chprintarr(win, size - 1 - i, size - 1 - i, 'd');
  }
  for (i = 0; i < size; i += 7) {
    chprintarr(win, i, 0, 'T');
    chprintarr(win, 0, i, 'T');
    chprintarr(win, i, size - 1, 'T');
    chprintarr(win, size - 1, i, 'T');
  }
  wrefresh(win);
}


x86 assembly (clang, -O0):
<printspecial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
mov    -0xc(%rbp),%eax
sub    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%edx
mov    $0x2a,%ecx
call   1040 <chprintarr@plt>
movl   $0x1,-0x10(%rbp)
cmpl   $0x4,-0x10(%rbp)
jg     11e4 <printspecial+0xc4>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
sub    -0x10(%rbp),%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
sub    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
sub    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
sub    -0x10(%rbp),%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1164 <printspecial+0x44>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1259 <printspecial+0x139>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
xor    %edx,%edx
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
xor    %esi,%esi
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
mov    -0x10(%rbp),%edx
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
mov    -0x10(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x10(%rbp)
jmp    11eb <printspecial+0xcb>
mov    -0x8(%rbp),%rdi
call   1030 <wrefresh@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printspecial>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %esi,%r14d
mov    %rdi,%rbx
lea    -0x1(%r14),%r15d
mov    %r15d,%eax
shr    $0x1f,%eax
lea    (%r14,%rax,1),%edx
add    $0xffffffff,%edx
sar    %edx
mov    %edx,%esi
mov    $0x2a,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
mov    $0x1,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
lea    -0x2(%r14),%ebp
mov    %rbx,%rdi
mov    $0x1,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x2,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
lea    -0x3(%r14),%ebp
mov    %rbx,%rdi
mov    $0x2,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x2,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x3,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
lea    -0x4(%r14),%ebp
mov    %rbx,%rdi
mov    $0x3,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x3,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x4,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
lea    -0x5(%r14),%ebp
mov    %rbx,%rdi
mov    $0x4,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x4,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    $0x64,%ecx
call   1040 <chprintarr@plt>
test   %r14d,%r14d
jle    12fe <printspecial+0x1de>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %rbx,%rdi
mov    %ebp,%esi
xor    %edx,%edx
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %ebp,%edx
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r15d,%edx
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
mov    %ebp,%edx
mov    $0x54,%ecx
call   1040 <chprintarr@plt>
add    $0x7,%ebp
cmp    %r14d,%ebp
jl     12b0 <printspecial+0x190>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <wrefresh@plt>

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

LLVM IR (-O2):
define void @printspecial(i32* %0, i32 %1) {
%3 = add nsw i32 %1, -1
%4 = sdiv i32 %3, 2
%5 = tail call i32 @chprintarr(i32* %0, i32 %4, i32 %4, i8 signext 42)
%6 = tail call i32 @chprintarr(i32* %0, i32 1, i32 1, i8 signext 100)
%7 = add nsw i32 %1, -2
%8 = tail call i32 @chprintarr(i32* %0, i32 1, i32 %7, i8 signext 100)
%9 = tail call i32 @chprintarr(i32* %0, i32 %7, i32 1, i8 signext 100)
%10 = tail call i32 @chprintarr(i32* %0, i32 %7, i32 %7, i8 signext 100)
%11 = tail call i32 @chprintarr(i32* %0, i32 2, i32 2, i8 signext 100)
%12 = add nsw i32 %1, -3
%13 = tail call i32 @chprintarr(i32* %0, i32 2, i32 %12, i8 signext 100)
%14 = tail call i32 @chprintarr(i32* %0, i32 %12, i32 2, i8 signext 100)
%15 = tail call i32 @chprintarr(i32* %0, i32 %12, i32 %12, i8 signext 100)
%16 = tail call i32 @chprintarr(i32* %0, i32 3, i32 3, i8 signext 100)
%17 = add nsw i32 %1, -4
%18 = tail call i32 @chprintarr(i32* %0, i32 3, i32 %17, i8 signext 100)
%19 = tail call i32 @chprintarr(i32* %0, i32 %17, i32 3, i8 signext 100)
%20 = tail call i32 @chprintarr(i32* %0, i32 %17, i32 %17, i8 signext 100)
%21 = tail call i32 @chprintarr(i32* %0, i32 4, i32 4, i8 signext 100)
%22 = add nsw i32 %1, -5
%23 = tail call i32 @chprintarr(i32* %0, i32 4, i32 %22, i8 signext 100)
%24 = tail call i32 @chprintarr(i32* %0, i32 %22, i32 4, i8 signext 100)
%25 = tail call i32 @chprintarr(i32* %0, i32 %22, i32 %22, i8 signext 100)
%26 = icmp sgt i32 %1, 0
br i1 %26, label %27, label %35
27: ; preds = %2, %27
%28 = phi i32 [ %33, %27 ], [ 0, %2 ]
%29 = tail call i32 @chprintarr(i32* %0, i32 %28, i32 0, i8 signext 84)
%30 = tail call i32 @chprintarr(i32* %0, i32 0, i32 %28, i8 signext 84)
%31 = tail call i32 @chprintarr(i32* %0, i32 %28, i32 %3, i8 signext 84)
%32 = tail call i32 @chprintarr(i32* %0, i32 %3, i32 %28, i8 signext 84)
%33 = add nuw nsw i32 %28, 7
%34 = icmp slt i32 %33, %1
br i1 %34, label %27, label %35
35: ; preds = %27, %2
%36 = tail call i32 @wrefresh(i32* %0)
ret void
}