// File: /workspace/github_c_makefile_star2_O1/lucvoo[P]sparse-dev/evaluate.c
// Function: evaluate_string
static struct symbol *evaluate_string(struct expression *expr)
{
	struct symbol *sym = alloc_symbol(expr->pos, SYM_NODE);
	struct symbol *array = alloc_symbol(expr->pos, SYM_ARRAY);
	struct expression *addr = alloc_expression(expr->pos, EXPR_SYMBOL);
	struct expression *initstr = alloc_expression(expr->pos, EXPR_STRING);
	unsigned int length = expr->string->length;
	struct symbol *char_type = expr->wide ? wchar_ctype : &char_ctype;

	sym->array_size = alloc_const_expression(expr->pos, length);
	sym->bit_size = length * char_type->bit_size;
	sym->ctype.alignment = 1;
	sym->string = 1;
	sym->ctype.modifiers = MOD_STATIC;
	sym->ctype.base_type = array;
	sym->initializer = initstr;
	sym->examined = 1;
	sym->evaluated = 1;

	initstr->ctype = sym;
	initstr->string = expr->string;

	array->array_size = sym->array_size;
	array->bit_size = sym->bit_size;
	array->ctype.alignment = char_type->ctype.alignment;
	array->ctype.modifiers = MOD_STATIC;
	array->ctype.base_type = char_type;
	array->examined = 1;
	array->evaluated = 1;
	
	addr->symbol = sym;
	addr->ctype = &lazy_ptr_ctype;
	addr->flags = CEF_ADDR;

	expr->type = EXPR_PREOP;
	expr->op = '*';
	expr->unop = addr;  
	expr->ctype = sym;
	return sym;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
movl $0x3, %esi
callq 0x2b547
movq %rax, %r14
movq 0x8(%rbx), %rdi
movl $0x6, %esi
callq 0x2b547
movq %rax, %r15
movq 0x8(%rbx), %r13
xorl %edi, %edi
callq 0x30029
movq %rax, %r12
movl (%rax), %eax
orl $0x3, %eax
movq %r13, 0x8(%r12)
andl $0xffff0003, %eax       # imm = 0xFFFF0003
movl %eax, (%r12)
movq 0x8(%rbx), %rbp
xorl %edi, %edi
callq 0x30029
movq %rax, %r13
movl (%rax), %eax
orl $0x2, %eax
movq %rbp, 0x8(%r13)
andl $0xffff0002, %eax       # imm = 0xFFFF0002
movl %eax, (%r13)
movq 0x8(%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x28(%rbx), %rax
movl (%rax), %ebp
andl $0x7fffffff, %ebp       # imm = 0x7FFFFFFF
cmpl $0x0, 0x20(%rbx)
jne 0x33983
leaq 0x38097(%rip), %rax     # 0x6ba18
jmp 0x3398d
leaq 0x31cd6(%rip), %rax     # 0x65660
movq (%rax), %rax
movq %rax, 0x8(%rsp)
xorl %edi, %edi
callq 0x30029
movl (%rax), %ecx
orl $0x1, %ecx
movq 0x10(%rsp), %rdx
movq %rdx, 0x8(%rax)
movq %rbp, 0x20(%rax)
leaq 0x38d86(%rip), %rdx     # 0x6c738
movq %rdx, 0x10(%rax)
andl $0xffff0001, %ecx       # imm = 0xFFFF0001
orl $0x3100, %ecx           # imm = 0x3100
movl %ecx, (%rax)
movq %rax, 0x58(%r14)
movq 0x8(%rsp), %rdx
movl 0x50(%rdx), %eax
imull %ebp, %eax
movl %eax, 0x50(%r14)
movq $0x1, 0x70(%r14)
movl $0x4, %eax
movq %rax, 0x68(%r14)
movq %r15, 0x60(%r14)
movq %r13, 0xb0(%r14)
orb $-0x58, 0x55(%r14)
movq %r14, 0x10(%r13)
movq 0x28(%rbx), %rcx
movq %rcx, 0x28(%r13)
movq 0x58(%r14), %rcx
movq %rcx, 0x58(%r15)
movl 0x50(%r14), %ecx
movl %ecx, 0x50(%r15)
movq 0x70(%rdx), %rcx
movq %rcx, 0x70(%r15)
movq %rax, 0x68(%r15)
movq %rdx, 0x60(%r15)
orb $0x28, 0x55(%r15)
movq %r14, 0x20(%r12)
leaq 0x39be3(%rip), %rax     # 0x6d618
movq %rax, 0x10(%r12)
movb $0x40, 0x1(%r12)
movb $0x9, (%rbx)
movl $0x2a, 0x4(%rbx)
movq %r12, 0x20(%rbx)
movq %r14, 0x10(%rbx)
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq