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 <string.h>

int main(void){

  char S[100000];
  int count0=0;
  int count1=0;
  
  scanf("%s",S);
  int len = strlen(S);
  
  for(int i=0;i<len;i++){
  	if(S[i]=='0')count0++;
    else count1++;
  }
  
  if(count0<=count1)printf("%d",count0*2);
  else{
    printf("%d",count1*2);
  }
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100032(%rbp)
	movl	$0, -100028(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100020(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L5:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L3
	addl	$1, -100032(%rbp)
	jmp	.L4
.L3:
	addl	$1, -100028(%rbp)
.L4:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100024(%rbp), %eax
	cmpl	-100020(%rbp), %eax
	jl	.L5
	movl	-100032(%rbp), %eax
	cmpl	-100028(%rbp), %eax
	jg	.L6
	movl	-100032(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-100028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"%s"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1712, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L40
	movq	%rax, %rsi
	leal	-1(%rax), %eax
	cmpl	$14, %eax
	jbe	.L41
	movl	%esi, %edx
	pxor	%xmm9, %xmm9
	pxor	%xmm3, %xmm3
	movq	%rbx, %rax
	shrl	$4, %edx
	movdqa	%xmm9, %xmm8
	pxor	%xmm2, %xmm2
	movdqa	.LC1(%rip), %xmm5
	subl	$1, %edx
	movdqa	.LC2(%rip), %xmm4
	salq	$4, %rdx
	leaq	16(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm5, %xmm0
	movdqa	%xmm3, %xmm1
	movdqa	%xmm2, %xmm10
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	movdqa	%xmm0, %xmm6
	pandn	%xmm4, %xmm0
	pand	%xmm4, %xmm6
	pcmpgtb	%xmm6, %xmm1
	movdqa	%xmm6, %xmm7
	punpcklbw	%xmm1, %xmm7
	punpckhbw	%xmm1, %xmm6
	pcmpgtw	%xmm7, %xmm10
	movdqa	%xmm7, %xmm1
	punpcklwd	%xmm10, %xmm1
	punpckhwd	%xmm10, %xmm7
	paddd	%xmm8, %xmm1
	movdqa	%xmm6, %xmm8
	paddd	%xmm7, %xmm1
	movdqa	%xmm2, %xmm7
	pcmpgtw	%xmm6, %xmm7
	punpcklwd	%xmm7, %xmm8
	punpckhwd	%xmm7, %xmm6
	movdqa	%xmm0, %xmm7
	paddd	%xmm8, %xmm1
	paddd	%xmm6, %xmm1
	movdqa	%xmm2, %xmm6
	movdqa	%xmm1, %xmm8
	movdqa	%xmm3, %xmm1
	pcmpgtb	%xmm0, %xmm1
	punpcklbw	%xmm1, %xmm7
	punpckhbw	%xmm1, %xmm0
	pcmpgtw	%xmm7, %xmm6
	movdqa	%xmm7, %xmm1
	punpcklwd	%xmm6, %xmm1
	punpckhwd	%xmm6, %xmm7
	movdqa	%xmm2, %xmm6
	pcmpgtw	%xmm0, %xmm6
	paddd	%xmm9, %xmm1
	paddd	%xmm7, %xmm1
	movdqa	%xmm0, %xmm7
	punpcklwd	%xmm6, %xmm7
	punpckhwd	%xmm6, %xmm0
	paddd	%xmm7, %xmm1
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm9
	cmpq	%rax, %rdx
	jne	.L4
	movdqa	%xmm1, %xmm0
	movl	%esi, %ecx
	psrldq	$8, %xmm0
	andl	$-16, %ecx
	paddd	%xmm0, %xmm9
	movdqa	%xmm9, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm9
	movdqa	%xmm8, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm9, %eax
	paddd	%xmm0, %xmm8
	movdqa	%xmm8, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm8
	movd	%xmm8, %edx
	testb	$15, %sil
	je	.L5
.L3:
	movslq	%ecx, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L45
	addl	$1, %eax
.L7:
	leal	1(%rcx), %edi
	cmpl	%esi, %edi
	jge	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L46
	addl	$1, %eax
.L9:
	leal	2(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L47
	addl	$1, %eax
.L11:
	leal	3(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L48
	addl	$1, %eax
.L13:
	leal	4(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L49
	addl	$1, %eax
.L15:
	leal	5(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L50
	addl	$1, %eax
.L17:
	leal	6(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L51
	addl	$1, %eax
.L19:
	leal	7(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L52
	addl	$1, %eax
.L21:
	leal	8(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L53
	addl	$1, %eax
.L23:
	leal	9(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L54
	addl	$1, %eax
.L25:
	leal	10(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L55
	addl	$1, %eax
.L27:
	leal	11(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L56
	addl	$1, %eax
.L29:
	leal	12(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L57
	addl	$1, %eax
.L31:
	leal	13(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L58
	addl	$1, %eax
.L33:
	addl	$14, %ecx
	cmpl	%ecx, %esi
	jle	.L5
	movslq	%ecx, %rcx
	cmpb	$48, (%rsp,%rcx)
	je	.L34
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	%eax, %edx
	jle	.L2
	leal	(%rax,%rax), %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L38:
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L59
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	xorl	%edx, %edx
.L2:
	addl	%edx, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L46:
	addl	$1, %edx
	jmp	.L9
.L45:
	addl	$1, %edx
	jmp	.L7
.L47:
	addl	$1, %edx
	jmp	.L11
.L48:
	addl	$1, %edx
	jmp	.L13
.L54:
	addl	$1, %edx
	jmp	.L25
.L49:
	addl	$1, %edx
	jmp	.L15
.L50:
	addl	$1, %edx
	jmp	.L17
.L51:
	addl	$1, %edx
	jmp	.L19
.L52:
	addl	$1, %edx
	jmp	.L21
.L53:
	addl	$1, %edx
	jmp	.L23
.L41:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L3
.L55:
	addl	$1, %edx
	jmp	.L27
.L56:
	addl	$1, %edx
	jmp	.L29
.L57:
	addl	$1, %edx
	jmp	.L31
.L58:
	addl	$1, %edx
	jmp	.L33
.L34:
	addl	$1, %edx
	jmp	.L5
.L59:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	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	"%s"
.LC3:
	.string	"%d"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB35:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	leaq	-98304(%rsp), %r11
	.cfi_def_cfa 11, 98320
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$1712, %rsp
	.cfi_def_cfa_offset 100032
	leaq	.LC0(%rip), %rdi
	movq	%fs:40, %rax
	movq	%rax, 100008(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rbx
	movq	%rbx, %rsi
	call	__isoc99_scanf@PLT
	movq	%rbx, %rdi
	call	strlen@PLT
	testq	%rax, %rax
	je	.L40
	movq	%rax, %rsi
	leal	-1(%rax), %eax
	cmpl	$14, %eax
	jbe	.L41
	movl	%esi, %edx
	pxor	%xmm9, %xmm9
	pxor	%xmm3, %xmm3
	movq	%rbx, %rax
	shrl	$4, %edx
	movdqa	%xmm9, %xmm8
	pxor	%xmm2, %xmm2
	movdqa	.LC1(%rip), %xmm5
	subl	$1, %edx
	movdqa	.LC2(%rip), %xmm4
	salq	$4, %rdx
	leaq	16(%rsp,%rdx), %rdx
	.p2align 4,,10
	.p2align 3
.L4:
	movdqa	%xmm5, %xmm0
	movdqa	%xmm3, %xmm1
	movdqa	%xmm2, %xmm10
	addq	$16, %rax
	pcmpeqb	-16(%rax), %xmm0
	movdqa	%xmm0, %xmm6
	pandn	%xmm4, %xmm0
	pand	%xmm4, %xmm6
	pcmpgtb	%xmm6, %xmm1
	movdqa	%xmm6, %xmm7
	punpcklbw	%xmm1, %xmm7
	punpckhbw	%xmm1, %xmm6
	pcmpgtw	%xmm7, %xmm10
	movdqa	%xmm7, %xmm1
	punpcklwd	%xmm10, %xmm1
	punpckhwd	%xmm10, %xmm7
	paddd	%xmm8, %xmm1
	movdqa	%xmm6, %xmm8
	paddd	%xmm7, %xmm1
	movdqa	%xmm2, %xmm7
	pcmpgtw	%xmm6, %xmm7
	punpcklwd	%xmm7, %xmm8
	punpckhwd	%xmm7, %xmm6
	movdqa	%xmm0, %xmm7
	paddd	%xmm8, %xmm1
	paddd	%xmm6, %xmm1
	movdqa	%xmm2, %xmm6
	movdqa	%xmm1, %xmm8
	movdqa	%xmm3, %xmm1
	pcmpgtb	%xmm0, %xmm1
	punpcklbw	%xmm1, %xmm7
	punpckhbw	%xmm1, %xmm0
	pcmpgtw	%xmm7, %xmm6
	movdqa	%xmm7, %xmm1
	punpcklwd	%xmm6, %xmm1
	punpckhwd	%xmm6, %xmm7
	movdqa	%xmm2, %xmm6
	pcmpgtw	%xmm0, %xmm6
	paddd	%xmm9, %xmm1
	paddd	%xmm7, %xmm1
	movdqa	%xmm0, %xmm7
	punpcklwd	%xmm6, %xmm7
	punpckhwd	%xmm6, %xmm0
	paddd	%xmm7, %xmm1
	paddd	%xmm0, %xmm1
	movdqa	%xmm1, %xmm9
	cmpq	%rax, %rdx
	jne	.L4
	movdqa	%xmm1, %xmm0
	movl	%esi, %ecx
	psrldq	$8, %xmm0
	andl	$-16, %ecx
	paddd	%xmm0, %xmm9
	movdqa	%xmm9, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm9
	movdqa	%xmm8, %xmm0
	psrldq	$8, %xmm0
	movd	%xmm9, %eax
	paddd	%xmm0, %xmm8
	movdqa	%xmm8, %xmm0
	psrldq	$4, %xmm0
	paddd	%xmm0, %xmm8
	movd	%xmm8, %edx
	testb	$15, %sil
	je	.L5
.L3:
	movslq	%ecx, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L45
	addl	$1, %eax
.L7:
	leal	1(%rcx), %edi
	cmpl	%esi, %edi
	jge	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L46
	addl	$1, %eax
.L9:
	leal	2(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L47
	addl	$1, %eax
.L11:
	leal	3(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L48
	addl	$1, %eax
.L13:
	leal	4(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L49
	addl	$1, %eax
.L15:
	leal	5(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L50
	addl	$1, %eax
.L17:
	leal	6(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L51
	addl	$1, %eax
.L19:
	leal	7(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L52
	addl	$1, %eax
.L21:
	leal	8(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L53
	addl	$1, %eax
.L23:
	leal	9(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L54
	addl	$1, %eax
.L25:
	leal	10(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L55
	addl	$1, %eax
.L27:
	leal	11(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L56
	addl	$1, %eax
.L29:
	leal	12(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L57
	addl	$1, %eax
.L31:
	leal	13(%rcx), %edi
	cmpl	%edi, %esi
	jle	.L5
	movslq	%edi, %rdi
	cmpb	$48, (%rsp,%rdi)
	je	.L58
	addl	$1, %eax
.L33:
	addl	$14, %ecx
	cmpl	%ecx, %esi
	jle	.L5
	movslq	%ecx, %rcx
	cmpb	$48, (%rsp,%rcx)
	je	.L34
	addl	$1, %eax
	.p2align 4,,10
	.p2align 3
.L5:
	cmpl	%eax, %edx
	jle	.L2
	leal	(%rax,%rax), %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
.L38:
	movq	100008(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L59
	addq	$100016, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
.L40:
	.cfi_restore_state
	xorl	%edx, %edx
.L2:
	addl	%edx, %edx
	leaq	.LC3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L38
.L46:
	addl	$1, %edx
	jmp	.L9
.L45:
	addl	$1, %edx
	jmp	.L7
.L47:
	addl	$1, %edx
	jmp	.L11
.L48:
	addl	$1, %edx
	jmp	.L13
.L54:
	addl	$1, %edx
	jmp	.L25
.L49:
	addl	$1, %edx
	jmp	.L15
.L50:
	addl	$1, %edx
	jmp	.L17
.L51:
	addl	$1, %edx
	jmp	.L19
.L52:
	addl	$1, %edx
	jmp	.L21
.L53:
	addl	$1, %edx
	jmp	.L23
.L41:
	xorl	%ecx, %ecx
	xorl	%eax, %eax
	xorl	%edx, %edx
	jmp	.L3
.L55:
	addl	$1, %edx
	jmp	.L27
.L56:
	addl	$1, %edx
	jmp	.L29
.L57:
	addl	$1, %edx
	jmp	.L31
.L58:
	addl	$1, %edx
	jmp	.L33
.L34:
	addl	$1, %edx
	jmp	.L5
.L59:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE35:
	.size	main, .-main
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC1:
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.byte	48
	.align 16
.LC2:
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	1
	.byte	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>
#include <string.h>

int main(void){

  char S[100000];
  int count0=0;
  int count1=0;
  
  scanf("%s",S);
  int len = strlen(S);
  
  for(int i=0;i<len;i++){
  	if(S[i]=='0')count0++;
    else count1++;
  }
  
  if(count0<=count1)printf("%d",count0*2);
  else{
    printf("%d",count1*2);
  }
  
  return 0;
}

1
 0010
 11011010001001
 11001010001001
 11001000001001
 1010
 01001000101000
 11011011111101
 0000
 1000

0 2 14 12 10 4 8 6 0 2
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 <string.h>

int main(void){

  char S[100000];
  int count0=0;
  int count1=0;
  
  scanf("%s",S);
  int len = strlen(S);
  
  for(int i=0;i<len;i++){
  	if(S[i]=='0')count0++;
    else count1++;
  }
  
  if(count0<=count1)printf("%d",count0*2);
  else{
    printf("%d",count1*2);
  }
  
  return 0;
}
```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.string	"%s"
.LC1:
	.string	"%d"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100032(%rbp)
	movl	$0, -100028(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100020(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L5:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L3
	addl	$1, -100032(%rbp)
	jmp	.L4
.L3:
	addl	$1, -100028(%rbp)
.L4:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100024(%rbp), %eax
	cmpl	-100020(%rbp), %eax
	jl	.L5
	movl	-100032(%rbp), %eax
	cmpl	-100028(%rbp), %eax
	jg	.L6
	movl	-100032(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-100028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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	"%s"
.LC1:
	.string	"%d"
	.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
	leaq	-98304(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$1728, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$0, -100032(%rbp)
	movl	$0, -100028(%rbp)
	leaq	-100016(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	leaq	-100016(%rbp), %rax
	movq	%rax, %rdi
	call	strlen@PLT
	movl	%eax, -100020(%rbp)
	movl	$0, -100024(%rbp)
	jmp	.L2
.L5:
	movl	-100024(%rbp), %eax
	cltq
	movzbl	-100016(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L3
	addl	$1, -100032(%rbp)
	jmp	.L4
.L3:
	addl	$1, -100028(%rbp)
.L4:
	addl	$1, -100024(%rbp)
.L2:
	movl	-100024(%rbp), %eax
	cmpl	-100020(%rbp), %eax
	jl	.L5
	movl	-100032(%rbp), %eax
	cmpl	-100028(%rbp), %eax
	jg	.L6
	movl	-100032(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L7
.L6:
	movl	-100028(%rbp), %eax
	addl	%eax, %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L7:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L9
	call	__stack_chk_fail@PLT
.L9:
	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:
