// File: /workspace/github_cpp_makefile_star2_O1/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 $0x100008, %edx         # imm = 0x100008
xorl %esi, %esi
callq 0x4140
movq $0x0, 0x100010(%rbx)
movl $0x0, 0x100017(%rbx)
leaq 0x18(%rsp), %r13
movq %r13, -0x10(%r13)
leaq 0x29b7(%rip), %rsi      # 0x7033
leaq 0x29b2(%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 0x46b0
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4230
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2977(%rip), %rsi      # 0x7036
leaq 0x2973(%rip), %rdx      # 0x7039
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, %r14d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x46ef
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4230
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x293c(%rip), %rsi      # 0x703a
leaq 0x2937(%rip), %rdx      # 0x703c
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, %r15d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x472e
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4230
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2900(%rip), %rsi      # 0x703d
leaq 0x28fb(%rip), %rdx      # 0x703f
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, %r12d
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x476d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4230
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x28c4(%rip), %rsi      # 0x7040
leaq 0x28bf(%rip), %rdx      # 0x7042
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
leaq 0x100010(%rbx), %rcx
movl %eax, (%rcx)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x47b2
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4230
leaq 0x8(%rsp), %rdi
movq %r13, (%rdi)
leaq 0x2882(%rip), %rsi      # 0x7043
leaq 0x287f(%rip), %rdx      # 0x7047
callq 0x40b0
leaq 0x8(%rsp), %rdi
callq 0x40f0
movl %eax, 0x100014(%rbx)
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x47f4
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4230
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)
addq $0x10, %rbx
movl $0x100000, %edx         # imm = 0x100000
movq %rbx, %rdi
movl $0xff, %esi
callq 0x4140
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x485e
jmp 0x487a
jmp 0x485e
jmp 0x487a
jmp 0x485e
jmp 0x487a
jmp 0x485e
jmp 0x487a
jmp 0x485e
jmp 0x487a
movq %rax, %rbx
movq 0x8(%rsp), %rdi
cmpq %r13, %rdi
je 0x487d
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x4230
jmp 0x487d
movq %rax, %rbx
movq %rbx, %rdi
callq 0x4410
nop