40a549:	81 f9 ff 00 00 00    	cmp    $0xff,%ecx
40a54f:	0f 87 01 ac 07 00    	ja     0x485156
40a555:	8b 5d c8             	mov    -0x38(%ebp),%ebx
40a558:	83 e1 07             	and    $0x7,%ecx
40a55b:	b8 01 00 00 00       	mov    $0x1,%eax
40a560:	d3 e0                	shl    %cl,%eax
40a562:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
40a565:	c1 e9 03             	shr    $0x3,%ecx
40a568:	84 04 19             	test   %al,(%ecx,%ebx,1)
40a56b:	8b 5d 10             	mov    0x10(%ebp),%ebx
40a56e:	0f 85 0d 01 00 00    	jne    0x40a681
40a574:	33 c0                	xor    %eax,%eax
40a576:	5f                   	pop    %edi
40a577:	5e                   	pop    %esi
40a578:	5b                   	pop    %ebx
40a579:	8b e5                	mov    %ebp,%esp
40a57b:	5d                   	pop    %ebp
40a57c:	c3                   	ret
40a57d:	8b 73 7c             	mov    0x7c(%ebx),%esi
40a580:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a583:	89 75 ec             	mov    %esi,-0x14(%ebp)
40a586:	3b c6                	cmp    %esi,%eax
40a588:	0f 83 06 06 00 00    	jae    0x40ab94
40a58e:	0f b7 08             	movzwl (%eax),%ecx
40a591:	83 c0 02             	add    $0x2,%eax
40a594:	89 45 f8             	mov    %eax,-0x8(%ebp)
40a597:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
40a59a:	74 12                	je     0x40a5ae
40a59c:	8b c1                	mov    %ecx,%eax
40a59e:	25 00 fc 00 00       	and    $0xfc00,%eax
40a5a3:	3d 00 d8 00 00       	cmp    $0xd800,%eax
40a5a8:	0f 84 ba a8 07 00    	je     0x484e68
40a5ae:	8b c1                	mov    %ecx,%eax
40a5b0:	99                   	cltd
40a5b1:	83 e2 7f             	and    $0x7f,%edx
40a5b4:	03 c2                	add    %edx,%eax
40a5b6:	c1 f8 07             	sar    $0x7,%eax
40a5b9:	0f b6 80 a0 c4 4a 00 	movzbl 0x4ac4a0(%eax),%eax
40a5c0:	c1 e0 07             	shl    $0x7,%eax
40a5c3:	81 e1 7f 00 00 80    	and    $0x8000007f,%ecx
40a5c9:	79 05                	jns    0x40a5d0
40a5cb:	49                   	dec    %ecx
40a5cc:	83 c9 80             	or     $0xffffff80,%ecx
40a5cf:	41                   	inc    %ecx
40a5d0:	03 c1                	add    %ecx,%eax
40a5d2:	0f b7 04 45 08 e6 49 	movzwl 0x49e608(,%eax,2),%eax
40a5d9:	00
40a5da:	0f b6 04 c5 0a b1 4a 	movzbl 0x4ab10a(,%eax,8),%eax
40a5e1:	00
40a5e2:	89 45 d4             	mov    %eax,-0x2c(%ebp)
40a5e5:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a5e8:	3b c6                	cmp    %esi,%eax
40a5ea:	73 7d                	jae    0x40a669
40a5ec:	8b 7d e4             	mov    -0x1c(%ebp),%edi
40a5ef:	8b d8                	mov    %eax,%ebx
40a5f1:	0f b7 0b             	movzwl (%ebx),%ecx
40a5f4:	be 01 00 00 00       	mov    $0x1,%esi
40a5f9:	85 ff                	test   %edi,%edi
40a5fb:	74 12                	je     0x40a60f
40a5fd:	8b c1                	mov    %ecx,%eax
40a5ff:	25 00 fc 00 00       	and    $0xfc00,%eax
40a604:	3d 00 d8 00 00       	cmp    $0xd800,%eax
40a609:	0f 84 7e a8 07 00    	je     0x484e8d
40a60f:	8b c1                	mov    %ecx,%eax
40a611:	99                   	cltd
40a612:	83 e2 7f             	and    $0x7f,%edx
40a615:	03 c2                	add    %edx,%eax
40a617:	c1 f8 07             	sar    $0x7,%eax
40a61a:	0f b6 80 a0 c4 4a 00 	movzbl 0x4ac4a0(%eax),%eax
40a621:	c1 e0 07             	shl    $0x7,%eax
40a624:	81 e1 7f 00 00 80    	and    $0x8000007f,%ecx
40a62a:	79 05                	jns    0x40a631
40a62c:	49                   	dec    %ecx
40a62d:	83 c9 80             	or     $0xffffff80,%ecx
40a630:	41                   	inc    %ecx
40a631:	8b 55 d4             	mov    -0x2c(%ebp),%edx
40a634:	03 c1                	add    %ecx,%eax
40a636:	0f b7 04 45 08 e6 49 	movzwl 0x49e608(,%eax,2),%eax
40a63d:	00
40a63e:	0f b6 0c c5 0a b1 4a 	movzbl 0x4ab10a(,%eax,8),%ecx
40a645:	00
40a646:	b8 01 00 00 00       	mov    $0x1,%eax
40a64b:	d3 e0                	shl    %cl,%eax
40a64d:	85 04 95 2c e5 49 00 	test   %eax,0x49e52c(,%edx,4)
40a654:	0f 85 f3 00 00 00    	jne    0x40a74d
40a65a:	8b 75 ec             	mov    -0x14(%ebp),%esi
40a65d:	8b 7d cc             	mov    -0x34(%ebp),%edi
40a660:	89 5d f8             	mov    %ebx,-0x8(%ebp)
40a663:	8b 5d 10             	mov    0x10(%ebp),%ebx
40a666:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a669:	83 bb 8c 00 00 00 00 	cmpl   $0x0,0x8c(%ebx)
40a670:	0f 85 3b a8 07 00    	jne    0x484eb1
40a676:	83 c7 02             	add    $0x2,%edi
40a679:	89 7d cc             	mov    %edi,-0x34(%ebp)
40a67c:	e9 df fc ff ff       	jmp    0x40a360
40a681:	8b 45 ec             	mov    -0x14(%ebp),%eax
40a684:	8b 4b 7c             	mov    0x7c(%ebx),%ecx
40a687:	40                   	inc    %eax
40a688:	89 45 ec             	mov    %eax,-0x14(%ebp)
40a68b:	3b 45 d8             	cmp    -0x28(%ebp),%eax
40a68e:	0f 8e 8c fe ff ff    	jle    0x40a520
40a694:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a697:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
40a69a:	8b 5d e8             	mov    -0x18(%ebp),%ebx
40a69d:	39 5d d8             	cmp    %ebx,-0x28(%ebp)
40a6a0:	8b 5d 10             	mov    0x10(%ebp),%ebx
40a6a3:	0f 84 b7 fc ff ff    	je     0x40a360
40a6a9:	85 d2                	test   %edx,%edx
40a6ab:	0f 85 bd f5 07 00    	jne    0x489c6e
40a6b1:	8b 55 d8             	mov    -0x28(%ebp),%edx
40a6b4:	89 45 dc             	mov    %eax,-0x24(%ebp)
40a6b7:	85 c9                	test   %ecx,%ecx
40a6b9:	0f 84 81 ab 07 00    	je     0x485240
40a6bf:	3b 55 e8             	cmp    -0x18(%ebp),%edx
40a6c2:	7d 54                	jge    0x40a718
40a6c4:	c7 45 d4 01 00 00 00 	movl   $0x1,-0x2c(%ebp)
40a6cb:	3b 43 7c             	cmp    0x7c(%ebx),%eax
40a6ce:	0f 83 3a ab 07 00    	jae    0x48520e
40a6d4:	0f b7 08             	movzwl (%eax),%ecx
40a6d7:	8b c1                	mov    %ecx,%eax
40a6d9:	25 00 fc 00 00       	and    $0xfc00,%eax
40a6de:	89 4d e0             	mov    %ecx,-0x20(%ebp)
40a6e1:	3d 00 d8 00 00       	cmp    $0xd800,%eax
40a6e6:	0f 84 e8 aa 07 00    	je     0x4851d4
40a6ec:	81 f9 ff 00 00 00    	cmp    $0xff,%ecx
40a6f2:	0f 87 08 ab 07 00    	ja     0x485200
40a6f8:	c1 6d e0 03          	shrl   $0x3,-0x20(%ebp)
40a6fc:	8b 5d e0             	mov    -0x20(%ebp),%ebx
40a6ff:	83 e1 07             	and    $0x7,%ecx
40a702:	b8 01 00 00 00       	mov    $0x1,%eax
40a707:	d3 e0                	shl    %cl,%eax
40a709:	8b 4d c8             	mov    -0x38(%ebp),%ecx
40a70c:	84 04 0b             	test   %al,(%ebx,%ecx,1)
40a70f:	8b 5d 10             	mov    0x10(%ebp),%ebx
40a712:	0f 85 c1 05 00 00    	jne    0x40acd9
40a718:	83 7d d0 00          	cmpl   $0x0,-0x30(%ebp)
40a71c:	0f 85 3e fc ff ff    	jne    0x40a360
40a722:	8b 45 18             	mov    0x18(%ebp),%eax
40a725:	8b 75 f8             	mov    -0x8(%ebp),%esi
40a728:	40                   	inc    %eax
40a729:	50                   	push   %eax
40a72a:	ff 75 14             	push   0x14(%ebp)
40a72d:	8b d7                	mov    %edi,%edx
40a72f:	53                   	push   %ebx
40a730:	ff 75 0c             	push   0xc(%ebp)
40a733:	8b ce                	mov    %esi,%ecx
40a735:	ff 75 08             	push   0x8(%ebp)
40a738:	e8 c3 fb ff ff       	call   0x40a300
40a73d:	83 c4 14             	add    $0x14,%esp
40a740:	85 c0                	test   %eax,%eax
40a742:	0f 85 7f fd ff ff    	jne    0x40a4c7
40a748:	e9 d7 f4 07 00       	jmp    0x489c24
40a74d:	8d 1c 73             	lea    (%ebx,%esi,2),%ebx
40a750:	8b 75 ec             	mov    -0x14(%ebp),%esi
40a753:	89 4d d4             	mov    %ecx,-0x2c(%ebp)
40a756:	3b de                	cmp    %esi,%ebx
40a758:	0f 82 93 fe ff ff    	jb     0x40a5f1
40a75e:	e9 fa fe ff ff       	jmp    0x40a65d
40a763:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a766:	3b 43 7c             	cmp    0x7c(%ebx),%eax
40a769:	0f 83 25 04 00 00    	jae    0x40ab94
40a76f:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
40a772:	0f 84 e2 ae 07 00    	je     0x48565a
40a778:	0f b7 77 02          	movzwl 0x2(%edi),%esi
40a77c:	83 c7 02             	add    $0x2,%edi
40a77f:	8b c6                	mov    %esi,%eax
40a781:	25 00 fc 00 00       	and    $0xfc00,%eax
40a786:	ba 01 00 00 00       	mov    $0x1,%edx
40a78b:	3d 00 d8 00 00       	cmp    $0xd800,%eax
40a790:	0f 84 14 ae 07 00    	je     0x4855aa
40a796:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a799:	0f b7 08             	movzwl (%eax),%ecx
40a79c:	81 fe 80 00 00 00    	cmp    $0x80,%esi
40a7a2:	0f 83 26 ae 07 00    	jae    0x4855ce
40a7a8:	81 f9 ff 00 00 00    	cmp    $0xff,%ecx
40a7ae:	77 07                	ja     0x40a7b7
40a7b0:	8b 43 3c             	mov    0x3c(%ebx),%eax
40a7b3:	0f b6 0c 08          	movzbl (%eax,%ecx,1),%ecx
40a7b7:	8b 43 3c             	mov    0x3c(%ebx),%eax
40a7ba:	0f b6 04 30          	movzbl (%eax,%esi,1),%eax
40a7be:	3b c1                	cmp    %ecx,%eax
40a7c0:	0f 85 ae fd ff ff    	jne    0x40a574
40a7c6:	83 c7 02             	add    $0x2,%edi
40a7c9:	83 45 f8 02          	addl   $0x2,-0x8(%ebp)
40a7cd:	89 7d cc             	mov    %edi,-0x34(%ebp)
40a7d0:	e9 8b fb ff ff       	jmp    0x40a360
40a7d5:	0f b7 56 04          	movzwl 0x4(%esi),%edx
40a7d9:	8d 04 12             	lea    (%edx,%edx,1),%eax
40a7dc:	89 45 c0             	mov    %eax,-0x40(%ebp)
40a7df:	8b 83 a8 00 00 00    	mov    0xa8(%ebx),%eax
40a7e5:	85 c0                	test   %eax,%eax
40a7e7:	0f 85 e5 96 07 00    	jne    0x483ed2
40a7ed:	8b 83 94 00 00 00    	mov    0x94(%ebx),%eax
40a7f3:	8b 75 c0             	mov    -0x40(%ebp),%esi
40a7f6:	25 00 00 ff ff       	and    $0xffff0000,%eax
40a7fb:	0b c2                	or     %edx,%eax
40a7fd:	89 83 94 00 00 00    	mov    %eax,0x94(%ebx)
40a803:	3b 73 14             	cmp    0x14(%ebx),%esi
40a806:	8b 75 e0             	mov    -0x20(%ebp),%esi
40a809:	0f 8d e8 96 07 00    	jge    0x483ef7
40a80f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
40a812:	39 4d c0             	cmp    %ecx,-0x40(%ebp)
40a815:	0f 8f ec 96 07 00    	jg     0x483f07
40a81b:	8b 43 10             	mov    0x10(%ebx),%eax
40a81e:	8b 4b 0c             	mov    0xc(%ebx),%ecx
40a821:	2b c2                	sub    %edx,%eax
40a823:	8b 55 c0             	mov    -0x40(%ebp),%edx
40a826:	8b 04 81             	mov    (%ecx,%eax,4),%eax
40a829:	89 04 91             	mov    %eax,(%ecx,%edx,4)
40a82c:	8b 4d f8             	mov    -0x8(%ebp),%ecx
40a82f:	2b 4b 78             	sub    0x78(%ebx),%ecx
40a832:	8b 43 0c             	mov    0xc(%ebx),%eax
40a835:	d1 f9                	sar    $1,%ecx
40a837:	89 4c 90 04          	mov    %ecx,0x4(%eax,%edx,4)
40a83b:	8b 55 0c             	mov    0xc(%ebp),%edx
40a83e:	8b 45 c0             	mov    -0x40(%ebp),%eax
40a841:	8b 4d ec             	mov    -0x14(%ebp),%ecx
40a844:	3b d0                	cmp    %eax,%edx
40a846:	0f 8f 28 fc ff ff    	jg     0x40a474
40a84c:	8d 50 02             	lea    0x2(%eax),%edx
40a84f:	89 55 0c             	mov    %edx,0xc(%ebp)
40a852:	e9 1d fc ff ff       	jmp    0x40a474
40a857:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a85a:	3b 43 7c             	cmp    0x7c(%ebx),%eax
40a85d:	0f 83 31 03 00 00    	jae    0x40ab94
40a863:	0f b7 08             	movzwl (%eax),%ecx
40a866:	83 c0 02             	add    $0x2,%eax
40a869:	89 4d d4             	mov    %ecx,-0x2c(%ebp)
40a86c:	89 45 f8             	mov    %eax,-0x8(%ebp)
40a86f:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
40a872:	74 12                	je     0x40a886
40a874:	8b c1                	mov    %ecx,%eax
40a876:	25 00 fc 00 00       	and    $0xfc00,%eax
40a87b:	3d 00 d8 00 00       	cmp    $0xd800,%eax
40a880:	0f 84 ad a3 07 00    	je     0x484c33
40a886:	8b c1                	mov    %ecx,%eax
40a888:	99                   	cltd
40a889:	83 e2 7f             	and    $0x7f,%edx
40a88c:	03 c2                	add    %edx,%eax
40a88e:	8b 55 d4             	mov    -0x2c(%ebp),%edx
40a891:	c1 f8 07             	sar    $0x7,%eax
40a894:	0f b6 88 a0 c4 4a 00 	movzbl 0x4ac4a0(%eax),%ecx
40a89b:	8b c2                	mov    %edx,%eax
40a89d:	c1 e1 07             	shl    $0x7,%ecx
40a8a0:	25 7f 00 00 80       	and    $0x8000007f,%eax
40a8a5:	79 05                	jns    0x40a8ac
40a8a7:	48                   	dec    %eax
40a8a8:	83 c8 80             	or     $0xffffff80,%eax
40a8ab:	40                   	inc    %eax
40a8ac:	03 c8                	add    %eax,%ecx
40a8ae:	0f b7 47 02          	movzwl 0x2(%edi),%eax
40a8b2:	0f b7 0c 4d 08 e6 49 	movzwl 0x49e608(,%ecx,2),%ecx
40a8b9:	00
40a8ba:	83 f8 09             	cmp    $0x9,%eax
40a8bd:	0f 85 98 a3 07 00    	jne    0x484c5b
40a8c3:	0f b7 47 04          	movzwl 0x4(%edi),%eax
40a8c7:	8b 0c 85 a0 e6 4a 00 	mov    0x4ae6a0(,%eax,4),%ecx
40a8ce:	8d 04 85 a0 e6 4a 00 	lea    0x4ae6a0(,%eax,4),%eax
40a8d5:	3b d1                	cmp    %ecx,%edx
40a8d7:	0f 82 7d a5 07 00    	jb     0x484e5a
40a8dd:	8d 49 00             	lea    0x0(%ecx),%ecx
40a8e0:	8d 40 04             	lea    0x4(%eax),%eax
40a8e3:	3b d1                	cmp    %ecx,%edx
40a8e5:	74 0b                	je     0x40a8f2
40a8e7:	8b 08                	mov    (%eax),%ecx
40a8e9:	3b d1                	cmp    %ecx,%edx
40a8eb:	73 f3                	jae    0x40a8e0
40a8ed:	e9 68 a5 07 00       	jmp    0x484e5a
40a8f2:	83 fe 10             	cmp    $0x10,%esi
40a8f5:	0f 85 79 fc ff ff    	jne    0x40a574
40a8fb:	83 c7 06             	add    $0x6,%edi
40a8fe:	89 7d cc             	mov    %edi,-0x34(%ebp)
40a901:	e9 5a fa ff ff       	jmp    0x40a360
40a906:	39 55 e4             	cmp    %edx,-0x1c(%ebp)
40a909:	0f 84 6c ac 07 00    	je     0x48557b
40a90f:	66 8b 47 02          	mov    0x2(%edi),%ax
40a913:	83 c7 02             	add    $0x2,%edi
40a916:	b9 00 fc 00 00       	mov    $0xfc00,%ecx
40a91b:	66 23 c1             	and    %cx,%ax
40a91e:	b9 00 d8 00 00       	mov    $0xd800,%ecx
40a923:	be 01 00 00 00       	mov    $0x1,%esi
40a928:	89 7d cc             	mov    %edi,-0x34(%ebp)
40a92b:	66 3b c1             	cmp    %cx,%ax
40a92e:	0f 84 ea 03 00 00    	je     0x40ad1e
40a934:	8b 43 7c             	mov    0x7c(%ebx),%eax
40a937:	8b 55 f8             	mov    -0x8(%ebp),%edx
40a93a:	2b c2                	sub    %edx,%eax
40a93c:	d1 f8                	sar    $1,%eax
40a93e:	3b f0                	cmp    %eax,%esi
40a940:	0f 8f 84 f5 07 00    	jg     0x489eca
40a946:	85 f6                	test   %esi,%esi
40a948:	0f 8e 12 fa ff ff    	jle    0x40a360
40a94e:	8b ff                	mov    %edi,%edi
40a950:	66 8b 0f             	mov    (%edi),%cx
40a953:	66 8b 02             	mov    (%edx),%ax
40a956:	83 c2 02             	add    $0x2,%edx
40a959:	83 c7 02             	add    $0x2,%edi
40a95c:	4e                   	dec    %esi
40a95d:	89 55 f8             	mov    %edx,-0x8(%ebp)
40a960:	89 7d cc             	mov    %edi,-0x34(%ebp)
40a963:	66 3b c8             	cmp    %ax,%cx
40a966:	0f 85 08 fc ff ff    	jne    0x40a574
40a96c:	85 f6                	test   %esi,%esi
40a96e:	0f 8e ec f9 ff ff    	jle    0x40a360
40a974:	eb da                	jmp    0x40a950
40a976:	0f b7 57 04          	movzwl 0x4(%edi),%edx
40a97a:	89 55 f4             	mov    %edx,-0xc(%ebp)
40a97d:	8d 04 12             	lea    (%edx,%edx,1),%eax
40a980:	89 45 c0             	mov    %eax,-0x40(%ebp)
40a983:	3b 43 14             	cmp    0x14(%ebx),%eax
40a986:	0f 8d 04 fa ff ff    	jge    0x40a390
40a98c:	8b 4b 0c             	mov    0xc(%ebx),%ecx
40a98f:	8b 55 c0             	mov    -0x40(%ebp),%edx
40a992:	8b 04 81             	mov    (%ecx,%eax,4),%eax
40a995:	89 45 e0             	mov    %eax,-0x20(%ebp)
40a998:	8b 44 91 04          	mov    0x4(%ecx,%edx,4),%eax
40a99c:	89 45 bc             	mov    %eax,-0x44(%ebp)
40a99f:	8b 43 10             	mov    0x10(%ebx),%eax
40a9a2:	2b 45 f4             	sub    -0xc(%ebp),%eax
40a9a5:	8d 0c 81             	lea    (%ecx,%eax,4),%ecx
40a9a8:	8b 01                	mov    (%ecx),%eax
40a9aa:	89 45 d8             	mov    %eax,-0x28(%ebp)
40a9ad:	8b 83 94 00 00 00    	mov    0x94(%ebx),%eax
40a9b3:	89 45 d4             	mov    %eax,-0x2c(%ebp)
40a9b6:	8b 83 b0 00 00 00    	mov    0xb0(%ebx),%eax
40a9bc:	89 45 ec             	mov    %eax,-0x14(%ebp)
40a9bf:	8b 45 f8             	mov    -0x8(%ebp),%eax
40a9c2:	2b 43 78             	sub    0x78(%ebx),%eax
40a9c5:	d1 f8                	sar    $1,%eax
40a9c7:	89 01                	mov    %eax,(%ecx)
40a9c9:	8d a4 24 00 00 00 00 	lea    0x0(%esp),%esp
40a9d0:	81 fe 88 00 00 00    	cmp    $0x88,%esi
40a9d6:	0f 83 2e 0b 08 00    	jae    0x48b50a
40a9dc:	8b 45 18             	mov    0x18(%ebp),%eax
40a9df:	8b 4d f8             	mov    -0x8(%ebp),%ecx
40a9e2:	40                   	inc    %eax
40a9e3:	50                   	push   %eax
40a9e4:	ff 75 14             	push   0x14(%ebp)
40a9e7:	0f b7 07             	movzwl (%edi),%eax
40a9ea:	53                   	push   %ebx
40a9eb:	0f b6 80 60 e5 49 00 	movzbl 0x49e560(%eax),%eax
40a9f2:	ff 75 0c             	push   0xc(%ebp)
40a9f5:	8d 14 47             	lea    (%edi,%eax,2),%edx
40a9f8:	ff 75 08             	push   0x8(%ebp)
40a9fb:	e8 00 f9 ff ff       	call   0x40a300
40aa00:	8b d0                	mov    %eax,%edx
40aa02:	83 c4 14             	add    $0x14,%esp
40aa05:	81 fa 1b fc ff ff    	cmp    $0xfffffc1b,%edx
40aa0b:	0f 84 50 0b 08 00    	je     0x48b561
40aa11:	81 fa 20 fc ff ff    	cmp    $0xfffffc20,%edx