#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*/ exit(int /*<<< orphan*/);
int *init_deck(int);
int *move(int *, int, int, int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *, int *, int *);
int /*<<< orphan*/ sort(int *, int);
int main() {
  int player_num, card_num, skip;
  scanf("%d %d %d", &player_num, &card_num, &skip);
  int *deck = init_deck(card_num);
  int i;
  int *cand = move(deck, card_num, player_num, skip);
  sort(cand, card_num / player_num);
  for (i = 0; i < card_num / player_num; i++)
    printf("%d\n", cand[i]);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe8a(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
call   1060 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1030 <init_deck@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x10(%rbp),%ecx
call   1080 <move@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%esi
call   1050 <sort@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0xc(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,%ecx
mov    -0x2c(%rbp),%eax
cmp    %ecx,%eax
jge    1201 <main+0xa1>
mov    -0x28(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xe1b(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c2 <main+0x62>
xor    %edi,%edi
call   1070 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xe90(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x4(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1060 <scanf@plt>
mov    0x4(%rsp),%edi
call   1030 <init_deck@plt>
mov    0x4(%rsp),%esi
mov    0x8(%rsp),%edx
mov    0xc(%rsp),%ecx
mov    %rax,%rdi
call   1080 <move@plt>
mov    %rax,%r15
mov    0x4(%rsp),%eax
cltd
idivl  0x8(%rsp)
mov    %r15,%rdi
mov    %eax,%esi
call   1050 <sort@plt>
mov    0x4(%rsp),%eax
cltd
idivl  0x8(%rsp)
test   %eax,%eax
jle    11f0 <main+0x90>
xor    %ebx,%ebx
lea    0xe3c(%rip),%r14
nopl   (%rax)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
call   1040 <printf@plt>
add    $0x1,%rbx
mov    0x4(%rsp),%eax
cltd
idivl  0x8(%rsp)
cltq
cmp    %rax,%rbx
jl     11d0 <main+0x70>
xor    %edi,%edi
call   1070 <exit@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"%d %d %d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32*
store i32 0, i32* %1
%8 = call i32 @scanf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%9 = load i32, i32* %3
%10 = call i32* @init_deck(i32 %9)
store i32* %10, i32** %5
%11 = load i32*, i32** %5
%12 = load i32, i32* %3
%13 = load i32, i32* %2
%14 = load i32, i32* %4
%15 = call i32* @move(i32* %11, i32 %12, i32 %13, i32 %14)
store i32* %15, i32** %7
%16 = load i32*, i32** %7
%17 = load i32, i32* %3
%18 = load i32, i32* %2
%19 = sdiv i32 %17, %18
%20 = call i32 @sort(i32* %16, i32 %19)
store i32 0, i32* %6
br label %21
21: ; preds = %34, %0
%22 = load i32, i32* %6
%23 = load i32, i32* %3
%24 = load i32, i32* %2
%25 = sdiv i32 %23, %24
%26 = icmp slt i32 %22, %25
br i1 %26, label %27, label %37
27: ; preds = %21
%28 = load i32*, i32** %7
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i32, i32* %28, i64 %30
%32 = load i32, i32* %31
%33 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %27
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %21
37: ; preds = %21
%38 = call i32 @exit(i32 0)
unreachable
}

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