#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 main() {
  int x, y, i, j;
  scanf("%d%d", &x, &y);
  for (i = 1; i <= y;) {
    for (j = 1; j <= x; j++) {
      if (i > y) {
        break;
      }
      if (j == 1) {
        printf("%d", i++);
      } else {
        printf(" %d", i++);
      }
    }
    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
call   1040 <scanf@plt>
movl   $0x1,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jg     11e1 <main+0xc1>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     11ce <main+0xae>
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    117a <main+0x5a>
jmp    11ce <main+0xae>
cmpl   $0x1,-0x14(%rbp)
jne    11a2 <main+0x82>
mov    -0x10(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xe70(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11bb <main+0x9b>
mov    -0x10(%rbp),%esi
mov    %esi,%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
lea    0xe51(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11c0 <main+0xa0>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    115d <main+0x3d>
lea    0xe34(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    114a <main+0x2a>
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    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x8(%rsp),%eax
test   %eax,%eax
jle    11fd <main+0xcd>
mov    $0x1,%r12d
lea    0xe9b(%rip),%r14
lea    0xe93(%rip),%r15
jmp    1198 <main+0x68>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r12d,%ebp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x8(%rsp),%eax
mov    %ebp,%r12d
cmp    %eax,%ebp
jg     11fd <main+0xcd>
cmpl   $0x0,0xc(%rsp)
jle    1180 <main+0x50>
cmp    %eax,%r12d
jg     1180 <main+0x50>
mov    %r14,%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%r12),%ebp
cmpl   $0x2,0xc(%rsp)
jl     1183 <main+0x53>
cmp    0x8(%rsp),%r12d
jge    1183 <main+0x53>
mov    $0x2,%eax
nopl   0x0(%rax)
mov    %eax,%ebx
lea    (%r12,%rbx,1),%ebp
add    $0xffffffff,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x1(%rbx),%eax
cmp    0xc(%rsp),%ebx
jge    11f4 <main+0xc4>
cmp    0x8(%rsp),%ebp
jl     11d0 <main+0xa0>
lea    (%r12,%rax,1),%ebp
add    $0xffffffff,%ebp
jmp    1183 <main+0x53>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

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

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