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

```c
int check[30];

int main() {

  for (int bit = 29; bit >= 0; bit--) {
    check[bit] = 0;
  }

  int n;
  scanf("%d", &n);
  int xor_sum = 0;
  int a;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    xor_sum ^= a;
    a = a ^ (a - 1);

    switch (a) {
    case 1073741823:
      check[29] = 1;
      break;
    case 536870911:
      check[28] = 1;
      break;
    case 268435455:
      check[27] = 1;
      break;
    case 134217727:
      check[26] = 1;
      break;
    case 67108863:
      check[25] = 1;
      break;
    case 33554431:
      check[24] = 1;
      break;
    case 16777215:
      check[23] = 1;
      break;
    case 8388607:
      check[22] = 1;
      break;
    case 4194303:
      check[21] = 1;
      break;
    case 2097151:
      check[20] = 1;
      break;
    case 1048575:
      check[19] = 1;
      break;
    case 524287:
      check[18] = 1;
      break;
    case 262143:
      check[17] = 1;
      break;
    case 131071:
      check[16] = 1;
      break;
    case 65535:
      check[15] = 1;
      break;
    case 32767:
      check[14] = 1;
      break;
    case 16383:
      check[13] = 1;
      break;
    case 8191:
      check[12] = 1;
      break;
    case 4095:
      check[11] = 1;
      break;
    case 2047:
      check[10] = 1;
      break;
    case 1023:
      check[9] = 1;
      break;
    case 511:
      check[8] = 1;
      break;
    case 255:
      check[7] = 1;
      break;
    case 127:
      check[6] = 1;
      break;
    case 63:
      check[5] = 1;
      break;
    case 31:
      check[4] = 1;
      break;
    case 15:
      check[3] = 1;
      break;
    case 7:
      check[2] = 1;
      break;
    case 3:
      check[1] = 1;
      break;
    case 1:
      check[0] = 1;
      break;
    }
  }

  int ans = 0;
  for (int bit = 29; bit >= 0; bit--) {
    if (((1 << bit) & xor_sum) == 0) {
      continue;
    }
    int x = (1 << (bit + 1)) - 1;

    if (check[bit] > 0) {
      xor_sum ^= x;
      ans += 1;
    }
  }

  if (xor_sum != 0) {
    printf("-1\n");
  } else {
    printf("%d\n", ans);
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check
	.bss
	.align 32
	.type	check, @object
	.size	check, 120
check:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$29, -32(%rbp)
	jmp	.L2
.L3:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	check(%rip), %rax
	movl	$0, (%rdx,%rax)
	subl	$1, -32(%rbp)
.L2:
	cmpl	$0, -32(%rbp)
	jns	.L3
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L4
.L38:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-36(%rbp), %eax
	xorl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	xorl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cmpl	$1073741823, %eax
	je	.L5
	cmpl	$1073741823, %eax
	jg	.L6
	cmpl	$536870911, %eax
	je	.L7
	cmpl	$536870911, %eax
	jg	.L6
	cmpl	$268435455, %eax
	je	.L8
	cmpl	$268435455, %eax
	jg	.L6
	cmpl	$134217727, %eax
	je	.L9
	cmpl	$134217727, %eax
	jg	.L6
	cmpl	$67108863, %eax
	je	.L10
	cmpl	$67108863, %eax
	jg	.L6
	cmpl	$33554431, %eax
	je	.L11
	cmpl	$33554431, %eax
	jg	.L6
	cmpl	$16777215, %eax
	je	.L12
	cmpl	$16777215, %eax
	jg	.L6
	cmpl	$8388607, %eax
	je	.L13
	cmpl	$8388607, %eax
	jg	.L6
	cmpl	$4194303, %eax
	je	.L14
	cmpl	$4194303, %eax
	jg	.L6
	cmpl	$2097151, %eax
	je	.L15
	cmpl	$2097151, %eax
	jg	.L6
	cmpl	$1048575, %eax
	je	.L16
	cmpl	$1048575, %eax
	jg	.L6
	cmpl	$524287, %eax
	je	.L17
	cmpl	$524287, %eax
	jg	.L6
	cmpl	$262143, %eax
	je	.L18
	cmpl	$262143, %eax
	jg	.L6
	cmpl	$131071, %eax
	je	.L19
	cmpl	$131071, %eax
	jg	.L6
	cmpl	$65535, %eax
	je	.L20
	cmpl	$65535, %eax
	jg	.L6
	cmpl	$32767, %eax
	je	.L21
	cmpl	$32767, %eax
	jg	.L6
	cmpl	$16383, %eax
	je	.L22
	cmpl	$16383, %eax
	jg	.L6
	cmpl	$8191, %eax
	je	.L23
	cmpl	$8191, %eax
	jg	.L6
	cmpl	$4095, %eax
	je	.L24
	cmpl	$4095, %eax
	jg	.L6
	cmpl	$2047, %eax
	je	.L25
	cmpl	$2047, %eax
	jg	.L6
	cmpl	$1023, %eax
	je	.L26
	cmpl	$1023, %eax
	jg	.L6
	cmpl	$511, %eax
	je	.L27
	cmpl	$511, %eax
	jg	.L6
	cmpl	$255, %eax
	je	.L28
	cmpl	$255, %eax
	jg	.L6
	cmpl	$127, %eax
	je	.L29
	cmpl	$127, %eax
	jg	.L6
	cmpl	$31, %eax
	jg	.L30
	testl	%eax, %eax
	jle	.L6
	cmpl	$31, %eax
	ja	.L6
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L32(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L32(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L32:
	.long	.L6-.L32
	.long	.L36-.L32
	.long	.L6-.L32
	.long	.L35-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L34-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L33-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L31-.L32
	.text
.L30:
	cmpl	$63, %eax
	je	.L37
	jmp	.L6
.L5:
	movl	$1, 116+check(%rip)
	jmp	.L6
.L7:
	movl	$1, 112+check(%rip)
	jmp	.L6
.L8:
	movl	$1, 108+check(%rip)
	jmp	.L6
.L9:
	movl	$1, 104+check(%rip)
	jmp	.L6
.L10:
	movl	$1, 100+check(%rip)
	jmp	.L6
.L11:
	movl	$1, 96+check(%rip)
	jmp	.L6
.L12:
	movl	$1, 92+check(%rip)
	jmp	.L6
.L13:
	movl	$1, 88+check(%rip)
	jmp	.L6
.L14:
	movl	$1, 84+check(%rip)
	jmp	.L6
.L15:
	movl	$1, 80+check(%rip)
	jmp	.L6
.L16:
	movl	$1, 76+check(%rip)
	jmp	.L6
.L17:
	movl	$1, 72+check(%rip)
	jmp	.L6
.L18:
	movl	$1, 68+check(%rip)
	jmp	.L6
.L19:
	movl	$1, 64+check(%rip)
	jmp	.L6
.L20:
	movl	$1, 60+check(%rip)
	jmp	.L6
.L21:
	movl	$1, 56+check(%rip)
	jmp	.L6
.L22:
	movl	$1, 52+check(%rip)
	jmp	.L6
.L23:
	movl	$1, 48+check(%rip)
	jmp	.L6
.L24:
	movl	$1, 44+check(%rip)
	jmp	.L6
.L25:
	movl	$1, 40+check(%rip)
	jmp	.L6
.L26:
	movl	$1, 36+check(%rip)
	jmp	.L6
.L27:
	movl	$1, 32+check(%rip)
	jmp	.L6
.L28:
	movl	$1, 28+check(%rip)
	jmp	.L6
.L29:
	movl	$1, 24+check(%rip)
	jmp	.L6
.L37:
	movl	$1, 20+check(%rip)
	jmp	.L6
.L31:
	movl	$1, 16+check(%rip)
	jmp	.L6
.L33:
	movl	$1, 12+check(%rip)
	jmp	.L6
.L34:
	movl	$1, 8+check(%rip)
	jmp	.L6
.L35:
	movl	$1, 4+check(%rip)
	jmp	.L6
.L36:
	movl	$1, check(%rip)
	nop
.L6:
	addl	$1, -24(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L38
	movl	$0, -20(%rbp)
	movl	$29, -16(%rbp)
	jmp	.L39
.L42:
	movl	-16(%rbp), %eax
	movl	-28(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L47
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	check(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L41
	movl	-12(%rbp), %eax
	xorl	%eax, -28(%rbp)
	addl	$1, -20(%rbp)
	jmp	.L41
.L47:
	nop
.L41:
	subl	$1, -16(%rbp)
.L39:
	cmpl	$0, -16(%rbp)
	jns	.L42
	cmpl	$0, -28(%rbp)
	je	.L43
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L44
.L43:
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L44:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	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	"%d"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$15, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	check(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	rep stosq
	movq	%rbp, %rdi
	call	scanf@PLT
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L47
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	leaq	4(%rsp), %r12
	leaq	.L10(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	4(%rsp), %edx
	leal	-1(%rdx), %eax
	xorl	%edx, %r13d
	xorl	%edx, %eax
	movl	%eax, 4(%rsp)
	cmpl	$65535, %eax
	je	.L3
	jg	.L4
	cmpl	$255, %eax
	je	.L5
	jle	.L55
	cmpl	$4095, %eax
	je	.L17
	jle	.L56
	cmpl	$16383, %eax
	je	.L22
	cmpl	$32767, %eax
	jne	.L57
	movl	$1, 56+check(%rip)
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %r15d
	cmpl	%r15d, (%rsp)
	jg	.L41
.L2:
	movl	$29, %eax
	xorl	%esi, %esi
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L43:
	btl	%eax, %r13d
	movl	%eax, %ecx
	jnc	.L42
	movl	(%r14,%rax,4), %edx
	testl	%edx, %edx
	jle	.L42
	addl	$1, %ecx
	movl	%edi, %edx
	addl	$1, %esi
	sall	%cl, %edx
	subl	$1, %edx
	xorl	%edx, %r13d
.L42:
	subq	$1, %rax
	jnb	.L43
	testl	%r13d, %r13d
	jne	.L58
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L45:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L59
	addq	$24, %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
.L57:
	.cfi_restore_state
	cmpl	$8191, %eax
	jne	.L8
	movl	$1, 48+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L56:
	cmpl	$1023, %eax
	je	.L19
	cmpl	$2047, %eax
	jne	.L60
	movl	$1, 40+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L55:
	cmpl	$31, %eax
	jg	.L7
	testl	%eax, %eax
	jle	.L8
	cmpl	$31, %eax
	ja	.L8
	movslq	(%rbx,%rax,4), %rax
	addq	%rbx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L10:
	.long	.L8-.L10
	.long	.L14-.L10
	.long	.L8-.L10
	.long	.L13-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L12-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L11-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L9-.L10
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L4:
	cmpl	$16777215, %eax
	je	.L25
	jg	.L26
	cmpl	$1048575, %eax
	je	.L27
	jle	.L61
	cmpl	$4194303, %eax
	je	.L32
	cmpl	$8388607, %eax
	jne	.L62
	movl	$1, 88+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L60:
	cmpl	$511, %eax
	jne	.L8
	movl	$1, 32+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	cmpl	$63, %eax
	je	.L15
	cmpl	$127, %eax
	jne	.L8
	movl	$1, 24+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	$2097151, %eax
	jne	.L8
	movl	$1, 80+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L61:
	cmpl	$262143, %eax
	je	.L29
	cmpl	$524287, %eax
	jne	.L63
	movl	$1, 72+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L26:
	cmpl	$268435455, %eax
	je	.L35
	jle	.L64
	cmpl	$536870911, %eax
	je	.L40
	cmpl	$1073741823, %eax
	jne	.L8
	movl	$1, 116+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L63:
	cmpl	$131071, %eax
	jne	.L8
	movl	$1, 64+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L64:
	cmpl	$67108863, %eax
	je	.L37
	cmpl	$134217727, %eax
	jne	.L65
	movl	$1, 104+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L65:
	cmpl	$33554431, %eax
	jne	.L8
	movl	$1, 96+check(%rip)
	jmp	.L8
.L58:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L45
.L9:
	movl	$1, 16+check(%rip)
	jmp	.L8
.L11:
	movl	$1, 12+check(%rip)
	jmp	.L8
.L12:
	movl	$1, 8+check(%rip)
	jmp	.L8
.L13:
	movl	$1, 4+check(%rip)
	jmp	.L8
.L14:
	movl	$1, check(%rip)
	jmp	.L8
.L22:
	movl	$1, 52+check(%rip)
	jmp	.L8
.L19:
	movl	$1, 36+check(%rip)
	jmp	.L8
.L17:
	movl	$1, 44+check(%rip)
	jmp	.L8
.L5:
	movl	$1, 28+check(%rip)
	jmp	.L8
.L27:
	movl	$1, 76+check(%rip)
	jmp	.L8
.L25:
	movl	$1, 92+check(%rip)
	jmp	.L8
.L3:
	movl	$1, 60+check(%rip)
	jmp	.L8
.L40:
	movl	$1, 112+check(%rip)
	jmp	.L8
.L15:
	movl	$1, 20+check(%rip)
	jmp	.L8
.L37:
	movl	$1, 100+check(%rip)
	jmp	.L8
.L35:
	movl	$1, 108+check(%rip)
	jmp	.L8
.L29:
	movl	$1, 68+check(%rip)
	jmp	.L8
.L32:
	movl	$1, 84+check(%rip)
	jmp	.L8
.L47:
	xorl	%r13d, %r13d
	jmp	.L2
.L59:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	check
	.bss
	.align 32
	.type	check, @object
	.size	check, 120
check:
	.zero	120
	.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	"%d"
.LC1:
	.string	"-1"
.LC2:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movl	$15, %ecx
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	leaq	check(%rip), %r14
	pushq	%r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	movq	%r14, %rdi
	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	$24, %rsp
	.cfi_def_cfa_offset 80
	movq	%fs:40, %rax
	movq	%rax, 8(%rsp)
	xorl	%eax, %eax
	movq	%rsp, %rsi
	rep stosq
	movq	%rbp, %rdi
	call	scanf@PLT
	movl	(%rsp), %ecx
	testl	%ecx, %ecx
	jle	.L47
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	leaq	4(%rsp), %r12
	leaq	.L10(%rip), %rbx
	.p2align 4,,10
	.p2align 3
.L41:
	movq	%r12, %rsi
	movq	%rbp, %rdi
	xorl	%eax, %eax
	call	scanf@PLT
	movl	4(%rsp), %edx
	leal	-1(%rdx), %eax
	xorl	%edx, %r13d
	xorl	%edx, %eax
	movl	%eax, 4(%rsp)
	cmpl	$65535, %eax
	je	.L3
	jg	.L4
	cmpl	$255, %eax
	je	.L5
	jle	.L55
	cmpl	$4095, %eax
	je	.L17
	jle	.L56
	cmpl	$16383, %eax
	je	.L22
	cmpl	$32767, %eax
	jne	.L57
	movl	$1, 56+check(%rip)
	.p2align 4,,10
	.p2align 3
.L8:
	addl	$1, %r15d
	cmpl	%r15d, (%rsp)
	jg	.L41
.L2:
	movl	$29, %eax
	xorl	%esi, %esi
	movl	$1, %edi
	.p2align 4,,10
	.p2align 3
.L43:
	btl	%eax, %r13d
	movl	%eax, %ecx
	jnc	.L42
	movl	(%r14,%rax,4), %edx
	testl	%edx, %edx
	jle	.L42
	addl	$1, %ecx
	movl	%edi, %edx
	addl	$1, %esi
	sall	%cl, %edx
	subl	$1, %edx
	xorl	%edx, %r13d
.L42:
	subq	$1, %rax
	jnb	.L43
	testl	%r13d, %r13d
	jne	.L58
	leaq	.LC2(%rip), %rdi
	xorl	%eax, %eax
	call	printf@PLT
.L45:
	movq	8(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L59
	addq	$24, %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
.L57:
	.cfi_restore_state
	cmpl	$8191, %eax
	jne	.L8
	movl	$1, 48+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L56:
	cmpl	$1023, %eax
	je	.L19
	cmpl	$2047, %eax
	jne	.L60
	movl	$1, 40+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L55:
	cmpl	$31, %eax
	jg	.L7
	testl	%eax, %eax
	jle	.L8
	cmpl	$31, %eax
	ja	.L8
	movslq	(%rbx,%rax,4), %rax
	addq	%rbx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L10:
	.long	.L8-.L10
	.long	.L14-.L10
	.long	.L8-.L10
	.long	.L13-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L12-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L11-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L8-.L10
	.long	.L9-.L10
	.section	.text.startup
	.p2align 4,,10
	.p2align 3
.L4:
	cmpl	$16777215, %eax
	je	.L25
	jg	.L26
	cmpl	$1048575, %eax
	je	.L27
	jle	.L61
	cmpl	$4194303, %eax
	je	.L32
	cmpl	$8388607, %eax
	jne	.L62
	movl	$1, 88+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L60:
	cmpl	$511, %eax
	jne	.L8
	movl	$1, 32+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L7:
	cmpl	$63, %eax
	je	.L15
	cmpl	$127, %eax
	jne	.L8
	movl	$1, 24+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L62:
	cmpl	$2097151, %eax
	jne	.L8
	movl	$1, 80+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L61:
	cmpl	$262143, %eax
	je	.L29
	cmpl	$524287, %eax
	jne	.L63
	movl	$1, 72+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L26:
	cmpl	$268435455, %eax
	je	.L35
	jle	.L64
	cmpl	$536870911, %eax
	je	.L40
	cmpl	$1073741823, %eax
	jne	.L8
	movl	$1, 116+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L63:
	cmpl	$131071, %eax
	jne	.L8
	movl	$1, 64+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L64:
	cmpl	$67108863, %eax
	je	.L37
	cmpl	$134217727, %eax
	jne	.L65
	movl	$1, 104+check(%rip)
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L65:
	cmpl	$33554431, %eax
	jne	.L8
	movl	$1, 96+check(%rip)
	jmp	.L8
.L58:
	leaq	.LC1(%rip), %rdi
	call	puts@PLT
	jmp	.L45
.L9:
	movl	$1, 16+check(%rip)
	jmp	.L8
.L11:
	movl	$1, 12+check(%rip)
	jmp	.L8
.L12:
	movl	$1, 8+check(%rip)
	jmp	.L8
.L13:
	movl	$1, 4+check(%rip)
	jmp	.L8
.L14:
	movl	$1, check(%rip)
	jmp	.L8
.L22:
	movl	$1, 52+check(%rip)
	jmp	.L8
.L19:
	movl	$1, 36+check(%rip)
	jmp	.L8
.L17:
	movl	$1, 44+check(%rip)
	jmp	.L8
.L5:
	movl	$1, 28+check(%rip)
	jmp	.L8
.L27:
	movl	$1, 76+check(%rip)
	jmp	.L8
.L25:
	movl	$1, 92+check(%rip)
	jmp	.L8
.L3:
	movl	$1, 60+check(%rip)
	jmp	.L8
.L40:
	movl	$1, 112+check(%rip)
	jmp	.L8
.L15:
	movl	$1, 20+check(%rip)
	jmp	.L8
.L37:
	movl	$1, 100+check(%rip)
	jmp	.L8
.L35:
	movl	$1, 108+check(%rip)
	jmp	.L8
.L29:
	movl	$1, 68+check(%rip)
	jmp	.L8
.L32:
	movl	$1, 84+check(%rip)
	jmp	.L8
.L47:
	xorl	%r13d, %r13d
	jmp	.L2
.L59:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	check
	.bss
	.align 32
	.type	check, @object
	.size	check, 120
check:
	.zero	120
	.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:

int check[30];

int main() {

  for (int bit = 29; bit >= 0; bit--) {
    check[bit] = 0;
  }

  int n;
  scanf("%d", &n);
  int xor_sum = 0;
  int a;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    xor_sum ^= a;
    a = a ^ (a - 1);

    switch (a) {
    case 1073741823:
      check[29] = 1;
      break;
    case 536870911:
      check[28] = 1;
      break;
    case 268435455:
      check[27] = 1;
      break;
    case 134217727:
      check[26] = 1;
      break;
    case 67108863:
      check[25] = 1;
      break;
    case 33554431:
      check[24] = 1;
      break;
    case 16777215:
      check[23] = 1;
      break;
    case 8388607:
      check[22] = 1;
      break;
    case 4194303:
      check[21] = 1;
      break;
    case 2097151:
      check[20] = 1;
      break;
    case 1048575:
      check[19] = 1;
      break;
    case 524287:
      check[18] = 1;
      break;
    case 262143:
      check[17] = 1;
      break;
    case 131071:
      check[16] = 1;
      break;
    case 65535:
      check[15] = 1;
      break;
    case 32767:
      check[14] = 1;
      break;
    case 16383:
      check[13] = 1;
      break;
    case 8191:
      check[12] = 1;
      break;
    case 4095:
      check[11] = 1;
      break;
    case 2047:
      check[10] = 1;
      break;
    case 1023:
      check[9] = 1;
      break;
    case 511:
      check[8] = 1;
      break;
    case 255:
      check[7] = 1;
      break;
    case 127:
      check[6] = 1;
      break;
    case 63:
      check[5] = 1;
      break;
    case 31:
      check[4] = 1;
      break;
    case 15:
      check[3] = 1;
      break;
    case 7:
      check[2] = 1;
      break;
    case 3:
      check[1] = 1;
      break;
    case 1:
      check[0] = 1;
      break;
    }
  }

  int ans = 0;
  for (int bit = 29; bit >= 0; bit--) {
    if (((1 << bit) & xor_sum) == 0) {
      continue;
    }
    int x = (1 << (bit + 1)) - 1;

    if (check[bit] > 0) {
      xor_sum ^= x;
      ans += 1;
    }
  }

  if (xor_sum != 0) {
    printf("-1\n");
  } else {
    printf("%d\n", ans);
  }
}
3
2
3
4

3

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

```c
int check[30];

