// File: alex-courtis[P]xlayoutdisplay/src/Edid.cpp
// Function: Edid::Edid(unsigned char const*, unsigned long, char const*)
Edid::Edid(const unsigned char *edid, const size_t length, const char *name) {
    if (length < EDID_MIN_LENGTH)
        throw invalid_argument(string(name) + " has Edid size " + to_string(length) + ", expected at least " +
                               to_string(EDID_MIN_LENGTH));

    this->edid = (unsigned char *) malloc(length);
    memcpy(this->edid, edid, length);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x140, %rsp            # imm = 0x140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x128(%rbp)
leaq 0x55c93(%rip), %rcx     # 0x5d8a0
addq $0x10, %rcx
movq %rcx, (%rax)
movq $0x0, 0x8(%rax)
cmpq $0x80, -0x18(%rbp)
jae 0x7e51
movb $0x1, -0x119(%rbp)
movl $0x10, %edi
callq 0x7260
movq %rax, -0x140(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x138(%rbp)
leaq -0xc1(%rbp), %rdi
movq %rdi, -0x130(%rbp)
callq 0x7940
movq -0x138(%rbp), %rsi
movq -0x130(%rbp), %rdx
leaq -0xc0(%rbp), %rdi
callq 0x8150
jmp 0x7c7c
leaq 0x38395(%rip), %rdx     # 0x40018
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
callq 0x8100
jmp 0x7c98
movq -0x18(%rbp), %rsi
leaq -0xf8(%rbp), %rdi
callq 0x8200
jmp 0x7caa
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0xf8(%rbp), %rdx
callq 0x8030
jmp 0x7cc3
leaq 0x3835e(%rip), %rdx     # 0x40028
leaq -0x60(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0x8100
jmp 0x7cd9
leaq -0x118(%rbp), %rdi
movl $0x80, %esi
callq 0x82e0
jmp 0x7cec
leaq -0x40(%rbp), %rdi
leaq -0x60(%rbp), %rsi
leaq -0x118(%rbp), %rdx
callq 0x8030
jmp 0x7d02
movq -0x140(%rbp), %rdi
leaq -0x40(%rbp), %rsi
callq 0x7910
jmp 0x7d14
movq -0x140(%rbp), %rdi
movb $0x0, -0x119(%rbp)
movq 0x5629f(%rip), %rsi     # 0x5dfc8
movq 0x56280(%rip), %rdx     # 0x5dfb0
callq 0x78c0
jmp 0x7e8e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x7e2c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x7e20
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x7e14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x7e08
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x7dff
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x7df6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
jmp 0x7dea
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0xd0(%rbp)
movl %eax, -0xd4(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x7320
leaq -0x118(%rbp), %rdi
callq 0x7320
leaq -0x60(%rbp), %rdi
callq 0x7320
leaq -0x80(%rbp), %rdi
callq 0x7320
leaq -0xf8(%rbp), %rdi
callq 0x7320
leaq -0xa0(%rbp), %rdi
callq 0x7320
leaq -0xc0(%rbp), %rdi
callq 0x7320
leaq -0xc1(%rbp), %rdi
callq 0x7550
testb $0x1, -0x119(%rbp)
jne 0x7e43
jmp 0x7e4f
movq -0x140(%rbp), %rdi
callq 0x73c0
jmp 0x7e82
movq -0x18(%rbp), %rdi
callq 0x7700
movq %rax, %rcx
movq -0x128(%rbp), %rax
movq %rcx, 0x8(%rax)
movq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x7410
addq $0x140, %rsp            # imm = 0x140
popq %rbp
retq
movq -0xd0(%rbp), %rdi
callq 0x7930
nop