// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]gh_cpp/Src/gh_cpp1.c
// Function: do_if_pre
static void
do_if_pre(TS *s)	/* replace occurrences of "defined()" */
{	TS *d, *b, *n;
	int bracketed;

	for (d = s; d; d = d->nxt)
	{	bracketed = 0;
		if (d->tok == NAME
		&&  strcmp(d->name, "defined") == 0)
		{	b = d->nxt;
			if (!b) fatal_error("syntax of defined, missing name");

			if (b->tok == CHAR
			&&  b->val == '(')
			{	b = b->nxt;	/* the name */
				if (!b
				||  b->nxt->tok != CHAR
				||  b->nxt->val != ')')
				{	if (misra_rules) m_rule(19, 14, "malformed defined");
					fatal_error("missing ')' after defined(..");
				}
				bracketed = 1;
			}

			if (b->tok != NAME)
			{	if (misra_rules) m_rule(19, 14, "malformed defined");
				fatal_error("missing name after defined");
			}
			n = new_inl(VAL);
			n->val = (is_macro(b->name))?1:0;
			n->space = d->space;

			if (n->val) add_tag(n, is_macro(b->name));

			if (bracketed)
			{	b = b->nxt;	/* skip to ')' */
				if (!b) fatal_error("syntax of defined, missing ')'");
			}
			n->prv = d->prv;
			n->nxt = b->nxt;

			if (n->prv)
				n->prv->nxt = n;
			if (n->nxt)
				n->nxt->prv = n;

			b->nxt = (TS *) 0;
			release_all(d);

			d = n;
	}	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r15
leaq 0x7e0d(%rip), %rbx      # 0xda78
testq %r15, %r15
je 0x5d86
cmpl $0x1, (%r15)
jne 0x5c8a
movq 0x8(%r15), %rdi
movq %rbx, %rsi
callq 0x4140
testl %eax, %eax
je 0x5c94
movq %r15, %r12
movq 0x28(%r12), %r15
jmp 0x5c6b
movq 0x28(%r15), %r14
testq %r14, %r14
je 0x5de3
movl (%r14), %ebx
cmpl $0x2, %ebx
jne 0x5cdd
cmpl $0x28, 0x4(%r14)
jne 0x5d95
movq 0x28(%r14), %r14
testq %r14, %r14
je 0x5dbc
movq 0x28(%r14), %rax
cmpl $0x2, (%rax)
jne 0x5dbc
cmpl $0x29, 0x4(%rax)
jne 0x5dbc
movl (%r14), %eax
jmp 0x5cdf
movl %ebx, %eax
cmpl $0x1, %eax
jne 0x5d95
pushq $0x4
popq %rdi
callq 0x5acc
movq %rax, %r12
movq 0x8(%r14), %r13
movq %r13, %rdi
callq 0x6350
xorl %ecx, %ecx
testq %rax, %rax
setne %cl
movl %ecx, 0x4(%r12)
movl 0x10(%r15), %eax
movl %eax, 0x10(%r12)
je 0x5d2a
movq %r13, %rdi
callq 0x6350
movq %r12, %rdi
movq %rax, %rsi
callq 0x6386
cmpl $0x2, %ebx
jne 0x5d44
movq 0x28(%r14), %r14
testq %r14, %r14
leaq 0x7d3b(%rip), %rbx      # 0xda78
jne 0x5d4b
jmp 0x5def
leaq 0x7d2d(%rip), %rbx      # 0xda78
movq 0x20(%r15), %rcx
movq %rcx, 0x20(%r12)
movq 0x28(%r14), %rax
movq %rax, 0x28(%r12)
testq %rcx, %rcx
je 0x5d6b
movq %r12, 0x28(%rcx)
movq 0x28(%r12), %rax
testq %rax, %rax
je 0x5d74
movq %r12, 0x20(%rax)
andq $0x0, 0x28(%r14)
movq %r15, %rdi
callq 0x4e29
jmp 0x5c8d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x0, 0xc0f8(%rip)      # 0x11e94
je 0x5db0
leaq 0x7cc9(%rip), %rdx      # 0xda6e
pushq $0x13
popq %rdi
pushq $0xe
popq %rsi
callq 0x9bc0
leaq 0x7ce6(%rip), %rdi      # 0xda9d
callq 0x42ec
cmpl $0x0, 0xc0d1(%rip)      # 0x11e94
je 0x5dd7
leaq 0x7ca2(%rip), %rdx      # 0xda6e
pushq $0x13
popq %rdi
pushq $0xe
popq %rsi
callq 0x9bc0
leaq 0x7ca2(%rip), %rdi      # 0xda80
callq 0x42ec
leaq 0x7c64(%rip), %rdi      # 0xda4e
callq 0x42ec
leaq 0x7cc2(%rip), %rdi      # 0xdab8
callq 0x42ec