// File: /workspace/github_c_makefile_star2_O0/BatchLabs[P]msgpack-dump/src/cmp.c
// Function: read_type_size
static bool read_type_size(cmp_ctx_t *ctx, uint8_t type_marker,
                                           uint8_t cmp_type,
                                           uint32_t *size) {
  uint8_t u8temp = 0;
  uint16_t u16temp = 0;
  uint32_t u32temp = 0;

  switch (cmp_type) {
    case CMP_TYPE_POSITIVE_FIXNUM:
      *size = 0;
      return true;
    case CMP_TYPE_FIXMAP:
      *size = (type_marker & FIXMAP_SIZE);
      return true;
    case CMP_TYPE_FIXARRAY:
      *size = (type_marker & FIXARRAY_SIZE);
      return true;
    case CMP_TYPE_FIXSTR:
      *size = (type_marker & FIXSTR_SIZE);
      return true;
    case CMP_TYPE_NIL:
      *size = 0;
      return true;
    case CMP_TYPE_BOOLEAN:
      *size = 0;
      return true;
    case CMP_TYPE_BIN8:
      if (!ctx->read(ctx, &u8temp, sizeof(uint8_t))) {
        ctx->error = LENGTH_READING_ERROR;
        return false;
      }
      *size = u8temp;
      return true;
    case CMP_TYPE_BIN16:
      if (!ctx->read(ctx, &u16temp, sizeof(uint16_t))) {
        ctx->error = LENGTH_READING_ERROR;
        return false;
      }
      *size = be16(u16temp);
      return true;
    case CMP_TYPE_BIN32:
      if (!ctx->read(ctx, &u32temp, sizeof(uint32_t))) {
        ctx->error = LENGTH_READING_ERROR;
        return false;
      }
      *size = be32(u32temp);
      return true;
    case CMP_TYPE_EXT8:
      if (!ctx->read(ctx, &u8temp, sizeof(uint8_t))) {
        ctx->error = LENGTH_READING_ERROR;
        return false;
      }
      *size = u8temp;
      return true;
    case CMP_TYPE_EXT16:
      if (!ctx->read(ctx, &u16temp, sizeof(uint16_t))) {
        ctx->error = LENGTH_READING_ERROR;
        return false;
      }
      *size = be16(u16temp);
      return true;
    case CMP_TYPE_EXT32:
      if (!ctx->read(ctx, &u32temp, sizeof(uint32_t))) {
        ctx->error = LENGTH_READING_ERROR;
        return false;
      }
      *size = be32(u32temp);
      return true;
    case CMP_TYPE_FLOAT:
      *size = 4;
      return true;
    case CMP_TYPE_DOUBLE:
      *size = 8;
      return true;
    case CMP_TYPE_UINT8:
      *size = 1;
      return true;
    case CMP_TYPE_UINT16:
      *size = 2;
      return true;
    case CMP_TYPE_UINT32:
      *size = 4;
      return true;
    case CMP_TYPE_UINT64:
      *size = 8;
      return true;
    case CMP_TYPE_SINT8:
      *size = 1;
      return true;
    case CMP_TYPE_SINT16:
      *size = 2;
      return true;
    case CMP_TYPE_SINT32:
      *size = 4;
      return true;
    case CMP_TYPE_SINT64:
      *size = 8;
      return true;
    case CMP_TYPE_FIXEXT1:
      *size = 1;
      return true;
    case CMP_TYPE_FIXEXT2:
      *size = 2;
      return true;
    case CMP_TYPE_FIXEXT4:
      *size = 4;
      return true;
    case CMP_TYPE_FIXEXT8:
      *size = 8;
      return true;
    case CMP_TYPE_FIXEXT16:
      *size = 16;
      return true;
    case CMP_TYPE_STR8:
      if (!ctx->read(ctx, &u8temp, sizeof(uint8_t))) {
        ctx->error = DATA_READING_ERROR;
        return false;
      }
      *size = u8temp;
      return true;
    case CMP_TYPE_STR16:
      if (!ctx->read(ctx, &u16temp, sizeof(uint16_t))) {
        ctx->error = DATA_READING_ERROR;
        return false;
      }
      *size = be16(u16temp);
      return true;
    case CMP_TYPE_STR32:
      if (!ctx->read(ctx, &u32temp, sizeof(uint32_t))) {
        ctx->error = DATA_READING_ERROR;
        return false;
      }
      *size = be32(u32temp);
      return true;
    case CMP_TYPE_ARRAY16:
      if (!ctx->read(ctx, &u16temp, sizeof(uint16_t))) {
        ctx->error = DATA_READING_ERROR;
        return false;
      }
      *size = be16(u16temp);
      return true;
    case CMP_TYPE_ARRAY32:
      if (!ctx->read(ctx, &u32temp, sizeof(uint32_t))) {
        ctx->error = DATA_READING_ERROR;
        return false;
      }
      *size = be32(u32temp);
      return true;
    case CMP_TYPE_MAP16:
      if (!ctx->read(ctx, &u16temp, sizeof(uint16_t))) {
        ctx->error = DATA_READING_ERROR;
        return false;
      }
      *size = be16(u16temp);
      return true;
    case CMP_TYPE_MAP32:
      if (!ctx->read(ctx, &u32temp, sizeof(uint32_t))) {
        ctx->error = DATA_READING_ERROR;
        return false;
      }
      *size = be32(u32temp);
      return true;
    case CMP_TYPE_NEGATIVE_FIXNUM:
      *size = 0;
      return true;
    default:
      ctx->error = INVALID_TYPE_ERROR;
      return false;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %dl, %al
movb %sil, %dl
movq %rdi, -0x10(%rbp)
movb %dl, -0x11(%rbp)
movb %al, -0x12(%rbp)
movq %rcx, -0x20(%rbp)
movb $0x0, -0x21(%rbp)
movw $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movzbl -0x12(%rbp), %eax
movq %rax, -0x30(%rbp)
subq $0x22, %rax
ja 0x684a
movq -0x30(%rbp), %rax
leaq 0x338f(%rip), %rcx      # 0x96c8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movzbl -0x11(%rbp), %ecx
andl $0xf, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movzbl -0x11(%rbp), %ecx
andl $0xf, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movzbl -0x11(%rbp), %ecx
andl $0x1f, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x21(%rbp), %rsi
movl $0x1, %edx
callq *%rax
testb $0x1, %al
jne 0x63e8
movq -0x10(%rbp), %rax
movb $0xe, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzbl -0x21(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x2, %edx
callq *%rax
testb $0x1, %al
jne 0x6426
movq -0x10(%rbp), %rax
movb $0xe, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzwl -0x24(%rbp), %edi
callq 0x1760
movzwl %ax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq *%rax
testb $0x1, %al
jne 0x646c
movq -0x10(%rbp), %rax
movb $0xe, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movl -0x28(%rbp), %edi
callq 0x1810
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x21(%rbp), %rsi
movl $0x1, %edx
callq *%rax
testb $0x1, %al
jne 0x64b0
movq -0x10(%rbp), %rax
movb $0xe, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzbl -0x21(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x2, %edx
callq *%rax
testb $0x1, %al
jne 0x64ee
movq -0x10(%rbp), %rax
movb $0xe, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzwl -0x24(%rbp), %edi
callq 0x1760
movzwl %ax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq *%rax
testb $0x1, %al
jne 0x6534
movq -0x10(%rbp), %rax
movb $0xe, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movl -0x28(%rbp), %edi
callq 0x1810
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x4, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x8, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x2, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x4, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x8, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x2, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x4, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x8, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x1, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x2, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x4, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x8, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x10, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x21(%rbp), %rsi
movl $0x1, %edx
callq *%rax
testb $0x1, %al
jne 0x6695
movq -0x10(%rbp), %rax
movb $0x9, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzbl -0x21(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x2, %edx
callq *%rax
testb $0x1, %al
jne 0x66d3
movq -0x10(%rbp), %rax
movb $0x9, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzwl -0x24(%rbp), %edi
callq 0x1760
movzwl %ax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq *%rax
testb $0x1, %al
jne 0x6719
movq -0x10(%rbp), %rax
movb $0x9, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movl -0x28(%rbp), %edi
callq 0x1810
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x2, %edx
callq *%rax
testb $0x1, %al
jne 0x675d
movq -0x10(%rbp), %rax
movb $0x9, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzwl -0x24(%rbp), %edi
callq 0x1760
movzwl %ax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq *%rax
testb $0x1, %al
jne 0x67a3
movq -0x10(%rbp), %rax
movb $0x9, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movl -0x28(%rbp), %edi
callq 0x1810
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x24(%rbp), %rsi
movl $0x2, %edx
callq *%rax
testb $0x1, %al
jne 0x67e4
movq -0x10(%rbp), %rax
movb $0x9, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movzwl -0x24(%rbp), %edi
callq 0x1760
movzwl %ax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rdi
leaq -0x28(%rbp), %rsi
movl $0x4, %edx
callq *%rax
testb $0x1, %al
jne 0x6824
movq -0x10(%rbp), %rax
movb $0x9, (%rax)
movb $0x0, -0x1(%rbp)
jmp 0x6855
movl -0x28(%rbp), %edi
callq 0x1810
movl %eax, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x6855
movq -0x10(%rbp), %rax
movb $0xd, (%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq