/* Generated by libdrgn/build-aux/gen_arch_inc_strswitch.py. */

enum {
	DRGN_REGISTER_NUMBER__r13,
	DRGN_REGISTER_NUMBER__r14,
	DRGN_REGISTER_NUMBER__r4,
	DRGN_REGISTER_NUMBER__r5,
	DRGN_REGISTER_NUMBER__r6,
	DRGN_REGISTER_NUMBER__r7,
	DRGN_REGISTER_NUMBER__r8,
	DRGN_REGISTER_NUMBER__r9,
	DRGN_REGISTER_NUMBER__r10,
	DRGN_REGISTER_NUMBER__r11,
	DRGN_REGISTER_NUMBER__r0,
	DRGN_REGISTER_NUMBER__r1,
	DRGN_REGISTER_NUMBER__r2,
	DRGN_REGISTER_NUMBER__r3,
	DRGN_REGISTER_NUMBER__r12,
	DRGN_REGISTER_NUMBER__r15,
	DRGN_REGISTER_NUMBER__cpsr,
};

struct drgn_arch_register_layout {
	char r13[4];
	char r14[4];
	char r4[4];
	char r5[4];
	char r6[4];
	char r7[4];
	char r8[4];
	char r9[4];
	char r10[4];
	char r11[4];
	char r0[4];
	char r1[4];
	char r2[4];
	char r3[4];
	char r12[4];
	char r15[4];
	char cpsr[4];
};

static const struct drgn_register_layout register_layout[] = {
	{ offsetof(struct drgn_arch_register_layout, r13), 4 },
	{ offsetof(struct drgn_arch_register_layout, r14), 4 },
	{ offsetof(struct drgn_arch_register_layout, r4), 4 },
	{ offsetof(struct drgn_arch_register_layout, r5), 4 },
	{ offsetof(struct drgn_arch_register_layout, r6), 4 },
	{ offsetof(struct drgn_arch_register_layout, r7), 4 },
	{ offsetof(struct drgn_arch_register_layout, r8), 4 },
	{ offsetof(struct drgn_arch_register_layout, r9), 4 },
	{ offsetof(struct drgn_arch_register_layout, r10), 4 },
	{ offsetof(struct drgn_arch_register_layout, r11), 4 },
	{ offsetof(struct drgn_arch_register_layout, r0), 4 },
	{ offsetof(struct drgn_arch_register_layout, r1), 4 },
	{ offsetof(struct drgn_arch_register_layout, r2), 4 },
	{ offsetof(struct drgn_arch_register_layout, r3), 4 },
	{ offsetof(struct drgn_arch_register_layout, r12), 4 },
	{ offsetof(struct drgn_arch_register_layout, r15), 4 },
	{ offsetof(struct drgn_arch_register_layout, cpsr), 4 },
};

static drgn_register_number dwarf_regno_to_internal(uint64_t dwarf_regno)
{
	switch (dwarf_regno) {
	case 13:
		return DRGN_REGISTER_NUMBER__r13;
	case 14:
		return DRGN_REGISTER_NUMBER__r14;
	case 4:
		return DRGN_REGISTER_NUMBER__r4;
	case 5:
		return DRGN_REGISTER_NUMBER__r5;
	case 6:
		return DRGN_REGISTER_NUMBER__r6;
	case 7:
		return DRGN_REGISTER_NUMBER__r7;
	case 8:
		return DRGN_REGISTER_NUMBER__r8;
	case 9:
		return DRGN_REGISTER_NUMBER__r9;
	case 10:
		return DRGN_REGISTER_NUMBER__r10;
	case 11:
		return DRGN_REGISTER_NUMBER__r11;
	case 0:
		return DRGN_REGISTER_NUMBER__r0;
	case 1:
		return DRGN_REGISTER_NUMBER__r1;
	case 2:
		return DRGN_REGISTER_NUMBER__r2;
	case 3:
		return DRGN_REGISTER_NUMBER__r3;
	case 12:
		return DRGN_REGISTER_NUMBER__r12;
	case 15:
		return DRGN_REGISTER_NUMBER__r15;
	default:
		return DRGN_REGISTER_NUMBER_UNKNOWN;
	}
}

