// File: /workspace/github_c_makefile_star2_O0/fuldaros[P]akb_sources/cc/akb_cc.c
// Function: eval_shell
int eval_shell(char * text)
{
	int i;
	char * ptr;

	ptr = strchr(text, (int)'\n');
	if (!ptr)
		i = strlen(text);
	else
		i = ptr - text;
	ptr  = malloc(i + 1);
	shll = malloc(i + 1);
	opts = malloc(i + 1);
	if (!ptr || !shll || !opts)
		return -1;
	strncpy(ptr, text, i);
	ptr[i] = '\0';

	*opts = '\0';
	i = sscanf(ptr, " #!%s%s %c", shll, opts, opts);
	if (i < 1 || i > 2) {
		fprintf(stderr, "%s: invalid first line in script: %s\n", my_name, ptr);
		return -1;
	}
	free(ptr);

	shll = realloc(shll, strlen(shll) + 1);
	ptr  = strrchr(shll, (int)'/');
	if (*ptr == '/')
		ptr++;
	if (verbose) fprintf(stderr, "%s shll=%s\n", my_name, ptr);

	for(i=0; shellsDB[i].shll; i++) {
		if(!strcmp(ptr, shellsDB[i].shll)) {
			if (!inlo)
				inlo = strdup(shellsDB[i].inlo);
			if (!xecc)
				xecc = strdup(shellsDB[i].xecc);
			if (!lsto)
				lsto = strdup(shellsDB[i].lsto);
		}
	}
	if (!inlo || !xecc || !lsto) {
		fprintf(stderr, "%s Unknown shell (%s): specify [-i][-x][-l]\n", my_name, ptr);
		return -1;
	}
	if (verbose) fprintf(stderr, "%s [-i]=%s\n", my_name, inlo);
	if (verbose) fprintf(stderr, "%s [-x]=%s\n", my_name, xecc);
	if (verbose) fprintf(stderr, "%s [-l]=%s\n", my_name, lsto);

	opts = realloc(opts, strlen(opts) + 1);
	if (*opts && !strcmp(opts, lsto)) {
		fprintf(stderr, "%s opts=%s : Is equal to [-l]. Removing opts\n", my_name, opts);
		*opts = '\0';
	} else if (!strcmp(opts, "-")) {
		fprintf(stderr, "%s opts=%s : No real one. Removing opts\n", my_name, opts);
		*opts = '\0';
	}
	if (verbose) fprintf(stderr, "%s opts=%s\n", my_name, opts);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movl $0xa, %esi
callq 0x40d0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4693
movq -0x10(%rbp), %rdi
callq 0x40b0
movl %eax, -0x14(%rbp)
jmp 0x46a1
movq -0x20(%rbp), %rax
movq -0x10(%rbp), %rcx
subq %rcx, %rax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x4170
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x4170
movq %rax, 0x7858(%rip)      # 0xbf20
movl -0x14(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
callq 0x4170
movq %rax, 0x784b(%rip)      # 0xbf28
cmpq $0x0, -0x20(%rbp)
je 0x46f8
cmpq $0x0, 0x7834(%rip)      # 0xbf20
je 0x46f8
cmpq $0x0, 0x7832(%rip)      # 0xbf28
jne 0x4704
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4ae1
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x4050
movq -0x20(%rbp), %rax
movslq -0x14(%rbp), %rcx
movb $0x0, (%rax,%rcx)
movq 0x7800(%rip), %rax      # 0xbf28
movb $0x0, (%rax)
movq -0x20(%rbp), %rdi
movq 0x77ea(%rip), %rdx      # 0xbf20
movq 0x77eb(%rip), %rcx      # 0xbf28
movq 0x77e4(%rip), %r8       # 0xbf28
leaq 0x2ce8(%rip), %rsi      # 0x7433
movb $0x0, %al
callq 0x4190
movl %eax, -0x14(%rbp)
cmpl $0x1, -0x14(%rbp)
jl 0x4761
cmpl $0x2, -0x14(%rbp)
jle 0x4790
movq 0x6890(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x20(%rbp), %rcx
leaq 0x2cc8(%rip), %rsi      # 0x743e
leaq 0x2ac7(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4ae1
movq -0x20(%rbp), %rdi
callq 0x4040
movq 0x7780(%rip), %rax      # 0xbf20
movq %rax, -0x28(%rbp)
movq 0x7775(%rip), %rdi      # 0xbf20
callq 0x40b0
movq -0x28(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x41b0
movq %rax, 0x7759(%rip)      # 0xbf20
movq 0x7752(%rip), %rdi      # 0xbf20
movl $0x2f, %esi
callq 0x40e0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x47f4
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
cmpl $0x0, 0x7735(%rip)      # 0xbf30
je 0x4820
movq 0x67f4(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x20(%rbp), %rcx
leaq 0x2c52(%rip), %rsi      # 0x7464
leaq 0x2a2b(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
movl $0x0, -0x14(%rbp)
movslq -0x14(%rbp), %rcx
leaq 0x690e(%rip), %rax      # 0xb140
shlq $0x5, %rcx
addq %rcx, %rax
cmpq $0x0, (%rax)
je 0x4900
movq -0x20(%rbp), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x68ee(%rip), %rax      # 0xb140
shlq $0x5, %rcx
addq %rcx, %rax
movq (%rax), %rsi
callq 0x4130
cmpl $0x0, %eax
jne 0x48f0
cmpq $0x0, 0x76c6(%rip)      # 0xbf38
jne 0x4896
movslq -0x14(%rbp), %rcx
leaq 0x68c1(%rip), %rax      # 0xb140
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x4230
movq %rax, 0x76a2(%rip)      # 0xbf38
cmpq $0x0, 0x76a2(%rip)      # 0xbf40
jne 0x48c2
movslq -0x14(%rbp), %rcx
leaq 0x6895(%rip), %rax      # 0xb140
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x18(%rax), %rdi
callq 0x4230
movq %rax, 0x767e(%rip)      # 0xbf40
cmpq $0x0, 0x767e(%rip)      # 0xbf48
jne 0x48ee
movslq -0x14(%rbp), %rcx
leaq 0x6869(%rip), %rax      # 0xb140
shlq $0x5, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x4230
movq %rax, 0x765a(%rip)      # 0xbf48
jmp 0x48f0
jmp 0x48f2
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x4827
cmpq $0x0, 0x7630(%rip)      # 0xbf38
je 0x491e
cmpq $0x0, 0x762e(%rip)      # 0xbf40
je 0x491e
cmpq $0x0, 0x762c(%rip)      # 0xbf48
jne 0x494d
movq 0x66d3(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq -0x20(%rbp), %rcx
leaq 0x2b3d(%rip), %rsi      # 0x7470
leaq 0x290a(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4ae1
cmpl $0x0, 0x75dc(%rip)      # 0xbf30
je 0x497c
movq 0x669b(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x75d1(%rip), %rcx      # 0xbf38
leaq 0x2b2f(%rip), %rsi      # 0x749d
leaq 0x28cf(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
cmpl $0x0, 0x75ad(%rip)      # 0xbf30
je 0x49ab
movq 0x666c(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x75aa(%rip), %rcx      # 0xbf40
leaq 0x2b0c(%rip), %rsi      # 0x74a9
leaq 0x28a0(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
cmpl $0x0, 0x757e(%rip)      # 0xbf30
je 0x49da
movq 0x663d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x7583(%rip), %rcx      # 0xbf48
leaq 0x2ae9(%rip), %rsi      # 0x74b5
leaq 0x2871(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
movq 0x7547(%rip), %rax      # 0xbf28
movq %rax, -0x30(%rbp)
movq 0x753c(%rip), %rdi      # 0xbf28
callq 0x40b0
movq -0x30(%rbp), %rdi
movq %rax, %rsi
addq $0x1, %rsi
callq 0x41b0
movq %rax, 0x7520(%rip)      # 0xbf28
movq 0x7519(%rip), %rax      # 0xbf28
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x4a61
movq 0x750a(%rip), %rdi      # 0xbf28
movq 0x7523(%rip), %rsi      # 0xbf48
callq 0x4130
cmpl $0x0, %eax
jne 0x4a61
movq 0x65c2(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x74e8(%rip), %rcx      # 0xbf28
leaq 0x2a7a(%rip), %rsi      # 0x74c1
leaq 0x27f6(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
movq 0x74cc(%rip), %rax      # 0xbf28
movb $0x0, (%rax)
jmp 0x4aab
movq 0x74c0(%rip), %rdi      # 0xbf28
leaq 0x4956(%rip), %rsi      # 0x93c5
callq 0x4130
cmpl $0x0, %eax
jne 0x4aa9
movq 0x6578(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x749e(%rip), %rcx      # 0xbf28
leaq 0x2a5e(%rip), %rsi      # 0x74ef
leaq 0x27ac(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
movq 0x7482(%rip), %rax      # 0xbf28
movb $0x0, (%rax)
jmp 0x4aab
cmpl $0x0, 0x747e(%rip)      # 0xbf30
je 0x4ada
movq 0x653d(%rip), %rax      # 0xaff8
movq (%rax), %rdi
movq 0x7463(%rip), %rcx      # 0xbf28
leaq 0x2a4c(%rip), %rsi      # 0x7518
leaq 0x2771(%rip), %rdx      # 0x7244
movb $0x0, %al
callq 0x4140
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)