40bb60:	8b 04 95 a8 21 42 00 	mov    0x4221a8(,%edx,4),%eax
40bb67:	f6 44 07 28 20       	testb  $0x20,0x28(%edi,%eax,1)
40bb6c:	74 11                	je     0x40bb7f
40bb6e:	53                   	push   %ebx
40bb6f:	6a 02                	push   $0x2
40bb71:	56                   	push   %esi
40bb72:	56                   	push   %esi
40bb73:	51                   	push   %ecx
40bb74:	e8 06 53 00 00       	call   0x410e7f
40bb79:	8b 4d f0             	mov    -0x10(%ebp),%ecx
40bb7c:	83 c4 14             	add    $0x14,%esp
40bb7f:	53                   	push   %ebx
40bb80:	8b fe                	mov    %esi,%edi
40bb82:	51                   	push   %ecx
40bb83:	89 7d dc             	mov    %edi,-0x24(%ebp)
40bb86:	e8 8e fa ff ff       	call   0x40b619
40bb8b:	59                   	pop    %ecx
40bb8c:	59                   	pop    %ecx
40bb8d:	84 c0                	test   %al,%al
40bb8f:	74 47                	je     0x40bbd8
40bb91:	0f be 45 ff          	movsbl -0x1(%ebp),%eax
40bb95:	2b c6                	sub    %esi,%eax
40bb97:	74 27                	je     0x40bbc0
40bb99:	83 e8 01             	sub    $0x1,%eax
40bb9c:	74 09                	je     0x40bba7
40bb9e:	83 e8 01             	sub    $0x1,%eax
40bba1:	0f 85 da 00 00 00    	jne    0x40bc81
40bba7:	ff 75 f4             	push   -0xc(%ebp)
40bbaa:	8d 45 d0             	lea    -0x30(%ebp),%eax
40bbad:	ff 75 f8             	push   -0x8(%ebp)
40bbb0:	50                   	push   %eax
40bbb1:	e8 fb f9 ff ff       	call   0x40b5b1
40bbb6:	83 c4 0c             	add    $0xc,%esp
40bbb9:	8b f0                	mov    %eax,%esi
40bbbb:	e9 af 00 00 00       	jmp    0x40bc6f
40bbc0:	53                   	push   %ebx
40bbc1:	ff 75 f4             	push   -0xc(%ebp)
40bbc4:	8d 45 d0             	lea    -0x30(%ebp),%eax
40bbc7:	ff 75 f8             	push   -0x8(%ebp)
40bbca:	ff 75 f0             	push   -0x10(%ebp)
40bbcd:	50                   	push   %eax
40bbce:	e8 17 f6 ff ff       	call   0x40b1ea
40bbd3:	83 c4 14             	add    $0x14,%esp
40bbd6:	eb e1                	jmp    0x40bbb9
40bbd8:	8b 55 ec             	mov    -0x14(%ebp),%edx
40bbdb:	8b 4d e8             	mov    -0x18(%ebp),%ecx
40bbde:	8b 04 95 a8 21 42 00 	mov    0x4221a8(,%edx,4),%eax
40bbe5:	80 7c 08 28 00       	cmpb   $0x0,0x28(%eax,%ecx,1)
40bbea:	7d 55                	jge    0x40bc41
40bbec:	0f be 45 ff          	movsbl -0x1(%ebp),%eax
40bbf0:	2b c6                	sub    %esi,%eax
40bbf2:	74 39                	je     0x40bc2d
40bbf4:	83 e8 01             	sub    $0x1,%eax
40bbf7:	74 20                	je     0x40bc19
40bbf9:	83 e8 01             	sub    $0x1,%eax
40bbfc:	0f 85 85 00 00 00    	jne    0x40bc87
40bc02:	ff 75 f4             	push   -0xc(%ebp)
40bc05:	8d 45 d0             	lea    -0x30(%ebp),%eax
40bc08:	ff 75 f8             	push   -0x8(%ebp)
40bc0b:	ff 75 f0             	push   -0x10(%ebp)
40bc0e:	50                   	push   %eax
40bc0f:	e8 5d fb ff ff       	call   0x40b771
40bc14:	83 c4 10             	add    $0x10,%esp
40bc17:	eb a0                	jmp    0x40bbb9
40bc19:	ff 75 f4             	push   -0xc(%ebp)
40bc1c:	8d 45 d0             	lea    -0x30(%ebp),%eax
40bc1f:	ff 75 f8             	push   -0x8(%ebp)
40bc22:	ff 75 f0             	push   -0x10(%ebp)
40bc25:	50                   	push   %eax
40bc26:	e8 2f fc ff ff       	call   0x40b85a
40bc2b:	eb e7                	jmp    0x40bc14
40bc2d:	ff 75 f4             	push   -0xc(%ebp)
40bc30:	8d 45 d0             	lea    -0x30(%ebp),%eax
40bc33:	ff 75 f8             	push   -0x8(%ebp)
40bc36:	ff 75 f0             	push   -0x10(%ebp)
40bc39:	50                   	push   %eax
40bc3a:	e8 57 fa ff ff       	call   0x40b696
40bc3f:	eb d3                	jmp    0x40bc14
40bc41:	8b 4c 08 18          	mov    0x18(%eax,%ecx,1),%ecx
40bc45:	8d 7d d0             	lea    -0x30(%ebp),%edi
40bc48:	33 c0                	xor    %eax,%eax
40bc4a:	ab                   	stos   %eax,%es:(%edi)
40bc4b:	56                   	push   %esi
40bc4c:	ab                   	stos   %eax,%es:(%edi)
40bc4d:	ab                   	stos   %eax,%es:(%edi)
40bc4e:	8d 45 d4             	lea    -0x2c(%ebp),%eax
40bc51:	50                   	push   %eax
40bc52:	ff 75 f4             	push   -0xc(%ebp)
40bc55:	ff 75 f8             	push   -0x8(%ebp)
40bc58:	51                   	push   %ecx
40bc59:	ff 15 c0 90 41 00    	call   *0x4190c0
40bc5f:	85 c0                	test   %eax,%eax
40bc61:	75 09                	jne    0x40bc6c
40bc63:	ff 15 28 90 41 00    	call   *0x419028
40bc69:	89 45 d0             	mov    %eax,-0x30(%ebp)
40bc6c:	8d 75 d0             	lea    -0x30(%ebp),%esi
40bc6f:	8d 7d dc             	lea    -0x24(%ebp),%edi
40bc72:	a5                   	movsl  %ds:(%esi),%es:(%edi)
40bc73:	a5                   	movsl  %ds:(%esi),%es:(%edi)
40bc74:	a5                   	movsl  %ds:(%esi),%es:(%edi)
40bc75:	8b 45 e0             	mov    -0x20(%ebp),%eax
40bc78:	85 c0                	test   %eax,%eax
40bc7a:	75 68                	jne    0x40bce4
40bc7c:	8b 7d dc             	mov    -0x24(%ebp),%edi
40bc7f:	33 f6                	xor    %esi,%esi
40bc81:	8b 55 ec             	mov    -0x14(%ebp),%edx
40bc84:	8b 4d e8             	mov    -0x18(%ebp),%ecx
40bc87:	85 ff                	test   %edi,%edi
40bc89:	74 2c                	je     0x40bcb7
40bc8b:	6a 05                	push   $0x5
40bc8d:	58                   	pop    %eax
40bc8e:	3b f8                	cmp    %eax,%edi
40bc90:	75 17                	jne    0x40bca9
40bc92:	c6 43 1c 01          	movb   $0x1,0x1c(%ebx)
40bc96:	c7 43 18 09 00 00 00 	movl   $0x9,0x18(%ebx)
40bc9d:	c6 43 24 01          	movb   $0x1,0x24(%ebx)
40bca1:	89 43 20             	mov    %eax,0x20(%ebx)
40bca4:	e9 79 fe ff ff       	jmp    0x40bb22
40bca9:	53                   	push   %ebx
40bcaa:	57                   	push   %edi
40bcab:	e8 48 ea ff ff       	call   0x40a6f8
40bcb0:	59                   	pop    %ecx
40bcb1:	59                   	pop    %ecx
40bcb2:	e9 6b fe ff ff       	jmp    0x40bb22
40bcb7:	8b 04 95 a8 21 42 00 	mov    0x4221a8(,%edx,4),%eax
40bcbe:	f6 44 08 28 40       	testb  $0x40,0x28(%eax,%ecx,1)
40bcc3:	74 08                	je     0x40bccd
40bcc5:	8b 45 f8             	mov    -0x8(%ebp),%eax
40bcc8:	80 38 1a             	cmpb   $0x1a,(%eax)
40bccb:	74 1c                	je     0x40bce9
40bccd:	c6 43 1c 01          	movb   $0x1,0x1c(%ebx)
40bcd1:	c7 43 18 1c 00 00 00 	movl   $0x1c,0x18(%ebx)
40bcd8:	c6 43 24 01          	movb   $0x1,0x24(%ebx)
40bcdc:	89 73 20             	mov    %esi,0x20(%ebx)
40bcdf:	e9 3e fe ff ff       	jmp    0x40bb22
40bce4:	2b 45 e4             	sub    -0x1c(%ebp),%eax
40bce7:	eb 02                	jmp    0x40bceb
40bce9:	33 c0                	xor    %eax,%eax
40bceb:	5f                   	pop    %edi
40bcec:	5e                   	pop    %esi
40bced:	5b                   	pop    %ebx
40bcee:	c9                   	leave
40bcef:	c3                   	ret
40bcf0:	8b ff                	mov    %edi,%edi
40bcf2:	55                   	push   %ebp
40bcf3:	8b ec                	mov    %esp,%ebp
40bcf5:	ff 75 0c             	push   0xc(%ebp)
40bcf8:	e8 c6 f4 ff ff       	call   0x40b1c3
40bcfd:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd00:	59                   	pop    %ecx
40bd01:	8b 40 0c             	mov    0xc(%eax),%eax
40bd04:	90                   	nop
40bd05:	a8 06                	test   $0x6,%al
40bd07:	75 1f                	jne    0x40bd28
40bd09:	8b 45 10             	mov    0x10(%ebp),%eax
40bd0c:	c7 40 18 09 00 00 00 	movl   $0x9,0x18(%eax)
40bd13:	c6 40 1c 01          	movb   $0x1,0x1c(%eax)
40bd17:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd1a:	6a 10                	push   $0x10
40bd1c:	59                   	pop    %ecx
40bd1d:	83 c0 0c             	add    $0xc,%eax
40bd20:	f0 09 08             	lock or %ecx,(%eax)
40bd23:	83 c8 ff             	or     $0xffffffff,%eax
40bd26:	5d                   	pop    %ebp
40bd27:	c3                   	ret
40bd28:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd2b:	8b 40 0c             	mov    0xc(%eax),%eax
40bd2e:	90                   	nop
40bd2f:	c1 e8 0c             	shr    $0xc,%eax
40bd32:	a8 01                	test   $0x1,%al
40bd34:	74 0c                	je     0x40bd42
40bd36:	8b 45 10             	mov    0x10(%ebp),%eax
40bd39:	c7 40 18 22 00 00 00 	movl   $0x22,0x18(%eax)
40bd40:	eb d1                	jmp    0x40bd13
40bd42:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd45:	8b 40 0c             	mov    0xc(%eax),%eax
40bd48:	90                   	nop
40bd49:	a8 01                	test   $0x1,%al
40bd4b:	74 28                	je     0x40bd75
40bd4d:	ff 75 0c             	push   0xc(%ebp)
40bd50:	e8 63 01 00 00       	call   0x40beb8
40bd55:	59                   	pop    %ecx
40bd56:	8b 4d 0c             	mov    0xc(%ebp),%ecx
40bd59:	83 61 08 00          	andl   $0x0,0x8(%ecx)
40bd5d:	84 c0                	test   %al,%al
40bd5f:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd62:	74 b6                	je     0x40bd1a
40bd64:	8b 48 04             	mov    0x4(%eax),%ecx
40bd67:	89 08                	mov    %ecx,(%eax)
40bd69:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd6c:	6a fe                	push   $0xfffffffe
40bd6e:	59                   	pop    %ecx
40bd6f:	83 c0 0c             	add    $0xc,%eax
40bd72:	f0 21 08             	lock and %ecx,(%eax)
40bd75:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd78:	6a 02                	push   $0x2
40bd7a:	59                   	pop    %ecx
40bd7b:	83 c0 0c             	add    $0xc,%eax
40bd7e:	f0 09 08             	lock or %ecx,(%eax)
40bd81:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd84:	6a f7                	push   $0xfffffff7
40bd86:	59                   	pop    %ecx
40bd87:	83 c0 0c             	add    $0xc,%eax
40bd8a:	f0 21 08             	lock and %ecx,(%eax)
40bd8d:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd90:	83 60 08 00          	andl   $0x0,0x8(%eax)
40bd94:	8b 45 0c             	mov    0xc(%ebp),%eax
40bd97:	8b 40 0c             	mov    0xc(%eax),%eax
40bd9a:	90                   	nop
40bd9b:	a9 c0 04 00 00       	test   $0x4c0,%eax
40bda0:	75 16                	jne    0x40bdb8
40bda2:	ff 75 0c             	push   0xc(%ebp)
40bda5:	e8 9e 01 00 00       	call   0x40bf48
40bdaa:	59                   	pop    %ecx
40bdab:	84 c0                	test   %al,%al
40bdad:	75 09                	jne    0x40bdb8
40bdaf:	ff 75 0c             	push   0xc(%ebp)
40bdb2:	e8 0f 5c 00 00       	call   0x4119c6
40bdb7:	59                   	pop    %ecx
40bdb8:	53                   	push   %ebx
40bdb9:	ff 75 10             	push   0x10(%ebp)
40bdbc:	8b 5d 08             	mov    0x8(%ebp),%ebx
40bdbf:	ff 75 0c             	push   0xc(%ebp)
40bdc2:	53                   	push   %ebx
40bdc3:	e8 1e 00 00 00       	call   0x40bde6
40bdc8:	83 c4 0c             	add    $0xc,%esp
40bdcb:	84 c0                	test   %al,%al
40bdcd:	75 11                	jne    0x40bde0
40bdcf:	8b 45 0c             	mov    0xc(%ebp),%eax
40bdd2:	6a 10                	push   $0x10
40bdd4:	59                   	pop    %ecx
40bdd5:	83 c0 0c             	add    $0xc,%eax
40bdd8:	f0 09 08             	lock or %ecx,(%eax)
40bddb:	83 c8 ff             	or     $0xffffffff,%eax
40bdde:	eb 03                	jmp    0x40bde3
40bde0:	0f b6 c3             	movzbl %bl,%eax
40bde3:	5b                   	pop    %ebx
40bde4:	5d                   	pop    %ebp
40bde5:	c3                   	ret
40bde6:	8b ff                	mov    %edi,%edi
40bde8:	55                   	push   %ebp
40bde9:	8b ec                	mov    %esp,%ebp
40bdeb:	56                   	push   %esi
40bdec:	57                   	push   %edi
40bded:	ff 75 0c             	push   0xc(%ebp)
40bdf0:	e8 ce f3 ff ff       	call   0x40b1c3
40bdf5:	59                   	pop    %ecx
40bdf6:	8b 4d 0c             	mov    0xc(%ebp),%ecx
40bdf9:	8b d0                	mov    %eax,%edx
40bdfb:	8b 49 0c             	mov    0xc(%ecx),%ecx
40bdfe:	90                   	nop
40bdff:	f6 c1 c0             	test   $0xc0,%cl
40be02:	0f 84 93 00 00 00    	je     0x40be9b
40be08:	8b 4d 0c             	mov    0xc(%ebp),%ecx
40be0b:	33 ff                	xor    %edi,%edi
40be0d:	8b 41 04             	mov    0x4(%ecx),%eax
40be10:	8b 31                	mov    (%ecx),%esi
40be12:	2b f0                	sub    %eax,%esi
40be14:	40                   	inc    %eax
40be15:	89 01                	mov    %eax,(%ecx)
40be17:	8b 45 0c             	mov    0xc(%ebp),%eax
40be1a:	8b 48 18             	mov    0x18(%eax),%ecx
40be1d:	49                   	dec    %ecx
40be1e:	89 48 08             	mov    %ecx,0x8(%eax)
40be21:	85 f6                	test   %esi,%esi
40be23:	7e 27                	jle    0x40be4c
40be25:	ff 75 10             	push   0x10(%ebp)
40be28:	8b 45 0c             	mov    0xc(%ebp),%eax
40be2b:	56                   	push   %esi
40be2c:	ff 70 04             	push   0x4(%eax)
40be2f:	52                   	push   %edx
40be30:	e8 8e fb ff ff       	call   0x40b9c3
40be35:	83 c4 10             	add    $0x10,%esp
40be38:	8b f8                	mov    %eax,%edi
40be3a:	8b 4d 0c             	mov    0xc(%ebp),%ecx
40be3d:	3b fe                	cmp    %esi,%edi
40be3f:	8a 45 08             	mov    0x8(%ebp),%al
40be42:	8b 49 04             	mov    0x4(%ecx),%ecx
40be45:	88 01                	mov    %al,(%ecx)
40be47:	0f 94 c0             	sete   %al
40be4a:	eb 68                	jmp    0x40beb4
40be4c:	83 fa ff             	cmp    $0xffffffff,%edx
40be4f:	74 1b                	je     0x40be6c
40be51:	83 fa fe             	cmp    $0xfffffffe,%edx
40be54:	74 16                	je     0x40be6c
40be56:	8b c2                	mov    %edx,%eax
40be58:	8b ca                	mov    %edx,%ecx
40be5a:	83 e0 3f             	and    $0x3f,%eax
40be5d:	c1 f9 06             	sar    $0x6,%ecx
40be60:	6b c0 38             	imul   $0x38,%eax,%eax
40be63:	03 04 8d a8 21 42 00 	add    0x4221a8(,%ecx,4),%eax
40be6a:	eb 05                	jmp    0x40be71
40be6c:	b8 e8 11 42 00       	mov    $0x4211e8,%eax
40be71:	f6 40 28 20          	testb  $0x20,0x28(%eax)
40be75:	74 c3                	je     0x40be3a
40be77:	6a 02                	push   $0x2
40be79:	57                   	push   %edi
40be7a:	57                   	push   %edi
40be7b:	52                   	push   %edx
40be7c:	e8 7e 4f 00 00       	call   0x410dff
40be81:	23 c2                	and    %edx,%eax
40be83:	83 c4 10             	add    $0x10,%esp
40be86:	83 f8 ff             	cmp    $0xffffffff,%eax
40be89:	75 af                	jne    0x40be3a
40be8b:	8b 45 0c             	mov    0xc(%ebp),%eax
40be8e:	6a 10                	push   $0x10
40be90:	59                   	pop    %ecx
40be91:	83 c0 0c             	add    $0xc,%eax
40be94:	f0 09 08             	lock or %ecx,(%eax)
40be97:	b0 01                	mov    $0x1,%al
40be99:	eb 19                	jmp    0x40beb4
40be9b:	ff 75 10             	push   0x10(%ebp)
40be9e:	8d 45 08             	lea    0x8(%ebp),%eax
40bea1:	6a 01                	push   $0x1
40bea3:	50                   	push   %eax
40bea4:	52                   	push   %edx
40bea5:	e8 19 fb ff ff       	call   0x40b9c3
40beaa:	83 c4 10             	add    $0x10,%esp
40bead:	48                   	dec    %eax
40beae:	f7 d8                	neg    %eax
40beb0:	1a c0                	sbb    %al,%al
40beb2:	fe c0                	inc    %al
40beb4:	5f                   	pop    %edi
40beb5:	5e                   	pop    %esi
40beb6:	5d                   	pop    %ebp
40beb7:	c3                   	ret
40beb8:	8b ff                	mov    %edi,%edi
40beba:	55                   	push   %ebp
40bebb:	8b ec                	mov    %esp,%ebp
40bebd:	8b 45 08             	mov    0x8(%ebp),%eax
40bec0:	83 ec 10             	sub    $0x10,%esp
40bec3:	8b 40 0c             	mov    0xc(%eax),%eax
40bec6:	90                   	nop
40bec7:	c1 e8 03             	shr    $0x3,%eax
40beca:	a8 01                	test   $0x1,%al
40becc:	74 04                	je     0x40bed2
40bece:	b0 01                	mov    $0x1,%al
40bed0:	c9                   	leave
40bed1:	c3                   	ret
40bed2:	8b 45 08             	mov    0x8(%ebp),%eax
40bed5:	53                   	push   %ebx
40bed6:	56                   	push   %esi
40bed7:	8b 40 0c             	mov    0xc(%eax),%eax
40beda:	90                   	nop
40bedb:	a8 c0                	test   $0xc0,%al
40bedd:	8b 45 08             	mov    0x8(%ebp),%eax
40bee0:	74 07                	je     0x40bee9
40bee2:	8b 08                	mov    (%eax),%ecx
40bee4:	3b 48 04             	cmp    0x4(%eax),%ecx
40bee7:	74 4e                	je     0x40bf37