	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MSG_ReadBits                   ## -- Begin function MSG_ReadBits
	.p2align	4, 0x90
_MSG_ReadBits:                          ## @MSG_ReadBits
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %eax
	movq	%rdi, %r14
	movslq	(%rdi), %rsi
	movl	4(%rdi), %edi
	xorl	%r13d, %r13d
	cmpl	%edi, %esi
	jg	LBB0_31
## %bb.1:
	movl	$0, -44(%rbp)
	movl	%eax, %r12d
	negl	%r12d
	cmovsl	%eax, %r12d
	testl	%eax, %eax
	jns	LBB0_2
## %bb.3:
	movq	_qtrue@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_2:
	movq	_qfalse@GOTPCREL(%rip), %rax
LBB0_4:
	movq	(%rax), %rbx
	cmpq	$0, 24(%r14)
	je	LBB0_14
## %bb.5:
	movl	%r12d, %eax
	shrl	$3, %eax
	addl	%esi, %eax
	cmpl	%edi, %eax
	jle	LBB0_7
## %bb.6:
	incl	%edi
	movl	%edi, (%r14)
	jmp	LBB0_31
LBB0_14:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movl	%r12d, %r15d
	andl	$7, %r15d
	je	LBB0_15
## %bb.16:
	movl	16(%r14), %eax
	addl	%r15d, %eax
	leal	(,%rdi,8), %edx
	cmpl	%edx, %eax
	jle	LBB0_17
## %bb.32:
	incl	%edi
	movl	%edi, (%r14)
	xorl	%r13d, %r13d
	jmp	LBB0_31
LBB0_7:
	cmpl	$32, %r12d
	je	LBB0_12
## %bb.8:
	cmpl	$16, %r12d
	je	LBB0_11
## %bb.9:
	cmpl	$8, %r12d
	jne	LBB0_13
## %bb.10:
	movq	8(%r14), %rax
	movl	(%rax,%rsi,4), %r13d
	movl	%r13d, -44(%rbp)
	incl	%esi
	movl	%esi, (%r14)
	addl	$8, 16(%r14)
	movl	$8, %r12d
	jmp	LBB0_26
LBB0_15:
	xorl	%r13d, %r13d
	testl	%r12d, %r12d
	jne	LBB0_21
	jmp	LBB0_25
LBB0_17:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	leaq	16(%r14), %r12
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r14), %rdi
	movq	%r12, %rsi
	callq	_Huff_getBit
	movl	%ebx, %ecx
	shll	%cl, %eax
	orl	%eax, %r13d
	incl	%ebx
	cmpl	%ebx, %r15d
	jne	LBB0_18
## %bb.19:
	movl	%r13d, -44(%rbp)
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	andl	$2147483640, %r12d              ## imm = 0x7FFFFFF8
	testl	%r12d, %r12d
	je	LBB0_25
LBB0_21:
	leaq	16(%r14), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	4(%r14), %r8d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	_msgHuff@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	8(%r14), %rdx
	shll	$3, %r8d
	leaq	-60(%rbp), %rsi
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
                                        ## kill: def $r8d killed $r8d killed $r8
	callq	_Huff_offsetReceive
	movl	4(%r14), %r8d
	leal	(,%r8,8), %eax
	cmpl	%eax, 16(%r14)
	jg	LBB0_24
## %bb.22:                              ##   in Loop: Header=BB0_23 Depth=1
	movl	-60(%rbp), %eax
	movl	%ebx, %ecx
	orl	%r15d, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	orl	%eax, %r13d
	addl	$8, %ebx
	cmpl	%r12d, %ebx
	jb	LBB0_23
LBB0_25:
	movl	16(%r14), %eax
	sarl	$3, %eax
	incl	%eax
	movl	%eax, (%r14)
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	jmp	LBB0_26
LBB0_12:
	shlq	$2, %rsi
	addq	8(%r14), %rsi
	leaq	-44(%rbp), %rdi
	callq	_CopyLittleLong
	addl	$4, (%r14)
	addl	$32, 16(%r14)
	movl	-44(%rbp), %r13d
	jmp	LBB0_31
LBB0_11:
	shlq	$2, %rsi
	addq	8(%r14), %rsi
	leaq	-46(%rbp), %rdi
	callq	_CopyLittleShort
	movswl	-46(%rbp), %r13d
	movl	%r13d, -44(%rbp)
	addl	$2, (%r14)
	addl	$16, 16(%r14)
	movl	$16, %r12d
	jmp	LBB0_26
LBB0_24:
	incl	%r8d
	movl	%r8d, (%r14)
	xorl	%r13d, %r13d
	jmp	LBB0_31
LBB0_13:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r12d, %edx
	callq	_Com_Error
	xorl	%r13d, %r13d
LBB0_26:
	testq	%rbx, %rbx
	je	LBB0_31
## %bb.27:
	testl	%r12d, %r12d
	jle	LBB0_31
## %bb.28:
	cmpl	$31, %r12d
	jg	LBB0_31
## %bb.29:
	leal	-1(%r12), %eax
	movzbl	%al, %eax
	btl	%eax, %r13d
	jae	LBB0_31
## %bb.30:
	movl	$-1, %eax
	movl	%r12d, %ecx
	shll	%cl, %eax
	orl	%eax, %r13d
LBB0_31:
	movl	%r13d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_qfalse,8,3                     ## @qfalse
	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't read %d bits"

	.comm	_msgHuff,4,2                    ## @msgHuff
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MSG_ReadBits                   ; -- Begin function MSG_ReadBits
	.p2align	2
_MSG_ReadBits:                          ; @MSG_ReadBits
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldp	w8, w9, [x0]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	cmp	w8, w9
	b.le	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_33
LBB0_2:
	mov	x19, x0
	str	wzr, [sp, #12]
	cmp	w1, #0
Lloh0:
	adrp	x10, _qtrue@GOTPAGE
Lloh1:
	ldr	x10, [x10, _qtrue@GOTPAGEOFF]
	cneg	w21, w1, mi
Lloh2:
	adrp	x11, _qfalse@GOTPAGE
Lloh3:
	ldr	x11, [x11, _qfalse@GOTPAGEOFF]
	csel	x10, x10, x11, lt
	ldr	x23, [x10]
	ldr	x10, [x0, #24]
	cbz	x10, LBB0_8
; %bb.3:
	add	w10, w8, w21, lsr #3
	cmp	w10, w9
	b.gt	LBB0_10
; %bb.4:
	cmp	w21, #32
	b.eq	LBB0_25
; %bb.5:
	cmp	w21, #16
	b.eq	LBB0_26
; %bb.6:
	cmp	w21, #8
	b.ne	LBB0_27
; %bb.7:
	ldr	x9, [x19, #8]
	ldr	w20, [x9, x8, lsl #2]
	str	w20, [sp, #12]
	add	w8, w8, #1
	str	w8, [x19]
	ldr	w8, [x19, #16]
	add	w8, w8, #8
	str	w8, [x19, #16]
	b	LBB0_28
LBB0_8:
	ands	w24, w21, #0x7
	b.eq	LBB0_11
; %bb.9:
	mov	x22, x19
	ldr	w8, [x22, #16]!
	add	w8, w8, w24
	cmp	w8, w9, lsl #3
	b.le	LBB0_12
LBB0_10:
	mov	w20, #0
	add	w8, w9, #1
	str	w8, [x19]
	b	LBB0_33
LBB0_11:
	mov	w20, #0
	cbnz	w21, LBB0_20
	b	LBB0_23
LBB0_12:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_Huff_getBit
	mov	x20, x0
	cmp	w24, #1
	b.eq	LBB0_19
; %bb.13:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w20, w20, w0, lsl #1
	cmp	w24, #2
	b.eq	LBB0_19
; %bb.14:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w20, w20, w0, lsl #2
	cmp	w24, #3
	b.eq	LBB0_19
; %bb.15:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w20, w20, w0, lsl #3
	cmp	w24, #4
	b.eq	LBB0_19
; %bb.16:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w20, w20, w0, lsl #4
	cmp	w24, #5
	b.eq	LBB0_19
; %bb.17:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w20, w20, w0, lsl #5
	cmp	w24, #6
	b.eq	LBB0_19
; %bb.18:
	ldr	x0, [x19, #8]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w20, w20, w0, lsl #6
LBB0_19:
	str	w20, [sp, #12]
	and	w21, w21, #0x7ffffff8
	cbz	w21, LBB0_23
LBB0_20:
	mov	w25, #0
	add	x22, x19, #16
	ldr	w8, [x19, #4]
Lloh4:
	adrp	x26, _msgHuff@GOTPAGE
Lloh5:
	ldr	x26, [x26, _msgHuff@GOTPAGEOFF]
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	ldr	x2, [x19, #8]
	lsl	w4, w8, #3
	add	x1, sp, #8
	mov	x3, x22
	bl	_Huff_offsetReceive
	ldr	w9, [x19, #16]
	ldr	w8, [x19, #4]
	cmp	w9, w8, lsl #3
	b.gt	LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	w9, [sp, #8]
	orr	w10, w25, w24
	lsl	w9, w9, w10
	orr	w20, w9, w20
	add	w25, w25, #8
	cmp	w25, w21
	b.lo	LBB0_21
LBB0_23:
	ldr	w8, [x19, #16]
	asr	w8, w8, #3
	add	w8, w8, #1
	str	w8, [x19]
	b	LBB0_28
LBB0_24:
	mov	w20, #0
	add	w8, w8, #1
	str	w8, [x19]
	b	LBB0_33
LBB0_25:
	ldr	x9, [x19, #8]
	add	x1, x9, x8, lsl #2
	add	x0, sp, #12
	bl	_CopyLittleLong
	ldr	w8, [x19]
	add	w8, w8, #4
	str	w8, [x19]
	ldr	w8, [x19, #16]
	add	w8, w8, #32
	str	w8, [x19, #16]
	ldr	w20, [sp, #12]
	b	LBB0_33
LBB0_26:
	ldr	x9, [x19, #8]
	add	x1, x9, x8, lsl #2
	add	x0, sp, #6
	bl	_CopyLittleShort
	ldrsh	w20, [sp, #6]
	str	w20, [sp, #12]
	ldr	w8, [x19]
	add	w8, w8, #2
	str	w8, [x19]
	ldr	w8, [x19, #16]
	add	w8, w8, #16
	str	w8, [x19, #16]
	b	LBB0_28
LBB0_27:
Lloh6:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x21
	bl	_Com_Error
	mov	w20, #0
LBB0_28:
	cbz	x23, LBB0_33
; %bb.29:
	subs	w8, w21, #1
	b.lt	LBB0_33
; %bb.30:
	cmp	w21, #31
	b.gt	LBB0_33
; %bb.31:
	lsr	w8, w20, w8
	tbz	w8, #0, LBB0_33
; %bb.32:
	mov	w8, #-1
	lsl	w8, w8, w21
	orr	w20, w20, w8
LBB0_33:
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_qfalse,8,3                     ; @qfalse
	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't read %d bits"

	.comm	_msgHuff,4,2                    ; @msgHuff
.subsections_via_symbols