static const struct drgn_register registers[] = {
	{
		.names = (const char * const []){
			"r0",
			"a1",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r0,
	},
	{
		.names = (const char * const []){
			"r1",
			"a2",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r1,
	},
	{
		.names = (const char * const []){
			"r2",
			"a3",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r2,
	},
	{
		.names = (const char * const []){
			"r3",
			"a4",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r3,
	},
	{
		.names = (const char * const []){
			"r4",
			"v1",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r4,
	},
	{
		.names = (const char * const []){
			"r5",
			"v2",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r5,
	},
	{
		.names = (const char * const []){
			"r6",
			"v3",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r6,
	},
	{
		.names = (const char * const []){
			"r7",
			"v4",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r7,
	},
	{
		.names = (const char * const []){
			"r8",
			"v5",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r8,
	},
	{
		.names = (const char * const []){
			"r9",
			"v6",
			"sb",
		},
		.num_names = 3,
		.regno = DRGN_REGISTER_NUMBER__r9,
	},
	{
		.names = (const char * const []){
			"r10",
			"v7",
			"sl",
		},
		.num_names = 3,
		.regno = DRGN_REGISTER_NUMBER__r10,
	},
	{
		.names = (const char * const []){
			"r11",
			"v8",
			"fp",
		},
		.num_names = 3,
		.regno = DRGN_REGISTER_NUMBER__r11,
	},
	{
		.names = (const char * const []){
			"r12",
			"ip",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r12,
	},
	{
		.names = (const char * const []){
			"r13",
			"sp",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r13,
	},
	{
		.names = (const char * const []){
			"r14",
			"lr",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r14,
	},
	{
		.names = (const char * const []){
			"r15",
			"pc",
		},
		.num_names = 2,
		.regno = DRGN_REGISTER_NUMBER__r15,
	},
};

static const struct drgn_register *register_by_name(const char *name)
{
	/* Generated by libdrgn/build-aux/gen_strswitch.py. */
	switch (1) {
	default: {
		#define strswitch0_args(str) \
			const char *strswitch0_str = (str);
		strswitch0_args(
	            name
		)
		#undef strswitch0_args
		if (strswitch0_str[0] == 'a') {
			if (strswitch0_str[1] == '1') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case1:
		return &registers[0];
					goto strswitch0_case2;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '2') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case3:
		return &registers[1];
					goto strswitch0_case4;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '3') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case5:
		return &registers[2];
					goto strswitch0_case6;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '4') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case7:
		return &registers[3];
					goto strswitch0_case8;
				} else {
					goto strswitch0_default;
				}
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'f') {
			if (strswitch0_str[1] == 'p' && strswitch0_str[2] == '\0') {
				strswitch0_case26:
		return &registers[11];
				goto strswitch0_case27;
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'i') {
			if (strswitch0_str[1] == 'p' && strswitch0_str[2] == '\0') {
				strswitch0_case28:
		return &registers[12];
				goto strswitch0_case29;
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'l') {
			if (strswitch0_str[1] == 'r' && strswitch0_str[2] == '\0') {
				strswitch0_case32:
		return &registers[14];
				goto strswitch0_case33;
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'p') {
			if (strswitch0_str[1] == 'c' && strswitch0_str[2] == '\0') {
				strswitch0_case34:
		return &registers[15];
				goto strswitch0_default;
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'r') {
			if (strswitch0_str[1] == '0') {
				if (strswitch0_str[2] == '\0') {
		return &registers[0];
					goto strswitch0_case1;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '1') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case2:
		return &registers[1];
					goto strswitch0_case3;
				} else if (strswitch0_str[2] == '0') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case21:
		return &registers[10];
						goto strswitch0_case22;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '1') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case24:
		return &registers[11];
						goto strswitch0_case25;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '2') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case27:
		return &registers[12];
						goto strswitch0_case28;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '3') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case29:
		return &registers[13];
						goto strswitch0_case30;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '4') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case31:
		return &registers[14];
						goto strswitch0_case32;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '5') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case33:
		return &registers[15];
						goto strswitch0_case34;
					} else {
						goto strswitch0_default;
					}
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '2') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case4:
		return &registers[2];
					goto strswitch0_case5;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '3') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case6:
		return &registers[3];
					goto strswitch0_case7;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '4') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case8:
		return &registers[4];
					goto strswitch0_case9;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '5') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case10:
		return &registers[5];
					goto strswitch0_case11;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '6') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case12:
		return &registers[6];
					goto strswitch0_case13;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '7') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case14:
		return &registers[7];
					goto strswitch0_case15;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '8') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case16:
		return &registers[8];
					goto strswitch0_case17;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '9') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case18:
		return &registers[9];
					goto strswitch0_case19;
				} else {
					goto strswitch0_default;
				}
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 's') {
			if (strswitch0_str[1] == 'b') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case20:
		return &registers[9];
					goto strswitch0_case21;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'l') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case23:
		return &registers[10];
					goto strswitch0_case24;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'p') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case30:
		return &registers[13];
					goto strswitch0_case31;
				} else {
					goto strswitch0_default;
				}
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'v') {
			if (strswitch0_str[1] == '1') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case9:
		return &registers[4];
					goto strswitch0_case10;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '2') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case11:
		return &registers[5];
					goto strswitch0_case12;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '3') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case13:
		return &registers[6];
					goto strswitch0_case14;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '4') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case15:
		return &registers[7];
					goto strswitch0_case16;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '5') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case17:
		return &registers[8];
					goto strswitch0_case18;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '6') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case19:
		return &registers[9];
					goto strswitch0_case20;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '7') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case22:
		return &registers[10];
					goto strswitch0_case23;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '8') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case25:
		return &registers[11];
					goto strswitch0_case26;
				} else {
					goto strswitch0_default;
				}
			} else {
				goto strswitch0_default;
			}
		} else {
			strswitch0_default:
		return NULL;
		}
	}
	}
}

#define DRGN_ARCHITECTURE_REGISTERS \
	.register_layout = register_layout, \
	.dwarf_regno_to_internal = dwarf_regno_to_internal, \
	.registers = registers, \
	.num_registers = 16, \
	.stack_pointer_regno = DRGN_REGISTER_NUMBER__r13, \
	.register_by_name = register_by_name
