// File: /workspace/github_cpp_makefile_star2_O3/Thomas1995[P]Rentz/src/./event.h
// Function: event::send(int)
void send(int fd) {
    std::vector<uint8_t> header(8, 0);
    ((uint32_t *)header.data())[0] = htonl(type);
    ((uint32_t *)header.data())[1] = htonl(len);

    std::vector<uint8_t> message;
    message.reserve(8 + len + 2);
    message.push_back(FLAG);

    for(auto &b: header) {
      append(b);
    }

    for(size_t i = 0; i < len; ++i) {
      uint8_t b = data[i];
      append(b);
    }

    message.push_back(FLAG);

    int rem = message.size();
    uint8_t *at = message.data();

    while(rem > 0) {
      const int n = ::send(fd, at, rem, 0);
      rem -= n;
      at += n;
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
movq %rdi, %r14
movl $0x8, %edi
callq 0x3230
movq %rax, %rbx
movl (%r14), %eax
bswapl %eax
movl %eax, (%rbx)
movq 0x8(%r14), %rsi
movl %esi, %eax
bswapl %eax
movl %eax, 0x4(%rbx)
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
addq $0xa, %rsi
callq 0x5ef4
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x8162
movb $0x7e, (%rsi)
incq 0x18(%rsp)
jmp 0x8173
leaq 0x568f(%rip), %rdx      # 0xd7f8
leaq 0x10(%rsp), %rdi
callq 0xc004
movl %ebp, 0x34(%rsp)
xorl %ebp, %ebp
leaq 0x10(%rsp), %r12
leaq 0xe(%rsp), %r13
leaq (%rbx,%rbp), %r15
movb (%rbx,%rbp), %al
leal -0x7d(%rax), %edx
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rcx
cmpb $0x1, %dl
ja 0x81ab
cmpq %rcx, %rsi
je 0x81b9
movb $0x7d, (%rsi)
incq 0x18(%rsp)
jmp 0x81c8
cmpq %rcx, %rsi
je 0x81de
movb %al, (%rsi)
incq 0x18(%rsp)
jmp 0x81e9
movq %r12, %rdi
leaq 0x5636(%rip), %rdx      # 0xd7f9
callq 0xc004
movb (%r15), %al
xorb $0x20, %al
movb %al, 0xe(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x6018
jmp 0x81e9
movq %r12, %rdi
movq %r15, %rdx
callq 0xc004
incq %rbp
cmpq $0x8, %rbp
jne 0x8183
cmpq $0x0, 0x8(%r14)
je 0x8284
xorl %r15d, %r15d
leaq 0x55f2(%rip), %rbp      # 0xd7f9
leaq 0x10(%rsp), %r12
leaq 0xf(%rsp), %r13
movq 0x10(%r14), %rax
movb (%rax,%r15), %al
movb %al, 0xe(%rsp)
leal -0x7d(%rax), %edx
movq 0x18(%rsp), %rsi
movq 0x20(%rsp), %rcx
cmpb $0x1, %dl
ja 0x823e
cmpq %rcx, %rsi
je 0x824c
movb $0x7d, (%rsi)
incq 0x18(%rsp)
jmp 0x8257
cmpq %rcx, %rsi
je 0x826e
movb %al, (%rsi)
incq 0x18(%rsp)
jmp 0x827b
movq %r12, %rdi
movq %rbp, %rdx
callq 0xc004
movb 0xe(%rsp), %al
xorb $0x20, %al
movb %al, 0xf(%rsp)
movq %r12, %rdi
movq %r13, %rsi
callq 0x6018
jmp 0x827b
movq %r12, %rdi
leaq 0xe(%rsp), %rdx
callq 0xc004
incq %r15
cmpq 0x8(%r14), %r15
jb 0x8211
movq 0x18(%rsp), %rsi
cmpq 0x20(%rsp), %rsi
je 0x82a6
movb $0x7e, (%rsi)
movq 0x18(%rsp), %r15
incq %r15
movq %r15, 0x18(%rsp)
movl 0x34(%rsp), %ebp
jmp 0x82c0
leaq 0x554b(%rip), %rdx      # 0xd7f8
leaq 0x10(%rsp), %rdi
callq 0xc004
movl 0x34(%rsp), %ebp
movq 0x18(%rsp), %r15
movq 0x10(%rsp), %r14
subl %r14d, %r15d
testl %r15d, %r15d
jle 0x82eb
movl %r15d, %edx
movl %ebp, %edi
movq %r14, %rsi
xorl %ecx, %ecx
callq 0x3110
cltq
addq %rax, %r14
subl %eax, %r15d
jg 0x82cd
movq 0x10(%rsp), %r14
testq %r14, %r14
je 0x8300
movq 0x20(%rsp), %rsi
subq %r14, %rsi
movq %r14, %rdi
callq 0x3240
movl $0x8, %esi
movq %rbx, %rdi
callq 0x3240
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x8326
jmp 0x8326
jmp 0x8326
jmp 0x8326
jmp 0x8326
movq %rax, %r14
movq 0x10(%rsp), %rdi
testq %rdi, %rdi
je 0x8340
movq 0x20(%rsp), %rsi
subq %rdi, %rsi
callq 0x3240
movl $0x8, %esi
movq %rbx, %rdi
callq 0x3240
movq %r14, %rdi
callq 0x33a0
nop