#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*/ printAsterisks(int);
int /*<<< orphan*/ printEquals(int);
int /*<<< orphan*/ printf(char *);
void printPattern(int height, int width) {
  printf("\n\n");
  printEquals(width);
  for (height -= 2; height > 0; height--)
    printAsterisks(width);
  printEquals(width);
  printf("\n\n");
  return;
}


x86 assembly (clang, -O0):
<printPattern>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    0xebb(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%edi
call   1030 <printEquals@plt>
mov    -0x4(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    117b <printPattern+0x4b>
mov    -0x8(%rbp),%edi
call   1050 <printAsterisks@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    115b <printPattern+0x2b>
mov    -0x8(%rbp),%edi
call   1030 <printEquals@plt>
lea    0xe76(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printPattern>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
lea    0xec2(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1040 <printEquals@plt>
cmp    $0x3,%ebp
jl     116f <printPattern+0x3f>
add    $0xffffffff,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %ebx,%edi
call   1050 <printAsterisks@plt>
add    $0xffffffff,%ebp
cmp    $0x1,%ebp
ja     1160 <printPattern+0x30>
mov    %ebx,%edi
call   1040 <printEquals@plt>
lea    0xe83(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
define void @printPattern(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %4
%7 = call i32 @printEquals(i32 %6)
%8 = load i32, i32* %3
%9 = sub nsw i32 %8, 2
store i32 %9, i32* %3
br label %10
10: ; preds = %16, %2
%11 = load i32, i32* %3
%12 = icmp sgt i32 %11, 0
br i1 %12, label %13, label %19
13: ; preds = %10
%14 = load i32, i32* %4
%15 = call i32 @printAsterisks(i32 %14)
br label %16
16: ; preds = %13
%17 = load i32, i32* %3
%18 = add nsw i32 %17, -1
store i32 %18, i32* %3
br label %10
19: ; preds = %10
%20 = load i32, i32* %4
%21 = call i32 @printEquals(i32 %20)
%22 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str.1 = [2 x i8] c"\0A\00"
define void @printPattern(i32 %0, i32 %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.1, i64 0, i64 0))
%4 = tail call i32 @printEquals(i32 %1)
%5 = icmp sgt i32 %0, 2
br i1 %5, label %6, label %13
6: ; preds = %2
%7 = add nsw i32 %0, -2
br label %8
8: ; preds = %6, %8
%9 = phi i32 [ %11, %8 ], [ %7, %6 ]
%10 = tail call i32 @printAsterisks(i32 %1)
%11 = add nsw i32 %9, -1
%12 = icmp ugt i32 %9, 1
br i1 %12, label %8, label %13
13: ; preds = %8, %2
%14 = tail call i32 @printEquals(i32 %1)
%15 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.1, i64 0, i64 0))
ret void
}