// File: /workspace/github_c_makefile_star2_O0/BatchLabs[P]msgpack-dump/src/cmp.c
// Function: cmp_skip_object_flat
bool cmp_skip_object_flat(cmp_ctx_t *ctx, cmp_object_t *obj) {
  size_t element_count = 1;
  bool in_container = false;

  while (element_count) {
    uint8_t type_marker = 0;
    uint8_t cmp_type;
    uint32_t size = 0;

    if (!read_type_marker(ctx, &type_marker)) {
      return false;
    }

    if (!type_marker_to_cmp_type(type_marker, &cmp_type)) {
      ctx->error = INVALID_TYPE_ERROR;
      return false;
    }

    switch (cmp_type) {
      case CMP_TYPE_FIXARRAY:
      case CMP_TYPE_ARRAY16:
      case CMP_TYPE_ARRAY32:
      case CMP_TYPE_FIXMAP:
      case CMP_TYPE_MAP16:
      case CMP_TYPE_MAP32:
        if (in_container) {
          obj->type = cmp_type;

          if (!read_obj_data(ctx, type_marker, obj)) {
            return false;
          }

          ctx->error = SKIP_DEPTH_LIMIT_EXCEEDED_ERROR;
          return false;
        }

        in_container = true;

        break;
      default:
        if (!read_type_size(ctx, type_marker, cmp_type, &size)) {
          return false;
        }

        if (size) {
          switch (cmp_type) {
            case CMP_TYPE_FIXEXT1:
            case CMP_TYPE_FIXEXT2:
            case CMP_TYPE_FIXEXT4:
            case CMP_TYPE_FIXEXT8:
            case CMP_TYPE_FIXEXT16:
            case CMP_TYPE_EXT8:
            case CMP_TYPE_EXT16:
            case CMP_TYPE_EXT32:
              size++;
            default:
              break;
          }

          skip_bytes(ctx, size);
        }
    }

    element_count--;

    switch (cmp_type) {
      case CMP_TYPE_FIXARRAY:
      case CMP_TYPE_ARRAY16:
      case CMP_TYPE_ARRAY32:
        if (!read_type_size(ctx, type_marker, cmp_type, &size)) {
          return false;
        }
        element_count += size;
        break;
      case CMP_TYPE_FIXMAP:
      case CMP_TYPE_MAP16:
      case CMP_TYPE_MAP32:
        if (!read_type_size(ctx, type_marker, cmp_type, &size)) {
          return false;
        }
        element_count += ((size_t)size) * 2;
        break;
      default:
        break;
    }
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x1, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x6ac5
movb $0x0, -0x22(%rbp)
movl $0x0, -0x28(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x22(%rbp), %rsi
callq 0x57f0
testb $0x1, %al
jne 0x693c
movb $0x0, -0x1(%rbp)
jmp 0x6ac9
leaq -0x23(%rbp), %rsi
movzbl -0x22(%rbp), %edi
callq 0x5830
testb $0x1, %al
jne 0x695d
movq -0x10(%rbp), %rax
movb $0xd, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6ac9
movzbl -0x23(%rbp), %eax
movl %eax, -0x2c(%rbp)
decl %eax
subl $0x2, %eax
jb 0x697a
jmp 0x696d
movl -0x2c(%rbp), %eax
addl $-0x1e, %eax
subl $0x3, %eax
ja 0x69bf
jmp 0x697a
testb $0x1, -0x21(%rbp)
je 0x69b9
movb -0x23(%rbp), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rdi
movb -0x22(%rbp), %al
movq -0x18(%rbp), %rdx
movzbl %al, %esi
callq 0x5ad0
testb $0x1, %al
jne 0x69a9
movb $0x0, -0x1(%rbp)
jmp 0x6ac9
movq -0x10(%rbp), %rax
movb $0x10, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6ac9
movb $0x1, -0x21(%rbp)
jmp 0x6a22
movq -0x10(%rbp), %rdi
movb -0x22(%rbp), %al
leaq -0x28(%rbp), %rcx
movzbl %al, %esi
movzbl -0x23(%rbp), %edx
callq 0x62f0
testb $0x1, %al
jne 0x69e3
movb $0x0, -0x1(%rbp)
jmp 0x6ac9
cmpl $0x0, -0x28(%rbp)
je 0x6a20
movzbl -0x23(%rbp), %eax
movl %eax, -0x30(%rbp)
addl $-0x9, %eax
subl $0x3, %eax
jb 0x6a07
jmp 0x69fa
movl -0x30(%rbp), %eax
addl $-0x16, %eax
subl $0x4, %eax
ja 0x6a10
jmp 0x6a07
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x6a12
movq -0x10(%rbp), %rdi
movl -0x28(%rbp), %eax
movl %eax, %esi
callq 0x6860
jmp 0x6a22
movq -0x20(%rbp), %rax
decq %rax
movq %rax, -0x20(%rbp)
movzbl -0x23(%rbp), %eax
movl %eax, -0x34(%rbp)
subl $0x1, %eax
je 0x6a8d
jmp 0x6a3b
movl -0x34(%rbp), %eax
subl $0x2, %eax
je 0x6a5f
jmp 0x6a45
movl -0x34(%rbp), %eax
addl $-0x1e, %eax
subl $0x2, %eax
jb 0x6a5f
jmp 0x6a52
movl -0x34(%rbp), %eax
addl $-0x20, %eax
subl $0x2, %eax
jb 0x6a8d
jmp 0x6abe
movq -0x10(%rbp), %rdi
movb -0x22(%rbp), %al
leaq -0x28(%rbp), %rcx
movzbl %al, %esi
movzbl -0x23(%rbp), %edx
callq 0x62f0
testb $0x1, %al
jne 0x6a80
movb $0x0, -0x1(%rbp)
jmp 0x6ac9
movl -0x28(%rbp), %eax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x6ac0
movq -0x10(%rbp), %rdi
movb -0x22(%rbp), %al
leaq -0x28(%rbp), %rcx
movzbl %al, %esi
movzbl -0x23(%rbp), %edx
callq 0x62f0
testb $0x1, %al
jne 0x6aae
movb $0x0, -0x1(%rbp)
jmp 0x6ac9
movl -0x28(%rbp), %eax
shlq %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x6ac0
jmp 0x6ac0
jmp 0x690c
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)