// File: /workspace/github_cpp_makefile_star2_O3/ruippeixotog[P]algo-lib/segment-tree.cpp
// Function: SegTree<Node, Op>::update(int, int, int, int, int, Op)
void update(int node, int st, int end, int i, int j, Op op) {
    if (j < st || i > end) return;
    if (st == end) { op.apply(tree[node], st, end); return; }
    if (st >= i && end <= j) {
      op.apply(tree[node], st, end);
      pending[node] = hasPending[node] ? pending[node].merge(op, st, end) : op;
      hasPending[node] = true;
      return;
    }
    applyPending(node, st, end);
    if(i <= (st + end) / 2) update(left(node), st, (st + end) / 2, i, j, op);
    if(j > (st + end) / 2) update(right(node), (st + end) / 2 + 1, end, i, j, op);
    tree[node] = tree[left(node)].join(tree[right(node)]);
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r12d
cmpl %edx, %r9d
setl %al
cmpl %ecx, %r8d
setg %cl
orb %al, %cl
je 0x2098
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %edx, %r13d
movl %esi, %r14d
movq 0x50(%rsp), %r11
movq %r11, %rax
shrq $0x20, %rax
cmpl %r12d, %edx
jne 0x20d2
movslq %r14d, %rcx
movq 0x8(%rdi), %rdx
cmpb $0x61, %r11b
je 0x21c6
movzbl %r11b, %esi
cmpl $0x73, %esi
jne 0x2089
movl %eax, 0x4(%rdx,%rcx,8)
movl %eax, (%rdx,%rcx,8)
jmp 0x2089
movl %r9d, %ebp
movl %r8d, %r15d
cmpl %r8d, %r13d
setl %cl
cmpl %r9d, %r12d
setg %dl
orb %cl, %dl
je 0x21a7
movq %rdi, 0x8(%rsp)
movl %r14d, %esi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x2292
leal (%r12,%r13), %eax
movl %eax, %ebx
shrl $0x1f, %ebx
addl %eax, %ebx
sarl %ebx
cmpl %r15d, %ebx
jl 0x2133
leal (%r14,%r14), %esi
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movl %r13d, %edx
movl %ebx, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x2068
leal (%r14,%r14), %eax
leal 0x1(,%r14,2), %r13d
cmpl %ebp, %ebx
jge 0x216e
incl %ebx
movl %eax, 0x14(%rsp)
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x8(%rsp), %rdi
movl %r13d, %esi
movl %ebx, %edx
movl %r12d, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x2068
movl 0x14(%rsp), %eax
cltq
movq 0x8(%rsp), %rcx
movq 0x8(%rcx), %rcx
movslq %r13d, %rdx
movl (%rcx,%rax,8), %esi
movl 0x4(%rcx,%rax,8), %eax
movl (%rcx,%rdx,8), %edi
cmpl %esi, %edi
cmovll %edi, %esi
movl 0x4(%rcx,%rdx,8), %edx
cmpl %edx, %eax
cmovgl %eax, %edx
shlq $0x20, %rdx
orq %rdx, %rsi
movslq %r14d, %rax
movq %rsi, (%rcx,%rax,8)
jmp 0x2089
movslq %r14d, %rcx
movq 0x8(%rdi), %rdx
cmpb $0x61, %r11b
je 0x21e2
movzbl %r11b, %esi
cmpl $0x73, %esi
jne 0x21f9
movl %eax, 0x4(%rdx,%rcx,8)
movl %eax, (%rdx,%rcx,8)
jmp 0x21f9
movq (%rdx,%rcx,8), %xmm0
movd %eax, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
paddd %xmm0, %xmm1
movq %xmm1, (%rdx,%rcx,8)
jmp 0x2089
movq (%rdx,%rcx,8), %xmm0
movd %eax, %xmm1
pshufd $0x50, %xmm1, %xmm1     # xmm1 = xmm1[0,0,1,1]
paddd %xmm0, %xmm1
movq %xmm1, (%rdx,%rcx,8)
leal 0x3f(%rcx), %edx
testl %ecx, %ecx
cmovsl %edx, %r14d
sarl $0x6, %r14d
movslq %r14d, %rdx
shlq $0x3, %rdx
movq 0x20(%rdi), %r8
addq %rdx, %r8
movabsq $-0x8000000000000000, %rsi # imm = 0x8000000000000000
leaq 0x3f(%rsi), %r10
andq %rcx, %r10
xorl %r9d, %r9d
cmpq %rsi, %r10
setbe %r9b
movl $0x1, %esi
shlq %cl, %rsi
leaq -0x8(,%r9,8), %r10
movq -0x8(%r8,%r9,8), %r8
btq %rcx, %r8
jae 0x227d
cmpb $0x73, %r11b
jne 0x225f
andl $0xffffff00, %r11d      # imm = 0xFFFFFF00
movl $0x73, %r8d
jmp 0x2270
movq 0x48(%rdi), %r9
movzbl (%r9,%rcx,8), %r8d
addl 0x4(%r9,%rcx,8), %eax
xorl %r11d, %r11d
shlq $0x20, %rax
orq %r11, %rax
orq %r8, %rax
movq %rax, %r11
movq 0x48(%rdi), %rax
movq %r11, (%rax,%rcx,8)
addq 0x20(%rdi), %rdx
orq %rsi, (%r10,%rdx)
jmp 0x2089