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
40a647:	ff 45 f6             	incl   -0xa(%ebp)
40a64a:	eb 03                	jmp    0x40a64f
40a64c:	ff 45 f2             	incl   -0xe(%ebp)
40a64f:	b8 ff 7f 00 00       	mov    $0x7fff,%eax
40a654:	66 3b f0             	cmp    %ax,%si
40a657:	72 23                	jb     0x40a67c
40a659:	33 c0                	xor    %eax,%eax
40a65b:	33 c9                	xor    %ecx,%ecx
40a65d:	66 39 45 a4          	cmp    %ax,-0x5c(%ebp)
40a661:	89 45 e4             	mov    %eax,-0x1c(%ebp)
40a664:	0f 94 c1             	sete   %cl
40a667:	89 45 e0             	mov    %eax,-0x20(%ebp)
40a66a:	49                   	dec    %ecx
40a66b:	81 e1 00 00 00 80    	and    $0x80000000,%ecx
40a671:	81 c1 00 80 ff 7f    	add    $0x7fff8000,%ecx
40a677:	89 4d e8             	mov    %ecx,-0x18(%ebp)
40a67a:	eb 3b                	jmp    0x40a6b7
40a67c:	66 8b 45 f2          	mov    -0xe(%ebp),%ax
40a680:	0b 75 a4             	or     -0x5c(%ebp),%esi
40a683:	66 89 45 e0          	mov    %ax,-0x20(%ebp)
40a687:	8b 45 f4             	mov    -0xc(%ebp),%eax
40a68a:	89 45 e2             	mov    %eax,-0x1e(%ebp)
40a68d:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a690:	89 45 e6             	mov    %eax,-0x1a(%ebp)
40a693:	66 89 75 ea          	mov    %si,-0x16(%ebp)
40a697:	eb 1e                	jmp    0x40a6b7
40a699:	33 c0                	xor    %eax,%eax
40a69b:	66 85 db             	test   %bx,%bx
40a69e:	0f 94 c0             	sete   %al
40a6a1:	83 65 e4 00          	andl   $0x0,-0x1c(%ebp)
40a6a5:	48                   	dec    %eax
40a6a6:	25 00 00 00 80       	and    $0x80000000,%eax
40a6ab:	05 00 80 ff 7f       	add    $0x7fff8000,%eax
40a6b0:	83 65 e0 00          	andl   $0x0,-0x20(%ebp)
40a6b4:	89 45 e8             	mov    %eax,-0x18(%ebp)
40a6b7:	f6 45 18 01          	testb  $0x1,0x18(%ebp)
40a6bb:	8b 55 a0             	mov    -0x60(%ebp),%edx
40a6be:	8b 45 b4             	mov    -0x4c(%ebp),%eax
40a6c1:	8b 7d 14             	mov    0x14(%ebp),%edi
40a6c4:	66 89 02             	mov    %ax,(%edx)
40a6c7:	74 32                	je     0x40a6fb
40a6c9:	98                   	cwtl
40a6ca:	03 f8                	add    %eax,%edi
40a6cc:	85 ff                	test   %edi,%edi
40a6ce:	7f 2b                	jg     0x40a6fb
40a6d0:	33 c0                	xor    %eax,%eax
40a6d2:	66 89 02             	mov    %ax,(%edx)
40a6d5:	b8 00 80 00 00       	mov    $0x8000,%eax
40a6da:	66 39 45 90          	cmp    %ax,-0x70(%ebp)
40a6de:	c6 42 03 01          	movb   $0x1,0x3(%edx)
40a6e2:	0f 95 c0             	setne  %al
40a6e5:	fe c8                	dec    %al
40a6e7:	24 0d                	and    $0xd,%al
40a6e9:	04 20                	add    $0x20,%al
40a6eb:	88 42 02             	mov    %al,0x2(%edx)
40a6ee:	c6 42 04 30          	movb   $0x30,0x4(%edx)
40a6f2:	c6 42 05 00          	movb   $0x0,0x5(%edx)
40a6f6:	e9 5e f9 ff ff       	jmp    0x40a059
40a6fb:	83 ff 15             	cmp    $0x15,%edi
40a6fe:	7e 03                	jle    0x40a703
40a700:	6a 15                	push   $0x15
40a702:	5f                   	pop    %edi
40a703:	8b 75 e8             	mov    -0x18(%ebp),%esi
40a706:	c1 ee 10             	shr    $0x10,%esi
40a709:	81 ee fe 3f 00 00    	sub    $0x3ffe,%esi
40a70f:	33 c0                	xor    %eax,%eax
40a711:	66 89 45 ea          	mov    %ax,-0x16(%ebp)
40a715:	c7 45 bc 08 00 00 00 	movl   $0x8,-0x44(%ebp)
40a71c:	8b 45 e0             	mov    -0x20(%ebp),%eax
40a71f:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
40a722:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
40a725:	d1 65 e0             	shll   $1,-0x20(%ebp)
40a728:	c1 e8 1f             	shr    $0x1f,%eax
40a72b:	03 db                	add    %ebx,%ebx
40a72d:	0b d8                	or     %eax,%ebx
40a72f:	8b 45 e8             	mov    -0x18(%ebp),%eax
40a732:	c1 e9 1f             	shr    $0x1f,%ecx
40a735:	03 c0                	add    %eax,%eax
40a737:	0b c1                	or     %ecx,%eax
40a739:	ff 4d bc             	decl   -0x44(%ebp)
40a73c:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
40a73f:	89 45 e8             	mov    %eax,-0x18(%ebp)
40a742:	75 d8                	jne    0x40a71c
40a744:	85 f6                	test   %esi,%esi
40a746:	7d 32                	jge    0x40a77a
40a748:	f7 de                	neg    %esi
40a74a:	81 e6 ff 00 00 00    	and    $0xff,%esi
40a750:	7e 28                	jle    0x40a77a
40a752:	8b 45 e8             	mov    -0x18(%ebp),%eax
40a755:	8b 5d e4             	mov    -0x1c(%ebp),%ebx
40a758:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
40a75b:	d1 6d e8             	shrl   $1,-0x18(%ebp)
40a75e:	c1 e0 1f             	shl    $0x1f,%eax
40a761:	d1 eb                	shr    $1,%ebx
40a763:	0b d8                	or     %eax,%ebx
40a765:	8b 45 e0             	mov    -0x20(%ebp),%eax
40a768:	c1 e1 1f             	shl    $0x1f,%ecx
40a76b:	d1 e8                	shr    $1,%eax
40a76d:	0b c1                	or     %ecx,%eax
40a76f:	4e                   	dec    %esi
40a770:	89 5d e4             	mov    %ebx,-0x1c(%ebp)
40a773:	89 45 e0             	mov    %eax,-0x20(%ebp)
40a776:	85 f6                	test   %esi,%esi
40a778:	7f d8                	jg     0x40a752
40a77a:	8d 47 01             	lea    0x1(%edi),%eax
40a77d:	8d 5a 04             	lea    0x4(%edx),%ebx
40a780:	89 5d c0             	mov    %ebx,-0x40(%ebp)
40a783:	89 45 b4             	mov    %eax,-0x4c(%ebp)
40a786:	85 c0                	test   %eax,%eax
40a788:	0f 8e b5 00 00 00    	jle    0x40a843
40a78e:	8b 55 e0             	mov    -0x20(%ebp),%edx
40a791:	8b 45 e4             	mov    -0x1c(%ebp),%eax
40a794:	8d 75 e0             	lea    -0x20(%ebp),%esi
40a797:	8d 7d c4             	lea    -0x3c(%ebp),%edi
40a79a:	a5                   	movsl  %ds:(%esi),%es:(%edi)
40a79b:	a5                   	movsl  %ds:(%esi),%es:(%edi)
40a79c:	a5                   	movsl  %ds:(%esi),%es:(%edi)
40a79d:	d1 65 e0             	shll   $1,-0x20(%ebp)
40a7a0:	8b 7d e0             	mov    -0x20(%ebp),%edi
40a7a3:	d1 65 e0             	shll   $1,-0x20(%ebp)
40a7a6:	c1 ea 1f             	shr    $0x1f,%edx
40a7a9:	8d 0c 00             	lea    (%eax,%eax,1),%ecx
40a7ac:	0b ca                	or     %edx,%ecx
40a7ae:	8b 55 e8             	mov    -0x18(%ebp),%edx
40a7b1:	8b f0                	mov    %eax,%esi
40a7b3:	c1 ee 1f             	shr    $0x1f,%esi
40a7b6:	03 d2                	add    %edx,%edx
40a7b8:	0b d6                	or     %esi,%edx
40a7ba:	8b c1                	mov    %ecx,%eax
40a7bc:	8d 34 09             	lea    (%ecx,%ecx,1),%esi
40a7bf:	c1 e8 1f             	shr    $0x1f,%eax
40a7c2:	8d 0c 12             	lea    (%edx,%edx,1),%ecx
40a7c5:	8b 55 c4             	mov    -0x3c(%ebp),%edx
40a7c8:	c1 ef 1f             	shr    $0x1f,%edi
40a7cb:	0b c8                	or     %eax,%ecx
40a7cd:	8b 45 e0             	mov    -0x20(%ebp),%eax
40a7d0:	0b f7                	or     %edi,%esi
40a7d2:	8d 3c 02             	lea    (%edx,%eax,1),%edi
40a7d5:	3b f8                	cmp    %eax,%edi
40a7d7:	72 04                	jb     0x40a7dd
40a7d9:	3b fa                	cmp    %edx,%edi
40a7db:	73 18                	jae    0x40a7f5
40a7dd:	8d 46 01             	lea    0x1(%esi),%eax
40a7e0:	33 d2                	xor    %edx,%edx
40a7e2:	3b c6                	cmp    %esi,%eax
40a7e4:	72 05                	jb     0x40a7eb
40a7e6:	83 f8 01             	cmp    $0x1,%eax
40a7e9:	73 03                	jae    0x40a7ee
40a7eb:	33 d2                	xor    %edx,%edx
40a7ed:	42                   	inc    %edx
40a7ee:	8b f0                	mov    %eax,%esi
40a7f0:	85 d2                	test   %edx,%edx
40a7f2:	74 01                	je     0x40a7f5
40a7f4:	41                   	inc    %ecx
40a7f5:	8b 45 c8             	mov    -0x38(%ebp),%eax
40a7f8:	8d 14 30             	lea    (%eax,%esi,1),%edx
40a7fb:	89 55 bc             	mov    %edx,-0x44(%ebp)
40a7fe:	3b d6                	cmp    %esi,%edx
40a800:	72 04                	jb     0x40a806
40a802:	3b d0                	cmp    %eax,%edx
40a804:	73 01                	jae    0x40a807
40a806:	41                   	inc    %ecx
40a807:	03 4d cc             	add    -0x34(%ebp),%ecx
40a80a:	c1 ea 1f             	shr    $0x1f,%edx
40a80d:	03 c9                	add    %ecx,%ecx
40a80f:	0b ca                	or     %edx,%ecx
40a811:	8d 34 3f             	lea    (%edi,%edi,1),%esi
40a814:	89 75 e0             	mov    %esi,-0x20(%ebp)
40a817:	8b 75 bc             	mov    -0x44(%ebp),%esi
40a81a:	89 4d e8             	mov    %ecx,-0x18(%ebp)
40a81d:	c1 e9 18             	shr    $0x18,%ecx
40a820:	03 f6                	add    %esi,%esi
40a822:	80 c1 30             	add    $0x30,%cl
40a825:	8b c7                	mov    %edi,%eax
40a827:	c1 e8 1f             	shr    $0x1f,%eax