// File: /workspace/github_cpp_makefile_star2_O1/ronakshah725[P]SLR1Parser_C/parser1.cpp
// Function: slr(char (*) [16])
int slr(char x[row][col]){
    
    
    int accepted = 0;
    int token = getToken();
    int state = 1;
    s.push(to_string(state));
    int method = getAction(state, token, x);
    int val = getValueFromMatrix(state, token);
    string action = "";
    method = getAction(state, token, x);
    action = x[val];
    int i = 0;
    
    
    while(action!="0" || action!="9999"){
    
        if (method==shift){
            s.push(string(1,tokens[token]));
            
            s.push(action);
            token = getToken();
            
        }
        else if (method == reduce){
            
            string al = x[val];
            char first = al[2];
            char nt = al[0];
            while(s.top()[0]!=first){
                s.pop();
            }
            s.pop();
            int gotostate = stoi(s.top());
            int sy = getSym(nt);
            int gotoval = getValueFromMatrix(gotostate, sy);
            s.push(string(1,nt));
            s.push(x[gotoval]);
        }
        
        
        
        state = stoi(s.top());
        method = getAction(state, token, x);
        val = getValueFromMatrix(state, token);
        action = x[val];
        i++;
        if(action=="9999"){
            break;
        }
        
    }
    
    if(action=="0")
        accepted =-1;
    else if(action=="9999")
        accepted = 1;
    
   

    
    
    
    return accepted;

    
    

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, -0x78(%rbp)
callq 0x37a4
movl %eax, %r14d
leaq -0x40(%rbp), %r12
movq %r12, -0x10(%r12)
leaq -0x50(%rbp), %r15
movl $0x1, %esi
movq %r15, %rdi
movl $0x2d, %edx
callq 0x2190
movq (%r15), %rax
movb $0x31, (%rax)
leaq 0x5ab4(%rip), %rdi      # 0x81e0
movq %r15, %rsi
callq 0x31e6
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
je 0x2742
callq 0x2150
leaq -0x50(%rbp), %rdi
movq %r12, (%rdi)
leaq 0x2915(%rip), %rdx      # 0x5065
movq %rdx, %rsi
callq 0x348a
movslq %r14d, %r15
shlq $0x4, %r15
addq -0x78(%rbp), %r15
movsbl (%r15), %edi
leal -0x30(%rdi), %eax
movl $0x37, %r13d
cmpl $0xa, %eax
jb 0x278b
callq 0x2290
testl %eax, %eax
movl $0xffffff9c, %eax       # imm = 0xFFFFFF9C
movl $0x4d, %r13d
cmovel %eax, %r13d
leaq -0x50(%rbp), %r12
movq 0x8(%r12), %rbx
movq %r15, %rdi
callq 0x20d0
movq %r12, %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %r15, %rcx
movq %rax, %r8
callq 0x2260
leaq -0x50(%rbp), %rbx
leaq -0xa0(%rbp), %r15
movl %r14d, %eax
movq %rax, -0x80(%rbp)
movq -0x78(%rbp), %r12
movq %rbx, %rdi
leaq 0x2888(%rip), %rsi      # 0x5057
callq 0x2080
testl %eax, %eax
jne 0x27ef
movq %rbx, %rdi
leaq 0x2877(%rip), %rsi      # 0x5059
callq 0x2080
testl %eax, %eax
je 0x2b22
cmpl $0x4d, %r13d
je 0x2865
cmpl $0x37, %r13d
jne 0x285c
movslq -0x80(%rbp), %rax
leaq 0x59aa(%rip), %rcx      # 0x81b0
movsbl (%rax,%rcx), %edx
leaq -0x60(%rbp), %rax
movq %rax, -0x70(%rbp)
movl $0x1, %esi
leaq -0x70(%rbp), %r14
movq %r14, %rdi
callq 0x2190
leaq 0x59b6(%rip), %rdi      # 0x81e0
movq %r14, %rsi
callq 0x31e6
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2844
callq 0x2150
leaq 0x5995(%rip), %rdi      # 0x81e0
movq %rbx, %rsi
callq 0x3524
callq 0x37a4
movq %rax, -0x80(%rbp)
leaq -0x70(%rbp), %r13
jmp 0x2a1d
movslq %r14d, %rsi
shlq $0x4, %rsi
addq %r12, %rsi
leaq -0x70(%rbp), %rdi
movq %r15, %rdx
callq 0x20b0
movq -0x70(%rbp), %rax
movb (%rax), %r13b
movb 0x2(%rax), %bl
movl $0x200, %r15d           # imm = 0x200
leaq 0x594e(%rip), %r12      # 0x81e0
movq 0x5977(%rip), %rax      # 0x8210
cmpq 0x5978(%rip), %rax      # 0x8218
jne 0x28b0
movq 0x597f(%rip), %rax      # 0x8228
movq -0x8(%rax), %rax
addq %r15, %rax
movq -0x20(%rax), %rax
movb (%rax), %r14b
movq %r12, %rdi
callq 0x3716
cmpb %bl, %r14b
jne 0x2892
movq 0x5945(%rip), %rax      # 0x8210
cmpq 0x5946(%rip), %rax      # 0x8218
jne 0x28e2
movq 0x594d(%rip), %rax      # 0x8228
movq -0x8(%rax), %rax
addq %r15, %rax
movq -0x20(%rax), %rbx
callq 0x2030
movq %rax, %r15
movl (%rax), %r12d
movl $0x0, (%rax)
movq %rbx, %rdi
leaq -0xa0(%rbp), %rsi
movl $0xa, %edx
callq 0x21f0
cmpq %rbx, -0xa0(%rbp)
je 0x2b9b
movq %rax, %r14
addq $-0x80000000, %rax      # imm = 0x80000000
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
cmpq %rcx, %rax
jb 0x2b8f
movl (%r15), %eax
cmpl $0x22, %eax
je 0x2b8f
testl %eax, %eax
jne 0x2947
movl %r12d, (%r15)
xorl %ebx, %ebx
movq -0x78(%rbp), %r12
leaq -0xa0(%rbp), %r15
leaq 0x5855(%rip), %rax      # 0x81b0
cmpb %r13b, (%rbx,%rax)
je 0x2971
incq %rbx
cmpq $0xf, %rbx
jne 0x295b
movq $-0x1, %rbx
leaq -0x90(%rbp), %rax
movq %rax, -0xa0(%rbp)
movsbl %r13b, %edx
movl $0x1, %esi
movq %r15, %rdi
callq 0x2190
leaq 0x5849(%rip), %rdi      # 0x81e0
movq %r15, %rsi
callq 0x31e6
leaq -0x70(%rbp), %r13
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x29bb
callq 0x2150
leaq (%r14,%r14,4), %rax
leaq (%rax,%rax,2), %rax
movl $0xfffffff1, %ecx       # imm = 0xFFFFFFF1
addq %rcx, %rbx
addq %rax, %rbx
movslq %ebx, %rsi
shlq $0x4, %rsi
addq %r12, %rsi
movq %r15, %rdi
leaq -0x29(%rbp), %rdx
callq 0x20b0
leaq 0x57f5(%rip), %rdi      # 0x81e0
movq %r15, %rsi
callq 0x31e6
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x2a0b
callq 0x2150
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2a1d
callq 0x2150
movq 0x57ec(%rip), %rax      # 0x8210
cmpq 0x57ed(%rip), %rax      # 0x8218
jne 0x2a40
movq 0x57f4(%rip), %rax      # 0x8228
movq -0x8(%rax), %rax
movl $0x200, %ecx            # imm = 0x200
addq %rcx, %rax
movq -0x20(%rax), %rbx
callq 0x2030
movq %rax, %r14
movl (%rax), %r15d
movl $0x0, (%rax)
movq %rbx, %rdi
movq %r13, %rsi
movl $0xa, %edx
callq 0x21f0
cmpq %rbx, -0x70(%rbp)
je 0x2b83
leaq -0x80000000(%rax), %rcx
movabsq $-0x100000000, %rdx     # imm = 0xFFFFFFFF00000000
cmpq %rdx, %rcx
jb 0x2b77
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x2b77
testl %ecx, %ecx
jne 0x2a9c
movl %r15d, (%r14)
leal (%rax,%rax,4), %eax
leal (%rax,%rax,2), %eax
movq -0x80(%rbp), %rcx
leal (%rcx,%rax), %r14d
addl $-0xf, %r14d
movslq %r14d, %r15
shlq $0x4, %r15
movsbl (%r12,%r15), %edi
leal -0x30(%rdi), %eax
movl $0x37, %r13d
cmpl $0xa, %eax
jb 0x2ade
callq 0x2290
testl %eax, %eax
movl $0x4d, %r13d
movl $0xffffff9c, %eax       # imm = 0xFFFFFF9C
cmovel %eax, %r13d
addq %r12, %r15
movq -0x48(%rbp), %rbx
movq %r15, %rdi
callq 0x20d0
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movq %rbx, %rdx
movq %rdi, %rbx
movq %r15, %rcx
movq %rax, %r8
callq 0x2260
leaq -0xa0(%rbp), %r15
movq %rbx, %rdi
leaq 0x2544(%rip), %rsi      # 0x5059
callq 0x2080
testl %eax, %eax
jne 0x27c5
leaq 0x252e(%rip), %rsi      # 0x5057
leaq -0x50(%rbp), %rdi
callq 0x2080
testl %eax, %eax
je 0x2b4f
leaq 0x251c(%rip), %rsi      # 0x5059
leaq -0x50(%rbp), %rdi
callq 0x2080
xorl %ebx, %ebx
testl %eax, %eax
sete %bl
jmp 0x2b54
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
leaq -0x40(%rbp), %rax
movq -0x50(%rbp), %rdi
cmpq %rax, %rdi
je 0x2b66
callq 0x2150
movl %ebx, %eax
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x24fd(%rip), %rdi      # 0x507b
callq 0x2210
leaq 0x24f1(%rip), %rdi      # 0x507b
callq 0x20f0
leaq 0x24e5(%rip), %rdi      # 0x507b
callq 0x2210
leaq 0x24d9(%rip), %rdi      # 0x507b
callq 0x20f0
jmp 0x2c08
movq %rax, %rbx
jmp 0x2c2b
movq %rax, %rbx
movq -0x50(%rbp), %rdi
cmpq %r12, %rdi
jne 0x2c26
jmp 0x2c2b
jmp 0x2bc0
jmp 0x2be1
movq %rax, %rbx
movq -0xa0(%rbp), %rdi
leaq -0x90(%rbp), %rax
cmpq %rax, %rdi
je 0x2bf4
callq 0x2150
jmp 0x2bf4
jmp 0x2be1
jmp 0x2c08
movq %rax, %rbx
jmp 0x2bf4
jmp 0x2c08
movq %rax, %rbx
cmpl $0x0, (%r15)
jne 0x2bf4
movl %r12d, (%r15)
movq -0x70(%rbp), %rdi
leaq -0x60(%rbp), %rax
cmpq %rax, %rdi
je 0x2c19
callq 0x2150
jmp 0x2c19
movq %rax, %rbx
jmp 0x2c19
movq %rax, %rbx
cmpl $0x0, (%r14)
jne 0x2c19
movl %r15d, (%r14)
leaq -0x40(%rbp), %rax
movq -0x50(%rbp), %rdi
cmpq %rax, %rdi
je 0x2c2b
callq 0x2150
movq %rbx, %rdi
callq 0x22f0