#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 atoi(char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  if (argc != 3) {
    printf("error usage: %s width height\n", argv[0]);
    return (0);
  }
  int width = atoi(argv[1]);
  int height = atoi(argv[2]);
  int x, y;
  for (x = 0; x < width; x++) {
    printf("*");
  }
  printf("\n");
  for (y = 1; y < height - 1; y++) {
    printf("*");
    for (x = 1; x < width - 1; x++) {
      printf(" ");
    }
    printf("*");
    printf("\n");
  }
  for (x = 0; x < width; x++) {
    printf("*");
  }
  printf("\n");
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1161 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xeb2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1286 <main+0x166>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1040 <atoi@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    11b0 <main+0x90>
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1188 <main+0x68>
lea    0xe65(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0x18(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1242 <main+0x122>
lea    0xe41(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1218 <main+0xf8>
lea    0xe1d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11eb <main+0xcb>
lea    0xdff(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xdef(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11c5 <main+0xa5>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1271 <main+0x151>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1249 <main+0x129>
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rsi,%rbp
cmp    $0x3,%edi
jne    11e1 <main+0xb1>
mov    0x8(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%r12d
mov    0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%r15d
test   %r12d,%r12d
jle    117f <main+0x4f>
mov    %r12d,%ebp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebp
jne    1170 <main+0x40>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmp    $0x3,%r15d
jl     11f5 <main+0xc5>
add    $0xffffffff,%r15d
lea    -0x2(%r12),%r14d
mov    $0x1,%ebp
jmp    11bc <main+0x8c>
nop
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    %r15d,%ebp
je     11f5 <main+0xc5>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmp    $0x3,%r12d
jl     11a0 <main+0x70>
mov    %r14d,%ebx
nop
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    11d0 <main+0xa0>
jmp    11a0 <main+0x70>
mov    0x0(%rbp),%rsi
lea    0xe14(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    121a <main+0xea>
test   %r12d,%r12d
jle    1210 <main+0xe0>
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%r12d
jne    1200 <main+0xd0>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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