#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);
      }
    }
    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     11f4 <main+0xd4>
movl   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11d8 <main+0xb8>
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    11c5 <main+0xa5>
cmpl   $0x1,-0x18(%rbp)
je     11af <main+0x8f>
mov    -0x18(%rbp),%eax
cmp    -0xc(%rbp),%eax
jne    11c0 <main+0xa0>
mov    -0x8(%rbp),%esi
lea    0xe4d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c5 <main+0xa5>
jmp    11ca <main+0xaa>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1161 <main+0x41>
lea    0xe2a(%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    11d4 <main+0xa4>
mov    $0x1,%ebx
lea    0xe9f(%rip),%r14
jmp    1187 <main+0x57>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%rbx),%ecx
mov    0x4(%rsp),%eax
cmp    %eax,%ebx
mov    %ecx,%ebx
jge    11d4 <main+0xa4>
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
jle    1170 <main+0x40>
mov    $0x1,%ebp
cmp    $0x1,%ebx
je     11b0 <main+0x80>
nopl   0x0(%rax)
cmp    %eax,%ebx
je     11b0 <main+0x80>
cmp    $0x1,%ebp
je     11b0 <main+0x80>
cmp    %ecx,%ebp
jne    11be <main+0x8e>
nopl   (%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    11b0 <main+0x80>
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"\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 = %44, %0
%9 = load i32, i32* %5
%10 = load i32, i32* %4
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %47
12: ; preds = %8
store i32 1, i32* %6
br label %13
13: ; preds = %39, %12
%14 = load i32, i32* %6
%15 = load i32, i32* %3
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %42
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 %38
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 %37
37: ; preds = %34, %30
br label %38
38: ; preds = %37, %24
br label %39
39: ; preds = %38
%40 = load i32, i32* %6
%41 = add nsw i32 %40, 1
store i32 %41, i32* %6
br label %13
42: ; preds = %13
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %44
44: ; preds = %42
%45 = load i32, i32* %5
%46 = add nsw i32 %45, 1
store i32 %46, i32* %5
br label %8
47: ; 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 %41, label %10
10: ; preds = %0, %36
%11 = phi i32 [ %39, %36 ], [ %8, %0 ]
%12 = phi i32 [ %38, %36 ], [ 1, %0 ]
%13 = load i32, i32* %2
%14 = icmp slt i32 %13, 1
br i1 %14, label %36, label %15
15: ; preds = %10
%16 = icmp eq i32 %12, 1
br label %17
17: ; preds = %33, %15
%18 = phi i32 [ %11, %15 ], [ %35, %33 ]
%19 = phi i32 [ %13, %15 ], [ %31, %33 ]
%20 = phi i32 [ 1, %15 ], [ %34, %33 ]
%21 = icmp eq i32 %12, %18
%22 = select i1 %16, i1 true, i1 %21
br i1 %22, label %27, label %23
23: ; preds = %17
%24 = icmp eq i32 %20, 1
%25 = icmp eq i32 %20, %19
%26 = select i1 %24, i1 true, i1 %25
br i1 %26, label %27, label %30
27: ; preds = %23, %17
%28 = load i32, i32* %1
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %28)
br label %30
30: ; preds = %27, %23
%31 = load i32, i32* %2
%32 = icmp slt i32 %20, %31
br i1 %32, label %33, label %36
33: ; preds = %30
%34 = add nuw nsw i32 %20, 1
%35 = load i32, i32* %3
br label %17
36: ; preds = %30, %10
%37 = call i32 @putchar(i32 10)
%38 = add nuw nsw i32 %12, 1
%39 = load i32, i32* %3
%40 = icmp slt i32 %12, %39
br i1 %40, label %10, label %41
41: ; preds = %36, %0
ret i32 0
}