	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movl	%esi, %ecx
	negl	%ecx
	cmovsl	%esi, %ecx
	testl	%esi, %esi
	jns	LBB0_1
## %bb.2:
	movq	_qtrue@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_1:
	movq	_qfalse@GOTPCREL(%rip), %rax
LBB0_3:
	movq	(%rax), %rbx
	cmpq	$0, 24(%r15)
	je	LBB0_11
## %bb.4:
	cmpl	$32, %ecx
	je	LBB0_9
## %bb.5:
	cmpl	$16, %ecx
	je	LBB0_8
## %bb.6:
	cmpl	$8, %ecx
	jne	LBB0_10
## %bb.7:
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movl	(%rax,%rcx,4), %r13d
	incq	%rcx
	movq	%rcx, 8(%r15)
	addl	$8, 16(%r15)
	movl	$8, %ecx
	jmp	LBB0_20
LBB0_11:
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%ecx, %r14d
	andl	$7, %r14d
	je	LBB0_12
## %bb.13:
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	leaq	16(%r15), %r12
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rdi
	movq	%r12, %rsi
	callq	_Huff_getBit
	movl	%ebx, %ecx
	shll	%cl, %eax
	orl	%eax, %r13d
	incl	%ebx
	cmpl	%ebx, %r14d
	jne	LBB0_14
## %bb.15:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	andl	$2147483640, %ecx               ## imm = 0x7FFFFFF8
	testl	%ecx, %ecx
	jne	LBB0_17
	jmp	LBB0_19
LBB0_9:
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movl	(%rax,%rcx,4), %edi
	callq	_LittleLong
	movl	%eax, %r13d
	addq	$4, 8(%r15)
	addl	$32, 16(%r15)
	movl	$32, %ecx
	jmp	LBB0_20
LBB0_8:
	movq	(%r15), %rax
	movq	8(%r15), %rcx
	movzwl	(%rax,%rcx,4), %edi
	callq	_LittleShort
	movl	%eax, %r13d
	addq	$2, 8(%r15)
	addl	$16, 16(%r15)
	movl	$16, %ecx
	jmp	LBB0_20
LBB0_10:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ecx, %edx
	movq	%rcx, %r14
	callq	_Com_Error
	movq	%r14, %rcx
	xorl	%r13d, %r13d
	jmp	LBB0_20
LBB0_12:
	xorl	%r13d, %r13d
	testl	%ecx, %ecx
	je	LBB0_19
LBB0_17:
	leaq	16(%r15), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	_msgHuff@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r15), %rdx
	leaq	-52(%rbp), %rsi
	movq	%r15, %r12
	movq	%rcx, %r15
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	callq	_Huff_offsetReceive
	movl	-52(%rbp), %eax
	movl	%ebx, %ecx
	orl	%r14d, %ecx
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %eax
	movq	%r15, %rcx
	movq	%r12, %r15
	orl	%eax, %r13d
	addl	$8, %ebx
	cmpl	%ecx, %ebx
	jb	LBB0_18
LBB0_19:
	movl	16(%r15), %eax
	sarl	$3, %eax
	incl	%eax
	cltq
	movq	%rax, 8(%r15)
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
LBB0_20:
	testq	%rbx, %rbx
	je	LBB0_23
## %bb.21:
	leal	-1(%rcx), %eax
	movzbl	%al, %eax
	btl	%eax, %r13d
	jae	LBB0_23
## %bb.22:
	movl	$-1, %eax
                                        ## kill: def $cl killed $cl killed $rcx
	shll	%cl, %eax
	orl	%eax, %r13d
LBB0_23:
	movl	%r13d, %eax
	addq	$24, %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\n"

	.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
	mov	x19, x0
	cmp	w1, #0
Lloh0:
	adrp	x8, _qtrue@GOTPAGE
Lloh1:
	ldr	x8, [x8, _qtrue@GOTPAGEOFF]
	cneg	w20, w1, mi
Lloh2:
	adrp	x9, _qfalse@GOTPAGE
Lloh3:
	ldr	x9, [x9, _qfalse@GOTPAGEOFF]
	csel	x8, x8, x9, lt
	ldr	x23, [x8]
	ldr	x8, [x0, #24]
	cbz	x8, LBB0_5
; %bb.1:
	cmp	w20, #32
	b.eq	LBB0_14
; %bb.2:
	cmp	w20, #16
	b.eq	LBB0_15
; %bb.3:
	cmp	w20, #8
	b.ne	LBB0_16
; %bb.4:
	ldp	x8, x9, [x19]
	ldr	w21, [x8, x9, lsl #2]
	add	x8, x9, #1
	str	x8, [x19, #8]
	ldr	w8, [x19, #16]
	add	w8, w8, #8
	str	w8, [x19, #16]
	b	LBB0_21
LBB0_5:
	ands	w24, w20, #0x7
	b.eq	LBB0_17
; %bb.6:
	mov	x22, x19
	ldr	x0, [x22], #16
	mov	x1, x22
	bl	_Huff_getBit
	mov	x21, x0
	cmp	w24, #1
	b.eq	LBB0_13
; %bb.7:
	ldr	x0, [x19]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w21, w21, w0, lsl #1
	cmp	w24, #2
	b.eq	LBB0_13
; %bb.8:
	ldr	x0, [x19]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w21, w21, w0, lsl #2
	cmp	w24, #3
	b.eq	LBB0_13
; %bb.9:
	ldr	x0, [x19]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w21, w21, w0, lsl #3
	cmp	w24, #4
	b.eq	LBB0_13
; %bb.10:
	ldr	x0, [x19]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w21, w21, w0, lsl #4
	cmp	w24, #5
	b.eq	LBB0_13
; %bb.11:
	ldr	x0, [x19]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w21, w21, w0, lsl #5
	cmp	w24, #6
	b.eq	LBB0_13
; %bb.12:
	ldr	x0, [x19]
	mov	x1, x22
	bl	_Huff_getBit
	orr	w21, w21, w0, lsl #6
LBB0_13:
	and	w20, w20, #0x7ffffff8
	cbnz	w20, LBB0_18
	b	LBB0_20
LBB0_14:
	ldp	x8, x9, [x19]
	ldr	w0, [x8, x9, lsl #2]
	bl	_LittleLong
	mov	x21, x0
	ldr	x8, [x19, #8]
	add	x8, x8, #4
	str	x8, [x19, #8]
	ldr	w8, [x19, #16]
	add	w8, w8, #32
	str	w8, [x19, #16]
	b	LBB0_21
LBB0_15:
	ldp	x8, x9, [x19]
	lsl	x9, x9, #2
	ldrh	w0, [x8, x9]
	bl	_LittleShort
	mov	x21, x0
	ldr	x8, [x19, #8]
	add	x8, x8, #2
	str	x8, [x19, #8]
	ldr	w8, [x19, #16]
	add	w8, w8, #16
	str	w8, [x19, #16]
	b	LBB0_21
LBB0_16:
Lloh4:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh6:
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_Com_Error
	mov	w21, #0
	b	LBB0_21
LBB0_17:
	mov	w21, #0
	cbz	w20, LBB0_20
LBB0_18:
	mov	w25, #0
	add	x22, x19, #16
Lloh9:
	adrp	x26, _msgHuff@GOTPAGE
Lloh10:
	ldr	x26, [x26, _msgHuff@GOTPAGEOFF]
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x26]
	ldr	x2, [x19]
	add	x1, sp, #12
	mov	x3, x22
	bl	_Huff_offsetReceive
	ldr	w8, [sp, #12]
	orr	w9, w25, w24
	lsl	w8, w8, w9
	orr	w21, w8, w21
	add	w25, w25, #8
	cmp	w25, w20
	b.lo	LBB0_19
LBB0_20:
	ldr	w8, [x19, #16]
	asr	w8, w8, #3
	add	w8, w8, #1
	sxtw	x8, w8
	str	x8, [x19, #8]
LBB0_21:
	sub	w8, w20, #1
	lsr	w8, w21, w8
	mov	w9, #-1
	lsl	w9, w9, w20
	orr	w9, w9, w21
	tst	w8, #0x1
	csel	w8, w21, w9, eq
	cmp	x23, #0
	csel	w0, w21, w8, eq
	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 AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.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\n"

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