#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*/ printf(char *);
void draw(int l, int c) {
  for (int x = 0; x < c; ++x) {
    printf("*");
  }
  printf("\n");
  for (int m = 1; m < l - 1; ++m) {
    printf("*");
    for (int n = 1; n < c - 1; ++n) {
      printf(".");
    }
    if (c > 1) {
      printf("*");
    }
    printf("\n");
  }
  if (l > 1) {
    for (int x = 0; x < c; ++x) {
      printf("*");
    }
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<draw>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    114b <draw+0x3b>
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <draw+0x15>
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x4(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11dd <draw+0xcd>
lea    0xe8a(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    11ad <draw+0x9d>
lea    0xe68(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1182 <draw+0x72>
cmpl   $0x1,-0x8(%rbp)
jle    11c3 <draw+0xb3>
lea    0xe42(%rip),%rdi
call   1030 <printf@plt>
lea    0xe3b(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    115e <draw+0x4e>
cmpl   $0x1,-0x4(%rbp)
jle    1219 <draw+0x109>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1214 <draw+0x104>
lea    0xdff(%rip),%rdi
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ee <draw+0xde>
jmp    1219 <draw+0x109>
lea    0xde4(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<draw>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,%r13d
mov    %edi,%r14d
test   %esi,%esi
jle    114f <draw+0x2f>
mov    %r13d,%ebx
nopl   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1140 <draw+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x3,%r14d
jl     11c1 <draw+0xa1>
lea    -0x1(%r14),%r15d
lea    -0x2(%r13),%r12d
mov    $0x1,%ebp
jmp    1182 <draw+0x62>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %r15d,%ebp
je     11c1 <draw+0xa1>
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    %r12d,%ebx
cmp    $0x3,%r13d
jl     11af <draw+0x8f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    $0x2e,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11a0 <draw+0x80>
cmp    $0x1,%r13d
jle    1170 <draw+0x50>
mov    $0x2a,%edi
call   1030 <putchar@plt>
jmp    1170 <draw+0x50>
cmp    $0x2,%r14d
jl     11e0 <draw+0xc0>
test   %r13d,%r13d
jle    11e0 <draw+0xc0>
nopl   0x0(%rax)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r13d
jne    11d0 <draw+0xb0>
lea    0xe19(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"*\00"
@.str.1 = [2 x i8] c"\0A\00"
@.str.2 = [2 x i8] c".\00"
@.str.3 = [3 x i8] c"\0A\0A\00"
define void @draw(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %9
9: ; preds = %15, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %18
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %15
15: ; preds = %13
%16 = load i32, i32* %5
%17 = add nsw i32 %16, 1
store i32 %17, i32* %5
br label %9
18: ; preds = %9
%19 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %6
br label %20
20: ; preds = %44, %18
%21 = load i32, i32* %6
%22 = load i32, i32* %3
%23 = sub nsw i32 %22, 1
%24 = icmp slt i32 %21, %23
br i1 %24, label %25, label %47
25: ; preds = %20
%26 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %7
br label %27
27: ; preds = %34, %25
%28 = load i32, i32* %7
%29 = load i32, i32* %4
%30 = sub nsw i32 %29, 1
%31 = icmp slt i32 %28, %30
br i1 %31, label %32, label %37
32: ; preds = %27
%33 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %34
34: ; preds = %32
%35 = load i32, i32* %7
%36 = add nsw i32 %35, 1
store i32 %36, i32* %7
br label %27
37: ; preds = %27
%38 = load i32, i32* %4
%39 = icmp sgt i32 %38, 1
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %42
42: ; preds = %40, %37
%43 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %20
47: ; preds = %20
%48 = load i32, i32* %3
%49 = icmp sgt i32 %48, 1
br i1 %49, label %50, label %61
50: ; preds = %47
store i32 0, i32* %8
br label %51
51: ; preds = %57, %50
%52 = load i32, i32* %8
%53 = load i32, i32* %4
%54 = icmp slt i32 %52, %53
br i1 %54, label %55, label %60
55: ; preds = %51
%56 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %57
57: ; preds = %55
%58 = load i32, i32* %8
%59 = add nsw i32 %58, 1
store i32 %59, i32* %8
br label %51
60: ; preds = %51
br label %61
61: ; preds = %60, %47
%62 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define void @draw(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %12, label %4
4: ; preds = %12, %2
%5 = tail call i32 @putchar(i32 10)
%6 = add i32 %0, -1
%7 = icmp sgt i32 %0, 2
br i1 %7, label %8, label %17
8: ; preds = %4
%9 = add i32 %1, -1
%10 = icmp sgt i32 %1, 2
%11 = icmp sgt i32 %1, 1
br label %20
12: ; preds = %2, %12
%13 = phi i32 [ %15, %12 ], [ 0, %2 ]
%14 = tail call i32 @putchar(i32 42)
%15 = add nuw nsw i32 %13, 1
%16 = icmp eq i32 %15, %1
br i1 %16, label %4, label %12
17: ; preds = %31, %4
%18 = icmp sgt i32 %0, 1
%19 = and i1 %18, %3
br i1 %19, label %35, label %40
20: ; preds = %8, %31
%21 = phi i32 [ 1, %8 ], [ %33, %31 ]
%22 = tail call i32 @putchar(i32 42)
br i1 %10, label %24, label %23
23: ; preds = %24, %20
br i1 %11, label %29, label %31
24: ; preds = %20, %24
%25 = phi i32 [ %27, %24 ], [ 1, %20 ]
%26 = tail call i32 @putchar(i32 46)
%27 = add nuw nsw i32 %25, 1
%28 = icmp eq i32 %27, %9
br i1 %28, label %23, label %24
29: ; preds = %23
%30 = tail call i32 @putchar(i32 42)
br label %31
31: ; preds = %29, %23
%32 = tail call i32 @putchar(i32 10)
%33 = add nuw nsw i32 %21, 1
%34 = icmp eq i32 %33, %6
br i1 %34, label %17, label %20
35: ; preds = %17, %35
%36 = phi i32 [ %38, %35 ], [ 0, %17 ]
%37 = tail call i32 @putchar(i32 42)
%38 = add nuw nsw i32 %36, 1
%39 = icmp eq i32 %38, %1
br i1 %39, label %40, label %35
40: ; preds = %35, %17
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}