// File: /workspace/github_cpp_makefile_star2_O1/zhengwangsun[P]pas2c/semantics.cpp
// Function: simple_expression(int)
int simple_expression(int k)
{
	TreeNode tNode= tree.node[k];
	TreeNode childNode;
    int flag1, flag2;
    if(lookahead(k) == 33)//33是term
    {
        flag1 = term(tree.node[k].child[0]);
        
        flag2 = simple_expression1(tree.node[k].child[1]);
        
        if (flag1 >= flag2)
            return flag1;
        else if (flag1 <= flag2)
            return flag2;
        else
        {
            cout<<"type not match where simple_expression"<<endl;
            return -1;
        }
    }
    else if (lookahead(k) == 37)//37是sign
    {
        sign(tree.node[k].child[0]);
        
        flag1 = term(tree.node[k].child[1]);
        
        flag2 = simple_expression1(tree.node[k].child[2]);
        
        if (flag1 >= flag2)
            return flag1;
        else if (flag1 <= flag2)
            return flag2;
        else
        {
            cout<<"type not match where simple_expression"<<endl;
            return -1;
        }
    }
    else
    {
        cout<<"simple_expression error!"<<endl;
        return -1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x158, %rsp            # imm = 0x158
movslq %edi, %rax
imulq $0xa8, %rax, %rax
leaq 0xad1a7(%rip), %rbp     # 0xba0c8
leaq (%rax,%rbp), %rbx
addq $0x8, %rbx
leaq 0x8(%rsp), %rax
movl $0xb, %ecx
movq %rax, %rdi
movq %rbx, %rsi
rep  movsq (%rsi), %es:(%rdi)
movb 0x58(%rbx), %cl
movb %cl, 0x58(%rax)
leaq 0x68(%rsp), %rdi
leaq 0x78(%rsp), %r14
movq %r14, -0x10(%r14)
movq 0x60(%rbx), %rsi
movq 0x68(%rbx), %rdx
addq %rsi, %rdx
callq 0x768e
leaq 0x88(%rsp), %rdi
leaq 0x98(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x80(%rbx), %rsi
movq 0x88(%rbx), %rdx
addq %rsi, %rdx
callq 0x768e
movq 0xa0(%rbx), %rax
movq %rax, 0xa8(%rsp)
leaq 0x120(%rsp), %r12
movq %r12, -0x10(%r12)
xorl %eax, %eax
movq %rax, -0x8(%r12)
movb %al, (%r12)
leaq 0x140(%rsp), %r13
movq %r13, -0x10(%r13)
movq %rax, -0x8(%r13)
movb %al, (%r13)
movl (%rbx), %eax
testl %eax, %eax
jle 0xd02a
movslq 0x4(%rbx), %rcx
imulq $0xa8, %rcx, %rcx
cmpl $0x21, 0x5c(%rbp,%rcx)
jne 0xcff1
movl 0x4(%rbx), %edi
callq 0xd6bc
movl %eax, %ebp
movl 0x8(%rbx), %edi
callq 0xd75f
jmp 0xd021
testl %eax, %eax
jle 0xd02a
movslq 0x4(%rbx), %rax
imulq $0xa8, %rax, %rax
cmpl $0x25, 0x5c(%rbp,%rax)
jne 0xd02a
movl 0x4(%rbx), %edi
callq 0xd983
movl 0x8(%rbx), %edi
callq 0xd6bc
movl %eax, %ebp
movl 0xc(%rbx), %edi
callq 0xd75f
movl %eax, %ebx
cmpl %eax, %ebp
cmovgl %ebp, %ebx
jmp 0xd075
movq 0xcf9f(%rip), %rbx      # 0x19fd0
leaq 0x7aa2(%rip), %rsi      # 0x14ada
movl $0x18, %edx
movq %rbx, %rdi
callq 0x2280
movq (%rbx), %rax
addq -0x18(%rax), %rbx
movq %rbx, %rdi
movl $0xa, %esi
callq 0x2200
movsbl %al, %esi
movq 0xcf6d(%rip), %rdi      # 0x19fd0
callq 0x2030
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movq %rax, %rdi
callq 0x2150
movq 0x130(%rsp), %rdi
cmpq %r13, %rdi
je 0xd092
movq 0x140(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x110(%rsp), %rdi
cmpq %r12, %rdi
je 0xd0af
movq 0x120(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x88(%rsp), %rdi
cmpq %r15, %rdi
je 0xd0cc
movq 0x98(%rsp), %rsi
incq %rsi
callq 0x2230
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0xd0e3
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2230
movl %ebx, %eax
addq $0x158, %rsp            # imm = 0x158
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x68(%rsp), %rdi
cmpq %r14, %rdi
je 0xd12d
movq 0x78(%rsp), %rsi
incq %rsi
callq 0x2230
jmp 0xd12d
movq %rax, %rbx
leaq 0xb0(%rsp), %rdi
callq 0xf7a8
leaq 0x8(%rsp), %rdi
callq 0xf7a8
movq %rbx, %rdi
callq 0x23a0