#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 *);
int main() {
  int num, wid, hig, a, b;
  scanf("%d %d %d", &num, &wid, &hig);
  for (a = 1; a <= hig; a++) {
    for (b = 1; b <= wid; b++) {
      if (a == 1 || a == hig) {
        printf("%d", num);
      } else if (b == 1 || b == wid) {
        printf("%d", num);
      } else {
        printf(" ");
      }
    }
    printf("\n");
  }
  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
lea    -0x10(%rbp),%rcx
call   1040 <scanf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jg     1207 <main+0xe7>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11eb <main+0xcb>
cmpl   $0x1,-0x14(%rbp)
je     1183 <main+0x63>
mov    -0x14(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1199 <main+0x79>
mov    -0x8(%rbp),%esi
lea    0xe79(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
cmpl   $0x1,-0x18(%rbp)
je     11af <main+0x8f>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11c5 <main+0xa5>
mov    -0x8(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d3 <main+0xb3>
lea    0xe3d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11d8 <main+0xb8>
jmp    11dd <main+0xbd>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1161 <main+0x41>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    114e <main+0x2e>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
lea    0x4(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x4(%rsp),%eax
test   %eax,%eax
jle    11e4 <main+0xb4>
mov    $0x1,%ebx
lea    0xe9b(%rip),%r14
jmp    1187 <main+0x57>
nopl   (%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    11e4 <main+0xb4>
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
jle    1170 <main+0x40>
mov    $0x1,%ebp
cmp    $0x1,%ebx
je     11c0 <main+0x90>
nopl   0x0(%rax)
cmp    %eax,%ebx
je     11c0 <main+0x90>
cmp    $0x1,%ebp
je     11c0 <main+0x90>
cmp    %ecx,%ebp
je     11c0 <main+0x90>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11ce <main+0x9e>
nopl   0x0(%rax)
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rsp),%ecx
cmp    %ecx,%ebp
jge    1170 <main+0x40>
add    $0x1,%ebp
mov    0x4(%rsp),%eax
cmp    $0x1,%ebx
jne    11a0 <main+0x70>
jmp    11c0 <main+0x90>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

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