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>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int descending_compare(const void *a, const void *b){
    return (int)(*(int*)b - *(int*)a);
}

int ascending_compare(const void *a, const void *b){
    return (int)*(int*)a - *(int*)b;
}

char input[100005];

int main(void){
    int i;
    int answer = 100005;
    for (i = 0; i < 100005; i++){
        input[i] = 'a';
    }
    scanf("%s", input);
    int len = strlen(input);
    for (i = 0; i < len; i++){
        if (input[i] != input[i+1]){
            if (answer > (i+1>len-(i+1)?i+1:len-(i+1))){
                answer = i+1>len-(i+1)?i+1:len-(i+1);
            }
        }
    }


    printf("%d\n", answer);



    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	descending_compare
	.type	descending_compare, @function
descending_compare:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	descending_compare, .-descending_compare
	.p2align 4
	.globl	ascending_compare
	.type	ascending_compare, @function
ascending_compare:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	ascending_compare, .-ascending_compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	input(%rip), %rbx
	movl	$100005, %edx
	movl	$97, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L9
	movzbl	input(%rip), %esi
	leal	-1(%rax), %ecx
	leal	1(%rax), %r9d
	movl	$100005, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, %edi
	movzbl	(%rbx,%rax), %esi
	movl	%eax, %edx
	cmpb	%sil, %dil
	je	.L6
	leal	-1(%rax), %edi
	cmpl	%edi, %ecx
	cmovg	%ecx, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
.L6:
	addq	$1, %rax
	subl	$1, %ecx
	cmpq	%r9, %rax
	jne	.L8
.L5:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movl	$100005, %r8d
	jmp	.L5
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	input
	.bss
	.align 32
	.type	input, @object
	.size	input, 100005
input:
	.zero	100005
	.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	descending_compare
	.type	descending_compare, @function
descending_compare:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	descending_compare, .-descending_compare
	.p2align 4
	.globl	ascending_compare
	.type	ascending_compare, @function
ascending_compare:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	ascending_compare, .-ascending_compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	input(%rip), %rbx
	movl	$100005, %edx
	movl	$97, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L9
	movzbl	input(%rip), %esi
	leal	-1(%rax), %ecx
	leal	1(%rax), %r9d
	movl	$100005, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, %edi
	movzbl	(%rbx,%rax), %esi
	movl	%eax, %edx
	cmpb	%sil, %dil
	je	.L6
	leal	-1(%rax), %edi
	cmpl	%edi, %ecx
	cmovg	%ecx, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
.L6:
	addq	$1, %rax
	subl	$1, %ecx
	cmpq	%r9, %rax
	jne	.L8
.L5:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movl	$100005, %r8d
	jmp	.L5
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	input
	.bss
	.align 32
	.type	input, @object
	.size	input, 100005
input:
	.zero	100005
	.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	descending_compare
	.type	descending_compare, @function
descending_compare:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	descending_compare, .-descending_compare
	.p2align 4
	.globl	ascending_compare
	.type	ascending_compare, @function
ascending_compare:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	ascending_compare, .-ascending_compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	input(%rip), %rbx
	movl	$100005, %edx
	movl	$97, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L9
	movzbl	input(%rip), %esi
	leal	-1(%rax), %ecx
	leal	1(%rax), %r9d
	movl	$100005, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, %edi
	movzbl	(%rbx,%rax), %esi
	movl	%eax, %edx
	cmpb	%sil, %dil
	je	.L6
	leal	-1(%rax), %edi
	cmpl	%edi, %ecx
	cmovg	%ecx, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
.L6:
	addq	$1, %rax
	subl	$1, %ecx
	cmpq	%r9, %rax
	jne	.L8
.L5:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movl	$100005, %r8d
	jmp	.L5
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	input
	.bss
	.align 32
	.type	input, @object
	.size	input, 100005
input:
	.zero	100005
	.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>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int descending_compare(const void *a, const void *b){
    return (int)(*(int*)b - *(int*)a);
}

int ascending_compare(const void *a, const void *b){
    return (int)*(int*)a - *(int*)b;
}

char input[100005];

int main(void){
    int i;
    int answer = 100005;
    for (i = 0; i < 100005; i++){
        input[i] = 'a';
    }
    scanf("%s", input);
    int len = strlen(input);
    for (i = 0; i < len; i++){
        if (input[i] != input[i+1]){
            if (answer > (i+1>len-(i+1)?i+1:len-(i+1))){
                answer = i+1>len-(i+1)?i+1:len-(i+1);
            }
        }
    }


    printf("%d\n", answer);



    return 0;
}
```
Given the following C code, your task is to generate highly optimized x86-64 assembly code.
C Code:

```c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int descending_compare(const void *a, const void *b){
    return (int)(*(int*)b - *(int*)a);
}

int ascending_compare(const void *a, const void *b){
    return (int)*(int*)a - *(int*)b;
}

char input[100005];

int main(void){
    int i;
    int answer = 100005;
    for (i = 0; i < 100005; i++){
        input[i] = 'a';
    }
    scanf("%s", input);
    int len = strlen(input);
    for (i = 0; i < len; i++){
        if (input[i] != input[i+1]){
            if (answer > (i+1>len-(i+1)?i+1:len-(i+1))){
                answer = i+1>len-(i+1)?i+1:len-(i+1);
            }
        }
    }


    printf("%d\n", answer);



    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:

100000010
 011
 00001101
 111
 00011101
 100000101
 11111111
 000000000
 100000011
 100001011

7
 2
 4
 3
 5
 6
 8
 9
 7
 5

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>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int descending_compare(const void *a, const void *b){
    return (int)(*(int*)b - *(int*)a);
}

int ascending_compare(const void *a, const void *b){
    return (int)*(int*)a - *(int*)b;
}

char input[100005];

int main(void){
    int i;
    int answer = 100005;
    for (i = 0; i < 100005; i++){
        input[i] = 'a';
    }
    scanf("%s", input);
    int len = strlen(input);
    for (i = 0; i < len; i++){
        if (input[i] != input[i+1]){
            if (answer > (i+1>len-(i+1)?i+1:len-(i+1))){
                answer = i+1>len-(i+1)?i+1:len-(i+1);
            }
        }
    }


    printf("%d\n", answer);



    return 0;
}
```

Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.p2align 4
	.globl	descending_compare
	.type	descending_compare, @function
descending_compare:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	descending_compare, .-descending_compare
	.p2align 4
	.globl	ascending_compare
	.type	ascending_compare, @function
ascending_compare:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	ascending_compare, .-ascending_compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	input(%rip), %rbx
	movl	$100005, %edx
	movl	$97, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L9
	movzbl	input(%rip), %esi
	leal	-1(%rax), %ecx
	leal	1(%rax), %r9d
	movl	$100005, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, %edi
	movzbl	(%rbx,%rax), %esi
	movl	%eax, %edx
	cmpb	%sil, %dil
	je	.L6
	leal	-1(%rax), %edi
	cmpl	%edi, %ecx
	cmovg	%ecx, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
.L6:
	addq	$1, %rax
	subl	$1, %ecx
	cmpq	%r9, %rax
	jne	.L8
.L5:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movl	$100005, %r8d
	jmp	.L5
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	input
	.bss
	.align 32
	.type	input, @object
	.size	input, 100005
input:
	.zero	100005
	.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	descending_compare
	.type	descending_compare, @function
descending_compare:
.LFB51:
	.cfi_startproc
	endbr64
	movl	(%rsi), %eax
	subl	(%rdi), %eax
	ret
	.cfi_endproc
.LFE51:
	.size	descending_compare, .-descending_compare
	.p2align 4
	.globl	ascending_compare
	.type	ascending_compare, @function
ascending_compare:
.LFB52:
	.cfi_startproc
	endbr64
	movl	(%rdi), %eax
	subl	(%rsi), %eax
	ret
	.cfi_endproc
.LFE52:
	.size	ascending_compare, .-ascending_compare
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%s"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB53:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	input(%rip), %rbx
	movl	$100005, %edx
	movl	$97, %esi
	movq	%rbx, %rdi
	call	memset@PLT
	leaq	.LC0(%rip), %rdi
	xorl	%eax, %eax
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L9
	movzbl	input(%rip), %esi
	leal	-1(%rax), %ecx
	leal	1(%rax), %r9d
	movl	$100005, %r8d
	movl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L8:
	movl	%esi, %edi
	movzbl	(%rbx,%rax), %esi
	movl	%eax, %edx
	cmpb	%sil, %dil
	je	.L6
	leal	-1(%rax), %edi
	cmpl	%edi, %ecx
	cmovg	%ecx, %edx
	cmpl	%edx, %r8d
	cmovg	%edx, %r8d
.L6:
	addq	$1, %rax
	subl	$1, %ecx
	cmpq	%r9, %rax
	jne	.L8
.L5:
	movl	%r8d, %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	xorl	%eax, %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
.L9:
	.cfi_restore_state
	movl	$100005, %r8d
	jmp	.L5
	.cfi_endproc
.LFE53:
	.size	main, .-main
	.globl	input
	.bss
	.align 32
	.type	input, @object
	.size	input, 100005
input:
	.zero	100005
	.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:
```