// File: nilnilnil[P]autocomplete/src/main.cpp
// Function: rich_suggestions_json_array[abi:cxx11](std::vector<phrase_t, std::allocator<phrase_t>>&)
std::string
rich_suggestions_json_array(vp_t& suggestions) {
    std::string ret = "[";
    ret.reserve(OUTPUT_SIZE_RESERVE);
    for (vp_t::iterator i = suggestions.begin(); i != suggestions.end(); ++i) {
        escape_special_chars(i->phrase);
        std::string snippet = i->snippet;
        escape_special_chars(snippet);

        std::string trailer = i + 1 == suggestions.end() ? "\n" : ",\n";
        ret += " { \"phrase\": \"" + i->phrase + "\", \"score\": " + uint_to_string(i->weight) + 
            (snippet.empty() ? "" : ", \"snippet\": \"" + snippet + "\"") + "}" + trailer;
    }
    ret += "]";
    return ret;
}

// Assembly:
subq $0x1f8, %rsp            # imm = 0x1F8
movq %rdi, 0x28(%rsp)
movq %rdi, %rax
movq %rax, 0x20(%rsp)
movq %rdi, 0x1f0(%rsp)
movq %rsi, 0x1e8(%rsp)
movb $0x0, 0x1e7(%rsp)
leaq 0x1e6(%rsp), %rdi
movq %rdi, 0x30(%rsp)
callq 0x5a50
movq 0x28(%rsp), %rdi
movq 0x30(%rsp), %rdx
leaq 0x18335(%rip), %rsi     # 0x22274
callq 0xddd0
jmp 0x9f46
leaq 0x1e6(%rsp), %rdi
callq 0x55e0
movq 0x28(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
callq 0x5970
jmp 0x9f64
movq 0x1e8(%rsp), %rdi
callq 0xda50
movq %rax, 0x1c8(%rsp)
movq 0x1e8(%rsp), %rdi
callq 0xdac0
movq %rax, 0x1c0(%rsp)
leaq 0x1c8(%rsp), %rdi
leaq 0x1c0(%rsp), %rsi
callq 0xda80
testb $0x1, %al
jne 0x9fac
jmp 0xa4d3
leaq 0x1c8(%rsp), %rdi
callq 0xdb30
movq %rax, %rdi
addq $0x8, %rdi
callq 0x9d60
jmp 0x9fc7
leaq 0x1c8(%rsp), %rdi
callq 0xdb30
movq %rax, %rsi
addq $0x28, %rsi
leaq 0x1a0(%rsp), %rdi
callq 0xe460
jmp 0x9fea
leaq 0x1a0(%rsp), %rdi
callq 0x9d60
jmp 0x9ff9
leaq 0x1c8(%rsp), %rdi
movl $0x1, %esi
callq 0xe540
movq %rax, 0x178(%rsp)
movq 0x1e8(%rsp), %rdi
callq 0xdac0
movq %rax, 0x170(%rsp)
leaq 0x178(%rsp), %rdi
leaq 0x170(%rsp), %rsi
callq 0xe500
movb %al, %dl
leaq 0x182a9(%rip), %rcx     # 0x222ef
leaq 0x18229(%rip), %rax     # 0x22276
testb %dl, %dl
cmovneq %rcx, %rax
movq %rax, 0x10(%rsp)
leaq 0x16f(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x5a50
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
leaq 0x180(%rsp), %rdi
callq 0xddd0
jmp 0xa083
leaq 0x16f(%rsp), %rdi
callq 0x55e0
leaq 0x1c8(%rsp), %rdi
callq 0xdb30
movq %rax, %rdx
addq $0x8, %rdx
leaq 0x181ce(%rip), %rsi     # 0x22279
leaq 0xa8(%rsp), %rdi
callq 0xe710
jmp 0xa0ba
leaq 0x181c7(%rip), %rdx     # 0x22288
leaq 0xc8(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
callq 0xe5d0
jmp 0xa0d8
leaq 0x1c8(%rsp), %rdi
callq 0xdb30
movl (%rax), %esi
leaq 0x88(%rsp), %rdi
xorl %edx, %edx
callq 0xe840
jmp 0xa0f8
leaq 0xe8(%rsp), %rdi
leaq 0xc8(%rsp), %rsi
leaq 0x88(%rsp), %rdx
callq 0xe620
jmp 0xa117
leaq 0x1a0(%rsp), %rdi
callq 0x5a00
movb $0x0, 0x66(%rsp)
movb $0x0, 0x3f(%rsp)
testb $0x1, %al
jne 0xa134
jmp 0xa162
leaq 0x67(%rsp), %rdi
movq %rdi, 0x8(%rsp)
callq 0x5a50
movq 0x8(%rsp), %rdx
movb $0x1, 0x66(%rsp)
leaq 0x1819c(%rip), %rsi     # 0x222f0
leaq 0x68(%rsp), %rdi
callq 0xddd0
jmp 0xa160
jmp 0xa19c
leaq 0x1812c(%rip), %rsi     # 0x22295
leaq 0x40(%rsp), %rdi
leaq 0x1a0(%rsp), %rdx
callq 0xe710
jmp 0xa17d
movb $0x1, 0x3f(%rsp)
leaq 0x180fd(%rip), %rdx     # 0x22286
leaq 0x68(%rsp), %rdi
leaq 0x40(%rsp), %rsi
callq 0xe5d0
jmp 0xa19a
jmp 0xa19c
leaq 0x108(%rsp), %rdi
leaq 0xe8(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0xe620
jmp 0xa1b8
leaq 0x180e5(%rip), %rdx     # 0x222a4
leaq 0x128(%rsp), %rdi
leaq 0x108(%rsp), %rsi
callq 0xe5d0
jmp 0xa1d6
leaq 0x148(%rsp), %rdi
leaq 0x128(%rsp), %rsi
leaq 0x180(%rsp), %rdx
callq 0xe580
jmp 0xa1f5
movq 0x28(%rsp), %rdi
leaq 0x148(%rsp), %rsi
callq 0x5750
jmp 0xa209
leaq 0x148(%rsp), %rdi
callq 0x5320
leaq 0x128(%rsp), %rdi
callq 0x5320
leaq 0x108(%rsp), %rdi
callq 0x5320
leaq 0x68(%rsp), %rdi
callq 0x5320
testb $0x1, 0x3f(%rsp)
jne 0xa243
jmp 0xa24d
leaq 0x40(%rsp), %rdi
callq 0x5320
testb $0x1, 0x66(%rsp)
jne 0xa256
jmp 0xa260
leaq 0x67(%rsp), %rdi
callq 0x55e0
leaq 0xe8(%rsp), %rdi
callq 0x5320
leaq 0x88(%rsp), %rdi
callq 0x5320
leaq 0xc8(%rsp), %rdi
callq 0x5320
leaq 0xa8(%rsp), %rdi
callq 0x5320
leaq 0x180(%rsp), %rdi
callq 0x5320
leaq 0x1a0(%rsp), %rdi
callq 0x5320
leaq 0x1c8(%rsp), %rdi
callq 0xdb40
jmp 0x9f79
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x1e6(%rsp), %rdi
callq 0x55e0
jmp 0xa519
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa50f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa4c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x16f(%rsp), %rdi
callq 0x55e0
jmp 0xa4c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa4b7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa4aa
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa49d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa490
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa470
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa45b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa451
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa444
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
jmp 0xa437
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x1d8(%rsp)
movl %eax, 0x1d4(%rsp)
leaq 0x148(%rsp), %rdi
callq 0x5320
leaq 0x128(%rsp), %rdi
callq 0x5320
leaq 0x108(%rsp), %rdi
callq 0x5320
leaq 0x68(%rsp), %rdi
callq 0x5320
testb $0x1, 0x3f(%rsp)
jne 0xa464
jmp 0xa46e
leaq 0x40(%rsp), %rdi
callq 0x5320
jmp 0xa470
testb $0x1, 0x66(%rsp)
jne 0xa479
jmp 0xa483
leaq 0x67(%rsp), %rdi
callq 0x55e0
leaq 0xe8(%rsp), %rdi
callq 0x5320
leaq 0x88(%rsp), %rdi
callq 0x5320
leaq 0xc8(%rsp), %rdi
callq 0x5320
leaq 0xa8(%rsp), %rdi
callq 0x5320
leaq 0x180(%rsp), %rdi
callq 0x5320
leaq 0x1a0(%rsp), %rdi
callq 0x5320
jmp 0xa50f
movq 0x28(%rsp), %rdi
leaq 0x17dd0(%rip), %rsi     # 0x222af
callq 0x5530
jmp 0xa4e6
movb $0x1, 0x1e7(%rsp)
testb $0x1, 0x1e7(%rsp)
jne 0xa502
movq 0x28(%rsp), %rdi
callq 0x5320
movq 0x20(%rsp), %rax
addq $0x1f8, %rsp            # imm = 0x1F8
retq
movq 0x28(%rsp), %rdi
callq 0x5320
movq 0x1d8(%rsp), %rdi
callq 0x5a40
nopw %cs:(%rax,%rax)