// File: /workspace/github_c_makefile_star2_O0/stonezwr[P]SpiKL-IP/readout.C
// Function: Readout::SetRefer(int)
void Readout::SetRefer(int flag){ // To set the reference array according the application
    if(flag == 0){
        for (int i = 0; i < 26; ++i)
        {
            if(i < 2) 
                refer.push_back(i);
            else if(i == 2)
                refer.push_back(10);
            else if(i < 12)
                refer.push_back(refer[i-1] + 1);
            else if(i == 12)
                refer.push_back(2);
            else if(i == 13)
                refer.push_back(20);
            else if(i < 19)
                refer.push_back(refer[i-1] + 1);
            else if(i == 19)
                refer.push_back(3);
            else
                refer.push_back(refer[i-1] + 1);
        }
        // for (int i = 0; i < 26; ++i)
        // {
        // 	cout<<refer[i]<<endl;
        // }
    }
    // refer = {0, 1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 3, 4, 5, 6, 7, 8, 9};
    else{
        for (int i = 0; i < CLS; ++i)
        {
            refer.push_back(i);
        }
        //	refer = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9};
    }     


}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x38(%rbp)
cmpl $0x0, -0xc(%rbp)
jne 0x2cc9a
movl $0x0, -0x10(%rbp)
cmpl $0x1a, -0x10(%rbp)
jge 0x2cc98
cmpl $0x2, -0x10(%rbp)
jge 0x2cb3e
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
leaq -0x10(%rbp), %rsi
callq 0x5640
jmp 0x2cc88
cmpl $0x2, -0x10(%rbp)
jne 0x2cb61
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movl $0xa, -0x14(%rbp)
leaq -0x14(%rbp), %rsi
callq 0x5830
jmp 0x2cc86
cmpl $0xc, -0x10(%rbp)
jge 0x2cba2
movq -0x38(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x40(%rbp)
addq $0x8, %rdi
movl -0x10(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x5620
movq -0x40(%rbp), %rdi
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
leaq -0x18(%rbp), %rsi
callq 0x5830
jmp 0x2cc84
cmpl $0xc, -0x10(%rbp)
jne 0x2cbc5
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movl $0x2, -0x1c(%rbp)
leaq -0x1c(%rbp), %rsi
callq 0x5830
jmp 0x2cc82
cmpl $0xd, -0x10(%rbp)
jne 0x2cbe8
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movl $0x14, -0x20(%rbp)
leaq -0x20(%rbp), %rsi
callq 0x5830
jmp 0x2cc80
cmpl $0x13, -0x10(%rbp)
jge 0x2cc26
movq -0x38(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x48(%rbp)
addq $0x8, %rdi
movl -0x10(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x5620
movq -0x48(%rbp), %rdi
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
leaq -0x24(%rbp), %rsi
callq 0x5830
jmp 0x2cc7e
cmpl $0x13, -0x10(%rbp)
jne 0x2cc46
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
movl $0x3, -0x28(%rbp)
leaq -0x28(%rbp), %rsi
callq 0x5830
jmp 0x2cc7c
movq -0x38(%rbp), %rdi
movq %rdi, %rax
addq $0x8, %rax
movq %rax, -0x50(%rbp)
addq $0x8, %rdi
movl -0x10(%rbp), %eax
subl $0x1, %eax
movslq %eax, %rsi
callq 0x5620
movq -0x50(%rbp), %rdi
movl (%rax), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
leaq -0x2c(%rbp), %rsi
callq 0x5830
jmp 0x2cc7e
jmp 0x2cc80
jmp 0x2cc82
jmp 0x2cc84
jmp 0x2cc86
jmp 0x2cc88
jmp 0x2cc8a
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x2cb18
jmp 0x2ccc5
movl $0x0, -0x30(%rbp)
cmpl $0x1a, -0x30(%rbp)
jge 0x2ccc3
movq -0x38(%rbp), %rdi
addq $0x8, %rdi
leaq -0x30(%rbp), %rsi
callq 0x5640
movl -0x30(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x30(%rbp)
jmp 0x2cca1
jmp 0x2ccc5
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)