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>

void d_islands(int[64][64], int, int);//inc counter, call islands()

int main(void){

  char scan[128], give[4];
  int w, h, loop1, loop2, loop3, map[64][64];


  while(1){

    for(loop1 = 0; loop1 < 128; loop1++){
      scan[loop1] = '\0';
    }
    for(loop1 = 0; loop1 < 64; loop1++){
      for(loop2 = 0; loop2 < 64; loop2++){
	map[loop1][loop2] = 0;
      }
    }
    
    fgets(scan, 8, stdin);
    for(loop1 = 0; scan[loop1] != ' '; loop1++){
      give[loop1] = scan[loop1];
    }
    w = atoi(give);
    loop1++;    
    for(loop2 = 0; loop2 < 4; loop2++){
      give[loop2] = '\0';
    }
    for(loop2 = 0; scan[loop1] != '\n'; loop1++, loop2++){
      give[loop2] = scan[loop1];
    }
    h = atoi(give);   // get w h
    
    if((w == 0) && (h == 0)) break;

    for(loop1 = 0; loop1 < 4; loop1++){
      give[loop2] = '\0';
    }
    for(loop1 = 0; loop1 < 128; loop1++){
      scan[loop1] = '\0';
    }
    
    
    for(loop1 = 1; loop1 <= h; loop1++){
      fgets(scan, 128, stdin);
      for(loop2 = 0, loop3 = 1; scan[loop2] != '\n'; loop2++){
	if(scan[loop2] == '0'){
	  loop3++;
	}
	if(scan[loop2] == '1'){
	  map[loop1][loop3] = 1;
	  loop3++;
	}
      }
    }  // load the map

    /*    for(loop1 = 0; loop1 < 10; loop1++){
      for(loop2 = 0; loop2 < 10; loop2++){
	printf("%d ", map[loop1][loop2]);
      }
      printf("\n");
      }*/

    loop3 = 0;
    for(loop1 = 1; loop1 <= h; loop1++){
      for(loop2 = 1; loop2 <= w; loop2++){
	if(map[loop1][loop2] != 0){
	  d_islands(map, loop1, loop2);
	  loop3++;
	}
      }
    }
    printf("%d\n", loop3);

    
  }
  return 0;
    
}


void d_islands(int map[64][64], int h, int w){
  int loop1, loop2;
  map[h][w] = 0;
  /*    for(loop1 = 0; loop1 < 10; loop1++){
      for(loop2 = 0; loop2 < 10; loop2++){
	printf("%d ", map[loop1][loop2]);
      }
      printf("\n");
      }*/
  //  printf("checking %d %d\n", h, w);
  for(loop1 = h - 1; loop1 < h + 2; loop1++){
    for(loop2 = w - 1; loop2 < w + 2; loop2++){ 
      if(map[loop1][loop2] == 1) d_islands(map, loop1, loop2);//printf("1 ");
      //      else printf("0 ");

    }    
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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
	leaq	-16384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$192, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L31:
	movl	$0, -16564(%rbp)
	jmp	.L2
.L3:
	movl	-16564(%rbp), %eax
	cltq
	movb	$0, -144(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L2:
	cmpl	$127, -16564(%rbp)
	jle	.L3
	movl	$0, -16564(%rbp)
	jmp	.L4
.L7:
	movl	$0, -16560(%rbp)
	jmp	.L5
.L6:
	movl	-16560(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	$0, -16544(%rbp,%rax,4)
	addl	$1, -16560(%rbp)
.L5:
	cmpl	$63, -16560(%rbp)
	jle	.L6
	addl	$1, -16564(%rbp)
.L4:
	cmpl	$63, -16564(%rbp)
	jle	.L7
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$8, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -16564(%rbp)
	jmp	.L8
.L9:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %edx
	movl	-16564(%rbp), %eax
	cltq
	movb	%dl, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L8:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$32, %al
	jne	.L9
	leaq	-148(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, -16552(%rbp)
	addl	$1, -16564(%rbp)
	movl	$0, -16560(%rbp)
	jmp	.L10
.L11:
	movl	-16560(%rbp), %eax
	cltq
	movb	$0, -148(%rbp,%rax)
	addl	$1, -16560(%rbp)
.L10:
	cmpl	$3, -16560(%rbp)
	jle	.L11
	movl	$0, -16560(%rbp)
	jmp	.L12
.L13:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %edx
	movl	-16560(%rbp), %eax
	cltq
	movb	%dl, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
	addl	$1, -16560(%rbp)
.L12:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L13
	leaq	-148(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, -16548(%rbp)
	cmpl	$0, -16552(%rbp)
	jne	.L14
	cmpl	$0, -16548(%rbp)
	je	.L35
.L14:
	movl	$0, -16564(%rbp)
	jmp	.L16
.L17:
	movl	-16560(%rbp), %eax
	cltq
	movb	$0, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L16:
	cmpl	$3, -16564(%rbp)
	jle	.L17
	movl	$0, -16564(%rbp)
	jmp	.L18
.L19:
	movl	-16564(%rbp), %eax
	cltq
	movb	$0, -144(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L18:
	cmpl	$127, -16564(%rbp)
	jle	.L19
	movl	$1, -16564(%rbp)
	jmp	.L20
.L25:
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$128, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -16560(%rbp)
	movl	$1, -16556(%rbp)
	jmp	.L21
.L24:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L22
	addl	$1, -16556(%rbp)
.L22:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$49, %al
	jne	.L23
	movl	-16556(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	$1, -16544(%rbp,%rax,4)
	addl	$1, -16556(%rbp)
.L23:
	addl	$1, -16560(%rbp)
.L21:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L24
	addl	$1, -16564(%rbp)
.L20:
	movl	-16564(%rbp), %eax
	cmpl	-16548(%rbp), %eax
	jle	.L25
	movl	$0, -16556(%rbp)
	movl	$1, -16564(%rbp)
	jmp	.L26
.L30:
	movl	$1, -16560(%rbp)
	jmp	.L27
.L29:
	movl	-16560(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	-16544(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	-16560(%rbp), %edx
	movl	-16564(%rbp), %ecx
	leaq	-16544(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	d_islands
	addl	$1, -16556(%rbp)
.L28:
	addl	$1, -16560(%rbp)
.L27:
	movl	-16560(%rbp), %eax
	cmpl	-16552(%rbp), %eax
	jle	.L29
	addl	$1, -16564(%rbp)
.L26:
	movl	-16564(%rbp), %eax
	cmpl	-16548(%rbp), %eax
	jle	.L30
	movl	-16556(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L31
.L35:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	d_islands
	.type	d_islands, @function
d_islands:
.LFB1:
	.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	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	salq	$8, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L37
.L41:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L38
.L40:
	movl	-8(%rbp), %eax
	cltq
	salq	$8, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L39
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	d_islands
.L39:
	addl	$1, -4(%rbp)
.L38:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jle	.L40
	addl	$1, -8(%rbp)
.L37:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jle	.L41
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	d_islands, .-d_islands
	.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	d_islands
	.type	d_islands, @function
d_islands:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edx, %rdx
	movslq	%esi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %rcx
	salq	$8, %rax
	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	$328, %rsp
	.cfi_def_cfa_offset 384
	movl	%edx, 236(%rsp)
	movq	%rdx, 240(%rsp)
	leaq	(%rdi,%rdx,4), %rdx
	movl	$0, (%rdx,%rax)
	leal	-2(%rcx), %edx
	leaq	-256(%rdi,%rax), %rax
	movl	%esi, 232(%rsp)
	movl	%edx, 252(%rsp)
	movq	%rax, 160(%rsp)
	leal	-2(%rsi), %eax
.L44:
	movq	240(%rsp), %rsi
	movslq	%eax, %rcx
	movl	252(%rsp), %edx
	salq	$8, %rcx
	subq	$3, %rsi
	movq	%rsi, 144(%rsp)
	leaq	(%rdi,%rcx), %rsi
	movq	%rsi, 224(%rsp)
	leal	1(%rax), %esi
	subl	$1, %eax
	movl	%esi, 200(%rsp)
	movl	%eax, 272(%rsp)
.L3:
	movq	160(%rsp), %rax
	movq	144(%rsp), %rsi
	cmpl	$1, 8(%rax,%rsi,4)
	je	.L2
	leal	1(%rdx), %eax
	movl	%eax, 192(%rsp)
	movl	%eax, %edx
.L43:
	addq	$1, 144(%rsp)
	cmpl	%edx, 236(%rsp)
	jge	.L3
	addq	$256, 160(%rsp)
	movl	200(%rsp), %eax
	cmpl	%eax, 232(%rsp)
	jge	.L44
	addq	$328, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L2:
	.cfi_restore_state
	movl	$0, 8(%rax,%rsi,4)
	movq	224(%rsp), %rsi
	movl	272(%rsp), %eax
	movq	%rsi, 152(%rsp)
	leal	1(%rdx), %esi
	subl	$1, %edx
	movl	%esi, 192(%rsp)
	movl	%edx, 248(%rsp)
.L42:
	movslq	%eax, %rcx
	movl	248(%rsp), %edx
	salq	$8, %rcx
	leaq	(%rdi,%rcx), %rsi
	movq	%rsi, 208(%rsp)
	movq	144(%rsp), %rsi
	movq	%rsi, 136(%rsp)
	leal	1(%rax), %esi
	subl	$1, %eax
	movl	%esi, 196(%rsp)
	movl	%eax, 260(%rsp)
.L6:
	movq	152(%rsp), %rax
	movq	136(%rsp), %rsi
	cmpl	$1, 4(%rax,%rsi,4)
	je	.L5
	leal	1(%rdx), %eax
	movl	%eax, 168(%rsp)
	movl	%eax, %edx
.L41:
	addq	$1, 136(%rsp)
	cmpl	192(%rsp), %edx
	jle	.L6
	addq	$256, 152(%rsp)
	movl	196(%rsp), %eax
	cmpl	200(%rsp), %eax
	jle	.L42
	movl	192(%rsp), %edx
	jmp	.L43
.L5:
	movl	$0, 4(%rax,%rsi,4)
	movq	208(%rsp), %rsi
	addl	$1, %edx
	movl	%edx, 168(%rsp)
	movl	260(%rsp), %eax
	movq	%rsi, 128(%rsp)
.L40:
	movslq	%eax, %rdx
	salq	$8, %rdx
	addq	%rdi, %rdx
	movq	%rdx, 216(%rsp)
	movq	136(%rsp), %rdx
	movq	%rdx, 72(%rsp)
	leal	1(%rax), %edx
	subl	$1, %eax
	movl	%edx, 172(%rsp)
	movl	%eax, 256(%rsp)
.L9:
	movq	128(%rsp), %rax
	movq	72(%rsp), %rdx
	cmpl	$1, (%rax,%rdx,4)
	je	.L8
.L39:
	addq	$1, 72(%rsp)
	movq	72(%rsp), %rax
	subl	$1, %eax
	cmpl	168(%rsp), %eax
	jle	.L9
	addq	$256, 128(%rsp)
	movl	172(%rsp), %eax
	cmpl	196(%rsp), %eax
	jle	.L40
	movl	168(%rsp), %edx
	jmp	.L41
.L8:
	movl	$0, (%rax,%rdx,4)
	movq	%rdx, %rsi
	movq	216(%rsp), %rdx
	movl	256(%rsp), %eax
	movq	%rdx, 96(%rsp)
	leaq	-1(%rsi), %rdx
	movq	%rdx, 184(%rsp)
.L38:
	movq	184(%rsp), %rdx
	movq	%rdx, 16(%rsp)
	movslq	%eax, %rdx
	salq	$8, %rdx
	leaq	(%rdi,%rdx), %rsi
	leal	1(%rax), %edx
	subl	$1, %eax
	movq	%rsi, 176(%rsp)
	movl	%edx, 112(%rsp)
	movl	%eax, 204(%rsp)
.L12:
	movq	96(%rsp), %rax
	movq	16(%rsp), %rdx
	cmpl	$1, (%rax,%rdx,4)
	je	.L11
.L37:
	addq	$1, 16(%rsp)
	movq	16(%rsp), %rax
	subl	$1, %eax
	cmpl	72(%rsp), %eax
	jle	.L12
	addq	$256, 96(%rsp)
	movl	112(%rsp), %eax
	cmpl	172(%rsp), %eax
	jle	.L38
	jmp	.L39
.L11:
	movq	%rax, %rdx
	movq	16(%rsp), %rax
	movq	176(%rsp), %rsi
	movl	$0, (%rdx,%rax,4)
	subq	$1, %rax
	movl	204(%rsp), %edx
	movq	%rsi, 40(%rsp)
	movq	%rax, 120(%rsp)
.L36:
	movslq	%edx, %rax
	movq	120(%rsp), %r11
	salq	$8, %rax
	addq	%rdi, %rax
	movq	%rax, 104(%rsp)
	leal	1(%rdx), %eax
	movl	%eax, 64(%rsp)
	leal	-1(%rdx), %eax
	movl	%eax, 116(%rsp)
.L15:
	movq	40(%rsp), %rax
	cmpl	$1, (%rax,%r11,4)
	je	.L14
.L35:
	addq	$1, %r11
	leal	-1(%r11), %eax
	cmpl	16(%rsp), %eax
	jle	.L15
	addq	$256, 40(%rsp)
	movl	64(%rsp), %edx
	cmpl	%edx, 112(%rsp)
	jge	.L36
	jmp	.L37
.L14:
	leaq	-1(%r11), %rsi
	movq	104(%rsp), %r10
	movq	%r11, 8(%rsp)
	movq	%rsi, 80(%rsp)
	movl	$0, (%rax,%r11,4)
	movl	116(%rsp), %eax
	movq	%r10, %r11
.L34:
	movslq	%eax, %rdx
	movq	80(%rsp), %r10
	salq	$8, %rdx
	leaq	(%rdi,%rdx), %rsi
	movq	%rsi, 56(%rsp)
	leal	1(%rax), %esi
	subl	$1, %eax
	movl	%esi, 48(%rsp)
	movl	%eax, 68(%rsp)
	movq	%r11, %rax
	movq	%r10, %r11
	movq	%rax, %r10
.L18:
	cmpl	$1, (%r10,%r11,4)
	je	.L17
.L33:
	addq	$1, %r11
	leal	-1(%r11), %eax
	cmpl	8(%rsp), %eax
	jle	.L18
	movq	%r10, %r11
	movl	48(%rsp), %eax
	addq	$256, %r11
	cmpl	%eax, 64(%rsp)
	jge	.L34
	movq	8(%rsp), %r11
	jmp	.L35
.L17:
	leaq	-1(%r11), %rax
	movq	%r10, 88(%rsp)
	movl	68(%rsp), %r13d
	movl	$0, (%r10,%r11,4)
	movq	56(%rsp), %r9
	movq	%rax, 24(%rsp)
.L32:
	movslq	%r13d, %rax
	movq	24(%rsp), %rbx
	leal	1(%r13), %ecx
	leal	-1(%r13), %r10d
	salq	$8, %rax
	addq	%rdi, %rax
	movq	%rax, (%rsp)
.L21:
	cmpl	$1, (%r9,%rbx,4)
	je	.L20
.L31:
	addq	$1, %rbx
	leal	-1(%rbx), %eax
	cmpl	%r11d, %eax
	jle	.L21
	addq	$256, %r9
	movl	%ecx, %r13d
	cmpl	48(%rsp), %ecx
	jle	.L32
	movq	88(%rsp), %r10
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L20:
	leaq	-1(%rbx), %rax
	movl	$0, (%r9,%rbx,4)
	movq	(%rsp), %r15
	movl	%r10d, %r13d
	movq	%rax, 32(%rsp)
.L30:
	leal	1(%r13), %eax
	movslq	%r13d, %r14
	movq	32(%rsp), %r12
	movl	%eax, 52(%rsp)
	salq	$8, %r14
	addq	%rdi, %r14
.L24:
	cmpl	$1, (%r15,%r12,4)
	je	.L23
.L29:
	addq	$1, %r12
	leal	-1(%r12), %eax
	cmpl	%ebx, %eax
	jle	.L24
	movl	52(%rsp), %r13d
	addq	$256, %r15
	cmpl	%r13d, %ecx
	jge	.L30
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$0, (%r15,%r12,4)
	movq	%r14, %rax
	movl	%r13d, %esi
	leaq	-1(%r12), %r8
.L28:
	movq	%r8, %rbp
.L27:
	cmpl	$1, (%rax,%rbp,4)
	movl	%ebp, %edx
	je	.L74
.L26:
	addq	$1, %rbp
	leal	-1(%rbp), %edx
	cmpl	%r12d, %edx
	jle	.L27
	leal	1(%rsi), %edx
	addq	$256, %rax
	cmpl	%esi, 52(%rsp)
	jl	.L29
	movl	%edx, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%r10d, 316(%rsp)
	movq	%r8, 304(%rsp)
	movl	%ecx, 312(%rsp)
	movq	%rax, 296(%rsp)
	movq	%r9, 288(%rsp)
	movq	%r11, 280(%rsp)
	movl	%esi, 276(%rsp)
	movq	%rdi, 264(%rsp)
	call	d_islands
	movl	316(%rsp), %r10d
	movq	304(%rsp), %r8
	movl	312(%rsp), %ecx
	movq	296(%rsp), %rax
	movq	288(%rsp), %r9
	movq	280(%rsp), %r11
	movl	276(%rsp), %esi
	movq	264(%rsp), %rdi
	jmp	.L26
	.cfi_endproc
.LFE24:
	.size	d_islands, .-d_islands
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-16384(%rsp), %r11
	.cfi_def_cfa 11, 16440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$232, %rsp
	.cfi_def_cfa_offset 16672
	movq	%fs:40, %rax
	movq	%rax, 16600(%rsp)
	xorl	%eax, %eax
	leaq	16464(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	16460(%rsp), %rax
	movq	%rax, 56(%rsp)
.L96:
	movq	40(%rsp), %rdi
	xorl	%eax, %eax
	movl	$16, %ecx
	xorl	%esi, %esi
	movl	$16384, %edx
	rep stosq
	movq	32(%rsp), %rdi
	call	memset@PLT
	movq	40(%rsp), %rdi
	movl	$8, %esi
	movq	stdin(%rip), %rdx
	call	fgets@PLT
	movzbl	16464(%rsp), %eax
	cmpb	$32, %al
	je	.L98
	movb	%al, 16460(%rsp)
	movzbl	16465(%rsp), %eax
	cmpb	$32, %al
	je	.L99
	movb	%al, 16461(%rsp)
	movzbl	16466(%rsp), %eax
	cmpb	$32, %al
	je	.L100
	movb	%al, 16462(%rsp)
	movzbl	16467(%rsp), %eax
	cmpb	$32, %al
	je	.L101
	movb	%al, 16463(%rsp)
	movl	$4, %ebx
.L77:
	addl	$1, %ebx
.L76:
	movq	56(%rsp), %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	$0, 16460(%rsp)
	movl	%eax, 4(%rsp)
	movslq	%ebx, %rax
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L102
	movb	%al, 16460(%rsp)
	leal	1(%rbx), %eax
	cltq
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L103
	movb	%al, 16461(%rsp)
	leal	2(%rbx), %eax
	cltq
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L104
	movb	%al, 16462(%rsp)
	leal	3(%rbx), %eax
	cltq
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L105
	movb	%al, 16463(%rsp)
	movl	$4, %ebx
.L78:
	movq	56(%rsp), %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	4(%rsp), %edi
	movl	%eax, 52(%rsp)
	movl	%eax, %esi
	orl	%eax, %edi
	je	.L79
	movq	40(%rsp), %rdi
	movl	$16, %ecx
	xorl	%eax, %eax
	movb	$0, 16460(%rsp,%rbx)
	rep stosq
	testl	%esi, %esi
	jle	.L106
	movl	$1, %ebx
.L82:
	movq	stdin(%rip), %rdx
	movq	40(%rsp), %rdi
	movl	$128, %esi
	call	fgets@PLT
	movzbl	16464(%rsp), %eax
	movslq	%ebx, %rsi
	leaq	16465(%rsp), %rdx
	movl	$1, %ecx
	salq	$6, %rsi
	cmpb	$10, %al
	je	.L87
	.p2align 4,,10
	.p2align 3
.L86:
	cmpb	$48, %al
	je	.L115
	cmpb	$49, %al
	jne	.L85
	movslq	%ecx, %rax
	addq	%rsi, %rax
	movl	$1, 64(%rsp,%rax,4)
.L115:
	addl	$1, %ecx
.L85:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	cmpb	$10, %al
	jne	.L86
.L87:
	addl	$1, %ebx
	cmpl	%ebx, 52(%rsp)
	jge	.L82
	leaq	320(%rsp), %rax
	movl	$1, (%rsp)
	movq	%rax, 24(%rsp)
	movl	$0, 20(%rsp)
.L83:
	movl	(%rsp), %eax
	movq	24(%rsp), %r13
	movl	$1, %r15d
	subl	$1, %eax
	movq	%r13, %r14
	movl	%eax, 48(%rsp)
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jg	.L93
	jmp	.L95
.L88:
	addq	$1, %r15
	addq	$4, %r14
	cmpl	%r15d, 4(%rsp)
	jl	.L95
.L93:
	movl	4(%r14), %edx
	leal	1(%r15), %r12d
	testl	%edx, %edx
	je	.L88
	movq	24(%rsp), %rax
	movl	48(%rsp), %ebp
	movl	%r12d, %r13d
	movq	%r14, 8(%rsp)
	movl	%r15d, %r12d
	movl	$0, (%rax,%r15,4)
	leal	-1(%r15), %eax
	movl	%ebp, %ebx
	cmpl	$1, -256(%r14)
	movl	%eax, 16(%rsp)
	movq	32(%rsp), %rbp
	je	.L116
.L89:
	cmpl	$1, -252(%r14)
	je	.L117
.L90:
	cmpl	$1, -248(%r14)
	je	.L118
.L91:
	leal	1(%rbx), %edx
	addq	$256, %r14
	cmpl	%ebx, (%rsp)
	jl	.L119
.L107:
	cmpl	$1, -256(%r14)
	movl	%edx, %ebx
	jne	.L89
.L116:
	movl	16(%rsp), %edx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	d_islands
	cmpl	$1, -252(%r14)
	jne	.L90
.L117:
	movl	%r12d, %edx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	d_islands
	cmpl	$1, -248(%r14)
	jne	.L91
.L118:
	movl	%r13d, %edx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	addq	$256, %r14
	call	d_islands
	leal	1(%rbx), %edx
	cmpl	%ebx, (%rsp)
	jge	.L107
.L119:
	movq	8(%rsp), %r14
	addl	$1, 20(%rsp)
	addq	$1, %r15
	addq	$4, %r14
	cmpl	%r15d, 4(%rsp)
	jge	.L93
.L95:
	addl	$1, (%rsp)
	movl	(%rsp), %eax
	addq	$256, 24(%rsp)
	cmpl	%eax, 52(%rsp)
	jge	.L83
.L80:
	movl	20(%rsp), %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L96
.L100:
	movl	$2, %ebx
	jmp	.L77
.L99:
	movl	$1, %ebx
	jmp	.L77
.L98:
	movl	$1, %ebx
	jmp	.L76
.L106:
	movl	$0, 20(%rsp)
	jmp	.L80
.L79:
	movq	16600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L120
	addq	$16616, %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
.L105:
	.cfi_restore_state
	movl	$3, %ebx
	jmp	.L78
.L104:
	movl	$2, %ebx
	jmp	.L78
.L103:
	movl	$1, %ebx
	jmp	.L78
.L102:
	xorl	%ebx, %ebx
	jmp	.L78
.L101:
	movl	$3, %ebx
	jmp	.L77
.L120:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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	d_islands
	.type	d_islands, @function
d_islands:
.LFB24:
	.cfi_startproc
	endbr64
	pushq	%r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	movslq	%edx, %rdx
	movslq	%esi, %rax
	pushq	%r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	movq	%rdx, %rcx
	salq	$8, %rax
	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	$328, %rsp
	.cfi_def_cfa_offset 384
	movl	%edx, 236(%rsp)
	movq	%rdx, 240(%rsp)
	leaq	(%rdi,%rdx,4), %rdx
	movl	$0, (%rdx,%rax)
	leal	-2(%rcx), %edx
	leaq	-256(%rdi,%rax), %rax
	movl	%esi, 232(%rsp)
	movl	%edx, 252(%rsp)
	movq	%rax, 160(%rsp)
	leal	-2(%rsi), %eax
.L44:
	movq	240(%rsp), %rsi
	movslq	%eax, %rcx
	movl	252(%rsp), %edx
	salq	$8, %rcx
	subq	$3, %rsi
	movq	%rsi, 144(%rsp)
	leaq	(%rdi,%rcx), %rsi
	movq	%rsi, 224(%rsp)
	leal	1(%rax), %esi
	subl	$1, %eax
	movl	%esi, 200(%rsp)
	movl	%eax, 272(%rsp)
.L3:
	movq	160(%rsp), %rax
	movq	144(%rsp), %rsi
	cmpl	$1, 8(%rax,%rsi,4)
	je	.L2
	leal	1(%rdx), %eax
	movl	%eax, 192(%rsp)
	movl	%eax, %edx
.L43:
	addq	$1, 144(%rsp)
	cmpl	%edx, 236(%rsp)
	jge	.L3
	addq	$256, 160(%rsp)
	movl	200(%rsp), %eax
	cmpl	%eax, 232(%rsp)
	jge	.L44
	addq	$328, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L2:
	.cfi_restore_state
	movl	$0, 8(%rax,%rsi,4)
	movq	224(%rsp), %rsi
	movl	272(%rsp), %eax
	movq	%rsi, 152(%rsp)
	leal	1(%rdx), %esi
	subl	$1, %edx
	movl	%esi, 192(%rsp)
	movl	%edx, 248(%rsp)
.L42:
	movslq	%eax, %rcx
	movl	248(%rsp), %edx
	salq	$8, %rcx
	leaq	(%rdi,%rcx), %rsi
	movq	%rsi, 208(%rsp)
	movq	144(%rsp), %rsi
	movq	%rsi, 136(%rsp)
	leal	1(%rax), %esi
	subl	$1, %eax
	movl	%esi, 196(%rsp)
	movl	%eax, 260(%rsp)
.L6:
	movq	152(%rsp), %rax
	movq	136(%rsp), %rsi
	cmpl	$1, 4(%rax,%rsi,4)
	je	.L5
	leal	1(%rdx), %eax
	movl	%eax, 168(%rsp)
	movl	%eax, %edx
.L41:
	addq	$1, 136(%rsp)
	cmpl	192(%rsp), %edx
	jle	.L6
	addq	$256, 152(%rsp)
	movl	196(%rsp), %eax
	cmpl	200(%rsp), %eax
	jle	.L42
	movl	192(%rsp), %edx
	jmp	.L43
.L5:
	movl	$0, 4(%rax,%rsi,4)
	movq	208(%rsp), %rsi
	addl	$1, %edx
	movl	%edx, 168(%rsp)
	movl	260(%rsp), %eax
	movq	%rsi, 128(%rsp)
.L40:
	movslq	%eax, %rdx
	salq	$8, %rdx
	addq	%rdi, %rdx
	movq	%rdx, 216(%rsp)
	movq	136(%rsp), %rdx
	movq	%rdx, 72(%rsp)
	leal	1(%rax), %edx
	subl	$1, %eax
	movl	%edx, 172(%rsp)
	movl	%eax, 256(%rsp)
.L9:
	movq	128(%rsp), %rax
	movq	72(%rsp), %rdx
	cmpl	$1, (%rax,%rdx,4)
	je	.L8
.L39:
	addq	$1, 72(%rsp)
	movq	72(%rsp), %rax
	subl	$1, %eax
	cmpl	168(%rsp), %eax
	jle	.L9
	addq	$256, 128(%rsp)
	movl	172(%rsp), %eax
	cmpl	196(%rsp), %eax
	jle	.L40
	movl	168(%rsp), %edx
	jmp	.L41
.L8:
	movl	$0, (%rax,%rdx,4)
	movq	%rdx, %rsi
	movq	216(%rsp), %rdx
	movl	256(%rsp), %eax
	movq	%rdx, 96(%rsp)
	leaq	-1(%rsi), %rdx
	movq	%rdx, 184(%rsp)
.L38:
	movq	184(%rsp), %rdx
	movq	%rdx, 16(%rsp)
	movslq	%eax, %rdx
	salq	$8, %rdx
	leaq	(%rdi,%rdx), %rsi
	leal	1(%rax), %edx
	subl	$1, %eax
	movq	%rsi, 176(%rsp)
	movl	%edx, 112(%rsp)
	movl	%eax, 204(%rsp)
.L12:
	movq	96(%rsp), %rax
	movq	16(%rsp), %rdx
	cmpl	$1, (%rax,%rdx,4)
	je	.L11
.L37:
	addq	$1, 16(%rsp)
	movq	16(%rsp), %rax
	subl	$1, %eax
	cmpl	72(%rsp), %eax
	jle	.L12
	addq	$256, 96(%rsp)
	movl	112(%rsp), %eax
	cmpl	172(%rsp), %eax
	jle	.L38
	jmp	.L39
.L11:
	movq	%rax, %rdx
	movq	16(%rsp), %rax
	movq	176(%rsp), %rsi
	movl	$0, (%rdx,%rax,4)
	subq	$1, %rax
	movl	204(%rsp), %edx
	movq	%rsi, 40(%rsp)
	movq	%rax, 120(%rsp)
.L36:
	movslq	%edx, %rax
	movq	120(%rsp), %r11
	salq	$8, %rax
	addq	%rdi, %rax
	movq	%rax, 104(%rsp)
	leal	1(%rdx), %eax
	movl	%eax, 64(%rsp)
	leal	-1(%rdx), %eax
	movl	%eax, 116(%rsp)
.L15:
	movq	40(%rsp), %rax
	cmpl	$1, (%rax,%r11,4)
	je	.L14
.L35:
	addq	$1, %r11
	leal	-1(%r11), %eax
	cmpl	16(%rsp), %eax
	jle	.L15
	addq	$256, 40(%rsp)
	movl	64(%rsp), %edx
	cmpl	%edx, 112(%rsp)
	jge	.L36
	jmp	.L37
.L14:
	leaq	-1(%r11), %rsi
	movq	104(%rsp), %r10
	movq	%r11, 8(%rsp)
	movq	%rsi, 80(%rsp)
	movl	$0, (%rax,%r11,4)
	movl	116(%rsp), %eax
	movq	%r10, %r11
.L34:
	movslq	%eax, %rdx
	movq	80(%rsp), %r10
	salq	$8, %rdx
	leaq	(%rdi,%rdx), %rsi
	movq	%rsi, 56(%rsp)
	leal	1(%rax), %esi
	subl	$1, %eax
	movl	%esi, 48(%rsp)
	movl	%eax, 68(%rsp)
	movq	%r11, %rax
	movq	%r10, %r11
	movq	%rax, %r10
.L18:
	cmpl	$1, (%r10,%r11,4)
	je	.L17
.L33:
	addq	$1, %r11
	leal	-1(%r11), %eax
	cmpl	8(%rsp), %eax
	jle	.L18
	movq	%r10, %r11
	movl	48(%rsp), %eax
	addq	$256, %r11
	cmpl	%eax, 64(%rsp)
	jge	.L34
	movq	8(%rsp), %r11
	jmp	.L35
.L17:
	leaq	-1(%r11), %rax
	movq	%r10, 88(%rsp)
	movl	68(%rsp), %r13d
	movl	$0, (%r10,%r11,4)
	movq	56(%rsp), %r9
	movq	%rax, 24(%rsp)
.L32:
	movslq	%r13d, %rax
	movq	24(%rsp), %rbx
	leal	1(%r13), %ecx
	leal	-1(%r13), %r10d
	salq	$8, %rax
	addq	%rdi, %rax
	movq	%rax, (%rsp)
.L21:
	cmpl	$1, (%r9,%rbx,4)
	je	.L20
.L31:
	addq	$1, %rbx
	leal	-1(%rbx), %eax
	cmpl	%r11d, %eax
	jle	.L21
	addq	$256, %r9
	movl	%ecx, %r13d
	cmpl	48(%rsp), %ecx
	jle	.L32
	movq	88(%rsp), %r10
	jmp	.L33
	.p2align 4,,10
	.p2align 3
.L20:
	leaq	-1(%rbx), %rax
	movl	$0, (%r9,%rbx,4)
	movq	(%rsp), %r15
	movl	%r10d, %r13d
	movq	%rax, 32(%rsp)
.L30:
	leal	1(%r13), %eax
	movslq	%r13d, %r14
	movq	32(%rsp), %r12
	movl	%eax, 52(%rsp)
	salq	$8, %r14
	addq	%rdi, %r14
.L24:
	cmpl	$1, (%r15,%r12,4)
	je	.L23
.L29:
	addq	$1, %r12
	leal	-1(%r12), %eax
	cmpl	%ebx, %eax
	jle	.L24
	movl	52(%rsp), %r13d
	addq	$256, %r15
	cmpl	%r13d, %ecx
	jge	.L30
	jmp	.L31
	.p2align 4,,10
	.p2align 3
.L23:
	movl	$0, (%r15,%r12,4)
	movq	%r14, %rax
	movl	%r13d, %esi
	leaq	-1(%r12), %r8
.L28:
	movq	%r8, %rbp
.L27:
	cmpl	$1, (%rax,%rbp,4)
	movl	%ebp, %edx
	je	.L74
.L26:
	addq	$1, %rbp
	leal	-1(%rbp), %edx
	cmpl	%r12d, %edx
	jle	.L27
	leal	1(%rsi), %edx
	addq	$256, %rax
	cmpl	%esi, 52(%rsp)
	jl	.L29
	movl	%edx, %esi
	jmp	.L28
	.p2align 4,,10
	.p2align 3
.L74:
	movl	%r10d, 316(%rsp)
	movq	%r8, 304(%rsp)
	movl	%ecx, 312(%rsp)
	movq	%rax, 296(%rsp)
	movq	%r9, 288(%rsp)
	movq	%r11, 280(%rsp)
	movl	%esi, 276(%rsp)
	movq	%rdi, 264(%rsp)
	call	d_islands
	movl	316(%rsp), %r10d
	movq	304(%rsp), %r8
	movl	312(%rsp), %ecx
	movq	296(%rsp), %rax
	movq	288(%rsp), %r9
	movq	280(%rsp), %r11
	movl	276(%rsp), %esi
	movq	264(%rsp), %rdi
	jmp	.L26
	.cfi_endproc
.LFE24:
	.size	d_islands, .-d_islands
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB23:
	.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
	pushq	%rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	leaq	-16384(%rsp), %r11
	.cfi_def_cfa 11, 16440
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	.cfi_def_cfa_register 7
	subq	$232, %rsp
	.cfi_def_cfa_offset 16672
	movq	%fs:40, %rax
	movq	%rax, 16600(%rsp)
	xorl	%eax, %eax
	leaq	16464(%rsp), %rax
	movq	%rax, 40(%rsp)
	leaq	64(%rsp), %rax
	movq	%rax, 32(%rsp)
	leaq	16460(%rsp), %rax
	movq	%rax, 56(%rsp)
.L96:
	movq	40(%rsp), %rdi
	xorl	%eax, %eax
	movl	$16, %ecx
	xorl	%esi, %esi
	movl	$16384, %edx
	rep stosq
	movq	32(%rsp), %rdi
	call	memset@PLT
	movq	40(%rsp), %rdi
	movl	$8, %esi
	movq	stdin(%rip), %rdx
	call	fgets@PLT
	movzbl	16464(%rsp), %eax
	cmpb	$32, %al
	je	.L98
	movb	%al, 16460(%rsp)
	movzbl	16465(%rsp), %eax
	cmpb	$32, %al
	je	.L99
	movb	%al, 16461(%rsp)
	movzbl	16466(%rsp), %eax
	cmpb	$32, %al
	je	.L100
	movb	%al, 16462(%rsp)
	movzbl	16467(%rsp), %eax
	cmpb	$32, %al
	je	.L101
	movb	%al, 16463(%rsp)
	movl	$4, %ebx
.L77:
	addl	$1, %ebx
.L76:
	movq	56(%rsp), %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	$0, 16460(%rsp)
	movl	%eax, 4(%rsp)
	movslq	%ebx, %rax
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L102
	movb	%al, 16460(%rsp)
	leal	1(%rbx), %eax
	cltq
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L103
	movb	%al, 16461(%rsp)
	leal	2(%rbx), %eax
	cltq
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L104
	movb	%al, 16462(%rsp)
	leal	3(%rbx), %eax
	cltq
	movzbl	16464(%rsp,%rax), %eax
	cmpb	$10, %al
	je	.L105
	movb	%al, 16463(%rsp)
	movl	$4, %ebx
.L78:
	movq	56(%rsp), %rdi
	xorl	%eax, %eax
	call	atoi@PLT
	movl	4(%rsp), %edi
	movl	%eax, 52(%rsp)
	movl	%eax, %esi
	orl	%eax, %edi
	je	.L79
	movq	40(%rsp), %rdi
	movl	$16, %ecx
	xorl	%eax, %eax
	movb	$0, 16460(%rsp,%rbx)
	rep stosq
	testl	%esi, %esi
	jle	.L106
	movl	$1, %ebx
.L82:
	movq	stdin(%rip), %rdx
	movq	40(%rsp), %rdi
	movl	$128, %esi
	call	fgets@PLT
	movzbl	16464(%rsp), %eax
	movslq	%ebx, %rsi
	leaq	16465(%rsp), %rdx
	movl	$1, %ecx
	salq	$6, %rsi
	cmpb	$10, %al
	je	.L87
	.p2align 4,,10
	.p2align 3
.L86:
	cmpb	$48, %al
	je	.L115
	cmpb	$49, %al
	jne	.L85
	movslq	%ecx, %rax
	addq	%rsi, %rax
	movl	$1, 64(%rsp,%rax,4)
.L115:
	addl	$1, %ecx
.L85:
	movzbl	(%rdx), %eax
	addq	$1, %rdx
	cmpb	$10, %al
	jne	.L86
.L87:
	addl	$1, %ebx
	cmpl	%ebx, 52(%rsp)
	jge	.L82
	leaq	320(%rsp), %rax
	movl	$1, (%rsp)
	movq	%rax, 24(%rsp)
	movl	$0, 20(%rsp)
.L83:
	movl	(%rsp), %eax
	movq	24(%rsp), %r13
	movl	$1, %r15d
	subl	$1, %eax
	movq	%r13, %r14
	movl	%eax, 48(%rsp)
	movl	4(%rsp), %eax
	testl	%eax, %eax
	jg	.L93
	jmp	.L95
.L88:
	addq	$1, %r15
	addq	$4, %r14
	cmpl	%r15d, 4(%rsp)
	jl	.L95
.L93:
	movl	4(%r14), %edx
	leal	1(%r15), %r12d
	testl	%edx, %edx
	je	.L88
	movq	24(%rsp), %rax
	movl	48(%rsp), %ebp
	movl	%r12d, %r13d
	movq	%r14, 8(%rsp)
	movl	%r15d, %r12d
	movl	$0, (%rax,%r15,4)
	leal	-1(%r15), %eax
	movl	%ebp, %ebx
	cmpl	$1, -256(%r14)
	movl	%eax, 16(%rsp)
	movq	32(%rsp), %rbp
	je	.L116
.L89:
	cmpl	$1, -252(%r14)
	je	.L117
.L90:
	cmpl	$1, -248(%r14)
	je	.L118
.L91:
	leal	1(%rbx), %edx
	addq	$256, %r14
	cmpl	%ebx, (%rsp)
	jl	.L119
.L107:
	cmpl	$1, -256(%r14)
	movl	%edx, %ebx
	jne	.L89
.L116:
	movl	16(%rsp), %edx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	d_islands
	cmpl	$1, -252(%r14)
	jne	.L90
.L117:
	movl	%r12d, %edx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	call	d_islands
	cmpl	$1, -248(%r14)
	jne	.L91
.L118:
	movl	%r13d, %edx
	movl	%ebx, %esi
	movq	%rbp, %rdi
	addq	$256, %r14
	call	d_islands
	leal	1(%rbx), %edx
	cmpl	%ebx, (%rsp)
	jge	.L107
.L119:
	movq	8(%rsp), %r14
	addl	$1, 20(%rsp)
	addq	$1, %r15
	addq	$4, %r14
	cmpl	%r15d, 4(%rsp)
	jge	.L93
.L95:
	addl	$1, (%rsp)
	movl	(%rsp), %eax
	addq	$256, 24(%rsp)
	cmpl	%eax, 52(%rsp)
	jge	.L83
.L80:
	movl	20(%rsp), %edx
	leaq	.LC0(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	call	__printf_chk@PLT
	jmp	.L96
.L100:
	movl	$2, %ebx
	jmp	.L77
.L99:
	movl	$1, %ebx
	jmp	.L77
.L98:
	movl	$1, %ebx
	jmp	.L76
.L106:
	movl	$0, 20(%rsp)
	jmp	.L80
.L79:
	movq	16600(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L120
	addq	$16616, %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
.L105:
	.cfi_restore_state
	movl	$3, %ebx
	jmp	.L78
.L104:
	movl	$2, %ebx
	jmp	.L78
.L103:
	movl	$1, %ebx
	jmp	.L78
.L102:
	xorl	%ebx, %ebx
	jmp	.L78
.L101:
	movl	$3, %ebx
	jmp	.L77
.L120:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE23:
	.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:

#include <stdio.h>

void d_islands(int[64][64], int, int);//inc counter, call islands()

int main(void){

  char scan[128], give[4];
  int w, h, loop1, loop2, loop3, map[64][64];


  while(1){

    for(loop1 = 0; loop1 < 128; loop1++){
      scan[loop1] = '\0';
    }
    for(loop1 = 0; loop1 < 64; loop1++){
      for(loop2 = 0; loop2 < 64; loop2++){
	map[loop1][loop2] = 0;
      }
    }
    
    fgets(scan, 8, stdin);
    for(loop1 = 0; scan[loop1] != ' '; loop1++){
      give[loop1] = scan[loop1];
    }
    w = atoi(give);
    loop1++;    
    for(loop2 = 0; loop2 < 4; loop2++){
      give[loop2] = '\0';
    }
    for(loop2 = 0; scan[loop1] != '\n'; loop1++, loop2++){
      give[loop2] = scan[loop1];
    }
    h = atoi(give);   // get w h
    
    if((w == 0) && (h == 0)) break;

    for(loop1 = 0; loop1 < 4; loop1++){
      give[loop2] = '\0';
    }
    for(loop1 = 0; loop1 < 128; loop1++){
      scan[loop1] = '\0';
    }
    
    
    for(loop1 = 1; loop1 <= h; loop1++){
      fgets(scan, 128, stdin);
      for(loop2 = 0, loop3 = 1; scan[loop2] != '\n'; loop2++){
	if(scan[loop2] == '0'){
	  loop3++;
	}
	if(scan[loop2] == '1'){
	  map[loop1][loop3] = 1;
	  loop3++;
	}
      }
    }  // load the map

    /*    for(loop1 = 0; loop1 < 10; loop1++){
      for(loop2 = 0; loop2 < 10; loop2++){
	printf("%d ", map[loop1][loop2]);
      }
      printf("\n");
      }*/

    loop3 = 0;
    for(loop1 = 1; loop1 <= h; loop1++){
      for(loop2 = 1; loop2 <= w; loop2++){
	if(map[loop1][loop2] != 0){
	  d_islands(map, loop1, loop2);
	  loop3++;
	}
      }
    }
    printf("%d\n", loop3);

    
  }
  return 0;
    
}


void d_islands(int map[64][64], int h, int w){
  int loop1, loop2;
  map[h][w] = 0;
  /*    for(loop1 = 0; loop1 < 10; loop1++){
      for(loop2 = 0; loop2 < 10; loop2++){
	printf("%d ", map[loop1][loop2]);
      }
      printf("\n");
      }*/
  //  printf("checking %d %d\n", h, w);
  for(loop1 = h - 1; loop1 < h + 2; loop1++){
    for(loop2 = w - 1; loop2 < w + 2; loop2++){ 
      if(map[loop1][loop2] == 1) d_islands(map, loop1, loop2);//printf("1 ");
      //      else printf("0 ");

    }    
  }
}
1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
1 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 1
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
2 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 1
1 0 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 0
0 0
 1 1
0
2 2
0 1
2 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 0 1 0 0
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 0 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 1
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
0 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0
 1 1
0
2 1
0 1
1 0
3 2
1 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 0
1 1 1 0 1
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
0 0 1 0 1
2 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 0 0
1 0 1 1 1
0 0
 1 1
0
2 2
0 1
2 0
3 2
0 1 1
1 1 1
5 4
1 0 1 0 0
1 0 0 0 2
1 1 1 0 0
1 0 0 1 0
5 4
1 1 1 0 1
1 1 1 0 1
1 0 1 0 1
2 0 1 1 1
5 5
0 0 0 0 1
0 0 0 0 0
1 0 1 0 1
0 0 1 1 0
1 0 1 0 1
0 0
 1 1
0
2 2
0 1
1 0
3 2
1 1 1
1 1 1
5 4
2 0 1 0 0
1 0 1 0 0
1 0 1 0 2
1 0 0 1 0
5 4
1 1 1 0 1
1 0 1 0 1
1 0 1 0 1
1 0 1 1 1
5 5
1 0 1 0 1
0 0 0 0 1
1 0 1 0 1
0 0 1 0 0
1 0 1 0 1
0 0

0
1
1
3
1
8
 0
1
1
3
1
7
 0
1
1
3
1
5
 0
1
1
2
1
8
 0
1
1
3
1
6
 0
1
1
3
1
4
 0
1
0
1
2
1
8
 0
1
0
1
2
1
7
 0
1
1
2
1
4
 0
1
1
1
1
7

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>

void d_islands(int[64][64], int, int);//inc counter, call islands()

int main(void){

  char scan[128], give[4];
  int w, h, loop1, loop2, loop3, map[64][64];


  while(1){

    for(loop1 = 0; loop1 < 128; loop1++){
      scan[loop1] = '\0';
    }
    for(loop1 = 0; loop1 < 64; loop1++){
      for(loop2 = 0; loop2 < 64; loop2++){
	map[loop1][loop2] = 0;
      }
    }
    
    fgets(scan, 8, stdin);
    for(loop1 = 0; scan[loop1] != ' '; loop1++){
      give[loop1] = scan[loop1];
    }
    w = atoi(give);
    loop1++;    
    for(loop2 = 0; loop2 < 4; loop2++){
      give[loop2] = '\0';
    }
    for(loop2 = 0; scan[loop1] != '\n'; loop1++, loop2++){
      give[loop2] = scan[loop1];
    }
    h = atoi(give);   // get w h
    
    if((w == 0) && (h == 0)) break;

    for(loop1 = 0; loop1 < 4; loop1++){
      give[loop2] = '\0';
    }
    for(loop1 = 0; loop1 < 128; loop1++){
      scan[loop1] = '\0';
    }
    
    
    for(loop1 = 1; loop1 <= h; loop1++){
      fgets(scan, 128, stdin);
      for(loop2 = 0, loop3 = 1; scan[loop2] != '\n'; loop2++){
	if(scan[loop2] == '0'){
	  loop3++;
	}
	if(scan[loop2] == '1'){
	  map[loop1][loop3] = 1;
	  loop3++;
	}
      }
    }  // load the map

    /*    for(loop1 = 0; loop1 < 10; loop1++){
      for(loop2 = 0; loop2 < 10; loop2++){
	printf("%d ", map[loop1][loop2]);
      }
      printf("\n");
      }*/

    loop3 = 0;
    for(loop1 = 1; loop1 <= h; loop1++){
      for(loop2 = 1; loop2 <= w; loop2++){
	if(map[loop1][loop2] != 0){
	  d_islands(map, loop1, loop2);
	  loop3++;
	}
      }
    }
    printf("%d\n", loop3);

    
  }
  return 0;
    
}


void d_islands(int map[64][64], int h, int w){
  int loop1, loop2;
  map[h][w] = 0;
  /*    for(loop1 = 0; loop1 < 10; loop1++){
      for(loop2 = 0; loop2 < 10; loop2++){
	printf("%d ", map[loop1][loop2]);
      }
      printf("\n");
      }*/
  //  printf("checking %d %d\n", h, w);
  for(loop1 = h - 1; loop1 < h + 2; loop1++){
    for(loop2 = w - 1; loop2 < w + 2; loop2++){ 
      if(map[loop1][loop2] == 1) d_islands(map, loop1, loop2);//printf("1 ");
      //      else printf("0 ");

    }    
  }
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.section	.rodata
.LC0:
	.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
	leaq	-16384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$192, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L31:
	movl	$0, -16564(%rbp)
	jmp	.L2
.L3:
	movl	-16564(%rbp), %eax
	cltq
	movb	$0, -144(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L2:
	cmpl	$127, -16564(%rbp)
	jle	.L3
	movl	$0, -16564(%rbp)
	jmp	.L4
.L7:
	movl	$0, -16560(%rbp)
	jmp	.L5
.L6:
	movl	-16560(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	$0, -16544(%rbp,%rax,4)
	addl	$1, -16560(%rbp)
.L5:
	cmpl	$63, -16560(%rbp)
	jle	.L6
	addl	$1, -16564(%rbp)
.L4:
	cmpl	$63, -16564(%rbp)
	jle	.L7
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$8, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -16564(%rbp)
	jmp	.L8
.L9:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %edx
	movl	-16564(%rbp), %eax
	cltq
	movb	%dl, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L8:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$32, %al
	jne	.L9
	leaq	-148(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, -16552(%rbp)
	addl	$1, -16564(%rbp)
	movl	$0, -16560(%rbp)
	jmp	.L10
.L11:
	movl	-16560(%rbp), %eax
	cltq
	movb	$0, -148(%rbp,%rax)
	addl	$1, -16560(%rbp)
.L10:
	cmpl	$3, -16560(%rbp)
	jle	.L11
	movl	$0, -16560(%rbp)
	jmp	.L12
.L13:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %edx
	movl	-16560(%rbp), %eax
	cltq
	movb	%dl, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
	addl	$1, -16560(%rbp)
.L12:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L13
	leaq	-148(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, -16548(%rbp)
	cmpl	$0, -16552(%rbp)
	jne	.L14
	cmpl	$0, -16548(%rbp)
	je	.L35
.L14:
	movl	$0, -16564(%rbp)
	jmp	.L16
.L17:
	movl	-16560(%rbp), %eax
	cltq
	movb	$0, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L16:
	cmpl	$3, -16564(%rbp)
	jle	.L17
	movl	$0, -16564(%rbp)
	jmp	.L18
.L19:
	movl	-16564(%rbp), %eax
	cltq
	movb	$0, -144(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L18:
	cmpl	$127, -16564(%rbp)
	jle	.L19
	movl	$1, -16564(%rbp)
	jmp	.L20
.L25:
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$128, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -16560(%rbp)
	movl	$1, -16556(%rbp)
	jmp	.L21
.L24:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L22
	addl	$1, -16556(%rbp)
.L22:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$49, %al
	jne	.L23
	movl	-16556(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	$1, -16544(%rbp,%rax,4)
	addl	$1, -16556(%rbp)
.L23:
	addl	$1, -16560(%rbp)
.L21:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L24
	addl	$1, -16564(%rbp)
.L20:
	movl	-16564(%rbp), %eax
	cmpl	-16548(%rbp), %eax
	jle	.L25
	movl	$0, -16556(%rbp)
	movl	$1, -16564(%rbp)
	jmp	.L26
.L30:
	movl	$1, -16560(%rbp)
	jmp	.L27
.L29:
	movl	-16560(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	-16544(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	-16560(%rbp), %edx
	movl	-16564(%rbp), %ecx
	leaq	-16544(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	d_islands
	addl	$1, -16556(%rbp)
.L28:
	addl	$1, -16560(%rbp)
.L27:
	movl	-16560(%rbp), %eax
	cmpl	-16552(%rbp), %eax
	jle	.L29
	addl	$1, -16564(%rbp)
.L26:
	movl	-16564(%rbp), %eax
	cmpl	-16548(%rbp), %eax
	jle	.L30
	movl	-16556(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L31
.L35:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	d_islands
	.type	d_islands, @function
d_islands:
.LFB1:
	.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	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	salq	$8, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L37
.L41:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L38
.L40:
	movl	-8(%rbp), %eax
	cltq
	salq	$8, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L39
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	d_islands
.L39:
	addl	$1, -4(%rbp)
.L38:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jle	.L40
	addl	$1, -8(%rbp)
.L37:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jle	.L41
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	d_islands, .-d_islands
	.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	"%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
	leaq	-16384(%rsp), %r11
.LPSRL0:
	subq	$4096, %rsp
	orq	$0, (%rsp)
	cmpq	%r11, %rsp
	jne	.LPSRL0
	subq	$192, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
.L31:
	movl	$0, -16564(%rbp)
	jmp	.L2
.L3:
	movl	-16564(%rbp), %eax
	cltq
	movb	$0, -144(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L2:
	cmpl	$127, -16564(%rbp)
	jle	.L3
	movl	$0, -16564(%rbp)
	jmp	.L4
.L7:
	movl	$0, -16560(%rbp)
	jmp	.L5
.L6:
	movl	-16560(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	$0, -16544(%rbp,%rax,4)
	addl	$1, -16560(%rbp)
.L5:
	cmpl	$63, -16560(%rbp)
	jle	.L6
	addl	$1, -16564(%rbp)
.L4:
	cmpl	$63, -16564(%rbp)
	jle	.L7
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$8, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -16564(%rbp)
	jmp	.L8
.L9:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %edx
	movl	-16564(%rbp), %eax
	cltq
	movb	%dl, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L8:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$32, %al
	jne	.L9
	leaq	-148(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, -16552(%rbp)
	addl	$1, -16564(%rbp)
	movl	$0, -16560(%rbp)
	jmp	.L10
.L11:
	movl	-16560(%rbp), %eax
	cltq
	movb	$0, -148(%rbp,%rax)
	addl	$1, -16560(%rbp)
.L10:
	cmpl	$3, -16560(%rbp)
	jle	.L11
	movl	$0, -16560(%rbp)
	jmp	.L12
.L13:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %edx
	movl	-16560(%rbp), %eax
	cltq
	movb	%dl, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
	addl	$1, -16560(%rbp)
.L12:
	movl	-16564(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L13
	leaq	-148(%rbp), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	atoi@PLT
	movl	%eax, -16548(%rbp)
	cmpl	$0, -16552(%rbp)
	jne	.L14
	cmpl	$0, -16548(%rbp)
	je	.L35
.L14:
	movl	$0, -16564(%rbp)
	jmp	.L16
.L17:
	movl	-16560(%rbp), %eax
	cltq
	movb	$0, -148(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L16:
	cmpl	$3, -16564(%rbp)
	jle	.L17
	movl	$0, -16564(%rbp)
	jmp	.L18
.L19:
	movl	-16564(%rbp), %eax
	cltq
	movb	$0, -144(%rbp,%rax)
	addl	$1, -16564(%rbp)
.L18:
	cmpl	$127, -16564(%rbp)
	jle	.L19
	movl	$1, -16564(%rbp)
	jmp	.L20
.L25:
	movq	stdin(%rip), %rdx
	leaq	-144(%rbp), %rax
	movl	$128, %esi
	movq	%rax, %rdi
	call	fgets@PLT
	movl	$0, -16560(%rbp)
	movl	$1, -16556(%rbp)
	jmp	.L21
.L24:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$48, %al
	jne	.L22
	addl	$1, -16556(%rbp)
.L22:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$49, %al
	jne	.L23
	movl	-16556(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	$1, -16544(%rbp,%rax,4)
	addl	$1, -16556(%rbp)
.L23:
	addl	$1, -16560(%rbp)
.L21:
	movl	-16560(%rbp), %eax
	cltq
	movzbl	-144(%rbp,%rax), %eax
	cmpb	$10, %al
	jne	.L24
	addl	$1, -16564(%rbp)
.L20:
	movl	-16564(%rbp), %eax
	cmpl	-16548(%rbp), %eax
	jle	.L25
	movl	$0, -16556(%rbp)
	movl	$1, -16564(%rbp)
	jmp	.L26
.L30:
	movl	$1, -16560(%rbp)
	jmp	.L27
.L29:
	movl	-16560(%rbp), %eax
	movslq	%eax, %rdx
	movl	-16564(%rbp), %eax
	cltq
	salq	$6, %rax
	addq	%rdx, %rax
	movl	-16544(%rbp,%rax,4), %eax
	testl	%eax, %eax
	je	.L28
	movl	-16560(%rbp), %edx
	movl	-16564(%rbp), %ecx
	leaq	-16544(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	d_islands
	addl	$1, -16556(%rbp)
.L28:
	addl	$1, -16560(%rbp)
.L27:
	movl	-16560(%rbp), %eax
	cmpl	-16552(%rbp), %eax
	jle	.L29
	addl	$1, -16564(%rbp)
.L26:
	movl	-16564(%rbp), %eax
	cmpl	-16548(%rbp), %eax
	jle	.L30
	movl	-16556(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
	jmp	.L31
.L35:
	nop
	movl	$0, %eax
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L33
	call	__stack_chk_fail@PLT
.L33:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.globl	d_islands
	.type	d_islands, @function
d_islands:
.LFB1:
	.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	%edx, -32(%rbp)
	movl	-28(%rbp), %eax
	cltq
	salq	$8, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-32(%rbp), %eax
	cltq
	movl	$0, (%rdx,%rax,4)
	movl	-28(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -8(%rbp)
	jmp	.L37
.L41:
	movl	-32(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L38
.L40:
	movl	-8(%rbp), %eax
	cltq
	salq	$8, %rax
	movq	%rax, %rdx
	movq	-24(%rbp), %rax
	addq	%rax, %rdx
	movl	-4(%rbp), %eax
	cltq
	movl	(%rdx,%rax,4), %eax
	cmpl	$1, %eax
	jne	.L39
	movl	-4(%rbp), %edx
	movl	-8(%rbp), %ecx
	movq	-24(%rbp), %rax
	movl	%ecx, %esi
	movq	%rax, %rdi
	call	d_islands
.L39:
	addl	$1, -4(%rbp)
.L38:
	movl	-32(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -4(%rbp)
	jle	.L40
	addl	$1, -8(%rbp)
.L37:
	movl	-28(%rbp), %eax
	addl	$1, %eax
	cmpl	%eax, -8(%rbp)
	jle	.L41
	nop
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	d_islands, .-d_islands
	.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:
