// File: /workspace/github_cpp_makefile_star2_O3/yuroitaki[P]enigma_machine/rotor.cpp
// Function: Rotor::store_encrypt(int)
void Rotor::store_encrypt(int rotor_id){
  ifstream input_1,input_2;
  vector<const char*>* buffer_files;
  buffer_files = (config_rot->get_rotor_files());
  int buffer;
  int count = 0;
  
  input_1.open(config_rot->get_file(RP));      //function to read rotor position file
  vector<int> buffer_num;
  while(input_1>>buffer){
    buffer_num.push_back(buffer);
  }
  ground_position = buffer_num[rotor_id];
  input_1.close();

  input_2.open((*buffer_files)[rotor_id]);     //function to read rotor mapping file
  
  while(input_2>>buffer){
    count++;
    if(count < 27){
      forward_encryption.push_back(buffer);
    }else                                       //storing the notch positions
      notch.push_back(buffer);                         
  }
  input_2.close();  
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x448, %rsp            # imm = 0x448
movl %esi, %ebp
movq %rdi, %rbx
leaq 0x240(%rsp), %rdi
callq 0x2130
leaq 0x38(%rsp), %rdi
callq 0x2130
movq (%rbx), %rdi
callq 0x3a9a
movq %rax, %r14
movq (%rbx), %rdi
movl $0x12c, %esi            # imm = 0x12C
callq 0x3a6e
leaq 0x240(%rsp), %rdi
movq %rax, %rsi
movl $0x8, %edx
callq 0x20c0
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %r15
movaps %xmm0, (%r15)
movq $0x0, 0x10(%r15)
leaq 0x240(%rsp), %r12
leaq 0xc(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x20b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x4008
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x3ffb
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
addq $0x4, %rsi
movq %rsi, 0x18(%rsp)
jmp 0x3fc5
movq %r15, %rdi
movq %r13, %rdx
callq 0x3be0
jmp 0x3fc5
movslq %ebp, %r15
movq 0x10(%rsp), %rax
movl (%rax,%r15,4), %eax
movl %eax, 0x50(%rbx)
leaq 0x240(%rsp), %rdi
callq 0x2040
movq (%r14), %rax
movq (%rax,%r15,8), %rsi
leaq 0x38(%rsp), %rdi
movl $0x8, %edx
callq 0x20c0
leaq 0x40(%rbx), %r12
leaq 0x38(%rbx), %rax
movq %rax, 0x30(%rsp)
leaq 0x10(%rbx), %rbp
leaq 0x8(%rbx), %rax
movq %rax, 0x28(%rsp)
xorl %r13d, %r13d
leaq 0x38(%rsp), %r14
leaq 0xc(%rsp), %r15
movq %r14, %rdi
movq %r15, %rsi
callq 0x20b0
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
testb $0x5, 0x20(%rax,%rcx)
jne 0x40ca
cmpl $0x19, %r13d
ja 0x4095
movq 0x10(%rbx), %rsi
cmpq 0x18(%rbx), %rsi
je 0x40b1
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
movq %rbp, %rax
jmp 0x40a8
movq 0x40(%rbx), %rsi
cmpq 0x48(%rbx), %rsi
je 0x40b8
movl 0xc(%rsp), %eax
movl %eax, (%rsi)
movq %r12, %rax
addq $0x4, %rsi
movq %rsi, (%rax)
jmp 0x40c5
movq 0x28(%rsp), %rdi
jmp 0x40bd
movq 0x30(%rsp), %rdi
movq %r15, %rdx
callq 0x3be0
incl %r13d
jmp 0x4061
leaq 0x38(%rsp), %rdi
callq 0x2040
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x40eb
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0x38(%rsp), %rdi
callq 0x2050
leaq 0x240(%rsp), %rdi
callq 0x2050
addq $0x448, %rsp            # imm = 0x448
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x411b
movq %rax, %rbx
jmp 0x4148
movq %rax, %rbx
jmp 0x413e
jmp 0x4124
jmp 0x4124
movq %rax, %rbx
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x413e
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0x38(%rsp), %rdi
callq 0x2050
leaq 0x240(%rsp), %rdi
callq 0x2050
movq %rbx, %rdi
callq 0x21d0
nop