	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_pre_bridge_resource_split
_do_pre_bridge_resource_split:          ## @do_pre_bridge_resource_split
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %rbx
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rdi
	callq	_dbg
	cmpq	$0, (%r12)
	je	LBB0_9
## %bb.1:
	cmpq	$0, (%rbx)
	je	LBB0_9
## %bb.2:
	movq	%r12, %rdi
	callq	_cpqhp_resource_sort_and_combine
	testl	%eax, %eax
	jne	LBB0_9
## %bb.6:
	movq	(%r12), %r14
	movq	(%r14), %rcx
	movq	(%rbx), %rax
	cmpq	(%rax), %rcx
	jne	LBB0_9
## %bb.7:
	movq	8(%r14), %rcx
	cmpq	8(%rax), %rcx
	je	LBB0_9
## %bb.11:
	leal	-1(%r15), %ebx
	movslq	%ebx, %rax
	testq	%rax, %rcx
	je	LBB0_14
## %bb.12:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.13:
	orl	8(%r14), %ebx
	subl	%r15d, %ebx
	incl	%ebx
	movq	(%r14), %rcx
	movq	%rcx, (%rax)
	movslq	%ebx, %rdx
	movq	%rdx, 8(%rax)
	movq	8(%r14), %rcx
	subq	%rdx, %rcx
	movq	%rcx, 8(%r14)
	movq	8(%rax), %rdx
	addq	%rdx, (%r14)
	movq	%rax, (%r12)
	movq	%r14, 16(%rax)
LBB0_14:
	movslq	%r15d, %rax
	cmpq	%rax, %rcx
	jge	LBB0_16
LBB0_9:
	xorl	%r14d, %r14d
LBB0_10:
	movq	%r14, %rax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	(%r12), %rax
	cmpq	%r14, %rax
	je	LBB0_19
	.p2align	4, 0x90
LBB0_17:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %r12
	movq	16(%rax), %rax
	cmpq	%r14, %rax
	jne	LBB0_17
## %bb.18:
	addq	$16, %r12
LBB0_19:
	movq	16(%r14), %rax
	movq	%rax, (%r12)
	movq	$0, 16(%r14)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"do_pre_bridge_resource_split\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_do_pre_bridge_resource_split
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_pre_bridge_resource_split
_do_pre_bridge_resource_split:          ; @do_pre_bridge_resource_split
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg
	ldr	x8, [x20]
	cbz	x8, LBB0_9
; %bb.1:
	ldr	x8, [x22]
	cbz	x8, LBB0_9
; %bb.2:
	mov	x0, x20
	bl	_cpqhp_resource_sort_and_combine
	cbnz	w0, LBB0_9
; %bb.3:
	ldr	x19, [x20]
	ldr	x8, [x19]
	ldr	x9, [x22]
	ldr	x10, [x9]
	cmp	x8, x10
	b.ne	LBB0_9
; %bb.4:
	ldr	x8, [x19, #8]
	ldr	x9, [x9, #8]
	cmp	x8, x9
	b.eq	LBB0_9
; %bb.5:
	sub	w22, w21, #1
	sxtw	x9, w22
	tst	x8, x9
	b.eq	LBB0_8
; %bb.6:
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	w0, #24
	bl	_kmalloc
	cbz	x0, LBB0_9
; %bb.7:
	ldr	w8, [x19, #8]
	orr	w8, w22, w8
	sub	w8, w8, w21
	add	w8, w8, #1
	ldr	x9, [x19]
	sxtw	x8, w8
	stp	x9, x8, [x0]
	ldp	x10, x9, [x19]
	sub	x8, x9, x8
	str	x8, [x19, #8]
	ldr	x9, [x0, #8]
	add	x9, x10, x9
	str	x9, [x19]
	str	x0, [x20]
	str	x19, [x0, #16]
LBB0_8:
	cmp	x8, w21, sxtw
	b.ge	LBB0_11
LBB0_9:
	mov	x19, #0
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
	ldr	x8, [x20]
	cmp	x8, x19
	b.eq	LBB0_14
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	mov	x9, x8
	ldr	x8, [x8, #16]
	cmp	x8, x19
	b.ne	LBB0_12
; %bb.13:
	add	x20, x9, #16
LBB0_14:
	ldr	x8, [x19, #16]
	str	x8, [x20]
	str	xzr, [x19, #16]
	b	LBB0_10
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"do_pre_bridge_resource_split\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_do_pre_bridge_resource_split
.subsections_via_symbols
