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

```c
#include <stdio.h>

int max(int a,int b){
    if (a>b) return a;
    else return b;
}

int min(int a,int b){
    if (a>b) return b;
    else return a;
}

int main(){
    int n,i;
    while (1) {
        scanf("%d",&n);
        if (n==0) return 0;
        int b=0,s=1000,sum=0,x;
        for (i=0; i<n; i++) {
            scanf("%d",&x);
            b=max(x,b);
            s=min(x,s);
            sum+=x;
        }
        printf("%d\n",(sum-b-s)/(n-2));
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L5
	movl	$-1000, %eax
	jle	.L7
	xorl	%ebx, %ebx
	movl	$1000, %r15d
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	cmpl	%ecx, %r14d
	cmovl	%ecx, %r14d
	cmpl	%ecx, %r15d
	cmovg	%ecx, %r15d
	addl	%ecx, %ebx
	movl	16(%rsp), %ecx
	addl	$1, %r13d
	cmpl	%r13d, %ecx
	jg	.L6
	movl	%ebx, %eax
	subl	%r14d, %eax
	subl	%r15d, %eax
.L7:
	subl	$2, %ecx
	cltd
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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.
Optimized Assembly Code:

user
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L5
	movl	$-1000, %eax
	jle	.L7
	xorl	%ebx, %ebx
	movl	$1000, %r15d
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	cmpl	%ecx, %r14d
	cmovl	%ecx, %r14d
	cmpl	%ecx, %r15d
	cmovg	%ecx, %r15d
	addl	%ecx, %ebx
	movl	16(%rsp), %ecx
	addl	$1, %r13d
	cmpl	%r13d, %ecx
	jg	.L6
	movl	%ebx, %eax
	subl	%r14d, %eax
	subl	%r15d, %eax
.L7:
	subl	$2, %ecx
	cltd
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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:
```
rule
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L5
	movl	$-1000, %eax
	jle	.L7
	xorl	%ebx, %ebx
	movl	$1000, %r15d
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	cmpl	%ecx, %r14d
	cmovl	%ecx, %r14d
	cmpl	%ecx, %r15d
	cmovg	%ecx, %r15d
	addl	%ecx, %ebx
	movl	16(%rsp), %ecx
	addl	$1, %r13d
	cmpl	%r13d, %ecx
	jg	.L6
	movl	%ebx, %eax
	subl	%r14d, %eax
	subl	%r15d, %eax
.L7:
	subl	$2, %ecx
	cltd
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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:
```
```c
#include <stdio.h>

int max(int a,int b){
    if (a>b) return a;
    else return b;
}

int min(int a,int b){
    if (a>b) return b;
    else return a;
}

int main(){
    int n,i;
    while (1) {
        scanf("%d",&n);
        if (n==0) return 0;
        int b=0,s=1000,sum=0,x;
        for (i=0; i<n; i++) {
            scanf("%d",&x);
            b=max(x,b);
            s=min(x,s);
            sum+=x;
        }
        printf("%d\n",(sum-b-s)/(n-2));
    }
    return 0;
}```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int max(int a,int b){
    if (a>b) return a;
    else return b;
}

int min(int a,int b){
    if (a>b) return b;
    else return a;
}

int main(){
    int n,i;
    while (1) {
        scanf("%d",&n);
        if (n==0) return 0;
        int b=0,s=1000,sum=0,x;
        for (i=0; i<n; i++) {
            scanf("%d",&x);
            b=max(x,b);
            s=min(x,s);
            sum+=x;
        }
        printf("%d\n",(sum-b-s)/(n-2));
    }
    return 0;
}```

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.
Optimized Assembly Code:

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 assembly code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>

int max(int a,int b){
    if (a>b) return a;
    else return b;
}

int min(int a,int b){
    if (a>b) return b;
    else return a;
}

int main(){
    int n,i;
    while (1) {
        scanf("%d",&n);
        if (n==0) return 0;
        int b=0,s=1000,sum=0,x;
        for (i=0; i<n; i++) {
            scanf("%d",&x);
            b=max(x,b);
            s=min(x,s);
            sum+=x;
        }
        printf("%d\n",(sum-b-s)/(n-2));
    }
    return 0;
}```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L5
	movl	$-1000, %eax
	jle	.L7
	xorl	%ebx, %ebx
	movl	$1000, %r15d
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	cmpl	%ecx, %r14d
	cmovl	%ecx, %r14d
	cmpl	%ecx, %r15d
	cmovg	%ecx, %r15d
	addl	%ecx, %ebx
	movl	16(%rsp), %ecx
	addl	$1, %r13d
	cmpl	%r13d, %ecx
	jg	.L6
	movl	%ebx, %eax
	subl	%r14d, %eax
	subl	%r15d, %eax
.L7:
	subl	$2, %ecx
	cltd
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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.
Optimized Assembly Code:

train
```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	max
	.type	max, @function
max:
.LFB23:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovge	%edi, %eax
	ret
	.cfi_endproc
.LFE23:
	.size	max, .-max
	.p2align 4
	.globl	min
	.type	min, @function
min:
.LFB24:
	.cfi_startproc
	endbr64
	cmpl	%esi, %edi
	movl	%esi, %eax
	cmovle	%edi, %eax
	ret
	.cfi_endproc
.LFE24:
	.size	min, .-min
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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
	leaq	.LC0(%rip), %rbp
	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	16(%rsp), %rax
	movq	%rax, 8(%rsp)
	.p2align 4,,10
	.p2align 3
.L8:
	movq	8(%rsp), %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	16(%rsp), %ecx
	testl	%ecx, %ecx
	je	.L5
	movl	$-1000, %eax
	jle	.L7
	xorl	%ebx, %ebx
	movl	$1000, %r15d
	xorl	%r14d, %r14d
	xorl	%r13d, %r13d
	leaq	20(%rsp), %r12
	.p2align 4,,10
	.p2align 3
.L6:
	xorl	%eax, %eax
	movq	%r12, %rsi
	movq	%rbp, %rdi
	call	__isoc99_scanf@PLT
	movl	20(%rsp), %ecx
	cmpl	%ecx, %r14d
	cmovl	%ecx, %r14d
	cmpl	%ecx, %r15d
	cmovg	%ecx, %r15d
	addl	%ecx, %ebx
	movl	16(%rsp), %ecx
	addl	$1, %r13d
	cmpl	%r13d, %ecx
	jg	.L6
	movl	%ebx, %eax
	subl	%r14d, %eax
	subl	%r15d, %eax
.L7:
	subl	$2, %ecx
	cltd
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	idivl	%ecx
	movl	%eax, %edx
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L5:
	movq	24(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L14
	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
.L14:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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:
```