// File: tdv[P]boss/boss/include/common/file_stream.h
// Function: Boss::Private::IOFileStream<Boss::IIStream>::Read(unsigned int, Boss::IBuffer**)
virtual RetCode BOSS_CALL Read(UInt bytes, IBuffer **buffer)
      {
        if (!buffer || *buffer)
          return Status::InvalidArgument;
        assert(!!File && "File not open.");
        if (!File)
          return Status::Fail;
        try
        {
          if (!bytes)
            return Base<RawBuffer>::Create(nullptr, 0).QueryInterface(buffer);
          std::vector<char> Buffer(bytes);
          std::size_t Res = std::fread(&Buffer[0], 1, Buffer.size(), File);
          if (!Res || Res > Buffer.size())
            return Status::Fail;
          return Base<RawBuffer>::Create(&Buffer[0], Res).QueryInterface(buffer);
        }
        catch (...)
        {
        }
        return Status::Fail;
      }

// Assembly:
subq $0xd8, %rsp
movq %rdi, 0xc8(%rsp)
movl %esi, 0xc4(%rsp)
movq %rdx, 0xb8(%rsp)
movq 0xc8(%rsp), %rax
movq %rax, 0x48(%rsp)
cmpq $0x0, 0xb8(%rsp)
je 0x1e294
movq 0xb8(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1e2a4
movl $0x5, 0xd4(%rsp)
jmp 0x1e579
movq 0x48(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x8(%rcx)
movb %al, 0x47(%rsp)
je 0x1e2be
movb $0x1, %al
movb %al, 0x47(%rsp)
jmp 0x1e2be
movb 0x47(%rsp), %al
testb $0x1, %al
jne 0x1e2c8
jmp 0x1e2ca
jmp 0x1e2e9
leaq 0xa90f4(%rip), %rdi     # 0xc73c5
leaq 0xa902d(%rip), %rsi     # 0xc7305
movl $0x3e, %edx
leaq 0xa90fc(%rip), %rcx     # 0xc73e0
callq 0x15150
movq 0x48(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1e305
movl $0x2, 0xd4(%rsp)
jmp 0x1e579
cmpl $0x0, 0xc4(%rsp)
jne 0x1e3c0
movq $0x0, 0xa8(%rsp)
movl $0x0, 0xa4(%rsp)
leaq 0xb0(%rsp), %rdi
leaq 0xa8(%rsp), %rsi
leaq 0xa4(%rsp), %rdx
callq 0x1f300
jmp 0x1e349
movq 0xb8(%rsp), %rsi
leaq 0xb0(%rsp), %rdi
callq 0x1f410
movl %eax, 0x40(%rsp)
jmp 0x1e364
movl 0x40(%rsp), %eax
movl %eax, 0xd4(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x1f460
jmp 0x1e579
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1e55c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x1f460
jmp 0x1e55c
movl 0xc4(%rsp), %eax
movq %rax, 0x30(%rsp)
leaq 0x77(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x25790
movq 0x30(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x78(%rsp), %rdi
callq 0x1f480
jmp 0x1e3f1
leaq 0x77(%rsp), %rdi
callq 0x257b0
xorl %eax, %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
movq %rdi, 0x18(%rsp)
callq 0x1f500
movq 0x18(%rsp), %rdi
movq %rax, 0x20(%rsp)
callq 0x1f520
movq 0x20(%rsp), %rdi
movq %rax, %rdx
movq 0x48(%rsp), %rax
movq 0x8(%rax), %rcx
movl $0x1, %esi
callq 0x15470
movq %rax, 0x28(%rsp)
jmp 0x1e43f
movq 0x28(%rsp), %rax
movq %rax, 0x68(%rsp)
cmpq $0x0, 0x68(%rsp)
je 0x1e472
movq 0x68(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x1f520
movq %rax, %rcx
movq 0x10(%rsp), %rax
cmpq %rcx, %rax
jbe 0x1e4c6
movl $0x2, 0xd4(%rsp)
movl $0x1, 0x64(%rsp)
jmp 0x1e546
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x77(%rsp), %rdi
callq 0x257b0
jmp 0x1e55c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
jmp 0x1e552
xorl %eax, %eax
movl %eax, %esi
leaq 0x78(%rsp), %rdi
callq 0x1f500
movq %rax, 0x50(%rsp)
leaq 0x58(%rsp), %rdi
leaq 0x50(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x1f540
jmp 0x1e4ef
movq 0xb8(%rsp), %rsi
leaq 0x58(%rsp), %rdi
callq 0x1f410
movl %eax, 0xc(%rsp)
jmp 0x1e507
movl 0xc(%rsp), %eax
movl %eax, 0xd4(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x1f460
movl $0x1, 0x64(%rsp)
jmp 0x1e546
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x98(%rsp)
movl %eax, 0x94(%rsp)
leaq 0x58(%rsp), %rdi
callq 0x1f460
jmp 0x1e552
leaq 0x78(%rsp), %rdi
callq 0x1f640
jmp 0x1e579
leaq 0x78(%rsp), %rdi
callq 0x1f640
movq 0x98(%rsp), %rdi
callq 0x23770
callq 0x237e0
movl $0x2, 0xd4(%rsp)
movl 0xd4(%rsp), %eax
addq $0xd8, %rsp
retq
nopl (%rax,%rax)