// File: /workspace/github_cpp_makefile_star2_O1/romkatv[P]hcproxy/src/forwarder.cc
// Function: hcproxy::(anonymous namespace)::Buffer::Init(unsigned long)
bool Init(size_t size_bytes) {
    CHECK(size_bytes > 0 && size_bytes < std::numeric_limits<int>::max());
    if (pipe(pipe_) != 0) {
      LOG(ERROR) << "pipe() failed: " << Errno();
      CHECK(errno == EMFILE || errno == ENFILE) << Errno();
      for (int& fd : pipe_) fd = -1;
      return false;
    }
    CHECK((capacity_ = fcntl(pipe_[0], F_SETPIPE_SZ, size_bytes)) > 0) << Errno();
    for (int fd : pipe_) {
      CHECK(fd >= 0);
      CHECK(fcntl(fd, F_GETPIPE_SZ) == capacity_);
    }
    return true;
  }

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
subq $0x20, %rsp
leaq -0x1(%rsi), %rax
cmpq $0x7ffffffe, %rax       # imm = 0x7FFFFFFE
jae 0x1edb2
movq %rsi, %r14
movq %rdi, %rbx
addq $0x8, %rdi
callq 0x15460
movl %eax, %ebp
testl %eax, %eax
je 0x1ecc8
leaq 0xb1290(%rip), %rsi     # 0xcfefc
movq %rsp, %r14
movq %r14, %rdi
movl $0x35, %edx
movl $0x2, %ecx
callq 0x2019c
movq 0x18(%r14), %rdi
leaq 0xb14f0(%rip), %rsi     # 0xd017c
movl $0xf, %edx
callq 0x8bab0
movl (%rsp), %esi
movq 0x18(%rsp), %rdi
callq 0x2023b
movq %rsp, %rdi
callq 0x19e28
callq 0x15640
movl (%rax), %eax
addl $-0x17, %eax
cmpl $0x1, %eax
ja 0x1edf7
movq $-0x1, 0x8(%rbx)
jmp 0x1ed0c
movl 0x8(%rbx), %edi
movl $0x407, %esi            # imm = 0x407
movq %r14, %rdx
xorl %eax, %eax
callq 0x158f0
movl %eax, (%rbx)
testl %eax, %eax
jle 0x1ee48
movl $0x8, %r14d
movl (%rbx,%r14), %edi
testl %edi, %edi
js 0x1ed1a
movl $0x408, %esi            # imm = 0x408
xorl %eax, %eax
callq 0x158f0
cmpl (%rbx), %eax
jne 0x1ed66
addq $0x4, %r14
cmpq $0x10, %r14
jne 0x1ecea
testl %ebp, %ebp
sete %al
addq $0x20, %rsp
popq %rbx
popq %r14
popq %rbp
retq
leaq 0xb11db(%rip), %rsi     # 0xcfefc
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3c, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb11e2(%rip), %rsi     # 0xcff23
movl $0x7, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xb55b4(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x1eeb9
leaq 0xb118f(%rip), %rsi     # 0xcfefc
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3d, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb145e(%rip), %rsi     # 0xd01eb
movl $0x24, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xb5568(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
jmp 0x1eeb9
leaq 0xb1143(%rip), %rsi     # 0xcfefc
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x33, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb1364(%rip), %rsi     # 0xd013d
movl $0x3e, %edx
callq 0x8bab0
leaq 0xb5521(%rip), %rsi     # 0xd430b
movq %rsp, %rdi
callq 0x18a7b
jmp 0x1eeb9
leaq 0xb10fe(%rip), %rsi     # 0xcfefc
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x36, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb136e(%rip), %rsi     # 0xd018c
movl $0x22, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xb54d7(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
movq %rsp, %rdi
callq 0x19e13
jmp 0x1eeb9
leaq 0xb10ad(%rip), %rsi     # 0xcfefc
movq %rsp, %rbx
movq %rbx, %rdi
movl $0x3a, %edx
movl $0x3, %ecx
callq 0x2019c
movq 0x18(%rbx), %rdi
leaq 0xb1340(%rip), %rsi     # 0xd01af
movl $0x3b, %edx
callq 0x8bab0
movq 0x18(%rsp), %rdi
leaq 0xb5486(%rip), %rsi     # 0xd430b
movl $0x2, %edx
callq 0x8bab0
movl (%rsp), %esi
movq 0x18(%rsp), %rdi
callq 0x2023b
jmp 0x1eeb9
jmp 0x1eeb9
jmp 0x1eeb9
jmp 0x1eeb9
movq %rax, %rbx
movq %rsp, %rdi
callq 0x19e28
movq %rbx, %rdi
callq 0xcc900
jmp 0x1eeb9
movq %rsp, %rdi
callq 0x18aaa
nop