Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define rad M_PI/3
#define N 2147483647
#define Max 100000
#define NTL -1
#define min(a,b) ((a>b)?b:a)
  int a[Max];
void getSum(int s,int t){
    int mm=0;
    for(int k=s;k<=t;k++){
        mm+=a[k];
    }
    printf("%d\n",mm);
}
int main(){
  int n,i,j,q;
  int ord,x,y;

  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    a[i]=0;
  }
  while(q--){
    scanf("%d%d%d",&ord,&x,&y);
    if(ord==0){
      a[x]+=y;
    }else{
      getSum(x,y);
    }
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L3
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getSum, .-getSum
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L5
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
	jmp	.L7
.L9:
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L7
.L8:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getSum
.L7:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
user
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %ecx
	movl	%esi, %edi
	cmpl	%esi, %ecx
	jg	.L7
	movl	%esi, %eax
	subl	%ecx, %eax
	leal	1(%rax), %r9d
	cmpl	$2, %eax
	jbe	.L8
	movslq	%ecx, %rax
	leaq	a(%rip), %r8
	pxor	%xmm0, %xmm0
	leaq	(%r8,%rax,4), %rdx
	movl	%r9d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %esi
	leaq	16(%rdx), %rax
	salq	$4, %rsi
	addq	%rax, %rsi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$16, %rax
.L4:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rdx
	paddd	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%r9d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	addl	%eax, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%eax, %r9d
	je	.L2
.L3:
	movslq	%ecx, %rax
	addl	(%r8,%rax,4), %edx
	leal	1(%rcx), %eax
	cmpl	%eax, %edi
	jl	.L2
	cltq
	addl	$2, %ecx
	addl	(%r8,%rax,4), %edx
	cmpl	%ecx, %edi
	jl	.L2
	movslq	%ecx, %rcx
	addl	(%r8,%rcx,4), %edx
.L2:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%edx, %edx
	jmp	.L2
.L8:
	xorl	%edx, %edx
	leaq	a(%rip), %r8
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	getSum, .-getSum
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jle	.L14
	leaq	0(,%rax,4), %rdx
	xorl	%esi, %esi
	leaq	a(%rip), %rdi
	call	memset@PLT
.L14:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L15
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	leaq	.LC0(%rip), %r15
	leaq	a(%rip), %rbx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	16(%rsp), %rax
	movl	20(%rsp), %edx
	addl	%edx, (%rbx,%rax,4)
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L15
.L22:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L33
	movl	20(%rsp), %edi
	movl	16(%rsp), %ecx
	cmpl	%ecx, %edi
	jl	.L24
	movl	%edi, %eax
	subl	%ecx, %eax
	leal	1(%rax), %r8d
	cmpl	$2, %eax
	jbe	.L25
	movslq	%ecx, %rax
	pxor	%xmm0, %xmm0
	leaq	(%rbx,%rax,4), %rdx
	movl	%r8d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %esi
	leaq	16(%rdx), %rax
	salq	$4, %rsi
	addq	%rax, %rsi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L34:
	addq	$16, %rax
.L20:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rdx
	paddd	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L34
	movdqa	%xmm0, %xmm1
	movl	%r8d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	addl	%eax, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%eax, %r8d
	je	.L18
.L19:
	movslq	%ecx, %rax
	addl	(%rbx,%rax,4), %edx
	leal	1(%rcx), %eax
	cmpl	%eax, %edi
	jl	.L18
	cltq
	addl	$2, %ecx
	addl	(%rbx,%rax,4), %edx
	cmpl	%ecx, %edi
	jl	.L18
	movslq	%ecx, %rcx
	addl	(%rbx,%rcx,4), %edx
.L18:
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jne	.L22
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L18
.L25:
	xorl	%edx, %edx
	jmp	.L19
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

rule
	.file	"temp.c"
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.text
	.p2align 4
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB51:
	.cfi_startproc
	endbr64
	movl	%edi, %ecx
	movl	%esi, %edi
	cmpl	%esi, %ecx
	jg	.L7
	movl	%esi, %eax
	subl	%ecx, %eax
	leal	1(%rax), %r9d
	cmpl	$2, %eax
	jbe	.L8
	movslq	%ecx, %rax
	leaq	a(%rip), %r8
	pxor	%xmm0, %xmm0
	leaq	(%r8,%rax,4), %rdx
	movl	%r9d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %esi
	leaq	16(%rdx), %rax
	salq	$4, %rsi
	addq	%rax, %rsi
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L12:
	addq	$16, %rax
.L4:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rdx
	paddd	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L12
	movdqa	%xmm0, %xmm1
	movl	%r9d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	addl	%eax, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%eax, %r9d
	je	.L2
.L3:
	movslq	%ecx, %rax
	addl	(%r8,%rax,4), %edx
	leal	1(%rcx), %eax
	cmpl	%eax, %edi
	jl	.L2
	cltq
	addl	$2, %ecx
	addl	(%r8,%rax,4), %edx
	cmpl	%ecx, %edi
	jl	.L2
	movslq	%ecx, %rcx
	addl	(%r8,%rcx,4), %edx
.L2:
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	jmp	__printf_chk@PLT
	.p2align 4,,10
	.p2align 3
.L7:
	xorl	%edx, %edx
	jmp	.L2
.L8:
	xorl	%edx, %edx
	leaq	a(%rip), %r8
	jmp	.L3
	.cfi_endproc
.LFE51:
	.size	getSum, .-getSum
	.section	.rodata.str1.1
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB52:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC1(%rip), %rdi
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	pushq	%r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	pushq	%rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	subq	$40, %rsp
	.cfi_def_cfa_offset 96
	movq	%fs:40, %rax
	movq	%rax, 24(%rsp)
	xorl	%eax, %eax
	leaq	8(%rsp), %rdx
	leaq	4(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movslq	4(%rsp), %rax
	testl	%eax, %eax
	jle	.L14
	leaq	0(,%rax,4), %rdx
	xorl	%esi, %esi
	leaq	a(%rip), %rdi
	call	memset@PLT
.L14:
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L15
	leaq	20(%rsp), %r14
	leaq	16(%rsp), %r13
	leaq	12(%rsp), %r12
	leaq	.LC2(%rip), %rbp
	leaq	.LC0(%rip), %r15
	leaq	a(%rip), %rbx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L33:
	movslq	16(%rsp), %rax
	movl	20(%rsp), %edx
	addl	%edx, (%rbx,%rax,4)
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	je	.L15
.L22:
	movq	%r14, %rcx
	movq	%r13, %rdx
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %eax
	testl	%eax, %eax
	je	.L33
	movl	20(%rsp), %edi
	movl	16(%rsp), %ecx
	cmpl	%ecx, %edi
	jl	.L24
	movl	%edi, %eax
	subl	%ecx, %eax
	leal	1(%rax), %r8d
	cmpl	$2, %eax
	jbe	.L25
	movslq	%ecx, %rax
	pxor	%xmm0, %xmm0
	leaq	(%rbx,%rax,4), %rdx
	movl	%r8d, %eax
	shrl	$2, %eax
	leal	-1(%rax), %esi
	leaq	16(%rdx), %rax
	salq	$4, %rsi
	addq	%rax, %rsi
	jmp	.L20
	.p2align 4,,10
	.p2align 3
.L34:
	addq	$16, %rax
.L20:
	movdqu	(%rdx), %xmm1
	movq	%rax, %rdx
	paddd	%xmm1, %xmm0
	cmpq	%rsi, %rax
	jne	.L34
	movdqa	%xmm0, %xmm1
	movl	%r8d, %eax
	psrldq	$8, %xmm1
	andl	$-4, %eax
	paddd	%xmm1, %xmm0
	addl	%eax, %ecx
	movdqa	%xmm0, %xmm1
	psrldq	$4, %xmm1
	paddd	%xmm1, %xmm0
	movd	%xmm0, %edx
	cmpl	%eax, %r8d
	je	.L18
.L19:
	movslq	%ecx, %rax
	addl	(%rbx,%rax,4), %edx
	leal	1(%rcx), %eax
	cmpl	%eax, %edi
	jl	.L18
	cltq
	addl	$2, %ecx
	addl	(%rbx,%rax,4), %edx
	cmpl	%ecx, %edi
	jl	.L18
	movslq	%ecx, %rcx
	addl	(%rbx,%rcx,4), %edx
.L18:
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	movl	8(%rsp), %eax
	leal	-1(%rax), %edx
	movl	%edx, 8(%rsp)
	testl	%eax, %eax
	jne	.L22
.L15:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L35
	addq	$40, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 48
	popq	%rbp
	.cfi_def_cfa_offset 40
	popq	%r12
	.cfi_def_cfa_offset 32
	popq	%r13
	.cfi_def_cfa_offset 24
	popq	%r14
	.cfi_def_cfa_offset 16
	popq	%r15
	.cfi_def_cfa_offset 8
	ret
.L24:
	.cfi_restore_state
	xorl	%edx, %edx
	jmp	.L18
.L25:
	xorl	%edx, %edx
	jmp	.L19
.L35:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE52:
	.size	main, .-main
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:

#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define rad M_PI/3
#define N 2147483647
#define Max 100000
#define NTL -1
#define min(a,b) ((a>b)?b:a)
  int a[Max];
void getSum(int s,int t){
    int mm=0;
    for(int k=s;k<=t;k++){
        mm+=a[k];
    }
    printf("%d\n",mm);
}
int main(){
  int n,i,j,q;
  int ord,x,y;

  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    a[i]=0;
  }
  while(q--){
    scanf("%d%d%d",&ord,&x,&y);
    if(ord==0){
      a[x]+=y;
    }else{
      getSum(x,y);
    }
  }
  return 0;
}

4 5
0 1 1
0 2 2
0 3 3
1 1 2
1 2 2
 4 5
0 1 1
0 2 2
0 1 5
1 1 2
1 2 2
 4 5
0 1 0
0 2 2
0 1 5
1 1 2
1 2 2
 4 5
0 1 1
0 2 4
0 3 3
1 1 2
1 2 2
 4 5
0 1 1
0 4 4
0 3 3
1 1 2
1 2 2
 4 5
0 1 1
0 2 2
0 3 9
1 1 2
0 2 2
 4 5
0 1 0
0 2 2
0 1 5
1 1 0
1 2 3
 4 5
0 1 1
0 4 4
0 3 3
1 1 2
1 2 3
 4 5
0 1 0
0 2 2
0 3 9
1 1 2
0 2 2
 4 5
0 1 1
1 4 4
0 3 3
1 1 2
1 2 3

3
2
 8
2
 7
2
 5
4
 1
0
 3
 0
2
 1
3
 2
 0
1
3

Given the following C code and unoptimized assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#define rad M_PI/3
#define N 2147483647
#define Max 100000
#define NTL -1
#define min(a,b) ((a>b)?b:a)
  int a[Max];
void getSum(int s,int t){
    int mm=0;
    for(int k=s;k<=t;k++){
        mm+=a[k];
    }
    printf("%d\n",mm);
}
int main(){
  int n,i,j,q;
  int ord,x,y;

  scanf("%d%d",&n,&q);
  for(i=0;i<n;i++){
    a[i]=0;
  }
  while(q--){
    scanf("%d%d%d",&ord,&x,&y);
    if(ord==0){
      a[x]+=y;
    }else{
      getSum(x,y);
    }
  }
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L3
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getSum, .-getSum
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L5
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
	jmp	.L7
.L9:
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L7
.L8:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getSum
.L7:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
```

Only output the optimized assembly code. Do not include any other text. Do not write any comments in the assembly code. Wrap the assembly code in ```assembly``` tags.
train
	.file	"temp.c"
	.text
	.globl	a
	.bss
	.align 32
	.type	a, @object
	.size	a, 400000
a:
	.zero	400000
	.section	.rodata
.LC0:
	.string	"%d\n"
	.text
	.globl	getSum
	.type	getSum, @function
getSum:
.LFB6:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movl	%edi, -20(%rbp)
	movl	%esi, -24(%rbp)
	movl	$0, -8(%rbp)
	movl	-20(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L2
.L3:
	movl	-4(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %eax
	addl	%eax, -8(%rbp)
	addl	$1, -4(%rbp)
.L2:
	movl	-4(%rbp), %eax
	cmpl	-24(%rbp), %eax
	jle	.L3
	movl	-8(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	getSum, .-getSum
	.section	.rodata
.LC1:
	.string	"%d%d"
.LC2:
	.string	"%d%d%d"
	.text
	.globl	main
	.type	main, @function
main:
.LFB7:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	leaq	-28(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -12(%rbp)
	jmp	.L5
.L6:
	movl	-12(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	$0, (%rdx,%rax)
	addl	$1, -12(%rbp)
.L5:
	movl	-32(%rbp), %eax
	cmpl	%eax, -12(%rbp)
	jl	.L6
	jmp	.L7
.L9:
	leaq	-16(%rbp), %rcx
	leaq	-20(%rbp), %rdx
	leaq	-24(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	jne	.L8
	movl	-20(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	(%rdx,%rax), %ecx
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	addl	%edx, %ecx
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	a(%rip), %rax
	movl	%ecx, (%rdx,%rax)
	jmp	.L7
.L8:
	movl	-16(%rbp), %edx
	movl	-20(%rbp), %eax
	movl	%edx, %esi
	movl	%eax, %edi
	call	getSum
.L7:
	movl	-28(%rbp), %eax
	leal	-1(%rax), %edx
	movl	%edx, -28(%rbp)
	testl	%eax, %eax
	jne	.L9
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L11
	call	__stack_chk_fail@PLT
.L11:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	1f - 0f
	.long	4f - 1f
	.long	5
0:
	.string	"GNU"
1:
	.align 8
	.long	0xc0000002
	.long	3f - 2f
2:
	.long	0x3
3:
	.align 8
4:
