// File: /workspace/github_c_makefile_star2_O3/nimble-code[P]gh_cpp/Src/gh_cpp1.c
// Function: purge_body
static void
purge_body(TS *s, TS *x, MD *m, TS *b)
{	TS *aa;
	ML *ml;
	ARL *ap;	/* actual parameter - could be list */
	int w, original;
	char nm[MAXIN];	/* scratch */

	if (!b) return;

	purge_body(s, x, m, b->nxt);

	switch (b->tok) {
	case ARG:
		if (!saa)
		{	fprintf(stderr, "%s,%d: cannot find argument for %s\n",
				filename, lineno, b->name);
			break;
		}
		original = ((b->nxt
		&&   b->nxt->nxt
		&&   b->nxt->tok == CHAR && b->nxt->val == '#'
		&&   b->nxt->nxt->tok == CHAR && b->nxt->val == '#')
		||  (b->prv
		&&   b->prv->prv
		&&   b->prv->tok == CHAR && b->prv->val == '#'
		&&   b->prv->prv->tok == CHAR && b->prv->val == '#'));

		ap = hunt_param(m, b);

		w = 1;
more1:
		if (original) aa = ap->oal; else aa = ap->al;

		original = 0; /* reuse as counter */
		for ( ; aa; aa = aa->nxt)
		{	if (original) w = aa->space;
			add_inl(aa->tok, aa->val, aa->name, w, 1);
			for (ml = aa->ml; ml; ml = ml->nxt)
				add_tag(lst, ml->m);
			original++;
		}
		if (strcmp(b->name, "__VA_ARGS__") == 0)
		{	ap = ap->nxt;
			if (ap)
			{	add_inl(CHAR, ',', "", 1, 1);
				w = 1;
				goto more1;
		}	}
		break;
	case ARGSTRING:
		if (!saa)
		{	fprintf(stderr, "%s,%d: cannot find arg for %s\n",
				filename, lineno, b->name);
			break;
		}
		ap = hunt_param(m, b);
		strcpy(nm, "\"");
more2:		for (aa = ap->oal; aa; aa = aa->nxt)
			strcat(nm, stringify(aa, ap->oal));

		if (strcmp(b->name, "__VA_ARGS__") == 0)
		{	ap = ap->nxt;
			if (ap)
			{	strcat(nm, ", ");
				goto more2;
		}	}

		strcat(nm, "\"");
		add_inl(NAME, 0, nm, b->space, 0);

		break;
	case PLAINSTRING:
		sprintf(nm, "#%s", b->name);
		add_inl(NAME, 0, nm, b->space, 0);
		break;
	case ECHAR:
	case CHAR:
	default:
		if (debugging)
		{	nested("ADD NORMAL: ");
			tokfull(b, stdout);
			printf(" (space %d)\n", b->space);
		}
		add_inl(b->tok, b->val, b->name, b->space, 1);
		break;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1008, %rsp           # imm = 0x1008
testq %rsi, %rsi
je 0x8297
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rsi), %rsi
callq 0x7fe3
movl (%rbx), %edi
cmpl $0x7, %edi
je 0x81eb
cmpl $0x6, %edi
je 0x8158
cmpl $0x5, %edi
jne 0x8209
cmpq $0x0, 0xd314(%rip)      # 0x15348
je 0x82b3
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x8062
movq 0x28(%rax), %rcx
testq %rcx, %rcx
je 0x8062
cmpl $0x2, (%rax)
jne 0x8062
cmpl $0x23, 0x4(%rax)
jne 0x8062
movl $0x1, %r12d
cmpl $0x2, (%rcx)
je 0x808c
movq 0x20(%rbx), %rcx
xorl %r12d, %r12d
testq %rcx, %rcx
je 0x808c
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x808c
cmpl $0x2, (%rcx)
jne 0x808c
cmpl $0x23, 0x4(%rcx)
jne 0x808c
xorl %r12d, %r12d
cmpl $0x2, (%rax)
sete %r12b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x833a
movq %rax, %r14
movq %rbx, -0x30(%rbp)
xorl %eax, %eax
testl %r12d, %r12d
setne %al
movq (%r14,%rax,8), %r15
testq %r15, %r15
je 0x8106
movl $0x1, %r13d
xorl %r12d, %r12d
testl %r12d, %r12d
je 0x80c1
movl 0x10(%r15), %r13d
movl (%r15), %edi
movl 0x4(%r15), %esi
movq 0x8(%r15), %rdx
movl %r13d, %ecx
movl $0x1, %r8d
callq 0x83c5
movq 0x18(%r15), %rbx
testq %rbx, %rbx
je 0x80f8
movq 0xd26e(%rip), %rdi      # 0x15358
movq (%rbx), %rsi
callq 0x6ac2
movq 0x8(%rbx), %rbx
jmp 0x80de
incl %r12d
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x80b8
jmp 0x8109
xorl %r12d, %r12d
movq -0x30(%rbp), %rbx
movq 0x8(%rbx), %rdi
leaq 0x6a8a(%rip), %rsi      # 0xeba2
callq 0x4140
testl %eax, %eax
jne 0x8297
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x8297
movl $0x2, %edi
movl $0x2c, %esi
leaq 0x7451(%rip), %rdx      # 0xf594
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x83c5
jmp 0x809e
cmpq $0x0, 0xd1e8(%rip)      # 0x15348
je 0x82a9
movq %r14, %rdi
movq %rbx, %rsi
callq 0x833a
movq %rax, %r14
leaq -0x1030(%rbp), %r15
movw $0x22, (%r15)
leaq 0x6a1a(%rip), %r12      # 0xeba2
movq 0x8(%r14), %r13
testq %r13, %r13
je 0x81ae
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0x848c
movq %r15, %rdi
movq %rax, %rsi
callq 0x4190
movq 0x28(%r13), %r13
jmp 0x818c
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x4140
testl %eax, %eax
jne 0x8269
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x8269
movq %r15, %rdi
callq 0x40a0
movw $0x202c, -0x1030(%rbp,%rax) # imm = 0x202C
movb $0x0, -0x102e(%rbp,%rax)
jmp 0x8188
movq 0x8(%rbx), %rdx
leaq 0x6ddf(%rip), %rsi      # 0xefd5
leaq -0x1030(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x41a0
jmp 0x8282
cmpl $0x0, 0xc0d0(%rip)      # 0x142e0
je 0x8243
leaq 0x6dc0(%rip), %rdi      # 0xefd9
callq 0x7f3c
movq 0x9dab(%rip), %rax      # 0x11fd0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x60df
movl 0x10(%rbx), %esi
leaq 0x6dac(%rip), %rdi      # 0xefe6
xorl %eax, %eax
callq 0x40c0
movl (%rbx), %edi
movl 0x4(%rbx), %esi
movq 0x8(%rbx), %rdx
movl 0x10(%rbx), %ecx
movl $0x1, %r8d
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x83c5
leaq -0x1030(%rbp), %r14
movq %r14, %rdi
callq 0x40a0
movw $0x22, -0x1030(%rbp,%rax)
movl 0x10(%rbx), %ecx
movl $0x1, %edi
xorl %esi, %esi
movq %r14, %rdx
xorl %r8d, %r8d
callq 0x83c5
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x4505
jmp 0x8297
movq %rbx, %rdi
callq 0x4536
jmp 0x8297