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

```c
/*
  AOJ 1518
  Title:Last One
  @kankichi573
*/
#include <stdio.h>
int conv(char c)
{
  if(isdigit(c))
    return(c-'0');
  if(isupper(c))
    return(c-'A'+10);
  if(islower(c))
    return(c-'a'+36);
}
int count_bits(int n)
{
  int ret=0;

  while(n)
    {
      ret += (n & 1);
      n >>= 1;
    }
  return(ret);
}
int count_bits_N(char * s,int radix)
{
  int ret=0;

  while(1)
    {
      ret += conv(*s);
      s++;
      if(!*s)	break;
      ret *= radix;
    }
  //printf("ret=%d\n",ret);
  return(count_bits(ret));
}
main()
{
  int n,p,i;
  char m[10];
  int cnt;
    
  scanf("%d",&n);
  for(i=0,cnt=0;i<n;i++)
    {
      scanf("%d %s",&p,m);
      cnt ^= count_bits_N(m,p);
    }
  printf("%s\n",(cnt)?"win":"lose");
  
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	conv
	.type	conv, @function
conv:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movsbl	-4(%rbp), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L2
	movsbl	-4(%rbp), %eax
	subl	$48, %eax
	jmp	.L1
.L2:
	movsbl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isupper@PLT
	testl	%eax, %eax
	je	.L4
	movsbl	-4(%rbp), %eax
	subl	$55, %eax
	jmp	.L1
.L4:
	movsbl	-4(%rbp), %eax
	movl	%eax, %edi
	call	islower@PLT
	testl	%eax, %eax
	je	.L5
	movsbl	-4(%rbp), %eax
	subl	$61, %eax
	jmp	.L1
.L5:
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	conv, .-conv
	.globl	count_bits
	.type	count_bits, @function
count_bits:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	addl	%eax, -4(%rbp)
	sarl	-20(%rbp)
.L7:
	cmpl	$0, -20(%rbp)
	jne	.L8
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	count_bits, .-count_bits
	.globl	count_bits_N
	.type	count_bits_N, @function
count_bits_N:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
.L13:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	conv
	addl	%eax, -4(%rbp)
	addq	$1, -24(%rbp)
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L16
	movl	-4(%rbp), %eax
	imull	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L13
.L16:
	nop
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	count_bits
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	count_bits_N, .-count_bits_N
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %s"
.LC2:
	.string	"win"
.LC3:
	.string	"lose"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L18
.L19:
	leaq	-18(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	leaq	-18(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	count_bits_N
	xorl	%eax, -24(%rbp)
	addl	$1, -28(%rbp)
.L18:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L19
	cmpl	$0, -24(%rbp)
	je	.L20
	leaq	.LC2(%rip), %rax
	jmp	.L21
.L20:
	leaq	.LC3(%rip), %rax
.L21:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.p2align 4
	.globl	conv
	.type	conv, @function
conv:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movsbl	%dil, %ebx
	leal	-48(%rbx), %eax
	cmpl	$9, %eax
	jbe	.L1
	movl	%ebx, %edi
	call	isupper@PLT
	testl	%eax, %eax
	jne	.L8
	movl	%ebx, %edi
	call	islower@PLT
	testl	%eax, %eax
	jne	.L9
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	leal	-55(%rbx), %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	leal	-61(%rbx), %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	conv, .-conv
	.p2align 4
	.globl	count_bits
	.type	count_bits, @function
count_bits:
.LFB24:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	testl	%edi, %edi
	je	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edi, %edx
	andl	$1, %edx
	addl	%edx, %eax
	sarl	%edi
	jne	.L12
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	ret
	.cfi_endproc
.LFE24:
	.size	count_bits, .-count_bits
	.p2align 4
	.globl	count_bits_N
	.type	count_bits_N, @function
count_bits_N:
.LFB25:
	.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
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%ebp, %edi
	call	isupper@PLT
	testl	%eax, %eax
	jne	.L29
	movl	%ebp, %edi
	subl	$61, %ebp
	call	islower@PLT
	testl	%eax, %eax
	cmovne	%ebp, %r14d
.L17:
	addq	$1, %r12
	leal	(%rbx,%r14), %eax
	cmpb	$0, (%r12)
	je	.L30
.L19:
	imull	%r13d, %eax
	movl	%eax, %ebx
.L22:
	movsbl	(%r12), %ebp
	leal	-48(%rbp), %eax
	cmpl	$9, %eax
	ja	.L16
	addq	$1, %r12
	movl	%eax, %r14d
	cmpb	$0, (%r12)
	leal	(%rbx,%r14), %eax
	jne	.L19
.L30:
	xorl	%r8d, %r8d
	testl	%eax, %eax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%eax, %edx
	andl	$1, %edx
	addl	%edx, %r8d
	sarl	%eax
	jne	.L20
.L15:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r8d, %eax
	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
.L29:
	.cfi_restore_state
	leal	-55(%rbp), %r14d
	jmp	.L17
	.cfi_endproc
.LFE25:
	.size	count_bits_N, .-count_bits_N
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"win"
.LC1:
	.string	"lose"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L41
	leaq	46(%rsp), %rax
	movl	$0, 12(%rsp)
	xorl	%r13d, %r13d
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L32:
	movq	24(%rsp), %r15
	movq	16(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rdi
	movq	%r15, %rdx
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %r12d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%r14d, %edi
	call	isupper@PLT
	testl	%eax, %eax
	jne	.L51
	movl	%r14d, %edi
	call	islower@PLT
	leal	-61(%r14), %edx
	testl	%eax, %eax
	cmovne	%edx, %ebp
.L35:
	addq	$1, %r15
	addl	%ebp, %ebx
	cmpb	$0, (%r15)
	je	.L52
.L37:
	imull	%r12d, %ebx
.L40:
	movsbl	(%r15), %r14d
	leal	-48(%r14), %eax
	cmpl	$9, %eax
	ja	.L34
	movl	%eax, %ebp
	addq	$1, %r15
	addl	%ebp, %ebx
	cmpb	$0, (%r15)
	jne	.L37
.L52:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	je	.L39
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%ebx, %edx
	andl	$1, %edx
	addl	%edx, %eax
	sarl	%ebx
	jne	.L38
	movl	12(%rsp), %edx
	xorl	%eax, %edx
.L39:
	addl	$1, %r13d
	cmpl	%r13d, 36(%rsp)
	jle	.L53
	movl	%edx, 12(%rsp)
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L51:
	leal	-55(%r14), %ebp
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L53:
	cmpl	%eax, 12(%rsp)
	je	.L41
	leaq	.LC0(%rip), %rdi
.L33:
	call	puts@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	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
.L41:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	jmp	.L33
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.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
	.file	"temp.c"
	.text
	.p2align 4
	.globl	conv
	.type	conv, @function
conv:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%rbx
	.cfi_def_cfa_offset 16
	.cfi_offset 3, -16
	movsbl	%dil, %ebx
	leal	-48(%rbx), %eax
	cmpl	$9, %eax
	jbe	.L1
	movl	%ebx, %edi
	call	isupper@PLT
	testl	%eax, %eax
	jne	.L8
	movl	%ebx, %edi
	call	islower@PLT
	testl	%eax, %eax
	jne	.L9
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L8:
	.cfi_restore_state
	leal	-55(%rbx), %eax
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	leal	-61(%rbx), %eax
	popq	%rbx
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE23:
	.size	conv, .-conv
	.p2align 4
	.globl	count_bits
	.type	count_bits, @function
count_bits:
.LFB24:
	.cfi_startproc
	endbr64
	xorl	%eax, %eax
	testl	%edi, %edi
	je	.L13
	.p2align 4,,10
	.p2align 3
.L12:
	movl	%edi, %edx
	andl	$1, %edx
	addl	%edx, %eax
	sarl	%edi
	jne	.L12
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	ret
	.cfi_endproc
.LFE24:
	.size	count_bits, .-count_bits
	.p2align 4
	.globl	count_bits_N
	.type	count_bits_N, @function
count_bits_N:
.LFB25:
	.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
	movl	%esi, %r13d
	pushq	%r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	movq	%rdi, %r12
	pushq	%rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	pushq	%rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	xorl	%ebx, %ebx
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L16:
	movl	%ebp, %edi
	call	isupper@PLT
	testl	%eax, %eax
	jne	.L29
	movl	%ebp, %edi
	subl	$61, %ebp
	call	islower@PLT
	testl	%eax, %eax
	cmovne	%ebp, %r14d
.L17:
	addq	$1, %r12
	leal	(%rbx,%r14), %eax
	cmpb	$0, (%r12)
	je	.L30
.L19:
	imull	%r13d, %eax
	movl	%eax, %ebx
.L22:
	movsbl	(%r12), %ebp
	leal	-48(%rbp), %eax
	cmpl	$9, %eax
	ja	.L16
	addq	$1, %r12
	movl	%eax, %r14d
	cmpb	$0, (%r12)
	leal	(%rbx,%r14), %eax
	jne	.L19
.L30:
	xorl	%r8d, %r8d
	testl	%eax, %eax
	je	.L15
	.p2align 4,,10
	.p2align 3
.L20:
	movl	%eax, %edx
	andl	$1, %edx
	addl	%edx, %r8d
	sarl	%eax
	jne	.L20
.L15:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	movl	%r8d, %eax
	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
.L29:
	.cfi_restore_state
	leal	-55(%rbp), %r14d
	jmp	.L17
	.cfi_endproc
.LFE25:
	.size	count_bits_N, .-count_bits_N
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"win"
.LC1:
	.string	"lose"
.LC2:
	.string	"%d"
.LC3:
	.string	"%d %s"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB26:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	leaq	.LC2(%rip), %rdi
	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
	subq	$72, %rsp
	.cfi_def_cfa_offset 128
	movq	%fs:40, %rax
	movq	%rax, 56(%rsp)
	xorl	%eax, %eax
	leaq	36(%rsp), %rsi
	call	__isoc99_scanf@PLT
	movl	36(%rsp), %eax
	testl	%eax, %eax
	jle	.L41
	leaq	46(%rsp), %rax
	movl	$0, 12(%rsp)
	xorl	%r13d, %r13d
	movq	%rax, 24(%rsp)
	leaq	40(%rsp), %rax
	movq	%rax, 16(%rsp)
	.p2align 4,,10
	.p2align 3
.L32:
	movq	24(%rsp), %r15
	movq	16(%rsp), %rsi
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	leaq	.LC3(%rip), %rdi
	movq	%r15, %rdx
	call	__isoc99_scanf@PLT
	movl	40(%rsp), %r12d
	jmp	.L40
	.p2align 4,,10
	.p2align 3
.L34:
	movl	%r14d, %edi
	call	isupper@PLT
	testl	%eax, %eax
	jne	.L51
	movl	%r14d, %edi
	call	islower@PLT
	leal	-61(%r14), %edx
	testl	%eax, %eax
	cmovne	%edx, %ebp
.L35:
	addq	$1, %r15
	addl	%ebp, %ebx
	cmpb	$0, (%r15)
	je	.L52
.L37:
	imull	%r12d, %ebx
.L40:
	movsbl	(%r15), %r14d
	leal	-48(%r14), %eax
	cmpl	$9, %eax
	ja	.L34
	movl	%eax, %ebp
	addq	$1, %r15
	addl	%ebp, %ebx
	cmpb	$0, (%r15)
	jne	.L37
.L52:
	movl	12(%rsp), %edx
	xorl	%eax, %eax
	testl	%ebx, %ebx
	je	.L39
	.p2align 4,,10
	.p2align 3
.L38:
	movl	%ebx, %edx
	andl	$1, %edx
	addl	%edx, %eax
	sarl	%ebx
	jne	.L38
	movl	12(%rsp), %edx
	xorl	%eax, %edx
.L39:
	addl	$1, %r13d
	cmpl	%r13d, 36(%rsp)
	jle	.L53
	movl	%edx, 12(%rsp)
	jmp	.L32
	.p2align 4,,10
	.p2align 3
.L51:
	leal	-55(%r14), %ebp
	jmp	.L35
	.p2align 4,,10
	.p2align 3
.L53:
	cmpl	%eax, 12(%rsp)
	je	.L41
	leaq	.LC0(%rip), %rdi
.L33:
	call	puts@PLT
	movq	56(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L54
	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
.L41:
	.cfi_restore_state
	leaq	.LC1(%rip), %rdi
	jmp	.L33
.L54:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE26:
	.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:

/*
  AOJ 1518
  Title:Last One
  @kankichi573
*/
#include <stdio.h>
int conv(char c)
{
  if(isdigit(c))
    return(c-'0');
  if(isupper(c))
    return(c-'A'+10);
  if(islower(c))
    return(c-'a'+36);
}
int count_bits(int n)
{
  int ret=0;

  while(n)
    {
      ret += (n & 1);
      n >>= 1;
    }
  return(ret);
}
int count_bits_N(char * s,int radix)
{
  int ret=0;

  while(1)
    {
      ret += conv(*s);
      s++;
      if(!*s)	break;
      ret *= radix;
    }
  //printf("ret=%d\n",ret);
  return(count_bits(ret));
}
main()
{
  int n,p,i;
  char m[10];
  int cnt;
    
  scanf("%d",&n);
  for(i=0,cnt=0;i<n;i++)
    {
      scanf("%d %s",&p,m);
      cnt ^= count_bits_N(m,p);
    }
  printf("%s\n",(cnt)?"win":"lose");
  
  return(0);
}
1
18 1
 2
5 1
10 1
 3
25 52AI
43 3BI0
62 pn6
 1
28 1
 3
25 52AI
45 3BI0
62 pn6
 1
54 1
 3
25 52AI
45 3AI0
62 pn6
 3
25 52AI
45 3AI0
55 pn6
 3
25 52AI
45 3AI0
55 pm6
 3
25 52AI
42 3AI0
55 pm6

win
 lose
 win
 win
 win
 win
 win
 win
 win
 win

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

```c
/*
  AOJ 1518
  Title:Last One
  @kankichi573
*/
#include <stdio.h>
int conv(char c)
{
  if(isdigit(c))
    return(c-'0');
  if(isupper(c))
    return(c-'A'+10);
  if(islower(c))
    return(c-'a'+36);
}
int count_bits(int n)
{
  int ret=0;

  while(n)
    {
      ret += (n & 1);
      n >>= 1;
    }
  return(ret);
}
int count_bits_N(char * s,int radix)
{
  int ret=0;

  while(1)
    {
      ret += conv(*s);
      s++;
      if(!*s)	break;
      ret *= radix;
    }
  //printf("ret=%d\n",ret);
  return(count_bits(ret));
}
main()
{
  int n,p,i;
  char m[10];
  int cnt;
    
  scanf("%d",&n);
  for(i=0,cnt=0;i<n;i++)
    {
      scanf("%d %s",&p,m);
      cnt ^= count_bits_N(m,p);
    }
  printf("%s\n",(cnt)?"win":"lose");
  
  return(0);
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	conv
	.type	conv, @function
conv:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movsbl	-4(%rbp), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L2
	movsbl	-4(%rbp), %eax
	subl	$48, %eax
	jmp	.L1
.L2:
	movsbl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isupper@PLT
	testl	%eax, %eax
	je	.L4
	movsbl	-4(%rbp), %eax
	subl	$55, %eax
	jmp	.L1
.L4:
	movsbl	-4(%rbp), %eax
	movl	%eax, %edi
	call	islower@PLT
	testl	%eax, %eax
	je	.L5
	movsbl	-4(%rbp), %eax
	subl	$61, %eax
	jmp	.L1
.L5:
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	conv, .-conv
	.globl	count_bits
	.type	count_bits, @function
count_bits:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	addl	%eax, -4(%rbp)
	sarl	-20(%rbp)
.L7:
	cmpl	$0, -20(%rbp)
	jne	.L8
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	count_bits, .-count_bits
	.globl	count_bits_N
	.type	count_bits_N, @function
count_bits_N:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
.L13:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	conv
	addl	%eax, -4(%rbp)
	addq	$1, -24(%rbp)
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L16
	movl	-4(%rbp), %eax
	imull	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L13
.L16:
	nop
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	count_bits
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	count_bits_N, .-count_bits_N
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %s"
.LC2:
	.string	"win"
.LC3:
	.string	"lose"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L18
.L19:
	leaq	-18(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	leaq	-18(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	count_bits_N
	xorl	%eax, -24(%rbp)
	addl	$1, -28(%rbp)
.L18:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L19
	cmpl	$0, -24(%rbp)
	je	.L20
	leaq	.LC2(%rip), %rax
	jmp	.L21
.L20:
	leaq	.LC3(%rip), %rax
.L21:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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
	.globl	conv
	.type	conv, @function
conv:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$16, %rsp
	movl	%edi, %eax
	movb	%al, -4(%rbp)
	movsbl	-4(%rbp), %eax
	subl	$48, %eax
	cmpl	$9, %eax
	ja	.L2
	movsbl	-4(%rbp), %eax
	subl	$48, %eax
	jmp	.L1
.L2:
	movsbl	-4(%rbp), %eax
	movl	%eax, %edi
	call	isupper@PLT
	testl	%eax, %eax
	je	.L4
	movsbl	-4(%rbp), %eax
	subl	$55, %eax
	jmp	.L1
.L4:
	movsbl	-4(%rbp), %eax
	movl	%eax, %edi
	call	islower@PLT
	testl	%eax, %eax
	je	.L5
	movsbl	-4(%rbp), %eax
	subl	$61, %eax
	jmp	.L1
.L5:
.L1:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	conv, .-conv
	.globl	count_bits
	.type	count_bits, @function
count_bits:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movl	%edi, -20(%rbp)
	movl	$0, -4(%rbp)
	jmp	.L7
.L8:
	movl	-20(%rbp), %eax
	andl	$1, %eax
	addl	%eax, -4(%rbp)
	sarl	-20(%rbp)
.L7:
	cmpl	$0, -20(%rbp)
	jne	.L8
	movl	-4(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	count_bits, .-count_bits
	.globl	count_bits_N
	.type	count_bits_N, @function
count_bits_N:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$32, %rsp
	movq	%rdi, -24(%rbp)
	movl	%esi, -28(%rbp)
	movl	$0, -4(%rbp)
.L13:
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	movsbl	%al, %eax
	movl	%eax, %edi
	call	conv
	addl	%eax, -4(%rbp)
	addq	$1, -24(%rbp)
	movq	-24(%rbp), %rax
	movzbl	(%rax), %eax
	testb	%al, %al
	je	.L16
	movl	-4(%rbp), %eax
	imull	-28(%rbp), %eax
	movl	%eax, -4(%rbp)
	jmp	.L13
.L16:
	nop
	movl	-4(%rbp), %eax
	movl	%eax, %edi
	call	count_bits
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.size	count_bits_N, .-count_bits_N
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d %s"
.LC2:
	.string	"win"
.LC3:
	.string	"lose"
	.text
	.globl	main
	.type	main, @function
main:
.LFB3:
	.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
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L18
.L19:
	leaq	-18(%rbp), %rdx
	leaq	-32(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	movl	-32(%rbp), %edx
	leaq	-18(%rbp), %rax
	movl	%edx, %esi
	movq	%rax, %rdi
	call	count_bits_N
	xorl	%eax, -24(%rbp)
	addl	$1, -28(%rbp)
.L18:
	movl	-36(%rbp), %eax
	cmpl	%eax, -28(%rbp)
	jl	.L19
	cmpl	$0, -24(%rbp)
	je	.L20
	leaq	.LC2(%rip), %rax
	jmp	.L21
.L20:
	leaq	.LC3(%rip), %rax
.L21:
	movq	%rax, %rdi
	call	puts@PLT
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L23
	call	__stack_chk_fail@PLT
.L23:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE3:
	.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:
