// File: /workspace/github_cpp_makefile_star2_O1/iZhangHui[P]CppPrimer/CH09_SequentialContainers/examples/substr.cc
// Function: main
int main()
{
    try {
        string s("hello world");
        cout << s.substr(0, 5) << endl;  // prints hello
        cout << s.substr(6) << endl;     // prints world
        cout << s.substr(6, 11) << endl; // prints world
        cout << s.substr(12) << endl;    // throws out_of_range
    } catch (out_of_range& e) {
        cout << e.what() << endl;
        // cout << "caught out_of_range" << endl;
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x40, %rsp
leaq -0x50(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0xd6a(%rip), %rsi       # 0x2004
leaq 0xd6e(%rip), %rdx       # 0x200f
leaq -0x60(%rbp), %rdi
callq 0x153e
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x5, %ecx
xorl %edx, %edx
callq 0x10e0
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x2d0b(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
leaq -0x30(%rbp), %r12
movq -0x10(%r12), %rdi
cmpq %r12, %rdi
je 0x1316
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x10d0
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x6, %edx
movq $-0x1, %rcx
callq 0x10e0
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x2c9a(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x1382
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x10d0
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0x6, %edx
movl $0xb, %ecx
callq 0x10e0
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x2c30(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x13ec
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x10d0
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
movl $0xc, %edx
movq $-0x1, %rcx
callq 0x10e0
movq -0x40(%rbp), %rsi
movq -0x38(%rbp), %rdx
movq 0x2bc4(%rip), %rdi      # 0x3fd8
callq 0x10f0
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x10b0
movsbl %al, %esi
movq %rbx, %rdi
callq 0x1030
movq %rax, %rdi
callq 0x1070
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x1458
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x10d0
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x146d
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x10d0
xorl %eax, %eax
addq $0x40, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x1482
jmp 0x1482
jmp 0x1482
movq %rdx, %r14
movq %rax, %rbx
jmp 0x14b1
movq %rdx, %r14
movq %rax, %rbx
jmp 0x14c6
jmp 0x1496
jmp 0x1496
movq %rdx, %r14
movq %rax, %rbx
movq -0x40(%rbp), %rdi
cmpq %r12, %rdi
je 0x14b1
movq -0x30(%rbp), %rsi
incq %rsi
callq 0x10d0
movq -0x60(%rbp), %rdi
cmpq %r15, %rdi
je 0x14c6
movq -0x50(%rbp), %rsi
incq %rsi
callq 0x10d0
cmpl $0x1, %r14d
jne 0x1506
movq %rbx, %rdi
callq 0x1050
movq (%rax), %rcx
movq %rax, %rdi
callq *0x10(%rcx)
movq 0x2af4(%rip), %rdi      # 0x3fd8
movq %rax, %rsi
callq 0x10c0
movq %rax, %rdi
callq 0x1060
callq 0x1110
jmp 0x146d
movq %rax, %rbx
callq 0x1110
movq %rbx, %rdi
callq 0x1120
movq %rax, %rdi
callq 0x152f
movq %rdx, %r14
movq %rax, %rbx
leaq -0x30(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
jne 0x14a5
jmp 0x14b1