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

enum {
	DRGN_REGISTER_NUMBER__rip,
	DRGN_REGISTER_NUMBER__rsp,
	DRGN_REGISTER_NUMBER__r15,
	DRGN_REGISTER_NUMBER__r14,
	DRGN_REGISTER_NUMBER__r13,
	DRGN_REGISTER_NUMBER__r12,
	DRGN_REGISTER_NUMBER__rbp,
	DRGN_REGISTER_NUMBER__rbx,
	DRGN_REGISTER_NUMBER__r11,
	DRGN_REGISTER_NUMBER__r10,
	DRGN_REGISTER_NUMBER__r9,
	DRGN_REGISTER_NUMBER__r8,
	DRGN_REGISTER_NUMBER__rax,
	DRGN_REGISTER_NUMBER__rcx,
	DRGN_REGISTER_NUMBER__rdx,
	DRGN_REGISTER_NUMBER__rsi,
	DRGN_REGISTER_NUMBER__rdi,
	DRGN_REGISTER_NUMBER__cs,
	DRGN_REGISTER_NUMBER__rflags,
	DRGN_REGISTER_NUMBER__ss,
	DRGN_REGISTER_NUMBER__fs_base,
	DRGN_REGISTER_NUMBER__gs_base,
	DRGN_REGISTER_NUMBER__ds,
	DRGN_REGISTER_NUMBER__es,
	DRGN_REGISTER_NUMBER__fs,
	DRGN_REGISTER_NUMBER__gs,
};

struct drgn_arch_register_layout {
	char rip[8];
	char rsp[8];
	char r15[8];
	char r14[8];
	char r13[8];
	char r12[8];
	char rbp[8];
	char rbx[8];
	char r11[8];
	char r10[8];
	char r9[8];
	char r8[8];
	char rax[8];
	char rcx[8];
	char rdx[8];
	char rsi[8];
	char rdi[8];
	char cs[8];
	char rflags[8];
	char ss[8];
	char fs_base[8];
	char gs_base[8];
	char ds[8];
	char es[8];
	char fs[8];
	char gs[8];
};

static const struct drgn_register_layout register_layout[] = {
	{ offsetof(struct drgn_arch_register_layout, rip), 8 },
	{ offsetof(struct drgn_arch_register_layout, rsp), 8 },
	{ offsetof(struct drgn_arch_register_layout, r15), 8 },
	{ offsetof(struct drgn_arch_register_layout, r14), 8 },
	{ offsetof(struct drgn_arch_register_layout, r13), 8 },
	{ offsetof(struct drgn_arch_register_layout, r12), 8 },
	{ offsetof(struct drgn_arch_register_layout, rbp), 8 },
	{ offsetof(struct drgn_arch_register_layout, rbx), 8 },
	{ offsetof(struct drgn_arch_register_layout, r11), 8 },
	{ offsetof(struct drgn_arch_register_layout, r10), 8 },
	{ offsetof(struct drgn_arch_register_layout, r9), 8 },
	{ offsetof(struct drgn_arch_register_layout, r8), 8 },
	{ offsetof(struct drgn_arch_register_layout, rax), 8 },
	{ offsetof(struct drgn_arch_register_layout, rcx), 8 },
	{ offsetof(struct drgn_arch_register_layout, rdx), 8 },
	{ offsetof(struct drgn_arch_register_layout, rsi), 8 },
	{ offsetof(struct drgn_arch_register_layout, rdi), 8 },
	{ offsetof(struct drgn_arch_register_layout, cs), 8 },
	{ offsetof(struct drgn_arch_register_layout, rflags), 8 },
	{ offsetof(struct drgn_arch_register_layout, ss), 8 },
	{ offsetof(struct drgn_arch_register_layout, fs_base), 8 },
	{ offsetof(struct drgn_arch_register_layout, gs_base), 8 },
	{ offsetof(struct drgn_arch_register_layout, ds), 8 },
	{ offsetof(struct drgn_arch_register_layout, es), 8 },
	{ offsetof(struct drgn_arch_register_layout, fs), 8 },
	{ offsetof(struct drgn_arch_register_layout, gs), 8 },
};

static drgn_register_number dwarf_regno_to_internal(uint64_t dwarf_regno)
{
	switch (dwarf_regno) {
	case 16:
		return DRGN_REGISTER_NUMBER__rip;
	case 7:
		return DRGN_REGISTER_NUMBER__rsp;
	case 15:
		return DRGN_REGISTER_NUMBER__r15;
	case 14:
		return DRGN_REGISTER_NUMBER__r14;
	case 13:
		return DRGN_REGISTER_NUMBER__r13;
	case 12:
		return DRGN_REGISTER_NUMBER__r12;
	case 6:
		return DRGN_REGISTER_NUMBER__rbp;
	case 3:
		return DRGN_REGISTER_NUMBER__rbx;
	case 11:
		return DRGN_REGISTER_NUMBER__r11;
	case 10:
		return DRGN_REGISTER_NUMBER__r10;
	case 9:
		return DRGN_REGISTER_NUMBER__r9;
	case 8:
		return DRGN_REGISTER_NUMBER__r8;
	case 0:
		return DRGN_REGISTER_NUMBER__rax;
	case 2:
		return DRGN_REGISTER_NUMBER__rcx;
	case 1:
		return DRGN_REGISTER_NUMBER__rdx;
	case 4:
		return DRGN_REGISTER_NUMBER__rsi;
	case 5:
		return DRGN_REGISTER_NUMBER__rdi;
	case 51:
		return DRGN_REGISTER_NUMBER__cs;
	case 49:
		return DRGN_REGISTER_NUMBER__rflags;
	case 52:
		return DRGN_REGISTER_NUMBER__ss;
	case 58:
		return DRGN_REGISTER_NUMBER__fs_base;
	case 59:
		return DRGN_REGISTER_NUMBER__gs_base;
	case 53:
		return DRGN_REGISTER_NUMBER__ds;
	case 50:
		return DRGN_REGISTER_NUMBER__es;
	case 54:
		return DRGN_REGISTER_NUMBER__fs;
	case 55:
		return DRGN_REGISTER_NUMBER__gs;
	default:
		return DRGN_REGISTER_NUMBER_UNKNOWN;
	}
}

