40a210:	33 f6                	xor    %esi,%esi
40a212:	89 75 e8             	mov    %esi,-0x18(%ebp)
40a215:	89 75 e4             	mov    %esi,-0x1c(%ebp)
40a218:	89 75 e0             	mov    %esi,-0x20(%ebp)
40a21b:	e9 d3 01 00 00       	jmp    0x40a3f3
40a220:	33 f6                	xor    %esi,%esi
40a222:	66 3b ce             	cmp    %si,%cx
40a225:	75 1f                	jne    0x40a246
40a227:	47                   	inc    %edi
40a228:	f7 45 e8 ff ff ff 7f 	testl  $0x7fffffff,-0x18(%ebp)
40a22f:	75 15                	jne    0x40a246
40a231:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
40a234:	75 10                	jne    0x40a246
40a236:	39 75 e0             	cmp    %esi,-0x20(%ebp)
40a239:	75 0b                	jne    0x40a246
40a23b:	33 c0                	xor    %eax,%eax
40a23d:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
40a241:	e9 ad 01 00 00       	jmp    0x40a3f3
40a246:	66 3b d6             	cmp    %si,%dx
40a249:	75 13                	jne    0x40a25e
40a24b:	47                   	inc    %edi
40a24c:	f7 40 08 ff ff ff 7f 	testl  $0x7fffffff,0x8(%eax)
40a253:	75 09                	jne    0x40a25e
40a255:	39 70 04             	cmp    %esi,0x4(%eax)
40a258:	75 04                	jne    0x40a25e
40a25a:	39 30                	cmp    %esi,(%eax)
40a25c:	74 b4                	je     0x40a212
40a25e:	21 75 a8             	and    %esi,-0x58(%ebp)
40a261:	8d 75 f4             	lea    -0xc(%ebp),%esi
40a264:	c7 45 c0 05 00 00 00 	movl   $0x5,-0x40(%ebp)
40a26b:	8b 4d a8             	mov    -0x58(%ebp),%ecx
40a26e:	8b 55 c0             	mov    -0x40(%ebp),%edx
40a271:	03 c9                	add    %ecx,%ecx
40a273:	89 55 b0             	mov    %edx,-0x50(%ebp)
40a276:	85 d2                	test   %edx,%edx
40a278:	7e 55                	jle    0x40a2cf
40a27a:	8d 4c 0d e0          	lea    -0x20(%ebp,%ecx,1),%ecx
40a27e:	83 c0 08             	add    $0x8,%eax
40a281:	89 4d 94             	mov    %ecx,-0x6c(%ebp)
40a284:	89 45 98             	mov    %eax,-0x68(%ebp)
40a287:	8b 45 94             	mov    -0x6c(%ebp),%eax
40a28a:	0f b7 08             	movzwl (%eax),%ecx
40a28d:	8b 45 98             	mov    -0x68(%ebp),%eax
40a290:	0f b7 00             	movzwl (%eax),%eax
40a293:	8b 56 fc             	mov    -0x4(%esi),%edx
40a296:	0f af c8             	imul   %eax,%ecx
40a299:	83 65 a4 00          	andl   $0x0,-0x5c(%ebp)
40a29d:	8d 04 0a             	lea    (%edx,%ecx,1),%eax
40a2a0:	3b c2                	cmp    %edx,%eax
40a2a2:	72 04                	jb     0x40a2a8
40a2a4:	3b c1                	cmp    %ecx,%eax
40a2a6:	73 07                	jae    0x40a2af
40a2a8:	c7 45 a4 01 00 00 00 	movl   $0x1,-0x5c(%ebp)
40a2af:	83 7d a4 00          	cmpl   $0x0,-0x5c(%ebp)
40a2b3:	89 46 fc             	mov    %eax,-0x4(%esi)
40a2b6:	74 03                	je     0x40a2bb
40a2b8:	66 ff 06             	incw   (%esi)
40a2bb:	83 45 94 02          	addl   $0x2,-0x6c(%ebp)
40a2bf:	83 6d 98 02          	subl   $0x2,-0x68(%ebp)
40a2c3:	ff 4d b0             	decl   -0x50(%ebp)
40a2c6:	83 7d b0 00          	cmpl   $0x0,-0x50(%ebp)
40a2ca:	7f bb                	jg     0x40a287
40a2cc:	8b 45 bc             	mov    -0x44(%ebp),%eax
40a2cf:	46                   	inc    %esi
40a2d0:	46                   	inc    %esi
40a2d1:	ff 45 a8             	incl   -0x58(%ebp)
40a2d4:	ff 4d c0             	decl   -0x40(%ebp)
40a2d7:	83 7d c0 00          	cmpl   $0x0,-0x40(%ebp)
40a2db:	7f 8e                	jg     0x40a26b
40a2dd:	81 c7 02 c0 00 00    	add    $0xc002,%edi
40a2e3:	66 85 ff             	test   %di,%di
40a2e6:	7e 3b                	jle    0x40a323
40a2e8:	f7 45 f8 00 00 00 80 	testl  $0x80000000,-0x8(%ebp)
40a2ef:	75 2d                	jne    0x40a31e
40a2f1:	8b 45 f4             	mov    -0xc(%ebp),%eax
40a2f4:	8b 4d f0             	mov    -0x10(%ebp),%ecx
40a2f7:	d1 65 f0             	shll   $1,-0x10(%ebp)
40a2fa:	8b d0                	mov    %eax,%edx
40a2fc:	03 c0                	add    %eax,%eax
40a2fe:	c1 e9 1f             	shr    $0x1f,%ecx
40a301:	0b c1                	or     %ecx,%eax
40a303:	89 45 f4             	mov    %eax,-0xc(%ebp)
40a306:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a309:	c1 ea 1f             	shr    $0x1f,%edx
40a30c:	03 c0                	add    %eax,%eax
40a30e:	0b c2                	or     %edx,%eax
40a310:	81 c7 ff ff 00 00    	add    $0xffff,%edi
40a316:	89 45 f8             	mov    %eax,-0x8(%ebp)
40a319:	66 85 ff             	test   %di,%di
40a31c:	7f ca                	jg     0x40a2e8
40a31e:	66 85 ff             	test   %di,%di
40a321:	7f 4d                	jg     0x40a370
40a323:	81 c7 ff ff 00 00    	add    $0xffff,%edi
40a329:	66 85 ff             	test   %di,%di
40a32c:	7d 42                	jge    0x40a370
40a32e:	8b c7                	mov    %edi,%eax
40a330:	f7 d8                	neg    %eax
40a332:	0f b7 c0             	movzwl %ax,%eax
40a335:	03 f8                	add    %eax,%edi
40a337:	f6 45 f0 01          	testb  $0x1,-0x10(%ebp)
40a33b:	74 03                	je     0x40a340
40a33d:	ff 45 ac             	incl   -0x54(%ebp)
40a340:	8b 4d f8             	mov    -0x8(%ebp),%ecx
40a343:	8b 75 f4             	mov    -0xc(%ebp),%esi
40a346:	8b 55 f4             	mov    -0xc(%ebp),%edx
40a349:	d1 6d f8             	shrl   $1,-0x8(%ebp)
40a34c:	c1 e1 1f             	shl    $0x1f,%ecx
40a34f:	d1 ee                	shr    $1,%esi
40a351:	0b f1                	or     %ecx,%esi
40a353:	8b 4d f0             	mov    -0x10(%ebp),%ecx
40a356:	c1 e2 1f             	shl    $0x1f,%edx
40a359:	d1 e9                	shr    $1,%ecx
40a35b:	0b ca                	or     %edx,%ecx
40a35d:	48                   	dec    %eax
40a35e:	89 75 f4             	mov    %esi,-0xc(%ebp)
40a361:	89 4d f0             	mov    %ecx,-0x10(%ebp)
40a364:	75 d1                	jne    0x40a337
40a366:	39 45 ac             	cmp    %eax,-0x54(%ebp)
40a369:	74 05                	je     0x40a370
40a36b:	66 83 4d f0 01       	orw    $0x1,-0x10(%ebp)
40a370:	b8 00 80 00 00       	mov    $0x8000,%eax
40a375:	8b c8                	mov    %eax,%ecx
40a377:	66 39 4d f0          	cmp    %cx,-0x10(%ebp)
40a37b:	77 11                	ja     0x40a38e
40a37d:	8b 4d f0             	mov    -0x10(%ebp),%ecx
40a380:	81 e1 ff ff 01 00    	and    $0x1ffff,%ecx
40a386:	81 f9 00 80 01 00    	cmp    $0x18000,%ecx
40a38c:	75 34                	jne    0x40a3c2
40a38e:	83 7d f2 ff          	cmpl   $0xffffffff,-0xe(%ebp)
40a392:	75 2b                	jne    0x40a3bf
40a394:	83 65 f2 00          	andl   $0x0,-0xe(%ebp)
40a398:	83 7d f6 ff          	cmpl   $0xffffffff,-0xa(%ebp)
40a39c:	75 1c                	jne    0x40a3ba
40a39e:	83 65 f6 00          	andl   $0x0,-0xa(%ebp)
40a3a2:	b9 ff ff 00 00       	mov    $0xffff,%ecx
40a3a7:	66 39 4d fa          	cmp    %cx,-0x6(%ebp)
40a3ab:	75 07                	jne    0x40a3b4
40a3ad:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
40a3b1:	47                   	inc    %edi
40a3b2:	eb 0e                	jmp    0x40a3c2
40a3b4:	66 ff 45 fa          	incw   -0x6(%ebp)
40a3b8:	eb 08                	jmp    0x40a3c2
40a3ba:	ff 45 f6             	incl   -0xa(%ebp)
40a3bd:	eb 03                	jmp    0x40a3c2
40a3bf:	ff 45 f2             	incl   -0xe(%ebp)
40a3c2:	b8 ff 7f 00 00       	mov    $0x7fff,%eax
40a3c7:	66 3b f8             	cmp    %ax,%di
40a3ca:	0f 82 ab 00 00 00    	jb     0x40a47b
40a3d0:	33 c0                	xor    %eax,%eax
40a3d2:	33 c9                	xor    %ecx,%ecx
40a3d4:	66 39 45 b8          	cmp    %ax,-0x48(%ebp)
40a3d8:	89 45 e4             	mov    %eax,-0x1c(%ebp)
40a3db:	0f 94 c1             	sete   %cl
40a3de:	89 45 e0             	mov    %eax,-0x20(%ebp)
40a3e1:	49                   	dec    %ecx
40a3e2:	81 e1 00 00 00 80    	and    $0x80000000,%ecx
40a3e8:	81 c1 00 80 ff 7f    	add    $0x7fff8000,%ecx
40a3ee:	89 4d e8             	mov    %ecx,-0x18(%ebp)
40a3f1:	33 f6                	xor    %esi,%esi
40a3f3:	3b de                	cmp    %esi,%ebx
40a3f5:	0f 85 7b fd ff ff    	jne    0x40a176
40a3fb:	8b 4d e8             	mov    -0x18(%ebp),%ecx
40a3fe:	c1 e9 10             	shr    $0x10,%ecx
40a401:	ba ff 3f 00 00       	mov    $0x3fff,%edx
40a406:	b8 ff 7f 00 00       	mov    $0x7fff,%eax
40a40b:	66 3b ca             	cmp    %dx,%cx
40a40e:	0f 82 a3 02 00 00    	jb     0x40a6b7
40a414:	ff 45 b4             	incl   -0x4c(%ebp)
40a417:	33 d2                	xor    %edx,%edx
40a419:	89 55 b0             	mov    %edx,-0x50(%ebp)
40a41c:	89 55 f0             	mov    %edx,-0x10(%ebp)
40a41f:	89 55 f4             	mov    %edx,-0xc(%ebp)
40a422:	89 55 f8             	mov    %edx,-0x8(%ebp)
40a425:	8b 55 da             	mov    -0x26(%ebp),%edx
40a428:	0f b7 c9             	movzwl %cx,%ecx
40a42b:	8b da                	mov    %edx,%ebx
40a42d:	33 d9                	xor    %ecx,%ebx
40a42f:	23 c8                	and    %eax,%ecx
40a431:	23 d0                	and    %eax,%edx
40a433:	81 e3 00 80 00 00    	and    $0x8000,%ebx
40a439:	8b f8                	mov    %eax,%edi
40a43b:	8d 34 0a             	lea    (%edx,%ecx,1),%esi
40a43e:	89 5d a4             	mov    %ebx,-0x5c(%ebp)
40a441:	0f b7 f6             	movzwl %si,%esi
40a444:	66 3b cf             	cmp    %di,%cx
40a447:	0f 83 4c 02 00 00    	jae    0x40a699
40a44d:	66 3b d0             	cmp    %ax,%dx
40a450:	0f 83 43 02 00 00    	jae    0x40a699
40a456:	b8 fd bf 00 00       	mov    $0xbffd,%eax
40a45b:	66 3b f0             	cmp    %ax,%si
40a45e:	0f 87 35 02 00 00    	ja     0x40a699
40a464:	b8 bf 3f 00 00       	mov    $0x3fbf,%eax
40a469:	66 3b f0             	cmp    %ax,%si
40a46c:	77 4b                	ja     0x40a4b9
40a46e:	33 c0                	xor    %eax,%eax
40a470:	89 45 e4             	mov    %eax,-0x1c(%ebp)
40a473:	89 45 e0             	mov    %eax,-0x20(%ebp)
40a476:	e9 39 02 00 00       	jmp    0x40a6b4
40a47b:	66 8b 45 f2          	mov    -0xe(%ebp),%ax
40a47f:	0b 7d b8             	or     -0x48(%ebp),%edi
40a482:	66 89 45 e0          	mov    %ax,-0x20(%ebp)
40a486:	8b 45 f4             	mov    -0xc(%ebp),%eax
40a489:	89 45 e2             	mov    %eax,-0x1e(%ebp)
40a48c:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a48f:	89 45 e6             	mov    %eax,-0x1a(%ebp)
40a492:	66 89 7d ea          	mov    %di,-0x16(%ebp)
40a496:	e9 56 ff ff ff       	jmp    0x40a3f1
40a49b:	33 c0                	xor    %eax,%eax
40a49d:	33 f6                	xor    %esi,%esi
40a49f:	66 39 75 b8          	cmp    %si,-0x48(%ebp)
40a4a3:	0f 94 c0             	sete   %al
40a4a6:	48                   	dec    %eax
40a4a7:	25 00 00 00 80       	and    $0x80000000,%eax
40a4ac:	05 00 80 ff 7f       	add    $0x7fff8000,%eax
40a4b1:	89 45 e8             	mov    %eax,-0x18(%ebp)
40a4b4:	e9 5c fd ff ff       	jmp    0x40a215
40a4b9:	33 c0                	xor    %eax,%eax
40a4bb:	66 3b c8             	cmp    %ax,%cx
40a4be:	75 1d                	jne    0x40a4dd
40a4c0:	46                   	inc    %esi
40a4c1:	f7 45 e8 ff ff ff 7f 	testl  $0x7fffffff,-0x18(%ebp)
40a4c8:	75 13                	jne    0x40a4dd
40a4ca:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
40a4cd:	75 0e                	jne    0x40a4dd
40a4cf:	39 45 e0             	cmp    %eax,-0x20(%ebp)
40a4d2:	75 09                	jne    0x40a4dd
40a4d4:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
40a4d8:	e9 da 01 00 00       	jmp    0x40a6b7
40a4dd:	66 3b d0             	cmp    %ax,%dx
40a4e0:	75 18                	jne    0x40a4fa
40a4e2:	46                   	inc    %esi
40a4e3:	f7 45 d8 ff ff ff 7f 	testl  $0x7fffffff,-0x28(%ebp)
40a4ea:	75 0e                	jne    0x40a4fa
40a4ec:	39 45 d4             	cmp    %eax,-0x2c(%ebp)
40a4ef:	75 09                	jne    0x40a4fa
40a4f1:	39 45 d0             	cmp    %eax,-0x30(%ebp)
40a4f4:	0f 84 76 ff ff ff    	je     0x40a470
40a4fa:	89 45 a8             	mov    %eax,-0x58(%ebp)
40a4fd:	8d 7d f4             	lea    -0xc(%ebp),%edi
40a500:	c7 45 c0 05 00 00 00 	movl   $0x5,-0x40(%ebp)
40a507:	8b 45 a8             	mov    -0x58(%ebp),%eax
40a50a:	8b 4d c0             	mov    -0x40(%ebp),%ecx
40a50d:	03 c0                	add    %eax,%eax
40a50f:	89 4d ac             	mov    %ecx,-0x54(%ebp)
40a512:	85 c9                	test   %ecx,%ecx
40a514:	7e 4a                	jle    0x40a560
40a516:	8d 4d d8             	lea    -0x28(%ebp),%ecx
40a519:	89 4d b8             	mov    %ecx,-0x48(%ebp)
40a51c:	8d 44 05 e0          	lea    -0x20(%ebp,%eax,1),%eax
40a520:	8b 4d b8             	mov    -0x48(%ebp),%ecx
40a523:	0f b7 10             	movzwl (%eax),%edx
40a526:	0f b7 09             	movzwl (%ecx),%ecx
40a529:	83 65 bc 00          	andl   $0x0,-0x44(%ebp)
40a52d:	0f af ca             	imul   %edx,%ecx
40a530:	8b 57 fc             	mov    -0x4(%edi),%edx
40a533:	8d 1c 0a             	lea    (%edx,%ecx,1),%ebx
40a536:	3b da                	cmp    %edx,%ebx
40a538:	72 04                	jb     0x40a53e
40a53a:	3b d9                	cmp    %ecx,%ebx
40a53c:	73 07                	jae    0x40a545
40a53e:	c7 45 bc 01 00 00 00 	movl   $0x1,-0x44(%ebp)
40a545:	83 7d bc 00          	cmpl   $0x0,-0x44(%ebp)
40a549:	89 5f fc             	mov    %ebx,-0x4(%edi)
40a54c:	74 03                	je     0x40a551
40a54e:	66 ff 07             	incw   (%edi)
40a551:	83 6d b8 02          	subl   $0x2,-0x48(%ebp)
40a555:	40                   	inc    %eax
40a556:	40                   	inc    %eax
40a557:	ff 4d ac             	decl   -0x54(%ebp)
40a55a:	83 7d ac 00          	cmpl   $0x0,-0x54(%ebp)
40a55e:	7f c0                	jg     0x40a520
40a560:	47                   	inc    %edi
40a561:	47                   	inc    %edi
40a562:	ff 45 a8             	incl   -0x58(%ebp)
40a565:	ff 4d c0             	decl   -0x40(%ebp)
40a568:	83 7d c0 00          	cmpl   $0x0,-0x40(%ebp)
40a56c:	7f 99                	jg     0x40a507
40a56e:	81 c6 02 c0 00 00    	add    $0xc002,%esi
40a574:	66 85 f6             	test   %si,%si
40a577:	7e 37                	jle    0x40a5b0
40a579:	8b 7d f8             	mov    -0x8(%ebp),%edi
40a57c:	85 ff                	test   %edi,%edi
40a57e:	78 2b                	js     0x40a5ab
40a580:	8b 45 f4             	mov    -0xc(%ebp),%eax
40a583:	8b 4d f0             	mov    -0x10(%ebp),%ecx
40a586:	d1 65 f0             	shll   $1,-0x10(%ebp)
40a589:	8b d0                	mov    %eax,%edx
40a58b:	03 c0                	add    %eax,%eax
40a58d:	c1 e9 1f             	shr    $0x1f,%ecx
40a590:	0b c1                	or     %ecx,%eax
40a592:	89 45 f4             	mov    %eax,-0xc(%ebp)
40a595:	c1 ea 1f             	shr    $0x1f,%edx
40a598:	8d 04 3f             	lea    (%edi,%edi,1),%eax
40a59b:	0b c2                	or     %edx,%eax
40a59d:	81 c6 ff ff 00 00    	add    $0xffff,%esi
40a5a3:	89 45 f8             	mov    %eax,-0x8(%ebp)
40a5a6:	66 85 f6             	test   %si,%si
40a5a9:	7f ce                	jg     0x40a579
40a5ab:	66 85 f6             	test   %si,%si
40a5ae:	7f 4d                	jg     0x40a5fd
40a5b0:	81 c6 ff ff 00 00    	add    $0xffff,%esi
40a5b6:	66 85 f6             	test   %si,%si
40a5b9:	7d 42                	jge    0x40a5fd
40a5bb:	8b c6                	mov    %esi,%eax
40a5bd:	f7 d8                	neg    %eax
40a5bf:	0f b7 c0             	movzwl %ax,%eax
40a5c2:	03 f0                	add    %eax,%esi
40a5c4:	f6 45 f0 01          	testb  $0x1,-0x10(%ebp)
40a5c8:	74 03                	je     0x40a5cd
40a5ca:	ff 45 b0             	incl   -0x50(%ebp)
40a5cd:	8b 4d f8             	mov    -0x8(%ebp),%ecx
40a5d0:	8b 7d f4             	mov    -0xc(%ebp),%edi
40a5d3:	8b 55 f4             	mov    -0xc(%ebp),%edx
40a5d6:	d1 6d f8             	shrl   $1,-0x8(%ebp)
40a5d9:	c1 e1 1f             	shl    $0x1f,%ecx
40a5dc:	d1 ef                	shr    $1,%edi
40a5de:	0b f9                	or     %ecx,%edi
40a5e0:	8b 4d f0             	mov    -0x10(%ebp),%ecx
40a5e3:	c1 e2 1f             	shl    $0x1f,%edx
40a5e6:	d1 e9                	shr    $1,%ecx
40a5e8:	0b ca                	or     %edx,%ecx
40a5ea:	48                   	dec    %eax
40a5eb:	89 7d f4             	mov    %edi,-0xc(%ebp)
40a5ee:	89 4d f0             	mov    %ecx,-0x10(%ebp)
40a5f1:	75 d1                	jne    0x40a5c4
40a5f3:	39 45 b0             	cmp    %eax,-0x50(%ebp)
40a5f6:	74 05                	je     0x40a5fd
40a5f8:	66 83 4d f0 01       	orw    $0x1,-0x10(%ebp)
40a5fd:	b8 00 80 00 00       	mov    $0x8000,%eax
40a602:	8b c8                	mov    %eax,%ecx
40a604:	66 39 4d f0          	cmp    %cx,-0x10(%ebp)
40a608:	77 11                	ja     0x40a61b
40a60a:	8b 4d f0             	mov    -0x10(%ebp),%ecx
40a60d:	81 e1 ff ff 01 00    	and    $0x1ffff,%ecx
40a613:	81 f9 00 80 01 00    	cmp    $0x18000,%ecx
40a619:	75 34                	jne    0x40a64f
40a61b:	83 7d f2 ff          	cmpl   $0xffffffff,-0xe(%ebp)
40a61f:	75 2b                	jne    0x40a64c
40a621:	83 65 f2 00          	andl   $0x0,-0xe(%ebp)
40a625:	83 7d f6 ff          	cmpl   $0xffffffff,-0xa(%ebp)
40a629:	75 1c                	jne    0x40a647
40a62b:	83 65 f6 00          	andl   $0x0,-0xa(%ebp)
40a62f:	b9 ff ff 00 00       	mov    $0xffff,%ecx
40a634:	66 39 4d fa          	cmp    %cx,-0x6(%ebp)
40a638:	75 07                	jne    0x40a641
40a63a:	66 89 45 fa          	mov    %ax,-0x6(%ebp)
40a63e:	46                   	inc    %esi
40a63f:	eb 0e                	jmp    0x40a64f
40a641:	66 ff 45 fa          	incw   -0x6(%ebp)
40a645:	eb 08                	jmp    0x40a64f