// File: /workspace/github_c_makefile_star2_O0/goodpaul6[P]generic/script.c
// Function: parse_unary
static expr_t* parse_unary(script_t* script)
{
	switch(g_cur_tok)
	{
		case TOK_NEW:
		{
			get_next_token();
			
			expr_t* exp = NULL;
			
			if(g_cur_tok == TOK_IDENT)
			{
				type_tag_t* tag = get_type_tag_from_name(script, g_lexeme);
				if(tag->type == TAG_STRUCT)
				{
					exp = create_expr(EXP_STRUCT_NEW);
					
					exp->newx.type = tag;
					vec_init(&exp->newx.init, sizeof(expr_t*));
					
					get_next_token();
					
					if(g_cur_tok == TOK_OPENCURLY)
					{
						get_next_token();
						while(g_cur_tok != TOK_CLOSECURLY)
						{
							expr_t* e = parse_expr(script);
							if(e->type != EXP_BINARY || e->binx.lhs->type != EXP_VAR || e->binx.op != TOK_ASSIGN)
								error_exit_p("Invalid initializer expression for %s\n", tag->ds.name);
							
							vec_push_back(&exp->newx.init, &e);
							if(g_cur_tok == TOK_COMMA) get_next_token();
						}
						get_next_token();
					}
					
					return exp;
				}
				
				// NOTE: http://xkcd.com/292/
				goto not_type;
			}
		
		not_type:
			exp = create_expr(EXP_VAR);
			exp->varx.name = estrdup("new");
			exp->varx.decl = reference_variable(script, "new");
			
			return parse_post(script, exp);
		} break;
		
		case TOK_NOT: case TOK_MINUS:
		{
			expr_t* exp = create_expr(EXP_UNARY);
			exp->unaryx.op = g_cur_tok;
			get_next_token();
			
			exp->unaryx.rhs = parse_expr(script);
			return parse_post(script, exp);
		} break;
		
		default:
			return parse_post(script, parse_factor(script));
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movl 0xcf3e(%rip), %eax      # 0x1a5b0
movl %eax, -0x34(%rbp)
subl $0x5, %eax
je 0xd69b
jmp 0xd67c
movl -0x34(%rbp), %eax
subl $0x23, %eax
je 0xd7f6
jmp 0xd68a
movl -0x34(%rbp), %eax
subl $0x26, %eax
je 0xd7f6
jmp 0xd83d
callq 0xd640
movq $0x0, -0x18(%rbp)
cmpl $0x16, 0xcf01(%rip)     # 0x1a5b0
jne 0xd7a1
movq -0x10(%rbp), %rdi
leaq 0xcf00(%rip), %rsi      # 0x1a5c0
callq 0xa7d0
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpl $0xa, 0x20(%rax)
jne 0xd79f
movl $0x2, %edi
callq 0xa1b0
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
movl $0x8, %esi
callq 0x114e0
callq 0xd640
cmpl $0x1b, 0xce9d(%rip)     # 0x1a5b0
jne 0xd792
callq 0xd640
cmpl $0x1c, 0xce8f(%rip)     # 0x1a5b0
je 0xd78d
movq -0x10(%rbp), %rdi
callq 0xd5a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpl $0xe, 0x28(%rax)
jne 0xd752
movq -0x28(%rbp), %rax
movq 0x38(%rax), %rax
cmpl $0x5, 0x28(%rax)
jne 0xd752
movq -0x28(%rbp), %rax
cmpl $0x24, 0x48(%rax)
je 0xd768
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rsi
leaq 0x77a9(%rip), %rdi      # 0x14f0a
movb $0x0, %al
callq 0xa0e0
movq -0x18(%rbp), %rdi
addq $0x38, %rdi
addq $0x8, %rdi
leaq -0x28(%rbp), %rsi
callq 0x11960
cmpl $0x1f, 0xce2c(%rip)     # 0x1a5b0
jne 0xd78b
callq 0xd640
jmp 0xd71a
callq 0xd640
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0xd85e
jmp 0xd7a3
jmp 0xd7a3
movl $0x5, %edi
callq 0xa1b0
movq %rax, -0x18(%rbp)
leaq 0x7534(%rip), %rdi      # 0x14cec
callq 0x2500
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
leaq 0x7519(%rip), %rsi      # 0x14cec
callq 0x9f10
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x40(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0xd930
movq %rax, -0x8(%rbp)
jmp 0xd85e
movl $0xd, %edi
callq 0xa1b0
movq %rax, -0x30(%rbp)
movl 0xcda6(%rip), %ecx      # 0x1a5b0
movq -0x30(%rbp), %rax
movl %ecx, 0x40(%rax)
callq 0xd640
movq -0x10(%rbp), %rdi
callq 0xd5a0
movq %rax, %rcx
movq -0x30(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xd930
movq %rax, -0x8(%rbp)
jmp 0xd85e
movq -0x10(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rdi
callq 0xdbf0
movq -0x40(%rbp), %rdi
movq %rax, %rsi
callq 0xd930
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax,%rax)