	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kempf_restore_buf
_kempf_restore_buf:                     ## @kempf_restore_buf
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movq	%r8, %r14
	movl	%ecx, -56(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r13
	movl	%esi, %ebx
	movq	%rdi, %r15
	movl	16(%rbp), %edi
	movl	$16, %esi
	callq	_FFALIGN
	movl	%eax, %r12d
	leaq	-68(%rbp), %rdi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_init_get_bits8
	testl	%eax, %eax
	js	LBB0_13
## %bb.1:
	movl	40(%rbp), %eax
	movl	$1, %ecx
	cmpl	$3, %eax
	jl	LBB0_4
## %bb.2:
	movl	$2, %ecx
	cmpl	$5, %eax
	jb	LBB0_4
## %bb.3:
	xorl	%ecx, %ecx
	cmpl	$17, %eax
	setae	%cl
	leal	4(,%rcx,4), %ecx
LBB0_4:
	cmpl	$0, 24(%rbp)
	jle	LBB0_12
## %bb.5:
	movl	16(%rbp), %eax
	subl	%eax, %r12d
	movl	%ecx, -60(%rbp)                 ## 4-byte Spill
	imull	%ecx, %r12d
	movl	%r12d, -64(%rbp)                ## 4-byte Spill
	movslq	-56(%rbp), %r15                 ## 4-byte Folded Reload
	movslq	-48(%rbp), %rcx                 ## 4-byte Folded Reload
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, %eax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	leaq	-68(%rbp), %r12
	movq	%r15, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%r12, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	callq	_skip_bits_long
	movq	-88(%rbp), %r15                 ## 8-byte Reload
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	movq	%rbx, %r13
	movq	-96(%rbp), %rbx                 ## 8-byte Reload
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=1
	incl	%ebx
	leaq	(%r13,%r15,4), %r13
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leaq	(%r14,%rax,4), %r14
	cmpl	24(%rbp), %ebx
	je	LBB0_12
LBB0_6:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movq	%r12, %rdi
	movl	$8, %esi
	callq	_get_bits
	testl	%eax, %eax
	jne	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, -96(%rbp)                 ## 8-byte Spill
	cmpl	$0, 16(%rbp)
	movl	-60(%rbp), %r15d                ## 4-byte Reload
	movq	%r13, %rbx
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	jle	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_6 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r12, %rdi
	movl	%r15d, %esi
	callq	_get_bits
                                        ## kill: def $eax killed $eax def $rax
	movl	%r13d, %ecx
	shlq	$2, %rcx
	leaq	(%rbx,%rcx), %rdi
	addq	-48(%rbp), %rcx                 ## 8-byte Folded Reload
	cmpl	48(%rbp), %eax
	leal	(%rax,%rax,2), %eax
	cltq
	movq	32(%rbp), %rdx
	leaq	(%rdx,%rax,4), %rsi
	cmoveq	%rcx, %rsi
	movl	$3, %edx
	callq	_memcpy
	addq	$3, %r13
	cmpq	%r13, %r14
	jne	LBB0_9
	jmp	LBB0_10
LBB0_12:
	xorl	%eax, %eax
LBB0_13:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_kempf_restore_buf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kempf_restore_buf
_kempf_restore_buf:                     ; @kempf_restore_buf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x7
	mov	x20, x5
	mov	x21, x4
	mov	x26, x3
	mov	x22, x2
	mov	x23, x1
	mov	x27, x0
	str	w6, [sp, #24]                   ; 4-byte Folded Spill
	mov	x0, x6
	mov	w1, #16
	bl	_FFALIGN
	mov	x24, x0
	add	x0, sp, #28
	mov	x1, x27
	mov	x2, x23
	bl	_init_get_bits8
	tbnz	w0, #31, LBB0_10
; %bb.1:
	ldr	w8, [x29, #24]
	mov	w9, #1
	mov	w10, #2
	mov	w11, #8
	mov	w12, #4
	cmp	w8, #17
	csel	w11, w12, w11, lo
	cmp	w8, #5
	csel	w10, w10, w11, lo
	cmp	w8, #3
	csel	w23, w9, w10, lt
	cmp	w19, #1
	b.lt	LBB0_9
; %bb.2:
	mov	w27, #0
	ldr	w28, [x29, #28]
	ldr	x25, [x29, #16]
	ldr	w9, [sp, #24]                   ; 4-byte Folded Reload
	sub	w8, w24, w9
	mul	w8, w23, w8
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	sxtw	x24, w26
	sxtw	x26, w20
	mov	w8, w9
	add	x20, x8, w9, uxtw #1
	str	x26, [sp, #8]                   ; 8-byte Folded Spill
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x0, sp, #28
	ldr	w1, [sp, #20]                   ; 4-byte Folded Reload
	bl	_skip_bits_long
	mov	x19, x26
	ldr	x26, [sp, #8]                   ; 8-byte Folded Reload
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w27, w27, #1
	add	x22, x22, x24, lsl #2
	add	x21, x21, x26, lsl #2
	cmp	w27, w19
	b.eq	LBB0_9
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	add	x0, sp, #28
	mov	w1, #8
	bl	_get_bits
	cbnz	w0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x26, x19
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x19, #0
LBB0_8:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x0, sp, #28
	mov	x1, x23
	bl	_get_bits
	ubfiz	x9, x19, #2, #32
	add	x8, x22, x9
	add	w10, w0, w0, lsl #1
	add	x10, x25, w10, sxtw #2
	add	x9, x21, x9
	cmp	w0, w28
	csel	x1, x9, x10, eq
	mov	x0, x8
	mov	w2, #3
	bl	_memcpy
	add	x19, x19, #3
	cmp	x20, x19
	b.ne	LBB0_8
	b	LBB0_3
LBB0_9:
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_kempf_restore_buf
.subsections_via_symbols
