// File: /workspace/github_c_makefile_star2_O2/nimble-code[P]gh_cpp/Src/gh_cpp1.c
// Function: do_define
static void
do_define(TS *s)
{	int i, j = 0;

	if (s->tok != NAME)
		fatal_error("expect name after #define");

	if (misra_rules
	&&  BlockDepth > 0)
		m_rule(19, 5, "#define within block scope");

	newmacro(s->name);

	s = s->nxt;

	sfa = (ARGS *) 0;
	if (s && s->tok == CHAR && s->val == '(' && s->space == 0)
		s = do_params(s->nxt);	/* puts formal par list in sfa */

	ca = sfa;	/* this is where scan_args and closemacro look for it */
	for (j = 0; s; j++, s?s = s->nxt:s)	/* body of define */
	{	white = (j>0)?s->space:0;
		switch (s->tok) {
		case NAME:
			i = scan_args(s->name);
			addbody(i >= 0 ? ARG: NAME, 0);
			cb->name = s->name;
			cb->val = (i >= 0)? i : 0;

			if (misra_rules && i > 0
			&&  not_braced(s))
				m_rule(19, 10, "formal param not enclosed in ()");

			break;
		case VAL:
			addbody(VAL, s->val);
			break;
		case ECHAR:
			addbody(ECHAR, s->val);
			break;
		case CHAR:
			if (s->val == '#')
			{	do_stringarg(s->nxt, s->space);
				s = s->nxt;
			} else
				addbody(CHAR, s->val);
			break;
		default:
			fatal_error("cannot happen");
	}	}

	white = 0;
	closemacro();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpl $0x1, (%rdi)
jne 0x6229
movq %rdi, %rbx
cmpl $0x0, 0xbfe3(%rip)      # 0x11e94
je 0x5ece
cmpl $0x0, 0xd456(%rip)      # 0x13310
jle 0x5ece
leaq 0x7c6c(%rip), %rdx      # 0xdb2f
pushq $0x13
popq %rdi
pushq $0x5
popq %rsi
callq 0x9bc0
movq 0x8(%rbx), %rdi
callq 0x63e6
movq 0x28(%rbx), %rax
andq $0x0, 0xd43d(%rip)      # 0x13320
xorl %ebx, %ebx
testq %rax, %rax
je 0x5f03
cmpl $0x2, (%rax)
jne 0x5eff
cmpl $0x28, 0x4(%rax)
jne 0x5eff
cmpl $0x0, 0x10(%rax)
je 0x6140
xorl %ecx, %ecx
jmp 0x5f07
xorl %ecx, %ecx
xorl %eax, %eax
movq %rcx, 0xd41a(%rip)      # 0x13328
leaq 0x41fb(%rip), %r15      # 0xa110
xorl %r12d, %r12d
testq %rax, %rax
je 0x6126
movq %rax, %r13
testl %r12d, %r12d
je 0x5f2f
movl 0x10(%r13), %eax
jmp 0x5f31
xorl %eax, %eax
movl %eax, 0xbf61(%rip)      # 0x11e98
movl (%r13), %eax
decl %eax
cmpl $0x3, %eax
ja 0x6205
movslq (%r15,%rax,4), %rax
addq %r15, %rax
jmpq *%rax
movq 0x8(%r13), %rdi
callq 0x6460
movl %eax, %r14d
xorl %eax, %eax
testl %r14d, %r14d
setns %al
leal 0x1(,%rax,4), %edi
xorl %esi, %esi
callq 0x64dd
movq 0x8(%r13), %rax
movq 0xd3b4(%rip), %rcx      # 0x13330
movq %rax, 0x8(%rcx)
testl %r14d, %r14d
cmovsl %ebx, %r14d
movl %r14d, 0x4(%rcx)
jle 0x6094
cmpl $0x0, 0xbefc(%rip)      # 0x11e94
je 0x6094
movq 0x20(%r13), %rcx
testq %rcx, %rcx
je 0x5ff0
movq 0x28(%r13), %rax
testq %rax, %rax
je 0x5ff0
cmpl $0x2, (%rcx)
jne 0x5ff0
movl 0x4(%rcx), %ecx
cmpl $0x28, %ecx
je 0x5fc2
cmpl $0x23, %ecx
jne 0x5ff0
cmpl $0x2, (%rax)
jne 0x5ff0
movl 0x4(%rax), %ecx
cmpl $0x29, %ecx
je 0x6094
cmpl $0x23, %ecx
jne 0x5ff0
movq 0x28(%rax), %rax
testq %rax, %rax
je 0x5ff0
cmpl $0x2, (%rax)
jne 0x5ff0
cmpl $0x23, 0x4(%rax)
je 0x6094
pushq $0x13
popq %rdi
pushq $0xa
popq %rsi
leaq 0x7b4d(%rip), %rdx      # 0xdb4a
callq 0x9bc0
jmp 0x6094
movl 0x4(%r13), %esi
pushq $0x3
jmp 0x608e
movl 0x4(%r13), %esi
pushq $0x4
jmp 0x608e
movl 0x4(%r13), %esi
cmpl $0x23, %esi
jne 0x608c
movq 0x28(%r13), %rbx
testq %rbx, %rbx
je 0x60a0
movl 0x10(%r13), %eax
movl %eax, 0xbe65(%rip)      # 0x11e98
movl (%rbx), %eax
decl %eax
cmpl $0x3, %eax
ja 0x6205
leaq 0x40d9(%rip), %rcx      # 0xa120
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x8(%rbx), %rdi
callq 0x6460
movl %eax, %r14d
xorl %edi, %edi
testl %eax, %eax
setns %dil
movl $0x0, %eax
cmovsl %eax, %r14d
xorl $0x7, %edi
xorl %esi, %esi
callq 0x64dd
movq 0x8(%rbx), %rax
movq 0xd2ae(%rip), %rcx      # 0x13330
movq %rax, 0x8(%rcx)
movl %r14d, 0x4(%rcx)
jmp 0x6103
pushq $0x2
popq %rdi
callq 0x64dd
incl %r12d
movq 0x28(%r13), %rax
jmp 0x5f18
pushq $0x2
popq %rdi
pushq $0x23
popq %rsi
callq 0x64dd
jmp 0x610a
pushq $0x2
popq %rdi
pushq $0x23
popq %rsi
callq 0x64dd
andl $0x0, 0xbdd9(%rip)      # 0x11e98
movl 0x4(%rbx), %esi
pushq $0x3
jmp 0x60dd
pushq $0x2
popq %rdi
pushq $0x23
popq %rsi
callq 0x64dd
andl $0x0, 0xbdc0(%rip)      # 0x11e98
movl 0x4(%rbx), %esi
pushq $0x4
popq %rdi
jmp 0x60fe
pushq $0x2
popq %r14
movl %r14d, %edi
pushq $0x23
popq %rsi
callq 0x64dd
movl 0x10(%rbx), %eax
movl %eax, 0xbda0(%rip)      # 0x11e98
movl 0x4(%rbx), %esi
movl %r14d, %edi
callq 0x64dd
andl $0x0, 0xbd8e(%rip)      # 0x11e98
xorl %ebx, %ebx
movq 0x28(%r13), %r13
incl %r12d
movl $0x0, %eax
testq %r13, %r13
jne 0x6097
jmp 0x5f18
andl $0x0, 0xbd6b(%rip)      # 0x11e98
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6518
movq 0x28(%rax), %r12
testq %r12, %r12
je 0x6235
movl (%r12), %eax
cmpl $0x2, %eax
jne 0x6165
cmpl $0x29, 0x4(%r12)
jne 0x6165
xorl %ecx, %ecx
jmp 0x61fb
pushq $0x10
popq %rbx
cmpl $0x1, %eax
jne 0x621d
movq 0x8(%r12), %r15
movq 0xd1ab(%rip), %r13      # 0x13328
movl %ebx, %edi
callq 0x4348
movq %rax, %r14
movq %r15, %rdi
callq 0x40a0
leal 0x1(%rax), %edi
callq 0x4348
movq %rax, (%r14)
movq %rax, %rdi
movq %r15, %rsi
callq 0x4070
testq %r13, %r13
je 0x61ae
movq %r14, 0x8(%r13)
movq %r14, 0xd173(%rip)      # 0x13328
movq 0xd164(%rip), %rcx      # 0x13320
testq %rcx, %rcx
jne 0x61cb
movq %r14, 0xd158(%rip)      # 0x13320
movq %r14, %rcx
movq 0x28(%r12), %r12
testq %r12, %r12
je 0x6211
cmpl $0x2, (%r12)
jne 0x6211
movl 0x4(%r12), %eax
cmpl $0x2c, %eax
jne 0x61f4
movq 0x28(%r12), %r12
movl (%r12), %eax
jmp 0x6168
cmpl $0x29, %eax
jne 0x6211
xorl %ebx, %ebx
movq 0x28(%r12), %rax
jmp 0x5f07
leaq 0x795e(%rip), %rdi      # 0xdb6a
callq 0x42ec
leaq 0x7974(%rip), %rdi      # 0xdb8c
callq 0x42ec
leaq 0x7954(%rip), %rdi      # 0xdb78
callq 0x42ec
leaq 0x78e5(%rip), %rdi      # 0xdb15
callq 0x42ec
leaq 0x7954(%rip), %rdi      # 0xdb90
callq 0x42ec