// File: /workspace/github_cpp_makefile_star2_O1/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 0x2086
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 0x20c0
movslq %r14d, %rcx
movq 0x8(%rdi), %rdx
cmpb $0x61, %r11b
je 0x21b1
movzbl %r11b, %esi
cmpl $0x73, %esi
jne 0x2077
movl %eax, 0x4(%rdx,%rcx,8)
movl %eax, (%rdx,%rcx,8)
jmp 0x2077
movl %r9d, %ebp
movl %r8d, %r15d
cmpl %r8d, %r13d
setl %cl
cmpl %r9d, %r12d
setg %dl
orb %cl, %dl
je 0x2192
movq %rdi, 0x10(%rsp)
movl %r14d, %esi
movl %r13d, %edx
movl %r12d, %ecx
callq 0x2282
leal (%r12,%r13), %eax
movl %eax, %ebx
shrl $0x1f, %ebx
addl %eax, %ebx
sarl %ebx
cmpl %r15d, %ebx
jl 0x2121
leal (%r14,%r14), %esi
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl %r13d, %edx
movl %ebx, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x2056
cmpl %ebp, %ebx
jge 0x214d
leal 0x1(,%r14,2), %esi
incl %ebx
movq 0x50(%rsp), %rax
movq %rax, (%rsp)
movq 0x10(%rsp), %rdi
movl %ebx, %edx
movl %r12d, %ecx
movl %r15d, %r8d
movl %ebp, %r9d
callq 0x2056
leal (%r14,%r14), %eax
cltq
movq 0x10(%rsp), %rcx
movq 0x8(%rcx), %rcx
leal 0x1(,%r14,2), %edx
movslq %edx, %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 0x2077
movslq %r14d, %rcx
movq 0x8(%rdi), %rdx
cmpb $0x61, %r11b
je 0x21cd
movzbl %r11b, %esi
cmpl $0x73, %esi
jne 0x21e4
movl %eax, 0x4(%rdx,%rcx,8)
movl %eax, (%rdx,%rcx,8)
jmp 0x21e4
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 0x2077
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)
leaq 0x3f(%rcx), %rdx
testq %rcx, %rcx
cmovnsq %rcx, %rdx
sarq $0x6, %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 0x226d
cmpb $0x73, %r11b
jne 0x224f
andl $0xffffff00, %r11d      # imm = 0xFFFFFF00
movl $0x73, %r8d
movq %r11, %r9
movl %eax, %r11d
jmp 0x2263
movq 0x48(%rdi), %r9
movzbl (%r9,%rcx,8), %r8d
movl 0x4(%r9,%rcx,8), %r11d
addl %eax, %r11d
xorl %r9d, %r9d
shlq $0x20, %r11
orq %r9, %r11
orq %r8, %r11
movq 0x48(%rdi), %rax
movq %r11, (%rax,%rcx,8)
addq 0x20(%rdi), %rdx
orq %rsi, (%r10,%rdx)
jmp 0x2077