#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*/ scanf(char *, int *, int *);
int main() {
  int max, divisor;
  scanf("%d %d", &max, &divisor);
  max -= max % divisor;
  if (divisor < 0) {
    divisor *= -1;
  }
  for (int i = 0; i < max; i += divisor) {
    printf("%d ", i);
  }
  printf("%d\n", max);
  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>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
jge    1163 <main+0x43>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1193 <main+0x73>
mov    -0x10(%rbp),%esi
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    116a <main+0x4a>
mov    -0x8(%rbp),%esi
lea    0xe6d(%rip),%rdi
call   1030 <printf@plt>
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>
mov    0x4(%rsp),%esi
mov    (%rsp),%ecx
mov    %esi,%eax
cltd
idiv   %ecx
sub    %edx,%esi
mov    %esi,0x4(%rsp)
test   %ecx,%ecx
js     1154 <main+0x34>
test   %esi,%esi
jg     115d <main+0x3d>
jmp    1185 <main+0x65>
neg    %ecx
mov    %ecx,(%rsp)
test   %esi,%esi
jle    1185 <main+0x65>
xor    %ebx,%ebx
lea    0xea0(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    (%rsp),%ebx
mov    0x4(%rsp),%esi
cmp    %esi,%ebx
jl     1170 <main+0x50>
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [4 x i8] c"%d \00"
@.str.2 = [4 x i8] c"%d\0A\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* %1
%7 = load i32, i32* %2
%8 = srem i32 %6, %7
%9 = sub nsw i32 %6, %8
store i32 %9, i32* %1
%10 = icmp slt i32 %7, 0
br i1 %10, label %11, label %13
11: ; preds = %0
%12 = sub nsw i32 0, %7
store i32 %12, i32* %2
br label %13
13: ; preds = %11, %0
%14 = icmp sgt i32 %9, 0
br i1 %14, label %18, label %15
15: ; preds = %18, %13
%16 = phi i32 [ %9, %13 ], [ %23, %18 ]
%17 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %16)
ret i32 0
18: ; preds = %13, %18
%19 = phi i32 [ %22, %18 ], [ 0, %13 ]
%20 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %19)
%21 = load i32, i32* %2
%22 = add nsw i32 %21, %19
%23 = load i32, i32* %1
%24 = icmp slt i32 %22, %23
br i1 %24, label %18, label %15
}