// File: stevedonovan[P]outstreams/testout.cpp
// Function: writing_iterator_range()
void writing_iterator_range() {
    outs("*iterator range")();
     // the convenience of initializer lists
    /// empty () is equivalent to ('\n')
    outs({10,20,30})();

    float arr[] {1.2,1.5,2.1};
    vector<int> vi {10,2,5,11,4};
    outs(range(arr,arr+3))();
    outs(range(vi))();

    // can specify the FORMAT and the SEPARATOR for a range
    string s = "\xFE\xEE\xAA";
    outs(range(s),"X",0)("and that's all")();


    outs("bork")(range(vi),"%#X",',')("heh")();

    // write out a quick little burst of json
    // The hex_u format (double-quoted) only applies to text fields
    // so can be safely passed for all times. q means single-quoted
    outs('{')({
        make_pair("hello",42),
        make_pair("dolly",99),
        make_pair("frodo",111)
    },quote_d,',')('}')();

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
leaq 0x7c7e(%rip), %rdi      # 0xa1c0
movq %rdi, -0x190(%rbp)
leaq 0x3ad5(%rip), %rsi      # 0x6025
xorl %eax, %eax
movl %eax, %edx
movq %rdx, -0x188(%rbp)
callq 0x3010
movq %rax, %rdi
callq 0x5110
movq -0x190(%rbp), %rdi
movq -0x188(%rbp), %rdx
movl $0xa, -0x1c(%rbp)
movl $0x14, -0x18(%rbp)
movl $0x1e, -0x14(%rbp)
leaq -0x1c(%rbp), %rax
movq %rax, -0x10(%rbp)
movq $0x3, -0x8(%rbp)
leaq -0x10(%rbp), %rsi
movl $0x20, %ecx
callq 0x3140
movq %rax, %rdi
callq 0x5110
movabsq $0x3fc000003f99999a, %rax # imm = 0x3FC000003F99999A
movq %rax, -0x28(%rbp)
movl $0x40066666, -0x20(%rbp) # imm = 0x40066666
movups 0x3bab(%rip), %xmm0     # 0x6178
movaps %xmm0, -0x70(%rbp)
movl $0x4, -0x60(%rbp)
leaq -0x70(%rbp), %rax
movq %rax, -0x50(%rbp)
movq $0x5, -0x48(%rbp)
leaq -0x71(%rbp), %rdi
movq %rdi, -0x180(%rbp)
callq 0x3190
movq -0x180(%rbp), %rcx
movq -0x50(%rbp), %rsi
movq -0x48(%rbp), %rdx
leaq -0x40(%rbp), %rdi
callq 0x31b0
jmp 0x2612
leaq -0x71(%rbp), %rdi
callq 0x3230
leaq -0x1c(%rbp), %rsi
leaq -0x28(%rbp), %rdi
callq 0x32e0
movq %rdx, -0x1a0(%rbp)
movq %rax, -0x198(%rbp)
jmp 0x2638
movq -0x1a0(%rbp), %rax
movq -0x198(%rbp), %rcx
movq %rcx, -0x98(%rbp)
movq %rax, -0x90(%rbp)
leaq 0x7b65(%rip), %rdi      # 0xa1c0
xorl %eax, %eax
movl %eax, %edx
leaq -0x98(%rbp), %rsi
movl $0x20, %ecx
callq 0x3250
movq %rax, -0x1a8(%rbp)
jmp 0x2679
movq -0x1a8(%rbp), %rdi
callq 0x5110
jmp 0x2687
leaq -0x40(%rbp), %rdi
callq 0x33a0
movq %rdx, -0x1b8(%rbp)
movq %rax, -0x1b0(%rbp)
jmp 0x26a0
movq -0x1b8(%rbp), %rax
movq -0x1b0(%rbp), %rcx
movq %rcx, -0xa8(%rbp)
movq %rax, -0xa0(%rbp)
leaq 0x7afd(%rip), %rdi      # 0xa1c0
xorl %eax, %eax
movl %eax, %edx
leaq -0xa8(%rbp), %rsi
movl $0x20, %ecx
callq 0x3310
movq %rax, -0x1c0(%rbp)
jmp 0x26e1
movq -0x1c0(%rbp), %rdi
callq 0x5110
jmp 0x26ef
leaq -0xc9(%rbp), %rdi
movq %rdi, -0x1c8(%rbp)
callq 0x22d0
movq -0x1c8(%rbp), %rdx
leaq 0x3925(%rip), %rsi      # 0x6035
leaq -0xc8(%rbp), %rdi
callq 0x33f0
jmp 0x271e
leaq -0xc9(%rbp), %rdi
callq 0x21e0
leaq -0xc8(%rbp), %rdi
callq 0x3540
movq %rdx, -0x1d8(%rbp)
movq %rax, -0x1d0(%rbp)
jmp 0x2746
movq -0x1d8(%rbp), %rax
movq -0x1d0(%rbp), %rcx
movq %rcx, -0xe0(%rbp)
movq %rax, -0xd8(%rbp)
leaq 0x7a57(%rip), %rdi      # 0xa1c0
leaq 0x38df(%rip), %rdx      # 0x604f
leaq -0xe0(%rbp), %rsi
xorl %ecx, %ecx
callq 0x34a0
movq %rax, -0x1e0(%rbp)
jmp 0x2787
movq -0x1e0(%rbp), %rdi
leaq 0x38a4(%rip), %rsi      # 0x6039
xorl %eax, %eax
movl %eax, %edx
callq 0x3010
movq %rax, -0x1e8(%rbp)
jmp 0x27a7
movq -0x1e8(%rbp), %rdi
callq 0x5110
jmp 0x27b5
leaq 0x7a04(%rip), %rdi      # 0xa1c0
leaq 0x3885(%rip), %rsi      # 0x6048
xorl %eax, %eax
movl %eax, %edx
callq 0x3010
movq %rax, -0x1f0(%rbp)
jmp 0x27d5
leaq -0x40(%rbp), %rdi
callq 0x33a0
movq %rdx, -0x200(%rbp)
movq %rax, -0x1f8(%rbp)
jmp 0x27ee
movq -0x1f0(%rbp), %rdi
movq -0x200(%rbp), %rax
movq -0x1f8(%rbp), %rcx
movq %rcx, -0xf0(%rbp)
movq %rax, -0xe8(%rbp)
leaq 0x3835(%rip), %rdx      # 0x604d
leaq -0xf0(%rbp), %rsi
movl $0x2c, %ecx
callq 0x3310
movq %rax, -0x208(%rbp)
jmp 0x2832
movq -0x208(%rbp), %rdi
leaq 0x3811(%rip), %rsi      # 0x6051
xorl %eax, %eax
movl %eax, %edx
callq 0x3010
movq %rax, -0x210(%rbp)
jmp 0x2852
movq -0x210(%rbp), %rdi
callq 0x5110
jmp 0x2860
leaq 0x7959(%rip), %rdi      # 0xa1c0
xorl %eax, %eax
movl %eax, %edx
movl $0x7b, %esi
callq 0x30e0
movq %rax, -0x218(%rbp)
jmp 0x287e
movl $0x2a, -0x134(%rbp)
leaq 0x37c6(%rip), %rdi      # 0x6055
leaq -0x134(%rbp), %rsi
callq 0x35e0
movl %edx, -0x224(%rbp)
movq %rax, -0x220(%rbp)
jmp 0x28aa
movl -0x224(%rbp), %eax
movq -0x220(%rbp), %rcx
movq %rcx, -0x148(%rbp)
movl %eax, -0x140(%rbp)
movl -0x140(%rbp), %eax
movl %eax, -0x128(%rbp)
movq -0x148(%rbp), %rax
movq %rax, -0x130(%rbp)
leaq -0x120(%rbp), %rax
movq %rax, -0x240(%rbp)
movl $0x63, -0x14c(%rbp)
leaq 0x375e(%rip), %rdi      # 0x605b
leaq -0x14c(%rbp), %rsi
callq 0x35e0
movl %edx, -0x234(%rbp)
movq %rax, -0x230(%rbp)
jmp 0x2918
movq -0x240(%rbp), %rax
movl -0x234(%rbp), %ecx
movq -0x230(%rbp), %rdx
movq %rdx, -0x160(%rbp)
movl %ecx, -0x158(%rbp)
movl -0x158(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq -0x160(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x110(%rbp), %rax
movq %rax, -0x258(%rbp)
movl $0x6f, -0x164(%rbp)
leaq 0x36f6(%rip), %rdi      # 0x6061
leaq -0x164(%rbp), %rsi
callq 0x35e0
movl %edx, -0x24c(%rbp)
movq %rax, -0x248(%rbp)
jmp 0x2986
movq -0x218(%rbp), %rdi
movq -0x258(%rbp), %rax
movl -0x24c(%rbp), %ecx
movq -0x248(%rbp), %rdx
movq %rdx, -0x178(%rbp)
movl %ecx, -0x170(%rbp)
movl -0x170(%rbp), %ecx
movl %ecx, 0x8(%rax)
movq -0x178(%rbp), %rcx
movq %rcx, (%rax)
leaq -0x130(%rbp), %rax
movq %rax, -0x100(%rbp)
movq $0x3, -0xf8(%rbp)
leaq 0x3686(%rip), %rdx      # 0x6067
leaq -0x100(%rbp), %rsi
movl $0x2c, %ecx
callq 0x3590
movq %rax, -0x260(%rbp)
jmp 0x29fb
movq -0x260(%rbp), %rdi
xorl %eax, %eax
movl %eax, %edx
movl $0x7d, %esi
callq 0x30e0
movq %rax, -0x268(%rbp)
jmp 0x2a19
movq -0x268(%rbp), %rdi
callq 0x5110
jmp 0x2a27
leaq -0xc8(%rbp), %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x3620
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x71(%rbp), %rdi
callq 0x3230
jmp 0x2ab1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
jmp 0x2aa8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xc9(%rbp), %rdi
callq 0x21e0
jmp 0x2aa8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0xc8(%rbp), %rdi
callq 0x20f0
leaq -0x40(%rbp), %rdi
callq 0x3620
movq -0x80(%rbp), %rdi
callq 0x22c0
nopw (%rax,%rax)