// File: /workspace/github_c_makefile_star2_O1/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 %r12
pushq %rbx
subq $0x10, %rsp
movq %rsi, %r15
movl 0xa5bd(%rip), %eax      # 0x16350
addl $-0x17, %eax
cmpl $0x9, %eax
ja 0xbf37
movq %rdi, %rbx
leaq 0x373b(%rip), %rcx      # 0xf4e4
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movl $0x6, %edi
callq 0x8991
movq %rax, %r14
movq %r15, 0x38(%rax)
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0xa580(%rip)      # 0x16350
movq %rbx, %rdi
callq 0xac14
movq %rax, 0x40(%r14)
movl 0xa56e(%rip), %eax      # 0x16350
cmpq $0x18, %rax
je 0xbf1c
leaq 0x9e4d(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x510e(%rip), %rdi      # 0x10f0c
jmp 0xbf59
movl $0x3, %edi
callq 0x8991
movq %rax, %r14
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0xa533(%rip)      # 0x16350
cmpl $0x16, %eax
je 0xbf08
movl %eax, %eax
leaq 0x9e11(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x505b(%rip), %rdi      # 0x10e95
jmp 0xbf59
movl $0xf, %edi
callq 0x8991
movq %rax, %r14
movq %r15, 0x38(%rax)
leaq 0x40(%rax), %r12
movl $0x8, %esi
movq %r12, %rdi
callq 0xdcb4
movl 0x28(%r15), %edi
cmpl $0x3, %edi
jne 0xbe93
callq 0x8991
leaq -0x28(%rbp), %rdx
movq %rax, (%rdx)
movq 0x38(%r15), %rsi
movl $0xc, %ecx
movq %rax, %rdi
rep  movsq (%rsi), %es:(%rdi)
movb $0x1, (%rax)
movq %r12, %rdi
movq %rdx, %rsi
callq 0xdf81
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0xa4b0(%rip)      # 0x16350
cmpl $0x1a, %eax
je 0xbf1c
leaq -0x28(%rbp), %r15
movq %rbx, %rdi
callq 0xac14
movq %rax, -0x28(%rbp)
movq %r12, %rdi
movq %r15, %rsi
callq 0xdf81
movl 0xa48a(%rip), %eax      # 0x16350
cmpq $0x1a, %rax
je 0xbede
cmpl $0x1f, %eax
jne 0xbf47
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0xa472(%rip)      # 0x16350
cmpl $0x1a, 0xa46b(%rip)     # 0x16350
jne 0xbea9
jmp 0xbf1c
movl $0x4, %edi
callq 0x8991
movq %rax, %r14
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0xa44d(%rip)      # 0x16350
cmpl $0x16, %eax
jne 0xbf60
movq %r15, 0x38(%r14)
leaq 0xa44d(%rip), %rdi      # 0x16360
callq 0x2807
movq %rax, 0x40(%r14)
xorl %edi, %edi
callq 0xa0ca
movl %eax, 0xa427(%rip)      # 0x16350
movq %rbx, %rdi
movq %r14, %rsi
callq 0xbd7b
movq %rax, %r15
movq %r15, %rax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9cf2(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x4f6d(%rip), %rdi      # 0x10ec6
xorl %eax, %eax
callq 0x88df
movl %eax, %eax
leaq 0x9cd7(%rip), %rcx      # 0x15c40
movq (%rcx,%rax,8), %rsi
leaq 0x4ef0(%rip), %rdi      # 0x10e64
jmp 0xbf59