// File: /workspace/github_cpp_makefile_star2_O3/noizebox[P]zipfsong/zipfsong.cpp
// Function: main
int main()
{
    std::chrono::steady_clock::time_point startTime = std::chrono::steady_clock::now();

    std::ios::sync_with_stdio (false);
    std::string input;
    std::getline(std::cin, input);
    int pos = input.find(" ");
    int no_songs = atoi(input.substr(0, pos).c_str());
    int no_outputs = atoi(input.substr(pos + 1).c_str());

    std::vector<Song> song_list;
    parse_songs(no_songs, song_list);
    stable_sort(song_list.begin(), song_list.end(), std::greater<Song>());
    print_songs(song_list, no_outputs);
    
    std::chrono::steady_clock::time_point endTime = std::chrono::steady_clock::now();
    std::cout << "Ex. time: " << std::chrono::duration_cast<std::chrono::milliseconds>(endTime - startTime).count() << " ms\n";
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
callq 0x2140
movq %rax, %rbx
xorl %edi, %edi
callq 0x2060
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
movq $0x0, -0x8(%rax)
movb $0x0, (%rax)
movq 0x5a23(%rip), %rdi      # 0x7fe0
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x20e0
movsbl %al, %edx
movq 0x5a08(%rip), %rdi      # 0x7fe0
leaq 0x20(%rsp), %rsi
callq 0x21d0
leaq 0x2a24(%rip), %rsi      # 0x500d
leaq 0x20(%rsp), %r14
movl $0x1, %ecx
movq %r14, %rdi
xorl %edx, %edx
callq 0x21a0
movq %rax, %r15
movslq %r15d, %rcx
movq %rsp, %rdi
movq %r14, %rsi
xorl %edx, %edx
callq 0x2110
shlq $0x20, %r15
leaq 0x10(%rsp), %r13
movq -0x10(%r13), %r12
movq %r12, %rdi
callq 0x2180
movl %eax, %r14d
cmpq %r13, %r12
je 0x263d
movq 0x10(%rsp), %rsi
incq %rsi
movq %r12, %rdi
callq 0x2100
movabsq $0x100000000, %rax      # imm = 0x100000000
addq %rax, %r15
sarq $0x20, %r15
movq %rsp, %rdi
leaq 0x20(%rsp), %rsi
movq %r15, %rdx
movq $-0x1, %rcx
callq 0x2110
movq (%rsp), %r15
movq %r15, %rdi
callq 0x2180
movl %eax, %ebp
cmpq %r13, %r15
je 0x2688
movq 0x10(%rsp), %rsi
incq %rsi
movq %r15, %rdi
callq 0x2100
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rsi
movaps %xmm0, (%rsi)
movq $0x0, 0x10(%rsi)
movl %r14d, %edi
callq 0x237c
movq 0x40(%rsp), %r15
movq 0x48(%rsp), %r14
cmpq %r14, %r15
je 0x2716
movq %r14, %rax
subq %r15, %rax
sarq $0x3, %rax
movabsq $-0x3333333333333333, %rcx # imm = 0xCCCCCCCCCCCCCCCD
imulq %rax, %rcx
leaq 0x1(%rcx), %rax
shrq $0x3f, %rax
leaq (%rcx,%rax), %rdx
incq %rdx
sarq %rdx
movq %rsp, %rdi
movq %r15, %rsi
callq 0x2e6e
movq 0x10(%rsp), %rdx
testq %rdx, %rdx
je 0x2703
movq 0x8(%rsp), %rcx
movq %r15, %rdi
movq %r14, %rsi
callq 0x2f82
jmp 0x270e
movq %r15, %rdi
movq %r14, %rsi
callq 0x2ef5
movq %rsp, %rdi
callq 0x3048
leaq 0x40(%rsp), %rdi
movl %ebp, %esi
callq 0x2518
callq 0x2140
movq %rax, %r14
movq 0x589f(%rip), %rdi      # 0x7fd0
leaq 0x28cc(%rip), %rsi      # 0x5004
movl $0xa, %edx
callq 0x2120
subq %rbx, %r14
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %r14, %rax
imulq %rcx
movq %rdx, %rsi
shrq $0x3f, %rsi
sarq $0x12, %rdx
addq %rdx, %rsi
movq 0x5866(%rip), %rdi      # 0x7fd0
callq 0x20d0
leaq 0x2899(%rip), %rsi      # 0x500f
movl $0x4, %edx
movq %rax, %rdi
callq 0x2120
leaq 0x40(%rsp), %rdi
callq 0x294c
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x27a9
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2100
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq %rsp, %rdi
callq 0x3048
jmp 0x27d7
jmp 0x27d4
jmp 0x27cf
jmp 0x27cf
jmp 0x27d4
movq %rax, %rbx
jmp 0x27e1
movq %rax, %rbx
leaq 0x40(%rsp), %rdi
callq 0x294c
movq 0x20(%rsp), %rdi
leaq 0x30(%rsp), %rax
cmpq %rax, %rdi
je 0x27fd
movq 0x30(%rsp), %rsi
incq %rsi
callq 0x2100
movq %rbx, %rdi
callq 0x21b0
nop