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()
{
  int i,j,n,min,max,sum=0,m=0,mini,maxi;
  int S[100],SS[100];
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&S[i]);
    }
    min=S[0];
    mini=0;
    max=S[0];
    maxi=0;
    for(i=1;i<n;i++){
      if(min>S[i]){
        min=S[i];
        mini=i;
      }
      if(max<S[i]){
      max=S[i];
      maxi=i;
      }
    }
    for(i=0;i<n;i++){
      if(i!=mini && i!=maxi)sum+=S[i];
    }
    SS[m]=sum/(n-2);
    m++;
    sum=0;
    
  }
  for(i=0;i<m;i++){
    printf("%d\n",SS[i]);
  }
  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	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -832(%rbp)
	movl	$0, -828(%rbp)
.L13:
	leaq	-848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-848(%rbp), %eax
	testl	%eax, %eax
	je	.L19
	movl	$0, -844(%rbp)
	jmp	.L4
.L5:
	leaq	-816(%rbp), %rdx
	movl	-844(%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, -844(%rbp)
.L4:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L5
	movl	-816(%rbp), %eax
	movl	%eax, -840(%rbp)
	movl	$0, -824(%rbp)
	movl	-816(%rbp), %eax
	movl	%eax, -836(%rbp)
	movl	$0, -820(%rbp)
	movl	$1, -844(%rbp)
	jmp	.L6
.L9:
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -840(%rbp)
	jle	.L7
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -840(%rbp)
	movl	-844(%rbp), %eax
	movl	%eax, -824(%rbp)
.L7:
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -836(%rbp)
	jge	.L8
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -836(%rbp)
	movl	-844(%rbp), %eax
	movl	%eax, -820(%rbp)
.L8:
	addl	$1, -844(%rbp)
.L6:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L9
	movl	$0, -844(%rbp)
	jmp	.L10
.L12:
	movl	-844(%rbp), %eax
	cmpl	-824(%rbp), %eax
	je	.L11
	movl	-844(%rbp), %eax
	cmpl	-820(%rbp), %eax
	je	.L11
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
.L11:
	addl	$1, -844(%rbp)
.L10:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L12
	movl	-848(%rbp), %eax
	leal	-2(%rax), %ecx
	movl	-832(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-828(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -828(%rbp)
	movl	$0, -832(%rbp)
	jmp	.L13
.L19:
	nop
	movl	$0, -844(%rbp)
	jmp	.L14
.L15:
	movl	-844(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -844(%rbp)
.L14:
	movl	-844(%rbp), %eax
	cmpl	-828(%rbp), %eax
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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
.LC1:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	leaq	16(%rsp), %r14
	movl	$0, %r13d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %r14
	cmpl	%r13d, %esi
	jg	.L6
.L4:
	movl	16(%rsp), %edi
	leal	-2(%rsi), %r11d
	cmpl	$1, %esi
	jle	.L7
	movslq	%esi, %r14
	movl	%edi, %r8d
	movl	$1, %eax
	xorl	%r13d, %r13d
	xorl	%r10d, %r10d
	leaq	16(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rcx,%rax,4), %edx
	movl	%eax, %r9d
	cmpl	%edx, %edi
	jle	.L8
	movl	%eax, %r10d
	movl	%edx, %edi
.L8:
	cmpl	%edx, %r8d
	jge	.L9
	movl	%r9d, %r13d
	movl	%edx, %r8d
.L9:
	addq	$1, %rax
	cmpq	%r14, %rax
	jne	.L10
	testl	%esi, %esi
	movl	$1, %edi
	cmovg	%esi, %edi
	cmpl	$3, %esi
	jle	.L14
	movl	%edi, %edx
	movd	%r10d, %xmm7
	movq	%rcx, %rax
	movdqa	.LC0(%rip), %xmm3
	shrl	$2, %edx
	pshufd	$0, %xmm7, %xmm6
	pxor	%xmm2, %xmm2
	subl	$1, %edx
	movd	%r13d, %xmm7
	movdqa	%xmm2, %xmm4
	salq	$4, %rdx
	pshufd	$0, %xmm7, %xmm5
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	%xmm3, %xmm1
	addq	$16, %rax
	paddd	.LC2(%rip), %xmm3
	movdqa	%xmm1, %xmm0
	pcmpeqd	%xmm5, %xmm1
	pcmpeqd	%xmm6, %xmm0
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm0
	pand	%xmm1, %xmm0
	pand	-16(%rax), %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %rdx
	jne	.L15
	movdqa	%xmm2, %xmm0
	movl	%edi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	andl	$3, %edi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %eax
	je	.L16
	cmpl	%edx, %r10d
	je	.L12
	cmpl	%edx, %r13d
	je	.L12
.L24:
	movslq	%edx, %rcx
	addl	16(%rsp,%rcx,4), %eax
.L12:
	addl	$1, %edx
	cmpl	%esi, %edx
	jge	.L16
.L26:
	cmpl	%r13d, %edx
	je	.L17
	cmpl	%r10d, %edx
	je	.L17
	movslq	%edx, %rcx
	addl	16(%rsp,%rcx,4), %eax
.L17:
	addl	$1, %edx
	cmpl	%esi, %edx
	jge	.L16
	cmpl	%r10d, %edx
	je	.L16
	cmpl	%r13d, %edx
	je	.L16
	movslq	%edx, %rdx
	addl	16(%rsp,%rdx,4), %eax
.L16:
	cltd
	idivl	%r11d
.L13:
	movl	%eax, 416(%rsp,%rbp,4)
	addq	$1, %rbp
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L2:
	testl	%ebp, %ebp
	je	.L23
	leal	-1(%rbp), %eax
	leaq	416(%rsp), %rbx
	leaq	420(%rsp,%rax,4), %r12
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r12
	jne	.L22
.L23:
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	je	.L28
	xorl	%eax, %eax
	jmp	.L13
.L14:
	testl	%r10d, %r10d
	je	.L30
	testl	%r13d, %r13d
	je	.L30
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L24
.L30:
	movl	$1, %edx
	xorl	%eax, %eax
	jmp	.L26
.L28:
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	jmp	.L12
.L58:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.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
.LC1:
	.string	"%d"
.LC3:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	pushq	%r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	xorl	%ebp, %ebp
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	leaq	.LC1(%rip), %rbx
	subq	$832, %rsp
	.cfi_def_cfa_offset 880
	movq	%fs:40, %rax
	movq	%rax, 824(%rsp)
	xorl	%eax, %eax
	leaq	12(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L21:
	movq	%r12, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	testl	%esi, %esi
	je	.L2
	leaq	16(%rsp), %r14
	movl	$0, %r13d
	jle	.L4
	.p2align 4,,10
	.p2align 3
.L6:
	movq	%r14, %rsi
	movq	%rbx, %rdi
	xorl	%eax, %eax
	addl	$1, %r13d
	call	__isoc99_scanf@PLT
	movl	12(%rsp), %esi
	addq	$4, %r14
	cmpl	%r13d, %esi
	jg	.L6
.L4:
	movl	16(%rsp), %edi
	leal	-2(%rsi), %r11d
	cmpl	$1, %esi
	jle	.L7
	movslq	%esi, %r14
	movl	%edi, %r8d
	movl	$1, %eax
	xorl	%r13d, %r13d
	xorl	%r10d, %r10d
	leaq	16(%rsp), %rcx
	.p2align 4,,10
	.p2align 3
.L10:
	movl	(%rcx,%rax,4), %edx
	movl	%eax, %r9d
	cmpl	%edx, %edi
	jle	.L8
	movl	%eax, %r10d
	movl	%edx, %edi
.L8:
	cmpl	%edx, %r8d
	jge	.L9
	movl	%r9d, %r13d
	movl	%edx, %r8d
.L9:
	addq	$1, %rax
	cmpq	%r14, %rax
	jne	.L10
	testl	%esi, %esi
	movl	$1, %edi
	cmovg	%esi, %edi
	cmpl	$3, %esi
	jle	.L14
	movl	%edi, %edx
	movd	%r10d, %xmm7
	movq	%rcx, %rax
	movdqa	.LC0(%rip), %xmm3
	shrl	$2, %edx
	pshufd	$0, %xmm7, %xmm6
	pxor	%xmm2, %xmm2
	subl	$1, %edx
	movd	%r13d, %xmm7
	movdqa	%xmm2, %xmm4
	salq	$4, %rdx
	pshufd	$0, %xmm7, %xmm5
	leaq	32(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L15:
	movdqa	%xmm3, %xmm1
	addq	$16, %rax
	paddd	.LC2(%rip), %xmm3
	movdqa	%xmm1, %xmm0
	pcmpeqd	%xmm5, %xmm1
	pcmpeqd	%xmm6, %xmm0
	pcmpeqd	%xmm4, %xmm1
	pcmpeqd	%xmm4, %xmm0
	pand	%xmm1, %xmm0
	pand	-16(%rax), %xmm0
	paddd	%xmm0, %xmm2
	cmpq	%rax, %rdx
	jne	.L15
	movdqa	%xmm2, %xmm0
	movl	%edi, %edx
	psrldq	$8, %xmm0
	andl	$-4, %edx
	andl	$3, %edi
	paddd	%xmm0, %xmm2
	movdqa	%xmm2, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm2
	movd	%xmm2, %eax
	je	.L16
	cmpl	%edx, %r10d
	je	.L12
	cmpl	%edx, %r13d
	je	.L12
.L24:
	movslq	%edx, %rcx
	addl	16(%rsp,%rcx,4), %eax
.L12:
	addl	$1, %edx
	cmpl	%esi, %edx
	jge	.L16
.L26:
	cmpl	%r13d, %edx
	je	.L17
	cmpl	%r10d, %edx
	je	.L17
	movslq	%edx, %rcx
	addl	16(%rsp,%rcx,4), %eax
.L17:
	addl	$1, %edx
	cmpl	%esi, %edx
	jge	.L16
	cmpl	%r10d, %edx
	je	.L16
	cmpl	%r13d, %edx
	je	.L16
	movslq	%edx, %rdx
	addl	16(%rsp,%rdx,4), %eax
.L16:
	cltd
	idivl	%r11d
.L13:
	movl	%eax, 416(%rsp,%rbp,4)
	addq	$1, %rbp
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L2:
	testl	%ebp, %ebp
	je	.L23
	leal	-1(%rbp), %eax
	leaq	416(%rsp), %rbx
	leaq	420(%rsp,%rax,4), %r12
	leaq	.LC3(%rip), %rbp
	.p2align 4,,10
	.p2align 3
.L22:
	movl	(%rbx), %edx
	movq	%rbp, %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	addq	$4, %rbx
	call	__printf_chk@PLT
	cmpq	%rbx, %r12
	jne	.L22
.L23:
	movq	824(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L58
	addq	$832, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 40
	popq	%rbp
	.cfi_def_cfa_offset 32
	popq	%r12
	.cfi_def_cfa_offset 24
	popq	%r13
	.cfi_def_cfa_offset 16
	popq	%r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	je	.L28
	xorl	%eax, %eax
	jmp	.L13
.L14:
	testl	%r10d, %r10d
	je	.L30
	testl	%r13d, %r13d
	je	.L30
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L24
.L30:
	movl	$1, %edx
	xorl	%eax, %eax
	jmp	.L26
.L28:
	xorl	%r10d, %r10d
	xorl	%edx, %edx
	xorl	%r13d, %r13d
	xorl	%eax, %eax
	jmp	.L12
.L58:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	0
	.long	1
	.long	2
	.long	3
	.align 16
.LC2:
	.long	4
	.long	4
	.long	4
	.long	4
	.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()
{
  int i,j,n,min,max,sum=0,m=0,mini,maxi;
  int S[100],SS[100];
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&S[i]);
    }
    min=S[0];
    mini=0;
    max=S[0];
    maxi=0;
    for(i=1;i<n;i++){
      if(min>S[i]){
        min=S[i];
        mini=i;
      }
      if(max<S[i]){
      max=S[i];
      maxi=i;
      }
    }
    for(i=0;i<n;i++){
      if(i!=mini && i!=maxi)sum+=S[i];
    }
    SS[m]=sum/(n-2);
    m++;
    sum=0;
    
  }
  for(i=0;i<m;i++){
    printf("%d\n",SS[i]);
  }
  return 0;
}
3
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
400
8
353
242
708
274
283
132
402
523
0
 3
1000
342
0
5
0
2
9
11
932
5
300
1000
0
200
400
8
353
242
402
274
283
132
402
523
0
 3
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
400
8
297
242
924
274
283
132
402
523
0
 3
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
400
8
297
242
924
274
5
132
402
523
0
 3
1000
342
0
5
0
2
9
11
932
5
300
1000
0
200
685
8
353
242
402
274
283
31
402
523
0
 3
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
400
8
297
242
924
274
5
132
531
523
0
 3
1000
342
0
5
0
2
9
11
932
5
300
1000
0
200
685
8
353
143
402
274
283
31
402
523
0
 3
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
400
8
203
242
924
274
5
132
531
523
0
 3
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
479
8
353
242
402
274
283
132
402
523
0
 3
1000
342
0
5
2
2
9
11
932
5
300
1000
0
200
400
8
353
242
708
274
283
132
13
523
0

342
7
300
346
 342
7
300
326
 342
7
300
336
 342
7
300
311
 342
7
395
326
 342
7
300
333
 342
7
395
309
 342
7
300
317
 342
7
326
326
 342
7
300
301

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()
{
  int i,j,n,min,max,sum=0,m=0,mini,maxi;
  int S[100],SS[100];
  while(1){
    scanf("%d",&n);
    if(n==0)break;
    for(i=0;i<n;i++){
      scanf("%d",&S[i]);
    }
    min=S[0];
    mini=0;
    max=S[0];
    maxi=0;
    for(i=1;i<n;i++){
      if(min>S[i]){
        min=S[i];
        mini=i;
      }
      if(max<S[i]){
      max=S[i];
      maxi=i;
      }
    }
    for(i=0;i<n;i++){
      if(i!=mini && i!=maxi)sum+=S[i];
    }
    SS[m]=sum/(n-2);
    m++;
    sum=0;
    
  }
  for(i=0;i<m;i++){
    printf("%d\n",SS[i]);
  }
  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	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -832(%rbp)
	movl	$0, -828(%rbp)
.L13:
	leaq	-848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-848(%rbp), %eax
	testl	%eax, %eax
	je	.L19
	movl	$0, -844(%rbp)
	jmp	.L4
.L5:
	leaq	-816(%rbp), %rdx
	movl	-844(%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, -844(%rbp)
.L4:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L5
	movl	-816(%rbp), %eax
	movl	%eax, -840(%rbp)
	movl	$0, -824(%rbp)
	movl	-816(%rbp), %eax
	movl	%eax, -836(%rbp)
	movl	$0, -820(%rbp)
	movl	$1, -844(%rbp)
	jmp	.L6
.L9:
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -840(%rbp)
	jle	.L7
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -840(%rbp)
	movl	-844(%rbp), %eax
	movl	%eax, -824(%rbp)
.L7:
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -836(%rbp)
	jge	.L8
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -836(%rbp)
	movl	-844(%rbp), %eax
	movl	%eax, -820(%rbp)
.L8:
	addl	$1, -844(%rbp)
.L6:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L9
	movl	$0, -844(%rbp)
	jmp	.L10
.L12:
	movl	-844(%rbp), %eax
	cmpl	-824(%rbp), %eax
	je	.L11
	movl	-844(%rbp), %eax
	cmpl	-820(%rbp), %eax
	je	.L11
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
.L11:
	addl	$1, -844(%rbp)
.L10:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L12
	movl	-848(%rbp), %eax
	leal	-2(%rax), %ecx
	movl	-832(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-828(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -828(%rbp)
	movl	$0, -832(%rbp)
	jmp	.L13
.L19:
	nop
	movl	$0, -844(%rbp)
	jmp	.L14
.L15:
	movl	-844(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -844(%rbp)
.L14:
	movl	-844(%rbp), %eax
	cmpl	-828(%rbp), %eax
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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	$848, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -832(%rbp)
	movl	$0, -828(%rbp)
.L13:
	leaq	-848(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-848(%rbp), %eax
	testl	%eax, %eax
	je	.L19
	movl	$0, -844(%rbp)
	jmp	.L4
.L5:
	leaq	-816(%rbp), %rdx
	movl	-844(%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, -844(%rbp)
.L4:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L5
	movl	-816(%rbp), %eax
	movl	%eax, -840(%rbp)
	movl	$0, -824(%rbp)
	movl	-816(%rbp), %eax
	movl	%eax, -836(%rbp)
	movl	$0, -820(%rbp)
	movl	$1, -844(%rbp)
	jmp	.L6
.L9:
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -840(%rbp)
	jle	.L7
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -840(%rbp)
	movl	-844(%rbp), %eax
	movl	%eax, -824(%rbp)
.L7:
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	cmpl	%eax, -836(%rbp)
	jge	.L8
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	movl	%eax, -836(%rbp)
	movl	-844(%rbp), %eax
	movl	%eax, -820(%rbp)
.L8:
	addl	$1, -844(%rbp)
.L6:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L9
	movl	$0, -844(%rbp)
	jmp	.L10
.L12:
	movl	-844(%rbp), %eax
	cmpl	-824(%rbp), %eax
	je	.L11
	movl	-844(%rbp), %eax
	cmpl	-820(%rbp), %eax
	je	.L11
	movl	-844(%rbp), %eax
	cltq
	movl	-816(%rbp,%rax,4), %eax
	addl	%eax, -832(%rbp)
.L11:
	addl	$1, -844(%rbp)
.L10:
	movl	-848(%rbp), %eax
	cmpl	%eax, -844(%rbp)
	jl	.L12
	movl	-848(%rbp), %eax
	leal	-2(%rax), %ecx
	movl	-832(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, %edx
	movl	-828(%rbp), %eax
	cltq
	movl	%edx, -416(%rbp,%rax,4)
	addl	$1, -828(%rbp)
	movl	$0, -832(%rbp)
	jmp	.L13
.L19:
	nop
	movl	$0, -844(%rbp)
	jmp	.L14
.L15:
	movl	-844(%rbp), %eax
	cltq
	movl	-416(%rbp,%rax,4), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	addl	$1, -844(%rbp)
.L14:
	movl	-844(%rbp), %eax
	cmpl	-828(%rbp), %eax
	jl	.L15
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L17
	call	__stack_chk_fail@PLT
.L17:
	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:
