// File: /workspace/github_c_makefile_star2_O3/goodpaul6[P]generic/script.c
// Function: parse_post
static expr_t* parse_post(script_t* script, expr_t* pre)
{
	switch(g_cur_tok)
	{
		case TOK_DOT:
		{
			expr_t* exp = create_expr(EXP_DOT);
			get_next_token();
			
			if(g_cur_tok != TOK_IDENT) error_exit_p("Expected identifier after '.' but received '%s'\n", g_token_names[g_cur_tok]);
			
			exp->dotx.value = pre;
			exp->dotx.name = estrdup(g_lexeme);
			
			get_next_token();
			
			return parse_post(script, exp);
		} break;
		
		case TOK_COLON:
		{
			expr_t* exp = create_expr(EXP_COLON);
			get_next_token();
			
			if(g_cur_tok != TOK_IDENT) error_exit_p("Expected identifier after ':' but received '%s'\n", g_token_names[g_cur_tok]);
			
			exp->dotx.value = pre;
			exp->dotx.name = estrdup(g_lexeme);
			
			get_next_token();
			
			return parse_post(script, exp);
		} break;
		
		case TOK_OPENPAREN:
		{
			expr_t* exp = create_expr(EXP_CALL);
			exp->callx.func = pre;
			vec_init(&exp->callx.args, sizeof(expr_t*));
			
			if(pre->type == EXP_COLON)
			{
				expr_t* cpy = create_expr(pre->type);
				
				memcpy(cpy, pre->dotx.value, sizeof(expr_t));
				cpy->is_shallow_copy = 1;
				
				vec_push_back(&exp->callx.args, &cpy);
			}
			
			get_next_token();
			
			while(g_cur_tok != TOK_CLOSEPAREN)
			{
				expr_t* arg = parse_expr(script);
				vec_push_back(&exp->callx.args, &arg);
				
				if(g_cur_tok == TOK_COMMA) get_next_token();
				else if(g_cur_tok != TOK_CLOSEPAREN) error_exit_p("Expected ')' after '(' in function call expression but received '%s'\n", g_token_names[g_cur_tok]);
			}
			get_next_token();
			
			return parse_post(script, exp);
		} break;
		
		case TOK_OPENSQUARE:
		{
			expr_t* exp = create_expr(EXP_ARRAY_INDEX);
			exp->array_index.array = pre;
			get_next_token();
			
			exp->array_index.index = parse_expr(script);
			if(g_cur_tok != TOK_CLOSESQUARE) error_exit_p("Expected ']' after '[' in array index expression but received '%s'\n", g_token_names[g_cur_tok]);
			get_next_token();
			
			return parse_post(script, exp);
		} break;
		
		default:
			return pre;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movl 0xa776(%rip), %eax      # 0x16360
leaq 0x38f3(%rip), %r13      # 0xf4e4
leaq 0xa778(%rip), %r15      # 0x16370
addl $-0x17, %eax
cmpl $0x9, %eax
ja 0xbd7c
movslq (%r13,%rax,4), %rax
addq %r13, %rax
jmpq *%rax
movl $0x6, %edi
callq 0x8840
movq %rax, %r12
movq %r14, 0x38(%rax)
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa734(%rip)      # 0x16360
movq %rbx, %rdi
callq 0xaa4d
movq %rax, 0x40(%r12)
movl 0xa721(%rip), %eax      # 0x16360
cmpq $0x18, %rax
je 0xbca3
jmp 0xbd8e
movl $0x3, %edi
callq 0x8840
movq %rax, %r12
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa6fc(%rip)      # 0x16360
cmpl $0x16, %eax
je 0xbc91
jmp 0xbdb8
movl $0x4, %edi
callq 0x8840
movq %rax, %r12
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa6d8(%rip)      # 0x16360
cmpl $0x16, %eax
jne 0xbda2
movq %r14, 0x38(%r12)
movq %r15, %rdi
callq 0x2817
movq %rax, 0x40(%r12)
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa6b0(%rip)      # 0x16360
movq %r12, %r14
jmp 0xbbf8
movl $0xf, %edi
callq 0x8840
movq %rax, %r15
movq %r14, 0x38(%rax)
leaq 0x40(%rax), %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0xda7c
cmpl $0x3, 0x28(%r14)
jne 0xbd0f
movl $0x3, %edi
callq 0x8840
leaq -0x30(%rbp), %rdx
movq %rax, (%rdx)
movq 0x38(%r14), %rsi
movl $0xc, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x1, (%rax)
movq %r12, %rdi
movq %rdx, %rsi
callq 0xdd50
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa644(%rip)      # 0x16360
cmpl $0x1a, %eax
je 0xbd61
leaq -0x30(%rbp), %r14
movq %rbx, %rdi
callq 0xaa4d
movq %rax, -0x30(%rbp)
movq %r12, %rdi
movq %r14, %rsi
callq 0xdd50
movl 0xa61e(%rip), %eax      # 0x16360
cmpq $0x1f, %rax
jne 0xbd5c
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa60b(%rip)      # 0x16360
cmpl $0x1a, %eax
jne 0xbd25
jmp 0xbd61
cmpl $0x1a, %eax
jne 0xbdce
xorl %edi, %edi
callq 0x9eb1
movl %eax, 0xa5f2(%rip)      # 0x16360
movq %rbx, %rdi
movq %r15, %rsi
callq 0xbbd0
movq %rax, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9eab(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x516c(%rip), %rdi      # 0x10f0c
jmp 0xbde0
movl %eax, %eax
leaq 0x9e95(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x50ae(%rip), %rdi      # 0x10e64
jmp 0xbde0
movl %eax, %eax
leaq 0x9e7f(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x50c9(%rip), %rdi      # 0x10e95
jmp 0xbde0
leaq 0x9e6b(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x50e6(%rip), %rdi      # 0x10ec6
xorl %eax, %eax
callq 0x878e