+do_pending_endp:
+ // do delayed endp processing to collect switch jumptables
+ if (pending_endp) {
+ if (in_func && !skip_func && wordc >= 2
+ && ((words[0][0] == 'd' && words[0][2] == 0)
+ || (words[1][0] == 'd' && words[1][2] == 0)))
+ {
+ i = 1;
+ if (words[1][0] == 'd' && words[1][2] == 0) {
+ // label
+ if (g_func_pd_cnt >= pd_alloc) {
+ pd_alloc = pd_alloc * 2 + 16;
+ g_func_pd = realloc(g_func_pd,
+ sizeof(g_func_pd[0]) * pd_alloc);
+ my_assert_not(g_func_pd, NULL);
+ }
+ pd = &g_func_pd[g_func_pd_cnt];
+ g_func_pd_cnt++;
+ memset(pd, 0, sizeof(*pd));
+ strcpy(pd->label, words[0]);
+ pd->type = OPT_CONST;
+ pd->lmod = lmod_from_directive(words[1]);
+ i = 2;
+ }
+ else {
+ lmod = lmod_from_directive(words[0]);
+ if (lmod != pd->lmod)
+ aerr("lmod change? %d->%d\n", pd->lmod, lmod);
+ }
+
+ if (pd->count_alloc < pd->count + wordc) {
+ pd->count_alloc = pd->count_alloc * 2 + 14 + wordc;
+ pd->d = realloc(pd->d, sizeof(pd->d[0]) * pd->count_alloc);
+ my_assert_not(pd->d, NULL);
+ }
+ for (; i < wordc; i++) {
+ if (IS(words[i], "offset")) {
+ pd->type = OPT_OFFSET;
+ i++;
+ }
+ p = strchr(words[i], ',');
+ if (p != NULL)
+ *p = 0;
+ if (pd->type == OPT_OFFSET)
+ pd->d[pd->count].u.label = strdup(words[i]);
+ else
+ pd->d[pd->count].u.val = parse_number(words[i]);
+ pd->d[pd->count].bt_i = -1;
+ pd->count++;
+ }
+ continue;
+ }
+
+ if (in_func && !skip_func)
+ gen_func(fout, g_fhdr, g_func, pi);
+
+ pending_endp = 0;
+ in_func = 0;
+ g_ida_func_attr = 0;
+ skip_warned = 0;
+ skip_func = 0;
+ g_func[0] = 0;
+ if (pi != 0) {
+ memset(&ops, 0, pi * sizeof(ops[0]));
+ memset(g_labels, 0, pi * sizeof(g_labels[0]));
+ pi = 0;
+ }
+ g_eqcnt = 0;
+ for (i = 0; i < g_func_pd_cnt; i++) {
+ pd = &g_func_pd[i];
+ if (pd->type == OPT_OFFSET) {
+ for (j = 0; j < pd->count; j++)
+ free(pd->d[j].u.label);
+ }
+ free(pd->d);
+ pd->d = NULL;
+ }
+ g_func_pd_cnt = 0;
+ pd = NULL;
+ if (wordc == 0)
+ continue;
+ }
+