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>

#define BOARD_WIDTH_MAX 5
#define BOARD_HEIGHT_MAX 10

#define DELETE_THRESHOLD 3

typedef struct {
	int W,H;
	int score;
	int board[BOARD_HEIGHT_MAX][BOARD_WIDTH_MAX];
} game_t;

int game_delete(game_t *game) {
	int deleted=0;
	int i,j,k;
	for(i=0;i<game->H;i++) {
		int cnt=1;
		for(j=1;j<=game->W;j++) {
			if(j>=game->W || game->board[i][j]!=game->board[i][j-1]) {
				if(cnt>=DELETE_THRESHOLD && game->board[i][j-1]>0) {
					game->score+=game->board[i][j-1]*cnt;
					for(k=j-cnt;k<j;k++)game->board[i][k]=0;
					deleted=1;
				}
				cnt=1;
			} else {
				cnt++;
			}
		}
	}
	return deleted;
}

void game_fall(game_t *game) {
	int i,j,k;
	for(i=game->H-1;i>0;i--) {
		for(j=0;j<game->W;j++) {
			if(game->board[i][j]==0) {
				for(k=i-1;k>=0 && game->board[k][j]==0;k--);
				if(k>=0) {
					game->board[i][j]=game->board[k][j];
					game->board[k][j]=0;
				}
			}
		}
	}
}

