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

// Assembly:
subq $0x108, %rsp            # imm = 0x108
movq %rdi, 0xf8(%rsp)
movq %rsi, 0xf0(%rsp)
movq 0xf8(%rsp), %rax
movq %rax, 0x60(%rsp)
cmpq $0x0, 0xf0(%rsp)
je 0x1e5cd
movq 0xf0(%rsp), %rax
cmpq $0x0, (%rax)
je 0x1e5dd
movl $0x5, 0x104(%rsp)
jmp 0x1e95f
movq 0x60(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, 0x8(%rcx)
movb %al, 0x5f(%rsp)
je 0x1e5f7
movb $0x1, %al
movb %al, 0x5f(%rsp)
jmp 0x1e5f7
movb 0x5f(%rsp), %al
testb $0x1, %al
jne 0x1e601
jmp 0x1e603
jmp 0x1e622
leaq 0xa8dbb(%rip), %rdi     # 0xc73c5
leaq 0xa8cf4(%rip), %rsi     # 0xc7305
movl $0x54, %edx
leaq 0xa8e5d(%rip), %rcx     # 0xc747a
callq 0x15150
movq 0x60(%rsp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x1e63e
movl $0x2, 0x104(%rsp)
jmp 0x1e95f
leaq 0xd8(%rsp), %rdi
callq 0x20190
leaq 0xbf(%rsp), %rdi
movq %rdi, 0x50(%rsp)
callq 0x25790
movq 0x50(%rsp), %rdx
leaq 0xc0(%rsp), %rdi
movl $0x2000, %esi           # imm = 0x2000
callq 0x1f480
jmp 0x1e676
leaq 0xbf(%rsp), %rdi
callq 0x257b0
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rdi
callq 0x15530
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x1e6d3
movl $0x2, 0xa8(%rsp)
jmp 0x1e833
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0xbf(%rsp), %rdi
callq 0x257b0
jmp 0x1e935
xorl %eax, %eax
movl %eax, %esi
leaq 0xc0(%rsp), %rdi
movq %rdi, 0x38(%rsp)
callq 0x1f500
movq 0x38(%rsp), %rdi
movq %rax, 0x40(%rsp)
callq 0x1f520
movq 0x40(%rsp), %rdi
movq %rax, %rdx
movq 0x60(%rsp), %rax
movq 0x8(%rax), %rcx
movl $0x1, %esi
callq 0x15470
movq %rax, 0x48(%rsp)
jmp 0x1e71a
movq 0x48(%rsp), %rax
movq %rax, 0xa0(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0x1e759
movq 0xa0(%rsp), %rax
movq %rax, 0x30(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x1f520
movq %rax, %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
jbe 0x1e79a
movl $0x2, 0x104(%rsp)
movl $0x1, 0xa8(%rsp)
jmp 0x1e833
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x1f640
jmp 0x1e935
leaq 0xc0(%rsp), %rdi
callq 0x214f0
movq %rax, 0x28(%rsp)
jmp 0x1e7ae
movq 0x28(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0xc0(%rsp), %rdi
callq 0x21520
movq %rax, 0x20(%rsp)
jmp 0x1e7cf
movq 0x20(%rsp), %rax
movq %rax, 0x90(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x21550
movq %rax, 0x18(%rsp)
jmp 0x1e7f0
movq 0x18(%rsp), %rax
movq %rax, 0x88(%rsp)
movq 0x98(%rsp), %rdi
movq 0x90(%rsp), %rsi
movq 0x88(%rsp), %rdx
callq 0x21480
movq %rax, 0x10(%rsp)
jmp 0x1e821
movq 0x10(%rsp), %rax
movq %rax, 0x80(%rsp)
jmp 0x1e683
leaq 0xc0(%rsp), %rdi
callq 0x1f640
movl 0xa8(%rsp), %eax
subl $0x2, %eax
jne 0x1e926
jmp 0x1e852
leaq 0xd8(%rsp), %rdi
callq 0x20e00
testb $0x1, %al
jne 0x1e865
jmp 0x1e86e
xorl %eax, %eax
movq %rax, 0x8(%rsp)
jmp 0x1e884
leaq 0xd8(%rsp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x1f500
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq %rax, 0x70(%rsp)
leaq 0xd8(%rsp), %rdi
callq 0x1f520
movq %rax, 0x68(%rsp)
leaq 0x78(%rsp), %rdi
leaq 0x70(%rsp), %rsi
leaq 0x68(%rsp), %rdx
callq 0x1f540
jmp 0x1e8b6
movq 0xf0(%rsp), %rsi
leaq 0x78(%rsp), %rdi
callq 0x1f410
movl %eax, 0x4(%rsp)
jmp 0x1e8ce
movl 0x4(%rsp), %eax
movl %eax, 0x104(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x1f460
movl $0x1, 0xa8(%rsp)
jmp 0x1e926
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
jmp 0x1e935
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0xb0(%rsp)
movl %eax, 0xac(%rsp)
leaq 0x78(%rsp), %rdi
callq 0x1f460
jmp 0x1e935
leaq 0xd8(%rsp), %rdi
callq 0x1f640
jmp 0x1e95f
leaq 0xd8(%rsp), %rdi
callq 0x1f640
movq 0xb0(%rsp), %rdi
callq 0x23770
callq 0x237e0
movl $0x2, 0x104(%rsp)
movl 0x104(%rsp), %eax
addq $0x108, %rsp            # imm = 0x108
retq
nop