#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);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ scanf(char *, unsigned long long *, int *, int *, int *,
                         int *);
int val(int, int, unsigned long long);
void test_case() {
  unsigned long long n;
  int x, y, w, h;
  scanf("%llu %d %d %d %d", &n, &x, &y, &w, &h);
  for (int _y = y; _y < y + h; _y++) {
    if (w)
      printf("%d", val(x, _y, n));
    for (int _x = x + 1; _x < x + w; _x++) {
      printf(" %d", val(_x, _y, n));
    }
    putchar('\n');
  }
  putchar('\n');
}


x86 assembly (clang, -O0):
<test_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    0xeb1(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
lea    -0x18(%rbp),%r9
call   1060 <scanf@plt>
mov    -0x10(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x10(%rbp),%ecx
add    -0x18(%rbp),%ecx
cmp    %ecx,%eax
jge    1203 <test_case+0xc3>
cmpl   $0x0,-0x14(%rbp)
je     11a6 <test_case+0x66>
mov    -0xc(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1050 <val@plt>
mov    %eax,%esi
lea    0xe6d(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    -0xc(%rbp),%ecx
add    -0x14(%rbp),%ecx
cmp    %ecx,%eax
jge    11eb <test_case+0xab>
mov    -0x20(%rbp),%edi
mov    -0x1c(%rbp),%esi
mov    -0x8(%rbp),%rdx
call   1050 <val@plt>
mov    %eax,%esi
lea    0xe35(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    11af <test_case+0x6f>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    116e <test_case+0x2e>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_case>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
lea    0xeaf(%rip),%rdi
lea    0x10(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0xc(%rsp),%rcx
mov    %rsp,%r8
lea    0x8(%rsp),%r9
call   1060 <scanf@plt>
cmpl   $0x0,0x8(%rsp)
jle    1208 <test_case+0xc8>
mov    0xc(%rsp),%ebx
lea    0xe8b(%rip),%r14
lea    0xe83(%rip),%r15
jmp    11a9 <test_case+0x69>
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebx
mov    0x8(%rsp),%eax
add    0xc(%rsp),%eax
cmp    %eax,%ebx
jge    1208 <test_case+0xc8>
cmpl   $0x0,(%rsp)
je     1190 <test_case+0x50>
mov    0x4(%rsp),%edi
mov    0x10(%rsp),%rdx
mov    %ebx,%esi
call   1050 <val@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
cmpl   $0x2,(%rsp)
jl     1190 <test_case+0x50>
mov    0x4(%rsp),%ebp
add    $0x1,%ebp
cs nopw 0x0(%rax,%rax,1)
mov    0x10(%rsp),%rdx
mov    %ebp,%edi
mov    %ebx,%esi
call   1050 <val@plt>
mov    %r15,%rdi
mov    %eax,%esi
call   1040 <printf@plt>
add    $0x1,%ebp
mov    (%rsp),%eax
add    0x4(%rsp),%eax
cmp    %eax,%ebp
jl     11e0 <test_case+0xa0>
jmp    1190 <test_case+0x50>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

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