int main(void) {
	game_t game;
	game.W=5;
	while(scanf("%d",&game.H)==1 && game.H>0) {
		int i,j;
		for(i=0;i<game.H;i++) {
			for(j=0;j<game.W;j++) {
				if(scanf("%d",&game.board[i][j])!=1)return 1;
			}
		}
		game.score=0;
		while(game_delete(&game))game_fall(&game);
		printf("%d\n",game.score);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	game_delete
	.type	game_delete, @function
game_delete:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L11:
	movl	$1, -4(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L3
.L10:
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movq	-40(%rbp), %rdx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %esi
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rdi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	movl	12(%rdx,%rax,4), %eax
	cmpl	%eax, %esi
	je	.L5
.L4:
	cmpl	$2, -4(%rbp)
	jle	.L6
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L6
	movq	-40(%rbp), %rax
	movl	8(%rax), %esi
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rdi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	movl	12(%rdx,%rax,4), %eax
	imull	-4(%rbp), %eax
	leal	(%rsi,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, 8(%rax)
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L7
.L8:
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	$0, 12(%rdx,%rax,4)
	addl	$1, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L8
	movl	$1, -20(%rbp)
.L6:
	movl	$1, -4(%rbp)
	jmp	.L9
.L5:
	addl	$1, -4(%rbp)
.L9:
	addl	$1, -12(%rbp)
.L3:
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L10
	addl	$1, -16(%rbp)
.L2:
	movq	-40(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	game_delete, .-game_delete
	.globl	game_fall
	.type	game_fall, @function
game_fall:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L14
.L21:
	movl	$0, -8(%rbp)
	jmp	.L15
.L20:
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L16
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L17
.L19:
	subl	$1, -4(%rbp)
.L17:
	cmpl	$0, -4(%rbp)
	js	.L18
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L19
.L18:
	cmpl	$0, -4(%rbp)
	js	.L16
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %ecx
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdi
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	addq	%rdi, %rax
	movl	%ecx, 12(%rdx,%rax,4)
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	$0, 12(%rdx,%rax,4)
.L16:
	addl	$1, -8(%rbp)
.L15:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L20
	subl	$1, -12(%rbp)
.L14:
	cmpl	$0, -12(%rbp)
	jg	.L21
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	game_fall, .-game_fall
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$5, -224(%rbp)
	jmp	.L23
.L33:
	movl	$0, -232(%rbp)
	jmp	.L24
.L29:
	movl	$0, -228(%rbp)
	jmp	.L25
.L28:
	leaq	-224(%rbp), %rcx
	movl	-228(%rbp), %eax
	movslq	%eax, %rsi
	movl	-232(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	$12, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L26
	movl	$1, %eax
	jmp	.L34
.L26:
	addl	$1, -228(%rbp)
.L25:
	movl	-224(%rbp), %eax
	cmpl	%eax, -228(%rbp)
	jl	.L28
	addl	$1, -232(%rbp)
.L24:
	movl	-220(%rbp), %eax
	cmpl	%eax, -232(%rbp)
	jl	.L29
	movl	$0, -216(%rbp)
	jmp	.L30
.L31:
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	game_fall
.L30:
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	game_delete
	testl	%eax, %eax
	jne	.L31
	movl	-216(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L23:
	leaq	-224(%rbp), %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L32
	movl	-220(%rbp), %eax
	testl	%eax, %eax
	jg	.L33
.L32:
	movl	$0, %eax
.L34:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	game_delete
	.type	game_delete, @function
game_delete:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	4(%rdi), %r9d
	testl	%r9d, %r9d
	jle	.L29
	movl	(%rdi), %r8d
	movq	%rdi, %rax
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	xorl	%r12d, %r12d
	movl	$4, %r11d
	xorl	%r10d, %r10d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L70:
	cmpl	$2, %r8d
	je	.L27
	movl	$1, %ebp
	cmpl	20(%rax,%rcx,4), %edx
	je	.L8
	cmpl	$3, %r8d
	je	.L27
	movl	20(%rax,%rcx,4), %ebx
	cmpl	%ebx, 24(%rax,%rcx,4)
	je	.L68
.L9:
	cmpl	$4, %r8d
	jle	.L27
	movl	24(%rax,%rcx,4), %ebx
	cmpl	%ebx, 28(%rax,%rcx,4)
	je	.L67
	.p2align 4,,10
	.p2align 3
.L27:
	addl	$1, %edi
	addq	$5, %rcx
	cmpl	%r9d, %edi
	je	.L1
.L3:
	testl	%r8d, %r8d
	jle	.L27
	cmpl	$1, %r8d
	je	.L27
	movl	16(%rax,%rcx,4), %edx
	cmpl	%edx, 12(%rax,%rcx,4)
	jne	.L70
	cmpl	$2, %r8d
	je	.L27
	movl	20(%rax,%rcx,4), %esi
	cmpl	%esi, %edx
	je	.L32
	cmpl	$3, %r8d
	je	.L27
	cmpl	%esi, 24(%rax,%rcx,4)
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L68:
	movl	$1, %ebp
.L10:
	addl	$1, %ebp
	cmpl	$4, %r8d
	jle	.L71
	movl	24(%rax,%rcx,4), %edx
	cmpl	%edx, 28(%rax,%rcx,4)
	je	.L13
	cmpl	$2, %ebp
	je	.L27
	testl	%edx, %edx
	jle	.L27
	movl	%r11d, %esi
	imull	%ebp, %edx
	addl	%edx, 8(%rax)
	movl	%ebp, %edx
	subl	%ebp, %esi
	salq	$2, %rdx
	movslq	%esi, %rsi
	movl	%edx, %ebx
	leaq	3(%rcx,%rsi), %rsi
	leaq	(%rax,%rsi,4), %rsi
	movq	$0, (%rsi)
	movq	$0, -8(%rsi,%rbx)
	leaq	8(%rsi), %rbx
	andq	$-8, %rbx
	subq	%rbx, %rsi
	addl	%esi, %edx
	andl	$-8, %edx
	cmpl	$8, %edx
	jb	.L19
	andl	$-8, %edx
	xorl	%esi, %esi
.L16:
	movl	%esi, %ebp
	addl	$8, %esi
	movq	%r10, (%rbx,%rbp)
	cmpl	%edx, %esi
	jb	.L16
	jmp	.L19
.L29:
	xorl	%r12d, %r12d
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	movl	%r12d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore_state
	movl	$2, %ebp
.L8:
	addl	$1, %ebp
	cmpl	$3, %r8d
	jle	.L33
	movl	24(%rax,%rcx,4), %esi
	movl	20(%rax,%rcx,4), %edx
	cmpl	%edx, %esi
	je	.L10
	cmpl	$3, %ebp
	jne	.L9
	testl	%edx, %edx
	jg	.L14
	cmpl	$4, %r8d
	je	.L27
	cmpl	28(%rax,%rcx,4), %esi
	jne	.L27
.L67:
	movl	$1, %ebp
.L13:
	addl	$1, %ebp
	movl	$5, %esi
.L11:
	cmpl	%esi, %r8d
	jl	.L27
.L25:
	cmpl	$2, %ebp
	je	.L27
	leal	-1(%rsi), %ebx
	movslq	%edi, %rdx
	movslq	%ebx, %r13
	leaq	(%rdx,%rdx,4), %rdx
	addq	%r13, %rdx
	movl	12(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L27
	subl	%ebp, %esi
	imull	%ebp, %edx
	addl	%edx, 8(%rax)
	subl	%esi, %ebx
	movslq	%esi, %rsi
	leal	1(%rbx), %edx
	leaq	3(%rcx,%rsi), %rsi
	salq	$2, %rdx
	leaq	(%rax,%rsi,4), %rsi
	cmpl	$8, %edx
	jnb	.L18
	testb	$4, %dl
	jne	.L72
	testl	%edx, %edx
	je	.L19
	movb	$0, (%rsi)
.L19:
	movl	$1, %r12d
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edx, %ebx
	movq	$0, (%rsi)
	movq	$0, -8(%rsi,%rbx)
	leaq	8(%rsi), %rbx
	andq	$-8, %rbx
	subq	%rbx, %rsi
	addl	%esi, %edx
	andl	$-8, %edx
	cmpl	$8, %edx
	jb	.L19
	andl	$-8, %edx
	xorl	%esi, %esi
.L22:
	movl	%esi, %ebp
	addl	$8, %esi
	movq	%r10, (%rbx,%rbp)
	cmpl	%edx, %esi
	jb	.L22
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	leal	(%rdx,%rdx,2), %edx
	addl	%edx, 8(%rax)
	leaq	12(%rax,%rcx,4), %rdx
	movl	$1, %r12d
	movq	$0, (%rdx)
	movl	$0, 8(%rdx)
	cmpl	$4, %r8d
	je	.L27
	movl	28(%rax,%rcx,4), %ebx
	cmpl	%ebx, 24(%rax,%rcx,4)
	jne	.L27
	jmp	.L67
.L72:
	movl	%edx, %edx
	movl	$0, (%rsi)
	movl	$0, -4(%rsi,%rdx)
	jmp	.L19
.L33:
	movl	$3, %esi
	jmp	.L11
.L71:
	movl	$4, %esi
	jmp	.L25
	.cfi_endproc
.LFE23:
	.size	game_delete, .-game_delete
	.p2align 4
	.globl	game_fall
	.type	game_fall, @function
game_fall:
.LFB24:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	leal	-1(%rax), %edx
	testl	%edx, %edx
	jle	.L130
	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
	movl	(%rdi), %ebp
	movq	%rdi, %rbx
	testl	%ebp, %ebp
	jle	.L73
	leal	-3(%rax), %r12d
	leal	-4(%rax), %r13d
	movslq	%edx, %rdx
	leal	-5(%rax), %r14d
	leal	-6(%rax), %r8d
	leal	-7(%rax), %r9d
	leal	-8(%rax), %r11d
	leal	-9(%rax), %r10d
	subl	$10, %eax
	movl	%eax, -72(%rsp)
	leaq	(%rdx,%rdx,4), %rax
	leaq	0(,%rax,4), %r15
	.p2align 4,,10
	.p2align 3
.L76:
	movslq	%r12d, %rdx
	leal	-8(%r12), %esi
	leal	1(%r12), %edi
	movq	%rbx, %rax
	leaq	(%rdx,%rdx,4), %rdx
	movl	%esi, -24(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r13d, %rdx
	movl	%edi, -4(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -104(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r14d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -96(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r8d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -88(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r9d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -80(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r11d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -64(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r10d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -56(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	-72(%rsp), %rdx
	movq	%rcx, -48(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	leaq	0(,%rdx,4), %rcx
	movslq	%esi, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -40(%rsp)
	leaq	0(,%rdx,4), %rsi
	movq	%rsi, -32(%rsp)
	leal	-9(%r12), %esi
	movslq	%esi, %rdx
	movl	%esi, -20(%rsp)
	leal	-10(%r12), %esi
	leaq	(%rdx,%rdx,4), %rdx
	movl	%esi, -8(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%edi, %rdx
	leaq	(%rdx,%rdx,4), %rdi
	movq	%rcx, -16(%rsp)
	xorl	%ecx, %ecx
	movq	%rdi, -112(%rsp)
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L77:
	addl	$1, %ecx
	addq	$4, %rax
	cmpl	%ecx, %ebp
	je	.L133
.L81:
	movl	12(%rax,%r15), %edx
	testl	%edx, %edx
	jne	.L77
	movq	-112(%rsp), %rsi
	movslq	%ecx, %rdi
	leaq	(%rsi,%rdi), %rdx
	movl	12(%rbx,%rdx,4), %edx
	testl	%edx, %edx
	jne	.L82
	cmpl	$-1, %r12d
	je	.L77
	movq	-104(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L83
	cmpl	$-1, %r13d
	je	.L77
	movq	-96(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L84
	cmpl	$-1, %r14d
	je	.L77
	movq	-88(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L85
	cmpl	$-1, %r8d
	je	.L77
	movq	-80(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L86
	cmpl	$-1, %r9d
	je	.L77
	movq	-64(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L87
	cmpl	$-1, %r11d
	je	.L77
	movq	-56(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L88
	cmpl	$-1, %r10d
	je	.L77
	movq	-48(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L89
	cmpl	$-1, -72(%rsp)
	je	.L77
	movq	-40(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L90
	cmpl	$-1, -24(%rsp)
	je	.L77
	movq	-32(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L91
	cmpl	$-1, -20(%rsp)
	je	.L77
	movq	-16(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L92
	movslq	-8(%rsp), %rsi
	cmpl	$-1, %esi
	jne	.L79
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L80:
	subq	$1, %rsi
	cmpl	$-1, %esi
	je	.L77
.L79:
	leaq	(%rsi,%rsi,4), %rdx
	movl	%esi, -68(%rsp)
	movl	12(%rax,%rdx,4), %edx
	testl	%edx, %edx
	je	.L80
	.p2align 4,,10
	.p2align 3
.L78:
	movslq	-68(%rsp), %rsi
	movl	%edx, 12(%rax,%r15)
	addl	$1, %ecx
	addq	$4, %rax
	leaq	(%rsi,%rsi,4), %rdx
	addq	%rdi, %rdx
	movl	$0, 12(%rbx,%rdx,4)
	cmpl	%ecx, %ebp
	jne	.L81
	.p2align 4,,10
	.p2align 3
.L133:
	subl	$1, %r12d
	subl	$1, %r13d
	subl	$1, %r14d
	subl	$1, %r8d
	subl	$1, %r9d
	subl	$1, %r11d
	subl	$1, %r10d
	subq	$20, %r15
	subl	$1, -72(%rsp)
	cmpl	$-2, %r12d
	jne	.L76
.L73:
	popq	%rbx
	.cfi_remember_state
	.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
.L82:
	.cfi_restore_state
	movl	-4(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L83:
	movl	%r12d, -68(%rsp)
	jmp	.L78
.L84:
	movl	%r13d, -68(%rsp)
	jmp	.L78
.L85:
	movl	%r14d, -68(%rsp)
	jmp	.L78
.L86:
	movl	%r8d, -68(%rsp)
	jmp	.L78
.L87:
	movl	%r9d, -68(%rsp)
	jmp	.L78
.L88:
	movl	%r11d, -68(%rsp)
	jmp	.L78
.L89:
	movl	%r10d, -68(%rsp)
	jmp	.L78
.L90:
	movl	-72(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L91:
	movl	-24(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L92:
	movl	-20(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L130:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE24:
	.size	game_fall, .-game_fall
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	.LC0(%rip), %rbx
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movl	$5, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rax, %rsi
.L135:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%eax, %r12d
	cmpl	$1, %eax
	jne	.L147
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L147
	movl	16(%rsp), %eax
	leaq	28(%rsp), %rbp
	xorl	%r13d, %r13d
	testl	%eax, %eax
	jle	.L143
.L145:
	movq	%rbp, %r14
	xorl	%r15d, %r15d
	jmp	.L137
	.p2align 4,,10
	.p2align 3
.L152:
	movl	16(%rsp), %eax
	addl	$1, %r15d
	addq	$4, %r14
	cmpl	%r15d, %eax
	jle	.L151
.L137:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L152
.L134:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L153
	addq	$248, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
	.p2align 4,,10
	.p2align 3
.L151:
	.cfi_restore_state
	leal	1(%r13), %edx
	cmpl	20(%rsp), %edx
	jge	.L143
	addq	$1, %r13
	addq	$20, %rbp
	testl	%eax, %eax
	jg	.L145
.L143:
	movl	$0, 24(%rsp)
	leaq	16(%rsp), %rbp
	jmp	.L139
	.p2align 4,,10
	.p2align 3
.L140:
	movq	%rbp, %rdi
	call	game_fall
.L139:
	movq	%rbp, %rdi
	call	game_delete
	testl	%eax, %eax
	jne	.L140
	movl	24(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rsi
	jmp	.L135
.L147:
	xorl	%r12d, %r12d
	jmp	.L134
.L153:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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	game_delete
	.type	game_delete, @function
game_delete:
.LFB23:
	.cfi_startproc
	endbr64
	pushq	%r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	pushq	%r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	pushq	%rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	pushq	%rbx
	.cfi_def_cfa_offset 40
	.cfi_offset 3, -40
	movl	4(%rdi), %r9d
	testl	%r9d, %r9d
	jle	.L29
	movl	(%rdi), %r8d
	movq	%rdi, %rax
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	xorl	%r12d, %r12d
	movl	$4, %r11d
	xorl	%r10d, %r10d
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L70:
	cmpl	$2, %r8d
	je	.L27
	movl	$1, %ebp
	cmpl	20(%rax,%rcx,4), %edx
	je	.L8
	cmpl	$3, %r8d
	je	.L27
	movl	20(%rax,%rcx,4), %ebx
	cmpl	%ebx, 24(%rax,%rcx,4)
	je	.L68
.L9:
	cmpl	$4, %r8d
	jle	.L27
	movl	24(%rax,%rcx,4), %ebx
	cmpl	%ebx, 28(%rax,%rcx,4)
	je	.L67
	.p2align 4,,10
	.p2align 3
.L27:
	addl	$1, %edi
	addq	$5, %rcx
	cmpl	%r9d, %edi
	je	.L1
.L3:
	testl	%r8d, %r8d
	jle	.L27
	cmpl	$1, %r8d
	je	.L27
	movl	16(%rax,%rcx,4), %edx
	cmpl	%edx, 12(%rax,%rcx,4)
	jne	.L70
	cmpl	$2, %r8d
	je	.L27
	movl	20(%rax,%rcx,4), %esi
	cmpl	%esi, %edx
	je	.L32
	cmpl	$3, %r8d
	je	.L27
	cmpl	%esi, 24(%rax,%rcx,4)
	jne	.L9
	.p2align 4,,10
	.p2align 3
.L68:
	movl	$1, %ebp
.L10:
	addl	$1, %ebp
	cmpl	$4, %r8d
	jle	.L71
	movl	24(%rax,%rcx,4), %edx
	cmpl	%edx, 28(%rax,%rcx,4)
	je	.L13
	cmpl	$2, %ebp
	je	.L27
	testl	%edx, %edx
	jle	.L27
	movl	%r11d, %esi
	imull	%ebp, %edx
	addl	%edx, 8(%rax)
	movl	%ebp, %edx
	subl	%ebp, %esi
	salq	$2, %rdx
	movslq	%esi, %rsi
	movl	%edx, %ebx
	leaq	3(%rcx,%rsi), %rsi
	leaq	(%rax,%rsi,4), %rsi
	movq	$0, (%rsi)
	movq	$0, -8(%rsi,%rbx)
	leaq	8(%rsi), %rbx
	andq	$-8, %rbx
	subq	%rbx, %rsi
	addl	%esi, %edx
	andl	$-8, %edx
	cmpl	$8, %edx
	jb	.L19
	andl	$-8, %edx
	xorl	%esi, %esi
.L16:
	movl	%esi, %ebp
	addl	$8, %esi
	movq	%r10, (%rbx,%rbp)
	cmpl	%edx, %esi
	jb	.L16
	jmp	.L19
.L29:
	xorl	%r12d, %r12d
.L1:
	popq	%rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	movl	%r12d, %eax
	popq	%rbp
	.cfi_def_cfa_offset 24
	popq	%r12
	.cfi_def_cfa_offset 16
	popq	%r13
	.cfi_def_cfa_offset 8
	ret
.L32:
	.cfi_restore_state
	movl	$2, %ebp
.L8:
	addl	$1, %ebp
	cmpl	$3, %r8d
	jle	.L33
	movl	24(%rax,%rcx,4), %esi
	movl	20(%rax,%rcx,4), %edx
	cmpl	%edx, %esi
	je	.L10
	cmpl	$3, %ebp
	jne	.L9
	testl	%edx, %edx
	jg	.L14
	cmpl	$4, %r8d
	je	.L27
	cmpl	28(%rax,%rcx,4), %esi
	jne	.L27
.L67:
	movl	$1, %ebp
.L13:
	addl	$1, %ebp
	movl	$5, %esi
.L11:
	cmpl	%esi, %r8d
	jl	.L27
.L25:
	cmpl	$2, %ebp
	je	.L27
	leal	-1(%rsi), %ebx
	movslq	%edi, %rdx
	movslq	%ebx, %r13
	leaq	(%rdx,%rdx,4), %rdx
	addq	%r13, %rdx
	movl	12(%rax,%rdx,4), %edx
	testl	%edx, %edx
	jle	.L27
	subl	%ebp, %esi
	imull	%ebp, %edx
	addl	%edx, 8(%rax)
	subl	%esi, %ebx
	movslq	%esi, %rsi
	leal	1(%rbx), %edx
	leaq	3(%rcx,%rsi), %rsi
	salq	$2, %rdx
	leaq	(%rax,%rsi,4), %rsi
	cmpl	$8, %edx
	jnb	.L18
	testb	$4, %dl
	jne	.L72
	testl	%edx, %edx
	je	.L19
	movb	$0, (%rsi)
.L19:
	movl	$1, %r12d
	jmp	.L27
	.p2align 4,,10
	.p2align 3
.L18:
	movl	%edx, %ebx
	movq	$0, (%rsi)
	movq	$0, -8(%rsi,%rbx)
	leaq	8(%rsi), %rbx
	andq	$-8, %rbx
	subq	%rbx, %rsi
	addl	%esi, %edx
	andl	$-8, %edx
	cmpl	$8, %edx
	jb	.L19
	andl	$-8, %edx
	xorl	%esi, %esi
.L22:
	movl	%esi, %ebp
	addl	$8, %esi
	movq	%r10, (%rbx,%rbp)
	cmpl	%edx, %esi
	jb	.L22
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L14:
	leal	(%rdx,%rdx,2), %edx
	addl	%edx, 8(%rax)
	leaq	12(%rax,%rcx,4), %rdx
	movl	$1, %r12d
	movq	$0, (%rdx)
	movl	$0, 8(%rdx)
	cmpl	$4, %r8d
	je	.L27
	movl	28(%rax,%rcx,4), %ebx
	cmpl	%ebx, 24(%rax,%rcx,4)
	jne	.L27
	jmp	.L67
.L72:
	movl	%edx, %edx
	movl	$0, (%rsi)
	movl	$0, -4(%rsi,%rdx)
	jmp	.L19
.L33:
	movl	$3, %esi
	jmp	.L11
.L71:
	movl	$4, %esi
	jmp	.L25
	.cfi_endproc
.LFE23:
	.size	game_delete, .-game_delete
	.p2align 4
	.globl	game_fall
	.type	game_fall, @function
game_fall:
.LFB24:
	.cfi_startproc
	endbr64
	movl	4(%rdi), %eax
	leal	-1(%rax), %edx
	testl	%edx, %edx
	jle	.L130
	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
	movl	(%rdi), %ebp
	movq	%rdi, %rbx
	testl	%ebp, %ebp
	jle	.L73
	leal	-3(%rax), %r12d
	leal	-4(%rax), %r13d
	movslq	%edx, %rdx
	leal	-5(%rax), %r14d
	leal	-6(%rax), %r8d
	leal	-7(%rax), %r9d
	leal	-8(%rax), %r11d
	leal	-9(%rax), %r10d
	subl	$10, %eax
	movl	%eax, -72(%rsp)
	leaq	(%rdx,%rdx,4), %rax
	leaq	0(,%rax,4), %r15
	.p2align 4,,10
	.p2align 3
.L76:
	movslq	%r12d, %rdx
	leal	-8(%r12), %esi
	leal	1(%r12), %edi
	movq	%rbx, %rax
	leaq	(%rdx,%rdx,4), %rdx
	movl	%esi, -24(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r13d, %rdx
	movl	%edi, -4(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -104(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r14d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -96(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r8d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -88(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r9d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -80(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r11d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -64(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%r10d, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -56(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	-72(%rsp), %rdx
	movq	%rcx, -48(%rsp)
	leaq	(%rdx,%rdx,4), %rdx
	leaq	0(,%rdx,4), %rcx
	movslq	%esi, %rdx
	leaq	(%rdx,%rdx,4), %rdx
	movq	%rcx, -40(%rsp)
	leaq	0(,%rdx,4), %rsi
	movq	%rsi, -32(%rsp)
	leal	-9(%r12), %esi
	movslq	%esi, %rdx
	movl	%esi, -20(%rsp)
	leal	-10(%r12), %esi
	leaq	(%rdx,%rdx,4), %rdx
	movl	%esi, -8(%rsp)
	leaq	0(,%rdx,4), %rcx
	movslq	%edi, %rdx
	leaq	(%rdx,%rdx,4), %rdi
	movq	%rcx, -16(%rsp)
	xorl	%ecx, %ecx
	movq	%rdi, -112(%rsp)
	jmp	.L81
	.p2align 4,,10
	.p2align 3
.L77:
	addl	$1, %ecx
	addq	$4, %rax
	cmpl	%ecx, %ebp
	je	.L133
.L81:
	movl	12(%rax,%r15), %edx
	testl	%edx, %edx
	jne	.L77
	movq	-112(%rsp), %rsi
	movslq	%ecx, %rdi
	leaq	(%rsi,%rdi), %rdx
	movl	12(%rbx,%rdx,4), %edx
	testl	%edx, %edx
	jne	.L82
	cmpl	$-1, %r12d
	je	.L77
	movq	-104(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L83
	cmpl	$-1, %r13d
	je	.L77
	movq	-96(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L84
	cmpl	$-1, %r14d
	je	.L77
	movq	-88(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L85
	cmpl	$-1, %r8d
	je	.L77
	movq	-80(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L86
	cmpl	$-1, %r9d
	je	.L77
	movq	-64(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L87
	cmpl	$-1, %r11d
	je	.L77
	movq	-56(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L88
	cmpl	$-1, %r10d
	je	.L77
	movq	-48(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L89
	cmpl	$-1, -72(%rsp)
	je	.L77
	movq	-40(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L90
	cmpl	$-1, -24(%rsp)
	je	.L77
	movq	-32(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L91
	cmpl	$-1, -20(%rsp)
	je	.L77
	movq	-16(%rsp), %rsi
	movl	12(%rax,%rsi), %edx
	testl	%edx, %edx
	jne	.L92
	movslq	-8(%rsp), %rsi
	cmpl	$-1, %esi
	jne	.L79
	jmp	.L77
	.p2align 4,,10
	.p2align 3
.L80:
	subq	$1, %rsi
	cmpl	$-1, %esi
	je	.L77
.L79:
	leaq	(%rsi,%rsi,4), %rdx
	movl	%esi, -68(%rsp)
	movl	12(%rax,%rdx,4), %edx
	testl	%edx, %edx
	je	.L80
	.p2align 4,,10
	.p2align 3
.L78:
	movslq	-68(%rsp), %rsi
	movl	%edx, 12(%rax,%r15)
	addl	$1, %ecx
	addq	$4, %rax
	leaq	(%rsi,%rsi,4), %rdx
	addq	%rdi, %rdx
	movl	$0, 12(%rbx,%rdx,4)
	cmpl	%ecx, %ebp
	jne	.L81
	.p2align 4,,10
	.p2align 3
.L133:
	subl	$1, %r12d
	subl	$1, %r13d
	subl	$1, %r14d
	subl	$1, %r8d
	subl	$1, %r9d
	subl	$1, %r11d
	subl	$1, %r10d
	subq	$20, %r15
	subl	$1, -72(%rsp)
	cmpl	$-2, %r12d
	jne	.L76
.L73:
	popq	%rbx
	.cfi_remember_state
	.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
.L82:
	.cfi_restore_state
	movl	-4(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L83:
	movl	%r12d, -68(%rsp)
	jmp	.L78
.L84:
	movl	%r13d, -68(%rsp)
	jmp	.L78
.L85:
	movl	%r14d, -68(%rsp)
	jmp	.L78
.L86:
	movl	%r8d, -68(%rsp)
	jmp	.L78
.L87:
	movl	%r9d, -68(%rsp)
	jmp	.L78
.L88:
	movl	%r11d, -68(%rsp)
	jmp	.L78
.L89:
	movl	%r10d, -68(%rsp)
	jmp	.L78
.L90:
	movl	-72(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L91:
	movl	-24(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L92:
	movl	-20(%rsp), %esi
	movl	%esi, -68(%rsp)
	jmp	.L78
.L130:
	.cfi_def_cfa_offset 8
	.cfi_restore 3
	.cfi_restore 6
	.cfi_restore 12
	.cfi_restore 13
	.cfi_restore 14
	.cfi_restore 15
	ret
	.cfi_endproc
.LFE24:
	.size	game_fall, .-game_fall
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB25:
	.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	.LC0(%rip), %rbx
	subq	$248, %rsp
	.cfi_def_cfa_offset 304
	movq	%fs:40, %rax
	movq	%rax, 232(%rsp)
	xorl	%eax, %eax
	leaq	20(%rsp), %rax
	movl	$5, 16(%rsp)
	movq	%rax, 8(%rsp)
	movq	%rax, %rsi
.L135:
	movq	%rbx, %rdi
	xorl	%eax, %eax
	call	__isoc99_scanf@PLT
	movl	%eax, %r12d
	cmpl	$1, %eax
	jne	.L147
	movl	20(%rsp), %eax
	testl	%eax, %eax
	jle	.L147
	movl	16(%rsp), %eax
	leaq	28(%rsp), %rbp
	xorl	%r13d, %r13d
	testl	%eax, %eax
	jle	.L143
.L145:
	movq	%rbp, %r14
	xorl	%r15d, %r15d
	jmp	.L137
	.p2align 4,,10
	.p2align 3
.L152:
	movl	16(%rsp), %eax
	addl	$1, %r15d
	addq	$4, %r14
	cmpl	%r15d, %eax
	jle	.L151
.L137:
	xorl	%eax, %eax
	movq	%r14, %rsi
	movq	%rbx, %rdi
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L152
.L134:
	movq	232(%rsp), %rax
	subq	%fs:40, %rax
	jne	.L153
	addq	$248, %rsp
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	movl	%r12d, %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
	.p2align 4,,10
	.p2align 3
.L151:
	.cfi_restore_state
	leal	1(%r13), %edx
	cmpl	20(%rsp), %edx
	jge	.L143
	addq	$1, %r13
	addq	$20, %rbp
	testl	%eax, %eax
	jg	.L145
.L143:
	movl	$0, 24(%rsp)
	leaq	16(%rsp), %rbp
	jmp	.L139
	.p2align 4,,10
	.p2align 3
.L140:
	movq	%rbp, %rdi
	call	game_fall
.L139:
	movq	%rbp, %rdi
	call	game_delete
	testl	%eax, %eax
	jne	.L140
	movl	24(%rsp), %edx
	leaq	.LC1(%rip), %rsi
	movl	$1, %edi
	call	__printf_chk@PLT
	movq	8(%rsp), %rsi
	jmp	.L135
.L147:
	xorl	%r12d, %r12d
	jmp	.L134
.L153:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE25:
	.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>

#define BOARD_WIDTH_MAX 5
#define BOARD_HEIGHT_MAX 10

#define DELETE_THRESHOLD 3

typedef struct {
	int W,H;
	int score;
	int board[BOARD_HEIGHT_MAX][BOARD_WIDTH_MAX];
} game_t;

int game_delete(game_t *game) {
	int deleted=0;
	int i,j,k;
	for(i=0;i<game->H;i++) {
		int cnt=1;
		for(j=1;j<=game->W;j++) {
			if(j>=game->W || game->board[i][j]!=game->board[i][j-1]) {
				if(cnt>=DELETE_THRESHOLD && game->board[i][j-1]>0) {
					game->score+=game->board[i][j-1]*cnt;
					for(k=j-cnt;k<j;k++)game->board[i][k]=0;
					deleted=1;
				}
				cnt=1;
			} else {
				cnt++;
			}
		}
	}
	return deleted;
}

void game_fall(game_t *game) {
	int i,j,k;
	for(i=game->H-1;i>0;i--) {
		for(j=0;j<game->W;j++) {
			if(game->board[i][j]==0) {
				for(k=i-1;k>=0 && game->board[k][j]==0;k--);
				if(k>=0) {
					game->board[i][j]=game->board[k][j];
					game->board[k][j]=0;
				}
			}
		}
	}
}

int main(void) {
	game_t game;
	game.W=5;
	while(scanf("%d",&game.H)==1 && game.H>0) {
		int i,j;
		for(i=0;i<game.H;i++) {
			for(j=0;j<game.W;j++) {
				if(scanf("%d",&game.board[i][j])!=1)return 1;
			}
		}
		game.score=0;
		while(game_delete(&game))game_fall(&game);
		printf("%d\n",game.score);
	}
	return 0;
}
1
6 9 9 9 9
5
5 9 5 2 9
5 5 6 9 9
4 6 3 6 9
3 3 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 6 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 8 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 2 9
5 5 6 9 9
4 6 3 6 9
3 2 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 6 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 8 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 2 9
5 5 6 9 9
4 6 3 6 9
3 2 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 9 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 8 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 2 9
5 5 6 9 9
4 6 3 6 9
3 2 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 9 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 4 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 2 9
5 5 6 9 9
4 6 3 10 9
3 2 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 9 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 4 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 2 9
5 5 6 9 9
4 6 3 10 9
3 2 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
8 7 7 6 1
4 9 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 12
3
2 2 4 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 5 9
5 5 6 9 9
4 6 3 6 9
3 3 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 2 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 8 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 2 9
5 5 6 9 9
4 6 3 6 9
3 2 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
3 7 7 6 1
4 6 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 8 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 2 9
5 6 6 9 9
4 6 3 10 9
3 2 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
8 7 7 6 1
4 9 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 12
3
2 2 4 7 4
6 5 7 7 7
8 8 9 9 9
0
 1
6 9 9 9 9
5
5 9 5 5 9
5 5 6 9 9
4 6 3 6 9
3 3 2 9 9
2 2 1 1 1
10
3 5 6 5 6
2 2 2 8 3
6 2 5 9 2
7 7 7 6 1
4 2 6 4 9
8 9 1 1 8
5 6 1 8 1
6 8 2 1 2
9 6 3 3 5
5 3 8 8 8
5
1 2 3 4 5
6 7 8 9 1
2 3 4 5 6
7 8 9 1 2
3 4 5 6 7
3
2 2 10 7 4
6 5 7 7 7
8 8 9 9 9
0

36
33
99
0
72
 36
42
99
0
72
 36
42
81
0
72
 36
42
81
0
48
 36
24
81
0
48
 36
24
60
0
48
 36
38
81
0
72
 36
42
60
0
72
 36
9
60
0
48
 36
38
81
0
48

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>

#define BOARD_WIDTH_MAX 5
#define BOARD_HEIGHT_MAX 10

#define DELETE_THRESHOLD 3

typedef struct {
	int W,H;
	int score;
	int board[BOARD_HEIGHT_MAX][BOARD_WIDTH_MAX];
} game_t;

int game_delete(game_t *game) {
	int deleted=0;
	int i,j,k;
	for(i=0;i<game->H;i++) {
		int cnt=1;
		for(j=1;j<=game->W;j++) {
			if(j>=game->W || game->board[i][j]!=game->board[i][j-1]) {
				if(cnt>=DELETE_THRESHOLD && game->board[i][j-1]>0) {
					game->score+=game->board[i][j-1]*cnt;
					for(k=j-cnt;k<j;k++)game->board[i][k]=0;
					deleted=1;
				}
				cnt=1;
			} else {
				cnt++;
			}
		}
	}
	return deleted;
}

void game_fall(game_t *game) {
	int i,j,k;
	for(i=game->H-1;i>0;i--) {
		for(j=0;j<game->W;j++) {
			if(game->board[i][j]==0) {
				for(k=i-1;k>=0 && game->board[k][j]==0;k--);
				if(k>=0) {
					game->board[i][j]=game->board[k][j];
					game->board[k][j]=0;
				}
			}
		}
	}
}

int main(void) {
	game_t game;
	game.W=5;
	while(scanf("%d",&game.H)==1 && game.H>0) {
		int i,j;
		for(i=0;i<game.H;i++) {
			for(j=0;j<game.W;j++) {
				if(scanf("%d",&game.board[i][j])!=1)return 1;
			}
		}
		game.score=0;
		while(game_delete(&game))game_fall(&game);
		printf("%d\n",game.score);
	}
	return 0;
}```

Unoptimized Assembly Code:

```assembly
	.file	"temp.c"
	.text
	.globl	game_delete
	.type	game_delete, @function
game_delete:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L11:
	movl	$1, -4(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L3
.L10:
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movq	-40(%rbp), %rdx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %esi
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rdi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	movl	12(%rdx,%rax,4), %eax
	cmpl	%eax, %esi
	je	.L5
.L4:
	cmpl	$2, -4(%rbp)
	jle	.L6
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L6
	movq	-40(%rbp), %rax
	movl	8(%rax), %esi
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rdi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	movl	12(%rdx,%rax,4), %eax
	imull	-4(%rbp), %eax
	leal	(%rsi,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, 8(%rax)
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L7
.L8:
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	$0, 12(%rdx,%rax,4)
	addl	$1, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L8
	movl	$1, -20(%rbp)
.L6:
	movl	$1, -4(%rbp)
	jmp	.L9
.L5:
	addl	$1, -4(%rbp)
.L9:
	addl	$1, -12(%rbp)
.L3:
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L10
	addl	$1, -16(%rbp)
.L2:
	movq	-40(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	game_delete, .-game_delete
	.globl	game_fall
	.type	game_fall, @function
game_fall:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L14
.L21:
	movl	$0, -8(%rbp)
	jmp	.L15
.L20:
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L16
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L17
.L19:
	subl	$1, -4(%rbp)
.L17:
	cmpl	$0, -4(%rbp)
	js	.L18
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L19
.L18:
	cmpl	$0, -4(%rbp)
	js	.L16
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %ecx
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdi
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	addq	%rdi, %rax
	movl	%ecx, 12(%rdx,%rax,4)
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	$0, 12(%rdx,%rax,4)
.L16:
	addl	$1, -8(%rbp)
.L15:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L20
	subl	$1, -12(%rbp)
.L14:
	cmpl	$0, -12(%rbp)
	jg	.L21
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	game_fall, .-game_fall
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$5, -224(%rbp)
	jmp	.L23
.L33:
	movl	$0, -232(%rbp)
	jmp	.L24
.L29:
	movl	$0, -228(%rbp)
	jmp	.L25
.L28:
	leaq	-224(%rbp), %rcx
	movl	-228(%rbp), %eax
	movslq	%eax, %rsi
	movl	-232(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	$12, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L26
	movl	$1, %eax
	jmp	.L34
.L26:
	addl	$1, -228(%rbp)
.L25:
	movl	-224(%rbp), %eax
	cmpl	%eax, -228(%rbp)
	jl	.L28
	addl	$1, -232(%rbp)
.L24:
	movl	-220(%rbp), %eax
	cmpl	%eax, -232(%rbp)
	jl	.L29
	movl	$0, -216(%rbp)
	jmp	.L30
.L31:
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	game_fall
.L30:
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	game_delete
	testl	%eax, %eax
	jne	.L31
	movl	-216(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L23:
	leaq	-224(%rbp), %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L32
	movl	-220(%rbp), %eax
	testl	%eax, %eax
	jg	.L33
.L32:
	movl	$0, %eax
.L34:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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	game_delete
	.type	game_delete, @function
game_delete:
.LFB0:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -40(%rbp)
	movl	$0, -20(%rbp)
	movl	$0, -16(%rbp)
	jmp	.L2
.L11:
	movl	$1, -4(%rbp)
	movl	$1, -12(%rbp)
	jmp	.L3
.L10:
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jge	.L4
	movq	-40(%rbp), %rdx
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %esi
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rdi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	movl	12(%rdx,%rax,4), %eax
	cmpl	%eax, %esi
	je	.L5
.L4:
	cmpl	$2, -4(%rbp)
	jle	.L6
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jle	.L6
	movq	-40(%rbp), %rax
	movl	8(%rax), %esi
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movq	-40(%rbp), %rdx
	movslq	%eax, %rdi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rdi, %rax
	movl	12(%rdx,%rax,4), %eax
	imull	-4(%rbp), %eax
	leal	(%rsi,%rax), %edx
	movq	-40(%rbp), %rax
	movl	%edx, 8(%rax)
	movl	-12(%rbp), %eax
	subl	-4(%rbp), %eax
	movl	%eax, -8(%rbp)
	jmp	.L7
.L8:
	movq	-40(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-16(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	$0, 12(%rdx,%rax,4)
	addl	$1, -8(%rbp)
.L7:
	movl	-8(%rbp), %eax
	cmpl	-12(%rbp), %eax
	jl	.L8
	movl	$1, -20(%rbp)
.L6:
	movl	$1, -4(%rbp)
	jmp	.L9
.L5:
	addl	$1, -4(%rbp)
.L9:
	addl	$1, -12(%rbp)
.L3:
	movq	-40(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -12(%rbp)
	jle	.L10
	addl	$1, -16(%rbp)
.L2:
	movq	-40(%rbp), %rax
	movl	4(%rax), %eax
	cmpl	%eax, -16(%rbp)
	jl	.L11
	movl	-20(%rbp), %eax
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	game_delete, .-game_delete
	.globl	game_fall
	.type	game_fall, @function
game_fall:
.LFB1:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	movq	%rdi, -24(%rbp)
	movq	-24(%rbp), %rax
	movl	4(%rax), %eax
	subl	$1, %eax
	movl	%eax, -12(%rbp)
	jmp	.L14
.L21:
	movl	$0, -8(%rbp)
	jmp	.L15
.L20:
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-12(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	jne	.L16
	movl	-12(%rbp), %eax
	subl	$1, %eax
	movl	%eax, -4(%rbp)
	jmp	.L17
.L19:
	subl	$1, -4(%rbp)
.L17:
	cmpl	$0, -4(%rbp)
	js	.L18
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %eax
	testl	%eax, %eax
	je	.L19
.L18:
	cmpl	$0, -4(%rbp)
	js	.L16
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	12(%rdx,%rax,4), %ecx
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rdi
	movl	-12(%rbp), %eax
	movslq	%eax, %rsi
	movq	%rsi, %rax
	salq	$2, %rax
	addq	%rsi, %rax
	addq	%rdi, %rax
	movl	%ecx, 12(%rdx,%rax,4)
	movq	-24(%rbp), %rdx
	movl	-8(%rbp), %eax
	movslq	%eax, %rsi
	movl	-4(%rbp), %eax
	movslq	%eax, %rcx
	movq	%rcx, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	%rsi, %rax
	movl	$0, 12(%rdx,%rax,4)
.L16:
	addl	$1, -8(%rbp)
.L15:
	movq	-24(%rbp), %rax
	movl	(%rax), %eax
	cmpl	%eax, -8(%rbp)
	jl	.L20
	subl	$1, -12(%rbp)
.L14:
	cmpl	$0, -12(%rbp)
	jg	.L21
	nop
	nop
	popq	%rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE1:
	.size	game_fall, .-game_fall
	.section	.rodata
.LC0:
	.string	"%d"
.LC1:
	.string	"%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB2:
	.cfi_startproc
	endbr64
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register 6
	subq	$240, %rsp
	movq	%fs:40, %rax
	movq	%rax, -8(%rbp)
	xorl	%eax, %eax
	movl	$5, -224(%rbp)
	jmp	.L23
.L33:
	movl	$0, -232(%rbp)
	jmp	.L24
.L29:
	movl	$0, -228(%rbp)
	jmp	.L25
.L28:
	leaq	-224(%rbp), %rcx
	movl	-228(%rbp), %eax
	movslq	%eax, %rsi
	movl	-232(%rbp), %eax
	movslq	%eax, %rdx
	movq	%rdx, %rax
	salq	$2, %rax
	addq	%rdx, %rax
	addq	%rsi, %rax
	salq	$2, %rax
	addq	%rcx, %rax
	addq	$12, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	je	.L26
	movl	$1, %eax
	jmp	.L34
.L26:
	addl	$1, -228(%rbp)
.L25:
	movl	-224(%rbp), %eax
	cmpl	%eax, -228(%rbp)
	jl	.L28
	addl	$1, -232(%rbp)
.L24:
	movl	-220(%rbp), %eax
	cmpl	%eax, -232(%rbp)
	jl	.L29
	movl	$0, -216(%rbp)
	jmp	.L30
.L31:
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	game_fall
.L30:
	leaq	-224(%rbp), %rax
	movq	%rax, %rdi
	call	game_delete
	testl	%eax, %eax
	jne	.L31
	movl	-216(%rbp), %eax
	movl	%eax, %esi
	leaq	.LC1(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	printf@PLT
.L23:
	leaq	-224(%rbp), %rax
	addq	$4, %rax
	movq	%rax, %rsi
	leaq	.LC0(%rip), %rax
	movq	%rax, %rdi
	movl	$0, %eax
	call	__isoc99_scanf@PLT
	cmpl	$1, %eax
	jne	.L32
	movl	-220(%rbp), %eax
	testl	%eax, %eax
	jg	.L33
.L32:
	movl	$0, %eax
.L34:
	movq	-8(%rbp), %rdx
	subq	%fs:40, %rdx
	je	.L35
	call	__stack_chk_fail@PLT
.L35:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE2:
	.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:
