40c539:	ab                   	stos   %eax,%es:(%edi)
40c53a:	8b c1                	mov    %ecx,%eax
40c53c:	8b bd a0 fb ff ff    	mov    -0x460(%ebp),%edi
40c542:	83 e0 02             	and    $0x2,%eax
40c545:	89 85 8c fb ff ff    	mov    %eax,-0x474(%ebp)
40c54b:	0b c2                	or     %edx,%eax
40c54d:	89 bd 90 fb ff ff    	mov    %edi,-0x470(%ebp)
40c553:	89 9d 94 fb ff ff    	mov    %ebx,-0x46c(%ebp)
40c559:	89 95 98 fb ff ff    	mov    %edx,-0x468(%ebp)
40c55f:	75 0a                	jne    0x40c56b
40c561:	88 95 9c fb ff ff    	mov    %dl,-0x464(%ebp)
40c567:	85 ff                	test   %edi,%edi
40c569:	75 07                	jne    0x40c572
40c56b:	c6 85 9c fb ff ff 01 	movb   $0x1,-0x464(%ebp)
40c572:	ff 75 20             	push   0x20(%ebp)
40c575:	8d 85 90 fb ff ff    	lea    -0x470(%ebp),%eax
40c57b:	89 85 a0 fb ff ff    	mov    %eax,-0x460(%ebp)
40c581:	8d 85 80 fb ff ff    	lea    -0x480(%ebp),%eax
40c587:	50                   	push   %eax
40c588:	ff 75 18             	push   0x18(%ebp)
40c58b:	8d 85 a0 fb ff ff    	lea    -0x460(%ebp),%eax
40c591:	ff 75 0c             	push   0xc(%ebp)
40c594:	51                   	push   %ecx
40c595:	50                   	push   %eax
40c596:	8d 8d a4 fb ff ff    	lea    -0x45c(%ebp),%ecx
40c59c:	e8 6d 04 00 00       	call   0x40ca0e
40c5a1:	83 65 f4 00          	andl   $0x0,-0xc(%ebp)
40c5a5:	8d 8d a4 fb ff ff    	lea    -0x45c(%ebp),%ecx
40c5ab:	e8 63 08 00 00       	call   0x40ce13
40c5b0:	8b f0                	mov    %eax,%esi
40c5b2:	85 ff                	test   %edi,%edi
40c5b4:	74 51                	je     0x40c607
40c5b6:	8b 45 08             	mov    0x8(%ebp),%eax
40c5b9:	83 e0 01             	and    $0x1,%eax
40c5bc:	83 c8 00             	or     $0x0,%eax
40c5bf:	74 1c                	je     0x40c5dd
40c5c1:	85 db                	test   %ebx,%ebx
40c5c3:	75 04                	jne    0x40c5c9
40c5c5:	85 f6                	test   %esi,%esi
40c5c7:	75 74                	jne    0x40c63d
40c5c9:	8b 85 98 fb ff ff    	mov    -0x468(%ebp),%eax
40c5cf:	3b c3                	cmp    %ebx,%eax
40c5d1:	75 2e                	jne    0x40c601
40c5d3:	85 f6                	test   %esi,%esi
40c5d5:	78 30                	js     0x40c607
40c5d7:	3b f3                	cmp    %ebx,%esi
40c5d9:	76 2c                	jbe    0x40c607
40c5db:	eb 60                	jmp    0x40c63d
40c5dd:	8b 85 8c fb ff ff    	mov    -0x474(%ebp),%eax
40c5e3:	83 c8 00             	or     $0x0,%eax
40c5e6:	74 51                	je     0x40c639
40c5e8:	85 db                	test   %ebx,%ebx
40c5ea:	74 1b                	je     0x40c607
40c5ec:	85 f6                	test   %esi,%esi
40c5ee:	79 07                	jns    0x40c5f7
40c5f0:	33 c0                	xor    %eax,%eax
40c5f2:	66 89 07             	mov    %ax,(%edi)
40c5f5:	eb 10                	jmp    0x40c607
40c5f7:	8b 85 98 fb ff ff    	mov    -0x468(%ebp),%eax
40c5fd:	3b c3                	cmp    %ebx,%eax
40c5ff:	74 4e                	je     0x40c64f
40c601:	33 c9                	xor    %ecx,%ecx
40c603:	66 89 0c 47          	mov    %cx,(%edi,%eax,2)
40c607:	8d 8d e4 fb ff ff    	lea    -0x41c(%ebp),%ecx
40c60d:	e8 cb 04 00 00       	call   0x40cadd
40c612:	80 bd 88 fb ff ff 00 	cmpb   $0x0,-0x478(%ebp)
40c619:	74 0d                	je     0x40c628
40c61b:	8b 8d 7c fb ff ff    	mov    -0x484(%ebp),%ecx
40c621:	83 a1 50 03 00 00 fd 	andl   $0xfffffffd,0x350(%ecx)
40c628:	5f                   	pop    %edi
40c629:	8b c6                	mov    %esi,%eax
40c62b:	5e                   	pop    %esi
40c62c:	8b 4d fc             	mov    -0x4(%ebp),%ecx
40c62f:	33 cd                	xor    %ebp,%ecx
40c631:	5b                   	pop    %ebx
40c632:	e8 be c5 ff ff       	call   0x408bf5
40c637:	c9                   	leave
40c638:	c3                   	ret
40c639:	85 db                	test   %ebx,%ebx
40c63b:	75 05                	jne    0x40c642
40c63d:	83 ce ff             	or     $0xffffffff,%esi
40c640:	eb c5                	jmp    0x40c607
40c642:	8b 85 98 fb ff ff    	mov    -0x468(%ebp),%eax
40c648:	3b c3                	cmp    %ebx,%eax
40c64a:	75 b5                	jne    0x40c601
40c64c:	6a fe                	push   $0xfffffffe
40c64e:	5e                   	pop    %esi
40c64f:	33 c0                	xor    %eax,%eax
40c651:	66 89 44 5f fe       	mov    %ax,-0x2(%edi,%ebx,2)
40c656:	eb af                	jmp    0x40c607
40c658:	8b ff                	mov    %edi,%edi
40c65a:	55                   	push   %ebp
40c65b:	8b ec                	mov    %esp,%ebp
40c65d:	83 7d 18 00          	cmpl   $0x0,0x18(%ebp)
40c661:	75 15                	jne    0x40c678
40c663:	e8 6b 26 00 00       	call   0x40ecd3
40c668:	c7 00 16 00 00 00    	movl   $0x16,(%eax)
40c66e:	e8 a3 25 00 00       	call   0x40ec16
40c673:	83 c8 ff             	or     $0xffffffff,%eax
40c676:	5d                   	pop    %ebp
40c677:	c3                   	ret
40c678:	56                   	push   %esi
40c679:	8b 75 10             	mov    0x10(%ebp),%esi
40c67c:	85 f6                	test   %esi,%esi
40c67e:	74 3c                	je     0x40c6bc
40c680:	83 7d 14 00          	cmpl   $0x0,0x14(%ebp)
40c684:	76 36                	jbe    0x40c6bc
40c686:	ff 75 20             	push   0x20(%ebp)
40c689:	ff 75 1c             	push   0x1c(%ebp)
40c68c:	ff 75 18             	push   0x18(%ebp)
40c68f:	ff 75 14             	push   0x14(%ebp)
40c692:	56                   	push   %esi
40c693:	ff 75 0c             	push   0xc(%ebp)
40c696:	ff 75 08             	push   0x8(%ebp)
40c699:	e8 ac fc ff ff       	call   0x40c34a
40c69e:	83 c4 1c             	add    $0x1c,%esp
40c6a1:	85 c0                	test   %eax,%eax
40c6a3:	79 05                	jns    0x40c6aa
40c6a5:	33 c9                	xor    %ecx,%ecx
40c6a7:	66 89 0e             	mov    %cx,(%esi)
40c6aa:	83 f8 fe             	cmp    $0xfffffffe,%eax
40c6ad:	75 20                	jne    0x40c6cf
40c6af:	e8 1f 26 00 00       	call   0x40ecd3
40c6b4:	c7 00 22 00 00 00    	movl   $0x22,(%eax)
40c6ba:	eb 0b                	jmp    0x40c6c7
40c6bc:	e8 12 26 00 00       	call   0x40ecd3
40c6c1:	c7 00 16 00 00 00    	movl   $0x16,(%eax)
40c6c7:	e8 4a 25 00 00       	call   0x40ec16
40c6cc:	83 c8 ff             	or     $0xffffffff,%eax
40c6cf:	5e                   	pop    %esi
40c6d0:	5d                   	pop    %ebp
40c6d1:	c3                   	ret
40c6d2:	83 b9 04 04 00 00 00 	cmpl   $0x0,0x404(%ecx)
40c6d9:	75 06                	jne    0x40c6e1
40c6db:	b8 00 02 00 00       	mov    $0x200,%eax
40c6e0:	c3                   	ret
40c6e1:	8b 81 00 04 00 00    	mov    0x400(%ecx),%eax
40c6e7:	d1 e8                	shr    $1,%eax
40c6e9:	c3                   	ret
40c6ea:	83 b9 04 04 00 00 00 	cmpl   $0x0,0x404(%ecx)
40c6f1:	75 06                	jne    0x40c6f9
40c6f3:	b8 00 01 00 00       	mov    $0x100,%eax
40c6f8:	c3                   	ret
40c6f9:	8b 81 00 04 00 00    	mov    0x400(%ecx),%eax
40c6ff:	c1 e8 02             	shr    $0x2,%eax
40c702:	c3                   	ret
40c703:	8b ff                	mov    %edi,%edi
40c705:	55                   	push   %ebp
40c706:	8b ec                	mov    %esp,%ebp
40c708:	51                   	push   %ecx
40c709:	56                   	push   %esi
40c70a:	8b 75 08             	mov    0x8(%ebp),%esi
40c70d:	57                   	push   %edi
40c70e:	8b f9                	mov    %ecx,%edi
40c710:	81 fe ff ff ff 7f    	cmp    $0x7fffffff,%esi
40c716:	76 0f                	jbe    0x40c727
40c718:	e8 b6 25 00 00       	call   0x40ecd3
40c71d:	c7 00 0c 00 00 00    	movl   $0xc,(%eax)
40c723:	32 c0                	xor    %al,%al
40c725:	eb 53                	jmp    0x40c77a
40c727:	53                   	push   %ebx
40c728:	33 db                	xor    %ebx,%ebx
40c72a:	03 f6                	add    %esi,%esi
40c72c:	39 9f 04 04 00 00    	cmp    %ebx,0x404(%edi)
40c732:	75 08                	jne    0x40c73c
40c734:	81 fe 00 04 00 00    	cmp    $0x400,%esi
40c73a:	76 08                	jbe    0x40c744
40c73c:	3b b7 00 04 00 00    	cmp    0x400(%edi),%esi
40c742:	77 04                	ja     0x40c748
40c744:	b0 01                	mov    $0x1,%al
40c746:	eb 31                	jmp    0x40c779
40c748:	56                   	push   %esi
40c749:	e8 95 42 00 00       	call   0x4109e3
40c74e:	89 45 fc             	mov    %eax,-0x4(%ebp)
40c751:	59                   	pop    %ecx
40c752:	85 c0                	test   %eax,%eax
40c754:	74 1a                	je     0x40c770
40c756:	8d 45 fc             	lea    -0x4(%ebp),%eax
40c759:	50                   	push   %eax
40c75a:	8d 8f 04 04 00 00    	lea    0x404(%edi),%ecx
40c760:	e8 92 03 00 00       	call   0x40caf7
40c765:	8b 45 fc             	mov    -0x4(%ebp),%eax
40c768:	b3 01                	mov    $0x1,%bl
40c76a:	89 b7 00 04 00 00    	mov    %esi,0x400(%edi)
40c770:	50                   	push   %eax
40c771:	e8 cd 25 00 00       	call   0x40ed43
40c776:	59                   	pop    %ecx
40c777:	8a c3                	mov    %bl,%al
40c779:	5b                   	pop    %ebx
40c77a:	5f                   	pop    %edi
40c77b:	5e                   	pop    %esi
40c77c:	c9                   	leave
40c77d:	c2 04 00             	ret    $0x4
40c780:	8b ff                	mov    %edi,%edi
40c782:	55                   	push   %ebp
40c783:	8b ec                	mov    %esp,%ebp
40c785:	51                   	push   %ecx
40c786:	56                   	push   %esi
40c787:	8b 75 08             	mov    0x8(%ebp),%esi
40c78a:	57                   	push   %edi
40c78b:	8b f9                	mov    %ecx,%edi
40c78d:	81 fe ff ff ff 3f    	cmp    $0x3fffffff,%esi
40c793:	76 0f                	jbe    0x40c7a4
40c795:	e8 39 25 00 00       	call   0x40ecd3
40c79a:	c7 00 0c 00 00 00    	movl   $0xc,(%eax)
40c7a0:	32 c0                	xor    %al,%al
40c7a2:	eb 54                	jmp    0x40c7f8
40c7a4:	53                   	push   %ebx
40c7a5:	33 db                	xor    %ebx,%ebx
40c7a7:	c1 e6 02             	shl    $0x2,%esi
40c7aa:	39 9f 04 04 00 00    	cmp    %ebx,0x404(%edi)
40c7b0:	75 08                	jne    0x40c7ba
40c7b2:	81 fe 00 04 00 00    	cmp    $0x400,%esi
40c7b8:	76 08                	jbe    0x40c7c2
40c7ba:	3b b7 00 04 00 00    	cmp    0x400(%edi),%esi
40c7c0:	77 04                	ja     0x40c7c6
40c7c2:	b0 01                	mov    $0x1,%al
40c7c4:	eb 31                	jmp    0x40c7f7
40c7c6:	56                   	push   %esi
40c7c7:	e8 17 42 00 00       	call   0x4109e3
40c7cc:	89 45 fc             	mov    %eax,-0x4(%ebp)
40c7cf:	59                   	pop    %ecx
40c7d0:	85 c0                	test   %eax,%eax
40c7d2:	74 1a                	je     0x40c7ee
40c7d4:	8d 45 fc             	lea    -0x4(%ebp),%eax
40c7d7:	50                   	push   %eax
40c7d8:	8d 8f 04 04 00 00    	lea    0x404(%edi),%ecx
40c7de:	e8 14 03 00 00       	call   0x40caf7
40c7e3:	8b 45 fc             	mov    -0x4(%ebp),%eax
40c7e6:	b3 01                	mov    $0x1,%bl
40c7e8:	89 b7 00 04 00 00    	mov    %esi,0x400(%edi)
40c7ee:	50                   	push   %eax
40c7ef:	e8 4f 25 00 00       	call   0x40ed43
40c7f4:	59                   	pop    %ecx
40c7f5:	8a c3                	mov    %bl,%al
40c7f7:	5b                   	pop    %ebx
40c7f8:	5f                   	pop    %edi
40c7f9:	5e                   	pop    %esi
40c7fa:	c9                   	leave
40c7fb:	c2 04 00             	ret    $0x4
40c7fe:	8b ff                	mov    %edi,%edi
40c800:	55                   	push   %ebp
40c801:	8b ec                	mov    %esp,%ebp
40c803:	8b 45 14             	mov    0x14(%ebp),%eax
40c806:	48                   	dec    %eax
40c807:	83 e8 01             	sub    $0x1,%eax
40c80a:	74 3c                	je     0x40c848
40c80c:	83 e8 01             	sub    $0x1,%eax
40c80f:	74 33                	je     0x40c844
40c811:	83 e8 09             	sub    $0x9,%eax
40c814:	74 2e                	je     0x40c844
40c816:	83 7d 14 0d          	cmpl   $0xd,0x14(%ebp)
40c81a:	74 28                	je     0x40c844
40c81c:	8b 45 08             	mov    0x8(%ebp),%eax
40c81f:	83 e0 04             	and    $0x4,%eax
40c822:	83 c8 00             	or     $0x0,%eax
40c825:	6a 01                	push   $0x1
40c827:	58                   	pop    %eax
40c828:	74 04                	je     0x40c82e
40c82a:	8a c8                	mov    %al,%cl
40c82c:	eb 02                	jmp    0x40c830
40c82e:	32 c9                	xor    %cl,%cl
40c830:	66 83 7d 10 63       	cmpw   $0x63,0x10(%ebp)
40c835:	74 07                	je     0x40c83e
40c837:	66 83 7d 10 73       	cmpw   $0x73,0x10(%ebp)
40c83c:	75 02                	jne    0x40c840
40c83e:	32 c0                	xor    %al,%al
40c840:	32 c1                	xor    %cl,%al
40c842:	5d                   	pop    %ebp
40c843:	c3                   	ret
40c844:	b0 01                	mov    $0x1,%al
40c846:	5d                   	pop    %ebp
40c847:	c3                   	ret
40c848:	32 c0                	xor    %al,%al
40c84a:	5d                   	pop    %ebp
40c84b:	c3                   	ret
40c84c:	8b ff                	mov    %edi,%edi
40c84e:	56                   	push   %esi
40c84f:	8b f1                	mov    %ecx,%esi
40c851:	57                   	push   %edi
40c852:	8b be 04 04 00 00    	mov    0x404(%esi),%edi
40c858:	e8 75 fe ff ff       	call   0x40c6d2
40c85d:	85 ff                	test   %edi,%edi
40c85f:	75 04                	jne    0x40c865
40c861:	03 c6                	add    %esi,%eax
40c863:	eb 02                	jmp    0x40c867
40c865:	03 c7                	add    %edi,%eax
40c867:	5f                   	pop    %edi
40c868:	5e                   	pop    %esi
40c869:	c3                   	ret
40c86a:	8b ff                	mov    %edi,%edi
40c86c:	55                   	push   %ebp
40c86d:	8b ec                	mov    %esp,%ebp
40c86f:	53                   	push   %ebx
40c870:	56                   	push   %esi
40c871:	8b f1                	mov    %ecx,%esi
40c873:	57                   	push   %edi
40c874:	8d 4e 40             	lea    0x40(%esi),%ecx
40c877:	8b b9 04 04 00 00    	mov    0x404(%ecx),%edi
40c87d:	85 ff                	test   %edi,%edi
40c87f:	75 02                	jne    0x40c883
40c881:	8b f9                	mov    %ecx,%edi
40c883:	e8 62 fe ff ff       	call   0x40c6ea
40c888:	8b 5d 08             	mov    0x8(%ebp),%ebx
40c88b:	8d 3c 47             	lea    (%edi,%eax,2),%edi
40c88e:	83 c7 fe             	add    $0xfffffffe,%edi
40c891:	89 7e 34             	mov    %edi,0x34(%esi)
40c894:	8b cf                	mov    %edi,%ecx
40c896:	8b 56 28             	mov    0x28(%esi),%edx
40c899:	85 d2                	test   %edx,%edx
40c89b:	7f 04                	jg     0x40c8a1
40c89d:	85 db                	test   %ebx,%ebx
40c89f:	74 3e                	je     0x40c8df
40c8a1:	8d 4a ff             	lea    -0x1(%edx),%ecx
40c8a4:	8b c3                	mov    %ebx,%eax
40c8a6:	33 d2                	xor    %edx,%edx
40c8a8:	89 4e 28             	mov    %ecx,0x28(%esi)
40c8ab:	f7 75 0c             	divl   0xc(%ebp)
40c8ae:	8b d8                	mov    %eax,%ebx
40c8b0:	8d 42 30             	lea    0x30(%edx),%eax
40c8b3:	0f b7 c8             	movzwl %ax,%ecx
40c8b6:	83 f9 39             	cmp    $0x39,%ecx
40c8b9:	76 11                	jbe    0x40c8cc
40c8bb:	8a 45 10             	mov    0x10(%ebp),%al
40c8be:	34 01                	xor    $0x1,%al
40c8c0:	c0 e0 05             	shl    $0x5,%al
40c8c3:	04 07                	add    $0x7,%al
40c8c5:	02 c1                	add    %cl,%al
40c8c7:	66 98                	cbtw
40c8c9:	0f b7 c8             	movzwl %ax,%ecx
40c8cc:	8b 46 34             	mov    0x34(%esi),%eax
40c8cf:	66 0f be c9          	movsbw %cl,%cx
40c8d3:	66 89 08             	mov    %cx,(%eax)
40c8d6:	83 46 34 fe          	addl   $0xfffffffe,0x34(%esi)
40c8da:	8b 4e 34             	mov    0x34(%esi),%ecx
40c8dd:	eb b7                	jmp    0x40c896
40c8df:	2b f9                	sub    %ecx,%edi
40c8e1:	d1 ff                	sar    $1,%edi
40c8e3:	89 7e 38             	mov    %edi,0x38(%esi)
40c8e6:	83 46 34 02          	addl   $0x2,0x34(%esi)
40c8ea:	5f                   	pop    %edi
40c8eb:	5e                   	pop    %esi
40c8ec:	5b                   	pop    %ebx
40c8ed:	5d                   	pop    %ebp
40c8ee:	c2 0c 00             	ret    $0xc
40c8f1:	8b ff                	mov    %edi,%edi
40c8f3:	55                   	push   %ebp
40c8f4:	8b ec                	mov    %esp,%ebp
40c8f6:	83 ec 0c             	sub    $0xc,%esp
40c8f9:	53                   	push   %ebx