#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, char);
int /*<<< orphan*/ scanf(char *, int *, int *);
int main(void) {
  int x, y, i;
  scanf("%d %d", &x, &y);
  for (i = 1; i <= y; i++) {
    printf("%d%c", i, i % x == 0 ? '\n' : ' ');
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%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     118d <main+0x6d>
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    $0x20,%eax
mov    $0xa,%ecx
cmp    $0x0,%edx
cmove  %ecx,%eax
lea    0xe8f(%rip),%rdi
movsbl %al,%edx
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    114a <main+0x2a>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
lea    0xed5(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
cmpl   $0x0,(%rsp)
jle    117b <main+0x5b>
xor    %ebx,%ebx
lea    0xebf(%rip),%r14
jmp    115f <main+0x3f>
nopl   0x0(%rax)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    (%rsp),%ebx
jge    117b <main+0x5b>
add    $0x1,%ebx
mov    %ebx,%eax
cltd
idivl  0x4(%rsp)
mov    %edx,%eax
mov    $0xa,%edx
test   %eax,%eax
je     1150 <main+0x30>
mov    $0x20,%edx
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [5 x i8] c"%d%c\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = 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 %6
6: ; preds = %20, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp sle i32 %7, %8
br i1 %9, label %10, label %23
10: ; preds = %6
%11 = load i32, i32* %4
%12 = load i32, i32* %4
%13 = load i32, i32* %2
%14 = srem i32 %12, %13
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 10, i32 32
%18 = trunc i32 %17 to i8
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %11, i8 signext %18)
br label %20
20: ; preds = %10
%21 = load i32, i32* %4
%22 = add nsw i32 %21, 1
store i32 %22, i32* %4
br label %6
23: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [5 x i8] c"%d%c\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 %18, label %8
8: ; preds = %0, %8
%9 = phi i32 [ %15, %8 ], [ 1, %0 ]
%10 = load i32, i32* %1
%11 = srem i32 %9, %10
%12 = icmp eq i32 %11, 0
%13 = select i1 %12, i8 10, i8 32
%14 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %9, i8 signext %13)
%15 = add nuw nsw i32 %9, 1
%16 = load i32, i32* %2
%17 = icmp slt i32 %9, %16
br i1 %17, label %8, label %18
18: ; preds = %8, %0
ret i32 0
}