int main() {

  for (int bit = 29; bit >= 0; bit--) {
    check[bit] = 0;
  }

  int n;
  scanf("%d", &n);
  int xor_sum = 0;
  int a;
  for (int i = 0; i < n; i++) {
    scanf("%d", &a);
    xor_sum ^= a;
    a = a ^ (a - 1);

    switch (a) {
    case 1073741823:
      check[29] = 1;
      break;
    case 536870911:
      check[28] = 1;
      break;
    case 268435455:
      check[27] = 1;
      break;
    case 134217727:
      check[26] = 1;
      break;
    case 67108863:
      check[25] = 1;
      break;
    case 33554431:
      check[24] = 1;
      break;
    case 16777215:
      check[23] = 1;
      break;
    case 8388607:
      check[22] = 1;
      break;
    case 4194303:
      check[21] = 1;
      break;
    case 2097151:
      check[20] = 1;
      break;
    case 1048575:
      check[19] = 1;
      break;
    case 524287:
      check[18] = 1;
      break;
    case 262143:
      check[17] = 1;
      break;
    case 131071:
      check[16] = 1;
      break;
    case 65535:
      check[15] = 1;
      break;
    case 32767:
      check[14] = 1;
      break;
    case 16383:
      check[13] = 1;
      break;
    case 8191:
      check[12] = 1;
      break;
    case 4095:
      check[11] = 1;
      break;
    case 2047:
      check[10] = 1;
      break;
    case 1023:
      check[9] = 1;
      break;
    case 511:
      check[8] = 1;
      break;
    case 255:
      check[7] = 1;
      break;
    case 127:
      check[6] = 1;
      break;
    case 63:
      check[5] = 1;
      break;
    case 31:
      check[4] = 1;
      break;
    case 15:
      check[3] = 1;
      break;
    case 7:
      check[2] = 1;
      break;
    case 3:
      check[1] = 1;
      break;
    case 1:
      check[0] = 1;
      break;
    }
  }

  int ans = 0;
  for (int bit = 29; bit >= 0; bit--) {
    if (((1 << bit) & xor_sum) == 0) {
      continue;
    }
    int x = (1 << (bit + 1)) - 1;

    if (check[bit] > 0) {
      xor_sum ^= x;
      ans += 1;
    }
  }

  if (xor_sum != 0) {
    printf("-1\n");
  } else {
    printf("%d\n", ans);
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	check
	.bss
	.align 32
	.type	check, @object
	.size	check, 120
check:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$29, -32(%rbp)
	jmp	.L2
.L3:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	check(%rip), %rax
	movl	$0, (%rdx,%rax)
	subl	$1, -32(%rbp)
.L2:
	cmpl	$0, -32(%rbp)
	jns	.L3
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L4
.L38:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-36(%rbp), %eax
	xorl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	xorl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cmpl	$1073741823, %eax
	je	.L5
	cmpl	$1073741823, %eax
	jg	.L6
	cmpl	$536870911, %eax
	je	.L7
	cmpl	$536870911, %eax
	jg	.L6
	cmpl	$268435455, %eax
	je	.L8
	cmpl	$268435455, %eax
	jg	.L6
	cmpl	$134217727, %eax
	je	.L9
	cmpl	$134217727, %eax
	jg	.L6
	cmpl	$67108863, %eax
	je	.L10
	cmpl	$67108863, %eax
	jg	.L6
	cmpl	$33554431, %eax
	je	.L11
	cmpl	$33554431, %eax
	jg	.L6
	cmpl	$16777215, %eax
	je	.L12
	cmpl	$16777215, %eax
	jg	.L6
	cmpl	$8388607, %eax
	je	.L13
	cmpl	$8388607, %eax
	jg	.L6
	cmpl	$4194303, %eax
	je	.L14
	cmpl	$4194303, %eax
	jg	.L6
	cmpl	$2097151, %eax
	je	.L15
	cmpl	$2097151, %eax
	jg	.L6
	cmpl	$1048575, %eax
	je	.L16
	cmpl	$1048575, %eax
	jg	.L6
	cmpl	$524287, %eax
	je	.L17
	cmpl	$524287, %eax
	jg	.L6
	cmpl	$262143, %eax
	je	.L18
	cmpl	$262143, %eax
	jg	.L6
	cmpl	$131071, %eax
	je	.L19
	cmpl	$131071, %eax
	jg	.L6
	cmpl	$65535, %eax
	je	.L20
	cmpl	$65535, %eax
	jg	.L6
	cmpl	$32767, %eax
	je	.L21
	cmpl	$32767, %eax
	jg	.L6
	cmpl	$16383, %eax
	je	.L22
	cmpl	$16383, %eax
	jg	.L6
	cmpl	$8191, %eax
	je	.L23
	cmpl	$8191, %eax
	jg	.L6
	cmpl	$4095, %eax
	je	.L24
	cmpl	$4095, %eax
	jg	.L6
	cmpl	$2047, %eax
	je	.L25
	cmpl	$2047, %eax
	jg	.L6
	cmpl	$1023, %eax
	je	.L26
	cmpl	$1023, %eax
	jg	.L6
	cmpl	$511, %eax
	je	.L27
	cmpl	$511, %eax
	jg	.L6
	cmpl	$255, %eax
	je	.L28
	cmpl	$255, %eax
	jg	.L6
	cmpl	$127, %eax
	je	.L29
	cmpl	$127, %eax
	jg	.L6
	cmpl	$31, %eax
	jg	.L30
	testl	%eax, %eax
	jle	.L6
	cmpl	$31, %eax
	ja	.L6
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L32(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L32(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L32:
	.long	.L6-.L32
	.long	.L36-.L32
	.long	.L6-.L32
	.long	.L35-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L34-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L33-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L31-.L32
	.text
.L30:
	cmpl	$63, %eax
	je	.L37
	jmp	.L6
.L5:
	movl	$1, 116+check(%rip)
	jmp	.L6
.L7:
	movl	$1, 112+check(%rip)
	jmp	.L6
.L8:
	movl	$1, 108+check(%rip)
	jmp	.L6
.L9:
	movl	$1, 104+check(%rip)
	jmp	.L6
.L10:
	movl	$1, 100+check(%rip)
	jmp	.L6
.L11:
	movl	$1, 96+check(%rip)
	jmp	.L6
.L12:
	movl	$1, 92+check(%rip)
	jmp	.L6
.L13:
	movl	$1, 88+check(%rip)
	jmp	.L6
.L14:
	movl	$1, 84+check(%rip)
	jmp	.L6
.L15:
	movl	$1, 80+check(%rip)
	jmp	.L6
.L16:
	movl	$1, 76+check(%rip)
	jmp	.L6
.L17:
	movl	$1, 72+check(%rip)
	jmp	.L6
.L18:
	movl	$1, 68+check(%rip)
	jmp	.L6
.L19:
	movl	$1, 64+check(%rip)
	jmp	.L6
.L20:
	movl	$1, 60+check(%rip)
	jmp	.L6
.L21:
	movl	$1, 56+check(%rip)
	jmp	.L6
.L22:
	movl	$1, 52+check(%rip)
	jmp	.L6
.L23:
	movl	$1, 48+check(%rip)
	jmp	.L6
.L24:
	movl	$1, 44+check(%rip)
	jmp	.L6
.L25:
	movl	$1, 40+check(%rip)
	jmp	.L6
.L26:
	movl	$1, 36+check(%rip)
	jmp	.L6
.L27:
	movl	$1, 32+check(%rip)
	jmp	.L6
.L28:
	movl	$1, 28+check(%rip)
	jmp	.L6
.L29:
	movl	$1, 24+check(%rip)
	jmp	.L6
.L37:
	movl	$1, 20+check(%rip)
	jmp	.L6
.L31:
	movl	$1, 16+check(%rip)
	jmp	.L6
.L33:
	movl	$1, 12+check(%rip)
	jmp	.L6
.L34:
	movl	$1, 8+check(%rip)
	jmp	.L6
.L35:
	movl	$1, 4+check(%rip)
	jmp	.L6
.L36:
	movl	$1, check(%rip)
	nop
.L6:
	addl	$1, -24(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L38
	movl	$0, -20(%rbp)
	movl	$29, -16(%rbp)
	jmp	.L39
.L42:
	movl	-16(%rbp), %eax
	movl	-28(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L47
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	check(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L41
	movl	-12(%rbp), %eax
	xorl	%eax, -28(%rbp)
	addl	$1, -20(%rbp)
	jmp	.L41
.L47:
	nop
.L41:
	subl	$1, -16(%rbp)
.L39:
	cmpl	$0, -16(%rbp)
	jns	.L42
	cmpl	$0, -28(%rbp)
	je	.L43
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L44
.L43:
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L44:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	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
	.globl	check
	.bss
	.align 32
	.type	check, @object
	.size	check, 120
check:
	.zero	120
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"-1"
.LC2:
	.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	$48, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$29, -32(%rbp)
	jmp	.L2
.L3:
	movl	-32(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	check(%rip), %rax
	movl	$0, (%rdx,%rax)
	subl	$1, -32(%rbp)
.L2:
	cmpl	$0, -32(%rbp)
	jns	.L3
	leaq	-40(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	$0, -28(%rbp)
	movl	$0, -24(%rbp)
	jmp	.L4
.L38:
	leaq	-36(%rbp), %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	scanf@PLT
	movl	-36(%rbp), %eax
	xorl	%eax, -28(%rbp)
	movl	-36(%rbp), %eax
	leal	-1(%rax), %edx
	movl	-36(%rbp), %eax
	xorl	%edx, %eax
	movl	%eax, -36(%rbp)
	movl	-36(%rbp), %eax
	cmpl	$1073741823, %eax
	je	.L5
	cmpl	$1073741823, %eax
	jg	.L6
	cmpl	$536870911, %eax
	je	.L7
	cmpl	$536870911, %eax
	jg	.L6
	cmpl	$268435455, %eax
	je	.L8
	cmpl	$268435455, %eax
	jg	.L6
	cmpl	$134217727, %eax
	je	.L9
	cmpl	$134217727, %eax
	jg	.L6
	cmpl	$67108863, %eax
	je	.L10
	cmpl	$67108863, %eax
	jg	.L6
	cmpl	$33554431, %eax
	je	.L11
	cmpl	$33554431, %eax
	jg	.L6
	cmpl	$16777215, %eax
	je	.L12
	cmpl	$16777215, %eax
	jg	.L6
	cmpl	$8388607, %eax
	je	.L13
	cmpl	$8388607, %eax
	jg	.L6
	cmpl	$4194303, %eax
	je	.L14
	cmpl	$4194303, %eax
	jg	.L6
	cmpl	$2097151, %eax
	je	.L15
	cmpl	$2097151, %eax
	jg	.L6
	cmpl	$1048575, %eax
	je	.L16
	cmpl	$1048575, %eax
	jg	.L6
	cmpl	$524287, %eax
	je	.L17
	cmpl	$524287, %eax
	jg	.L6
	cmpl	$262143, %eax
	je	.L18
	cmpl	$262143, %eax
	jg	.L6
	cmpl	$131071, %eax
	je	.L19
	cmpl	$131071, %eax
	jg	.L6
	cmpl	$65535, %eax
	je	.L20
	cmpl	$65535, %eax
	jg	.L6
	cmpl	$32767, %eax
	je	.L21
	cmpl	$32767, %eax
	jg	.L6
	cmpl	$16383, %eax
	je	.L22
	cmpl	$16383, %eax
	jg	.L6
	cmpl	$8191, %eax
	je	.L23
	cmpl	$8191, %eax
	jg	.L6
	cmpl	$4095, %eax
	je	.L24
	cmpl	$4095, %eax
	jg	.L6
	cmpl	$2047, %eax
	je	.L25
	cmpl	$2047, %eax
	jg	.L6
	cmpl	$1023, %eax
	je	.L26
	cmpl	$1023, %eax
	jg	.L6
	cmpl	$511, %eax
	je	.L27
	cmpl	$511, %eax
	jg	.L6
	cmpl	$255, %eax
	je	.L28
	cmpl	$255, %eax
	jg	.L6
	cmpl	$127, %eax
	je	.L29
	cmpl	$127, %eax
	jg	.L6
	cmpl	$31, %eax
	jg	.L30
	testl	%eax, %eax
	jle	.L6
	cmpl	$31, %eax
	ja	.L6
	movl	%eax, %eax
	leaq	0(,%rax,4), %rdx
	leaq	.L32(%rip), %rax
	movl	(%rdx,%rax), %eax
	cltq
	leaq	.L32(%rip), %rdx
	addq	%rdx, %rax
	notrack jmp	*%rax
	.section	.rodata
	.align 4
	.align 4
.L32:
	.long	.L6-.L32
	.long	.L36-.L32
	.long	.L6-.L32
	.long	.L35-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L34-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L33-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L6-.L32
	.long	.L31-.L32
	.text
.L30:
	cmpl	$63, %eax
	je	.L37
	jmp	.L6
.L5:
	movl	$1, 116+check(%rip)
	jmp	.L6
.L7:
	movl	$1, 112+check(%rip)
	jmp	.L6
.L8:
	movl	$1, 108+check(%rip)
	jmp	.L6
.L9:
	movl	$1, 104+check(%rip)
	jmp	.L6
.L10:
	movl	$1, 100+check(%rip)
	jmp	.L6
.L11:
	movl	$1, 96+check(%rip)
	jmp	.L6
.L12:
	movl	$1, 92+check(%rip)
	jmp	.L6
.L13:
	movl	$1, 88+check(%rip)
	jmp	.L6
.L14:
	movl	$1, 84+check(%rip)
	jmp	.L6
.L15:
	movl	$1, 80+check(%rip)
	jmp	.L6
.L16:
	movl	$1, 76+check(%rip)
	jmp	.L6
.L17:
	movl	$1, 72+check(%rip)
	jmp	.L6
.L18:
	movl	$1, 68+check(%rip)
	jmp	.L6
.L19:
	movl	$1, 64+check(%rip)
	jmp	.L6
.L20:
	movl	$1, 60+check(%rip)
	jmp	.L6
.L21:
	movl	$1, 56+check(%rip)
	jmp	.L6
.L22:
	movl	$1, 52+check(%rip)
	jmp	.L6
.L23:
	movl	$1, 48+check(%rip)
	jmp	.L6
.L24:
	movl	$1, 44+check(%rip)
	jmp	.L6
.L25:
	movl	$1, 40+check(%rip)
	jmp	.L6
.L26:
	movl	$1, 36+check(%rip)
	jmp	.L6
.L27:
	movl	$1, 32+check(%rip)
	jmp	.L6
.L28:
	movl	$1, 28+check(%rip)
	jmp	.L6
.L29:
	movl	$1, 24+check(%rip)
	jmp	.L6
.L37:
	movl	$1, 20+check(%rip)
	jmp	.L6
.L31:
	movl	$1, 16+check(%rip)
	jmp	.L6
.L33:
	movl	$1, 12+check(%rip)
	jmp	.L6
.L34:
	movl	$1, 8+check(%rip)
	jmp	.L6
.L35:
	movl	$1, 4+check(%rip)
	jmp	.L6
.L36:
	movl	$1, check(%rip)
	nop
.L6:
	addl	$1, -24(%rbp)
.L4:
	movl	-40(%rbp), %eax
	cmpl	%eax, -24(%rbp)
	jl	.L38
	movl	$0, -20(%rbp)
	movl	$29, -16(%rbp)
	jmp	.L39
.L42:
	movl	-16(%rbp), %eax
	movl	-28(%rbp), %edx
	movl	%eax, %ecx
	sarl	%cl, %edx
	movl	%edx, %eax
	andl	$1, %eax
	testl	%eax, %eax
	je	.L47
	movl	-16(%rbp), %eax
	addl	$1, %eax
	movl	$1, %edx
	movl	%eax, %ecx
	sall	%cl, %edx
	movl	%edx, %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	movl	-16(%rbp), %eax
	cltq
	leaq	0(,%rax,4), %rdx
	leaq	check(%rip), %rax
	movl	(%rdx,%rax), %eax
	testl	%eax, %eax
	jle	.L41
	movl	-12(%rbp), %eax
	xorl	%eax, -28(%rbp)
	addl	$1, -20(%rbp)
	jmp	.L41
.L47:
	nop
.L41:
	subl	$1, -16(%rbp)
.L39:
	cmpl	$0, -16(%rbp)
	jns	.L42
	cmpl	$0, -28(%rbp)
	je	.L43
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	call	puts@PLT
	jmp	.L44
.L43:
	movl	-20(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC2(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L44:
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L46
	call	__stack_chk_fail@PLT
.L46:
	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:
