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>
int main(void)
{
    int q,i,j,can[4],ans=0;
    scanf("%d",&q);
    for(i=0;i<q;i++){
        ans=0;
        for(j=0;j<3;j++){
            scanf("%d",&can[j]);
        }
        while(1){
            if(can[0]==0||can[1]==0||can[2]==0)break;
            can[0]-=1;
            can[1]-=1;
            can[2]-=1;
            ans++;
        }
        while(1){
            if(can[0]-2<0||can[1]==0)break;
            can[0]-=2;
            can[1]-=1;
            ans++;
        }
        while(1){
            if(can[0]-3<0)break;
            can[0]-=3;
            ans++;
        }
        printf("%d\n",ans);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -36(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L12:
	movl	$0, -36(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L3
.L4:
	leaq	-32(%rbp), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -40(%rbp)
.L3:
	cmpl	$2, -40(%rbp)
	jle	.L4
.L6:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L6
.L8:
	movl	-32(%rbp), %eax
	cmpl	$1, %eax
	jle	.L11
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-32(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L8
.L11:
	movl	-32(%rbp), %eax
	cmpl	$2, %eax
	jle	.L16
	movl	-32(%rbp), %eax
	subl	$3, %eax
	movl	%eax, -32(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L11
.L16:
	nop
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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"
.LC7:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L3
	leaq	36(%rsp), %rax
	xorl	%ebp, %ebp
	leaq	32(%rsp), %r14
	movq	%rax, (%rsp)
	leaq	40(%rsp), %rax
	leaq	.LC7(%rip), %r15
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r9d
	movdqa	.LC3(%rip), %xmm7
	movdqa	.LC4(%rip), %xmm6
	testl	%r9d, %r9d
	je	.L41
	movl	36(%rsp), %esi
	movl	40(%rsp), %edi
	movl	%r9d, %edx
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%edi, %edi
	je	.L42
	subl	$1, %esi
	subl	$1, %edi
	addl	$1, %eax
	movl	$1, %r10d
	subl	$1, %edx
	je	.L9
	movl	%edx, %r12d
.L10:
	testl	%esi, %esi
	jne	.L4
	testb	%r10b, %r10b
	je	.L5
	movl	%edi, 40(%rsp)
	movl	%r12d, %r9d
	movl	$0, 36(%rsp)
	movl	%r12d, 32(%rsp)
.L5:
	cmpl	$1, %r9d
	jle	.L26
	movl	36(%rsp), %esi
	movl	%r9d, %edx
	xorl	%edi, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$2, %edx
	subl	$1, %esi
	addl	$1, %eax
	movl	$1, %edi
	cmpl	$1, %edx
	jle	.L15
	movl	%edx, %r13d
.L16:
	testl	%esi, %esi
	jne	.L12
	testb	%dil, %dil
	je	.L25
	movl	$0, 36(%rsp)
	movl	%r13d, 32(%rsp)
.L13:
	cmpl	$2, %r13d
	jle	.L26
	leal	-3(%r13), %esi
	movl	$2863311531, %edi
	movq	%rsi, %rdx
	imulq	%rdi, %rsi
	shrq	$33, %rsi
	addl	$1, %esi
	cmpl	$11, %edx
	jbe	.L17
	movd	%r13d, %xmm4
	movd	%eax, %xmm5
	movl	%esi, %edi
	xorl	%edx, %edx
	pshufd	$0, %xmm4, %xmm3
	pshufd	$0, %xmm5, %xmm2
	paddd	.LC1(%rip), %xmm3
	movdqa	.LC5(%rip), %xmm5
	paddd	.LC2(%rip), %xmm2
	movdqa	.LC6(%rip), %xmm4
	shrl	$2, %edi
	.p2align 4,,10
	.p2align 3
.L18:
	movdqa	%xmm2, %xmm1
	movdqa	%xmm3, %xmm0
	paddd	%xmm7, %xmm2
	addl	$1, %edx
	paddd	%xmm6, %xmm3
	paddd	%xmm5, %xmm0
	paddd	%xmm4, %xmm1
	cmpl	%edi, %edx
	jne	.L18
	movl	%esi, %edi
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %edi
	movd	%xmm1, %r9d
	movd	%xmm0, %edx
	leal	0(,%rdi,4), %r11d
	movl	%edi, %r10d
	addl	%edi, %eax
	subl	%r11d, %r10d
	addl	%r10d, %r13d
	cmpl	%edi, %esi
	je	.L19
	leal	-3(%r13), %edx
.L17:
	leal	1(%rax), %r9d
	cmpl	$2, %edx
	jle	.L19
	leal	-6(%r13), %edx
	leal	2(%rax), %r9d
	cmpl	$2, %edx
	jle	.L19
	leal	-9(%r13), %edx
	leal	3(%rax), %r9d
	cmpl	$2, %edx
	jle	.L19
	leal	-12(%r13), %edx
	leal	4(%rax), %r9d
.L19:
	movl	%edx, 32(%rsp)
.L7:
	movl	%r9d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	%ebp, 28(%rsp)
	jg	.L2
.L3:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$72, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	%esi, 36(%rsp)
	movl	%edx, 32(%rsp)
.L26:
	movl	%eax, %r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L42:
	testb	%r10b, %r10b
	je	.L5
	movl	$0, 40(%rsp)
	movl	%r12d, %r9d
	movl	%esi, 36(%rsp)
	movl	%r12d, 32(%rsp)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, 40(%rsp)
	movl	%esi, 36(%rsp)
	movl	$0, 32(%rsp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%r9d, %r13d
	jmp	.L13
.L41:
	xorl	%eax, %eax
	jmp	.L26
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	-3
	.long	-6
	.long	-9
	.align 16
.LC2:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	-12
	.long	-12
	.long	-12
	.long	-12
	.align 16
.LC5:
	.long	-3
	.long	-3
	.long	-3
	.long	-3
	.align 16
.LC6:
	.long	1
	.long	1
	.long	1
	.long	1
	.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"
.LC7:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	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
	leaq	.LC0(%rip), %rbx
	movq	%rbx, %rdi
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	28(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	28(%rsp), %eax
	testl	%eax, %eax
	jle	.L3
	leaq	36(%rsp), %rax
	xorl	%ebp, %ebp
	leaq	32(%rsp), %r14
	movq	%rax, (%rsp)
	leaq	40(%rsp), %rax
	leaq	.LC7(%rip), %r15
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L2:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	(%rsp), %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movq	8(%rsp), %rsi
	xorl	%eax, %eax
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	movl	32(%rsp), %r9d
	movdqa	.LC3(%rip), %xmm7
	movdqa	.LC4(%rip), %xmm6
	testl	%r9d, %r9d
	je	.L41
	movl	36(%rsp), %esi
	movl	40(%rsp), %edi
	movl	%r9d, %edx
	xorl	%r10d, %r10d
	xorl	%eax, %eax
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L4:
	testl	%edi, %edi
	je	.L42
	subl	$1, %esi
	subl	$1, %edi
	addl	$1, %eax
	movl	$1, %r10d
	subl	$1, %edx
	je	.L9
	movl	%edx, %r12d
.L10:
	testl	%esi, %esi
	jne	.L4
	testb	%r10b, %r10b
	je	.L5
	movl	%edi, 40(%rsp)
	movl	%r12d, %r9d
	movl	$0, 36(%rsp)
	movl	%r12d, 32(%rsp)
.L5:
	cmpl	$1, %r9d
	jle	.L26
	movl	36(%rsp), %esi
	movl	%r9d, %edx
	xorl	%edi, %edi
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L12:
	subl	$2, %edx
	subl	$1, %esi
	addl	$1, %eax
	movl	$1, %edi
	cmpl	$1, %edx
	jle	.L15
	movl	%edx, %r13d
.L16:
	testl	%esi, %esi
	jne	.L12
	testb	%dil, %dil
	je	.L25
	movl	$0, 36(%rsp)
	movl	%r13d, 32(%rsp)
.L13:
	cmpl	$2, %r13d
	jle	.L26
	leal	-3(%r13), %esi
	movl	$2863311531, %edi
	movq	%rsi, %rdx
	imulq	%rdi, %rsi
	shrq	$33, %rsi
	addl	$1, %esi
	cmpl	$11, %edx
	jbe	.L17
	movd	%r13d, %xmm4
	movd	%eax, %xmm5
	movl	%esi, %edi
	xorl	%edx, %edx
	pshufd	$0, %xmm4, %xmm3
	pshufd	$0, %xmm5, %xmm2
	paddd	.LC1(%rip), %xmm3
	movdqa	.LC5(%rip), %xmm5
	paddd	.LC2(%rip), %xmm2
	movdqa	.LC6(%rip), %xmm4
	shrl	$2, %edi
	.p2align 4,,10
	.p2align 3
.L18:
	movdqa	%xmm2, %xmm1
	movdqa	%xmm3, %xmm0
	paddd	%xmm7, %xmm2
	addl	$1, %edx
	paddd	%xmm6, %xmm3
	paddd	%xmm5, %xmm0
	paddd	%xmm4, %xmm1
	cmpl	%edi, %edx
	jne	.L18
	movl	%esi, %edi
	pshufd	$255, %xmm1, %xmm1
	pshufd	$255, %xmm0, %xmm0
	andl	$-4, %edi
	movd	%xmm1, %r9d
	movd	%xmm0, %edx
	leal	0(,%rdi,4), %r11d
	movl	%edi, %r10d
	addl	%edi, %eax
	subl	%r11d, %r10d
	addl	%r10d, %r13d
	cmpl	%edi, %esi
	je	.L19
	leal	-3(%r13), %edx
.L17:
	leal	1(%rax), %r9d
	cmpl	$2, %edx
	jle	.L19
	leal	-6(%r13), %edx
	leal	2(%rax), %r9d
	cmpl	$2, %edx
	jle	.L19
	leal	-9(%r13), %edx
	leal	3(%rax), %r9d
	cmpl	$2, %edx
	jle	.L19
	leal	-12(%r13), %edx
	leal	4(%rax), %r9d
.L19:
	movl	%edx, 32(%rsp)
.L7:
	movl	%r9d, %edx
	movq	%r15, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	addl	$1, %ebp
	cmpl	%ebp, 28(%rsp)
	jg	.L2
.L3:
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L43
	addq	$72, %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
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	movl	%esi, 36(%rsp)
	movl	%edx, 32(%rsp)
.L26:
	movl	%eax, %r9d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L42:
	testb	%r10b, %r10b
	je	.L5
	movl	$0, 40(%rsp)
	movl	%r12d, %r9d
	movl	%esi, 36(%rsp)
	movl	%r12d, 32(%rsp)
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L9:
	movl	%edi, 40(%rsp)
	movl	%esi, 36(%rsp)
	movl	$0, 32(%rsp)
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L25:
	movl	%r9d, %r13d
	jmp	.L13
.L41:
	xorl	%eax, %eax
	jmp	.L26
.L43:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.long	0
	.long	-3
	.long	-6
	.long	-9
	.align 16
.LC2:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC3:
	.long	4
	.long	4
	.long	4
	.long	4
	.align 16
.LC4:
	.long	-12
	.long	-12
	.long	-12
	.long	-12
	.align 16
.LC5:
	.long	-3
	.long	-3
	.long	-3
	.long	-3
	.align 16
.LC6:
	.long	1
	.long	1
	.long	1
	.long	1
	.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>
int main(void)
{
    int q,i,j,can[4],ans=0;
    scanf("%d",&q);
    for(i=0;i<q;i++){
        ans=0;
        for(j=0;j<3;j++){
            scanf("%d",&can[j]);
        }
        while(1){
            if(can[0]==0||can[1]==0||can[2]==0)break;
            can[0]-=1;
            can[1]-=1;
            can[2]-=1;
            ans++;
        }
        while(1){
            if(can[0]-2<0||can[1]==0)break;
            can[0]-=2;
            can[1]-=1;
            ans++;
        }
        while(1){
            if(can[0]-3<0)break;
            can[0]-=3;
            ans++;
        }
        printf("%d\n",ans);
    }
    return 0;
}
4
3 0 0
1 1 1
9 4 2
0 1 2
 4
2 0 0
1 1 1
9 4 2
0 1 2
 4
3 0 1
1 1 1
9 4 1
0 1 2
 4
3 0 0
1 2 1
0 4 2
0 1 2
 4
0 0 0
1 2 1
0 4 2
0 1 3
 4
2 1 0
2 2 2
9 8 2
0 1 3
 4
0 1 2
3 0 2
9 19 0
0 2 3
 4
0 1 2
3 0 2
9 0 0
0 2 3
 4
3 0 0
1 2 1
12 4 2
0 1 2
 4
0 0 0
1 2 1
1 4 2
0 0 3

1
1
5
0
 0
1
5
0
 1
1
4
0
 1
1
0
0
 0
1
0
0
 1
2
5
0
 0
1
4
0
 0
1
3
0
 1
1
6
0
 0
1
1
0

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>
int main(void)
{
    int q,i,j,can[4],ans=0;
    scanf("%d",&q);
    for(i=0;i<q;i++){
        ans=0;
        for(j=0;j<3;j++){
            scanf("%d",&can[j]);
        }
        while(1){
            if(can[0]==0||can[1]==0||can[2]==0)break;
            can[0]-=1;
            can[1]-=1;
            can[2]-=1;
            ans++;
        }
        while(1){
            if(can[0]-2<0||can[1]==0)break;
            can[0]-=2;
            can[1]-=1;
            ans++;
        }
        while(1){
            if(can[0]-3<0)break;
            can[0]-=3;
            ans++;
        }
        printf("%d\n",ans);
    }
    return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -36(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L12:
	movl	$0, -36(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L3
.L4:
	leaq	-32(%rbp), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -40(%rbp)
.L3:
	cmpl	$2, -40(%rbp)
	jle	.L4
.L6:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L6
.L8:
	movl	-32(%rbp), %eax
	cmpl	$1, %eax
	jle	.L11
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-32(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L8
.L11:
	movl	-32(%rbp), %eax
	cmpl	$2, %eax
	jle	.L16
	movl	-32(%rbp), %eax
	subl	$3, %eax
	movl	%eax, -32(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L11
.L16:
	nop
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -36(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -44(%rbp)
	jmp	.L2
.L12:
	movl	$0, -36(%rbp)
	movl	$0, -40(%rbp)
	jmp	.L3
.L4:
	leaq	-32(%rbp), %rdx
	movl	-40(%rbp), %eax
	cltq
	salq	$2, %rax
	addq	%rdx, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	addl	$1, -40(%rbp)
.L3:
	cmpl	$2, -40(%rbp)
	jle	.L4
.L6:
	movl	-32(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-24(%rbp), %eax
	testl	%eax, %eax
	je	.L8
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	movl	-24(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -24(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L6
.L8:
	movl	-32(%rbp), %eax
	cmpl	$1, %eax
	jle	.L11
	movl	-28(%rbp), %eax
	testl	%eax, %eax
	je	.L11
	movl	-32(%rbp), %eax
	subl	$2, %eax
	movl	%eax, -32(%rbp)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -28(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L8
.L11:
	movl	-32(%rbp), %eax
	cmpl	$2, %eax
	jle	.L16
	movl	-32(%rbp), %eax
	subl	$3, %eax
	movl	%eax, -32(%rbp)
	addl	$1, -36(%rbp)
	jmp	.L11
.L16:
	nop
	movl	-36(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -44(%rbp)
.L2:
	movl	-48(%rbp), %eax
	cmpl	%eax, -44(%rbp)
	jl	.L12
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L14
	call	__stack_chk_fail@PLT
.L14:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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:
