#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 *);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main() {
  int w, n, i, j;
  scanf("%d %d", &w, &n);
  for (i = 0; i < w * n + n + 1; i++) {
    printf("*");
  }
  printf("\n");
  for (i = 0; i < n; i++) {
    printf("*");
    for (j = 0; j < w; j++) {
      printf(" ");
    }
  }
  printf("*\n");
  for (i = 0; i < w * n + n + 1; i++) {
    printf("*");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    117c <main+0x5c>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x2a>
lea    0xe88(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    11e7 <main+0xc7>
lea    0xe64(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    11d4 <main+0xb4>
lea    0xe47(%rip),%rdi
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11ae <main+0x8e>
jmp    11d9 <main+0xb9>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    118f <main+0x6f>
lea    0xe1c(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x8(%rbp),%ecx
imul   -0xc(%rbp),%ecx
add    -0xc(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jge    122c <main+0x10c>
lea    0xded(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    11fa <main+0xda>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
lea    0xec6(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1050 <scanf@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%ecx
imul   %eax,%ecx
add    %eax,%ecx
js     117d <main+0x4d>
mov    $0xffffffff,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%ecx
imul   %eax,%ecx
add    %eax,%ecx
add    $0x1,%ebx
cmp    %ecx,%ebx
jl     1160 <main+0x30>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,(%rsp)
jle    11d5 <main+0xa5>
xor    %ebx,%ebx
jmp    11a8 <main+0x78>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    (%rsp),%ebx
jge    11d5 <main+0xa5>
mov    $0x2a,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x4(%rsp)
jle    11a0 <main+0x70>
xor    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     11c0 <main+0x90>
jmp    11a0 <main+0x70>
lea    0xe2a(%rip),%rdi
call   1040 <puts@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%ecx
imul   %eax,%ecx
add    %eax,%ecx
js     121d <main+0xed>
mov    $0xffffffff,%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x2a,%edi
call   1030 <putchar@plt>
mov    (%rsp),%eax
mov    0x4(%rsp),%ecx
imul   %eax,%ecx
add    %eax,%ecx
add    $0x1,%ebx
cmp    %ecx,%ebx
jl     1200 <main+0xd0>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@str = [2 x i8] c"*\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, i32* %2)
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = mul nsw i32 %7, %6
%9 = add nsw i32 %8, %7
%10 = icmp slt i32 %9, 0
br i1 %10, label %20, label %11
11: ; preds = %0, %11
%12 = phi i32 [ %14, %11 ], [ 0, %0 ]
%13 = call i32 @putchar(i32 42)
%14 = add nuw nsw i32 %12, 1
%15 = load i32, i32* %1
%16 = load i32, i32* %2
%17 = mul nsw i32 %16, %15
%18 = add nsw i32 %17, %16
%19 = icmp slt i32 %12, %18
br i1 %19, label %11, label %20
20: ; preds = %11, %0
%21 = call i32 @putchar(i32 10)
%22 = load i32, i32* %2
%23 = icmp sgt i32 %22, 0
br i1 %23, label %24, label %39
24: ; preds = %20, %35
%25 = phi i32 [ %36, %35 ], [ 0, %20 ]
%26 = call i32 @putchar(i32 42)
%27 = load i32, i32* %1
%28 = icmp sgt i32 %27, 0
br i1 %28, label %29, label %35
29: ; preds = %24, %29
%30 = phi i32 [ %32, %29 ], [ 0, %24 ]
%31 = call i32 @putchar(i32 32)
%32 = add nuw nsw i32 %30, 1
%33 = load i32, i32* %1
%34 = icmp slt i32 %32, %33
br i1 %34, label %29, label %35
35: ; preds = %29, %24
%36 = add nuw nsw i32 %25, 1
%37 = load i32, i32* %2
%38 = icmp slt i32 %36, %37
br i1 %38, label %24, label %39
39: ; preds = %35, %20
%40 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%41 = load i32, i32* %1
%42 = load i32, i32* %2
%43 = mul nsw i32 %42, %41
%44 = add nsw i32 %43, %42
%45 = icmp slt i32 %44, 0
br i1 %45, label %55, label %46
46: ; preds = %39, %46
%47 = phi i32 [ %49, %46 ], [ 0, %39 ]
%48 = call i32 @putchar(i32 42)
%49 = add nuw nsw i32 %47, 1
%50 = load i32, i32* %1
%51 = load i32, i32* %2
%52 = mul nsw i32 %51, %50
%53 = add nsw i32 %52, %51
%54 = icmp slt i32 %47, %53
br i1 %54, label %46, label %55
55: ; preds = %46, %39
ret i32 0
}