	.include "asm/macros.inc"
	.include "global.inc"

	.section .rodata

	.global UNK_020F2DB4
UNK_020F2DB4: ; 0x020F2DB4
	.byte 0x6F, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC9, 0x00, 0x11, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA0, 0x00
	.byte 0x16, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA1, 0x00, 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x57, 0x00
	.byte 0x29, 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD9, 0x00
	.byte 0x34, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x00, 0x12, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA7, 0x00
	.byte 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x96, 0x00, 0x37, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x00
	.byte 0x33, 0x00, 0x01, 0x01, 0x00, 0x00, 0xE4, 0x00, 0x04, 0x00, 0x01, 0x01, 0x00, 0x00, 0x03, 0x00
	.byte 0x28, 0x00, 0x01, 0x02, 0x00, 0x00, 0x04, 0x00, 0x11, 0x00, 0x01, 0x02, 0x00, 0x00, 0x05, 0x00
	.byte 0x1A, 0x00, 0x01, 0x02, 0x00, 0x00, 0x08, 0x00, 0x5C, 0x00, 0x01, 0x02, 0x00, 0x00, 0x06, 0x00
	.byte 0x13, 0x00, 0x01, 0x02, 0x00, 0x00, 0x09, 0x00, 0x11, 0x00, 0x01, 0x02, 0x00, 0x00, 0xA2, 0x00
	.byte 0x11, 0x00, 0x01, 0x02, 0x00, 0x00, 0xD0, 0x00, 0x56, 0x00, 0x01, 0x02, 0x00, 0x00, 0xD1, 0x00
	.byte 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0A, 0x00, 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0B, 0x00
	.byte 0x04, 0x00, 0x01, 0x02, 0x00, 0x00, 0x5B, 0x00, 0x32, 0x00, 0x01, 0x02, 0x00, 0x00, 0x0C, 0x00
	.byte 0x1C, 0x00, 0x01, 0x02, 0x00, 0x00, 0x97, 0x00, 0x26, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0D, 0x00
	.byte 0x2F, 0x00, 0x01, 0x01, 0x00, 0x00, 0x0E, 0x00, 0x5E, 0x00, 0x01, 0x02, 0x00, 0x00, 0x0F, 0x00
	.byte 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x10, 0x00, 0x1A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x11, 0x00
	.byte 0x03, 0x00, 0x01, 0x01, 0x00, 0x00, 0x12, 0x00, 0x13, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA3, 0x00
	.byte 0x2E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x13, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x14, 0x00
	.byte 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x15, 0x00, 0x26, 0x00, 0x01, 0x01, 0x00, 0x00, 0x16, 0x00
	.byte 0x5D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x17, 0x00, 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0x18, 0x00
	.byte 0x03, 0x00, 0x01, 0x01, 0x00, 0x00, 0x19, 0x00, 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x1A, 0x00
	.byte 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0x1B, 0x00, 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD2, 0x00
	.byte 0x30, 0x01, 0x01, 0x01, 0x00, 0x00, 0xD3, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD4, 0x00
	.byte 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD5, 0x00, 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD6, 0x00
	.byte 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xD7, 0x00, 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0x1C, 0x00
	.byte 0x59, 0x00, 0x01, 0x01, 0x00, 0x00, 0x1D, 0x00, 0x1D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x1E, 0x00
	.byte 0x15, 0x00, 0x01, 0x01, 0x00, 0x00, 0x98, 0x00, 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA4, 0x00
	.byte 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA5, 0x00, 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA6, 0x00
	.byte 0x03, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB8, 0x00, 0x31, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB9, 0x00
	.byte 0x1A, 0x00, 0x01, 0x01, 0x00, 0x00, 0xBA, 0x00, 0xC3, 0x01, 0x01, 0x00, 0x00, 0x00, 0xD8, 0x00
	.byte 0x1D, 0x00, 0x01, 0x01, 0x00, 0x00, 0xAE, 0x00, 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x1F, 0x00
	.byte 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0x07, 0x00, 0x27, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB4, 0x00
	.byte 0x15, 0x00, 0x01, 0x01, 0x00, 0x00, 0x20, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x21, 0x00
	.byte 0x1A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x23, 0x00, 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x99, 0x00
	.byte 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0xBB, 0x00, 0x03, 0x00, 0x01, 0x01, 0x00, 0x00, 0xBC, 0x00
	.byte 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x22, 0x00, 0x4F, 0x00, 0x01, 0x01, 0x00, 0x00, 0x24, 0x00
	.byte 0x4E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x25, 0x00, 0x57, 0x00, 0x01, 0x01, 0x00, 0x00, 0x26, 0x00
	.byte 0x26, 0x00, 0x01, 0x01, 0x00, 0x00, 0x27, 0x00, 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0x95, 0x00
	.byte 0x03, 0x00, 0x01, 0x01, 0x00, 0x00, 0x9A, 0x00, 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xBD, 0x00
	.byte 0x13, 0x00, 0x01, 0x01, 0x00, 0x00, 0xCA, 0x00, 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB5, 0x00
	.byte 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB6, 0x00, 0x34, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB7, 0x00
	.byte 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x28, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x29, 0x00
	.byte 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x2A, 0x00, 0x5D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x2B, 0x00
	.byte 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA8, 0x00, 0x2D, 0x01, 0x01, 0x01, 0x00, 0x00, 0x2C, 0x00
	.byte 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x2D, 0x00, 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0x2E, 0x00
	.byte 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0x2F, 0x00, 0x18, 0x00, 0x01, 0x01, 0x00, 0x00, 0x9B, 0x00
	.byte 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x9C, 0x00, 0x1A, 0x00, 0x01, 0x01, 0x00, 0x00, 0xA9, 0x00
	.byte 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0x30, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x31, 0x00
	.byte 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x32, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0xBE, 0x00
	.byte 0x30, 0x00, 0x01, 0x01, 0x00, 0x00, 0xBF, 0x00, 0x1D, 0x00, 0x01, 0x00, 0x00, 0x00, 0xC0, 0x00
	.byte 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0xDA, 0x00, 0x27, 0x00, 0x01, 0x01, 0x00, 0x00, 0x33, 0x00
	.byte 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x34, 0x00, 0x2F, 0x00, 0x01, 0x01, 0x00, 0x00, 0x35, 0x00
	.byte 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0x36, 0x00, 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x37, 0x00
	.byte 0x39, 0x01, 0x01, 0x01, 0x00, 0x00, 0x38, 0x00, 0x2D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x39, 0x00
	.byte 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x3A, 0x00, 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x3B, 0x00
	.byte 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xDB, 0x00, 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0xDC, 0x00
	.byte 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0xDD, 0x00, 0x12, 0x00, 0x01, 0x01, 0x00, 0x00, 0xDE, 0x00
	.byte 0x1A, 0x00, 0x01, 0x01, 0x00, 0x00, 0xDF, 0x00, 0x16, 0x00, 0x01, 0x01, 0x00, 0x00, 0xE0, 0x00
	.byte 0x11, 0x00, 0x01, 0x01, 0x00, 0x00, 0xE1, 0x00, 0x18, 0x00, 0x01, 0x01, 0x00, 0x00, 0xE2, 0x00
	.byte 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0xE3, 0x00, 0x34, 0x00, 0x01, 0x01, 0x00, 0x00, 0x3C, 0x00
	.byte 0x2D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x3D, 0x00, 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x3E, 0x00
	.byte 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0x3F, 0x00, 0x28, 0x00, 0x01, 0x01, 0x00, 0x00, 0x40, 0x00
	.byte 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x41, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x42, 0x00
	.byte 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x43, 0x00, 0x33, 0x00, 0x01, 0x01, 0x00, 0x00, 0x44, 0x00
	.byte 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x45, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x46, 0x00
	.byte 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0x47, 0x00, 0x31, 0x00, 0x01, 0x01, 0x00, 0x00, 0x48, 0x00
	.byte 0x1D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x49, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC1, 0x00
	.byte 0x33, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC2, 0x00, 0x4D, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC3, 0x00
	.byte 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC4, 0x00, 0x2E, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC5, 0x00
	.byte 0x18, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC6, 0x00, 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC7, 0x00
	.byte 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0xC8, 0x00, 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB2, 0x00
	.byte 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB3, 0x00, 0x33, 0x00, 0x01, 0x01, 0x00, 0x00, 0x4A, 0x00
	.byte 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x4B, 0x00, 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0x4C, 0x00
	.byte 0x28, 0x00, 0x01, 0x01, 0x00, 0x00, 0x4D, 0x00, 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x4E, 0x00
	.byte 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0x4F, 0x00, 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x50, 0x00
	.byte 0x26, 0x00, 0x01, 0x01, 0x00, 0x00, 0x51, 0x00, 0x1D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x52, 0x00
	.byte 0x4C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x53, 0x00, 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x54, 0x00
	.byte 0x57, 0x00, 0x01, 0x01, 0x00, 0x00, 0x55, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x56, 0x00
	.byte 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x58, 0x00, 0x18, 0x00, 0x01, 0x01, 0x00, 0x00, 0x59, 0x00
	.byte 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0x5A, 0x00, 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x5C, 0x00
	.byte 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x5D, 0x00, 0x26, 0x00, 0x01, 0x01, 0x00, 0x00, 0x5E, 0x00
	.byte 0x4E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x5F, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x60, 0x00
	.byte 0x33, 0x00, 0x01, 0x01, 0x00, 0x00, 0x61, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x62, 0x00
	.byte 0x35, 0x01, 0x01, 0x01, 0x00, 0x00, 0x63, 0x00, 0x56, 0x00, 0x01, 0x01, 0x00, 0x00, 0x64, 0x00
	.byte 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x65, 0x00, 0x18, 0x00, 0x01, 0x01, 0x00, 0x00, 0x66, 0x00
	.byte 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x67, 0x00, 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x68, 0x00
	.byte 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0x69, 0x00, 0x27, 0x00, 0x01, 0x01, 0x00, 0x00, 0x6A, 0x00
	.byte 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x6B, 0x00, 0x57, 0x00, 0x01, 0x01, 0x00, 0x00, 0x6C, 0x00
	.byte 0x57, 0x00, 0x01, 0x01, 0x00, 0x00, 0x6D, 0x00, 0x5E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x9D, 0x00
	.byte 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x9E, 0x00, 0x2C, 0x01, 0x01, 0x01, 0x00, 0x00, 0x6E, 0x00
	.byte 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0x6F, 0x00, 0x59, 0x00, 0x01, 0x01, 0x00, 0x00, 0x70, 0x00
	.byte 0x29, 0x00, 0x01, 0x01, 0x00, 0x00, 0x71, 0x00, 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x72, 0x00
	.byte 0x1D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x73, 0x00, 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0x74, 0x00
	.byte 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x75, 0x00, 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0x76, 0x00
	.byte 0x57, 0x00, 0x01, 0x01, 0x00, 0x00, 0x77, 0x00, 0x32, 0x01, 0x01, 0x01, 0x00, 0x00, 0x78, 0x00
	.byte 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0x79, 0x00, 0x57, 0x00, 0x01, 0x01, 0x00, 0x00, 0x7A, 0x00
	.byte 0x1D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x7B, 0x00, 0x35, 0x00, 0x01, 0x00, 0x00, 0x00, 0x7C, 0x00
	.byte 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x7D, 0x00, 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x7E, 0x00
	.byte 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x7F, 0x00, 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0xAA, 0x00
	.byte 0x58, 0x00, 0x01, 0x01, 0x00, 0x00, 0xAB, 0x00, 0x59, 0x00, 0x01, 0x01, 0x00, 0x00, 0xAC, 0x00
	.byte 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x80, 0x00, 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0x81, 0x00
	.byte 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x82, 0x00, 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0xCB, 0x00
	.byte 0x4D, 0x00, 0x01, 0x01, 0x00, 0x00, 0xCC, 0x00, 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xAD, 0x00
	.byte 0x1D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x83, 0x00, 0x57, 0x00, 0x01, 0x00, 0x00, 0x00, 0x84, 0x00
	.byte 0x56, 0x00, 0x01, 0x00, 0x00, 0x00, 0x85, 0x00, 0x56, 0x00, 0x01, 0x00, 0x00, 0x00, 0x86, 0x00
	.byte 0x59, 0x00, 0x01, 0x01, 0x00, 0x00, 0x87, 0x00, 0x33, 0x00, 0x01, 0x01, 0x00, 0x00, 0x9F, 0x00
	.byte 0x2E, 0x00, 0x01, 0x01, 0x00, 0x00, 0x88, 0x00, 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0x89, 0x00
	.byte 0x29, 0x00, 0x01, 0x01, 0x00, 0x00, 0x8A, 0x00, 0x2A, 0x01, 0x01, 0x01, 0x00, 0x00, 0x8B, 0x00
	.byte 0x34, 0x00, 0x01, 0x01, 0x00, 0x00, 0x8C, 0x00, 0x2F, 0x00, 0x01, 0x01, 0x00, 0x00, 0x8D, 0x00
	.byte 0x19, 0x00, 0x01, 0x01, 0x00, 0x00, 0xAF, 0x00, 0x1C, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB0, 0x00
	.byte 0x1B, 0x00, 0x01, 0x01, 0x00, 0x00, 0xB1, 0x00, 0x31, 0x00, 0x01, 0x01, 0x00, 0x00, 0x8E, 0x00
	.byte 0x02, 0x00, 0x01, 0x01, 0x00, 0x00, 0x8F, 0x00, 0x5A, 0x00, 0x01, 0x01, 0x00, 0x00, 0x90, 0x00
	.byte 0x32, 0x00, 0x01, 0x01, 0x00, 0x00, 0xCD, 0x00, 0x33, 0x00, 0x01, 0x01, 0x00, 0x00, 0xCE, 0x00
	.byte 0x17, 0x00, 0x01, 0x01, 0x00, 0x00, 0xCF, 0x00, 0x57, 0x00, 0x01, 0x01, 0x00, 0x00, 0x91, 0x00
	.byte 0x5C, 0x00, 0x01, 0x01, 0x00, 0x00, 0x92, 0x00, 0x30, 0x00, 0x01, 0x01, 0x00, 0x00, 0x93, 0x00
	.byte 0x2D, 0x00, 0x01, 0x01, 0x00, 0x00, 0x94, 0x00

	.global sNumScriptCmds
sNumScriptCmds: ; 0x020F34DC
	.word 721 ; NELEMS(gScriptCmdTable)

	.global UNK_020F34E0
UNK_020F34E0: ; 0x020F34E0
	.byte 0x03, 0x19, 0x0D, 0x06, 0x04, 0x0D, 0x15, 0x03

	.global sScriptConditionTable
sScriptConditionTable: ; 0x020F34E8
	.byte 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x01, 0x01, 0x01
	.byte 0x00, 0x01, 0x00, 0x00

	.global UNK_020F34FC
UNK_020F34FC: ; 0x020F34FC
	.byte 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07
	.byte 0xFF, 0xFF, 0xFF, 0x07, 0xFF, 0xFF, 0xFF, 0x07, 0x0F, 0x01, 0x10, 0x01, 0x11, 0x01, 0x06, 0x02
	.byte 0x07, 0x02, 0x08, 0x02, 0x09, 0x02, 0x0A, 0x02, 0x0B, 0x02, 0x0C, 0x02, 0x0D, 0x02, 0x0E, 0x02
	.byte 0x0F, 0x02, 0x10, 0x02, 0x11, 0x02, 0x12, 0x02, 0x13, 0x02, 0x14, 0x02

	.global UNK_020F3538
UNK_020F3538: ; 0x020F3538
	.byte 0x0F, 0x01, 0x10, 0x01, 0x11, 0x01, 0x06, 0x02, 0x07, 0x02, 0x08, 0x02, 0x09, 0x02, 0x0A, 0x02
	.byte 0x0B, 0x02, 0x0C, 0x02, 0x0D, 0x02, 0x0E, 0x02, 0x0F, 0x02, 0x10, 0x02, 0x11, 0x02, 0x12, 0x02
	.byte 0x13, 0x02, 0x14, 0x02

	.global gScriptCmdTable
gScriptCmdTable: ; 0x020F355C
	.word ScrCmd_Nop
	.word ScrCmd_Dummy
	.word ScrCmd_End
	.word ScrCmd_Wait
	.word ScrCmd_LoadByte
	.word ScrCmd_LoadWord
	.word ScrCmd_LoadByteFromAddr
	.word ScrCmd_WriteByteToAddr
	.word ScrCmd_SetPtrByte
	.word ScrCmd_CopyLocal
	.word ScrCmd_CopyByte
	.word ScrCmd_CompareLocalToLocal
	.word ScrCmd_CompareLocalToValue
	.word ScrCmd_CompareLocalToAddr
	.word ScrCmd_CompareAddrToLocal
	.word ScrCmd_CompareAddrToValue
	.word ScrCmd_CompareAddrToAddr
	.word ScrCmd_CompareVarToValue
	.word ScrCmd_CompareVarToVar
	.word ScrCmd_RunScript
	.word ScrCmd_RunScriptWait
	.word ScrCmd_RestartCurrentScript
	.word ScrCmd_GoTo
	.word ScrCmd_ObjectGoTo
	.word ScrCmd_BgGoTo
	.word ScrCmd_DirectionGoTo
	.word ScrCmd_Call
	.word ScrCmd_Return
	.word ScrCmd_GoToIf
	.word ScrCmd_CallIf
	.word ScrCmd_SetFlag
	.word ScrCmd_ClearFlag
	.word ScrCmd_CheckFlag
	.word ScrCmd_CheckFlagVar
	.word ScrCmd_SetFlagVar
	.word ScrCmd_SetTrainerFlag
	.word ScrCmd_ClearTrainerFlag
	.word ScrCmd_CheckTrainerFlag
	.word ScrCmd_AddVar
	.word ScrCmd_SubVar
	.word ScrCmd_SetVar
	.word ScrCmd_CopyVar
	.word ScrCmd_SetOrCopyVar
	.word ScrCmd_Message
	.word ScrCmd_Unk002C
	.word ScrCmd_Unk002D
	.word ScrCmd_Unk002E
	.word ScrCmd_Unk002F
	.word ScrCmd_WaitButtonAB
	.word ScrCmd_WaitButton
	.word ScrCmd_WaitButtonABPad
	.word ScrCmd_Unk0033
	.word ScrCmd_CloseMessageBox
	.word ScrCmd_Unk0035
	.word ScrCmd_CreateMessageBox
	.word ScrCmd_Unk0037
	.word ScrCmd_Unk0038
	.word ScrCmd_Unk0039
	.word ScrCmd_Unk003A
	.word ScrCmd_Unk003B
	.word ScrCmd_Menu
	.word ScrCmd_ScrollBg
	.word ScrCmd_YesNoMenu
	.word ScrCmd_Unk003F
	.word ScrCmd_Unk0040
	.word ScrCmd_Unk0041
	.word ScrCmd_Unk0042
	.word ScrCmd_Unk0043
	.word ScrCmd_Unk0044
	.word ScrCmd_Unk0045
	.word ScrCmd_Unk0046
	.word ScrCmd_Unk0047
	.word ScrCmd_Unk0048
	.word ScrCmd_PlayFanfare
	.word ScrCmd_StopFanfare
	.word ScrCmd_PlayFanfareWait
	.word ScrCmd_PlayCry
	.word ScrCmd_PlayCryWait
	.word ScrCmd_PlaySound
	.word ScrCmd_PlaySoundWait
	.word ScrCmd_PlayBgm
	.word ScrCmd_StopBgm
	.word ScrCmd_PlayDefaultBgm
	.word ScrCmd_Unk0053
	.word ScrCmd_FadeOutBgm
	.word ScrCmd_FadeInBgm
	.word ScrCmd_Unk0056
	.word ScrCmd_Unk0057
	.word ScrCmd_Unk0058
	.word ScrCmd_CheckChatotCry
	.word ScrCmd_StartChatotRecord
	.word ScrCmd_StopChatotRecord
	.word ScrCmd_SaveChatotCry
	.word ScrCmd_Unk005D
	.word ScrCmd_Unk005E
	.word ScrCmd_WaitForMovement
	.word ScrCmd_LockAllEvents
	.word ScrCmd_ReleaseAllEvents
	.word ScrCmd_LockEvent
	.word ScrCmd_ReleaseEvent
	.word ScrCmd_AddEvent
	.word ScrCmd_RemoveEvent
	.word ScrCmd_LockCamera
	.word ScrCmd_ReleaseCamera
	.word ScrCmd_FacePlayer
	.word ScrCmd_GetPlayerPosition
	.word ScrCmd_GetEventPosition
	.word ScrCmd_Unk006B
	.word ScrCmd_KeepEvent
	.word ScrCmd_SetEventMovement
	.word ScrCmd_EventStopFollowing
	.word ScrCmd_GiveMoney
	.word ScrCmd_TakeMoneyImmediate
	.word ScrCmd_HasEnoughMoneyImmediate
	.word ScrCmd_ShowMoneyBox
	.word ScrCmd_HideMoneyBox
	.word ScrCmd_UpdateMoneyBox
	.word ScrCmd_ShowCoinBox
	.word ScrCmd_HideCoinBox
	.word ScrCmd_UpdateCoinBox
	.word ScrCmd_GetCoins
	.word ScrCmd_GiveCoins
	.word ScrCmd_TakeCoinsImmediate
	.word ScrCmd_GiveItem
	.word ScrCmd_TakeItem
	.word ScrCmd_HasSpaceForItem
	.word ScrCmd_HasItem
	.word ScrCmd_ItemIdIsTMOrHM
	.word ScrCmd_GetItemPocketId
	.word ScrCmd_Unk0081
	.word ScrCmd_Unk0082
	.word ScrCmd_GiveSecretBaseDecoration
	.word ScrCmd_TakeSecretBaseDecoration
	.word ScrCmd_HasSpaceForDecoration
	.word ScrCmd_GetDecorationCount
	.word ScrCmd_GiveUndergroundTrap
	.word ScrCmd_TakeUndergroundTrap
	.word ScrCmd_HasSpaceForTrap
	.word ScrCmd_GetTrapCount
	.word ScrCmd_GiveTreasure
	.word ScrCmd_TakeTreasure
	.word ScrCmd_HasSpaceForTreasure
	.word ScrCmd_GetTreasureCount
	.word ScrCmd_GiveUndergroundSphere
	.word ScrCmd_TakeUndergroundSphere
	.word ScrCmd_HasSpaceForSphere
	.word ScrCmd_GetSphereCount
	.word ScrCmd_GetSealCountFromId
	.word ScrCmd_GiveSeals
	.word ScrCmd_GetPokemonForm
	.word ScrCmd_GiveMon
	.word ScrCmd_GiveEgg
	.word ScrCmd_SetPartyMonMove
	.word ScrCmd_PartyMonHasMove
	.word ScrCmd_FindPartyMonWithMove
	.word ScrCmd_Unk009B
	.word ScrCmd_DummySetWeather
	.word ScrCmd_DummyInitWeather
	.word ScrCmd_DummyUpdateWeather
	.word ScrCmd_DummyGetMapPosition
	.word ScrCmd_Unk00A0
	.word ScrCmd_RestoreOverworld
	.word ScrCmd_Unk00A2
	.word ScrCmd_Unk00A3
	.word ScrCmd_GetDressupPortraitSlot
	.word ScrCmd_Unk00A5
	.word ScrCmd_DressupPokemon
	.word ScrCmd_ShowDressedPokemon
	.word ScrCmd_ShowContestPokemon
	.word ScrCmd_ShowSealCapsuleEditor
	.word ScrCmd_ShowTownMapScreen
	.word ScrCmd_ShowPCBoxScreen
	.word ScrCmd_Unk00AC
	.word ScrCmd_Unk00AD
	.word ScrCmd_Unk00AE
	.word ScrCmd_Unk00AF
	.word ScrCmd_ShowEndGameScreen
	.word ScrCmd_InitHallOfFame
	.word ScrCmd_Unk00B2
	.word ScrCmd_Unk00B3
	.word ScrCmd_StarterSelectionScreen
	.word ScrCmd_EndStarterSelectionScreen
	.word ScrCmd_Unk00B6
	.word ScrCmd_Unk00B7
	.word ScrCmd_Unk00B8
	.word ScrCmd_Unk00B9
	.word ScrCmd_NamePlayerScreen
	.word ScrCmd_NamePokemonScreen
	.word ScrCmd_FadeScreen
	.word ScrCmd_WaitFadeScreen
	.word ScrCmd_Warp
	.word ScrCmd_RockClimb
	.word ScrCmd_Surf
	.word ScrCmd_Waterfall
	.word ScrCmd_Fly
	.word ScrCmd_Flash
	.word ScrCmd_Defog
	.word ScrCmd_Cut
	.word ScrCmd_ApplyContestDress
	.word ScrCmd_CheckBike
	.word ScrCmd_RideBike
	.word ScrCmd_CyclingRoad
	.word ScrCmd_GetPlayerState
	.word ScrCmd_SetPlayerState
	.word ScrCmd_ApplyPlayerState
	.word ScrCmd_GetPlayerName
	.word ScrCmd_GetRivalName
	.word ScrCmd_GetFriendName
	.word ScrCmd_GetPokemonName
	.word ScrCmd_GetItemName
	.word ScrCmd_GetPocketName
	.word ScrCmd_GetTMHMMoveName
	.word ScrCmd_GetMoveName
	.word ScrCmd_Unk00D5
	.word ScrCmd_GetPokemonNickname
	.word ScrCmd_GetPoketchAppName
	.word ScrCmd_GetTrainerClassName
	.word ScrCmd_Unk00D9
	.word ScrCmd_Unk00DA
	.word ScrCmd_GetPlayerStarterName
	.word ScrCmd_GetRivalStarterName
	.word ScrCmd_GetCounterpartStarterName
	.word ScrCmd_GetStarter
	.word ScrCmd_GetDecorationName
	.word ScrCmd_GetUndergroundTrapName
	.word ScrCmd_GetUndergroundItemName
	.word ScrCmd_GetMapName
	.word ScrCmd_GetSwarmInfo
	.word ScrCmd_Unk00E4
	.word ScrCmd_Unk00E5
	.word ScrCmd_TrainerMessage
	.word ScrCmd_Unk00E7
	.word ScrCmd_Unk00E8
	.word ScrCmd_Unk00E9
	.word ScrCmd_Unk00EA
	.word ScrCmd_Unk00EB
	.word ScrCmd_Unk00EC
	.word ScrCmd_Unk00ED
	.word ScrCmd_Unk00EE
	.word ScrCmd_Unk00EF
	.word ScrCmd_Unk00F0
	.word ScrCmd_Unk00F1
	.word ScrCmd_Unk00F2
	.word ScrCmd_Unk00F3
	.word ScrCmd_Unk00F4
	.word ScrCmd_Unk00F5
	.word ScrCmd_Unk00F6
	.word ScrCmd_Unk00F7
	.word ScrCmd_Unk00F8
	.word ScrCmd_Unk00F9
	.word ScrCmd_Unk00FA
	.word ScrCmd_Unk00FB
	.word ScrCmd_Unk00FC
	.word ScrCmd_Unk00FD
	.word ScrCmd_Unk00FE
	.word ScrCmd_Unk00FF
	.word ScrCmd_Unk0100
	.word ScrCmd_Unk0101
	.word ScrCmd_Unk0102
	.word ScrCmd_Unk0103
	.word ScrCmd_Unk0104
	.word ScrCmd_Unk0105
	.word ScrCmd_Unk0106
	.word ScrCmd_Unk0107
	.word ScrCmd_Unk0108
	.word ScrCmd_Unk0109
	.word ScrCmd_Unk010A
	.word ScrCmd_Unk010B
	.word ScrCmd_Unk010C
	.word ScrCmd_Unk010D
	.word ScrCmd_Unk010E
	.word ScrCmd_Unk010F
	.word ScrCmd_Unk0110
	.word ScrCmd_Unk0111
	.word ScrCmd_Unk0112
	.word ScrCmd_Unk0113
	.word ScrCmd_Unk0114
	.word ScrCmd_Unk0115
	.word ScrCmd_Unk0116
	.word ScrCmd_Unk0117
	.word ScrCmd_Unk0118
	.word ScrCmd_CheckPartyForPokerus
	.word ScrCmd_GetPartyMonGender
	.word ScrCmd_SetDynamicWarp
	.word ScrCmd_GetDynamicWarpFloorNumber
	.word ScrCmd_ShowCurrentFloorNumber
	.word ScrCmd_CountSinnohDexSeen
	.word ScrCmd_CountSinnohDexOwned
	.word ScrCmd_CountNationalDexSeen
	.word ScrCmd_CountNationalDexOwned
	.word ScrCmd_DummyDexCheck
	.word ScrCmd_GetDexEvaluationMessage
	.word ScrCmd_WildBattle
	.word ScrCmd_FirstBattle
	.word ScrCmd_CatchTutorial
	.word ScrCmd_UpdateHoneyTree
	.word ScrCmd_CheckHoneyTree
	.word ScrCmd_HoneyTreeBattle
	.word ScrCmd_StopHoneyTreeAnimation
	.word ScrCmd_ShowSignatureScreen
	.word ScrCmd_CheckSaveStatus
	.word ScrCmd_SaveGame
	.word ScrCmd_CheckPortraitSlot
	.word ScrCmd_CheckContestPortraitSlot
	.word ScrCmd_Unk0130
	.word ScrCmd_GivePoketch
	.word ScrCmd_CheckPoketch
	.word ScrCmd_UnlockPoketchApp
	.word ScrCmd_CheckPoketchApp
	.word ScrCmd_Unk0135
	.word ScrCmd_Unk0136
	.word ScrCmd_Unk0137
	.word ScrCmd_Unk0138
	.word ScrCmd_Unk0139
	.word ScrCmd_Unk013A
	.word ScrCmd_Unk013B
	.word ScrCmd_Unk013C
	.word ScrCmd_Unk013D
	.word ScrCmd_Unk013E
	.word ScrCmd_Unk013F
	.word ScrCmd_Unk0140
	.word ScrCmd_Unk0141
	.word ScrCmd_Unk0142
	.word ScrCmd_Unk0143
	.word ScrCmd_Unk0144
	.word ScrCmd_Unk0145
	.word ScrCmd_Unk0146
	.word ScrCmd_NormalMart
	.word ScrCmd_SpecialMart
	.word ScrCmd_GoodsMart
	.word ScrCmd_SealsMart
	.word ScrCmd_DummyBlackout
	.word ScrCmd_SetSpawn
	.word ScrCmd_GetPlayerGender
	.word ScrCmd_HealParty
	.word ScrCmd_Unk014F
	.word ScrCmd_Unk0150
	.word ScrCmd_Unk0151
	.word ScrCmd_Unk0152
	.word ScrCmd_Unk0153
	.word ScrCmd_Unk0154
	.word ScrCmd_Unk0155
	.word ScrCmd_SetPlayerAvatar
	.word ScrCmd_HasSinnohDex
	.word ScrCmd_GiveSinnohDex
	.word ScrCmd_HasRunningShoes
	.word ScrCmd_GiveRunningShoes
	.word ScrCmd_HasBadge
	.word ScrCmd_GiveBadge
	.word ScrCmd_GetTotalEarnedBadges
	.word ScrCmd_HasBag
	.word ScrCmd_GiveBag
	.word ScrCmd_Unk0160
	.word ScrCmd_Unk0161
	.word ScrCmd_Unk0162
	.word ScrCmd_Unk0163
	.word ScrCmd_Unk0164
	.word ScrCmd_Unk0165
	.word ScrCmd_CheckGameCompleted
	.word ScrCmd_SetGameCompleted
	.word ScrCmd_PrepareDoorAnimation
	.word ScrCmd_WaitDoorAnimation
	.word ScrCmd_FreeDoorAnimation
	.word ScrCmd_OpenDoorAnimation
	.word ScrCmd_CloseDoorAnimation
	.word ScrCmd_GetDaycarePokemonNames
	.word ScrCmd_GetDaycareStatus
	.word ScrCmd_InitPastoriaGym
	.word ScrCmd_CheckPastoriaGymButton
	.word ScrCmd_InitHearthomeGym
	.word ScrCmd_MoveHearthomeGymElevator
	.word ScrCmd_InitCanalaveGym
	.word ScrCmd_InitVeilstoneGym
	.word ScrCmd_InitSunyshoreGym
	.word ScrCmd_RotateSunyshoreGymGear
	.word ScrCmd_CountPartyMons
	.word ScrCmd_ShowBagScreen
	.word ScrCmd_GetBagScreenSelection
	.word ScrCmd_CheckPocketNotEmpty
	.word ScrCmd_GetBerryName
	.word ScrCmd_GetNatureName
	.word ScrCmd_GetBerryTreeGrowth
	.word ScrCmd_GetBerryTreeType
	.word ScrCmd_GetBerryTreeMulch
	.word ScrCmd_GetBerryTreeWater
	.word ScrCmd_GetBerryTreeAmount
	.word ScrCmd_SetBerryTreeMulch
	.word ScrCmd_SetBerryTreeType
	.word ScrCmd_Unk0184
	.word ScrCmd_TakeBerryTreeBerries
	.word ScrCmd_SetEventDefaultPosition
	.word ScrCmd_SetEventPosition
	.word ScrCmd_SetEventDefaultMovement
	.word ScrCmd_SetEventDefaultDirection
	.word ScrCmd_SetWarpPosition
	.word ScrCmd_SetBgEventPosition
	.word ScrCmd_SetEventDirection
	.word ScrCmd_ShowWaitingIcon
	.word ScrCmd_HideWaitingIcon
	.word ScrCmd_Unk018F
	.word ScrCmd_WaitButtonABTime
	.word ScrCmd_ChoosePokemonMenu
	.word ScrCmd_UnionChoosePokemonMenu
	.word ScrCmd_GetSelectedPartySlot
	.word ScrCmd_Unk0194
	.word ScrCmd_Unk0195
	.word ScrCmd_Unk0196
	.word ScrCmd_Unk0197
	.word ScrCmd_GetPartyMonSpecies
	.word ScrCmd_CheckPartyMonOTID
	.word ScrCmd_CountPartyMons_OmitEggs
	.word ScrCmd_CountAvailablePartyMons_IgnoreSlot
	.word ScrCmd_CountAvailablePartyAndPCMons
	.word ScrCmd_GetPartyEggCount
	.word ScrCmd_Unk019E
	.word ScrCmd_Unk019F
	.word ScrCmd_Unk01A0
	.word ScrCmd_Unk01A1
	.word ScrCmd_Unk01A2
	.word ScrCmd_TakeMoneyAddress
	.word ScrCmd_Unk01A4
	.word ScrCmd_Unk01A5
	.word ScrCmd_Unk01A6
	.word ScrCmd_Unk01A7
	.word ScrCmd_DeleteDaycareEgg
	.word ScrCmd_GiveDaycareEgg
	.word ScrCmd_Unk01AA
	.word ScrCmd_HasEnoughMoneyAddress
	.word ScrCmd_HatchEgg
	.word ScrCmd_Unk01AD
	.word ScrCmd_GetDaycareLevel
	.word ScrCmd_Unk01AF
	.word ScrCmd_Unk01B0
	.word ScrCmd_HideEvent
	.word ScrCmd_ShowEvent
	.word ScrCmd_ShowMailbox
	.word ScrCmd_CountMail
	.word ScrCmd_Unk01B5
	.word ScrCmd_GetTimeOfDay
	.word ScrCmd_Random
	.word ScrCmd_DummyRandom
	.word ScrCmd_GetPartyMonFriendship
	.word ScrCmd_AddPartyMonFriendship
	.word ScrCmd_SubtractPartyMonFriendship
	.word ScrCmd_Unk01BC
	.word ScrCmd_GetPlayerDirection
	.word ScrCmd_Unk01BE
	.word ScrCmd_Unk01BF
	.word ScrCmd_CheckPartyForSpecies
	.word ScrCmd_CheckPokemonSizeRecord
	.word ScrCmd_SetPokemonSizeRecord
	.word ScrCmd_BufferPartyPokemonSize
	.word ScrCmd_BufferPokemonRecordSize
	.word ScrCmd_InitPokemonRecordSize
	.word ScrCmd_Unk01C6
	.word ScrCmd_Unk01C7
	.word ScrCmd_CountPartyMonMoves
	.word ScrCmd_ForgetPartyMonMove
	.word ScrCmd_GetPartyMonMove
	.word ScrCmd_GetPokemonMoveName
	.word ScrCmd_Unk01CC
	.word ScrCmd_Unk01CD
	.word ScrCmd_Unk01CE
	.word ScrCmd_GetSetStrength
	.word ScrCmd_GetSetFlash
	.word ScrCmd_GetSetDefog
	.word ScrCmd_Unk01D2
	.word ScrCmd_Unk01D3
	.word ScrCmd_Unk01D4
	.word ScrCmd_Unk01D5
	.word ScrCmd_Unk01D6
	.word ScrCmd_Unk01D7
	.word ScrCmd_Unk01D8
	.word ScrCmd_Unk01D9
	.word ScrCmd_Unk01DA
	.word ScrCmd_Unk01DB
	.word ScrCmd_Unk01DC
	.word ScrCmd_Unk01DD
	.word ScrCmd_Unk01DE
	.word ScrCmd_Unk01DF
	.word ScrCmd_Unk01E0
	.word ScrCmd_Unk01E1
	.word ScrCmd_Unk01E2
	.word ScrCmd_Unk01E3
	.word ScrCmd_Unk01E4
	.word ScrCmd_IncrementGameStat
	.word ScrCmd_GetGameStat
	.word ScrCmd_SetGameStat
	.word ScrCmd_CheckSinnohDexComplete
	.word ScrCmd_CheckNationalDexComplete
	.word ScrCmd_RegisterSinnohPokedex
	.word ScrCmd_RegisterNationalPokedex
	.word ScrCmd_Unk01EC
	.word ScrCmd_Unk01ED
	.word ScrCmd_GetPartyMonHeldItem
	.word ScrCmd_Unk01EF
	.word ScrCmd_ResetPartyMonHeldItem
	.word ScrCmd_CountFossils
	.word ScrCmd_Unk01F2
	.word ScrCmd_Unk01F3
	.word ScrCmd_GetFossilPokemon
	.word ScrCmd_GetFossilMinimumAmount
	.word ScrCmd_CountPartyMonsAtOrBelowLevel
	.word ScrCmd_SurvivePsn
	.word ScrCmd_TerminateOverworldProcess
	.word ScrCmd_DebugWatch
	.word ScrCmd_MessageFrom
	.word ScrCmd_MessageFrom2
	.word ScrCmd_Unk01FC
	.word ScrCmd_Unk01FD
	.word ScrCmd_Unk01FE
	.word ScrCmd_Unk01FF
	.word ScrCmd_GetPreviousMapID
	.word ScrCmd_GetCurrentMapID
	.word ScrCmd_EnableDisableSafariZone
	.word ScrCmd_BattleRoomWarp
	.word ScrCmd_ExitBattleRoom
	.word ScrCmd_ShowGeonetScreen
	.word ScrCmd_UseGreatMarshBinoculars
	.word ScrCmd_Unk0207
	.word ScrCmd_ShowPokemonPic
	.word ScrCmd_Unk0209
	.word ScrCmd_Unk020A
	.word ScrCmd_Unk020B
	.word ScrCmd_Unk020C
	.word ScrCmd_SpearPillarSequence
	.word ScrCmd_KeepSafariTrain
	.word ScrCmd_MoveSafariTrain
	.word ScrCmd_CheckSafariTrainPosition
	.word ScrCmd_IgnoreHeights
	.word ScrCmd_GetPartyMonNature
	.word ScrCmd_FindPartyMonWithNature
	.word ScrCmd_GetSpiritombTalkCounter
	.word ScrCmd_ClearAmitySquareSteps
	.word ScrCmd_CheckAmitySquareSteps
	.word ScrCmd_GetAmitySquareAccessory
	.word ScrCmd_Unk0218
	.word ScrCmd_Unk0219
	.word ScrCmd_Unk021A
	.word ScrCmd_Unk021B
	.word ScrCmd_CreateRoamer
	.word ScrCmd_UnionGroup
	.word ScrCmd_Unk021E
	.word ScrCmd_Unk021F
	.word ScrCmd_Unk0220
	.word ScrCmd_Unk0221
	.word ScrCmd_Unk0222
	.word ScrCmd_Unk0223
	.word ScrCmd_Unk0224
	.word ScrCmd_Unk0225
	.word ScrCmd_NPCTradeInit
	.word ScrCmd_NPCTradeGetOfferedSpecies
	.word ScrCmd_NPCTradeGetRequestedSpecies
	.word ScrCmd_NPCTradeExecute
	.word ScrCmd_NPCTradeEnd
	.word ScrCmd_UnlockForeignEntries
	.word ScrCmd_UnlockGenderEntries
	.word ScrCmd_NationalDex
	.word ScrCmd_CountPartyMonRibbons
	.word ScrCmd_CountTotalPartyRibbons
	.word ScrCmd_PartyMonHasRibbon
	.word ScrCmd_GivePartyMonRibbon
	.word ScrCmd_GetRibbonName
	.word ScrCmd_GetTotalPokemonEVs
	.word ScrCmd_GetDayOfWeek
	.word ScrCmd_Unk0235
	.word ScrCmd_Unk0236
	.word ScrCmd_Unk0237
	.word ScrCmd_Unk0238
	.word ScrCmd_Unk0239
	.word ScrCmd_GetPokemonFootprint
	.word ScrCmd_PokecenterHealAnimation
	.word ScrCmd_ElevatorAnimation
	.word ScrCmd_ShipAnimation
	.word ScrCmd_Unk023E
	.word ScrCmd_Unk023F
	.word ScrCmd_Unk0240
	.word ScrCmd_Unk0241
	.word ScrCmd_Unk0242
	.word ScrCmd_Unk0243
	.word ScrCmd_Unk0244
	.word ScrCmd_Unk0245
	.word ScrCmd_GetGameVersion
	.word ScrCmd_GetLeadingPartyMonSlot
	.word ScrCmd_GetPartyMonTypes
	.word ScrCmd_GiveWallpaper
	.word ScrCmd_Unk024A
	.word ScrCmd_Unk024B
	.word ScrCmd_Unk024C
	.word ScrCmd_Unk024D
	.word ScrCmd_Unk024E
	.word ScrCmd_Unk024F
	.word ScrCmd_Unk0250
	.word ScrCmd_Unk0251
	.word ScrCmd_CountPCFreeSpace
	.word ScrCmd_Unk0253
	.word ScrCmd_Unk0254
	.word ScrCmd_Unk0255
	.word ScrCmd_Unk0256
	.word ScrCmd_AccessoriesShop
	.word ScrCmd_Unk0258
	.word ScrCmd_Unk0259
	.word ScrCmd_Unk025A
	.word ScrCmd_Unk025B
	.word ScrCmd_Unk025C
	.word ScrCmd_Unk025D
	.word ScrCmd_Unk025E
	.word ScrCmd_Unk025F
	.word ScrCmd_AddSpecialGameStat
	.word ScrCmd_GetFashionName
	.word ScrCmd_CheckPokemonInParty
	.word ScrCmd_SetDeoxysForm
	.word ScrCmd_CheckBurmyForms
	.word ScrCmd_Unk0265
	.word ScrCmd_Unk0266
	.word ScrCmd_SlotMachine
	.word ScrCmd_GetHour
	.word ScrCmd_ShakeEvent
	.word ScrCmd_BlinkEvent
	.word ScrCmd_CheckRegis
	.word ScrCmd_Unk026C
	.word ScrCmd_MessageUnown
	.word ScrCmd_CheckGBACartridge
	.word ScrCmd_ResetSpiritombTalkCounter
	.word ScrCmd_Unk0270
	.word ScrCmd_WriteWhiteRockInscription
	.word ScrCmd_GetWhiteRockInscription
	.word ScrCmd_BufferContestBackgroundName
	.word ScrCmd_HasEnoughCoinsImmediate
	.word ScrCmd_Unk0275
	.word ScrCmd_CanGiveCoins
	.word ScrCmd_Unk0277
	.word ScrCmd_GetPartyMonLevel
	.word ScrCmd_Unk0279
	.word ScrCmd_UseSunyshoreBinoculars
	.word ScrCmd_Unk027B
	.word ScrCmd_Unk027C
	.word ScrCmd_BufferRandomTrendySaying
	.word ScrCmd_Unk027E
	.word ScrCmd_Unk027F
	.word ScrCmd_Unk0280
	.word ScrCmd_GetPartyMonContestCondition
	.word ScrCmd_CheckBirthday
	.word ScrCmd_SetVolume
	.word ScrCmd_CountSeenUnown
	.word ScrCmd_Unk0285
	.word ScrCmd_Unk0286
	.word ScrCmd_Unk0287
	.word ScrCmd_Unk0288
	.word ScrCmd_Unk0289
	.word ScrCmd_Unk028A
	.word ScrCmd_CheckEventValidity
	.word ScrCmd_ShowPartyPokemonPic
	.word ScrCmd_Unk028D
	.word ScrCmd_Unk028E
	.word ScrCmd_Unk028F
	.word ScrCmd_Unk0290
	.word ScrCmd_Unk0291
	.word ScrCmd_Unk0292
	.word ScrCmd_Unk0293
	.word ScrCmd_Unk0294
	.word ScrCmd_Unk0295
	.word ScrCmd_Unk0296
	.word ScrCmd_Unk0297
	.word ScrCmd_Unk0298
	.word ScrCmd_Unk0299
	.word ScrCmd_Unk029A
	.word ScrCmd_Unk029B
	.word ScrCmd_Unk029C
	.word ScrCmd_Unk029D
	.word ScrCmd_Unk029E
	.word ScrCmd_ShakeCamera
	.word ScrCmd_Unk02A0
	.word ScrCmd_Unk02A1
	.word ScrCmd_Unk02A2
	.word ScrCmd_Unk02A3
	.word ScrCmd_Unk02A4
	.word ScrCmd_OpenTradeScreen
	.word ScrCmd_GetPrizeItemIdAndCost
	.word ScrCmd_Unk02A7
	.word ScrCmd_TakeCoinsAddress
	.word ScrCmd_HasEnoughCoinsAddress
	.word ScrCmd_CompareMysteryGiftEasyChatInput
	.word ScrCmd_Unk02AB
	.word ScrCmd_ActivateMysteryGift
	.word ScrCmd_GetEventMovement
	.word ScrCmd_Unk02AE
	.word ScrCmd_Unk02AF
	.word ScrCmd_Unk02B0
	.word ScrCmd_Unk02B1
	.word ScrCmd_Unk02B2
	.word ScrCmd_GetSealName
	.word ScrCmd_LockAllEvents2
	.word ScrCmd_Unk02B5
	.word ScrCmd_Unk02B6
	.word ScrCmd_CheckPartyForBadEgg
	.word ScrCmd_Unk02B8
	.word ScrCmd_Unk02B9
	.word ScrCmd_Unk02BA
	.word ScrCmd_Unk02BB
	.word ScrCmd_Unk02BC
	.word ScrCmd_LegendaryBattle
	.word ScrCmd_GetTrainerCardLevel
	.word ScrCmd_DummyRideBike
	.word ScrCmd_Unk02C0
	.word ScrCmd_ShowSaveStats
	.word ScrCmd_HideSaveStats
	.word ScrCmd_ScopeMode
	.word ScrCmd_GetItemNameWithIndefArticle
	.word ScrCmd_GetItemNamePlural
	.word ScrCmd_GetDecorationNameWithArticle
	.word ScrCmd_GetUndergroundTrapNameWithArticle
	.word ScrCmd_GetUndergroundItemNameWithArticle
	.word ScrCmd_Unk02C9
	.word ScrCmd_Unk02CA
	.word ScrCmd_GetFashionNameWithArticle
	.word ScrCmd_Unk02CC
	.word ScrCmd_GetSealNamePlural
	.word ScrCmd_CapitalizeFirstChar
	.word ScrCmd_Unk02CF
	.word ScrCmd_Unk02D0

	.text

	thumb_func_start sub_02038C78
sub_02038C78: ; 0x02038C78
	push {r3-r7, lr}
	add r5, r0, #0x0
	add r6, r1, #0x0
	add r7, r2, #0x0
	bl CreateFieldContext
	add r4, r0, #0x0
	mov r0, #0x0
	str r0, [sp, #0x0]
	add r0, r5, #0x0
	add r1, r4, #0x0
	add r2, r6, #0x0
	add r3, r7, #0x0
	bl sub_02038E60
	ldr r1, _02038CA4 ; =sub_02038D48
	add r0, r5, #0x0
	add r2, r4, #0x0
	bl FieldSystem_CreateTask
	pop {r3-r7, pc}
	nop
_02038CA4: .word sub_02038D48 

	thumb_func_start sub_02038CA8
sub_02038CA8: ; 0x02038CA8
	push {r4-r6, lr}
	ldr r0, [r0, #0x10]
	add r5, r1, #0x0
	add r4, r2, #0x0
	add r6, r3, #0x0
	bl TaskManager_GetEnvironment
	ldr r2, [sp, #0x1c]
	mov r1, #0x1c
	add r3, r2, #0x0
	add r0, #0x50
	mul r3, r1
	add r1, r0, r3
	str r4, [r0, r3]
	ldr r0, [sp, #0x10]
	str r6, [r1, #0x4]
	str r0, [r1, #0x8]
	ldr r0, [sp, #0x14]
	str r0, [r1, #0xc]
	ldr r0, [sp, #0x18]
	str r0, [r1, #0x10]
	str r5, [r1, #0x14]
	pop {r4-r6, pc}
	.balign 4

	thumb_func_start QueueScript
QueueScript: ; 0x02038CD8
	push {r4-r7, lr}
	sub sp, #0xc
	add r6, r0, #0x0
	add r7, r1, #0x0
	str r2, [sp, #0x4]
	add r5, r3, #0x0
	bl TaskManager_GetFieldSystem
	str r0, [sp, #0x8]
	bl CreateFieldContext
	add r4, r0, #0x0
	ldr r0, [sp, #0x8]
	ldr r3, [sp, #0x4]
	add r1, r4, #0x0
	add r2, r7, #0x0
	str r5, [sp, #0x0]
	bl sub_02038E60
	ldr r1, _02038D0C ; =sub_02038D48
	add r0, r6, #0x0
	add r2, r4, #0x0
	bl TaskManager_Call
	add sp, #0xc
	pop {r4-r7, pc}
	.balign 4
_02038D0C: .word sub_02038D48 

	thumb_func_start StartScriptFromMenu
StartScriptFromMenu: ; 0x02038D10
	push {r3-r7, lr}
	sub sp, #0x8
	add r5, r0, #0x0
	add r6, r1, #0x0
	add r7, r2, #0x0
	bl TaskManager_GetFieldSystem
	str r0, [sp, #0x4]
	bl CreateFieldContext
	add r4, r0, #0x0
	mov r0, #0x0
	str r0, [sp, #0x0]
	ldr r0, [sp, #0x4]
	add r1, r4, #0x0
	add r2, r6, #0x0
	add r3, r7, #0x0
	bl sub_02038E60
	ldr r1, _02038D44 ; =sub_02038D48
	add r0, r5, #0x0
	add r2, r4, #0x0
	bl TaskManager_Jump
	add sp, #0x8
	pop {r3-r7, pc}
	.balign 4
_02038D44: .word sub_02038D48 

	thumb_func_start sub_02038D48
sub_02038D48: ; 0x02038D48
	push {r3-r7, lr}
	sub sp, #0x8
	add r5, r0, #0x0
	bl TaskManager_GetEnvironment
	add r4, r0, #0x0
	add r0, r5, #0x0
	bl TaskManager_GetFieldSystem
	ldrb r1, [r4, #0x4]
	str r0, [sp, #0x0]
	cmp r1, #0x0
	beq _02038D68
	cmp r1, #0x1
	beq _02038D9E
	b _02038E1A
_02038D68:
	ldrh r1, [r4, #0xa]
	bl CreateScriptContext
	str r0, [r4, #0x38]
	mov r0, #0x1
	strb r0, [r4, #0x9]
	mov r0, #0x8
	mov r1, #0x40
	mov r2, #0xb
	bl MessageFormat_New_Custom
	str r0, [r4, #0x40]
	mov r0, #0x1
	lsl r0, r0, #0xa
	mov r1, #0xb
	bl String_New
	str r0, [r4, #0x44]
	mov r0, #0x1
	lsl r0, r0, #0xa
	mov r1, #0xb
	bl String_New
	str r0, [r4, #0x48]
	ldrb r0, [r4, #0x4]
	add r0, r0, #0x1
	strb r0, [r4, #0x4]
_02038D9E:
	mov r0, #0x0
	add r7, r4, #0x0
	str r0, [sp, #0x4]
	add r5, r4, #0x0
	add r7, #0x9
_02038DA8:
	ldr r6, [r5, #0x38]
	cmp r6, #0x0
	beq _02038DD2
	add r0, r6, #0x0
	bl RunScriptCommand
	cmp r0, #0x0
	bne _02038DD2
	add r0, r6, #0x0
	bl DeleteScriptContext
	ldrb r0, [r4, #0x9]
	cmp r0, #0x0
	bne _02038DC8
	bl GF_AssertFail
_02038DC8:
	mov r0, #0x0
	str r0, [r5, #0x38]
	ldrb r0, [r7, #0x0]
	sub r0, r0, #0x1
	strb r0, [r7, #0x0]
_02038DD2:
	ldr r0, [sp, #0x4]
	add r5, r5, #0x4
	add r0, r0, #0x1
	str r0, [sp, #0x4]
	cmp r0, #0x2
	blt _02038DA8
	ldrb r0, [r4, #0x9]
	cmp r0, #0x0
	bne _02038E1A
	add r0, r4, #0x0
	add r0, #0xa4
	ldr r5, [r0, #0x0]
	ldr r0, [r4, #0x40]
	bl MessageFormat_Delete
	ldr r0, [r4, #0x44]
	bl String_Delete
	ldr r0, [r4, #0x48]
	bl String_Delete
	mov r0, #0x0
	str r0, [r4, #0x0]
	add r0, r4, #0x0
	bl FreeToHeap
	cmp r5, #0x0
	beq _02038E14
	ldr r0, [sp, #0x0]
	blx r5
	add sp, #0x8
	mov r0, #0x0
	pop {r3-r7, pc}
_02038E14:
	add sp, #0x8
	mov r0, #0x1
	pop {r3-r7, pc}
_02038E1A:
	mov r0, #0x0
	add sp, #0x8
	pop {r3-r7, pc}

	thumb_func_start CreateFieldContext
CreateFieldContext: ; 0x02038E20
	push {r4, lr}
	mov r0, #0xb
	mov r1, #0xdc
	bl AllocFromHeap
	add r4, r0, #0x0
	bne _02038E32
	bl GF_AssertFail
_02038E32:
	add r0, r4, #0x0
	mov r1, #0x0
	mov r2, #0xdc
	bl memset
	ldr r0, _02038E44 ; =0x0003643F
	str r0, [r4, #0x0]
	add r0, r4, #0x0
	pop {r4, pc}
	.balign 4
_02038E44: .word 0x0003643F

	thumb_func_start DeleteScriptContext
DeleteScriptContext: ; 0x02038E48
	push {r4, lr}
	add r4, r0, #0x0
	ldr r0, [r4, #0x78]
	bl DestroyMsgData
	ldr r0, [r4, #0x7c]
	bl FreeToHeap
	add r0, r4, #0x0
	bl FreeToHeap
	pop {r4, pc}

	thumb_func_start sub_02038E60
sub_02038E60: ; 0x02038E60
	push {r3-r7, lr}
	add r5, r1, #0x0
	add r7, r0, #0x0
	add r0, r5, #0x0
	mov r1, #0x36
	add r4, r2, #0x0
	add r6, r3, #0x0
	bl sub_02039300
	str r0, [sp, #0x0]
	ldr r0, [r7, #0x38]
	bl PlayerAvatar_GetFacingDirection
	str r0, [r5, #0x28]
	str r6, [r5, #0x2c]
	ldr r0, [sp, #0x18]
	strh r4, [r5, #0xa]
	str r0, [r5, #0x34]
	cmp r6, #0x0
	beq _02038E92
	add r0, r6, #0x0
	bl MapObject_GetID
	ldr r1, [sp, #0x0]
	strh r0, [r1, #0x0]
_02038E92:
	mov r0, #0x7d
	lsl r0, r0, #0x6
	cmp r4, r0
	blo _02038EA8
	ldr r0, _02038EAC ; =0x0000225F
	cmp r4, r0
	bhi _02038EA8
	add r0, r5, #0x0
	add r1, r4, #0x0
	bl sub_020396E8
_02038EA8:
	pop {r3-r7, pc}
	nop
_02038EAC: .word 0x0000225F

	thumb_func_start CreateScriptContext
CreateScriptContext: ; 0x02038EB0
	push {r4-r6, lr}
	add r5, r0, #0x0
	add r6, r1, #0x0
	mov r0, #0xb
	mov r1, #0x84
	bl AllocFromHeap
	add r4, r0, #0x0
	bne _02038EC6
	bl GF_AssertFail
_02038EC6:
	ldr r2, _02038EE4 ; =sNumScriptCmds
	ldr r1, _02038EE8 ; =gScriptCmdTable
	ldr r2, [r2, #0x0]
	add r0, r4, #0x0
	bl InitScriptContext
	add r0, r5, #0x0
	add r1, r4, #0x0
	add r2, r6, #0x0
	mov r3, #0x0
	bl SetUpScriptContextForMap
	add r0, r4, #0x0
	pop {r4-r6, pc}
	nop
_02038EE4: .word sNumScriptCmds
_02038EE8: .word gScriptCmdTable

	thumb_func_start SetUpScriptContextForMap
SetUpScriptContextForMap: ; 0x02038EEC
	push {r4-r6, lr}
	add r4, r1, #0x0
	add r3, r4, #0x0
	add r5, r0, #0x0
	add r3, #0x80
	str r5, [r3, #0x0]
	bl LoadScriptsAndMessagesByMapId
	add r6, r0, #0x0
	ldr r1, [r4, #0x7c]
	add r0, r4, #0x0
	bl SetupBytecodeScript
	add r0, r4, #0x0
	add r1, r6, #0x0
	bl ScriptRunByIndex
	ldr r1, [r5, #0x10]
	add r0, r4, #0x0
	bl sub_02038B6C
	pop {r4-r6, pc}

	thumb_func_start LoadScriptsAndMessagesByMapId
LoadScriptsAndMessagesByMapId: ; 0x02038F18
	push {r3-r5, lr}
	ldr r3, _02039210 ; =0x0000283C
	add r4, r2, #0x0
	cmp r4, r3
	blo _02038F36
	mov r3, #0x1f
	ldr r2, _02039214 ; =0x000003D1
	lsl r3, r3, #0x4
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039210 ; =0x0000283C
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038F36:
	add r2, r3, #0x0
	sub r2, #0x64
	cmp r4, r2
	blo _02038F52
	ldr r2, _02039218 ; =0x00000175
	add r3, r2, #0x0
	sub r3, #0x29
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _0203921C ; =0x000027D8
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038F52:
	add r2, r3, #0x0
	sub r2, #0x96
	cmp r4, r2
	blo _02038F6C
	ldr r2, _02039220 ; =0x00000412
	ldr r3, _02039224 ; =0x00000232
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039228 ; =0x000027A6
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038F6C:
	sub r3, #0xc8
	cmp r4, r3
	blo _02038F84
	ldr r2, _0203922C ; =0x00000411
	ldr r3, _02039230 ; =0x00000233
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039234 ; =0x00002774
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038F84:
	ldr r3, _02039238 ; =0x00002710
	cmp r4, r3
	blo _02038F9E
	ldr r2, _0203923C ; =0x00000177
	add r3, r2, #0x0
	sub r3, #0x29
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039238 ; =0x00002710
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038F9E:
	add r2, r3, #0x0
	sub r2, #0x32
	cmp r4, r2
	blo _02038FBC
	mov r2, #0x5e
	lsl r2, r2, #0x2
	add r3, r2, #0x0
	sub r3, #0x29
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039240 ; =0x000026DE
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038FBC:
	add r2, r3, #0x0
	sub r2, #0x64
	cmp r4, r2
	blo _02038FD6
	ldr r2, _02039244 ; =0x0000016D
	mov r3, #0xc7
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039248 ; =0x000026AC
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038FD6:
	add r2, r3, #0x0
	sub r2, #0xc8
	cmp r4, r2
	blo _02038FF0
	mov r2, #0xce
	mov r3, #0xcb
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _0203924C ; =0x00002648
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02038FF0:
	ldr r5, _02039250 ; =0x000025E4
	cmp r4, r5
	blo _0203900A
	ldr r2, _02039254 ; =0x00000183
	add r3, r2, #0x0
	sub r3, #0x9
	bl LoadScriptsAndMessagesParameterized
	add r0, r5, #0x0
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_0203900A:
	add r2, r5, #0x0
	sub r2, #0x64
	cmp r4, r2
	blo _02039026
	ldr r2, _02039258 ; =0x00000179
	mov r3, #0xc7
	bl LoadScriptsAndMessagesParameterized
	add r0, r5, #0x0
	sub r0, #0x64
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02039026:
	sub r5, #0xc8
	cmp r4, r5
	blo _02039042
	mov r2, #0x1d
	lsl r2, r2, #0x4
	add r3, r2, #0x0
	add r3, #0x1c
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _0203925C ; =0x0000251C
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02039042:
	ldr r5, _02039260 ; =0x000024B8
	cmp r4, r5
	blo _0203905C
	ldr r2, _02039264 ; =0x00000187
	add r3, r2, #0x0
	sub r3, #0xa
	bl LoadScriptsAndMessagesParameterized
	add r0, r5, #0x0
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_0203905C:
	add r2, r5, #0x0
	sub r2, #0x64
	cmp r4, r2
	blo _0203907C
	mov r2, #0x5d
	lsl r2, r2, #0x2
	add r3, r2, #0x0
	sub r3, #0x2b
	bl LoadScriptsAndMessagesParameterized
	add r0, r5, #0x0
	sub r0, #0x64
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_0203907C:
	sub r5, #0xc8
	cmp r4, r5
	blo _02039098
	mov r2, #0x61
	lsl r2, r2, #0x2
	add r3, r2, #0x0
	sub r3, #0x9
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039268 ; =0x000023F0
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02039098:
	ldr r2, _0203926C ; =0x0000238C
	cmp r4, r2
	blo _020390B0
	mov r2, #0x0
	mov r3, #0x9
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _0203926C ; =0x0000238C
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020390B0:
	add r5, r2, #0x0
	sub r5, #0x64
	cmp r4, r5
	blo _020390CA
	mov r2, #0xcf
	add r3, r2, #0x0
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039270 ; =0x00002328
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020390CA:
	add r5, r2, #0x0
	sub r5, #0x82
	cmp r4, r5
	blo _020390E4
	ldr r2, _02039274 ; =0x00000186
	mov r3, #0x7
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039278 ; =0x0000230A
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020390E4:
	add r5, r2, #0x0
	sub r5, #0x96
	cmp r4, r5
	blo _02039100
	ldr r2, _0203927C ; =0x000001CF
	add r3, r2, #0x0
	add r3, #0x17
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039280 ; =0x000022F6
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02039100:
	sub r2, #0xc8
	cmp r4, r2
	blo _0203911A
	ldr r2, _02039284 ; =0x00000185
	add r3, r2, #0x0
	sub r3, #0x9
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _02039288 ; =0x000022C4
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_0203911A:
	ldr r2, _0203928C ; =0x00002260
	cmp r4, r2
	blo _02039134
	ldr r2, _02039290 ; =0x000001CE
	add r3, r2, #0x0
	add r3, #0x17
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _0203928C ; =0x00002260
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02039134:
	mov r2, #0x7d
	lsl r2, r2, #0x6
	cmp r4, r2
	blo _02039152
	ldr r2, _02039294 ; =0x00000176
	add r3, r2, #0x0
	sub r3, #0x29
	bl LoadScriptsAndMessagesParameterized
	mov r0, #0x7d
	lsl r0, r0, #0x6
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02039152:
	ldr r5, _02039298 ; =0x00001B58
	cmp r4, r5
	blo _0203916C
	ldr r2, _0203929C ; =0x00000172
	add r3, r2, #0x0
	sub r3, #0x2d
	bl LoadScriptsAndMessagesParameterized
	add r0, r5, #0x0
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_0203916C:
	lsr r5, r3, #0x1
	cmp r4, r5
	blo _02039186
	mov r2, #0x41
	lsl r2, r2, #0x4
	mov r3, #0xc7
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _020392A0 ; =0x00001388
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_02039186:
	ldr r5, _020392A4 ; =0x00000BB8
	cmp r4, r5
	blo _020391A0
	mov r2, #0x41
	lsl r2, r2, #0x4
	mov r3, #0xc7
	bl LoadScriptsAndMessagesParameterized
	add r0, r5, #0x0
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020391A0:
	sub r5, #0xc8
	cmp r4, r5
	blo _020391BC
	ldr r2, _020392A8 ; =0x0000017A
	add r3, r2, #0x0
	sub r3, #0x1c
	bl LoadScriptsAndMessagesParameterized
	mov r0, #0xaf
	lsl r0, r0, #0x4
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020391BC:
	lsr r3, r3, #0x2
	cmp r4, r3
	blo _020391D4
	mov r2, #0x1
	mov r3, #0xd
	bl LoadScriptsAndMessagesParameterized
	ldr r0, _020392AC ; =0x000009C4
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020391D4:
	lsr r2, r2, #0x2
	cmp r4, r2
	blo _020391EE
	mov r2, #0xcd
	mov r3, #0xc7
	bl LoadScriptsAndMessagesParameterized
	mov r0, #0x7d
	lsl r0, r0, #0x4
	sub r0, r4, r0
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020391EE:
	cmp r4, #0x1
	blo _020391FE
	bl LoadScriptsAndMessagesForCurrentMap
	sub r0, r4, #0x1
	lsl r0, r0, #0x10
	lsr r4, r0, #0x10
	b _0203920A
_020391FE:
	ldr r2, _020392B0 ; =0x00000171
	add r3, r2, #0x0
	sub r3, #0x34
	bl LoadScriptsAndMessagesParameterized
	mov r4, #0x0
_0203920A:
	add r0, r4, #0x0
	pop {r3-r5, pc}
	nop
_02039210: .word 0x0000283C
_02039214: .word 0x000003D1
_02039218: .word 0x00000175
_0203921C: .word 0x000027D8
_02039220: .word 0x00000412
_02039224: .word 0x00000232
_02039228: .word 0x000027A6
_0203922C: .word 0x00000411
_02039230: .word 0x00000233
_02039234: .word 0x00002774
_02039238: .word 0x00002710
_0203923C: .word 0x00000177
_02039240: .word 0x000026DE
_02039244: .word 0x0000016D
_02039248: .word 0x000026AC
_0203924C: .word 0x00002648
_02039250: .word 0x000025E4
_02039254: .word 0x00000183
_02039258: .word 0x00000179
_0203925C: .word 0x0000251C
_02039260: .word 0x000024B8
_02039264: .word 0x00000187
_02039268: .word 0x000023F0
_0203926C: .word 0x0000238C
_02039270: .word 0x00002328
_02039274: .word 0x00000186
_02039278: .word 0x0000230A
_0203927C: .word 0x000001CF
_02039280: .word 0x000022F6
_02039284: .word 0x00000185
_02039288: .word 0x000022C4
_0203928C: .word 0x00002260
_02039290: .word 0x000001CE
_02039294: .word 0x00000176
_02039298: .word 0x00001B58
_0203929C: .word 0x00000172
_020392A0: .word 0x00001388
_020392A4: .word 0x00000BB8
_020392A8: .word 0x0000017A
_020392AC: .word 0x000009C4
_020392B0: .word 0x00000171

	thumb_func_start LoadScriptsAndMessagesParameterized
LoadScriptsAndMessagesParameterized: ; 0x020392B4
	push {r3-r5, lr}
	add r5, r1, #0x0
	add r1, r2, #0x0
	add r4, r3, #0x0
	mov r0, #0xa
	mov r2, #0xb
	bl AllocAndReadWholeNarcMemberByIdPair
	str r0, [r5, #0x7c]
	mov r0, #0x1
	mov r1, #0x1a
	add r2, r4, #0x0
	mov r3, #0xb
	bl NewMsgDataFromNarc
	str r0, [r5, #0x78]
	pop {r3-r5, pc}
	.balign 4

	thumb_func_start LoadScriptsAndMessagesForCurrentMap
LoadScriptsAndMessagesForCurrentMap: ; 0x020392D8
	push {r3-r5, lr}
	add r5, r0, #0x0
	ldr r0, [r5, #0x1c]
	add r4, r1, #0x0
	ldr r0, [r0, #0x0]
	bl LoadScriptsForCurrentMap
	str r0, [r4, #0x7c]
	ldr r0, [r5, #0x1c]
	ldr r0, [r0, #0x0]
	bl GetCurrentMapMessageBank
	add r2, r0, #0x0
	mov r0, #0x1
	mov r1, #0x1a
	mov r3, #0xb
	bl NewMsgDataFromNarc
	str r0, [r4, #0x78]
	pop {r3-r5, pc}

	thumb_func_start sub_02039300
sub_02039300: ; 0x02039300
	push {r3, lr}
	cmp r1, #0x36
	bls _02039308
	b _02039430
_02039308:
	add r2, r1, r1
	add r2, pc
	ldrh r2, [r2, #0x6]
	lsl r2, r2, #0x10
	asr r2, r2, #0x10
	add pc, r2
_02039314: ; jump table (using 16-bit offset)
	.short _02039382 - _02039314 - 2; case 0
	.short _02039386 - _02039314 - 2; case 1
	.short _0203938A - _02039314 - 2; case 2
	.short _0203938E - _02039314 - 2; case 3
	.short _02039392 - _02039314 - 2; case 4
	.short _02039396 - _02039314 - 2; case 5
	.short _0203939A - _02039314 - 2; case 6
	.short _0203939E - _02039314 - 2; case 7
	.short _020393A2 - _02039314 - 2; case 8
	.short _020393A6 - _02039314 - 2; case 9
	.short _020393AA - _02039314 - 2; case 10
	.short _020393AE - _02039314 - 2; case 11
	.short _020393B2 - _02039314 - 2; case 12
	.short _020393B6 - _02039314 - 2; case 13
	.short _020393BA - _02039314 - 2; case 14
	.short _020393BE - _02039314 - 2; case 15
	.short _020393C2 - _02039314 - 2; case 16
	.short _020393C6 - _02039314 - 2; case 17
	.short _020393CA - _02039314 - 2; case 18
	.short _020393CE - _02039314 - 2; case 19
	.short _020393D2 - _02039314 - 2; case 20
	.short _020393D6 - _02039314 - 2; case 21
	.short _020393DA - _02039314 - 2; case 22
	.short _020393DE - _02039314 - 2; case 23
	.short _020393E2 - _02039314 - 2; case 24
	.short _020393E6 - _02039314 - 2; case 25
	.short _020393EA - _02039314 - 2; case 26
	.short _020393EE - _02039314 - 2; case 27
	.short _020393F2 - _02039314 - 2; case 28
	.short _020393F6 - _02039314 - 2; case 29
	.short _020393FA - _02039314 - 2; case 30
	.short _020393FE - _02039314 - 2; case 31
	.short _02039402 - _02039314 - 2; case 32
	.short _02039406 - _02039314 - 2; case 33
	.short _0203940A - _02039314 - 2; case 34
	.short _0203940E - _02039314 - 2; case 35
	.short _02039412 - _02039314 - 2; case 36
	.short _02039416 - _02039314 - 2; case 37
	.short _0203941A - _02039314 - 2; case 38
	.short _0203941E - _02039314 - 2; case 39
	.short _02039422 - _02039314 - 2; case 40
	.short _02039426 - _02039314 - 2; case 41
	.short _02039426 - _02039314 - 2; case 42
	.short _02039426 - _02039314 - 2; case 43
	.short _02039426 - _02039314 - 2; case 44
	.short _02039426 - _02039314 - 2; case 45
	.short _02039426 - _02039314 - 2; case 46
	.short _02039426 - _02039314 - 2; case 47
	.short _02039426 - _02039314 - 2; case 48
	.short _02039426 - _02039314 - 2; case 49
	.short _02039426 - _02039314 - 2; case 50
	.short _02039426 - _02039314 - 2; case 51
	.short _02039426 - _02039314 - 2; case 52
	.short _02039426 - _02039314 - 2; case 53
	.short _02039426 - _02039314 - 2; case 54
_02039382:
	add r0, #0x10
	pop {r3, pc}
_02039386:
	add r0, #0x14
	pop {r3, pc}
_0203938A:
	add r0, #0x24
	pop {r3, pc}
_0203938E:
	add r0, r0, #0x5
	pop {r3, pc}
_02039392:
	add r0, r0, #0x6
	pop {r3, pc}
_02039396:
	add r0, r0, #0x7
	pop {r3, pc}
_0203939A:
	add r0, #0x8
	pop {r3, pc}
_0203939E:
	add r0, #0x9
	pop {r3, pc}
_020393A2:
	add r0, #0xa
	pop {r3, pc}
_020393A6:
	add r0, #0x28
	pop {r3, pc}
_020393AA:
	add r0, #0x2c
	pop {r3, pc}
_020393AE:
	add r0, #0x30
	pop {r3, pc}
_020393B2:
	add r0, #0x34
	pop {r3, pc}
_020393B6:
	add r0, #0x38
	pop {r3, pc}
_020393BA:
	add r0, #0x3c
	pop {r3, pc}
_020393BE:
	add r0, #0x40
	pop {r3, pc}
_020393C2:
	add r0, #0x44
	pop {r3, pc}
_020393C6:
	add r0, #0x48
	pop {r3, pc}
_020393CA:
	add r0, #0x4c
	pop {r3, pc}
_020393CE:
	add r0, #0xa8
	pop {r3, pc}
_020393D2:
	add r0, #0xac
	pop {r3, pc}
_020393D6:
	add r0, #0xb0
	pop {r3, pc}
_020393DA:
	add r0, #0xb4
	pop {r3, pc}
_020393DE:
	add r0, #0xc
	pop {r3, pc}
_020393E2:
	add r0, #0x50
	pop {r3, pc}
_020393E6:
	add r0, #0x54
	pop {r3, pc}
_020393EA:
	add r0, #0x58
	pop {r3, pc}
_020393EE:
	add r0, #0x5c
	pop {r3, pc}
_020393F2:
	add r0, #0x60
	pop {r3, pc}
_020393F6:
	add r0, #0x64
	pop {r3, pc}
_020393FA:
	add r0, #0x68
	pop {r3, pc}
_020393FE:
	add r0, #0x6c
	pop {r3, pc}
_02039402:
	add r0, #0x70
	pop {r3, pc}
_02039406:
	add r0, #0x74
	pop {r3, pc}
_0203940A:
	add r0, #0x78
	pop {r3, pc}
_0203940E:
	add r0, #0x7c
	pop {r3, pc}
_02039412:
	add r0, #0x80
	pop {r3, pc}
_02039416:
	add r0, #0x84
	pop {r3, pc}
_0203941A:
	add r0, #0xb8
	pop {r3, pc}
_0203941E:
	add r0, #0xc8
	pop {r3, pc}
_02039422:
	add r0, #0xd8
	pop {r3, pc}
_02039426:
	sub r1, #0x29
	add r0, #0x88
	lsl r1, r1, #0x1
	add r0, r0, r1
	pop {r3, pc}
_02039430:
	bl GF_AssertFail
	mov r0, #0x0
	pop {r3, pc}

	thumb_func_start FieldSysGetAttrAddr
FieldSysGetAttrAddr: ; 0x02039438
	push {r3-r5, lr}
	ldr r0, [r0, #0x10]
	add r5, r1, #0x0
	bl TaskManager_GetEnvironment
	add r4, r0, #0x0
	ldr r1, [r4, #0x0]
	ldr r0, _0203945C ; =0x0003643F
	cmp r1, r0
	beq _02039450
	bl GF_AssertFail
_02039450:
	add r0, r4, #0x0
	add r1, r5, #0x0
	bl sub_02039300
	pop {r3-r5, pc}
	nop
_0203945C: .word 0x0003643F

	thumb_func_start sub_02039460
sub_02039460: ; 0x02039460
	push {r3-r5, lr}
	add r5, r0, #0x0
	ldr r0, [r5, #0x10]
	bl TaskManager_GetEnvironment
	add r4, r0, #0x0
	add r0, r5, #0x0
	bl sub_02035068
	cmp r0, #0x1
	bne _0203947C
	ldr r0, _02039480 ; =sub_020351A0
	add r4, #0xa4
	str r0, [r4, #0x0]
_0203947C:
	pop {r3-r5, pc}
	nop
_02039480: .word sub_020351A0 

	thumb_func_start ScriptRunByIndex
ScriptRunByIndex: ; 0x02039484
	push {r4, lr}
	add r4, r0, #0x0
	ldr r2, [r4, #0x8]
	lsl r1, r1, #0x2
	add r1, r2, r1
	str r1, [r4, #0x8]
	bl ScriptReadWord
	ldr r1, [r4, #0x8]
	add r0, r1, r0
	str r0, [r4, #0x8]
	pop {r4, pc}

	thumb_func_start LoadScriptsForCurrentMap
LoadScriptsForCurrentMap: ; 0x0203949C
	push {r3, lr}
	bl MapHeader_GetScriptsBank
	add r1, r0, #0x0
	mov r0, #0xa
	mov r2, #0xb
	bl AllocAndReadWholeNarcMemberByIdPair
	pop {r3, pc}
	.balign 4

	thumb_func_start GetCurrentMapMessageBank
GetCurrentMapMessageBank: ; 0x020394B0
	ldr r3, _020394B4 ; =MapHeader_GetMsgBank
	bx r3
	.balign 4
_020394B4: .word MapHeader_GetMsgBank 

	thumb_func_start GetVarPointer
GetVarPointer: ; 0x020394B8
	push {r3-r5, lr}
	add r5, r0, #0x0
	ldr r0, [r5, #0xc]
	add r4, r1, #0x0
	bl Save_VarsFlags_Get
	mov r1, #0x1
	lsl r1, r1, #0xe
	cmp r4, r1
	bhs _020394D0
	mov r0, #0x0
	pop {r3-r5, pc}
_020394D0:
	lsl r1, r1, #0x1
	cmp r4, r1
	bhs _020394DE
	add r1, r4, #0x0
	bl Save_VarsFlags_GetVarAddr
	pop {r3-r5, pc}
_020394DE:
	ldr r1, _020394EC ; =0x00007FD7
	add r0, r5, #0x0
	sub r1, r4, r1
	bl FieldSysGetAttrAddr
	pop {r3-r5, pc}
	nop
_020394EC: .word 0x00007FD7

	thumb_func_start FieldSystem_VarGet
FieldSystem_VarGet: ; 0x020394F0
	push {r4, lr}
	add r4, r1, #0x0
	bl GetVarPointer
	cmp r0, #0x0
	beq _020394FE
	ldrh r4, [r0, #0x0]
_020394FE:
	add r0, r4, #0x0
	pop {r4, pc}
	.balign 4

	thumb_func_start FieldSystem_VarGetObjectEventGraphicsId
FieldSystem_VarGetObjectEventGraphicsId: ; 0x02039504
	push {r3-r5, lr}
	add r4, r1, #0x0
	add r5, r0, #0x0
	cmp r4, #0x10
	blo _02039512
	bl GF_AssertFail
_02039512:
	ldr r1, _02039524 ; =0x00004020
	add r0, r5, #0x0
	add r1, r4, r1
	lsl r1, r1, #0x10
	lsr r1, r1, #0x10
	bl FieldSystem_VarGet
	pop {r3-r5, pc}
	nop
_02039524: .word 0x00004020

	thumb_func_start FieldSystem_FlagCheck
FieldSystem_FlagCheck: ; 0x02039528
	push {r4, lr}
	ldr r0, [r0, #0xc]
	add r4, r1, #0x0
	bl Save_VarsFlags_Get
	add r1, r4, #0x0
	bl Save_VarsFlags_CheckFlagInArray
	pop {r4, pc}
	.balign 4

	thumb_func_start FieldSystem_FlagSet
FieldSystem_FlagSet: ; 0x0203953C
	push {r4, lr}
	ldr r0, [r0, #0xc]
	add r4, r1, #0x0
	bl Save_VarsFlags_Get
	add r1, r4, #0x0
	bl Save_VarsFlags_SetFlagInArray
	pop {r4, pc}
	.balign 4

	thumb_func_start FlagClear
FlagClear: ; 0x02039550
	push {r4, lr}
	ldr r0, [r0, #0xc]
	add r4, r1, #0x0
	bl Save_VarsFlags_Get
	add r1, r4, #0x0
	bl Save_VarsFlags_ClearFlagInArray
	pop {r4, pc}
	.balign 4

	thumb_func_start ResetTempFlagsAndVars
ResetTempFlagsAndVars: ; 0x02039564
	push {r4, lr}
	ldr r0, [r0, #0xc]
	bl Save_VarsFlags_Get
	mov r1, #0x1
	add r4, r0, #0x0
	bl Save_VarsFlags_GetFlagAddr
	mov r1, #0x0
	strb r1, [r0, #0x0]
	strb r1, [r0, #0x1]
	strb r1, [r0, #0x2]
	strb r1, [r0, #0x3]
	strb r1, [r0, #0x4]
	strb r1, [r0, #0x5]
	strb r1, [r0, #0x6]
	strb r1, [r0, #0x7]
	mov r1, #0x1
	add r0, r4, #0x0
	lsl r1, r1, #0xe
	bl Save_VarsFlags_GetVarAddr
	mov r1, #0x0
	mov r2, #0x40
	bl memset
	pop {r4, pc}
	.balign 4

	thumb_func_start sub_0203959C
sub_0203959C: ; 0x0203959C
	push {r3, lr}
	ldr r0, [r0, #0xc]
	bl Save_VarsFlags_Get
	mov r1, #0xaa
	lsl r1, r1, #0x4
	bl Save_VarsFlags_GetFlagAddr
	mov r2, #0x18
	mov r1, #0x0
_020395B0:
	strb r1, [r0, #0x0]
	add r0, r0, #0x1
	sub r2, r2, #0x1
	bne _020395B0
	pop {r3, pc}
	.balign 4

	thumb_func_start FieldMove_SetArgs
FieldMove_SetArgs: ; 0x020395BC
	push {r3-r7, lr}
	add r4, r1, #0x0
	add r5, r0, #0x0
	mov r1, #0x29
	add r6, r2, #0x0
	add r7, r3, #0x0
	bl FieldSysGetAttrAddr
	strh r4, [r0, #0x0]
	add r0, r5, #0x0
	mov r1, #0x2a
	bl FieldSysGetAttrAddr
	strh r6, [r0, #0x0]
	add r0, r5, #0x0
	mov r1, #0x2b
	bl FieldSysGetAttrAddr
	strh r7, [r0, #0x0]
	add r0, r5, #0x0
	mov r1, #0x2c
	bl FieldSysGetAttrAddr
	add r1, sp, #0x8
	ldrh r1, [r1, #0x10]
	strh r1, [r0, #0x0]
	pop {r3-r7, pc}
	.balign 4

	thumb_func_start sub_020395F4
sub_020395F4: ; 0x020395F4
	ldr r1, _02039610 ; =0x00001388
	cmp r0, r1
	bhs _02039604
	ldr r1, _02039614 ; =0x00000BB7
	sub r0, r0, r1
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	bx lr
_02039604:
	sub r1, r1, #0x1
	sub r0, r0, r1
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	bx lr
	nop
_02039610: .word 0x00001388
_02039614: .word 0x00000BB7

	thumb_func_start sub_02039618
sub_02039618: ; 0x02039618
	ldr r1, _02039628 ; =0x00001388
	cmp r0, r1
	blo _02039622
	mov r0, #0x1
	bx lr
_02039622:
	mov r0, #0x0
	bx lr
	nop
_02039628: .word 0x00001388

	thumb_func_start TrainerIsDoubleBattle
TrainerIsDoubleBattle: ; 0x0203962C
	push {r3, lr}
	mov r1, #0x9
	bl TrainerData_GetAttr
	cmp r0, #0x0
	beq _0203963C
	mov r0, #0x1
	pop {r3, pc}
_0203963C:
	mov r0, #0x0
	pop {r3, pc}

	thumb_func_start TrainerFieldSystem_FlagCheck
TrainerFieldSystem_FlagCheck: ; 0x02039640
	push {r4, lr}
	ldr r0, [r0, #0xc]
	add r4, r1, #0x0
	bl Save_VarsFlags_Get
	mov r1, #0x55
	lsl r1, r1, #0x4
	add r1, r4, r1
	lsl r1, r1, #0x10
	lsr r1, r1, #0x10
	bl Save_VarsFlags_CheckFlagInArray
	pop {r4, pc}
	.balign 4

	thumb_func_start TrainerFieldSystem_FlagSet
TrainerFieldSystem_FlagSet: ; 0x0203965C
	push {r4, lr}
	ldr r0, [r0, #0xc]
	add r4, r1, #0x0
	bl Save_VarsFlags_Get
	mov r1, #0x55
	lsl r1, r1, #0x4
	add r1, r4, r1
	lsl r1, r1, #0x10
	lsr r1, r1, #0x10
	bl Save_VarsFlags_SetFlagInArray
	pop {r4, pc}
	.balign 4

	thumb_func_start TrainerFlagClear
TrainerFlagClear: ; 0x02039678
	push {r4, lr}
	ldr r0, [r0, #0xc]
	add r4, r1, #0x0
	bl Save_VarsFlags_Get
	mov r1, #0x55
	lsl r1, r1, #0x4
	add r1, r4, r1
	lsl r1, r1, #0x10
	lsr r1, r1, #0x10
	bl Save_VarsFlags_ClearFlagInArray
	pop {r4, pc}
	.balign 4

	thumb_func_start sub_02039694
sub_02039694: ; 0x02039694
	ldr r1, _020396A0 ; =0x00001C66
	sub r0, r0, r1
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	bx lr
	nop
_020396A0: .word 0x00001C66

	thumb_func_start sub_020396A4
sub_020396A4: ; 0x020396A4
	mov r1, #0x7d
	lsl r1, r1, #0x6
	sub r0, r0, r1
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	bx lr

	thumb_func_start sub_020396B0
sub_020396B0: ; 0x020396B0
	push {r4, lr}
	ldr r4, _020396E4 ; =UNK_020F2DB4
	bl sub_020396A4
	lsl r0, r0, #0x18
	lsr r3, r0, #0x18
	mov r1, #0x0
	add r2, r4, #0x0
_020396C0:
	ldrh r0, [r2, #0x6]
	cmp r3, r0
	beq _020396CE
	add r1, r1, #0x1
	add r2, #0x8
	cmp r1, #0xe5
	blo _020396C0
_020396CE:
	cmp r1, #0xe5
	blo _020396DA
	bl GF_AssertFail
	mov r0, #0x0
	pop {r4, pc}
_020396DA:
	lsl r0, r1, #0x3
	add r0, r4, r0
	ldrb r0, [r0, #0x3]
	pop {r4, pc}
	nop
_020396E4: .word UNK_020F2DB4

	thumb_func_start sub_020396E8
sub_020396E8: ; 0x020396E8
	push {r3-r7, lr}
	add r5, r1, #0x0
	add r4, r0, #0x0
	mov r1, #0x29
	bl sub_02039300
	add r7, r0, #0x0
	add r0, r4, #0x0
	mov r1, #0x2a
	bl sub_02039300
	add r6, r0, #0x0
	add r0, r4, #0x0
	mov r1, #0x2b
	bl sub_02039300
	add r4, r0, #0x0
	add r0, r5, #0x0
	bl sub_020396A4
	lsl r0, r0, #0x18
	ldr r2, _02039750 ; =UNK_020F2DB4
	lsr r3, r0, #0x18
	mov r1, #0x0
_02039718:
	ldrh r0, [r2, #0x6]
	cmp r3, r0
	beq _02039726
	add r1, r1, #0x1
	add r2, #0x8
	cmp r1, #0xe5
	blo _02039718
_02039726:
	cmp r1, #0xe5
	blo _02039732
	bl GF_AssertFail
	mov r0, #0x0
	pop {r3-r7, pc}
_02039732:
	lsl r0, r1, #0x3
	ldr r1, _02039750 ; =UNK_020F2DB4
	ldrh r1, [r1, r0]
	strh r1, [r7, #0x0]
	ldr r1, _02039750 ; =UNK_020F2DB4
	add r0, r1, r0
	ldrb r0, [r0, #0x2]
	strh r0, [r6, #0x0]
	add r0, r5, #0x0
	bl sub_02039694
	strh r0, [r4, #0x0]
	mov r0, #0x1
	pop {r3-r7, pc}
	nop
_02039750: .word UNK_020F2DB4

	thumb_func_start sub_02039754
sub_02039754: ; 0x02039754
	push {r4-r7, lr}
	sub sp, #0x24
	str r0, [sp, #0x0]
	add r4, r1, #0x0
	mov r6, #0x0
	bl sub_02034AF8
	add r5, r0, #0x0
	add r2, r5, #0x1
	mov r1, #0x6
	add r0, r4, #0x0
	mul r1, r2
	bl AllocFromHeap
	str r0, [sp, #0x1c]
	cmp r5, #0x0
	bne _02039786
	mov r2, #0xff
	add r1, r0, #0x0
	strb r2, [r1, #0x4]
	ldr r2, _02039870 ; =0x0000FFFF
	add sp, #0x24
	strh r2, [r1, #0x0]
	strh r2, [r1, #0x2]
	pop {r4-r7, pc}
_02039786:
	ldr r0, [sp, #0x0]
	bl sub_02034AF0
	add r4, r0, #0x0
	bne _020397A0
	ldr r0, [sp, #0x1c]
	mov r1, #0xff
	strb r1, [r0, #0x4]
	ldr r1, _02039870 ; =0x0000FFFF
	add sp, #0x24
	strh r1, [r0, #0x0]
	strh r1, [r0, #0x2]
	pop {r4-r7, pc}
_020397A0:
	ldr r0, [sp, #0x0]
	ldr r0, [r0, #0x38]
	bl GetPlayerXCoord
	str r0, [sp, #0x18]
	ldr r0, [sp, #0x0]
	ldr r0, [r0, #0x38]
	bl GetPlayerZCoord
	str r0, [sp, #0x14]
	ldr r0, [sp, #0x18]
	sub r0, r0, #0x7
	str r0, [sp, #0x10]
	ldr r0, [sp, #0x18]
	add r0, r0, #0x7
	str r0, [sp, #0xc]
	ldr r0, [sp, #0x14]
	sub r0, r0, #0x7
	str r0, [sp, #0x8]
	ldr r0, [sp, #0x14]
	add r0, r0, #0x6
	str r0, [sp, #0x4]
	ldr r0, [sp, #0x10]
	cmp r0, #0x0
	bge _020397D6
	add r0, r6, #0x0
	str r0, [sp, #0x10]
_020397D6:
	ldr r0, [sp, #0x8]
	cmp r0, #0x0
	bge _020397E0
	mov r0, #0x0
	str r0, [sp, #0x8]
_020397E0:
	add r0, r5, #0x1
	mov r7, #0x0
	str r0, [sp, #0x20]
	cmp r0, #0x0
	ble _02039856
	ldr r5, [sp, #0x1c]
_020397EC:
	ldrh r0, [r4, #0x2]
	cmp r0, #0x2
	bne _0203984C
	ldrh r0, [r4, #0x0]
	bl sub_02039694
	add r1, r0, #0x0
	ldr r0, [sp, #0x0]
	bl FieldSystem_FlagCheck
	cmp r0, #0x0
	bne _0203984C
	ldr r1, [r4, #0x4]
	ldr r0, [sp, #0x10]
	cmp r1, r0
	blt _0203984C
	ldr r0, [sp, #0xc]
	cmp r1, r0
	bgt _0203984C
	ldr r1, [r4, #0x8]
	ldr r0, [sp, #0x8]
	cmp r1, r0
	blt _0203984C
	ldr r0, [sp, #0x4]
	cmp r1, r0
	bgt _0203984C
	ldrh r0, [r4, #0x0]
	bl sub_020396B0
	strb r0, [r5, #0x4]
	ldr r1, [r4, #0x4]
	ldr r0, [sp, #0x18]
	sub r1, r0, r1
	mov r0, #0x7
	sub r0, r0, r1
	bl abs
	strh r0, [r5, #0x0]
	ldr r1, [r4, #0x8]
	ldr r0, [sp, #0x14]
	sub r1, r0, r1
	mov r0, #0x7
	sub r0, r0, r1
	bl abs
	strh r0, [r5, #0x2]
	add r5, r5, #0x6
	add r6, r6, #0x1
_0203984C:
	ldr r0, [sp, #0x20]
	add r7, r7, #0x1
	add r4, #0x14
	cmp r7, r0
	blt _020397EC
_02039856:
	mov r0, #0x6
	add r3, r6, #0x0
	mul r3, r0
	ldr r0, [sp, #0x1c]
	mov r1, #0xff
	add r2, r0, r3
	strb r1, [r2, #0x4]
	ldr r1, _02039870 ; =0x0000FFFF
	strh r1, [r0, r3]
	strh r1, [r2, #0x2]
	add sp, #0x24
	pop {r4-r7, pc}
	nop
_02039870: .word 0x0000FFFF

	thumb_func_start RunPokemonCenterScriptsInNewContext
RunPokemonCenterScriptsInNewContext: ; 0x02039874
	ldr r3, _0203987C ; =RunScriptInNewContext
	mov r1, #0x96
	lsl r1, r1, #0x6
	bx r3
	.balign 4
_0203987C: .word RunScriptInNewContext

	thumb_func_start RunScriptInNewContext
RunScriptInNewContext: ; 0x02039880
	push {r4, lr}
	bl CreateScriptContext
	add r4, r0, #0x0
_02039888:
	add r0, r4, #0x0
	bl RunScriptCommand
	cmp r0, #0x1
	beq _02039888
	add r0, r4, #0x0
	bl DeleteScriptContext
	pop {r4, pc}
	.balign 4

	thumb_func_start sub_0203989C
sub_0203989C: ; 0x0203989C
	push {r3-r5, lr}
	add r5, r0, #0x0
	add r4, r1, #0x0
	bl sub_02034D2C
	add r1, r0, #0x0
	bne _020398AE
	mov r0, #0x0
	pop {r3-r5, pc}
_020398AE:
	cmp r4, #0x1
	bne _020398BC
	add r0, r5, #0x0
	add r2, r4, #0x0
	bl sub_02039914
	b _020398C2
_020398BC:
	add r1, r4, #0x0
	bl _020398EC
_020398C2:
	add r1, r0, #0x0
	ldr r0, _020398E8 ; =0x0000FFFF
	cmp r1, r0
	bne _020398CE
	mov r0, #0x0
	pop {r3-r5, pc}
_020398CE:
	cmp r4, #0x1
	bne _020398DC
	add r0, r5, #0x0
	mov r2, #0x0
	bl sub_02038C78
	b _020398E2
_020398DC:
	add r0, r5, #0x0
	bl RunScriptInNewContext
_020398E2:
	mov r0, #0x1
	pop {r3-r5, pc}
	nop
_020398E8: .word 0x0000FFFF
_020398EC:
	ldrb r2, [r0, #0x0]
	cmp r2, #0x0
	bne _020398F6
	ldr r0, _02039910 ; =0x0000FFFF
	bx lr
_020398F6:
	cmp r2, r1
	bne _02039908
	ldrb r1, [r0, #0x1]
	ldrb r0, [r0, #0x2]
	lsl r0, r0, #0x8
	add r0, r1, r0
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	bx lr
_02039908:
	add r0, r0, #0x5
	b _020398EC
_0203990C: ; 0x0203990C
	bx lr
	nop
_02039910: .word 0x0000FFFF

	thumb_func_start sub_02039914
sub_02039914: ; 0x02039914
	push {r3-r7, lr}
	add r5, r0, #0x0
	add r4, r1, #0x0
_0203991A:
	ldrb r0, [r4, #0x0]
	cmp r0, #0x0
	bne _02039924
	ldr r0, _0203999C ; =0x0000FFFF
	pop {r3-r7, pc}
_02039924:
	cmp r0, r2
	bne _02039940
	ldrb r0, [r4, #0x4]
	ldrb r2, [r4, #0x2]
	ldrb r3, [r4, #0x1]
	lsl r1, r0, #0x18
	ldrb r0, [r4, #0x3]
	lsl r2, r2, #0x8
	add r2, r3, r2
	lsl r0, r0, #0x10
	add r0, r0, r2
	add r1, r1, r0
	add r0, r4, #0x5
	b _02039944
_02039940:
	add r4, r4, #0x5
	b _0203991A
_02039944:
	cmp r1, #0x0
	bne _0203994C
	ldr r0, _0203999C ; =0x0000FFFF
	pop {r3-r7, pc}
_0203994C:
	add r4, r0, r1
_0203994E:
	ldrb r1, [r4, #0x0]
	cmp r1, #0x0
	bne _02039958
	ldr r0, _0203999C ; =0x0000FFFF
	pop {r3-r7, pc}
_02039958:
	ldrb r0, [r4, #0x1]
	lsl r0, r0, #0x8
	add r0, r1, r0
	lsl r0, r0, #0x10
	lsr r1, r0, #0x10
	bne _02039968
	ldr r0, _0203999C ; =0x0000FFFF
	pop {r3-r7, pc}
_02039968:
	ldrb r0, [r4, #0x3]
	ldrb r2, [r4, #0x2]
	lsl r0, r0, #0x8
	add r0, r2, r0
	lsl r0, r0, #0x10
	lsr r6, r0, #0x10
	add r0, r5, #0x0
	bl FieldSystem_VarGet
	add r7, r0, #0x0
	add r0, r5, #0x0
	add r1, r6, #0x0
	bl FieldSystem_VarGet
	cmp r7, r0
	bne _02039996
	ldrb r0, [r4, #0x5]
	ldrb r1, [r4, #0x4]
	lsl r0, r0, #0x8
	add r0, r1, r0
	lsl r0, r0, #0x10
	lsr r0, r0, #0x10
	pop {r3-r7, pc}
_02039996:
	add r4, r4, #0x6
	b _0203994E
	pop {r3-r7, pc}
	.balign 4
_0203999C: .word 0x0000FFFF
