// File: kelwinfc[P]ci4721-Fernandez-Gyomrey/src/AST.cpp
// Function: AST_op::AST_op(AST_expression*, tokenId*, AST_expression*)
AST_op::AST_op(AST_expression* l, tokenId* o, AST_expression* r){
    
    is_constant = false;
    type = UNDEFINED;
    
    line = l->line;
    column = l->column;
    
    if ( o->ident.compare("+") == 0 ){
        oper_type = PLUS;
    } else if ( o->ident.compare("-") == 0 ){
        oper_type = MINUS;
    } else if ( o->ident.compare("*") == 0 ){
        oper_type = PROD;
    } else if ( o->ident.compare("/") == 0 ){
        oper_type = DIV;
    } else if ( o->ident.compare("%") == 0 ){
        oper_type = MOD;
    } else if ( o->ident.compare("&&") == 0 ){
        oper_type = AND;
    } else if ( o->ident.compare("||") == 0 ){
        oper_type = OR;
    } else if ( o->ident.compare("==>") == 0 ){
        oper_type = IMP;
    } else if ( o->ident.compare("<==") == 0 ){
        oper_type = CONSEQ;
    } else if ( o->ident.compare("==") == 0 ){
        oper_type = EQ;
    } else if ( o->ident.compare("!=") == 0 ){
        oper_type = UNEQ;
    } else if ( o->ident.compare("<") == 0 ){
        oper_type = LESS;
    } else if ( o->ident.compare("<=") == 0 ){
        oper_type = LESS_EQ;
    } else if ( o->ident.compare(">") == 0 ){
        oper_type = GREAT;
    } else if ( o->ident.compare(">=") == 0 ){
        oper_type = GREAT_EQ;
    } else {
        throw "Error de implementación en identificación de operador de expresión binaria";
    }
    
    line_op = o->line;
    column_op = o->column;
    delete o;
    
    left = l;
    right = r;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq %rsi, 0x38(%rsp)
movq %rdx, 0x30(%rsp)
movq %rcx, 0x28(%rsp)
movq 0x40(%rsp), %rdi
movq %rdi, 0x10(%rsp)
callq 0x20ec0
movq 0x10(%rsp), %rax
leaq 0x4fb5d(%rip), %rcx     # 0x6d040
addq $0x10, %rcx
movq %rcx, (%rax)
movb $0x0, 0x14(%rax)
movl $0x0, 0x10(%rax)
movq 0x38(%rsp), %rcx
movl 0x8(%rcx), %ecx
movl %ecx, 0x8(%rax)
movq 0x38(%rsp), %rcx
movl 0xc(%rcx), %ecx
movl %ecx, 0xc(%rax)
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x3503c(%rip), %rsi     # 0x52557
callq 0x6110
cmpl $0x0, %eax
jne 0x1d536
movq 0x10(%rsp), %rax
movl $0x0, 0x68(%rax)
jmp 0x1d7ec
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x371bf(%rip), %rsi     # 0x54705
callq 0x6110
cmpl $0x0, %eax
jne 0x1d561
movq 0x10(%rsp), %rax
movl $0x1, 0x68(%rax)
jmp 0x1d7ea
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x3715d(%rip), %rsi     # 0x546ce
callq 0x6110
cmpl $0x0, %eax
jne 0x1d58c
movq 0x10(%rsp), %rax
movl $0x2, 0x68(%rax)
jmp 0x1d7e8
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34fbd(%rip), %rsi     # 0x52559
callq 0x6110
cmpl $0x0, %eax
jne 0x1d5b7
movq 0x10(%rsp), %rax
movl $0x3, 0x68(%rax)
jmp 0x1d7e6
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34f94(%rip), %rsi     # 0x5255b
callq 0x6110
cmpl $0x0, %eax
jne 0x1d5e2
movq 0x10(%rsp), %rax
movl $0x4, 0x68(%rax)
jmp 0x1d7e4
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34f6b(%rip), %rsi     # 0x5255d
callq 0x6110
cmpl $0x0, %eax
jne 0x1d60d
movq 0x10(%rsp), %rax
movl $0x5, 0x68(%rax)
jmp 0x1d7e2
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34f43(%rip), %rsi     # 0x52560
callq 0x6110
cmpl $0x0, %eax
jne 0x1d638
movq 0x10(%rsp), %rax
movl $0x6, 0x68(%rax)
jmp 0x1d7e0
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34f1b(%rip), %rsi     # 0x52563
callq 0x6110
cmpl $0x0, %eax
jne 0x1d663
movq 0x10(%rsp), %rax
movl $0x7, 0x68(%rax)
jmp 0x1d7de
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34ef4(%rip), %rsi     # 0x52567
callq 0x6110
cmpl $0x0, %eax
jne 0x1d68e
movq 0x10(%rsp), %rax
movl $0x8, 0x68(%rax)
jmp 0x1d7dc
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34eca(%rip), %rsi     # 0x52568
callq 0x6110
cmpl $0x0, %eax
jne 0x1d6b9
movq 0x10(%rsp), %rax
movl $0x9, 0x68(%rax)
jmp 0x1d7da
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34ea2(%rip), %rsi     # 0x5256b
callq 0x6110
cmpl $0x0, %eax
jne 0x1d6e4
movq 0x10(%rsp), %rax
movl $0xa, 0x68(%rax)
jmp 0x1d7d8
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34e7a(%rip), %rsi     # 0x5256e
callq 0x6110
cmpl $0x0, %eax
jne 0x1d70f
movq 0x10(%rsp), %rax
movl $0xb, 0x68(%rax)
jmp 0x1d7d6
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34e51(%rip), %rsi     # 0x52570
callq 0x6110
cmpl $0x0, %eax
jne 0x1d73a
movq 0x10(%rsp), %rax
movl $0xc, 0x68(%rax)
jmp 0x1d7d4
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x36be9(%rip), %rsi     # 0x54333
callq 0x6110
cmpl $0x0, %eax
jne 0x1d762
movq 0x10(%rsp), %rax
movl $0xd, 0x68(%rax)
jmp 0x1d7d2
movq 0x30(%rsp), %rdi
addq $0x8, %rdi
leaq 0x34e01(%rip), %rsi     # 0x52573
callq 0x6110
cmpl $0x0, %eax
jne 0x1d78a
movq 0x10(%rsp), %rax
movl $0xe, 0x68(%rax)
jmp 0x1d7d0
movl $0x8, %edi
callq 0x61b0
movq %rax, %rdi
leaq 0x368e7(%rip), %rax     # 0x54085
movq %rax, (%rdi)
movq 0x507f8(%rip), %rsi     # 0x6dfa0
xorl %eax, %eax
movl %eax, %edx
callq 0x6670
jmp 0x1d855
movq 0x10(%rsp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x20(%rsp)
movl %eax, 0x1c(%rsp)
callq 0x20f40
jmp 0x1d84b
jmp 0x1d7d2
jmp 0x1d7d4
jmp 0x1d7d6
jmp 0x1d7d8
jmp 0x1d7da
jmp 0x1d7dc
jmp 0x1d7de
jmp 0x1d7e0
jmp 0x1d7e2
jmp 0x1d7e4
jmp 0x1d7e6
jmp 0x1d7e8
jmp 0x1d7ea
jmp 0x1d7ec
movq 0x10(%rsp), %rax
movq 0x30(%rsp), %rcx
movl (%rcx), %ecx
movl %ecx, 0x48(%rax)
movq 0x30(%rsp), %rcx
movl 0x4(%rcx), %ecx
movl %ecx, 0x4c(%rax)
movq 0x30(%rsp), %rax
movq %rax, 0x8(%rsp)
cmpq $0x0, %rax
je 0x1d82f
movq 0x8(%rsp), %rdi
callq 0x20f10
movq 0x8(%rsp), %rdi
movl $0x28, %esi
callq 0x63a0
movq 0x10(%rsp), %rax
movq 0x38(%rsp), %rcx
movq %rcx, 0x58(%rax)
movq 0x28(%rsp), %rcx
movq %rcx, 0x60(%rax)
addq $0x48, %rsp
retq
movq 0x20(%rsp), %rdi
callq 0x66b0
nopw %cs:(%rax,%rax)