// File: /workspace/github_cpp_makefile_star2_O3/ostafen[P]Fast-Insertion-Sort/src/algo.cpp
// Function: MergeSort<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>::merge(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*, int, int, int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>*)
void merge(T arr[], int l, int m, int r, T *L)
    {
        int i, j, k;
        int n1 = m - l + 1;
        int n2 = r - m;

        //T L[n1];
        T *R = arr + m + 1; //T R[n2];

        for (i = 0; i < n1; i++)
            L[i] = arr[l + i];

        /*for (j = 0; j < n2; j++)
            R[j] = arr[m + 1 + j];*/

        i = 0;
        j = 0;
        k = l;
        while (i < n1 && j < n2)
        {
            if (L[i] <= R[j])
            {
                arr[k] = L[i];
                i++;
            }
            else
            {
                arr[k] = R[j];
                j++;
            }
            k++;
        }

        while (i < n1)
            arr[k++] = L[i++];

        while (j < n2)
            arr[k++] = R[j++];
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %r8d, %r14d
subl %ecx, %r14d
movslq %ecx, %rbp
movq %rbp, %rax
shlq $0x5, %rax
xorl %edi, %edi
subl %edx, %ebp
movq %rsi, 0x10(%rsp)
movq %rax, 0x28(%rsp)
movl %ecx, 0x1c(%rsp)
movl %edx, 0x8(%rsp)
movq %r9, 0x20(%rsp)
js 0x5674
movl %r14d, 0xc(%rsp)
addq %rsi, %rax
addq $0x20, %rax
movq %rax, 0x30(%rsp)
movslq %edx, %rax
leal 0x1(%rbp), %r15d
shlq $0x5, %rax
movq %rax, (%rsp)
leaq (%rsi,%rax), %rbx
movq %r9, %r14
movq %r14, %rdi
movq %rbx, %rsi
callq 0x30c0
addq $0x20, %rbx
addq $0x20, %r14
decq %r15
jne 0x55a2
movl 0x8(%rsp), %edx
movl $0x0, %ecx
movl 0xc(%rsp), %r14d
testl %r14d, %r14d
movl $0x0, %edi
jle 0x5676
movq (%rsp), %rax
addq 0x10(%rsp), %rax
movq %rax, (%rsp)
xorl %ecx, %ecx
movl 0x8(%rsp), %edx
xorl %edi, %edi
movl %edx, %r12d
movq %rbp, %r15
movl %ecx, %r13d
movslq %ecx, %rbx
shlq $0x5, %rbx
addq 0x20(%rsp), %rbx
movl %edi, %ebp
movslq %edi, %r14
shlq $0x5, %r14
addq 0x30(%rsp), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0x3050
testl %eax, %eax
jle 0x563a
movq (%rsp), %rbx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x30c0
movl %ebp, %edi
incl %edi
movl 0xc(%rsp), %r14d
movl %r13d, %ecx
jmp 0x5655
movq (%rsp), %rdi
movq %rbx, %rsi
movq %rdi, %rbx
callq 0x30c0
movl %r13d, %ecx
incl %ecx
movl 0xc(%rsp), %r14d
movl %ebp, %edi
movl %r12d, %edx
incl %edx
movq %r15, %rbp
cmpl %ebp, %ecx
jg 0x5676
addq $0x20, %rbx
movq %rbx, (%rsp)
cmpl %r14d, %edi
jl 0x55eb
jmp 0x5676
xorl %ecx, %ecx
cmpl %ebp, %ecx
jg 0x56cc
movl %edi, (%rsp)
movslq %ecx, %rax
movl %edx, %r15d
movslq %edx, %r13
shlq $0x5, %r13
addq 0x10(%rsp), %r13
shlq $0x5, %rax
movq 0x20(%rsp), %r12
addq %rax, %r12
movl 0x8(%rsp), %eax
addl %ecx, %eax
movl 0x1c(%rsp), %ebp
notl %ebp
addl %eax, %ebp
xorl %ebx, %ebx
movq %r13, %rdi
movq %r12, %rsi
callq 0x30c0
addq $0x20, %r13
decl %ebx
addq $0x20, %r12
cmpl %ebx, %ebp
jne 0x56ab
movl %r15d, %edx
subl %ebx, %edx
movl (%rsp), %edi
cmpl %r14d, %edi
movq 0x10(%rsp), %rcx
jge 0x5718
movslq %edi, %r12
movslq %r14d, %r13
movslq %edx, %r14
shlq $0x5, %r14
addq %rcx, %r14
movq %r12, %rax
shlq $0x5, %rax
movq 0x28(%rsp), %rdx
addq %rax, %rdx
leaq (%rcx,%rdx), %rbx
addq $0x20, %rbx
incq %r12
movq %r14, %rdi
movq %rbx, %rsi
callq 0x30c0
addq $0x20, %r14
addq $0x20, %rbx
cmpq %r13, %r12
jl 0x56fd
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rdi
callq 0x4ae1
nop