// File: /workspace/github_c_makefile_star2_O1/orempel[P]multiboot_tool/filedata.c
// Function: file_read
int file_read(const char *filename, struct databuf *dbuf)
{
    switch (get_filetype(filename))
    {
        case FILETYPE_BINARY:
            return binfile_read(filename, dbuf);

        case FILETYPE_INTELHEX:
            return hexfile_read(filename, dbuf);

        default:
            return -1;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %rbx
movq %rdi, %r14
callq 0x4895
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
cmpl $0x2, %eax
je 0x495f
cmpl $0x1, %eax
jne 0x4cde
movq %r14, %rdi
xorl %esi, %esi
xorl %eax, %eax
callq 0x2200
testl %eax, %eax
js 0x4ca0
movl %eax, %r14d
leaq 0x8(%rbx), %rsi
movl (%rbx), %edx
movl %eax, %edi
callq 0x2150
testq %rax, %rax
jle 0x4cb7
movl %eax, 0x4(%rbx)
movl %r14d, %edi
callq 0x2140
jmp 0x4cdc
leaq 0x4030(%rip), %rsi      # 0x8996
movq %r14, %rdi
callq 0x2210
testq %rax, %rax
je 0x4ca9
movq %rax, 0x18(%rsp)
movq %rbx, 0x28(%rsp)
leaq 0x8(%rbx), %rax
movq %rax, 0x20(%rsp)
xorl %r15d, %r15d
movq $0x0, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
leaq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rbx
movq %rbx, %rdx
callq 0x2250
cmpq $-0x1, %rax
je 0x4a32
cmpq $0xb, %rax
jle 0x4c35
movq 0x8(%rsp), %rbp
cmpb $0x3a, (%rbp)
jne 0x4c44
movl $0x1, %eax
xorl %ebx, %ebx
movb (%rbp,%rax), %cl
leal -0x30(%rcx), %edx
cmpb $0xa, %dl
jb 0x49f4
movl %ecx, %edx
andb $-0x21, %dl
addb $-0x41, %dl
addb $-0x37, %cl
cmpb $0x6, %dl
movzbl %cl, %edx
cmovael %r15d, %edx
shlb $0x4, %bl
orb %dl, %bl
incq %rax
cmpq $0x2, %rax
je 0x49d3
movzbl %bl, %r12d
testb %bl, %bl
je 0x4a55
movq %r12, %rdi
callq 0x21c0
movq %rax, %r13
testq %rax, %rax
jne 0x4a58
leaq 0x8(%rsp), %rdi
callq 0x2745
movb $0x1, %bpl
xorl %r12d, %r12d
xorl %r14d, %r14d
jmp 0x4beb
movq %rbx, %rdi
callq 0x2180
movb $0x1, %bpl
testl %eax, %eax
je 0x4c8f
xorl %ebx, %ebx
xorl %r12d, %r12d
xorl %r14d, %r14d
xorl %r13d, %r13d
jmp 0x4beb
xorl %r13d, %r13d
movl $0x3, %ecx
xorl %eax, %eax
movb (%rbp,%rcx), %dl
leal -0x30(%rdx), %esi
cmpb $0xa, %sil
jb 0x4a84
movl %edx, %esi
andb $-0x21, %sil
addb $-0x41, %sil
addb $-0x37, %dl
cmpb $0x6, %sil
movzbl %dl, %esi
cmovael %r15d, %esi
shlb $0x4, %al
orb %sil, %al
incq %rcx
cmpq $0x4, %rcx
je 0x4a5f
movl $0x5, %edx
xorl %ecx, %ecx
movb (%rbp,%rdx), %sil
leal -0x30(%rsi), %edi
cmpb $0xa, %dil
jb 0x4ac2
movl %esi, %edi
andb $-0x21, %dil
addb $-0x41, %dil
addb $-0x37, %sil
cmpb $0x6, %dil
movzbl %sil, %edi
cmovael %r15d, %edi
shlb $0x4, %cl
orb %dil, %cl
incq %rdx
cmpq $0x6, %rdx
je 0x4a9a
movzbl %al, %r9d
movl $0x7, %esi
xorl %r14d, %r14d
movb (%rbp,%rsi), %dil
leal -0x30(%rdi), %r8d
cmpb $0xa, %r8b
jb 0x4b03
movl %edi, %edx
andb $-0x21, %dl
addb $-0x41, %dl
addb $-0x37, %dil
cmpb $0x6, %dl
movzbl %dil, %r8d
cmovael %r15d, %r8d
shlb $0x4, %r14b
orb %r8b, %r14b
incq %rsi
cmpq $0x8, %rsi
je 0x4add
addb %bl, %al
addb %cl, %al
addb %r14b, %al
testb %bl, %bl
je 0x4b8b
movl %r9d, 0x14(%rsp)
leaq 0x9(%rbp), %rdi
movl $0x9, %esi
xorl %r8d, %r8d
xorl %r9d, %r9d
xorl %r10d, %r10d
movb (%rdi,%r9), %r11b
leal -0x30(%r11), %edx
cmpb $0xa, %dl
jb 0x4b5a
movl %r11d, %edx
andb $-0x21, %dl
addb $-0x41, %dl
addb $-0x37, %r11b
cmpb $0x6, %dl
movzbl %r11b, %edx
cmovael %r15d, %edx
shlb $0x4, %r10b
orb %dl, %r10b
incq %r9
cmpq $0x1, %r9
je 0x4b35
movb %r10b, (%r13,%r8)
addb %r10b, %al
addq $0x2, %rsi
incq %r8
addq $0x2, %rdi
cmpq %r12, %r8
jne 0x4b2f
movl %esi, %esi
movl 0x14(%rsp), %r9d
jmp 0x4b90
movl $0x9, %esi
movzbl %cl, %ecx
movzwl %r9w, %r12d
shll $0x8, %r12d
orl %ecx, %r12d
addq %rbp, %rsi
xorl %edx, %edx
xorl %ecx, %ecx
movb (%rsi,%rdx), %dil
leal -0x30(%rdi), %r8d
cmpb $0xa, %r8b
jb 0x4bce
movl %edi, %r8d
andb $-0x21, %r8b
addb $-0x41, %r8b
addb $-0x37, %dil
cmpb $0x6, %r8b
movzbl %dil, %r8d
cmovael %r15d, %r8d
shlb $0x4, %cl
orb %r8b, %cl
incq %rdx
cmpq $0x1, %rdx
je 0x4ba5
addb %al, %cl
jne 0x4c56
movq %rbp, %rdi
callq 0x2030
xorl %ebp, %ebp
testb %bpl, %bpl
jne 0x4cd2
testb %r14b, %r14b
jne 0x498d
movzwl %r12w, %edi
movq 0x28(%rsp), %r14
movl (%r14), %eax
cmpl %edi, %eax
jb 0x4ccd
movzbl %bl, %edx
leal (%rdi,%rdx), %ebx
cmpl %eax, %ebx
ja 0x4ccd
addq 0x20(%rsp), %rdi
movq %r13, %rsi
callq 0x21a0
movl %ebx, 0x4(%r14)
jmp 0x498d
movq %rax, %rdi
leaq 0x8(%rsp), %rsi
callq 0x275f
jmp 0x4c4e
leaq 0x8(%rsp), %rdi
callq 0x271b
movb $0x1, %bpl
jmp 0x4a45
movzbl %cl, %edx
movq 0x8398(%rip), %rax      # 0xcff8
movq (%rax), %rdi
leaq 0x3dd2(%rip), %rsi      # 0x8a3c
xorl %eax, %eax
callq 0x2170
testb %bl, %bl
je 0x4c7d
movq %r13, %rdi
callq 0x2030
movq 0x8(%rsp), %rdi
callq 0x2030
movb $0x1, %bpl
jmp 0x4beb
leaq 0x3d3e(%rip), %rdi      # 0x89d4
callq 0x2230
jmp 0x4a45
leaq 0x3cc1(%rip), %rdi      # 0x8968
jmp 0x4cb0
leaq 0x3ce8(%rip), %rdi      # 0x8998
callq 0x2230
jmp 0x4cde
leaq 0x3cc1(%rip), %rdi      # 0x897f
callq 0x2230
movl %r14d, %edi
callq 0x2140
jmp 0x4cde
callq 0x2788
movq 0x18(%rsp), %rdi
callq 0x20a0
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq