// File: /workspace/github_cpp_makefile_star2_O3/Jumperr-labs[P]at25sf081/AT25SF081.cpp
// Function: AT25SF081::AT25SF081()
AT25SF081::AT25SF081() :
        should_stop_(false),
        status_register1_(0),
        status_register2_(0) {
    int cs_pin_number = GetPinNumber("cs");
    int sck_pin_number = GetPinNumber("sck");
    int si_pin_number = GetPinNumber("si");
    int so_pin_number = GetPinNumber("so");
    wp_pin_number_ = GetPinNumber("wp");
    hold_pin_number_ = GetPinNumber("hold");

    SpiSlaveConfig spi_config = {
            .mosi_pin_number = si_pin_number,
            .miso_pin_number = so_pin_number,
            .ss_pin_number = cs_pin_number,
            .sclk_pin_number = sck_pin_number,
            .supported_spi_modes = SPI_MODE_0 | SPI_MODE_3,
            .max_frequency = MAX_FREQUENCY,
            .bit_order = MSB_FIRST
    };

    spi_slave_ = CreateSpiSlave(spi_config);
    MemReset();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movq 0x5958(%rip), %rax      # 0x9f98
addq $0x10, %rax
movq %rax, (%rdi)
addq $0x8, %rdi
movl $0x100013, %edx         # imm = 0x100013
xorl %esi, %esi
callq 0x4140
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x29cc(%rip), %rsi      # 0x7033
leaq 0x29c7(%rip), %rdx      # 0x7035
leaq 0x8(%rsp), %rdi
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, %ebp
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x469b
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4240
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x298c(%rip), %rsi      # 0x7036
leaq 0x2988(%rip), %rdx      # 0x7039
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, %r14d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x46da
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4240
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2951(%rip), %rsi      # 0x703a
leaq 0x294c(%rip), %rdx      # 0x703c
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, %r15d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4719
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4240
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2915(%rip), %rsi      # 0x703d
leaq 0x2910(%rip), %rdx      # 0x703f
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, %r12d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4758
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4240
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x28d9(%rip), %rsi      # 0x7040
leaq 0x28d4(%rip), %rdx      # 0x7042
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, 0x100010(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x479a
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4240
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x289a(%rip), %rsi      # 0x7043
leaq 0x2897(%rip), %rdx      # 0x7047
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, 0x100014(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x47dc
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4240
leaq 0x10(%rbx), %r13
leaq 0x8(%rsp), %rdi
movl %r15d, (%rdi)
movl %r12d, 0x4(%rdi)
movl %ebp, 0x8(%rdi)
movl %r14d, 0xc(%rdi)
movabsq $0x632ea0000000009, %rax # imm = 0x632EA0000000009
movq %rax, 0x10(%rdi)
movl $0x0, 0x18(%rdi)
callq 0x4390
movq %rax, 0x8(%rbx)
movl $0x100000, %edx         # imm = 0x100000
movq %r13, %rdi
movl $0xff, %esi
callq 0x4140
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x4846
jmp 0x4862
jmp 0x4846
jmp 0x4862
jmp 0x4846
jmp 0x4862
jmp 0x4846
jmp 0x4862
jmp 0x4846
jmp 0x4862
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x4865
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4240
jmp 0x4865
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4410
nop