// File: /workspace/github_c_makefile_star2_O2/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, -0x48(%rbp)
movq %rdi, -0x40(%rbp)
pushq $0x1
popq %r15
xorl %r12d, %r12d
testq %r15, %r15
je 0x3c8e
movb $0x0, -0x29(%rbp)
andl $0x0, -0x30(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x29(%rbp), %rsi
pushq $0x1
popq %rdx
callq *0x10(%rdi)
testb %al, %al
je 0x3c68
movzbl -0x29(%rbp), %r13d
movl %r13d, %edi
leaq -0x31(%rbp), %rsi
callq 0x361f
testb %al, %al
je 0x3c6c
movzbl -0x31(%rbp), %ebx
movzbl %bl, %r14d
cmpq $0x21, %rbx
ja 0x3c22
movabsq $0x3c0000006, %rax      # imm = 0x3C0000006
btq %rbx, %rax
jae 0x3c22
testb $0x1, %r12b
movb $0x1, %r12b
jne 0x3c70
leaq -0x1(%r15), %r13
cmpl $0x21, %ebx
ja 0x3c1a
movl %ebx, %eax
movl $0xc0000004, %ecx       # imm = 0xC0000004
btq %rax, %rcx
jb 0x3bfc
movabsq $0x300000002, %rcx      # imm = 0x300000002
btq %rax, %rcx
jae 0x3c1a
movzbl -0x29(%rbp), %esi
movq -0x40(%rbp), %rdi
movl %r14d, %edx
leaq -0x30(%rbp), %rcx
callq 0x398b
testb %al, %al
je 0x3c8e
movl -0x30(%rbp), %eax
leaq (%r13,%rax,2), %r13
jmp 0x3c1a
movzbl -0x29(%rbp), %esi
movq -0x40(%rbp), %rdi
movl %r14d, %edx
leaq -0x30(%rbp), %rcx
callq 0x398b
testb %al, %al
je 0x3c8e
movl -0x30(%rbp), %eax
addq %rax, %r13
movq %r13, %r15
jmp 0x3b41
movq -0x40(%rbp), %rdi
movl %r13d, %esi
movl %r14d, %edx
leaq -0x30(%rbp), %rcx
callq 0x398b
testb %al, %al
je 0x3c8e
movl -0x30(%rbp), %eax
testl %eax, %eax
je 0x3bb0
cmpl $0x1a, %ebx
ja 0x3c58
movl $0x7c00e00, %ecx        # imm = 0x7C00E00
btl %ebx, %ecx
jae 0x3c58
incl %eax
movl %eax, -0x30(%rbp)
movl %eax, %esi
movq -0x40(%rbp), %rdi
callq 0x3ac1
jmp 0x3bb0
movb $0x7, %cl
jmp 0x3c88
movb $0xd, %cl
jmp 0x3c88
movq -0x48(%rbp), %rdx
movb %bl, (%rdx)
movq -0x40(%rbp), %rdi
movl %r13d, %esi
callq 0x367a
movb $0x10, %cl
testb %al, %al
je 0x3c8e
movq -0x40(%rbp), %rax
movb %cl, (%rax)
testq %r15, %r15
sete %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq