// File: /workspace/github_c_makefile_star2_O3/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 $0x458, %rsp            # imm = 0x458
movq %rcx, %rbp
movl %esi, %ecx
movq %rdi, 0x40(%rsp)
movq %rdx, %rbx
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 0x78a6
leaq 0x20(%rbx), %r14
leaq 0x8(%rbx), %rax
movq %rax, 0x8(%rsp)
leaq 0x10(%rbx), %rax
movq %rax, 0x28(%rsp)
addq $0x18, %rbx
movq %rbx, 0x30(%rsp)
addq $0xa8, 0x18(%rsp)
movq %r14, (%rsp)
movq %rbp, 0x38(%rsp)
andl $0x7fffffff, %r15d      # imm = 0x7FFFFFFF
je 0x7887
addq 0x18(%rsp), %r15
movq 0x20(%rsp), %rbx
movq %r15, 0x48(%rsp)
subq %rbx, %r15
movq %rbx, %rdi
movl $0xa, %esi
movq %r15, %rdx
callq 0x5160
testq %rax, %rax
je 0x7841
movq %rax, %r12
movslq (%r14), %r15
testq %r15, %r15
jle 0x776f
movq 0x8(%rsp), %rax
movq (%rax), %r14
testq %r14, %r14
je 0x7774
xorl %ebp, %ebp
movslq 0xc(%r14), %rax
leaq (%rax,%rbp), %rcx
movl $0x3e8, %r13d           # imm = 0x3E8
subq %rbp, %r13
movl $0x3e8, %edx            # imm = 0x3E8
cmpq %rdx, %rcx
cmovbq %rax, %r13
testq %r13, %r13
je 0x775d
leaq 0x20(%r14), %rsi
leaq (%rsp,%rbp), %rdi
addq $0x50, %rdi
movq %r13, %rdx
callq 0x5210
addq %r13, %rbp
movq (%r14), %r14
testq %r14, %r14
jne 0x7724
movslq %ebp, %r13
movq 0x38(%rsp), %rbp
jmp 0x7777
xorl %r13d, %r13d
jmp 0x77a6
xorl %r13d, %r13d
movq 0x8(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x50d0
xorps %xmm0, %xmm0
movups %xmm0, (%r14)
movq 0x30(%rsp), %rax
movq 0x28(%rsp), %rcx
movq %rcx, (%rax)
movq (%rsp), %r14
movl $0x0, (%r14)
movq %r12, %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 0x77e0
leaq (%rsp,%r13), %rdi
addq $0x50, %rdi
movq %rbx, %rsi
movq %r15, %rdx
callq 0x5210
addq %r15, %r13
cmpl $0x3e8, %r13d           # imm = 0x3E8
jne 0x7803
leaq 0x438(%rsp), %rax
movw $0x2e2e, 0x4(%rax)      # imm = 0x2E2E
movl $0x2e2e2e2e, (%rax)     # imm = 0x2E2E2E2E
movl $0x3ee, %r13d           # imm = 0x3EE
movslq %r13d, %rax
movb $0x0, 0x50(%rsp,%rax)
movq 0x40(%rsp), %rdi
movq %rbp, %rsi
leaq 0x38d0(%rip), %rdx      # 0xb0ea
leaq 0x50(%rsp), %rcx
xorl %eax, %eax
movq 0x6640(%rip), %r8       # 0xde68
callq *(%r8)
incq %r12
movq %r12, %rbx
movq 0x48(%rsp), %r15
cmpq %r15, %r12
jb 0x76ee
jmp 0x7887
movslq %r15d, %r14
movq 0x8(%rsp), %rdi
movq 0x28(%rsp), %rsi
movq 0x30(%rsp), %rdx
movq (%rsp), %rcx
movq %r14, %r8
movl $0x400, %r9d            # imm = 0x400
callq 0x5360
movq %rax, %r15
movslq 0xc(%rax), %rax
leaq (%r15,%rax), %rdi
addq $0x20, %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x5210
addl %r14d, 0xc(%r15)
movq (%rsp), %r14
movl $0x100000, %edx         # imm = 0x100000
movl 0x14(%rsp), %edi
movq 0x20(%rsp), %rsi
callq 0x5170
movq %rax, %r15
testl %r15d, %r15d
jg 0x76d2
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq