#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);
  if (divisor < 0) {
    divisor *= -1;
  }
  max -= max % divisor;
  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>
cmpl   $0x0,-0xc(%rbp)
jge    1154 <main+0x34>
imul   $0xffffffff,-0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    %edx,%eax
mov    %eax,-0x8(%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    (%rsp),%ecx
test   %ecx,%ecx
jns    1144 <main+0x24>
neg    %ecx
mov    %ecx,(%rsp)
mov    0x4(%rsp),%esi
mov    %esi,%eax
cltd
idiv   %ecx
sub    %edx,%esi
mov    %esi,0x4(%rsp)
jle    1175 <main+0x55>
xor    %ebx,%ebx
lea    0xea8(%rip),%r14
xchg   %ax,%ax
mov    %r14,%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
add    (%rsp),%ebx
mov    0x4(%rsp),%esi
cmp    %esi,%ebx
jl     1160 <main+0x40>
lea    0xe8e(%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* %3
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %0
%9 = load i32, i32* %3
%10 = mul nsw i32 %9, -1
store i32 %10, i32* %3
br label %11
11: ; preds = %8, %0
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = srem i32 %12, %13
%15 = load i32, i32* %2
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %2
store i32 0, i32* %4
br label %17
17: ; preds = %24, %11
%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* %2
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = sub nsw i32 0, %6
store i32 %9, i32* %2
br label %10
10: ; preds = %8, %0
%11 = phi i32 [ %9, %8 ], [ %6, %0 ]
%12 = load i32, i32* %1
%13 = srem i32 %12, %11
%14 = sub nsw i32 %12, %13
store i32 %14, i32* %1
%15 = icmp sgt i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %19, %10
%17 = phi i32 [ %14, %10 ], [ %24, %19 ]
%18 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %17)
ret i32 0
19: ; preds = %10, %19
%20 = phi i32 [ %23, %19 ], [ 0, %10 ]
%21 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = add nsw i32 %22, %20
%24 = load i32, i32* %1
%25 = icmp slt i32 %23, %24
br i1 %25, label %19, label %16
}