// File: 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:
subq $0x98, %rsp
movq 0xa0(%rsp), %rax
movq %rdi, 0x90(%rsp)
movl %esi, 0x8c(%rsp)
movl %edx, 0x88(%rsp)
movl %ecx, 0x84(%rsp)
movl %r8d, 0x80(%rsp)
movl %r9d, 0x7c(%rsp)
movq 0x90(%rsp), %rax
movq %rax, 0x30(%rsp)
movl 0x7c(%rsp), %eax
cmpl 0x88(%rsp), %eax
jl 0x5b23
movl 0x80(%rsp), %eax
cmpl 0x84(%rsp), %eax
jle 0x5b28
jmp 0x5e58
movl 0x88(%rsp), %eax
cmpl 0x84(%rsp), %eax
jne 0x5b71
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
movslq 0x8c(%rsp), %rsi
callq 0x5990
movq %rax, %rsi
movl 0x88(%rsp), %edx
movl 0x84(%rsp), %ecx
leaq 0xa0(%rsp), %rdi
callq 0x5e60
jmp 0x5e58
movl 0x88(%rsp), %eax
cmpl 0x80(%rsp), %eax
jl 0x5c94
movl 0x84(%rsp), %eax
cmpl 0x7c(%rsp), %eax
jg 0x5c94
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
movslq 0x8c(%rsp), %rsi
callq 0x5990
movq %rax, %rsi
movl 0x88(%rsp), %edx
movl 0x84(%rsp), %ecx
leaq 0xa0(%rsp), %rdi
callq 0x5e60
movq 0x30(%rsp), %rdi
addq $0x20, %rdi
movslq 0x8c(%rsp), %rsi
callq 0x5ed0
movq %rax, 0x60(%rsp)
movq %rdx, 0x68(%rsp)
leaq 0x60(%rsp), %rdi
callq 0x4030
testb $0x1, %al
jne 0x5bfa
jmp 0x5c35
movq 0x30(%rsp), %rdi
addq $0x48, %rdi
movslq 0x8c(%rsp), %rsi
callq 0x5f30
movq %rax, %rdi
movl 0x88(%rsp), %edx
movl 0x84(%rsp), %ecx
leaq 0xa0(%rsp), %rsi
callq 0x5f50
movq %rax, 0x74(%rsp)
jmp 0x5c42
movq 0xa0(%rsp), %rax
movq %rax, 0x74(%rsp)
movq 0x30(%rsp), %rdi
addq $0x48, %rdi
movslq 0x8c(%rsp), %rsi
callq 0x5f30
movq 0x30(%rsp), %rdi
movq 0x74(%rsp), %rcx
movq %rcx, (%rax)
addq $0x20, %rdi
movslq 0x8c(%rsp), %rsi
callq 0x5ed0
movq %rax, 0x50(%rsp)
movq %rdx, 0x58(%rsp)
leaq 0x50(%rsp), %rdi
movl $0x1, %esi
callq 0x4060
jmp 0x5e58
movq 0x30(%rsp), %rdi
movl 0x8c(%rsp), %esi
movl 0x88(%rsp), %edx
movl 0x84(%rsp), %ecx
callq 0x5fc0
movl 0x80(%rsp), %eax
movl %eax, 0x2c(%rsp)
movl 0x88(%rsp), %eax
addl 0x84(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0x2c(%rsp), %eax
cmpl %ecx, %eax
jg 0x5d45
movq 0x30(%rsp), %rdi
movl 0x8c(%rsp), %esi
callq 0x59b0
movq 0x30(%rsp), %rdi
movl %eax, %esi
movl 0x88(%rsp), %eax
movl %eax, 0x28(%rsp)
movl 0x88(%rsp), %eax
addl 0x84(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl 0x28(%rsp), %edx
movl %eax, %ecx
movl 0x80(%rsp), %r8d
movl 0x7c(%rsp), %r9d
movq 0xa0(%rsp), %rax
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %rax
movq %rax, (%rsp)
callq 0x5ac0
movl 0x7c(%rsp), %eax
movl %eax, 0x24(%rsp)
movl 0x88(%rsp), %eax
addl 0x84(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %ecx
movl 0x24(%rsp), %eax
cmpl %ecx, %eax
jle 0x5dcf
movq 0x30(%rsp), %rdi
movl 0x8c(%rsp), %esi
callq 0x59c0
movq 0x30(%rsp), %rdi
movl %eax, %esi
movl 0x88(%rsp), %eax
addl 0x84(%rsp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
addl $0x1, %edx
movl 0x84(%rsp), %ecx
movl 0x80(%rsp), %r8d
movl 0x7c(%rsp), %r9d
movq 0xa0(%rsp), %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
callq 0x5ac0
movq 0x30(%rsp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl 0x8c(%rsp), %esi
callq 0x59b0
movq 0x8(%rsp), %rdi
movslq %eax, %rsi
callq 0x5990
movq 0x30(%rsp), %rdi
movq %rax, 0x18(%rsp)
movq %rdi, %rax
addq $0x8, %rax
movq %rax, 0x10(%rsp)
movl 0x8c(%rsp), %esi
callq 0x59c0
movq 0x10(%rsp), %rdi
movslq %eax, %rsi
callq 0x5990
movq 0x18(%rsp), %rdi
movq %rax, %rsi
callq 0x59e0
movq 0x30(%rsp), %rdi
movq %rax, 0x38(%rsp)
addq $0x8, %rdi
movslq 0x8c(%rsp), %rsi
callq 0x5990
movq 0x38(%rsp), %rcx
movq %rcx, (%rax)
addq $0x98, %rsp
retq