#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 *);
main() {
  int x, y, i, j = 1, cont = 1;
  scanf("%d %d", &x, &y);
  for (i = 1; i <= y; i += x) {
    while (j <= x) {
      printf("%d", cont);
      cont++;
      if (j == x)
        printf("\n");
      else
        printf(" ");
      j++;
    }
    j = 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
lea    0xebc(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11df <main+0xbf>
jmp    1169 <main+0x49>
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ca <main+0xaa>
mov    -0x18(%rbp),%esi
lea    0xe84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    11ae <main+0x8e>
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bc <main+0x9c>
lea    0xe53(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1169 <main+0x49>
movl   $0x1,-0x14(%rbp)
mov    -0x8(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1158 <main+0x38>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
lea    0xebd(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0xc(%rsp),%rdx
call   1050 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
jle    11c2 <main+0x92>
mov    $0x1,%ebx
mov    0x8(%rsp),%ecx
lea    0xe99(%rip),%r14
mov    $0xa,%r12d
mov    $0x1,%r15d
jmp    1188 <main+0x58>
nopl   0x0(%rax,%rax,1)
add    %ecx,%r15d
cmp    %eax,%r15d
jg     11c2 <main+0x92>
test   %ecx,%ecx
jle    1180 <main+0x50>
xor    %ebp,%ebp
xchg   %ax,%ax
lea    (%rbx,%rbp,1),%esi
add    $0x1,%ebp
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
cmp    0x8(%rsp),%ebp
mov    $0x20,%edi
cmove  %r12d,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%ecx
cmp    %ecx,%ebp
jl     1190 <main+0x60>
mov    0xc(%rsp),%eax
add    %ebp,%ebx
jmp    1180 <main+0x50>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [2 x i8] c" \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
store i32 1, i32* %5
store i32 1, i32* %6
%7 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3)
store i32 1, i32* %4
br label %8
8: ; preds = %33, %0
%9 = load i32, i32* %4
%10 = load i32, i32* %3
%11 = icmp sle i32 %9, %10
br i1 %11, label %12, label %37
12: ; preds = %8
br label %13
13: ; preds = %29, %12
%14 = load i32, i32* %5
%15 = load i32, i32* %2
%16 = icmp sle i32 %14, %15
br i1 %16, label %17, label %32
17: ; preds = %13
%18 = load i32, i32* %6
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %18)
%20 = load i32, i32* %6
%21 = add nsw i32 %20, 1
store i32 %21, i32* %6
%22 = load i32, i32* %5
%23 = load i32, i32* %2
%24 = icmp eq i32 %22, %23
br i1 %24, label %25, label %27
25: ; preds = %17
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %29
27: ; preds = %17
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
br label %29
29: ; preds = %27, %25
%30 = load i32, i32* %5
%31 = add nsw i32 %30, 1
store i32 %31, i32* %5
br label %13
32: ; preds = %13
store i32 1, i32* %5
br label %33
33: ; preds = %32
%34 = load i32, i32* %2
%35 = load i32, i32* %4
%36 = add nsw i32 %35, %34
store i32 %36, i32* %4
br label %8
37: ; preds = %8
ret i32 0
}

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