// File: /workspace/github_c_makefile_star2_O1/redis-force[P]rpm/module/rpm.c
// Function: rpm_worker_log_read
static void rpm_worker_log_read(RedisModuleCtx *ctx, int fd, void *client_data, int mask, const char *level) {
  int rd;
  worker_pipe *pipe = client_data;
  worker_process *worker = pipe->worker;
  char *buf = worker->buf, *start, *end, *linefeed = NULL;
  REDISMODULE_NOT_USED(mask);
  while ((rd = read(fd, buf, sizeof(worker->buf))) > 0) {
    linefeed = start = buf;
    end = buf + rd;
scan_for_lf:
    if (start < end && (linefeed = memchr(start, '\n', end - start)) != NULL) {
      rpm_worker_log_flush(ctx, pipe, start, linefeed - start, level);
      start = linefeed + 1;
      goto scan_for_lf;
    }
    /* check if there are more data without linefeed left in read buffer */
    if (linefeed == NULL && start < end) {
      rpm_worker_pipe_buffer_data(pipe, start, end - start);
    }
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x468, %rsp            # imm = 0x468
movq %rcx, %r14
movq %rdx, %r12
movl %esi, %ecx
movq %rdi, 0x50(%rsp)
movq (%rdx), %rax
movq %rax, 0x18(%rsp)
leaq 0xa8(%rax), %rsi
movl $0x100000, %edx         # imm = 0x100000
movl %ecx, 0x14(%rsp)
movl %ecx, %edi
movq %rsi, 0x20(%rsp)
callq 0x5170
movq %rax, %r15
testl %r15d, %r15d
jle 0x7853
leaq 0x8(%r12), %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%r12), %rax
movq %rax, 0x28(%rsp)
leaq 0x18(%r12), %rax
movq %rax, 0x40(%rsp)
leaq 0x20(%r12), %rax
movq %rax, 0x38(%rsp)
addq $0xa8, 0x18(%rsp)
movq %r12, 0x30(%rsp)
movq %r14, 0x48(%rsp)
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
je 0x7834
addq 0x18(%rsp), %r15
movq 0x20(%rsp), %rbx
movq %r15, 0x58(%rsp)
subq %rbx, %r15
movq %rbx, %rdi
movl $0xa, %esi
movq %r15, %rdx
callq 0x5160
testq %rax, %rax
je 0x77eb
movq %rax, %rbp
movslq 0x20(%r12), %r15
testq %r15, %r15
jle 0x7718
movq 0x8(%rsp), %rax
movq (%rax), %r12
testq %r12, %r12
je 0x771d
xorl %r14d, %r14d
movslq 0xc(%r12), %rax
leaq (%r14,%rax), %rcx
movl $0x3e8, %r13d           # imm = 0x3E8
subq %r14, %r13
movl $0x3e8, %edx            # imm = 0x3E8
cmpq %rdx, %rcx
cmovbq %rax, %r13
testq %r13, %r13
je 0x7705
leaq 0x20(%r12), %rsi
leaq (%rsp,%r14), %rdi
addq $0x60, %rdi
movq %r13, %rdx
callq 0x5210
addq %r13, %r14
movq (%r12), %r12
testq %r12, %r12
jne 0x76ca
movslq %r14d, %r13
movq 0x48(%rsp), %r14
jmp 0x7720
xorl %r13d, %r13d
jmp 0x7750
xorl %r13d, %r13d
movq 0x8(%rsp), %r12
movq %r12, %rdi
movq %r15, %rsi
callq 0x50d0
xorps %xmm0, %xmm0
movups %xmm0, (%r12)
movq 0x30(%rsp), %r12
movq 0x28(%rsp), %rax
movq %rax, 0x18(%r12)
movl $0x0, 0x20(%r12)
movq %rbp, %rax
subq %rbx, %rax
leaq (%rax,%r13), %rcx
movl $0x3e8, %r15d           # imm = 0x3E8
subq %r13, %r15
movl $0x3e8, %edx            # imm = 0x3E8
cmpq %rdx, %rcx
cmovbq %rax, %r15
testq %r15, %r15
je 0x778a
leaq (%rsp,%r13), %rdi
addq $0x60, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5210
addq %r15, %r13
cmpl $0x3e8, %r13d           # imm = 0x3E8
jne 0x77ad
leaq 0x448(%rsp), %rax
movw $0x2e2e, 0x4(%rax)      # imm = 0x2E2E
movl $0x2e2e2e2e, (%rax)     # imm = 0x2E2E2E2E
movl $0x3ee, %r13d           # imm = 0x3EE
movslq %r13d, %rax
movb $0x0, 0x60(%rsp,%rax)
movq 0x50(%rsp), %rdi
movq %r14, %rsi
leaq 0x3926(%rip), %rdx      # 0xb0ea
leaq 0x60(%rsp), %rcx
xorl %eax, %eax
movq 0x6696(%rip), %r8       # 0xde68
callq *(%r8)
incq %rbp
movq %rbp, %rbx
movq 0x58(%rsp), %r15
cmpq %r15, %rbp
jb 0x7691
jmp 0x7834
movslq %r15d, %r15
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x40(%rsp), %rdx
movq 0x38(%rsp), %rcx
movq %r15, %r8
movl $0x400, %r9d            # imm = 0x400
callq 0x5360
movq %rax, %r12
movslq 0xc(%rax), %rax
leaq (%r12,%rax), %rdi
addq $0x20, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5210
addl %r15d, 0xc(%r12)
movq 0x30(%rsp), %r12
movl $0x100000, %edx         # imm = 0x100000
movl 0x14(%rsp), %edi
movq 0x20(%rsp), %rsi
callq 0x5170
movq %rax, %r15
testl %r15d, %r15d
jg 0x7675
addq $0x468, %rsp            # imm = 0x468
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq