// File: /workspace/github_c_makefile_star2_O0/nimble-code[P]Modex/Src/xtract.c
// Function: do_ccode
char *
do_ccode(int lno)
{	char *tag, *p, *lst = "";
	int i = 0, nn, mm;

	if (strncmp(OutBuf, "C: ", strlen("C: ")) == 0)
	{	i = strlen("C: ");
		tag = "c_expr { ";

		if (strstr(OutBuf, ND_CHOICE)
		||  strcmp(&OutBuf[i], "1") == 0)
		{	p = "true";
			goto sc;
		}
	} else if (strncmp(OutBuf, "case ", strlen("case ")) == 0)
	{	i = strlen("case ");
		tag = "c_expr { ";

		if (strstr(OutBuf, ND_CHOICE))
		{	p = "true";
			goto sc;
		}
	} else if (strncmp(OutBuf, "R: ", 3) == 0)
	{	p = "goto Return";

		if (strlen(OutBuf) > strlen("R: return"))
		{	if (extended)
			{	char *z, more[4096];

				for (z = &OutBuf[strlen("R: return")]; *z; z++)
				{	if (*z == ' ' || *z == '\t')
						continue;
					else
						break;
				}
				/*
				   if there are multiple instantiations of this proctype/function,
				   then we want to make sure that the return value that is
				   written into a global temporary var cannot change until it is
				   picked up by the caller -- so we use a lck_fctname_ret that the
				   caller resets to zero when the value has been retrieved.
				   assumes there is only one possible return value of type long
				   should instead:
					find the var reference - determine its type and
					declare the global res_%s accordingly
				 */
				sprintf(more, "\tatomic { !lck_p_%s_ret -> lck_p_%s_ret = 1 };\n\t",
					fct_name, fct_name);
				vis_direct(more);
				if (strlen(z) > 0)
				{
#if 0
					sprintf(more, "c_code { now.res_p_%s = (long) %s; }; ",
						fct_name, z);
#else
					sprintf(more, "c_code { now.res_p_%s = (%s) %s; }; ",
						fct_name, fct_type, z);
#endif
					vis_direct(more);
				}
			} else if (!show_deps && Warnings)
			{	fprintf(stderr, "%s: line %3d, warning, args on"
					" return not preserved: ", progname, lno);
				fprintf(stderr, " %s\n", rm_decor(OutBuf));
			}
			extra_comment = 1;
		}
		goto sc;
	} else  if (OutBuf[1] == ':' && OutBuf[2] == ' '
		&& (OutBuf[0] == 'A' || OutBuf[0] == 'F'))
	{	i = strlen("A: ");

		if (strncmp(&OutBuf[i], "assert(", strlen("assert(")) == 0
		&&   strcmp(&OutBuf[strlen(OutBuf)-1], ")") == 0)
		{	int nx = strlen(OutBuf)-1;
			OutBuf[nx] = '\0';
			mm =  strlen("F: assert(");
			nn =  strlen("c_code [] { ; };") + strlen(&OutBuf[mm]) + 1;
			p = (char *) e_malloc(nn * sizeof(char));
			sprintf(p, "c_code [%s] { ; }", &OutBuf[mm]);

			OutBuf[nx] = ')';
			goto sc;
		}

		if (strncmp(&OutBuf[i], "printf(", strlen("printf(")) == 0)
		{	nn =  strlen(&OutBuf[i]) + 1 + strlen("c_code { P") + strlen(" } ");
			p = (char *) e_malloc(nn * sizeof(char));
			sprintf(p, "c_code { P%s;", &OutBuf[i+1]);	/* map to Printf */
			strcat(p, " }");
			/* fprintf(stderr, "p length %d nn %d, p=%s\n", strlen(p), nn, p); */
			goto sc;
		}
		goto same;
	} else if (strncmp(OutBuf, "D: ", 3) == 0)
	{	p = "comment"; /* no locals in c_code fragments */
		goto sc;
	} else
	{	i = 0;
same:		if (strlen(PreBuf) > 0)
		{	tag = (char *) e_malloc(strlen("c_code [] { ")+strlen(PreBuf)+1);
			sprintf(tag, "c_code [%s] { ", PreBuf);
		} else
			tag = "c_code { ";
		lst = ";";
	}
	p = form_c_tag(tag, i, lst);
sc:
	return p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1050, %rsp           # imm = 0x1050
movl %edi, -0x4(%rbp)
leaq 0x22fe9(%rip), %rax     # 0x374be
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
leaq 0x34069(%rip), %rdi     # 0x48550
leaq 0x20d4e(%rip), %rsi     # 0x3523c
movl $0x3, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0x1455c
movl $0x3, -0x24(%rbp)
leaq 0x21985(%rip), %rax     # 0x35e90
movq %rax, -0x10(%rbp)
leaq 0x3403a(%rip), %rdi     # 0x48550
leaq 0x2290d(%rip), %rsi     # 0x36e2a
callq 0x4280
cmpq $0x0, %rax
jne 0x14547
movslq -0x24(%rbp), %rax
leaq 0x3401d(%rip), %rdi     # 0x48550
addq %rax, %rdi
leaq 0x20176(%rip), %rsi     # 0x346b3
callq 0x4180
cmpl $0x0, %eax
jne 0x14557
leaq 0x20cf2(%rip), %rax     # 0x35240
movq %rax, -0x18(%rbp)
jmp 0x149b6
jmp 0x149a2
leaq 0x33fed(%rip), %rdi     # 0x48550
leaq 0x20cbe(%rip), %rsi     # 0x35228
movl $0x5, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0x145b9
movl $0x5, -0x24(%rbp)
leaq 0x21909(%rip), %rax     # 0x35e90
movq %rax, -0x10(%rbp)
leaq 0x33fbe(%rip), %rdi     # 0x48550
leaq 0x22891(%rip), %rsi     # 0x36e2a
callq 0x4280
cmpq $0x0, %rax
je 0x145b4
leaq 0x20c95(%rip), %rax     # 0x35240
movq %rax, -0x18(%rbp)
jmp 0x149b6
jmp 0x149a0
leaq 0x33f90(%rip), %rdi     # 0x48550
leaq 0x21826(%rip), %rsi     # 0x35ded
movl $0x3, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0x1473f
leaq 0x218b9(%rip), %rax     # 0x35e9a
movq %rax, -0x18(%rbp)
leaq 0x33f64(%rip), %rdi     # 0x48550
callq 0x40f0
cmpq $0x9, %rax
jbe 0x1473a
leaq 0x33862(%rip), %rax     # 0x47e64
cmpl $0x0, (%rax)
je 0x146bc
leaq 0x33f3e(%rip), %rax     # 0x48550
addq $0x9, %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpb $0x0, (%rax)
je 0x1464d
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x1463b
movq -0x38(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x9, %eax
jne 0x1463d
jmp 0x1463f
jmp 0x1464d
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x1461a
leaq -0x1040(%rbp), %rdi
leaq 0x2184b(%rip), %rsi     # 0x35ea6
leaq 0x30cfe(%rip), %rcx     # 0x45360
movq %rcx, %rdx
movb $0x0, %al
callq 0x4260
leaq -0x1040(%rbp), %rdi
callq 0x10b40
movq -0x38(%rbp), %rdi
callq 0x40f0
cmpq $0x0, %rax
jbe 0x146ba
leaq -0x1040(%rbp), %rdi
movq -0x38(%rbp), %r8
leaq 0x2183e(%rip), %rsi     # 0x35ed7
leaq 0x30cc0(%rip), %rdx     # 0x45360
leaq 0x31249(%rip), %rcx     # 0x458f0
movb $0x0, %al
callq 0x4260
leaq -0x1040(%rbp), %rdi
callq 0x10b40
jmp 0x14730
leaq 0x3357d(%rip), %rax     # 0x47c40
cmpl $0x0, (%rax)
jne 0x1472e
leaq 0x33581(%rip), %rax     # 0x47c50
cmpl $0x0, (%rax)
je 0x1472e
movq 0x3091d(%rip), %rax     # 0x44ff8
movq (%rax), %rdi
leaq 0x30a8b(%rip), %rax     # 0x45170
movq (%rax), %rdx
movl -0x4(%rbp), %ecx
leaq 0x2180a(%rip), %rsi     # 0x35efc
movb $0x0, %al
callq 0x4190
movq 0x308f8(%rip), %rax     # 0x44ff8
movq (%rax), %rax
movq %rax, -0x1050(%rbp)
leaq 0x33e3f(%rip), %rdi     # 0x48550
callq 0xc930
movq -0x1050(%rbp), %rdi
movq %rax, %rdx
leaq 0x1ea6e(%rip), %rsi     # 0x33195
movb $0x0, %al
callq 0x4190
jmp 0x14730
movl $0x1, 0x39566(%rip)     # 0x4dca0
jmp 0x149b6
movsbl 0x33e0b(%rip), %eax     # 0x48551
cmpl $0x3a, %eax
jne 0x14904
movsbl 0x33dfc(%rip), %eax     # 0x48552
cmpl $0x20, %eax
jne 0x14904
movsbl 0x33dea(%rip), %eax     # 0x48550
cmpl $0x41, %eax
je 0x1477b
movsbl 0x33dde(%rip), %eax     # 0x48550
cmpl $0x46, %eax
jne 0x14904
movl $0x3, -0x24(%rbp)
movslq -0x24(%rbp), %rax
leaq 0x33dc3(%rip), %rdi     # 0x48550
addq %rax, %rdi
leaq 0x2238f(%rip), %rsi     # 0x36b26
movl $0x7, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0x14870
leaq 0x33d9f(%rip), %rdi     # 0x48550
callq 0x40f0
subq $0x1, %rax
leaq 0x33d8f(%rip), %rdi     # 0x48550
addq %rax, %rdi
leaq 0x2131e(%rip), %rsi     # 0x35ae9
callq 0x4180
cmpl $0x0, %eax
jne 0x14870
leaq 0x33d70(%rip), %rdi     # 0x48550
callq 0x40f0
subq $0x1, %rax
movl %eax, -0x1044(%rbp)
movslq -0x1044(%rbp), %rcx
leaq 0x33d53(%rip), %rax     # 0x48550
movb $0x0, (%rax,%rcx)
movl $0xa, -0x2c(%rbp)
movslq -0x2c(%rbp), %rax
leaq 0x33d3d(%rip), %rdi     # 0x48550
addq %rax, %rdi
callq 0x40f0
addq $0x10, %rax
addq $0x1, %rax
movl %eax, -0x28(%rbp)
movslq -0x28(%rbp), %rax
shlq $0x0, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x2c(%rbp), %rax
leaq 0x33d08(%rip), %rdx     # 0x48550
addq %rax, %rdx
leaq 0x216e0(%rip), %rsi     # 0x35f32
movb $0x0, %al
callq 0x4260
movslq -0x1044(%rbp), %rcx
leaq 0x33ce9(%rip), %rax     # 0x48550
movb $0x29, (%rax,%rcx)
jmp 0x149b6
movslq -0x24(%rbp), %rax
leaq 0x33cd5(%rip), %rdi     # 0x48550
addq %rax, %rdi
leaq 0x216bf(%rip), %rsi     # 0x35f44
movl $0x7, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0x14902
movslq -0x24(%rbp), %rax
leaq 0x33cb1(%rip), %rdi     # 0x48550
addq %rax, %rdi
callq 0x40f0
addq $0x1, %rax
addq $0xa, %rax
addq $0x3, %rax
movl %eax, -0x28(%rbp)
movslq -0x28(%rbp), %rax
shlq $0x0, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
movl -0x24(%rbp), %eax
addl $0x1, %eax
cltq
leaq 0x33c74(%rip), %rdx     # 0x48550
addq %rax, %rdx
leaq 0x21666(%rip), %rsi     # 0x35f4c
movb $0x0, %al
callq 0x4260
movq -0x18(%rbp), %rdi
leaq 0x21206(%rip), %rsi     # 0x35afe
callq 0x4250
jmp 0x149b6
jmp 0x14938
leaq 0x33c45(%rip), %rdi     # 0x48550
leaq 0x22b94(%rip), %rsi     # 0x374a6
movl $0x3, %edx
callq 0x4090
cmpl $0x0, %eax
jne 0x14931
leaq 0x26186(%rip), %rax     # 0x3aaae
movq %rax, -0x18(%rbp)
jmp 0x149b6
movl $0x0, -0x24(%rbp)
leaq 0x39371(%rip), %rdi     # 0x4dcb0
callq 0x40f0
cmpq $0x0, %rax
jbe 0x14984
leaq 0x3935f(%rip), %rdi     # 0x4dcb0
callq 0x40f0
addq $0xc, %rax
addq $0x1, %rax
movl %eax, %edi
callq 0x4a70
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0x215e6(%rip), %rsi     # 0x35f5a
leaq 0x39335(%rip), %rdx     # 0x4dcb0
movb $0x0, %al
callq 0x4260
jmp 0x1498f
leaq 0x215de(%rip), %rax     # 0x35f69
movq %rax, -0x10(%rbp)
leaq 0x22b0d(%rip), %rax     # 0x374a3
movq %rax, -0x20(%rbp)
jmp 0x1499c
jmp 0x1499e
jmp 0x149a0
jmp 0x149a2
movq -0x10(%rbp), %rdi
movl -0x24(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x14280
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
addq $0x1050, %rsp           # imm = 0x1050
popq %rbp
retq
nopw %cs:(%rax,%rax)