view compal/c139-boot.disasm @ 310:ae39d76d5b7a

moko1-fw-disasm: simple analysis of init module
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 31 Jan 2020 22:45:18 +0000
parents 49c7cda96f04
children
line wrap: on
line source

RESET entry and exception vectors:
       0:	ea000225 	b	0x89c
       4:	ea000825 	b	0x20a0
       8:	ea000825 	b	0x20a4
       c:	ea000825 	b	0x20a8
      10:	ea000825 	b	0x20ac
      14:	ea000825 	b	0x20b0
      18:	ea000825 	b	0x20b4
      1c:	ea000825 	b	0x20b8

; some magic words?
      20:	444efc57
      24:	444efc58
      28:	444efc86
      2c:	444efc87
; different in the C140 specimen:
      20:	44b1b707
      24:	44b1b708
      28:	44b1b735
      2c:	44b1b736

<30-7FF: all FFs>

00000800:  42 4F 4F 54 2E 39 30 2E  30 34 00 00 00 00 00 00  BOOT.90.04......
00000810:  31 30 30 33 01 01 00 00  FF FF FF FF FF FF FF FF  1003............
00000820:  FF FF FF FF FF FF FF FF  FF FF FF FF FF FF FF FF  ................

     830:	00000006
	...
     83c:	00000048
     840:	00000044
     844:	00000052
     848:	0000001b
     84c:	00000005
	...
     860:	000000fa
     864:	ffff5800
     868:	ffff5000
     86c:	fffffb00
     870:	02a1
     872:	02a1
     874:	02a1
     876:	0283
     878:	0281
     87a:	00c0
     87c:	0040
     87e:	002a
     880:	00000040
     884:	fffffd00
     888:	ffff9800
     88c:	fffffb10
     890:	ffffff08
     894:	1081
     896:	2006
     898:	0800
     89a:	0000

; RESET entry point
; set VCLKOUT_DIV2 in FFFF:FD02 register
     89c:	e51f1020	ldr	r1, =0xfffffd00	; via 0x884
     8a0:	e1d120b2	ldrh	r2, [r1, #2]
     8a4:	e51f002c	ldr	r0, =0x40	; via 0x880
     8a8:	e1800002	orr	r0, r0, r2
     8ac:	e1c100b2	strh	r0, [r1, #2]
; PLL disable (power-up state)
     8b0:	e51f1030	ldr	r1, =0xffff9800	; via 0x888
     8b4:	e15f22b6	ldrh	r2, =0x2006	; via 0x896
     8b8:	e1c120b0	strh	r2, [r1]
     8bc:	e5912000	ldr	r2, [r1]
     8c0:	e2022001	and	r2, r2, #1
     8c4:	e3520001	cmp	r2, #1
     8c8:	0afffffb	beq	0x8bc
; Write power-up default value into FFFF:FD00
     8cc:	e51f1050	ldr	r1, =0xfffffd00	; via 0x884
     8d0:	e15f24b4	ldrh	r2, =0x1081	; via 0x894
     8d4:	e1c120b0	strh	r2, [r1]
; Disable DU
     8d8:	e51f1054	ldr	r1, =0xfffffb10	; via 0x88c
     8dc:	e15f24bc	ldrh	r2, =0x800	; via 0x898
     8e0:	e1d100b0	ldrh	r0, [r1]
     8e4:	e1800002	orr	r0, r0, r2
     8e8:	e1c100b0	strh	r0, [r1]
; Disable all MPU regions
     8ec:	e51f1064	ldr	r1, =0xffffff08	; via 0x890
     8f0:	e15f25be	ldrh	r2, =0x0	; via 0x89a
     8f4:	e1c120b0	strh	r2, [r1]
; Memory timings
     8f8:	e51f1094	ldr	r1, =0xfffffb00	; via 0x86c
     8fc:	e15f29b4	ldrh	r2, =0x2a1	; via 0x870
     900:	e1c120b0	strh	r2, [r1]
     904:	e15f29ba	ldrh	r2, =0x2a1	; via 0x872
     908:	e1c120b2	strh	r2, [r1, #2]
     90c:	e15f2ab0	ldrh	r2, =0x2a1	; via 0x874
     910:	e1c120b4	strh	r2, [r1, #4]
     914:	e15f2ab6	ldrh	r2, =0x283	; via 0x876
     918:	e1c120b6	strh	r2, [r1, #6]
     91c:	e15f2abc	ldrh	r2, =0x281	; via 0x878
     920:	e1c120ba	strh	r2, [r1, #10]	; 0xa
     924:	e15f2bb2	ldrh	r2, =0xc0	; via 0x87a
     928:	e1c120bc	strh	r2, [r1, #12]	; 0xc
     92c:	e15f2bb8	ldrh	r2, =0x40	; via 0x87c
     930:	e1c120b8	strh	r2, [r1, #8]
     934:	e15f2bbe	ldrh	r2, =0x2a	; via 0x87e
     938:	e1c120be	strh	r2, [r1, #14]	; 0xe
; set up stack
     93c:	e59f0020	ldr	r0, =0x83e574	; via 0x964
     940:	e3a01b01	mov	r1, #1024	; 0x400
     944:	e2411004	sub	r1, r1, #4
     948:	e0802001	add	r2, r0, r1
     94c:	e3c22003	bic	r2, r2, #3
     950:	e1a0d002	mov	sp, r2
; business logic
     954:	e92d100f	stmdb	sp!, {r0, r1, r2, r3, r12}
     958:	eb000534	bl	0x1e30
     95c:	e8bd100f	ldmia	sp!, {r0, r1, r2, r3, r12}
     960:	ea0005e4	b	0x20f8

; C139 specimen:
     964:	0083e574
; different in the C140 specimen:
     964:	0083e55c

; mask all interrupts in INTH
     968:	4961		ldr	r1, =0xfffffa08	; via 0xaf0
     96a:	4862		ldr	r0, =0xffff	; via 0xaf4
     96c:	8008		strh	r0, [r1, #0]
     96e:	4862		ldr	r0, =0xfffffa0a	; via 0xaf8
     970:	211f		mov	r1, #31	; 0x1f
     972:	8001		strh	r1, [r0, #0]
; disable watchdog
     974:	4861		ldr	r0, =0xfffff804	; via 0xafc
     976:	21f5		mov	r1, #245	; 0xf5
     978:	8001		strh	r1, [r0, #0]
     97a:	21a0		mov	r1, #160	; 0xa0
     97c:	8001		strh	r1, [r0, #0]
; disable PLL
     97e:	4860		ldr	r0, =0xffff9800	; via 0xb00
     980:	4960		ldr	r1, =0x2002	; via 0xb04
     982:	8001		strh	r1, [r0, #0]
     984:	485e		ldr	r0, =0xffff9800	; via 0xb00
     986:	8800		ldrh	r0, [r0, #0]
     988:	0840		lsr	r0, r0, #1
     98a:	d2fb		bcs	0x984
; 0x1001 written into FFFF:FD00 - same as power-up default
; except for one reserved bit
     98c:	495e		ldr	r1, =0xfffffd00	; via 0xb08
     98e:	485f		ldr	r0, =0x1001	; via 0xb0c
     990:	8008		strh	r0, [r1, #0]
     992:	46f7		mov	pc, lr

     994:	b500		push	{lr}
     996:	b0ff		sub	sp, #508	; 0x1fc
     998:	b0ca		sub	sp, #296	; 0x128
     99a:	2000		mov	r0, #0
     99c:	9001		str	r0, [sp, #4]
     99e:	9801		ldr	r0, [sp, #4]
     9a0:	2800		cmp	r0, #0
     9a2:	d14e		bne	0xa42
     9a4:	a846		add	r0, sp, #280	; 0x118
     9a6:	2100		mov	r1, #0
     9a8:	f001 f86e	bl	0x1a88
     9ac:	a9c8		add	r1, sp, #800	; 0x320
     9ae:	7008		strb	r0, [r1, #0]
     9b0:	a846		add	r0, sp, #280	; 0x118
     9b2:	a902		add	r1, sp, #8
     9b4:	f000 fb2c	bl	0x1010
     9b8:	9000		str	r0, [sp, #0]
     9ba:	9800		ldr	r0, [sp, #0]
     9bc:	2800		cmp	r0, #0
     9be:	d01b		beq	0x9f8
     9c0:	a924		add	r1, sp, #144	; 0x90
     9c2:	4668		mov	r0, sp
     9c4:	7a00		ldrb	r0, [r0, #8]
     9c6:	7008		strb	r0, [r1, #0]
     9c8:	2191		mov	r1, #145	; 0x91
     9ca:	466a		mov	r2, sp
     9cc:	4668		mov	r0, sp
     9ce:	7800		ldrb	r0, [r0, #0]
     9d0:	5488		strb	r0, [r1, r2]
     9d2:	e01b		b	0xa0c
     9d4:	a802		add	r0, sp, #8
     9d6:	a924		add	r1, sp, #144	; 0x90
     9d8:	f000 fe08	bl	0x15ec
     9dc:	e016		b	0xa0c
     9de:	a802		add	r0, sp, #8
     9e0:	a924		add	r1, sp, #144	; 0x90
     9e2:	aac8		add	r2, sp, #800	; 0x320
     9e4:	7812		ldrb	r2, [r2, #0]
     9e6:	f000 fe15	bl	0x1614
     9ea:	e00f		b	0xa0c
     9ec:	a802		add	r0, sp, #8
     9ee:	a924		add	r1, sp, #144	; 0x90
     9f0:	f000 fe47	bl	0x1682
     9f4:	90c7		str	r0, [sp, #796]	; 0x31c
     9f6:	e009		b	0xa0c
     9f8:	4668		mov	r0, sp
     9fa:	7a00		ldrb	r0, [r0, #8]
     9fc:	2800		cmp	r0, #0
     9fe:	d0e9		beq	0x9d4
     a00:	3809		sub	r0, #9
     a02:	2800		cmp	r0, #0
     a04:	d0eb		beq	0x9de
     a06:	3801		sub	r0, #1
     a08:	2800		cmp	r0, #0
     a0a:	d0ef		beq	0x9ec
     a0c:	a824		add	r0, sp, #144	; 0x90
     a0e:	a986		add	r1, sp, #536	; 0x218
     a10:	f000 fbe1	bl	0x11d6
     a14:	2800		cmp	r0, #0
     a16:	d111		bne	0xa3c
     a18:	a886		add	r0, sp, #536	; 0x218
     a1a:	a9c8		add	r1, sp, #800	; 0x320
     a1c:	7809		ldrb	r1, [r1, #0]
     a1e:	f001 f808	bl	0x1a32
     a22:	2800		cmp	r0, #0
     a24:	d00a		beq	0xa3c
     a26:	4668		mov	r0, sp
     a28:	7a00		ldrb	r0, [r0, #8]
     a2a:	280a		cmp	r0, #10	; 0xa
     a2c:	d106		bne	0xa3c
     a2e:	a8c8		add	r0, sp, #800	; 0x320
     a30:	7800		ldrb	r0, [r0, #0]
     a32:	f001 f959	bl	0x1ce8
     a36:	98c7		ldr	r0, [sp, #796]	; 0x31c
     a38:	f000 fae8	bl	0x100c
     a3c:	9801		ldr	r0, [sp, #4]
     a3e:	2800		cmp	r0, #0
     a40:	d0b0		beq	0x9a4
     a42:	b07f		add	sp, #508	; 0x1fc
     a44:	b04a		add	sp, #296	; 0x128
     a46:	bd00		pop	{pc}

     a48:	b500		push	{lr}
     a4a:	b0ff		sub	sp, #508	; 0x1fc
     a4c:	b0c8		sub	sp, #288	; 0x120
     a4e:	2000		mov	r0, #0
     a50:	9000		str	r0, [sp, #0]
     a52:	a846		add	r0, sp, #280	; 0x118
     a54:	2101		mov	r1, #1
     a56:	f001 f817	bl	0x1a88
     a5a:	a9c6		add	r1, sp, #792	; 0x318
     a5c:	7008		strb	r0, [r1, #0]
     a5e:	a8c6		add	r0, sp, #792	; 0x318
     a60:	7800		ldrb	r0, [r0, #0]
     a62:	28ff		cmp	r0, #255	; 0xff
     a64:	d031		beq	0xaca
     a66:	a846		add	r0, sp, #280	; 0x118
     a68:	a902		add	r1, sp, #8
     a6a:	f000 fad1	bl	0x1010
     a6e:	9001		str	r0, [sp, #4]
     a70:	9801		ldr	r0, [sp, #4]
     a72:	2800		cmp	r0, #0
     a74:	d014		beq	0xaa0
     a76:	a924		add	r1, sp, #144	; 0x90
     a78:	4668		mov	r0, sp
     a7a:	7a00		ldrb	r0, [r0, #8]
     a7c:	7008		strb	r0, [r1, #0]
     a7e:	2291		mov	r2, #145	; 0x91
     a80:	4668		mov	r0, sp
     a82:	4669		mov	r1, sp
     a84:	7909		ldrb	r1, [r1, #4]
     a86:	5411		strb	r1, [r2, r0]
     a88:	a824		add	r0, sp, #144	; 0x90
     a8a:	a986		add	r1, sp, #536	; 0x218
     a8c:	f000 fba3	bl	0x11d6
     a90:	2800		cmp	r0, #0
     a92:	d11a		bne	0xaca
     a94:	a886		add	r0, sp, #536	; 0x218
     a96:	a9c6		add	r1, sp, #792	; 0x318
     a98:	7809		ldrb	r1, [r1, #0]
     a9a:	f000 ffca	bl	0x1a32
     a9e:	e014		b	0xaca
     aa0:	4668		mov	r0, sp
     aa2:	7a00		ldrb	r0, [r0, #8]
     aa4:	2800		cmp	r0, #0
     aa6:	d110		bne	0xaca
     aa8:	a802		add	r0, sp, #8
     aaa:	a924		add	r1, sp, #144	; 0x90
     aac:	f000 fd9e	bl	0x15ec
     ab0:	a824		add	r0, sp, #144	; 0x90
     ab2:	a986		add	r1, sp, #536	; 0x218
     ab4:	f000 fb8f	bl	0x11d6
     ab8:	2800		cmp	r0, #0
     aba:	d104		bne	0xac6
     abc:	a886		add	r0, sp, #536	; 0x218
     abe:	a9c6		add	r1, sp, #792	; 0x318
     ac0:	7809		ldrb	r1, [r1, #0]
     ac2:	f000 ffb6	bl	0x1a32
     ac6:	2001		mov	r0, #1
     ac8:	9000		str	r0, [sp, #0]
     aca:	9800		ldr	r0, [sp, #0]
     acc:	b07f		add	sp, #508	; 0x1fc
     ace:	b048		add	sp, #288	; 0x120
     ad0:	bd00		pop	{pc}

; Main entry routine
     ad2:	b500		push	{lr}
     ad4:	b082		sub	sp, #8
     ad6:	f7ff ff47	bl	0x968		; superfluous
     ada:	f001 f8ad	bl	0x1c38		; UART init
     ade:	f000 fd73	bl	0x15c8		; zero a couple of vars
     ae2:	f000 f81f	bl	0xb24		; serial protocol
     ae6:	f000 f96a	bl	0xdbe		; ftmtool voodoo
     aea:	b002		add	sp, #8
     aec:	bd00		pop	{pc}
     aee:	46c0		nop			(mov r8, r8)

     af0:	fffffa08
     af4:	0000ffff
     af8:	fffffa0a
     afc:	fffff804
     b00:	ffff9800
     b04:	00002002
     b08:	fffffd00
     b0c:	00001001

     b10:	e3a0d502	mov	sp, #8388608	; 0x800000
     b14:	e28dd802	add	sp, sp, #131072	; 0x20000
     b18:	e28fe005	add	lr, pc, #5
     b1c:	e12fff1e	bx	lr
     b20:	e1a00000	mov	r0, r0

; This function (0xb24, called from this bootloader's "main") calls
; 0xbac (serial download attempt) twice, first at 406250 baud, then
; at 115200 baud.  Only the MODEM UART is tried, not IrDA.
     b24:	b500		push	{lr}
     b26:	b082		sub	sp, #8
; select MODEM UART
     b28:	49ed		ldr	r1, =0x83ff00	; via 0xee0
     b2a:	48ee		ldr	r0, =0xffff5800	; via 0xee4
     b2c:	6008		str	r0, [r1, #0]
; set it to /2 (406250 baud)
     b2e:	2000		mov	r0, #0
     b30:	2102		mov	r1, #2
     b32:	f000 f9fb	bl	0xf2c
; delay loop
     b36:	2000		mov	r0, #0
     b38:	9000		str	r0, [sp, #0]
     b3a:	9900		ldr	r1, [sp, #0]
     b3c:	2005		mov	r0, #5
     b3e:	0300		lsl	r0, r0, #12
     b40:	4281		cmp	r1, r0
     b42:	d207		bcs	0xb54
     b44:	9800		ldr	r0, [sp, #0]
     b46:	3001		add	r0, #1
     b48:	9000		str	r0, [sp, #0]
     b4a:	9900		ldr	r1, [sp, #0]
     b4c:	2005		mov	r0, #5
     b4e:	0300		lsl	r0, r0, #12
     b50:	4281		cmp	r1, r0
     b52:	d3f7		bcc	0xb44
; 0xbac called at 406250 baud
     b54:	f000 f82a	bl	0xbac
; set it to /7 (115200 baud)
     b58:	2000		mov	r0, #0
     b5a:	2107		mov	r1, #7
     b5c:	f000 f9e6	bl	0xf2c
; same delay loop again
     b60:	2000		mov	r0, #0
     b62:	9000		str	r0, [sp, #0]
     b64:	9900		ldr	r1, [sp, #0]
     b66:	2005		mov	r0, #5
     b68:	0300		lsl	r0, r0, #12
     b6a:	4281		cmp	r1, r0
     b6c:	d207		bcs	0xb7e
     b6e:	9800		ldr	r0, [sp, #0]
     b70:	3001		add	r0, #1
     b72:	9000		str	r0, [sp, #0]
     b74:	9900		ldr	r1, [sp, #0]
     b76:	2005		mov	r0, #5
     b78:	0300		lsl	r0, r0, #12
     b7a:	4281		cmp	r1, r0
     b7c:	d3f7		bcc	0xb6e
; call 0xbac again, this time at 115200 baud
     b7e:	f000 f815	bl	0xbac
; another (longer) delay loop, then return
     b82:	2000		mov	r0, #0
     b84:	9001		str	r0, [sp, #4]
     b86:	9000		str	r0, [sp, #0]
     b88:	9900		ldr	r1, [sp, #0]
     b8a:	2005		mov	r0, #5
     b8c:	0400		lsl	r0, r0, #16
     b8e:	4281		cmp	r1, r0
     b90:	d20a		bcs	0xba8
     b92:	9801		ldr	r0, [sp, #4]
     b94:	3001		add	r0, #1
     b96:	9001		str	r0, [sp, #4]
     b98:	9800		ldr	r0, [sp, #0]
     b9a:	3001		add	r0, #1
     b9c:	9000		str	r0, [sp, #0]
     b9e:	9900		ldr	r1, [sp, #0]
     ba0:	2005		mov	r0, #5
     ba2:	0400		lsl	r0, r0, #16
     ba4:	4281		cmp	r1, r0
     ba6:	d3f4		bcc	0xb92
     ba8:	b002		add	sp, #8
     baa:	bd00		pop	{pc}

; This function implements the entirety of the serial download protocol,
; see c139-boot.notes for the details.
     bac:	b500		push	{lr}
     bae:	b088		sub	sp, #32	; 0x20
     bb0:	48dd		ldr	r0, =0x800100	; via 0xf28
     bb2:	9005		str	r0, [sp, #20]	; 0x14
     bb4:	201b		mov	r0, #27	; 0x1b
     bb6:	f000 f95f	bl	0xe78
     bba:	20f6		mov	r0, #246	; 0xf6
     bbc:	f000 f95c	bl	0xe78
     bc0:	2002		mov	r0, #2
     bc2:	f000 f959	bl	0xe78
     bc6:	2000		mov	r0, #0
     bc8:	f000 f956	bl	0xe78
     bcc:	2041		mov	r0, #65	; 0x41
     bce:	f000 f953	bl	0xe78
     bd2:	2001		mov	r0, #1
     bd4:	f000 f950	bl	0xe78
     bd8:	2040		mov	r0, #64	; 0x40
     bda:	f000 f94d	bl	0xe78
     bde:	2001		mov	r0, #1
     be0:	0300		lsl	r0, r0, #12
     be2:	f000 f961	bl	0xea8
     be6:	281b		cmp	r0, #27	; 0x1b
     be8:	d000		beq	0xbec
     bea:	e0e6		b	0xdba
     bec:	2001		mov	r0, #1
     bee:	0300		lsl	r0, r0, #12
     bf0:	f000 f95a	bl	0xea8
     bf4:	28f6		cmp	r0, #246	; 0xf6
     bf6:	d000		beq	0xbfa
     bf8:	e0df		b	0xdba
     bfa:	2001		mov	r0, #1
     bfc:	0300		lsl	r0, r0, #12
     bfe:	f000 f953	bl	0xea8
     c02:	2802		cmp	r0, #2
     c04:	d000		beq	0xc08
     c06:	e0d8		b	0xdba
     c08:	2001		mov	r0, #1
     c0a:	0300		lsl	r0, r0, #12
     c0c:	f000 f94c	bl	0xea8
     c10:	2800		cmp	r0, #0
     c12:	d000		beq	0xc16
     c14:	e0d1		b	0xdba
     c16:	2001		mov	r0, #1
     c18:	0300		lsl	r0, r0, #12
     c1a:	f000 f945	bl	0xea8
     c1e:	2852		cmp	r0, #82	; 0x52
     c20:	d000		beq	0xc24
     c22:	e0ca		b	0xdba
     c24:	2001		mov	r0, #1
     c26:	0300		lsl	r0, r0, #12
     c28:	f000 f93e	bl	0xea8
     c2c:	2801		cmp	r0, #1
     c2e:	d000		beq	0xc32
     c30:	e0c3		b	0xdba
     c32:	2001		mov	r0, #1
     c34:	0300		lsl	r0, r0, #12
     c36:	f000 f937	bl	0xea8
     c3a:	2853		cmp	r0, #83	; 0x53
     c3c:	d000		beq	0xc40
     c3e:	e0bc		b	0xdba
     c40:	201b		mov	r0, #27	; 0x1b
     c42:	f000 f919	bl	0xe78
     c46:	20f6		mov	r0, #246	; 0xf6
     c48:	f000 f916	bl	0xe78
     c4c:	2002		mov	r0, #2
     c4e:	f000 f913	bl	0xe78
     c52:	2000		mov	r0, #0
     c54:	f000 f910	bl	0xe78
     c58:	2041		mov	r0, #65	; 0x41
     c5a:	f000 f90d	bl	0xe78
     c5e:	2002		mov	r0, #2
     c60:	f000 f90a	bl	0xe78
     c64:	2043		mov	r0, #67	; 0x43
     c66:	f000 f907	bl	0xe78
     c6a:	2001		mov	r0, #1
     c6c:	0300		lsl	r0, r0, #12
     c6e:	f000 f91b	bl	0xea8
     c72:	4669		mov	r1, sp
     c74:	7208		strb	r0, [r1, #8]
     c76:	2002		mov	r0, #2
     c78:	7448		strb	r0, [r1, #17]	; 0x11
     c7a:	2000		mov	r0, #0
     c7c:	9000		str	r0, [sp, #0]
     c7e:	9800		ldr	r0, [sp, #0]
     c80:	2802		cmp	r0, #2
     c82:	d215		bcs	0xcb0
     c84:	2001		mov	r0, #1
     c86:	0300		lsl	r0, r0, #12
     c88:	f000 f90e	bl	0xea8
     c8c:	4669		mov	r1, sp
     c8e:	9a00		ldr	r2, [sp, #0]
     c90:	1a89		sub	r1, r1, r2
     c92:	7348		strb	r0, [r1, #13]	; 0xd
     c94:	4669		mov	r1, sp
     c96:	9800		ldr	r0, [sp, #0]
     c98:	1a08		sub	r0, r1, r0
     c9a:	7b40		ldrb	r0, [r0, #13]	; 0xd
     c9c:	7c49		ldrb	r1, [r1, #17]	; 0x11
     c9e:	4048		eor	r0, r1
     ca0:	4669		mov	r1, sp
     ca2:	7448		strb	r0, [r1, #17]	; 0x11
     ca4:	9800		ldr	r0, [sp, #0]
     ca6:	3001		add	r0, #1
     ca8:	9000		str	r0, [sp, #0]
     caa:	9800		ldr	r0, [sp, #0]
     cac:	2802		cmp	r0, #2
     cae:	d3e9		bcc	0xc84
     cb0:	4668		mov	r0, sp
     cb2:	8980		ldrh	r0, [r0, #12]	; 0xc
     cb4:	466a		mov	r2, sp
     cb6:	1e41		sub	r1, r0, #1
     cb8:	8191		strh	r1, [r2, #12]	; 0xc
     cba:	2800		cmp	r0, #0
     cbc:	d016		beq	0xcec
     cbe:	2001		mov	r0, #1
     cc0:	0300		lsl	r0, r0, #12
     cc2:	f000 f8f1	bl	0xea8
     cc6:	9905		ldr	r1, [sp, #20]	; 0x14
     cc8:	7008		strb	r0, [r1, #0]
     cca:	9805		ldr	r0, [sp, #20]	; 0x14
     ccc:	7800		ldrb	r0, [r0, #0]
     cce:	4669		mov	r1, sp
     cd0:	7c49		ldrb	r1, [r1, #17]	; 0x11
     cd2:	4048		eor	r0, r1
     cd4:	4669		mov	r1, sp
     cd6:	7448		strb	r0, [r1, #17]	; 0x11
     cd8:	9805		ldr	r0, [sp, #20]	; 0x14
     cda:	3001		add	r0, #1
     cdc:	9005		str	r0, [sp, #20]	; 0x14
     cde:	4668		mov	r0, sp
     ce0:	8981		ldrh	r1, [r0, #12]	; 0xc
     ce2:	466a		mov	r2, sp
     ce4:	1e48		sub	r0, r1, #1
     ce6:	8190		strh	r0, [r2, #12]	; 0xc
     ce8:	2900		cmp	r1, #0
     cea:	d1e8		bne	0xcbe
     cec:	2001		mov	r0, #1
     cee:	0300		lsl	r0, r0, #12
     cf0:	f000 f8da	bl	0xea8
     cf4:	4669		mov	r1, sp
     cf6:	7408		strb	r0, [r1, #16]	; 0x10
     cf8:	4668		mov	r0, sp
     cfa:	7c00		ldrb	r0, [r0, #16]	; 0x10
     cfc:	7c49		ldrb	r1, [r1, #17]	; 0x11
     cfe:	4288		cmp	r0, r1
     d00:	d015		beq	0xd2e
     d02:	201b		mov	r0, #27	; 0x1b
     d04:	f000 f8b8	bl	0xe78
     d08:	20f6		mov	r0, #246	; 0xf6
     d0a:	f000 f8b5	bl	0xe78
     d0e:	2002		mov	r0, #2
     d10:	f000 f8b2	bl	0xe78
     d14:	2000		mov	r0, #0
     d16:	f000 f8af	bl	0xe78
     d1a:	2045		mov	r0, #69	; 0x45
     d1c:	f000 f8ac	bl	0xe78
     d20:	2053		mov	r0, #83	; 0x53
     d22:	f000 f8a9	bl	0xe78
     d26:	2016		mov	r0, #22	; 0x16
     d28:	f000 f8a6	bl	0xe78
     d2c:	e045		b	0xdba
     d2e:	2081		mov	r0, #129	; 0x81
     d30:	0100		lsl	r0, r0, #4
     d32:	9006		str	r0, [sp, #24]	; 0x18
     d34:	48af		ldr	r0, =0x803ce0	; via 0xff4
     d36:	9007		str	r0, [sp, #28]	; 0x1c
     d38:	2000		mov	r0, #0
     d3a:	9000		str	r0, [sp, #0]
     d3c:	9800		ldr	r0, [sp, #0]
     d3e:	2804		cmp	r0, #4
     d40:	d221		bcs	0xd86
     d42:	9900		ldr	r1, [sp, #0]
     d44:	9806		ldr	r0, [sp, #24]	; 0x18
     d46:	5c0a		ldrb	r2, [r1, r0]
     d48:	9900		ldr	r1, [sp, #0]
     d4a:	9807		ldr	r0, [sp, #28]	; 0x1c
     d4c:	5c08		ldrb	r0, [r1, r0]
     d4e:	4282		cmp	r2, r0
     d50:	dd13		ble	0xd7a
     d52:	201b		mov	r0, #27	; 0x1b
     d54:	f000 f890	bl	0xe78
     d58:	20f6		mov	r0, #246	; 0xf6
     d5a:	f000 f88d	bl	0xe78
     d5e:	2002		mov	r0, #2
     d60:	f000 f88a	bl	0xe78
     d64:	2000		mov	r0, #0
     d66:	f000 f887	bl	0xe78
     d6a:	2041		mov	r0, #65	; 0x41
     d6c:	f000 f884	bl	0xe78
     d70:	2003		mov	r0, #3
     d72:	f000 f881	bl	0xe78
     d76:	2057		mov	r0, #87	; 0x57
     d78:	e7d6		b	0xd28
     d7a:	9800		ldr	r0, [sp, #0]
     d7c:	3001		add	r0, #1
     d7e:	9000		str	r0, [sp, #0]
     d80:	9800		ldr	r0, [sp, #0]
     d82:	2804		cmp	r0, #4
     d84:	d3dd		bcc	0xd42
     d86:	201b		mov	r0, #27	; 0x1b
     d88:	f000 f876	bl	0xe78
     d8c:	20f6		mov	r0, #246	; 0xf6
     d8e:	f000 f873	bl	0xe78
     d92:	2002		mov	r0, #2
     d94:	f000 f870	bl	0xe78
     d98:	2000		mov	r0, #0
     d9a:	f000 f86d	bl	0xe78
     d9e:	2041		mov	r0, #65	; 0x41
     da0:	f000 f86a	bl	0xe78
     da4:	2003		mov	r0, #3
     da6:	f000 f867	bl	0xe78
     daa:	2042		mov	r0, #66	; 0x42
     dac:	f000 f864	bl	0xe78
     db0:	484b		ldr	r0, =0x83ff00	; via 0xee0
     db2:	6800		ldr	r0, [r0, #0]
     db4:	4990		ldr	r1, =0x800100	; via 0xff8
     db6:	f000 f85e	bl	0xe76
     dba:	b008		add	sp, #32	; 0x20
     dbc:	bd00		pop	{pc}

     dbe:	b500		push	{lr}
     dc0:	b081		sub	sp, #4
; transmit "ftmtool" 7 bytes
     dc2:	2066		mov	r0, #102	; 0x66
     dc4:	f000 f858	bl	0xe78
     dc8:	2074		mov	r0, #116	; 0x74
     dca:	f000 f855	bl	0xe78
     dce:	206d		mov	r0, #109	; 0x6d
     dd0:	f000 f852	bl	0xe78
     dd4:	2074		mov	r0, #116	; 0x74
     dd6:	f000 f84f	bl	0xe78
     dda:	206f		mov	r0, #111	; 0x6f
     ddc:	f000 f84c	bl	0xe78
     de0:	206f		mov	r0, #111	; 0x6f
     de2:	f000 f849	bl	0xe78
     de6:	206c		mov	r0, #108	; 0x6c
     de8:	f000 f846	bl	0xe78
     dec:	4983		ldr	r1, =0x83ff80	; via 0xffc
     dee:	2000		mov	r0, #0
     df0:	7008		strb	r0, [r1, #0]
; delay loop
     df2:	9000		str	r0, [sp, #0]
     df4:	9800		ldr	r0, [sp, #0]
     df6:	0c00		lsr	r0, r0, #16
     df8:	d105		bne	0xe06
     dfa:	9800		ldr	r0, [sp, #0]
     dfc:	3001		add	r0, #1
     dfe:	9000		str	r0, [sp, #0]
     e00:	9800		ldr	r0, [sp, #0]
     e02:	0c00		lsr	r0, r0, #16
     e04:	d0f9		beq	0xdfa
; call Rx-char: expecting "yes"
     e06:	2007		mov	r0, #7
     e08:	0400		lsl	r0, r0, #16
     e0a:	f000 f84d	bl	0xea8
     e0e:	2879		cmp	r0, #121	; 0x79
     e10:	d10e		bne	0xe30
     e12:	2001		mov	r0, #1
     e14:	0300		lsl	r0, r0, #12
     e16:	f000 f847	bl	0xea8
     e1a:	2865		cmp	r0, #101	; 0x65
     e1c:	d108		bne	0xe30
     e1e:	2001		mov	r0, #1
     e20:	0300		lsl	r0, r0, #12
     e22:	f000 f841	bl	0xea8
     e26:	2873		cmp	r0, #115	; 0x73
     e28:	d102		bne	0xe30
     e2a:	4874		ldr	r0, =0x83ff80	; via 0xffc
     e2c:	2101		mov	r1, #1
     e2e:	7001		strb	r1, [r0, #0]
; "yes" and normal boot code paths merge
     e30:	f000 f8ce	bl	0xfd0
     e34:	2800		cmp	r0, #0
     e36:	d00d		beq	0xe54
     e38:	206d		mov	r0, #109	; 0x6d
     e3a:	f000 f81d	bl	0xe78
     e3e:	206f		mov	r0, #111	; 0x6f
     e40:	f000 f81a	bl	0xe78
     e44:	2064		mov	r0, #100	; 0x64
     e46:	f000 f817	bl	0xe78
     e4a:	2065		mov	r0, #101	; 0x65
     e4c:	f000 f814	bl	0xe78
     e50:	206d		mov	r0, #109	; 0x6d
     e52:	e00c		b	0xe6e
     e54:	2065		mov	r0, #101	; 0x65
     e56:	f000 f80f	bl	0xe78
     e5a:	2072		mov	r0, #114	; 0x72
     e5c:	f000 f80c	bl	0xe78
     e60:	2072		mov	r0, #114	; 0x72
     e62:	f000 f809	bl	0xe78
     e66:	206f		mov	r0, #111	; 0x6f
     e68:	f000 f806	bl	0xe78
     e6c:	2072		mov	r0, #114	; 0x72
     e6e:	f000 f803	bl	0xe78
     e72:	b001		add	sp, #4
     e74:	bd00		pop	{pc}

; Called via Thumb-BL to transfer control to the downloaded image
     e76:	4708		bx	r1

; UART character output routine
     e78:	b081		sub	sp, #4
     e7a:	4669		mov	r1, sp
     e7c:	7008		strb	r0, [r1, #0]
     e7e:	4818		ldr	r0, =0x83ff00	; via 0xee0
     e80:	6800		ldr	r0, [r0, #0]
     e82:	7940		ldrb	r0, [r0, #5]
     e84:	0980		lsr	r0, r0, #6
     e86:	d3fa		bcc	0xe7e
     e88:	4815		ldr	r0, =0x83ff00	; via 0xee0
     e8a:	6800		ldr	r0, [r0, #0]
     e8c:	4669		mov	r1, sp
     e8e:	7809		ldrb	r1, [r1, #0]
     e90:	7001		strb	r1, [r0, #0]
     e92:	b001		add	sp, #4
     e94:	46f7		mov	pc, lr

     e96:	4812		ldr	r0, =0x83ff00	; via 0xee0
     e98:	6800		ldr	r0, [r0, #0]
     e9a:	7940		ldrb	r0, [r0, #5]
     e9c:	0840		lsr	r0, r0, #1
     e9e:	d3fa		bcc	0xe96
     ea0:	480f		ldr	r0, =0x83ff00	; via 0xee0
     ea2:	6800		ldr	r0, [r0, #0]
     ea4:	7800		ldrb	r0, [r0, #0]
     ea6:	4770		bx	lr

; UART character input with a timeout (number of LSR read tries passed
; in r0).  Returns the character read if one was received, or 0xFF
; if timeout.
     ea8:	b083		sub	sp, #12	; 0xc
     eaa:	9000		str	r0, [sp, #0]
     eac:	9800		ldr	r0, [sp, #0]
     eae:	9002		str	r0, [sp, #8]
     eb0:	480b		ldr	r0, =0x83ff00	; via 0xee0
     eb2:	6800		ldr	r0, [r0, #0]
     eb4:	7940		ldrb	r0, [r0, #5]
     eb6:	0840		lsr	r0, r0, #1
     eb8:	d20c		bcs	0xed4
     eba:	9802		ldr	r0, [sp, #8]
     ebc:	3801		sub	r0, #1
     ebe:	9002		str	r0, [sp, #8]
     ec0:	9802		ldr	r0, [sp, #8]
     ec2:	2800		cmp	r0, #0
     ec4:	d101		bne	0xeca
     ec6:	20ff		mov	r0, #255	; 0xff
     ec8:	e007		b	0xeda
     eca:	4805		ldr	r0, =0x83ff00	; via 0xee0
     ecc:	6800		ldr	r0, [r0, #0]
     ece:	7940		ldrb	r0, [r0, #5]
     ed0:	0840		lsr	r0, r0, #1
     ed2:	d3f2		bcc	0xeba
     ed4:	484a		ldr	r0, =0x83ff00	; via 0x1000
     ed6:	6800		ldr	r0, [r0, #0]
     ed8:	7800		ldrb	r0, [r0, #0]
     eda:	b003		add	sp, #12	; 0xc
     edc:	4770		bx	lr
     ede:	46c0		nop			(mov r8, r8)

     ee0:	0083ff00
     ee4:	ffff5800

     ee8:	b081		sub	sp, #4
     eea:	e001		b	0xef0
     eec:	9800		ldr	r0, [sp, #0]
     eee:	3801		sub	r0, #1
     ef0:	9000		str	r0, [sp, #0]
     ef2:	4843		ldr	r0, =0x83ff00	; via 0x1000
     ef4:	6800		ldr	r0, [r0, #0]
     ef6:	7940		ldrb	r0, [r0, #5]
     ef8:	0840		lsr	r0, r0, #1
     efa:	d202		bcs	0xf02
     efc:	9800		ldr	r0, [sp, #0]
     efe:	2800		cmp	r0, #0
     f00:	dcf4		bgt	0xeec
     f02:	9800		ldr	r0, [sp, #0]
     f04:	2800		cmp	r0, #0
     f06:	dd01		ble	0xf0c
     f08:	2000		mov	r0, #0
     f0a:	e000		b	0xf0e
     f0c:	2001		mov	r0, #1
     f0e:	b001		add	sp, #4
     f10:	4770		bx	lr

     f12:	b082		sub	sp, #8
     f14:	9000		str	r0, [sp, #0]
     f16:	4669		mov	r1, sp
     f18:	2000		mov	r0, #0
     f1a:	7188		strb	r0, [r1, #6]
     f1c:	9900		ldr	r1, [sp, #0]
     f1e:	4839		ldr	r0, =0xfffef000	; via 0x1004
     f20:	8800		ldrh	r0, [r0, #0]
     f22:	8008		strh	r0, [r1, #0]
     f24:	b002		add	sp, #8
     f26:	4770		bx	lr

     f28:	00800100

; This function (0xf2c) reprograms the UART selected by the 83FF00
; var to the baud rate passed as arguments (div upper byte in R0,
; lower byte in R1) and flushes the Rx FIFO.
     f2c:	b081		sub	sp, #4
     f2e:	466a		mov	r2, sp
     f30:	7051		strb	r1, [r2, #1]
     f32:	4669		mov	r1, sp
     f34:	7008		strb	r0, [r1, #0]
     f36:	4934		ldr	r1, =0xffff6000	; via 0x1008
     f38:	2002		mov	r0, #2
     f3a:	880a		ldrh	r2, [r1, #0]
     f3c:	4310		orr	r0, r2
     f3e:	8008		strh	r0, [r1, #0]
     f40:	4831		ldr	r0, =0xffff6000	; via 0x1008
     f42:	8801		ldrh	r1, [r0, #0]
     f44:	0849		lsr	r1, r1, #1
     f46:	0049		lsl	r1, r1, #1
     f48:	8001		strh	r1, [r0, #0]
     f4a:	492f		ldr	r1, =0xffff6000	; via 0x1008
     f4c:	8808		ldrh	r0, [r1, #0]
     f4e:	2202		mov	r2, #2
     f50:	4390		bic	r0, r2
     f52:	8008		strh	r0, [r1, #0]
     f54:	482a		ldr	r0, =0x83ff00	; via 0x1000
     f56:	6801		ldr	r1, [r0, #0]
     f58:	2007		mov	r0, #7
     f5a:	7208		strb	r0, [r1, #8]
     f5c:	4828		ldr	r0, =0x83ff00	; via 0x1000
     f5e:	6801		ldr	r1, [r0, #0]
     f60:	20bf		mov	r0, #191	; 0xbf
     f62:	70c8		strb	r0, [r1, #3]
     f64:	4826		ldr	r0, =0x83ff00	; via 0x1000
     f66:	6800		ldr	r0, [r0, #0]
     f68:	1c80		add	r0, r0, #2
     f6a:	2110		mov	r1, #16	; 0x10
     f6c:	8802		ldrh	r2, [r0, #0]
     f6e:	4311		orr	r1, r2
     f70:	8001		strh	r1, [r0, #0]
     f72:	4823		ldr	r0, =0x83ff00	; via 0x1000
     f74:	6801		ldr	r1, [r0, #0]
     f76:	2080		mov	r0, #128	; 0x80
     f78:	70c8		strb	r0, [r1, #3]
     f7a:	4821		ldr	r0, =0x83ff00	; via 0x1000
     f7c:	6800		ldr	r0, [r0, #0]
     f7e:	2107		mov	r1, #7
     f80:	7081		strb	r1, [r0, #2]
     f82:	481f		ldr	r0, =0x83ff00	; via 0x1000
     f84:	6800		ldr	r0, [r0, #0]
     f86:	21bf		mov	r1, #191	; 0xbf
     f88:	70c1		strb	r1, [r0, #3]
     f8a:	481d		ldr	r0, =0x83ff00	; via 0x1000
     f8c:	6801		ldr	r1, [r0, #0]
     f8e:	4668		mov	r0, sp
     f90:	7840		ldrb	r0, [r0, #1]
     f92:	7008		strb	r0, [r1, #0]
     f94:	481a		ldr	r0, =0x83ff00	; via 0x1000
     f96:	6801		ldr	r1, [r0, #0]
     f98:	4668		mov	r0, sp
     f9a:	7800		ldrb	r0, [r0, #0]
     f9c:	7048		strb	r0, [r1, #1]
     f9e:	4818		ldr	r0, =0x83ff00	; via 0x1000
     fa0:	6801		ldr	r1, [r0, #0]
     fa2:	2003		mov	r0, #3
     fa4:	70c8		strb	r0, [r1, #3]
     fa6:	4816		ldr	r0, =0x83ff00	; via 0x1000
     fa8:	6800		ldr	r0, [r0, #0]
     faa:	2100		mov	r1, #0
     fac:	7201		strb	r1, [r0, #8]
     fae:	4814		ldr	r0, =0x83ff00	; via 0x1000
     fb0:	6800		ldr	r0, [r0, #0]
     fb2:	7940		ldrb	r0, [r0, #5]
     fb4:	0840		lsr	r0, r0, #1
     fb6:	d309		bcc	0xfcc
     fb8:	4669		mov	r1, sp
     fba:	4811		ldr	r0, =0x83ff00	; via 0x1000
     fbc:	6800		ldr	r0, [r0, #0]
     fbe:	7800		ldrb	r0, [r0, #0]
     fc0:	7088		strb	r0, [r1, #2]
     fc2:	480f		ldr	r0, =0x83ff00	; via 0x1000
     fc4:	6800		ldr	r0, [r0, #0]
     fc6:	7940		ldrb	r0, [r0, #5]
     fc8:	0840		lsr	r0, r0, #1
     fca:	d2f5		bcs	0xfb8
     fcc:	b001		add	sp, #4
     fce:	4770		bx	lr

     fd0:	480a		ldr	r0, =0x83ff80	; via 0xffc
     fd2:	7800		ldrb	r0, [r0, #0]
     fd4:	4770		bx	lr

     fd6:	b500		push	{lr}
     fd8:	b081		sub	sp, #4
     fda:	4669		mov	r1, sp
     fdc:	7008		strb	r0, [r1, #0]
     fde:	4668		mov	r0, sp
     fe0:	7800		ldrb	r0, [r0, #0]
     fe2:	f7ff ff49	bl	0xe78
     fe6:	b001		add	sp, #4
     fe8:	bd00		pop	{pc}
     fea:	b500		push	{lr}
     fec:	f7ff ff53	bl	0xe96
     ff0:	bd00		pop	{pc}
     ff2:	46c0		nop			(mov r8, r8)
     ff4:	3ce0		sub	r4, #224	; 0xe0
     ff6:	0080		lsl	r0, r0, #2
     ff8:	0100		lsl	r0, r0, #4
     ffa:	0080		lsl	r0, r0, #2
     ffc:	ff80		<half-bl>
     ffe:	0083		lsl	r3, r0, #2
    1000:	ff00		<half-bl>
    1002:	0083		lsl	r3, r0, #2
    1004:	f000 fffe	bl	0x2004
    1008:	6000		str	r0, [r0, #0]
    100a:	ffff		<half-bl>
    100c:	4700		bx	r0
    100e:	0000		lsl	r0, r0, #0
    1010:	b08c		sub	sp, #48	; 0x30
    1012:	9101		str	r1, [sp, #4]
    1014:	9000		str	r0, [sp, #0]
    1016:	2000		mov	r0, #0
    1018:	9003		str	r0, [sp, #12]	; 0xc
    101a:	9800		ldr	r0, [sp, #0]
    101c:	7801		ldrb	r1, [r0, #0]
    101e:	3001		add	r0, #1
    1020:	9000		str	r0, [sp, #0]
    1022:	9105		str	r1, [sp, #20]	; 0x14
    1024:	9800		ldr	r0, [sp, #0]
    1026:	7801		ldrb	r1, [r0, #0]
    1028:	3001		add	r0, #1
    102a:	9000		str	r0, [sp, #0]
    102c:	9801		ldr	r0, [sp, #4]
    102e:	7001		strb	r1, [r0, #0]
    1030:	2001		mov	r0, #1
    1032:	9004		str	r0, [sp, #16]	; 0x10
    1034:	e0a8		b	0x1188
    1036:	9804		ldr	r0, [sp, #16]	; 0x10
    1038:	3002		add	r0, #2
    103a:	9004		str	r0, [sp, #16]	; 0x10
    103c:	9800		ldr	r0, [sp, #0]
    103e:	7801		ldrb	r1, [r0, #0]
    1040:	3001		add	r0, #1
    1042:	9000		str	r0, [sp, #0]
    1044:	4668		mov	r0, sp
    1046:	8441		strh	r1, [r0, #34]	; 0x22
    1048:	9800		ldr	r0, [sp, #0]
    104a:	7801		ldrb	r1, [r0, #0]
    104c:	3001		add	r0, #1
    104e:	9000		str	r0, [sp, #0]
    1050:	4668		mov	r0, sp
    1052:	8401		strh	r1, [r0, #32]	; 0x20
    1054:	8c00		ldrh	r0, [r0, #32]	; 0x20
    1056:	4669		mov	r1, sp
    1058:	8c49		ldrh	r1, [r1, #34]	; 0x22
    105a:	0209		lsl	r1, r1, #8
    105c:	1840		add	r0, r0, r1
    105e:	9901		ldr	r1, [sp, #4]
    1060:	8088		strh	r0, [r1, #4]
    1062:	9804		ldr	r0, [sp, #16]	; 0x10
    1064:	3001		add	r0, #1
    1066:	9004		str	r0, [sp, #16]	; 0x10
    1068:	9800		ldr	r0, [sp, #0]
    106a:	7801		ldrb	r1, [r0, #0]
    106c:	3001		add	r0, #1
    106e:	9000		str	r0, [sp, #0]
    1070:	4668		mov	r0, sp
    1072:	7601		strb	r1, [r0, #24]	; 0x18
    1074:	9901		ldr	r1, [sp, #4]
    1076:	7e00		ldrb	r0, [r0, #24]	; 0x18
    1078:	7188		strb	r0, [r1, #6]
    107a:	4668		mov	r0, sp
    107c:	7e00		ldrb	r0, [r0, #24]	; 0x18
    107e:	2840		cmp	r0, #64	; 0x40
    1080:	dc00		bgt	0x1084
    1082:	e09f		b	0x11c4
    1084:	2004		mov	r0, #4
    1086:	9003		str	r0, [sp, #12]	; 0xc
    1088:	e09c		b	0x11c4
    108a:	9804		ldr	r0, [sp, #16]	; 0x10
    108c:	3002		add	r0, #2
    108e:	9004		str	r0, [sp, #16]	; 0x10
    1090:	9800		ldr	r0, [sp, #0]
    1092:	7801		ldrb	r1, [r0, #0]
    1094:	3001		add	r0, #1
    1096:	9000		str	r0, [sp, #0]
    1098:	4668		mov	r0, sp
    109a:	8441		strh	r1, [r0, #34]	; 0x22
    109c:	9800		ldr	r0, [sp, #0]
    109e:	7801		ldrb	r1, [r0, #0]
    10a0:	3001		add	r0, #1
    10a2:	9000		str	r0, [sp, #0]
    10a4:	4668		mov	r0, sp
    10a6:	8401		strh	r1, [r0, #32]	; 0x20
    10a8:	8c00		ldrh	r0, [r0, #32]	; 0x20
    10aa:	4669		mov	r1, sp
    10ac:	8c49		ldrh	r1, [r1, #34]	; 0x22
    10ae:	0209		lsl	r1, r1, #8
    10b0:	1841		add	r1, r0, r1
    10b2:	9801		ldr	r0, [sp, #4]
    10b4:	8081		strh	r1, [r0, #4]
    10b6:	9804		ldr	r0, [sp, #16]	; 0x10
    10b8:	3001		add	r0, #1
    10ba:	9004		str	r0, [sp, #16]	; 0x10
    10bc:	9800		ldr	r0, [sp, #0]
    10be:	7801		ldrb	r1, [r0, #0]
    10c0:	3001		add	r0, #1
    10c2:	9000		str	r0, [sp, #0]
    10c4:	4668		mov	r0, sp
    10c6:	7601		strb	r1, [r0, #24]	; 0x18
    10c8:	9901		ldr	r1, [sp, #4]
    10ca:	7e00		ldrb	r0, [r0, #24]	; 0x18
    10cc:	7188		strb	r0, [r1, #6]
    10ce:	4668		mov	r0, sp
    10d0:	7e00		ldrb	r0, [r0, #24]	; 0x18
    10d2:	2840		cmp	r0, #64	; 0x40
    10d4:	dcd6		bgt	0x1084
    10d6:	9801		ldr	r0, [sp, #4]
    10d8:	3008		add	r0, #8
    10da:	9007		str	r0, [sp, #28]	; 0x1c
    10dc:	2000		mov	r0, #0
    10de:	9002		str	r0, [sp, #8]
    10e0:	9902		ldr	r1, [sp, #8]
    10e2:	4668		mov	r0, sp
    10e4:	7e00		ldrb	r0, [r0, #24]	; 0x18
    10e6:	4281		cmp	r1, r0
    10e8:	da6c		bge	0x11c4
    10ea:	9800		ldr	r0, [sp, #0]
    10ec:	7801		ldrb	r1, [r0, #0]
    10ee:	3001		add	r0, #1
    10f0:	9000		str	r0, [sp, #0]
    10f2:	4668		mov	r0, sp
    10f4:	84c1		strh	r1, [r0, #38]	; 0x26
    10f6:	9800		ldr	r0, [sp, #0]
    10f8:	7801		ldrb	r1, [r0, #0]
    10fa:	3001		add	r0, #1
    10fc:	9000		str	r0, [sp, #0]
    10fe:	4668		mov	r0, sp
    1100:	8481		strh	r1, [r0, #36]	; 0x24
    1102:	9807		ldr	r0, [sp, #28]	; 0x1c
    1104:	1c81		add	r1, r0, #2
    1106:	9107		str	r1, [sp, #28]	; 0x1c
    1108:	4669		mov	r1, sp
    110a:	8c89		ldrh	r1, [r1, #36]	; 0x24
    110c:	466a		mov	r2, sp
    110e:	8cd2		ldrh	r2, [r2, #38]	; 0x26
    1110:	0212		lsl	r2, r2, #8
    1112:	1889		add	r1, r1, r2
    1114:	8001		strh	r1, [r0, #0]
    1116:	9804		ldr	r0, [sp, #16]	; 0x10
    1118:	3002		add	r0, #2
    111a:	9004		str	r0, [sp, #16]	; 0x10
    111c:	9802		ldr	r0, [sp, #8]
    111e:	3001		add	r0, #1
    1120:	9002		str	r0, [sp, #8]
    1122:	9902		ldr	r1, [sp, #8]
    1124:	4668		mov	r0, sp
    1126:	7e00		ldrb	r0, [r0, #24]	; 0x18
    1128:	4281		cmp	r1, r0
    112a:	dbde		blt	0x10ea
    112c:	e04a		b	0x11c4
    112e:	9804		ldr	r0, [sp, #16]	; 0x10
    1130:	3002		add	r0, #2
    1132:	9004		str	r0, [sp, #16]	; 0x10
    1134:	9800		ldr	r0, [sp, #0]
    1136:	7801		ldrb	r1, [r0, #0]
    1138:	3001		add	r0, #1
    113a:	9000		str	r0, [sp, #0]
    113c:	4668		mov	r0, sp
    113e:	8501		strh	r1, [r0, #40]	; 0x28
    1140:	9800		ldr	r0, [sp, #0]
    1142:	7801		ldrb	r1, [r0, #0]
    1144:	3001		add	r0, #1
    1146:	9000		str	r0, [sp, #0]
    1148:	4668		mov	r0, sp
    114a:	8541		strh	r1, [r0, #42]	; 0x2a
    114c:	8d41		ldrh	r1, [r0, #42]	; 0x2a
    114e:	8d00		ldrh	r0, [r0, #40]	; 0x28
    1150:	0200		lsl	r0, r0, #8
    1152:	1809		add	r1, r1, r0
    1154:	9801		ldr	r0, [sp, #4]
    1156:	8081		strh	r1, [r0, #4]
    1158:	9804		ldr	r0, [sp, #16]	; 0x10
    115a:	3002		add	r0, #2
    115c:	9004		str	r0, [sp, #16]	; 0x10
    115e:	9800		ldr	r0, [sp, #0]
    1160:	7801		ldrb	r1, [r0, #0]
    1162:	3001		add	r0, #1
    1164:	9000		str	r0, [sp, #0]
    1166:	4668		mov	r0, sp
    1168:	8581		strh	r1, [r0, #44]	; 0x2c
    116a:	9800		ldr	r0, [sp, #0]
    116c:	7801		ldrb	r1, [r0, #0]
    116e:	3001		add	r0, #1
    1170:	9000		str	r0, [sp, #0]
    1172:	4668		mov	r0, sp
    1174:	85c1		strh	r1, [r0, #46]	; 0x2e
    1176:	8dc1		ldrh	r1, [r0, #46]	; 0x2e
    1178:	8d80		ldrh	r0, [r0, #44]	; 0x2c
    117a:	0200		lsl	r0, r0, #8
    117c:	1808		add	r0, r1, r0
    117e:	9901		ldr	r1, [sp, #4]
    1180:	80c8		strh	r0, [r1, #6]
    1182:	e01f		b	0x11c4
    1184:	2008		mov	r0, #8
    1186:	e77e		b	0x1086
    1188:	9801		ldr	r0, [sp, #4]
    118a:	7801		ldrb	r1, [r0, #0]
    118c:	290a		cmp	r1, #10	; 0xa
    118e:	d8f9		bhi	0x1184
    1190:	a001		add	r0, pc, #4
    1192:	0089		lsl	r1, r1, #2
    1194:	5840		ldr	r0, [r0, r1]
    1196:	4687		mov	pc, r0
    1198:	11c4		asr	r4, r0, #7
    119a:	0000		lsl	r0, r0, #0
    119c:	11c4		asr	r4, r0, #7
    119e:	0000		lsl	r0, r0, #0
    11a0:	11c4		asr	r4, r0, #7
    11a2:	0000		lsl	r0, r0, #0
    11a4:	11c4		asr	r4, r0, #7
    11a6:	0000		lsl	r0, r0, #0
    11a8:	11c4		asr	r4, r0, #7
    11aa:	0000		lsl	r0, r0, #0
    11ac:	11c4		asr	r4, r0, #7
    11ae:	0000		lsl	r0, r0, #0
    11b0:	11c4		asr	r4, r0, #7
    11b2:	0000		lsl	r0, r0, #0
    11b4:	1036		asr	r6, r6, #32
    11b6:	0000		lsl	r0, r0, #0
    11b8:	108a		asr	r2, r1, #2
    11ba:	0000		lsl	r0, r0, #0
    11bc:	11c4		asr	r4, r0, #7
    11be:	0000		lsl	r0, r0, #0
    11c0:	112e		asr	r6, r5, #4
    11c2:	0000		lsl	r0, r0, #0
    11c4:	9905		ldr	r1, [sp, #20]	; 0x14
    11c6:	9804		ldr	r0, [sp, #16]	; 0x10
    11c8:	4281		cmp	r1, r0
    11ca:	d001		beq	0x11d0
    11cc:	2004		mov	r0, #4
    11ce:	9003		str	r0, [sp, #12]	; 0xc
    11d0:	9803		ldr	r0, [sp, #12]	; 0xc
    11d2:	b00c		add	sp, #48	; 0x30
    11d4:	4770		bx	lr
    11d6:	b089		sub	sp, #36	; 0x24
    11d8:	9101		str	r1, [sp, #4]
    11da:	9000		str	r0, [sp, #0]
    11dc:	2000		mov	r0, #0
    11de:	9003		str	r0, [sp, #12]	; 0xc
    11e0:	9801		ldr	r0, [sp, #4]
    11e2:	1c41		add	r1, r0, #1
    11e4:	9101		str	r1, [sp, #4]
    11e6:	9005		str	r0, [sp, #20]	; 0x14
    11e8:	9801		ldr	r0, [sp, #4]
    11ea:	1c41		add	r1, r0, #1
    11ec:	9101		str	r1, [sp, #4]
    11ee:	9900		ldr	r1, [sp, #0]
    11f0:	7809		ldrb	r1, [r1, #0]
    11f2:	7001		strb	r1, [r0, #0]
    11f4:	4669		mov	r1, sp
    11f6:	2001		mov	r0, #1
    11f8:	7408		strb	r0, [r1, #16]	; 0x10
    11fa:	9801		ldr	r0, [sp, #4]
    11fc:	1c41		add	r1, r0, #1
    11fe:	9101		str	r1, [sp, #4]
    1200:	9900		ldr	r1, [sp, #0]
    1202:	7849		ldrb	r1, [r1, #1]
    1204:	7001		strb	r1, [r0, #0]
    1206:	4669		mov	r1, sp
    1208:	4668		mov	r0, sp
    120a:	7c00		ldrb	r0, [r0, #16]	; 0x10
    120c:	3001		add	r0, #1
    120e:	7408		strb	r0, [r1, #16]	; 0x10
    1210:	e0e4		b	0x13dc
    1212:	9800		ldr	r0, [sp, #0]
    1214:	7840		ldrb	r0, [r0, #1]
    1216:	2800		cmp	r0, #0
    1218:	d000		beq	0x121c
    121a:	e0fd		b	0x1418
    121c:	9801		ldr	r0, [sp, #4]
    121e:	1c41		add	r1, r0, #1
    1220:	9101		str	r1, [sp, #4]
    1222:	9900		ldr	r1, [sp, #0]
    1224:	7909		ldrb	r1, [r1, #4]
    1226:	7001		strb	r1, [r0, #0]
    1228:	9801		ldr	r0, [sp, #4]
    122a:	1c41		add	r1, r0, #1
    122c:	9101		str	r1, [sp, #4]
    122e:	9900		ldr	r1, [sp, #0]
    1230:	7949		ldrb	r1, [r1, #5]
    1232:	7001		strb	r1, [r0, #0]
    1234:	9801		ldr	r0, [sp, #4]
    1236:	1c41		add	r1, r0, #1
    1238:	9101		str	r1, [sp, #4]
    123a:	9900		ldr	r1, [sp, #0]
    123c:	7989		ldrb	r1, [r1, #6]
    123e:	7001		strb	r1, [r0, #0]
    1240:	4668		mov	r0, sp
    1242:	7c00		ldrb	r0, [r0, #16]	; 0x10
    1244:	3003		add	r0, #3
    1246:	4669		mov	r1, sp
    1248:	7408		strb	r0, [r1, #16]	; 0x10
    124a:	e0e5		b	0x1418
    124c:	9800		ldr	r0, [sp, #0]
    124e:	7840		ldrb	r0, [r0, #1]
    1250:	2800		cmp	r0, #0
    1252:	d000		beq	0x1256
    1254:	e0e0		b	0x1418
    1256:	9801		ldr	r0, [sp, #4]
    1258:	1c41		add	r1, r0, #1
    125a:	9101		str	r1, [sp, #4]
    125c:	9900		ldr	r1, [sp, #0]
    125e:	7909		ldrb	r1, [r1, #4]
    1260:	7001		strb	r1, [r0, #0]
    1262:	4668		mov	r0, sp
    1264:	7c00		ldrb	r0, [r0, #16]	; 0x10
    1266:	3001		add	r0, #1
    1268:	e7ed		b	0x1246
    126a:	9800		ldr	r0, [sp, #0]
    126c:	7840		ldrb	r0, [r0, #1]
    126e:	2800		cmp	r0, #0
    1270:	d000		beq	0x1274
    1272:	e0d1		b	0x1418
    1274:	e7ef		b	0x1256
    1276:	9800		ldr	r0, [sp, #0]
    1278:	7840		ldrb	r0, [r0, #1]
    127a:	2800		cmp	r0, #0
    127c:	d000		beq	0x1280
    127e:	e0cb		b	0x1418
    1280:	e7e9		b	0x1256
    1282:	9800		ldr	r0, [sp, #0]
    1284:	7840		ldrb	r0, [r0, #1]
    1286:	2800		cmp	r0, #0
    1288:	d000		beq	0x128c
    128a:	e0c5		b	0x1418
    128c:	4669		mov	r1, sp
    128e:	9800		ldr	r0, [sp, #0]
    1290:	8880		ldrh	r0, [r0, #4]
    1292:	8408		strh	r0, [r1, #32]	; 0x20
    1294:	9801		ldr	r0, [sp, #4]
    1296:	1c41		add	r1, r0, #1
    1298:	9101		str	r1, [sp, #4]
    129a:	4669		mov	r1, sp
    129c:	8c09		ldrh	r1, [r1, #32]	; 0x20
    129e:	0409		lsl	r1, r1, #16
    12a0:	0e09		lsr	r1, r1, #24
    12a2:	0209		lsl	r1, r1, #8
    12a4:	1209		asr	r1, r1, #8
    12a6:	7001		strb	r1, [r0, #0]
    12a8:	9801		ldr	r0, [sp, #4]
    12aa:	1c41		add	r1, r0, #1
    12ac:	9101		str	r1, [sp, #4]
    12ae:	4669		mov	r1, sp
    12b0:	8c09		ldrh	r1, [r1, #32]	; 0x20
    12b2:	0609		lsl	r1, r1, #24
    12b4:	0e09		lsr	r1, r1, #24
    12b6:	7001		strb	r1, [r0, #0]
    12b8:	4669		mov	r1, sp
    12ba:	9800		ldr	r0, [sp, #0]
    12bc:	88c0		ldrh	r0, [r0, #6]
    12be:	8408		strh	r0, [r1, #32]	; 0x20
    12c0:	9801		ldr	r0, [sp, #4]
    12c2:	1c41		add	r1, r0, #1
    12c4:	9101		str	r1, [sp, #4]
    12c6:	4669		mov	r1, sp
    12c8:	8c09		ldrh	r1, [r1, #32]	; 0x20
    12ca:	0409		lsl	r1, r1, #16
    12cc:	0e09		lsr	r1, r1, #24
    12ce:	0209		lsl	r1, r1, #8
    12d0:	1209		asr	r1, r1, #8
    12d2:	7001		strb	r1, [r0, #0]
    12d4:	9801		ldr	r0, [sp, #4]
    12d6:	1c41		add	r1, r0, #1
    12d8:	9101		str	r1, [sp, #4]
    12da:	4669		mov	r1, sp
    12dc:	8c09		ldrh	r1, [r1, #32]	; 0x20
    12de:	0609		lsl	r1, r1, #24
    12e0:	0e09		lsr	r1, r1, #24
    12e2:	7001		strb	r1, [r0, #0]
    12e4:	4668		mov	r0, sp
    12e6:	7c00		ldrb	r0, [r0, #16]	; 0x10
    12e8:	3004		add	r0, #4
    12ea:	e7ac		b	0x1246
    12ec:	9800		ldr	r0, [sp, #0]
    12ee:	7840		ldrb	r0, [r0, #1]
    12f0:	2800		cmp	r0, #0
    12f2:	d000		beq	0x12f6
    12f4:	e090		b	0x1418
    12f6:	e7ae		b	0x1256
    12f8:	9800		ldr	r0, [sp, #0]
    12fa:	7840		ldrb	r0, [r0, #1]
    12fc:	2800		cmp	r0, #0
    12fe:	d000		beq	0x1302
    1300:	e08a		b	0x1418
    1302:	4669		mov	r1, sp
    1304:	4668		mov	r0, sp
    1306:	7c00		ldrb	r0, [r0, #16]	; 0x10
    1308:	3001		add	r0, #1
    130a:	7408		strb	r0, [r1, #16]	; 0x10
    130c:	4668		mov	r0, sp
    130e:	9900		ldr	r1, [sp, #0]
    1310:	7909		ldrb	r1, [r1, #4]
    1312:	7601		strb	r1, [r0, #24]	; 0x18
    1314:	9801		ldr	r0, [sp, #4]
    1316:	1c41		add	r1, r0, #1
    1318:	9101		str	r1, [sp, #4]
    131a:	4669		mov	r1, sp
    131c:	7e09		ldrb	r1, [r1, #24]	; 0x18
    131e:	7001		strb	r1, [r0, #0]
    1320:	4668		mov	r0, sp
    1322:	7e00		ldrb	r0, [r0, #24]	; 0x18
    1324:	2840		cmp	r0, #64	; 0x40
    1326:	dd01		ble	0x132c
    1328:	2004		mov	r0, #4
    132a:	e055		b	0x13d8
    132c:	9800		ldr	r0, [sp, #0]
    132e:	3006		add	r0, #6
    1330:	9007		str	r0, [sp, #28]	; 0x1c
    1332:	2000		mov	r0, #0
    1334:	9002		str	r0, [sp, #8]
    1336:	9902		ldr	r1, [sp, #8]
    1338:	4668		mov	r0, sp
    133a:	7e00		ldrb	r0, [r0, #24]	; 0x18
    133c:	4281		cmp	r1, r0
    133e:	da6b		bge	0x1418
    1340:	9801		ldr	r0, [sp, #4]
    1342:	1c41		add	r1, r0, #1
    1344:	9101		str	r1, [sp, #4]
    1346:	9907		ldr	r1, [sp, #28]	; 0x1c
    1348:	8809		ldrh	r1, [r1, #0]
    134a:	0409		lsl	r1, r1, #16
    134c:	0e09		lsr	r1, r1, #24
    134e:	0209		lsl	r1, r1, #8
    1350:	1209		asr	r1, r1, #8
    1352:	7001		strb	r1, [r0, #0]
    1354:	9807		ldr	r0, [sp, #28]	; 0x1c
    1356:	8801		ldrh	r1, [r0, #0]
    1358:	3002		add	r0, #2
    135a:	9007		str	r0, [sp, #28]	; 0x1c
    135c:	0608		lsl	r0, r1, #24
    135e:	0e01		lsr	r1, r0, #24
    1360:	9801		ldr	r0, [sp, #4]
    1362:	1c42		add	r2, r0, #1
    1364:	9201		str	r2, [sp, #4]
    1366:	7001		strb	r1, [r0, #0]
    1368:	4669		mov	r1, sp
    136a:	4668		mov	r0, sp
    136c:	7c00		ldrb	r0, [r0, #16]	; 0x10
    136e:	3002		add	r0, #2
    1370:	7408		strb	r0, [r1, #16]	; 0x10
    1372:	9802		ldr	r0, [sp, #8]
    1374:	3001		add	r0, #1
    1376:	9002		str	r0, [sp, #8]
    1378:	9902		ldr	r1, [sp, #8]
    137a:	4668		mov	r0, sp
    137c:	7e00		ldrb	r0, [r0, #24]	; 0x18
    137e:	4281		cmp	r1, r0
    1380:	dbde		blt	0x1340
    1382:	e049		b	0x1418
    1384:	9800		ldr	r0, [sp, #0]
    1386:	7840		ldrb	r0, [r0, #1]
    1388:	2800		cmp	r0, #0
    138a:	d145		bne	0x1418
    138c:	4669		mov	r1, sp
    138e:	9800		ldr	r0, [sp, #0]
    1390:	8880		ldrh	r0, [r0, #4]
    1392:	8408		strh	r0, [r1, #32]	; 0x20
    1394:	9801		ldr	r0, [sp, #4]
    1396:	1c41		add	r1, r0, #1
    1398:	9101		str	r1, [sp, #4]
    139a:	4669		mov	r1, sp
    139c:	8c09		ldrh	r1, [r1, #32]	; 0x20
    139e:	0409		lsl	r1, r1, #16
    13a0:	0e09		lsr	r1, r1, #24
    13a2:	0209		lsl	r1, r1, #8
    13a4:	1209		asr	r1, r1, #8
    13a6:	7001		strb	r1, [r0, #0]
    13a8:	9801		ldr	r0, [sp, #4]
    13aa:	1c41		add	r1, r0, #1
    13ac:	9101		str	r1, [sp, #4]
    13ae:	4669		mov	r1, sp
    13b0:	8c09		ldrh	r1, [r1, #32]	; 0x20
    13b2:	0609		lsl	r1, r1, #24
    13b4:	0e09		lsr	r1, r1, #24
    13b6:	7001		strb	r1, [r0, #0]
    13b8:	4668		mov	r0, sp
    13ba:	9900		ldr	r1, [sp, #0]
    13bc:	88c9		ldrh	r1, [r1, #6]
    13be:	8401		strh	r1, [r0, #32]	; 0x20
    13c0:	9901		ldr	r1, [sp, #4]
    13c2:	1c48		add	r0, r1, #1
    13c4:	9001		str	r0, [sp, #4]
    13c6:	4668		mov	r0, sp
    13c8:	8c00		ldrh	r0, [r0, #32]	; 0x20
    13ca:	0400		lsl	r0, r0, #16
    13cc:	0e00		lsr	r0, r0, #24
    13ce:	0200		lsl	r0, r0, #8
    13d0:	1200		asr	r0, r0, #8
    13d2:	7008		strb	r0, [r1, #0]
    13d4:	e77e		b	0x12d4
    13d6:	2008		mov	r0, #8
    13d8:	9003		str	r0, [sp, #12]	; 0xc
    13da:	e01d		b	0x1418
    13dc:	9800		ldr	r0, [sp, #0]
    13de:	7800		ldrb	r0, [r0, #0]
    13e0:	280a		cmp	r0, #10	; 0xa
    13e2:	d8f8		bhi	0x13d6
    13e4:	a101		add	r1, pc, #4
    13e6:	0080		lsl	r0, r0, #2
    13e8:	5808		ldr	r0, [r1, r0]
    13ea:	4687		mov	pc, r0
    13ec:	1212		asr	r2, r2, #8
    13ee:	0000		lsl	r0, r0, #0
    13f0:	124c		asr	r4, r1, #9
    13f2:	0000		lsl	r0, r0, #0
    13f4:	126a		asr	r2, r5, #9
    13f6:	0000		lsl	r0, r0, #0
    13f8:	1276		asr	r6, r6, #9
    13fa:	0000		lsl	r0, r0, #0
    13fc:	1418		asr	r0, r3, #16
    13fe:	0000		lsl	r0, r0, #0
    1400:	1282		asr	r2, r0, #10
    1402:	0000		lsl	r0, r0, #0
    1404:	12ec		asr	r4, r5, #11
    1406:	0000		lsl	r0, r0, #0
    1408:	12f8		asr	r0, r7, #11
    140a:	0000		lsl	r0, r0, #0
    140c:	1418		asr	r0, r3, #16
    140e:	0000		lsl	r0, r0, #0
    1410:	1384		asr	r4, r0, #14
    1412:	0000		lsl	r0, r0, #0
    1414:	1418		asr	r0, r3, #16
    1416:	0000		lsl	r0, r0, #0
    1418:	9805		ldr	r0, [sp, #20]	; 0x14
    141a:	4669		mov	r1, sp
    141c:	7c09		ldrb	r1, [r1, #16]	; 0x10
    141e:	7001		strb	r1, [r0, #0]
    1420:	9803		ldr	r0, [sp, #12]	; 0xc
    1422:	b009		add	sp, #36	; 0x24
    1424:	4770		bx	lr
    1426:	0000		lsl	r0, r0, #0
    1428:	b500		push	{lr}
    142a:	b083		sub	sp, #12	; 0xc
    142c:	9101		str	r1, [sp, #4]
    142e:	4669		mov	r1, sp
    1430:	7008		strb	r0, [r1, #0]
    1432:	2000		mov	r0, #0
    1434:	9002		str	r0, [sp, #8]
    1436:	e073		b	0x1520
    1438:	4668		mov	r0, sp
    143a:	7800		ldrb	r0, [r0, #0]
    143c:	28aa		cmp	r0, #170	; 0xaa
    143e:	d106		bne	0x144e
    1440:	4965		ldr	r1, =0x83ff10	; via 0x15d8
    1442:	4865		ldr	r0, =0x83ff10	; via 0x15d8
    1444:	6800		ldr	r0, [r0, #0]
    1446:	3001		add	r0, #1
    1448:	07c0		lsl	r0, r0, #31
    144a:	0fc0		lsr	r0, r0, #31
    144c:	e013		b	0x1476
    144e:	4862		ldr	r0, =0x83ff10	; via 0x15d8
    1450:	6800		ldr	r0, [r0, #0]
    1452:	2800		cmp	r0, #0
    1454:	d06b		beq	0x152e
    1456:	4961		ldr	r1, =0x83ff04	; via 0x15dc
    1458:	9801		ldr	r0, [sp, #4]
    145a:	3001		add	r0, #1
    145c:	6008		str	r0, [r1, #0]
    145e:	4960		ldr	r1, =0x83ff0e	; via 0x15e0
    1460:	2000		mov	r0, #0
    1462:	7008		strb	r0, [r1, #0]
    1464:	495f		ldr	r1, =0x83ff0c	; via 0x15e4
    1466:	4668		mov	r0, sp
    1468:	7800		ldrb	r0, [r0, #0]
    146a:	8008		strh	r0, [r1, #0]
    146c:	495a		ldr	r1, =0x83ff10	; via 0x15d8
    146e:	2000		mov	r0, #0
    1470:	6008		str	r0, [r1, #0]
    1472:	495d		ldr	r1, =0x83ff08	; via 0x15e8
    1474:	2001		mov	r0, #1
    1476:	6008		str	r0, [r1, #0]
    1478:	e059		b	0x152e
    147a:	4668		mov	r0, sp
    147c:	7800		ldrb	r0, [r0, #0]
    147e:	28aa		cmp	r0, #170	; 0xaa
    1480:	d113		bne	0x14aa
    1482:	4855		ldr	r0, =0x83ff10	; via 0x15d8
    1484:	6800		ldr	r0, [r0, #0]
    1486:	2800		cmp	r0, #0
    1488:	d00b		beq	0x14a2
    148a:	4954		ldr	r1, =0x83ff04	; via 0x15dc
    148c:	6808		ldr	r0, [r1, #0]
    148e:	1c42		add	r2, r0, #1
    1490:	600a		str	r2, [r1, #0]
    1492:	4669		mov	r1, sp
    1494:	7809		ldrb	r1, [r1, #0]
    1496:	7001		strb	r1, [r0, #0]
    1498:	4951		ldr	r1, =0x83ff0e	; via 0x15e0
    149a:	7808		ldrb	r0, [r1, #0]
    149c:	3001		add	r0, #1
    149e:	7008		strb	r0, [r1, #0]
    14a0:	e013		b	0x14ca
    14a2:	2101		mov	r1, #1
    14a4:	484c		ldr	r0, =0x83ff10	; via 0x15d8
    14a6:	6001		str	r1, [r0, #0]
    14a8:	e01c		b	0x14e4
    14aa:	484b		ldr	r0, =0x83ff10	; via 0x15d8
    14ac:	6800		ldr	r0, [r0, #0]
    14ae:	2800		cmp	r0, #0
    14b0:	d00d		beq	0x14ce
    14b2:	494a		ldr	r1, =0x83ff04	; via 0x15dc
    14b4:	9801		ldr	r0, [sp, #4]
    14b6:	3001		add	r0, #1
    14b8:	6008		str	r0, [r1, #0]
    14ba:	4849		ldr	r0, =0x83ff0e	; via 0x15e0
    14bc:	2100		mov	r1, #0
    14be:	7001		strb	r1, [r0, #0]
    14c0:	4948		ldr	r1, =0x83ff0c	; via 0x15e4
    14c2:	4668		mov	r0, sp
    14c4:	7800		ldrb	r0, [r0, #0]
    14c6:	3001		add	r0, #1
    14c8:	8008		strh	r0, [r1, #0]
    14ca:	2100		mov	r1, #0
    14cc:	e7ea		b	0x14a4
    14ce:	4843		ldr	r0, =0x83ff04	; via 0x15dc
    14d0:	6801		ldr	r1, [r0, #0]
    14d2:	1c4a		add	r2, r1, #1
    14d4:	6002		str	r2, [r0, #0]
    14d6:	4668		mov	r0, sp
    14d8:	7800		ldrb	r0, [r0, #0]
    14da:	7008		strb	r0, [r1, #0]
    14dc:	4940		ldr	r1, =0x83ff0e	; via 0x15e0
    14de:	7808		ldrb	r0, [r1, #0]
    14e0:	3001		add	r0, #1
    14e2:	7008		strb	r0, [r1, #0]
    14e4:	483f		ldr	r0, =0x83ff0c	; via 0x15e4
    14e6:	8801		ldrh	r1, [r0, #0]
    14e8:	3901		sub	r1, #1
    14ea:	8001		strh	r1, [r0, #0]
    14ec:	483d		ldr	r0, =0x83ff0c	; via 0x15e4
    14ee:	8800		ldrh	r0, [r0, #0]
    14f0:	2800		cmp	r0, #0
    14f2:	d11c		bne	0x152e
    14f4:	9901		ldr	r1, [sp, #4]
    14f6:	483a		ldr	r0, =0x83ff0e	; via 0x15e0
    14f8:	7800		ldrb	r0, [r0, #0]
    14fa:	7008		strb	r0, [r1, #0]
    14fc:	2001		mov	r0, #1
    14fe:	9002		str	r0, [sp, #8]
    1500:	4839		ldr	r0, =0x83ff08	; via 0x15e8
    1502:	2100		mov	r1, #0
    1504:	6001		str	r1, [r0, #0]
    1506:	4834		ldr	r0, =0x83ff10	; via 0x15d8
    1508:	6001		str	r1, [r0, #0]
    150a:	9801		ldr	r0, [sp, #4]
    150c:	7800		ldrb	r0, [r0, #0]
    150e:	2801		cmp	r0, #1
    1510:	d10d		bne	0x152e
    1512:	9801		ldr	r0, [sp, #4]
    1514:	7840		ldrb	r0, [r0, #1]
    1516:	28dd		cmp	r0, #221	; 0xdd
    1518:	d109		bne	0x152e
    151a:	f7ff fb03	bl	0xb24
    151e:	e006		b	0x152e
    1520:	4831		ldr	r0, =0x83ff08	; via 0x15e8
    1522:	6800		ldr	r0, [r0, #0]
    1524:	2800		cmp	r0, #0
    1526:	d087		beq	0x1438
    1528:	3801		sub	r0, #1
    152a:	2800		cmp	r0, #0
    152c:	d0a5		beq	0x147a
    152e:	9802		ldr	r0, [sp, #8]
    1530:	b003		add	sp, #12	; 0xc
    1532:	bd00		pop	{pc}
    1534:	b086		sub	sp, #24	; 0x18
    1536:	9202		str	r2, [sp, #8]
    1538:	9101		str	r1, [sp, #4]
    153a:	9000		str	r0, [sp, #0]
    153c:	9801		ldr	r0, [sp, #4]
    153e:	3001		add	r0, #1
    1540:	9004		str	r0, [sp, #16]	; 0x10
    1542:	9800		ldr	r0, [sp, #0]
    1544:	1c41		add	r1, r0, #1
    1546:	9100		str	r1, [sp, #0]
    1548:	9005		str	r0, [sp, #20]	; 0x14
    154a:	9901		ldr	r1, [sp, #4]
    154c:	20aa		mov	r0, #170	; 0xaa
    154e:	7008		strb	r0, [r1, #0]
    1550:	9801		ldr	r0, [sp, #4]
    1552:	3002		add	r0, #2
    1554:	9001		str	r0, [sp, #4]
    1556:	9902		ldr	r1, [sp, #8]
    1558:	2000		mov	r0, #0
    155a:	8008		strh	r0, [r1, #0]
    155c:	4669		mov	r1, sp
    155e:	8188		strh	r0, [r1, #12]	; 0xc
    1560:	4668		mov	r0, sp
    1562:	8981		ldrh	r1, [r0, #12]	; 0xc
    1564:	9805		ldr	r0, [sp, #20]	; 0x14
    1566:	7800		ldrb	r0, [r0, #0]
    1568:	4281		cmp	r1, r0
    156a:	da23		bge	0x15b4
    156c:	9800		ldr	r0, [sp, #0]
    156e:	7800		ldrb	r0, [r0, #0]
    1570:	28aa		cmp	r0, #170	; 0xaa
    1572:	d108		bne	0x1586
    1574:	9801		ldr	r0, [sp, #4]
    1576:	1c41		add	r1, r0, #1
    1578:	9101		str	r1, [sp, #4]
    157a:	21aa		mov	r1, #170	; 0xaa
    157c:	7001		strb	r1, [r0, #0]
    157e:	9902		ldr	r1, [sp, #8]
    1580:	8808		ldrh	r0, [r1, #0]
    1582:	3001		add	r0, #1
    1584:	8008		strh	r0, [r1, #0]
    1586:	9800		ldr	r0, [sp, #0]
    1588:	7801		ldrb	r1, [r0, #0]
    158a:	3001		add	r0, #1
    158c:	9000		str	r0, [sp, #0]
    158e:	9801		ldr	r0, [sp, #4]
    1590:	1c42		add	r2, r0, #1
    1592:	9201		str	r2, [sp, #4]
    1594:	7001		strb	r1, [r0, #0]
    1596:	9902		ldr	r1, [sp, #8]
    1598:	8808		ldrh	r0, [r1, #0]
    159a:	3001		add	r0, #1
    159c:	8008		strh	r0, [r1, #0]
    159e:	4669		mov	r1, sp
    15a0:	4668		mov	r0, sp
    15a2:	8980		ldrh	r0, [r0, #12]	; 0xc
    15a4:	3001		add	r0, #1
    15a6:	8188		strh	r0, [r1, #12]	; 0xc
    15a8:	4668		mov	r0, sp
    15aa:	8980		ldrh	r0, [r0, #12]	; 0xc
    15ac:	9905		ldr	r1, [sp, #20]	; 0x14
    15ae:	7809		ldrb	r1, [r1, #0]
    15b0:	4288		cmp	r0, r1
    15b2:	dbdb		blt	0x156c
    15b4:	9904		ldr	r1, [sp, #16]	; 0x10
    15b6:	9802		ldr	r0, [sp, #8]
    15b8:	7800		ldrb	r0, [r0, #0]
    15ba:	7008		strb	r0, [r1, #0]
    15bc:	9902		ldr	r1, [sp, #8]
    15be:	8808		ldrh	r0, [r1, #0]
    15c0:	3002		add	r0, #2
    15c2:	8008		strh	r0, [r1, #0]
    15c4:	b006		add	sp, #24	; 0x18
    15c6:	4770		bx	lr

; function zeroes out IRAM word vars at 0x83ff08 and 0x83ff10
    15c8:	4907		ldr	r1, =0x83ff08	; via 0x15e8
    15ca:	2000		mov	r0, #0
    15cc:	6008		str	r0, [r1, #0]
    15ce:	4802		ldr	r0, =0x83ff10	; via 0x15d8
    15d0:	2100		mov	r1, #0
    15d2:	6001		str	r1, [r0, #0]
    15d4:	4770		bx	lr
    15d6:	46c0		nop			(mov r8, r8)

    15d8:	0083ff10
    15dc:	0083ff04
    15e0:	0083ff0e
    15e4:	0083ff0c
    15e8:	0083ff08

    15ec:	b082		sub	sp, #8
    15ee:	9101		str	r1, [sp, #4]
    15f0:	9000		str	r0, [sp, #0]
    15f2:	9901		ldr	r1, [sp, #4]
    15f4:	2000		mov	r0, #0
    15f6:	7008		strb	r0, [r1, #0]
    15f8:	9801		ldr	r0, [sp, #4]
    15fa:	2100		mov	r1, #0
    15fc:	7041		strb	r1, [r0, #1]
    15fe:	9801		ldr	r0, [sp, #4]
    1600:	2102		mov	r1, #2
    1602:	7101		strb	r1, [r0, #4]
    1604:	9801		ldr	r0, [sp, #4]
    1606:	2106		mov	r1, #6
    1608:	7141		strb	r1, [r0, #5]
    160a:	9801		ldr	r0, [sp, #4]
    160c:	2102		mov	r1, #2
    160e:	7181		strb	r1, [r0, #6]
    1610:	b002		add	sp, #8
    1612:	4770		bx	lr

    1614:	b500		push	{lr}
    1616:	b084		sub	sp, #16	; 0x10
    1618:	466b		mov	r3, sp
    161a:	721a		strb	r2, [r3, #8]
    161c:	9101		str	r1, [sp, #4]
    161e:	9000		str	r0, [sp, #0]
    1620:	9901		ldr	r1, [sp, #4]
    1622:	2009		mov	r0, #9
    1624:	7008		strb	r0, [r1, #0]
    1626:	e015		b	0x1654
    1628:	9801		ldr	r0, [sp, #4]
    162a:	2100		mov	r1, #0
    162c:	7041		strb	r1, [r0, #1]
    162e:	9901		ldr	r1, [sp, #4]
    1630:	4668		mov	r0, sp
    1632:	8940		ldrh	r0, [r0, #10]	; 0xa
    1634:	8088		strh	r0, [r1, #4]
    1636:	9901		ldr	r1, [sp, #4]
    1638:	4668		mov	r0, sp
    163a:	8980		ldrh	r0, [r0, #12]	; 0xc
    163c:	80c8		strh	r0, [r1, #6]
    163e:	e01e		b	0x167e
    1640:	2101		mov	r1, #1
    1642:	e004		b	0x164e
    1644:	2103		mov	r1, #3
    1646:	e002		b	0x164e
    1648:	2105		mov	r1, #5
    164a:	e000		b	0x164e
    164c:	2106		mov	r1, #6
    164e:	9801		ldr	r0, [sp, #4]
    1650:	7041		strb	r1, [r0, #1]
    1652:	e014		b	0x167e
    1654:	200a		mov	r0, #10	; 0xa
    1656:	4468		add	r0, sp
    1658:	a903		add	r1, sp, #12	; 0xc
    165a:	466a		mov	r2, sp
    165c:	7a12		ldrb	r2, [r2, #8]
    165e:	f000 fb71	bl	0x1d44
    1662:	2800		cmp	r0, #0
    1664:	d0e0		beq	0x1628
    1666:	3801		sub	r0, #1
    1668:	2800		cmp	r0, #0
    166a:	d0e9		beq	0x1640
    166c:	3801		sub	r0, #1
    166e:	2800		cmp	r0, #0
    1670:	d0e8		beq	0x1644
    1672:	3801		sub	r0, #1
    1674:	2800		cmp	r0, #0
    1676:	d0e7		beq	0x1648
    1678:	3801		sub	r0, #1
    167a:	2800		cmp	r0, #0
    167c:	d0e6		beq	0x164c
    167e:	b004		add	sp, #16	; 0x10
    1680:	bd00		pop	{pc}
    1682:	b084		sub	sp, #16	; 0x10
    1684:	9101		str	r1, [sp, #4]
    1686:	9000		str	r0, [sp, #0]
    1688:	9901		ldr	r1, [sp, #4]
    168a:	200a		mov	r0, #10	; 0xa
    168c:	7008		strb	r0, [r1, #0]
    168e:	9801		ldr	r0, [sp, #4]
    1690:	2100		mov	r1, #0
    1692:	7041		strb	r1, [r0, #1]
    1694:	4669		mov	r1, sp
    1696:	9800		ldr	r0, [sp, #0]
    1698:	8880		ldrh	r0, [r0, #4]
    169a:	8108		strh	r0, [r1, #8]
    169c:	9800		ldr	r0, [sp, #0]
    169e:	88c0		ldrh	r0, [r0, #6]
    16a0:	8148		strh	r0, [r1, #10]	; 0xa
    16a2:	4668		mov	r0, sp
    16a4:	8941		ldrh	r1, [r0, #10]	; 0xa
    16a6:	8900		ldrh	r0, [r0, #8]
    16a8:	0400		lsl	r0, r0, #16
    16aa:	1808		add	r0, r1, r0
    16ac:	9003		str	r0, [sp, #12]	; 0xc
    16ae:	9803		ldr	r0, [sp, #12]	; 0xc
    16b0:	b004		add	sp, #16	; 0x10
    16b2:	4770		bx	lr
    16b4:	b085		sub	sp, #20	; 0x14
    16b6:	9303		str	r3, [sp, #12]	; 0xc
    16b8:	9202		str	r2, [sp, #8]
    16ba:	9101		str	r1, [sp, #4]
    16bc:	4669		mov	r1, sp
    16be:	7008		strb	r0, [r1, #0]
    16c0:	48ea		ldr	r0, =0x83ff19	; via 0x1a6c
    16c2:	7809		ldrb	r1, [r1, #0]
    16c4:	7802		ldrb	r2, [r0, #0]
    16c6:	1889		add	r1, r1, r2
    16c8:	7001		strb	r1, [r0, #0]
    16ca:	48e9		ldr	r0, =0x83ff1a	; via 0x1a70
    16cc:	7800		ldrb	r0, [r0, #0]
    16ce:	2800		cmp	r0, #0
    16d0:	d00e		beq	0x16f0
    16d2:	48e8		ldr	r0, =0x83ff26	; via 0x1a74
    16d4:	4669		mov	r1, sp
    16d6:	780a		ldrb	r2, [r1, #0]
    16d8:	8801		ldrh	r1, [r0, #0]
    16da:	1851		add	r1, r2, r1
    16dc:	8001		strh	r1, [r0, #0]
    16de:	9903		ldr	r1, [sp, #12]	; 0xc
    16e0:	48e4		ldr	r0, =0x83ff26	; via 0x1a74
    16e2:	8800		ldrh	r0, [r0, #0]
    16e4:	8008		strh	r0, [r1, #0]
    16e6:	9801		ldr	r0, [sp, #4]
    16e8:	2100		mov	r1, #0
    16ea:	6001		str	r1, [r0, #0]
    16ec:	2000		mov	r0, #0
    16ee:	e009		b	0x1704
    16f0:	9902		ldr	r1, [sp, #8]
    16f2:	6808		ldr	r0, [r1, #0]
    16f4:	3002		add	r0, #2
    16f6:	6008		str	r0, [r1, #0]
    16f8:	49de		ldr	r1, =0x83ff26	; via 0x1a74
    16fa:	4668		mov	r0, sp
    16fc:	7800		ldrb	r0, [r0, #0]
    16fe:	0200		lsl	r0, r0, #8
    1700:	8008		strh	r0, [r1, #0]
    1702:	2001		mov	r0, #1
    1704:	9004		str	r0, [sp, #16]	; 0x10
    1706:	2001		mov	r0, #1
    1708:	49d9		ldr	r1, =0x83ff1a	; via 0x1a70
    170a:	7809		ldrb	r1, [r1, #0]
    170c:	4388		bic	r0, r1
    170e:	49d8		ldr	r1, =0x83ff1a	; via 0x1a70
    1710:	7008		strb	r0, [r1, #0]
    1712:	48d9		ldr	r0, =0x83ff24	; via 0x1a78
    1714:	7801		ldrb	r1, [r0, #0]
    1716:	3901		sub	r1, #1
    1718:	7001		strb	r1, [r0, #0]
    171a:	48d7		ldr	r0, =0x83ff24	; via 0x1a78
    171c:	7800		ldrb	r0, [r0, #0]
    171e:	2800		cmp	r0, #0
    1720:	d102		bne	0x1728
    1722:	48d6		ldr	r0, =0x83ff20	; via 0x1a7c
    1724:	2106		mov	r1, #6
    1726:	6001		str	r1, [r0, #0]
    1728:	9804		ldr	r0, [sp, #16]	; 0x10
    172a:	b005		add	sp, #20	; 0x14
    172c:	46f7		mov	pc, lr
    172e:	b083		sub	sp, #12	; 0xc
    1730:	9101		str	r1, [sp, #4]
    1732:	4669		mov	r1, sp
    1734:	7008		strb	r0, [r1, #0]
    1736:	2001		mov	r0, #1
    1738:	9002		str	r0, [sp, #8]
    173a:	48d1		ldr	r0, =0x83ff1b	; via 0x1a80
    173c:	7800		ldrb	r0, [r0, #0]
    173e:	2800		cmp	r0, #0
    1740:	d10a		bne	0x1758
    1742:	4668		mov	r0, sp
    1744:	7800		ldrb	r0, [r0, #0]
    1746:	2853		cmp	r0, #83	; 0x53
    1748:	d102		bne	0x1750
    174a:	48cd		ldr	r0, =0x83ff1b	; via 0x1a80
    174c:	2101		mov	r1, #1
    174e:	e01a		b	0x1786
    1750:	2101		mov	r1, #1
    1752:	9801		ldr	r0, [sp, #4]
    1754:	6001		str	r1, [r0, #0]
    1756:	e03b		b	0x17d0
    1758:	49c9		ldr	r1, =0x83ff1b	; via 0x1a80
    175a:	2000		mov	r0, #0
    175c:	7008		strb	r0, [r1, #0]
    175e:	4668		mov	r0, sp
    1760:	7800		ldrb	r0, [r0, #0]
    1762:	2830		cmp	r0, #48	; 0x30
    1764:	d111		bne	0x178a
    1766:	48c7		ldr	r0, =0x83ff18	; via 0x1a84
    1768:	7800		ldrb	r0, [r0, #0]
    176a:	2800		cmp	r0, #0
    176c:	d006		beq	0x177c
    176e:	9901		ldr	r1, [sp, #4]
    1770:	2001		mov	r0, #1
    1772:	6008		str	r0, [r1, #0]
    1774:	49c3		ldr	r1, =0x83ff18	; via 0x1a84
    1776:	2000		mov	r0, #0
    1778:	7008		strb	r0, [r1, #0]
    177a:	e02a		b	0x17d2
    177c:	48bf		ldr	r0, =0x83ff20	; via 0x1a7c
    177e:	2102		mov	r1, #2
    1780:	6001		str	r1, [r0, #0]
    1782:	48ef		ldr	r0, =0x83ff1c	; via 0x1b40
    1784:	2100		mov	r1, #0
    1786:	7001		strb	r1, [r0, #0]
    1788:	e024		b	0x17d4
    178a:	4668		mov	r0, sp
    178c:	7800		ldrb	r0, [r0, #0]
    178e:	2833		cmp	r0, #51	; 0x33
    1790:	d105		bne	0x179e
    1792:	48bc		ldr	r0, =0x83ff18	; via 0x1a84
    1794:	7800		ldrb	r0, [r0, #0]
    1796:	2800		cmp	r0, #0
    1798:	d0da		beq	0x1750
    179a:	2004		mov	r0, #4
    179c:	e00c		b	0x17b8
    179e:	4668		mov	r0, sp
    17a0:	7800		ldrb	r0, [r0, #0]
    17a2:	2837		cmp	r0, #55	; 0x37
    17a4:	d10e		bne	0x17c4
    17a6:	48b7		ldr	r0, =0x83ff18	; via 0x1a84
    17a8:	7800		ldrb	r0, [r0, #0]
    17aa:	2800		cmp	r0, #0
    17ac:	d103		bne	0x17b6
    17ae:	9901		ldr	r1, [sp, #4]
    17b0:	2001		mov	r0, #1
    17b2:	6008		str	r0, [r1, #0]
    17b4:	e00c		b	0x17d0
    17b6:	2003		mov	r0, #3
    17b8:	49b0		ldr	r1, =0x83ff20	; via 0x1a7c
    17ba:	6008		str	r0, [r1, #0]
    17bc:	2000		mov	r0, #0
    17be:	49e0		ldr	r1, =0x83ff1c	; via 0x1b40
    17c0:	7008		strb	r0, [r1, #0]
    17c2:	e007		b	0x17d4
    17c4:	9901		ldr	r1, [sp, #4]
    17c6:	2001		mov	r0, #1
    17c8:	6008		str	r0, [r1, #0]
    17ca:	48ae		ldr	r0, =0x83ff18	; via 0x1a84
    17cc:	2100		mov	r1, #0
    17ce:	7001		strb	r1, [r0, #0]
    17d0:	2000		mov	r0, #0
    17d2:	9002		str	r0, [sp, #8]
    17d4:	9802		ldr	r0, [sp, #8]
    17d6:	b003		add	sp, #12	; 0xc
    17d8:	46f7		mov	pc, lr
    17da:	b083		sub	sp, #12	; 0xc
    17dc:	9101		str	r1, [sp, #4]
    17de:	4669		mov	r1, sp
    17e0:	7008		strb	r0, [r1, #0]
    17e2:	2001		mov	r0, #1
    17e4:	9002		str	r0, [sp, #8]
    17e6:	49d7		ldr	r1, =0x830	; via 0x1b44
    17e8:	48d5		ldr	r0, =0x83ff1c	; via 0x1b40
    17ea:	7800		ldrb	r0, [r0, #0]
    17ec:	0080		lsl	r0, r0, #2
    17ee:	5808		ldr	r0, [r1, r0]
    17f0:	4669		mov	r1, sp
    17f2:	7809		ldrb	r1, [r1, #0]
    17f4:	4281		cmp	r1, r0
    17f6:	d10d		bne	0x1814
    17f8:	49d1		ldr	r1, =0x83ff1c	; via 0x1b40
    17fa:	7808		ldrb	r0, [r1, #0]
    17fc:	3001		add	r0, #1
    17fe:	7008		strb	r0, [r1, #0]
    1800:	48cf		ldr	r0, =0x83ff1c	; via 0x1b40
    1802:	7800		ldrb	r0, [r0, #0]
    1804:	2807		cmp	r0, #7
    1806:	d10d		bne	0x1824
    1808:	489c		ldr	r0, =0x83ff20	; via 0x1a7c
    180a:	2101		mov	r1, #1
    180c:	6001		str	r1, [r0, #0]
    180e:	489d		ldr	r0, =0x83ff18	; via 0x1a84
    1810:	7001		strb	r1, [r0, #0]
    1812:	e007		b	0x1824
    1814:	9801		ldr	r0, [sp, #4]
    1816:	2101		mov	r1, #1
    1818:	6001		str	r1, [r0, #0]
    181a:	4998		ldr	r1, =0x83ff20	; via 0x1a7c
    181c:	2001		mov	r0, #1
    181e:	6008		str	r0, [r1, #0]
    1820:	2000		mov	r0, #0
    1822:	9002		str	r0, [sp, #8]
    1824:	9802		ldr	r0, [sp, #8]
    1826:	b003		add	sp, #12	; 0xc
    1828:	46f7		mov	pc, lr
    182a:	b083		sub	sp, #12	; 0xc
    182c:	9101		str	r1, [sp, #4]
    182e:	4669		mov	r1, sp
    1830:	7008		strb	r0, [r1, #0]
    1832:	2001		mov	r0, #1
    1834:	9002		str	r0, [sp, #8]
    1836:	49c4		ldr	r1, =0x84c	; via 0x1b48
    1838:	48c1		ldr	r0, =0x83ff1c	; via 0x1b40
    183a:	7800		ldrb	r0, [r0, #0]
    183c:	0080		lsl	r0, r0, #2
    183e:	5808		ldr	r0, [r1, r0]
    1840:	4669		mov	r1, sp
    1842:	7809		ldrb	r1, [r1, #0]
    1844:	4281		cmp	r1, r0
    1846:	d112		bne	0x186e
    1848:	49bd		ldr	r1, =0x83ff1c	; via 0x1b40
    184a:	7808		ldrb	r0, [r1, #0]
    184c:	3001		add	r0, #1
    184e:	7008		strb	r0, [r1, #0]
    1850:	48bb		ldr	r0, =0x83ff1c	; via 0x1b40
    1852:	7800		ldrb	r0, [r0, #0]
    1854:	2806		cmp	r0, #6
    1856:	d114		bne	0x1882
    1858:	9801		ldr	r0, [sp, #4]
    185a:	2102		mov	r1, #2
    185c:	6001		str	r1, [r0, #0]
    185e:	4887		ldr	r0, =0x83ff20	; via 0x1a7c
    1860:	2101		mov	r1, #1
    1862:	6001		str	r1, [r0, #0]
    1864:	4887		ldr	r0, =0x83ff18	; via 0x1a84
    1866:	2100		mov	r1, #0
    1868:	7001		strb	r1, [r0, #0]
    186a:	2000		mov	r0, #0
    186c:	e008		b	0x1880
    186e:	9801		ldr	r0, [sp, #4]
    1870:	2101		mov	r1, #1
    1872:	6001		str	r1, [r0, #0]
    1874:	4981		ldr	r1, =0x83ff20	; via 0x1a7c
    1876:	2001		mov	r0, #1
    1878:	6008		str	r0, [r1, #0]
    187a:	4982		ldr	r1, =0x83ff18	; via 0x1a84
    187c:	2000		mov	r0, #0
    187e:	7008		strb	r0, [r1, #0]
    1880:	9002		str	r0, [sp, #8]
    1882:	9802		ldr	r0, [sp, #8]
    1884:	b003		add	sp, #12	; 0xc
    1886:	46f7		mov	pc, lr
    1888:	b081		sub	sp, #4
    188a:	4669		mov	r1, sp
    188c:	7008		strb	r0, [r1, #0]
    188e:	497a		ldr	r1, =0x83ff24	; via 0x1a78
    1890:	4668		mov	r0, sp
    1892:	7800		ldrb	r0, [r0, #0]
    1894:	3801		sub	r0, #1
    1896:	7008		strb	r0, [r1, #0]
    1898:	4874		ldr	r0, =0x83ff19	; via 0x1a6c
    189a:	4669		mov	r1, sp
    189c:	7809		ldrb	r1, [r1, #0]
    189e:	7001		strb	r1, [r0, #0]
    18a0:	48a7		ldr	r0, =0x83ff1c	; via 0x1b40
    18a2:	2100		mov	r1, #0
    18a4:	7001		strb	r1, [r0, #0]
    18a6:	48e3		ldr	r0, =0x83ff14	; via 0x1c34
    18a8:	6001		str	r1, [r0, #0]
    18aa:	4874		ldr	r0, =0x83ff20	; via 0x1a7c
    18ac:	2105		mov	r1, #5
    18ae:	6001		str	r1, [r0, #0]
    18b0:	b001		add	sp, #4
    18b2:	46f7		mov	pc, lr
    18b4:	b084		sub	sp, #16	; 0x10
    18b6:	9202		str	r2, [sp, #8]
    18b8:	9101		str	r1, [sp, #4]
    18ba:	4669		mov	r1, sp
    18bc:	7008		strb	r0, [r1, #0]
    18be:	2001		mov	r0, #1
    18c0:	9003		str	r0, [sp, #12]	; 0xc
    18c2:	496d		ldr	r1, =0x83ff24	; via 0x1a78
    18c4:	7808		ldrb	r0, [r1, #0]
    18c6:	3801		sub	r0, #1
    18c8:	7008		strb	r0, [r1, #0]
    18ca:	486b		ldr	r0, =0x83ff24	; via 0x1a78
    18cc:	7800		ldrb	r0, [r0, #0]
    18ce:	2800		cmp	r0, #0
    18d0:	d026		beq	0x1920
    18d2:	4866		ldr	r0, =0x83ff19	; via 0x1a6c
    18d4:	4669		mov	r1, sp
    18d6:	780a		ldrb	r2, [r1, #0]
    18d8:	7801		ldrb	r1, [r0, #0]
    18da:	1851		add	r1, r2, r1
    18dc:	7001		strb	r1, [r0, #0]
    18de:	4998		ldr	r1, =0x83ff1c	; via 0x1b40
    18e0:	7808		ldrb	r0, [r1, #0]
    18e2:	3001		add	r0, #1
    18e4:	7008		strb	r0, [r1, #0]
    18e6:	49d3		ldr	r1, =0x83ff14	; via 0x1c34
    18e8:	2204		mov	r2, #4
    18ea:	4895		ldr	r0, =0x83ff1c	; via 0x1b40
    18ec:	7800		ldrb	r0, [r0, #0]
    18ee:	1a10		sub	r0, r2, r0
    18f0:	00c2		lsl	r2, r0, #3
    18f2:	4668		mov	r0, sp
    18f4:	7800		ldrb	r0, [r0, #0]
    18f6:	4090		lsl	r0, r2
    18f8:	680a		ldr	r2, [r1, #0]
    18fa:	1880		add	r0, r0, r2
    18fc:	6008		str	r0, [r1, #0]
    18fe:	4890		ldr	r0, =0x83ff1c	; via 0x1b40
    1900:	7800		ldrb	r0, [r0, #0]
    1902:	2804		cmp	r0, #4
    1904:	d117		bne	0x1936
    1906:	9902		ldr	r1, [sp, #8]
    1908:	48ca		ldr	r0, =0x83ff14	; via 0x1c34
    190a:	6800		ldr	r0, [r0, #0]
    190c:	3802		sub	r0, #2
    190e:	6008		str	r0, [r1, #0]
    1910:	485a		ldr	r0, =0x83ff20	; via 0x1a7c
    1912:	2100		mov	r1, #0
    1914:	6001		str	r1, [r0, #0]
    1916:	4856		ldr	r0, =0x83ff1a	; via 0x1a70
    1918:	7001		strb	r1, [r0, #0]
    191a:	4889		ldr	r0, =0x83ff1c	; via 0x1b40
    191c:	7001		strb	r1, [r0, #0]
    191e:	e00a		b	0x1936
    1920:	9801		ldr	r0, [sp, #4]
    1922:	2101		mov	r1, #1
    1924:	6001		str	r1, [r0, #0]
    1926:	4955		ldr	r1, =0x83ff20	; via 0x1a7c
    1928:	2001		mov	r0, #1
    192a:	6008		str	r0, [r1, #0]
    192c:	4855		ldr	r0, =0x83ff18	; via 0x1a84
    192e:	2100		mov	r1, #0
    1930:	7001		strb	r1, [r0, #0]
    1932:	2000		mov	r0, #0
    1934:	9003		str	r0, [sp, #12]	; 0xc
    1936:	9803		ldr	r0, [sp, #12]	; 0xc
    1938:	b004		add	sp, #16	; 0x10
    193a:	46f7		mov	pc, lr
    193c:	b083		sub	sp, #12	; 0xc
    193e:	9101		str	r1, [sp, #4]
    1940:	4669		mov	r1, sp
    1942:	7008		strb	r0, [r1, #0]
    1944:	2001		mov	r0, #1
    1946:	9002		str	r0, [sp, #8]
    1948:	494c		ldr	r1, =0x83ff20	; via 0x1a7c
    194a:	6008		str	r0, [r1, #0]
    194c:	20ff		mov	r0, #255	; 0xff
    194e:	4669		mov	r1, sp
    1950:	7809		ldrb	r1, [r1, #0]
    1952:	4388		bic	r0, r1
    1954:	4945		ldr	r1, =0x83ff19	; via 0x1a6c
    1956:	7809		ldrb	r1, [r1, #0]
    1958:	4281		cmp	r1, r0
    195a:	d007		beq	0x196c
    195c:	9801		ldr	r0, [sp, #4]
    195e:	2101		mov	r1, #1
    1960:	6001		str	r1, [r0, #0]
    1962:	4848		ldr	r0, =0x83ff18	; via 0x1a84
    1964:	2100		mov	r1, #0
    1966:	7001		strb	r1, [r0, #0]
    1968:	2000		mov	r0, #0
    196a:	9002		str	r0, [sp, #8]
    196c:	9802		ldr	r0, [sp, #8]
    196e:	b003		add	sp, #12	; 0xc
    1970:	46f7		mov	pc, lr
    1972:	b085		sub	sp, #20	; 0x14
    1974:	466b		mov	r3, sp
    1976:	719a		strb	r2, [r3, #6]
    1978:	466a		mov	r2, sp
    197a:	8091		strh	r1, [r2, #4]
    197c:	9000		str	r0, [sp, #0]
    197e:	9800		ldr	r0, [sp, #0]
    1980:	9002		str	r0, [sp, #8]
    1982:	4669		mov	r1, sp
    1984:	4668		mov	r0, sp
    1986:	8880		ldrh	r0, [r0, #4]
    1988:	8208		strh	r0, [r1, #16]	; 0x10
    198a:	4668		mov	r0, sp
    198c:	8a00		ldrh	r0, [r0, #16]	; 0x10
    198e:	2800		cmp	r0, #0
    1990:	d01e		beq	0x19d0
    1992:	49e3		ldr	r1, =0x864	; via 0x1d20
    1994:	4668		mov	r0, sp
    1996:	7980		ldrb	r0, [r0, #6]
    1998:	0080		lsl	r0, r0, #2
    199a:	5808		ldr	r0, [r1, r0]
    199c:	7941		ldrb	r1, [r0, #5]
    199e:	4668		mov	r0, sp
    19a0:	7301		strb	r1, [r0, #12]	; 0xc
    19a2:	7b00		ldrb	r0, [r0, #12]	; 0xc
    19a4:	0980		lsr	r0, r0, #6
    19a6:	d3f4		bcc	0x1992
    19a8:	49dd		ldr	r1, =0x864	; via 0x1d20
    19aa:	4668		mov	r0, sp
    19ac:	7980		ldrb	r0, [r0, #6]
    19ae:	0080		lsl	r0, r0, #2
    19b0:	5809		ldr	r1, [r1, r0]
    19b2:	9802		ldr	r0, [sp, #8]
    19b4:	7800		ldrb	r0, [r0, #0]
    19b6:	7008		strb	r0, [r1, #0]
    19b8:	9802		ldr	r0, [sp, #8]
    19ba:	3001		add	r0, #1
    19bc:	9002		str	r0, [sp, #8]
    19be:	4669		mov	r1, sp
    19c0:	4668		mov	r0, sp
    19c2:	8a00		ldrh	r0, [r0, #16]	; 0x10
    19c4:	3801		sub	r0, #1
    19c6:	8208		strh	r0, [r1, #16]	; 0x10
    19c8:	4668		mov	r0, sp
    19ca:	8a00		ldrh	r0, [r0, #16]	; 0x10
    19cc:	2800		cmp	r0, #0
    19ce:	d1e0		bne	0x1992
    19d0:	b005		add	sp, #20	; 0x14
    19d2:	46f7		mov	pc, lr
    19d4:	b082		sub	sp, #8
    19d6:	4669		mov	r1, sp
    19d8:	7008		strb	r0, [r1, #0]
    19da:	2000		mov	r0, #0
    19dc:	8088		strh	r0, [r1, #4]
    19de:	4668		mov	r0, sp
    19e0:	8881		ldrh	r1, [r0, #4]
    19e2:	20ff		mov	r0, #255	; 0xff
    19e4:	30f5		add	r0, #245	; 0xf5
    19e6:	4281		cmp	r1, r0
    19e8:	da21		bge	0x1a2e
    19ea:	4669		mov	r1, sp
    19ec:	4668		mov	r0, sp
    19ee:	8880		ldrh	r0, [r0, #4]
    19f0:	3001		add	r0, #1
    19f2:	8088		strh	r0, [r1, #4]
    19f4:	48ca		ldr	r0, =0x864	; via 0x1d20
    19f6:	7809		ldrb	r1, [r1, #0]
    19f8:	0089		lsl	r1, r1, #2
    19fa:	5840		ldr	r0, [r0, r1]
    19fc:	7940		ldrb	r0, [r0, #5]
    19fe:	4669		mov	r1, sp
    1a00:	7048		strb	r0, [r1, #1]
    1a02:	4668		mov	r0, sp
    1a04:	7840		ldrb	r0, [r0, #1]
    1a06:	0840		lsr	r0, r0, #1
    1a08:	d30b		bcc	0x1a22
    1a0a:	49c5		ldr	r1, =0x864	; via 0x1d20
    1a0c:	4668		mov	r0, sp
    1a0e:	7800		ldrb	r0, [r0, #0]
    1a10:	0080		lsl	r0, r0, #2
    1a12:	5808		ldr	r0, [r1, r0]
    1a14:	7800		ldrb	r0, [r0, #0]
    1a16:	0600		lsl	r0, r0, #24
    1a18:	0e00		lsr	r0, r0, #24
    1a1a:	4669		mov	r1, sp
    1a1c:	7088		strb	r0, [r1, #2]
    1a1e:	2000		mov	r0, #0
    1a20:	8088		strh	r0, [r1, #4]
    1a22:	4668		mov	r0, sp
    1a24:	8881		ldrh	r1, [r0, #4]
    1a26:	20ff		mov	r0, #255	; 0xff
    1a28:	30f5		add	r0, #245	; 0xf5
    1a2a:	4281		cmp	r1, r0
    1a2c:	dbdd		blt	0x19ea
    1a2e:	b002		add	sp, #8
    1a30:	4770		bx	lr
    1a32:	b500		push	{lr}
    1a34:	b08c		sub	sp, #48	; 0x30
    1a36:	466a		mov	r2, sp
    1a38:	7111		strb	r1, [r2, #4]
    1a3a:	9000		str	r0, [sp, #0]
    1a3c:	2001		mov	r0, #1
    1a3e:	9002		str	r0, [sp, #8]
    1a40:	9800		ldr	r0, [sp, #0]
    1a42:	a904		add	r1, sp, #16	; 0x10
    1a44:	aa03		add	r2, sp, #12	; 0xc
    1a46:	f7ff fd75	bl	0x1534
    1a4a:	4668		mov	r0, sp
    1a4c:	8980		ldrh	r0, [r0, #12]	; 0xc
    1a4e:	2820		cmp	r0, #32	; 0x20
    1a50:	dd02		ble	0x1a58
    1a52:	2000		mov	r0, #0
    1a54:	9002		str	r0, [sp, #8]
    1a56:	e006		b	0x1a66
    1a58:	a804		add	r0, sp, #16	; 0x10
    1a5a:	4669		mov	r1, sp
    1a5c:	8989		ldrh	r1, [r1, #12]	; 0xc
    1a5e:	466a		mov	r2, sp
    1a60:	7912		ldrb	r2, [r2, #4]
    1a62:	f7ff ff86	bl	0x1972
    1a66:	9802		ldr	r0, [sp, #8]
    1a68:	b00c		add	sp, #48	; 0x30
    1a6a:	bd00		pop	{pc}
    1a6c:	ff19		<half-bl>
    1a6e:	0083		lsl	r3, r0, #2
    1a70:	ff1a		<half-bl>
    1a72:	0083		lsl	r3, r0, #2
    1a74:	ff26		<half-bl>
    1a76:	0083		lsl	r3, r0, #2
    1a78:	ff24		<half-bl>
    1a7a:	0083		lsl	r3, r0, #2
    1a7c:	ff20		<half-bl>
    1a7e:	0083		lsl	r3, r0, #2
    1a80:	ff1b		<half-bl>
    1a82:	0083		lsl	r3, r0, #2
    1a84:	ff18		<half-bl>
    1a86:	0083		lsl	r3, r0, #2
    1a88:	b500		push	{lr}
    1a8a:	b084		sub	sp, #16	; 0x10
    1a8c:	9101		str	r1, [sp, #4]
    1a8e:	9000		str	r0, [sp, #0]
    1a90:	4669		mov	r1, sp
    1a92:	20ff		mov	r0, #255	; 0xff
    1a94:	7308		strb	r0, [r1, #12]	; 0xc
    1a96:	2000		mov	r0, #0
    1a98:	9002		str	r0, [sp, #8]
    1a9a:	4669		mov	r1, sp
    1a9c:	48a1		ldr	r0, =0xffff5805	; via 0x1d24
    1a9e:	7800		ldrb	r0, [r0, #0]
    1aa0:	7348		strb	r0, [r1, #13]	; 0xd
    1aa2:	48a1		ldr	r0, =0xffff5005	; via 0x1d28
    1aa4:	7800		ldrb	r0, [r0, #0]
    1aa6:	7388		strb	r0, [r1, #14]	; 0xe
    1aa8:	4668		mov	r0, sp
    1aaa:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1aac:	0840		lsr	r0, r0, #1
    1aae:	d206		bcs	0x1abe
    1ab0:	4668		mov	r0, sp
    1ab2:	7b80		ldrb	r0, [r0, #14]	; 0xe
    1ab4:	0840		lsr	r0, r0, #1
    1ab6:	d202		bcs	0x1abe
    1ab8:	9801		ldr	r0, [sp, #4]
    1aba:	2800		cmp	r0, #0
    1abc:	d0ed		beq	0x1a9a
    1abe:	4668		mov	r0, sp
    1ac0:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1ac2:	0840		lsr	r0, r0, #1
    1ac4:	d316		bcc	0x1af4
    1ac6:	4669		mov	r1, sp
    1ac8:	2000		mov	r0, #0
    1aca:	7308		strb	r0, [r1, #12]	; 0xc
    1acc:	4994		ldr	r1, =0x864	; via 0x1d20
    1ace:	4668		mov	r0, sp
    1ad0:	7b00		ldrb	r0, [r0, #12]	; 0xc
    1ad2:	0080		lsl	r0, r0, #2
    1ad4:	5808		ldr	r0, [r1, r0]
    1ad6:	7800		ldrb	r0, [r0, #0]
    1ad8:	0600		lsl	r0, r0, #24
    1ada:	0e00		lsr	r0, r0, #24
    1adc:	4669		mov	r1, sp
    1ade:	73c8		strb	r0, [r1, #15]	; 0xf
    1ae0:	4668		mov	r0, sp
    1ae2:	7bc0		ldrb	r0, [r0, #15]	; 0xf
    1ae4:	9900		ldr	r1, [sp, #0]
    1ae6:	f7ff fc9f	bl	0x1428
    1aea:	9002		str	r0, [sp, #8]
    1aec:	9802		ldr	r0, [sp, #8]
    1aee:	2800		cmp	r0, #0
    1af0:	d11c		bne	0x1b2c
    1af2:	e018		b	0x1b26
    1af4:	4668		mov	r0, sp
    1af6:	7b80		ldrb	r0, [r0, #14]	; 0xe
    1af8:	0840		lsr	r0, r0, #1
    1afa:	d317		bcc	0x1b2c
    1afc:	4669		mov	r1, sp
    1afe:	2001		mov	r0, #1
    1b00:	7308		strb	r0, [r1, #12]	; 0xc
    1b02:	4987		ldr	r1, =0x864	; via 0x1d20
    1b04:	4668		mov	r0, sp
    1b06:	7b00		ldrb	r0, [r0, #12]	; 0xc
    1b08:	0080		lsl	r0, r0, #2
    1b0a:	5808		ldr	r0, [r1, r0]
    1b0c:	7800		ldrb	r0, [r0, #0]
    1b0e:	0600		lsl	r0, r0, #24
    1b10:	0e01		lsr	r1, r0, #24
    1b12:	4668		mov	r0, sp
    1b14:	73c1		strb	r1, [r0, #15]	; 0xf
    1b16:	7bc0		ldrb	r0, [r0, #15]	; 0xf
    1b18:	9900		ldr	r1, [sp, #0]
    1b1a:	f7ff fc85	bl	0x1428
    1b1e:	9002		str	r0, [sp, #8]
    1b20:	9802		ldr	r0, [sp, #8]
    1b22:	2800		cmp	r0, #0
    1b24:	d102		bne	0x1b2c
    1b26:	20ff		mov	r0, #255	; 0xff
    1b28:	4669		mov	r1, sp
    1b2a:	7308		strb	r0, [r1, #12]	; 0xc
    1b2c:	9802		ldr	r0, [sp, #8]
    1b2e:	2800		cmp	r0, #0
    1b30:	d102		bne	0x1b38
    1b32:	9801		ldr	r0, [sp, #4]
    1b34:	2800		cmp	r0, #0
    1b36:	d0b0		beq	0x1a9a
    1b38:	4668		mov	r0, sp
    1b3a:	7b00		ldrb	r0, [r0, #12]	; 0xc
    1b3c:	b004		add	sp, #16	; 0x10
    1b3e:	bd00		pop	{pc}
    1b40:	ff1c		<half-bl>
    1b42:	0083		lsl	r3, r0, #2
    1b44:	0830		lsr	r0, r6, #32
    1b46:	0000		lsl	r0, r0, #0
    1b48:	084c		lsr	r4, r1, #1
    1b4a:	0000		lsl	r0, r0, #0
    1b4c:	b500		push	{lr}
    1b4e:	b086		sub	sp, #24	; 0x18
    1b50:	466b		mov	r3, sp
    1b52:	721a		strb	r2, [r3, #8]
    1b54:	9101		str	r1, [sp, #4]
    1b56:	9000		str	r0, [sp, #0]
    1b58:	2001		mov	r0, #1
    1b5a:	9004		str	r0, [sp, #16]	; 0x10
    1b5c:	9804		ldr	r0, [sp, #16]	; 0x10
    1b5e:	2800		cmp	r0, #0
    1b60:	d05b		beq	0x1c1a
    1b62:	496f		ldr	r1, =0x864	; via 0x1d20
    1b64:	4668		mov	r0, sp
    1b66:	7a00		ldrb	r0, [r0, #8]
    1b68:	0080		lsl	r0, r0, #2
    1b6a:	5808		ldr	r0, [r1, r0]
    1b6c:	7941		ldrb	r1, [r0, #5]
    1b6e:	4668		mov	r0, sp
    1b70:	7301		strb	r1, [r0, #12]	; 0xc
    1b72:	7b00		ldrb	r0, [r0, #12]	; 0xc
    1b74:	0840		lsr	r0, r0, #1
    1b76:	d3f4		bcc	0x1b62
    1b78:	4969		ldr	r1, =0x864	; via 0x1d20
    1b7a:	4668		mov	r0, sp
    1b7c:	7a00		ldrb	r0, [r0, #8]
    1b7e:	0080		lsl	r0, r0, #2
    1b80:	5808		ldr	r0, [r1, r0]
    1b82:	7800		ldrb	r0, [r0, #0]
    1b84:	0600		lsl	r0, r0, #24
    1b86:	0e01		lsr	r1, r0, #24
    1b88:	4668		mov	r0, sp
    1b8a:	7341		strb	r1, [r0, #13]	; 0xd
    1b8c:	e02c		b	0x1be8
    1b8e:	4668		mov	r0, sp
    1b90:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1b92:	a905		add	r1, sp, #20	; 0x14
    1b94:	9a00		ldr	r2, [sp, #0]
    1b96:	9b01		ldr	r3, [sp, #4]
    1b98:	f7ff fd8c	bl	0x16b4
    1b9c:	9004		str	r0, [sp, #16]	; 0x10
    1b9e:	e039		b	0x1c14
    1ba0:	4668		mov	r0, sp
    1ba2:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1ba4:	a905		add	r1, sp, #20	; 0x14
    1ba6:	f7ff fdc2	bl	0x172e
    1baa:	e7f7		b	0x1b9c
    1bac:	4668		mov	r0, sp
    1bae:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1bb0:	a905		add	r1, sp, #20	; 0x14
    1bb2:	f7ff fe12	bl	0x17da
    1bb6:	e7f1		b	0x1b9c
    1bb8:	4668		mov	r0, sp
    1bba:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1bbc:	a905		add	r1, sp, #20	; 0x14
    1bbe:	f7ff fe34	bl	0x182a
    1bc2:	e7eb		b	0x1b9c
    1bc4:	4668		mov	r0, sp
    1bc6:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1bc8:	f7ff fe5e	bl	0x1888
    1bcc:	e022		b	0x1c14
    1bce:	4668		mov	r0, sp
    1bd0:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1bd2:	a905		add	r1, sp, #20	; 0x14
    1bd4:	9a00		ldr	r2, [sp, #0]
    1bd6:	f7ff fe6d	bl	0x18b4
    1bda:	e7df		b	0x1b9c
    1bdc:	4668		mov	r0, sp
    1bde:	7b40		ldrb	r0, [r0, #13]	; 0xd
    1be0:	a905		add	r1, sp, #20	; 0x14
    1be2:	f7ff feab	bl	0x193c
    1be6:	e7d9		b	0x1b9c
    1be8:	4850		ldr	r0, =0x83ff20	; via 0x1d2c
    1bea:	6800		ldr	r0, [r0, #0]
    1bec:	2800		cmp	r0, #0
    1bee:	d0ce		beq	0x1b8e
    1bf0:	3801		sub	r0, #1
    1bf2:	2800		cmp	r0, #0
    1bf4:	d0d4		beq	0x1ba0
    1bf6:	3801		sub	r0, #1
    1bf8:	2800		cmp	r0, #0
    1bfa:	d0d7		beq	0x1bac
    1bfc:	3801		sub	r0, #1
    1bfe:	2800		cmp	r0, #0
    1c00:	d0da		beq	0x1bb8
    1c02:	3801		sub	r0, #1
    1c04:	2800		cmp	r0, #0
    1c06:	d0dd		beq	0x1bc4
    1c08:	3801		sub	r0, #1
    1c0a:	2800		cmp	r0, #0
    1c0c:	d0df		beq	0x1bce
    1c0e:	3801		sub	r0, #1
    1c10:	2800		cmp	r0, #0
    1c12:	d0e3		beq	0x1bdc
    1c14:	9804		ldr	r0, [sp, #16]	; 0x10
    1c16:	2800		cmp	r0, #0
    1c18:	d1a3		bne	0x1b62
    1c1a:	9805		ldr	r0, [sp, #20]	; 0x14
    1c1c:	b006		add	sp, #24	; 0x18
    1c1e:	bd00		pop	{pc}
    1c20:	4942		ldr	r1, =0x83ff20	; via 0x1d2c
    1c22:	2001		mov	r0, #1
    1c24:	6008		str	r0, [r1, #0]
    1c26:	4842		ldr	r0, =0x83ff1b	; via 0x1d30
    1c28:	2100		mov	r1, #0
    1c2a:	7001		strb	r1, [r0, #0]
    1c2c:	4841		ldr	r0, =0x83ff18	; via 0x1d34
    1c2e:	7001		strb	r1, [r0, #0]
    1c30:	4770		bx	lr
    1c32:	46c0		nop			(mov r8, r8)

    1c34:	0083ff14

; UART initialization routine
    1c38:	b081		sub	sp, #4
; MODEM UART
    1c3a:	483f		ldr	r0, =0xffff5800	; via 0x1d38
    1c3c:	9000		str	r0, [sp, #0]
; switch to MCU control
    1c3e:	493f		ldr	r1, =0xffff6000	; via 0x1d3c
    1c40:	2002		mov	r0, #2
    1c42:	880a		ldrh	r2, [r1, #0]
    1c44:	4310		orr	r0, r2
    1c46:	8008		strh	r0, [r1, #0]
    1c48:	483c		ldr	r0, =0xffff6000	; via 0x1d3c
    1c4a:	8801		ldrh	r1, [r0, #0]
    1c4c:	0849		lsr	r1, r1, #1
    1c4e:	0049		lsl	r1, r1, #1
    1c50:	8001		strh	r1, [r0, #0]
    1c52:	493a		ldr	r1, =0xffff6000	; via 0x1d3c
    1c54:	8808		ldrh	r0, [r1, #0]
    1c56:	2202		mov	r2, #2
    1c58:	4390		bic	r0, r2
    1c5a:	8008		strh	r0, [r1, #0]
; MDR1 = reset/default state
    1c5c:	9900		ldr	r1, [sp, #0]
    1c5e:	2007		mov	r0, #7
    1c60:	7208		strb	r0, [r1, #8]
; LCR = BF
    1c62:	9900		ldr	r1, [sp, #0]
    1c64:	20bf		mov	r0, #191	; 0xbf
    1c66:	70c8		strb	r0, [r1, #3]
; set ENHANCED_EN bit in EFR
    1c68:	9800		ldr	r0, [sp, #0]
    1c6a:	1c81		add	r1, r0, #2
    1c6c:	2010		mov	r0, #16	; 0x10
    1c6e:	880a		ldrh	r2, [r1, #0]
    1c70:	4310		orr	r0, r2
    1c72:	8008		strh	r0, [r1, #0]
; LCR = 80
    1c74:	9800		ldr	r0, [sp, #0]
    1c76:	2180		mov	r1, #128	; 0x80
    1c78:	70c1		strb	r1, [r0, #3]
; FCR = 07 (enable and clear both FIFOs)
    1c7a:	9800		ldr	r0, [sp, #0]
    1c7c:	2107		mov	r1, #7
    1c7e:	7081		strb	r1, [r0, #2]
; LCR = BF
    1c80:	9800		ldr	r0, [sp, #0]
    1c82:	21bf		mov	r1, #191	; 0xbf
    1c84:	70c1		strb	r1, [r0, #3]
; baud rate divisor set to 7 (115200 baud)
    1c86:	9800		ldr	r0, [sp, #0]
    1c88:	2107		mov	r1, #7
    1c8a:	7001		strb	r1, [r0, #0]
    1c8c:	9800		ldr	r0, [sp, #0]
    1c8e:	2100		mov	r1, #0
    1c90:	7041		strb	r1, [r0, #1]
; LCR = 03 (standard setting)
    1c92:	9800		ldr	r0, [sp, #0]
    1c94:	2103		mov	r1, #3
    1c96:	70c1		strb	r1, [r0, #3]
; MDR1 = UART mode
    1c98:	9800		ldr	r0, [sp, #0]
    1c9a:	2100		mov	r1, #0
    1c9c:	7201		strb	r1, [r0, #8]
; IrDA UART - same setup as for MODEM
    1c9e:	4828		ldr	r0, =0xffff5000	; via 0x1d40
    1ca0:	9000		str	r0, [sp, #0]
    1ca2:	9800		ldr	r0, [sp, #0]
    1ca4:	2107		mov	r1, #7
    1ca6:	7201		strb	r1, [r0, #8]
    1ca8:	9900		ldr	r1, [sp, #0]
    1caa:	20bf		mov	r0, #191	; 0xbf
    1cac:	70c8		strb	r0, [r1, #3]
    1cae:	9800		ldr	r0, [sp, #0]
    1cb0:	1c80		add	r0, r0, #2
    1cb2:	2110		mov	r1, #16	; 0x10
    1cb4:	8802		ldrh	r2, [r0, #0]
    1cb6:	4311		orr	r1, r2
    1cb8:	8001		strh	r1, [r0, #0]
    1cba:	9800		ldr	r0, [sp, #0]
    1cbc:	2180		mov	r1, #128	; 0x80
    1cbe:	70c1		strb	r1, [r0, #3]
    1cc0:	9800		ldr	r0, [sp, #0]
    1cc2:	2107		mov	r1, #7
    1cc4:	7081		strb	r1, [r0, #2]
    1cc6:	9800		ldr	r0, [sp, #0]
    1cc8:	21bf		mov	r1, #191	; 0xbf
    1cca:	70c1		strb	r1, [r0, #3]
    1ccc:	9800		ldr	r0, [sp, #0]
    1cce:	2107		mov	r1, #7
    1cd0:	7001		strb	r1, [r0, #0]
    1cd2:	9800		ldr	r0, [sp, #0]
    1cd4:	2100		mov	r1, #0
    1cd6:	7041		strb	r1, [r0, #1]
    1cd8:	9900		ldr	r1, [sp, #0]
    1cda:	2003		mov	r0, #3
    1cdc:	70c8		strb	r0, [r1, #3]
    1cde:	9800		ldr	r0, [sp, #0]
    1ce0:	2100		mov	r1, #0
    1ce2:	7201		strb	r1, [r0, #8]
    1ce4:	b001		add	sp, #4
    1ce6:	4770		bx	lr

    1ce8:	b081		sub	sp, #4
    1cea:	4669		mov	r1, sp
    1cec:	7008		strb	r0, [r1, #0]
    1cee:	490c		ldr	r1, =0x864	; via 0x1d20
    1cf0:	4668		mov	r0, sp
    1cf2:	7800		ldrb	r0, [r0, #0]
    1cf4:	0080		lsl	r0, r0, #2
    1cf6:	5808		ldr	r0, [r1, r0]
    1cf8:	7941		ldrb	r1, [r0, #5]
    1cfa:	4668		mov	r0, sp
    1cfc:	7041		strb	r1, [r0, #1]
    1cfe:	7840		ldrb	r0, [r0, #1]
    1d00:	09c0		lsr	r0, r0, #7
    1d02:	d20b		bcs	0x1d1c
    1d04:	4806		ldr	r0, =0x864	; via 0x1d20
    1d06:	4669		mov	r1, sp
    1d08:	7809		ldrb	r1, [r1, #0]
    1d0a:	0089		lsl	r1, r1, #2
    1d0c:	5840		ldr	r0, [r0, r1]
    1d0e:	7940		ldrb	r0, [r0, #5]
    1d10:	4669		mov	r1, sp
    1d12:	7048		strb	r0, [r1, #1]
    1d14:	4668		mov	r0, sp
    1d16:	7840		ldrb	r0, [r0, #1]
    1d18:	09c0		lsr	r0, r0, #7
    1d1a:	d3f3		bcc	0x1d04
    1d1c:	b001		add	sp, #4
    1d1e:	4770		bx	lr
    1d20:	0864		lsr	r4, r4, #1
    1d22:	0000		lsl	r0, r0, #0
    1d24:	5805		ldr	r5, [r0, r0]
    1d26:	ffff		<half-bl>
    1d28:	5005		str	r5, [r0, r0]
    1d2a:	ffff		<half-bl>
    1d2c:	ff20		<half-bl>
    1d2e:	0083		lsl	r3, r0, #2
    1d30:	ff1b		<half-bl>
    1d32:	0083		lsl	r3, r0, #2
    1d34:	ff18		<half-bl>
    1d36:	0083		lsl	r3, r0, #2
    1d38:	5800		ldr	r0, [r0, r0]
    1d3a:	ffff		<half-bl>
    1d3c:	6000		str	r0, [r0, #0]
    1d3e:	ffff		<half-bl>
    1d40:	5000		str	r0, [r0, r0]
    1d42:	ffff		<half-bl>
    1d44:	b500		push	{lr}
    1d46:	b087		sub	sp, #28	; 0x1c
    1d48:	466b		mov	r3, sp
    1d4a:	721a		strb	r2, [r3, #8]
    1d4c:	9101		str	r1, [sp, #4]
    1d4e:	9000		str	r0, [sp, #0]
    1d50:	9900		ldr	r1, [sp, #0]
    1d52:	2000		mov	r0, #0
    1d54:	8008		strh	r0, [r1, #0]
    1d56:	9801		ldr	r0, [sp, #4]
    1d58:	2100		mov	r1, #0
    1d5a:	8001		strh	r1, [r0, #0]
    1d5c:	2000		mov	r0, #0
    1d5e:	9003		str	r0, [sp, #12]	; 0xc
    1d60:	f7ff ff5e	bl	0x1c20
    1d64:	a805		add	r0, sp, #20	; 0x14
    1d66:	a906		add	r1, sp, #24	; 0x18
    1d68:	466a		mov	r2, sp
    1d6a:	7a12		ldrb	r2, [r2, #8]
    1d6c:	f7ff feee	bl	0x1b4c
    1d70:	9004		str	r0, [sp, #16]	; 0x10
    1d72:	9804		ldr	r0, [sp, #16]	; 0x10
    1d74:	2800		cmp	r0, #0
    1d76:	d11f		bne	0x1db8
    1d78:	9803		ldr	r0, [sp, #12]	; 0xc
    1d7a:	2800		cmp	r0, #0
    1d7c:	d11c		bne	0x1db8
    1d7e:	9800		ldr	r0, [sp, #0]
    1d80:	4669		mov	r1, sp
    1d82:	8b0a		ldrh	r2, [r1, #24]	; 0x18
    1d84:	8801		ldrh	r1, [r0, #0]
    1d86:	1851		add	r1, r2, r1
    1d88:	8001		strh	r1, [r0, #0]
    1d8a:	9905		ldr	r1, [sp, #20]	; 0x14
    1d8c:	4668		mov	r0, sp
    1d8e:	8b00		ldrh	r0, [r0, #24]	; 0x18
    1d90:	8008		strh	r0, [r1, #0]
    1d92:	9801		ldr	r0, [sp, #4]
    1d94:	9905		ldr	r1, [sp, #20]	; 0x14
    1d96:	8809		ldrh	r1, [r1, #0]
    1d98:	8802		ldrh	r2, [r0, #0]
    1d9a:	1889		add	r1, r1, r2
    1d9c:	8001		strh	r1, [r0, #0]
    1d9e:	a805		add	r0, sp, #20	; 0x14
    1da0:	a906		add	r1, sp, #24	; 0x18
    1da2:	466a		mov	r2, sp
    1da4:	7a12		ldrb	r2, [r2, #8]
    1da6:	f7ff fed1	bl	0x1b4c
    1daa:	9004		str	r0, [sp, #16]	; 0x10
    1dac:	9804		ldr	r0, [sp, #16]	; 0x10
    1dae:	2800		cmp	r0, #0
    1db0:	d102		bne	0x1db8
    1db2:	9803		ldr	r0, [sp, #12]	; 0xc
    1db4:	2800		cmp	r0, #0
    1db6:	d0e2		beq	0x1d7e
    1db8:	9804		ldr	r0, [sp, #16]	; 0x10
    1dba:	2801		cmp	r0, #1
    1dbc:	d101		bne	0x1dc2
    1dbe:	2004		mov	r0, #4
    1dc0:	9003		str	r0, [sp, #12]	; 0xc
    1dc2:	9803		ldr	r0, [sp, #12]	; 0xc
    1dc4:	b007		add	sp, #28	; 0x1c
    1dc6:	bd00		pop	{pc}
    1dc8:	b089		sub	sp, #36	; 0x24
    1dca:	201a		mov	r0, #26	; 0x1a
    1dcc:	9005		str	r0, [sp, #20]	; 0x14
    1dce:	2018		mov	r0, #24	; 0x18
    1dd0:	9006		str	r0, [sp, #24]	; 0x18
    1dd2:	2000		mov	r0, #0
    1dd4:	9008		str	r0, [sp, #32]	; 0x20
    1dd6:	4669		mov	r1, sp
    1dd8:	9805		ldr	r0, [sp, #20]	; 0x14
    1dda:	8800		ldrh	r0, [r0, #0]
    1ddc:	8008		strh	r0, [r1, #0]
    1dde:	9806		ldr	r0, [sp, #24]	; 0x18
    1de0:	8800		ldrh	r0, [r0, #0]
    1de2:	8048		strh	r0, [r1, #2]
    1de4:	4668		mov	r0, sp
    1de6:	8841		ldrh	r1, [r0, #2]
    1de8:	8800		ldrh	r0, [r0, #0]
    1dea:	0400		lsl	r0, r0, #16
    1dec:	1808		add	r0, r1, r0
    1dee:	9001		str	r0, [sp, #4]
    1df0:	9801		ldr	r0, [sp, #4]
    1df2:	0200		lsl	r0, r0, #8
    1df4:	0a00		lsr	r0, r0, #8
    1df6:	0080		lsl	r0, r0, #2
    1df8:	3008		add	r0, #8
    1dfa:	9007		str	r0, [sp, #28]	; 0x1c
    1dfc:	9807		ldr	r0, [sp, #28]	; 0x1c
    1dfe:	3018		add	r0, #24	; 0x18
    1e00:	9002		str	r0, [sp, #8]
    1e02:	9802		ldr	r0, [sp, #8]
    1e04:	9004		str	r0, [sp, #16]	; 0x10
    1e06:	9802		ldr	r0, [sp, #8]
    1e08:	3002		add	r0, #2
    1e0a:	9003		str	r0, [sp, #12]	; 0xc
    1e0c:	9803		ldr	r0, [sp, #12]	; 0xc
    1e0e:	8801		ldrh	r1, [r0, #0]
    1e10:	4806		ldr	r0, =0xffff	; via 0x1e2c
    1e12:	4281		cmp	r1, r0
    1e14:	d104		bne	0x1e20
    1e16:	9804		ldr	r0, [sp, #16]	; 0x10
    1e18:	8800		ldrh	r0, [r0, #0]
    1e1a:	4904		ldr	r1, =0xffff	; via 0x1e2c
    1e1c:	4288		cmp	r0, r1
    1e1e:	d001		beq	0x1e24
    1e20:	2001		mov	r0, #1
    1e22:	9008		str	r0, [sp, #32]	; 0x20
    1e24:	9808		ldr	r0, [sp, #32]	; 0x20
    1e26:	b009		add	sp, #36	; 0x24
    1e28:	4770		bx	lr
    1e2a:	46c0		nop			(mov r8, r8)

    1e2c:	0000ffff

; ARM->Thumb call veneer around 0xad2 routine
    1e30:	e92d4000 	stmdb	sp!, {lr}
    1e34:	e28fe001 	add	lr, pc, #1	; 0x1
    1e38:	e12fff1e 	bx	lr
    1e3c:	f7fe fe49	bl	0xad2
    1e40:	4778      	bx	pc
    1e42:	46c0      	nop			(mov r8, r8)
    1e44:	e8bd8000 	ldmia	sp!, {pc}

<1E48-1EFF: all FFs>

    1f00:	00000001

<1F04-end: all FFs>