#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 i, j, N, w, h;
  scanf("%d%d%d", &N, &w, &h);
  for (i = 1; i <= h; i++) {
    if (i == 1 || i == h) {
      for (j = 1; j <= w; j++)
        printf("%d", N);
    } else {
      for (j = 1; j <= w; j++)
        if (j == 1 || j == w)
          printf("%d", N);
        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    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
lea    -0x18(%rbp),%rcx
call   1040 <scanf@plt>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     1228 <main+0x108>
cmpl   $0x1,-0x8(%rbp)
je     1170 <main+0x50>
mov    -0x8(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    11a7 <main+0x87>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     11a2 <main+0x82>
mov    -0x10(%rbp),%esi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1177 <main+0x57>
jmp    120c <main+0xec>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1207 <main+0xe7>
cmpl   $0x1,-0xc(%rbp)
je     11d0 <main+0xb0>
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jne    11e6 <main+0xc6>
mov    -0x10(%rbp),%esi
lea    0xe2a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f4 <main+0xd4>
lea    0xe1a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f9 <main+0xd9>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ae <main+0x8e>
jmp    120c <main+0xec>
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%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    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x8(%rsp),%ecx
test   %ecx,%ecx
jle    120c <main+0xdc>
mov    $0x1,%r14d
lea    0xe98(%rip),%rbx
jmp    118e <main+0x5e>
xchg   %ax,%ax
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%eax
mov    0x8(%rsp),%ecx
cmp    %ecx,%r14d
mov    %eax,%r14d
jge    120c <main+0xdc>
mov    0x4(%rsp),%eax
cmp    $0x1,%r14d
je     11e0 <main+0xb0>
cmp    %ecx,%r14d
je     11e0 <main+0xb0>
test   %eax,%eax
jle    1170 <main+0x40>
xor    %ebp,%ebp
jmp    11c6 <main+0x96>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x4(%rsp),%eax
cmp    %eax,%ebp
jge    1170 <main+0x40>
mov    %ebp,%ecx
lea    0x1(%rcx),%ebp
test   %ecx,%ecx
je     11b0 <main+0x80>
cmp    %eax,%ebp
je     11b0 <main+0x80>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11be <main+0x8e>
nop
test   %eax,%eax
jle    1170 <main+0x40>
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebp
cmp    0x4(%rsp),%ebp
jl     11f0 <main+0xc0>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [7 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 ([7 x i8], [7 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 %47, label %10
10: ; preds = %0, %42
%11 = phi i32 [ %45, %42 ], [ %8, %0 ]
%12 = phi i32 [ %44, %42 ], [ 1, %0 ]
%13 = icmp eq i32 %12, 1
%14 = icmp eq i32 %12, %11
%15 = select i1 %13, i1 true, i1 %14
%16 = load i32, i32* %2
%17 = icmp slt i32 %16, 1
br i1 %15, label %19, label %18
18: ; preds = %10
br i1 %17, label %42, label %27
19: ; preds = %10
br i1 %17, label %42, label %20
20: ; preds = %19, %20
%21 = phi i32 [ %24, %20 ], [ 1, %19 ]
%22 = load i32, i32* %1
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = add nuw nsw i32 %21, 1
%25 = load i32, i32* %2
%26 = icmp slt i32 %21, %25
br i1 %26, label %20, label %42
27: ; preds = %18, %38
%28 = phi i32 [ %40, %38 ], [ %16, %18 ]
%29 = phi i32 [ %39, %38 ], [ 1, %18 ]
%30 = icmp eq i32 %29, 1
%31 = icmp eq i32 %29, %28
%32 = select i1 %30, i1 true, i1 %31
br i1 %32, label %33, label %36
33: ; preds = %27
%34 = load i32, i32* %1
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %34)
br label %38
36: ; preds = %27
%37 = call i32 @putchar(i32 32)
br label %38
38: ; preds = %33, %36
%39 = add nuw nsw i32 %29, 1
%40 = load i32, i32* %2
%41 = icmp slt i32 %29, %40
br i1 %41, label %27, label %42
42: ; preds = %38, %20, %18, %19
%43 = call i32 @putchar(i32 10)
%44 = add nuw nsw i32 %12, 1
%45 = load i32, i32* %3
%46 = icmp slt i32 %12, %45
br i1 %46, label %10, label %47
47: ; preds = %42, %0
ret i32 0
}