// File: /workspace/github_c_makefile_star2_O0/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
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x10(%rbp)
movq -0x8(%rbp), %rax
cmpl $0x1, (%rax)
je 0x6d58
leaq 0x9fb1(%rip), %rdi      # 0x10d04
callq 0x42b0
cmpl $0x0, 0xe235(%rip)      # 0x14f94
je 0x6d80
cmpl $0x0, 0xf6a8(%rip)      # 0x16410
jle 0x6d80
movl $0x13, %edi
movl $0x5, %esi
leaq 0x9fa3(%rip), %rdx      # 0x10d1e
callq 0xca50
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7250
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rbp)
movq $0x0, 0xf67c(%rip) # 0x16420
cmpq $0x0, -0x8(%rbp)
je 0x6dd9
movq -0x8(%rbp), %rax
cmpl $0x2, (%rax)
jne 0x6dd9
movq -0x8(%rbp), %rax
cmpl $0x28, 0x4(%rax)
jne 0x6dd9
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
jne 0x6dd9
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x7300
movq %rax, -0x8(%rbp)
movq 0xf640(%rip), %rax      # 0x16420
movq %rax, 0xf641(%rip)      # 0x16428
movl $0x0, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x6f74
cmpl $0x0, -0x10(%rbp)
jle 0x6e0b
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, -0x14(%rbp)
jmp 0x6e12
xorl %eax, %eax
movl %eax, -0x14(%rbp)
jmp 0x6e12
movl -0x14(%rbp), %eax
movl %eax, 0xe17d(%rip)      # 0x14f98
movq -0x8(%rbp), %rax
movl (%rax), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0x20(%rbp)
subl $0x3, %eax
ja 0x6f3f
movq -0x20(%rbp), %rax
leaq 0x6583(%rip), %rcx      # 0xd3c0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x7410
movl %eax, -0xc(%rbp)
movl -0xc(%rbp), %ecx
movl $0x1, %edi
movl $0x5, %eax
cmpl $0x0, %ecx
cmovgel %eax, %edi
xorl %esi, %esi
callq 0x74b0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
movq 0xf5b1(%rip), %rax      # 0x16430
movq %rcx, 0x8(%rax)
cmpl $0x0, -0xc(%rbp)
jl 0x6e91
movl -0xc(%rbp), %eax
movl %eax, -0x24(%rbp)
jmp 0x6e98
xorl %eax, %eax
movl %eax, -0x24(%rbp)
jmp 0x6e98
movl -0x24(%rbp), %ecx
movq 0xf58e(%rip), %rax      # 0x16430
movl %ecx, 0x4(%rax)
cmpl $0x0, 0xe0e8(%rip)      # 0x14f94
je 0x6ed8
cmpl $0x0, -0xc(%rbp)
jle 0x6ed8
movq -0x8(%rbp), %rdi
callq 0x7520
cmpl $0x0, %eax
je 0x6ed8
movl $0x13, %edi
movl $0xa, %esi
leaq 0x9e66(%rip), %rdx      # 0x10d39
callq 0xca50
jmp 0x6f4b
movq -0x8(%rbp), %rax
movl 0x4(%rax), %esi
movl $0x4, %edi
callq 0x74b0
jmp 0x6f4b
movq -0x8(%rbp), %rax
movl 0x4(%rax), %esi
movl $0x3, %edi
callq 0x74b0
jmp 0x6f4b
movq -0x8(%rbp), %rax
cmpl $0x23, 0x4(%rax)
jne 0x6f2c
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x75e0
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x6f3d
movq -0x8(%rbp), %rax
movl 0x4(%rax), %esi
movl $0x2, %edi
callq 0x74b0
jmp 0x6f4b
leaq 0x9e13(%rip), %rdi      # 0x10d59
callq 0x42b0
jmp 0x6f4d
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x6f6b
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x8(%rbp)
jmp 0x6f6f
movq -0x8(%rbp), %rax
jmp 0x6dee
movl $0x0, 0xe01a(%rip)      # 0x14f98
callq 0x7750
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)