#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 % 2 == 0)
          printf(" ");
        else
          printf("%d", N);
    }
    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     1226 <main+0x106>
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    120a <main+0xea>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x14(%rbp),%eax
jg     1205 <main+0xe5>
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    11e1 <main+0xc1>
lea    0xe32(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f2 <main+0xd2>
mov    -0x10(%rbp),%esi
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11f7 <main+0xd7>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    11ae <main+0x8e>
jmp    120a <main+0xea>
lea    0xdf8(%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   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xec0(%rip),%rdi
lea    0xc(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    120c <main+0xdc>
mov    $0x1,%r14d
lea    0xe97(%rip),%r15
jmp    118e <main+0x5e>
nop
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0x1(%r14),%ecx
mov    0x8(%rsp),%eax
cmp    %eax,%r14d
mov    %ecx,%r14d
jge    120c <main+0xdc>
mov    0x4(%rsp),%ecx
cmp    $0x1,%r14d
je     11e0 <main+0xb0>
cmp    %eax,%r14d
je     11e0 <main+0xb0>
test   %ecx,%ecx
jle    1170 <main+0x40>
xor    %ebx,%ebx
jmp    11c7 <main+0x97>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0xc(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jge    1170 <main+0x40>
lea    0x1(%rbx),%eax
test   $0x1,%al
jne    11b0 <main+0x80>
mov    $0x20,%edi
call   1030 <putchar@plt>
jmp    11be <main+0x8e>
nopw   0x0(%rax,%rax,1)
test   %ecx,%ecx
jle    1170 <main+0x40>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
mov    0xc(%rsp),%esi
mov    %r15,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    0x4(%rsp),%ebx
jl     11f0 <main+0xc0>
jmp    1170 <main+0x40>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
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 = %52, %0
%9 = load i32, i32* %2
%10 = load i32, i32* %6
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %55
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 %50
31: ; preds = %15
store i32 1, i32* %3
br label %32
32: ; preds = %46, %31
%33 = load i32, i32* %3
%34 = load i32, i32* %5
%35 = icmp sle i32 %33, %34
br i1 %35, label %36, label %49
36: ; preds = %32
%37 = load i32, i32* %3
%38 = srem i32 %37, 2
%39 = icmp eq i32 %38, 0
br i1 %39, label %40, label %42
40: ; preds = %36
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %45
42: ; preds = %36
%43 = load i32, i32* %4
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %43)
br label %45
45: ; preds = %42, %40
br label %46
46: ; preds = %45
%47 = load i32, i32* %3
%48 = add nsw i32 %47, 1
store i32 %48, i32* %3
br label %32
49: ; preds = %32
br label %50
50: ; preds = %49, %30
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %52
52: ; preds = %50
%53 = load i32, i32* %2
%54 = add nsw i32 %53, 1
store i32 %54, i32* %2
br label %8
55: ; 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 %45, label %10
10: ; preds = %0, %40
%11 = phi i32 [ %43, %40 ], [ %8, %0 ]
%12 = phi i32 [ %42, %40 ], [ 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 %40, label %27
19: ; preds = %10
br i1 %17, label %40, 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 %40
27: ; preds = %18, %36
%28 = phi i32 [ %37, %36 ], [ 1, %18 ]
%29 = and i32 %28, 1
%30 = icmp eq i32 %29, 0
br i1 %30, label %31, label %33
31: ; preds = %27
%32 = call i32 @putchar(i32 32)
br 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 %36
36: ; preds = %31, %33
%37 = add nuw nsw i32 %28, 1
%38 = load i32, i32* %2
%39 = icmp slt i32 %28, %38
br i1 %39, label %27, label %40
40: ; preds = %36, %20, %18, %19
%41 = call i32 @putchar(i32 10)
%42 = add nuw nsw i32 %12, 1
%43 = load i32, i32* %3
%44 = icmp slt i32 %12, %43
br i1 %44, label %10, label %45
45: ; preds = %40, %0
ret i32 0
}