static const struct drgn_register registers[] = {
	{
		.names = (const char * const []){
			"rax",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rax,
	},
	{
		.names = (const char * const []){
			"rdx",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rdx,
	},
	{
		.names = (const char * const []){
			"rcx",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rcx,
	},
	{
		.names = (const char * const []){
			"rbx",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rbx,
	},
	{
		.names = (const char * const []){
			"rsi",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rsi,
	},
	{
		.names = (const char * const []){
			"rdi",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rdi,
	},
	{
		.names = (const char * const []){
			"rbp",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rbp,
	},
	{
		.names = (const char * const []){
			"rsp",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rsp,
	},
	{
		.names = (const char * const []){
			"r8",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r8,
	},
	{
		.names = (const char * const []){
			"r9",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r9,
	},
	{
		.names = (const char * const []){
			"r10",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r10,
	},
	{
		.names = (const char * const []){
			"r11",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r11,
	},
	{
		.names = (const char * const []){
			"r12",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r12,
	},
	{
		.names = (const char * const []){
			"r13",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r13,
	},
	{
		.names = (const char * const []){
			"r14",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r14,
	},
	{
		.names = (const char * const []){
			"r15",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__r15,
	},
	{
		.names = (const char * const []){
			"rip",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rip,
	},
	{
		.names = (const char * const []){
			"rflags",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__rflags,
	},
	{
		.names = (const char * const []){
			"es",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__es,
	},
	{
		.names = (const char * const []){
			"cs",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__cs,
	},
	{
		.names = (const char * const []){
			"ss",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__ss,
	},
	{
		.names = (const char * const []){
			"ds",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__ds,
	},
	{
		.names = (const char * const []){
			"fs",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__fs,
	},
	{
		.names = (const char * const []){
			"gs",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__gs,
	},
	{
		.names = (const char * const []){
			"fs.base",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__fs_base,
	},
	{
		.names = (const char * const []){
			"gs.base",
		},
		.num_names = 1,
		.regno = DRGN_REGISTER_NUMBER__gs_base,
	},
};

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] == 'c') {
			if (strswitch0_str[1] == 's' && strswitch0_str[2] == '\0') {
				strswitch0_case19:
		return &registers[19];
				goto strswitch0_case20;
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'd') {
			if (strswitch0_str[1] == 's' && strswitch0_str[2] == '\0') {
				strswitch0_case21:
		return &registers[21];
				goto strswitch0_case22;
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'e') {
			if (strswitch0_str[1] == 's' && strswitch0_str[2] == '\0') {
				strswitch0_case18:
		return &registers[18];
				goto strswitch0_case19;
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'f') {
			if (strswitch0_str[1] == 's') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case22:
		return &registers[22];
					goto strswitch0_case23;
				} else if (strswitch0_str[2] == '.') {
					if (strswitch0_str[3] == 'b' && strswitch0_str[4] == 'a' && strswitch0_str[5] == 's' && strswitch0_str[6] == 'e' && strswitch0_str[7] == '\0') {
						strswitch0_case24:
		return &registers[24];
						goto strswitch0_case25;
					} else {
						goto strswitch0_default;
					}
				} else {
					goto strswitch0_default;
				}
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'g') {
			if (strswitch0_str[1] == 's') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case23:
		return &registers[23];
					goto strswitch0_case24;
				} else if (strswitch0_str[2] == '.') {
					if (strswitch0_str[3] == 'b' && strswitch0_str[4] == 'a' && strswitch0_str[5] == 's' && strswitch0_str[6] == 'e' && strswitch0_str[7] == '\0') {
						strswitch0_case25:
		return &registers[25];
						goto strswitch0_default;
					} else {
						goto strswitch0_default;
					}
				} else {
					goto strswitch0_default;
				}
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 'r') {
			if (strswitch0_str[1] == '1') {
				if (strswitch0_str[2] == '0') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case10:
		return &registers[10];
						goto strswitch0_case11;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '1') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case11:
		return &registers[11];
						goto strswitch0_case12;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '2') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case12:
		return &registers[12];
						goto strswitch0_case13;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '3') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case13:
		return &registers[13];
						goto strswitch0_case14;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '4') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case14:
		return &registers[14];
						goto strswitch0_case15;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == '5') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case15:
		return &registers[15];
						goto strswitch0_case16;
					} else {
						goto strswitch0_default;
					}
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '8') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case8:
		return &registers[8];
					goto strswitch0_case9;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == '9') {
				if (strswitch0_str[2] == '\0') {
					strswitch0_case9:
		return &registers[9];
					goto strswitch0_case10;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'a') {
				if (strswitch0_str[2] == 'x' && strswitch0_str[3] == '\0') {
		return &registers[0];
					goto strswitch0_case1;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'b') {
				if (strswitch0_str[2] == 'p') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case6:
		return &registers[6];
						goto strswitch0_case7;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == 'x') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case3:
		return &registers[3];
						goto strswitch0_case4;
					} else {
						goto strswitch0_default;
					}
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'c') {
				if (strswitch0_str[2] == 'x' && strswitch0_str[3] == '\0') {
					strswitch0_case2:
		return &registers[2];
					goto strswitch0_case3;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'd') {
				if (strswitch0_str[2] == 'i') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case5:
		return &registers[5];
						goto strswitch0_case6;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == 'x') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case1:
		return &registers[1];
						goto strswitch0_case2;
					} else {
						goto strswitch0_default;
					}
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'f') {
				if (strswitch0_str[2] == 'l' && strswitch0_str[3] == 'a' && strswitch0_str[4] == 'g' && strswitch0_str[5] == 's' && strswitch0_str[6] == '\0') {
					strswitch0_case17:
		return &registers[17];
					goto strswitch0_case18;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 'i') {
				if (strswitch0_str[2] == 'p' && strswitch0_str[3] == '\0') {
					strswitch0_case16:
		return &registers[16];
					goto strswitch0_case17;
				} else {
					goto strswitch0_default;
				}
			} else if (strswitch0_str[1] == 's') {
				if (strswitch0_str[2] == 'i') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case4:
		return &registers[4];
						goto strswitch0_case5;
					} else {
						goto strswitch0_default;
					}
				} else if (strswitch0_str[2] == 'p') {
					if (strswitch0_str[3] == '\0') {
						strswitch0_case7:
		return &registers[7];
						goto strswitch0_case8;
					} else {
						goto strswitch0_default;
					}
				} else {
					goto strswitch0_default;
				}
			} else {
				goto strswitch0_default;
			}
		} else if (strswitch0_str[0] == 's') {
			if (strswitch0_str[1] == 's' && strswitch0_str[2] == '\0') {
				strswitch0_case20:
		return &registers[20];
				goto strswitch0_case21;
			} 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 = 26, \
	.stack_pointer_regno = DRGN_REGISTER_NUMBER__rsp, \
	.register_by_name = register_by_name
