// File: /workspace/github_c_makefile_star2_O1/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 0x829f
movq %rsi, %rbx
movq %rdi, %r14
movq 0x28(%rsi), %rsi
callq 0x7feb
movl (%rbx), %eax
cmpl $0x7, %eax
je 0x81f3
cmpl $0x6, %eax
je 0x8160
cmpl $0x5, %eax
jne 0x8211
cmpq $0x0, 0xd30c(%rip)      # 0x15348
je 0x82bb
movq 0x28(%rbx), %rax
testq %rax, %rax
je 0x806a
movq 0x28(%rax), %rcx
testq %rcx, %rcx
je 0x806a
cmpl $0x2, (%rax)
jne 0x806a
cmpl $0x23, 0x4(%rax)
jne 0x806a
movl $0x1, %r12d
cmpl $0x2, (%rcx)
je 0x8094
movq 0x20(%rbx), %rcx
xorl %r12d, %r12d
testq %rcx, %rcx
je 0x8094
movq 0x20(%rcx), %rax
testq %rax, %rax
je 0x8094
cmpl $0x2, (%rcx)
jne 0x8094
cmpl $0x23, 0x4(%rcx)
jne 0x8094
xorl %r12d, %r12d
cmpl $0x2, (%rax)
sete %r12b
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8342
movq %rax, %r14
movq %rbx, -0x30(%rbp)
xorl %eax, %eax
testl %r12d, %r12d
setne %al
movq (%r14,%rax,8), %r15
testq %r15, %r15
je 0x810e
movl $0x1, %r13d
xorl %r12d, %r12d
testl %r12d, %r12d
je 0x80c9
movl 0x10(%r15), %r13d
movl (%r15), %edi
movl 0x4(%r15), %esi
movq 0x8(%r15), %rdx
movl %r13d, %ecx
movl $0x1, %r8d
callq 0x83cd
movq 0x18(%r15), %rbx
testq %rbx, %rbx
je 0x8100
movq 0xd266(%rip), %rdi      # 0x15358
movq (%rbx), %rsi
callq 0x6ad9
movq 0x8(%rbx), %rbx
jmp 0x80e6
incl %r12d
movq 0x28(%r15), %r15
testq %r15, %r15
jne 0x80c0
jmp 0x8111
xorl %r12d, %r12d
movq -0x30(%rbp), %rbx
movq 0x8(%rbx), %rdi
leaq 0x6a86(%rip), %rsi      # 0xeba6
callq 0x4140
testl %eax, %eax
jne 0x829f
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x829f
movl $0x2, %edi
movl $0x2c, %esi
leaq 0x744d(%rip), %rdx      # 0xf598
movl $0x1, %ecx
movl $0x1, %r8d
callq 0x83cd
jmp 0x80a6
cmpq $0x0, 0xd1e0(%rip)      # 0x15348
je 0x82b1
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8342
movq %rax, %r14
leaq -0x1030(%rbp), %r15
movw $0x22, (%r15)
leaq 0x6a16(%rip), %r12      # 0xeba6
movq 0x8(%r14), %r13
testq %r13, %r13
je 0x81b6
movq 0x8(%r14), %rsi
movq %r13, %rdi
callq 0x8494
movq %r15, %rdi
movq %rax, %rsi
callq 0x41a0
movq 0x28(%r13), %r13
jmp 0x8194
movq 0x8(%rbx), %rdi
movq %r12, %rsi
callq 0x4140
testl %eax, %eax
jne 0x8271
movq 0x10(%r14), %r14
testq %r14, %r14
je 0x8271
movq %r15, %rdi
callq 0x40a0
movw $0x202c, -0x1030(%rbp,%rax) # imm = 0x202C
movb $0x0, -0x102e(%rbp,%rax)
jmp 0x8190
movq 0x8(%rbx), %rdx
leaq 0x6dde(%rip), %rsi      # 0xefdc
leaq -0x1030(%rbp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x41b0
jmp 0x828a
cmpl $0x0, 0xc0c8(%rip)      # 0x142e0
je 0x8249
leaq 0x6dbf(%rip), %rdi      # 0xefe0
callq 0x7f44
movq 0x9da3(%rip), %rax      # 0x11fd0
movq (%rax), %rsi
movq %rbx, %rdi
callq 0x60a2
movl 0x10(%rbx), %esi
leaq 0x6dab(%rip), %rdi      # 0xefed
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 0x83cd
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 0x83cd
addq $0x1008, %rsp           # imm = 0x1008
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, %rdi
callq 0x45a1
jmp 0x829f
movq %rbx, %rdi
callq 0x45d2
jmp 0x829f