// File: /workspace/github_c_makefile_star2_O0/redis-force[P]rpm/module/rpm_redis.c
// Function: redis_response_reader_read_bulk_item
static int32_t redis_response_reader_read_bulk_item(redis_response_reader *reader) {
  redis_response_reader_task *cur = reader->tasks + reader->task_idx;
  void *obj = NULL;
  char *p, *s;
  long len;
  unsigned long bytelen;
  int32_t success = 0;

  p = reader->buf + reader->pos;
  s = redis_response_reader_seek_crlf(p, reader->len - reader->pos);
  if (s != NULL) {
    p = reader->buf + reader->pos;
    bytelen = s - (reader->buf + reader->pos) + 2;
    len = redis_response_reader_read_integer(p);

    if (len < 0) {
      obj = redis_response_reader_create_nil(reader, cur);
      success = 1;
    } else {
      bytelen += len + 2;
      if (reader->pos + bytelen <= reader->len) {
        obj = redis_response_reader_create_string(reader, cur, s + 2, len);
        success = 1;
      }
    }
    if (success) {
      if (obj == NULL) {
        redis_response_reader_set_error_oom(reader);
        return reader->err;
      }
      reader->pos += bytelen;
      if (reader->task_idx == 0) {
        reader->response = obj;
      }
      redis_response_reader_next_task(reader);
      return REDIS_RESPONSE_OK;
    }
  }

  return REDIS_RESPONSE_ERROR_WOULDBLOCK;
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq 0x38(%rsp), %rax
addq $0xb8, %rax
movq 0x38(%rsp), %rcx
movslq 0x1d8(%rcx), %rcx
shlq $0x5, %rcx
addq %rcx, %rax
movq %rax, 0x30(%rsp)
movq $0x0, 0x28(%rsp)
movl $0x0, 0x4(%rsp)
movq 0x38(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x38(%rsp), %rcx
addq 0xa0(%rcx), %rax
movq %rax, 0x20(%rsp)
movq 0x20(%rsp), %rdi
movq 0x38(%rsp), %rax
movq 0xa8(%rax), %rsi
movq 0x38(%rsp), %rax
subq 0xa0(%rax), %rsi
callq 0xc2b0
movq %rax, 0x18(%rsp)
cmpq $0x0, 0x18(%rsp)
je 0xb9b9
movq 0x38(%rsp), %rax
movq 0x90(%rax), %rax
movq 0x38(%rsp), %rcx
addq 0xa0(%rcx), %rax
movq %rax, 0x20(%rsp)
movq 0x18(%rsp), %rax
movq 0x38(%rsp), %rcx
movq 0x90(%rcx), %rcx
movq 0x38(%rsp), %rdx
addq 0xa0(%rdx), %rcx
subq %rcx, %rax
addq $0x2, %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rdi
callq 0xbf30
movq %rax, 0x10(%rsp)
cmpq $0x0, 0x10(%rsp)
jge 0xb8e8
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
callq 0xc3f0
movq %rax, 0x28(%rsp)
movl $0x1, 0x4(%rsp)
jmp 0xb946
movq 0x10(%rsp), %rax
addq $0x2, %rax
addq 0x8(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x38(%rsp), %rax
movq 0xa0(%rax), %rax
addq 0x8(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq 0xa8(%rcx), %rax
ja 0xb944
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movq 0x18(%rsp), %rdx
addq $0x2, %rdx
movq 0x10(%rsp), %rcx
callq 0xc000
movq %rax, 0x28(%rsp)
movl $0x1, 0x4(%rsp)
jmp 0xb946
cmpl $0x0, 0x4(%rsp)
je 0xb9b7
cmpq $0x0, 0x28(%rsp)
jne 0xb96c
movq 0x38(%rsp), %rdi
callq 0xb0b0
movq 0x38(%rsp), %rax
movl (%rax), %eax
movl %eax, 0x44(%rsp)
jmp 0xb9c1
movq 0x8(%rsp), %rcx
movq 0x38(%rsp), %rax
addq 0xa0(%rax), %rcx
movq %rcx, 0xa0(%rax)
movq 0x38(%rsp), %rax
cmpl $0x0, 0x1d8(%rax)
jne 0xb9a3
movq 0x28(%rsp), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x1e0(%rax)
movq 0x38(%rsp), %rdi
callq 0xc180
movl $0x0, 0x44(%rsp)
jmp 0xb9c1
jmp 0xb9b9
movl $0x1, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nopw (%rax,%rax)