	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function get_io_resource
_get_io_resource:                       ## @get_io_resource
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpq	$0, (%rdi)
	je	LBB0_19
## %bb.1:
	movl	%esi, %r15d
	movq	%rdi, %r14
	callq	_cpqhp_resource_sort_and_combine
	testq	%rax, %rax
	jne	LBB0_19
## %bb.2:
	movq	%r14, %rdi
	callq	_sort_by_size
	testq	%rax, %rax
	je	LBB0_3
LBB0_19:
	xorl	%ebx, %ebx
LBB0_20:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	movq	(%r14), %rbx
	testq	%rbx, %rbx
	je	LBB0_19
## %bb.4:
	leal	-1(%r15), %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	testl	$768, %eax                      ## imm = 0x300
	je	LBB0_14
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_19
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %ecx
	cmpl	%r15d, %ecx
	jl	LBB0_18
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%rbx), %eax
	testl	%r12d, %eax
	je	LBB0_10
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %r13d
	orl	%r12d, %r13d
	movl	%r13d, %edx
	notl	%edx
	addl	%eax, %ecx
	addl	%edx, %ecx
	cmpl	%r15d, %ecx
	jl	LBB0_18
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	incl	%r13d
	movl	4(%rbx), %ecx
	movl	%ecx, 4(%rax)
	movl	%r13d, %edx
	subl	4(%rbx), %edx
	movl	%edx, (%rax)
	movl	%r13d, 4(%rbx)
	movl	(%rbx), %ecx
	subl	%edx, %ecx
	movl	%ecx, (%rbx)
	movq	8(%rbx), %rdx
	movq	%rdx, 8(%rax)
	movq	%rax, 8(%rbx)
	movl	%r13d, %eax
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	cmpl	%r15d, %ecx
	jle	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$16, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	4(%rbx), %ecx
	addl	%r15d, %ecx
	movl	%ecx, 4(%rax)
	movl	(%rbx), %ecx
	subl	%r15d, %ecx
	movl	%ecx, (%rax)
	movl	%r15d, (%rbx)
	movq	8(%rbx), %rcx
	movq	%rcx, 8(%rax)
	movq	%rax, 8(%rbx)
	movl	4(%rbx), %eax
	jmp	LBB0_13
LBB0_14:
	movq	(%r14), %rax
	cmpq	%rbx, %rax
	je	LBB0_17
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	%rax, %r14
	movq	8(%rax), %rax
	cmpq	%rbx, %rax
	jne	LBB0_15
## %bb.16:
	addq	$8, %r14
LBB0_17:
	movq	8(%rbx), %rax
	movq	%rax, (%r14)
	movq	$0, 8(%rbx)
	jmp	LBB0_20
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_get_io_resource
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function get_io_resource
_get_io_resource:                       ; @get_io_resource
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	x8, [x0]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x21, x1
	mov	x20, x0
	bl	_cpqhp_resource_sort_and_combine
	cbnz	x0, LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_sort_by_size
	cbz	x0, LBB0_5
LBB0_3:
	mov	x19, #0
LBB0_4:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x19, [x20]
	cbz	x19, LBB0_4
; %bb.6:
	sub	w22, w21, #1
Lloh0:
	adrp	x23, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _GFP_KERNEL@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:                                 ;   in Loop: Header=BB0_9 Depth=1
	tst	w8, #0x300
	b.eq	LBB0_17
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	ldr	x19, [x19, #8]
	cbz	x19, LBB0_4
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x19]
	cmp	w9, w21
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [x19, #4]
	tst	w8, w22
	b.eq	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=1
	orr	w24, w8, w22
	mvn	w10, w24
	add	w8, w8, w9
	add	w8, w8, w10
	cmp	w8, w21
	b.lt	LBB0_8
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x23]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.13:                               ;   in Loop: Header=BB0_9 Depth=1
	add	w8, w24, #1
	ldr	w9, [x19, #4]
	str	w9, [x0, #4]
	ldr	w9, [x19, #4]
	sub	w9, w8, w9
	str	w9, [x0]
	ldr	w10, [x19]
	sub	w9, w10, w9
	stp	w9, w8, [x19]
	ldr	x10, [x19, #8]
	str	x10, [x0, #8]
	str	x0, [x19, #8]
LBB0_14:                                ;   in Loop: Header=BB0_9 Depth=1
	cmp	w9, w21
	b.le	LBB0_7
; %bb.15:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w1, [x23]
	mov	w0, #16
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.16:                               ;   in Loop: Header=BB0_9 Depth=1
	ldp	w9, w8, [x19]
	add	w8, w8, w21
	sub	w9, w9, w21
	stp	w9, w8, [x0]
	str	w21, [x19]
	ldr	x8, [x19, #8]
	str	x8, [x0, #8]
	str	x0, [x19, #8]
	ldr	w8, [x19, #4]
	b	LBB0_7
LBB0_17:
	ldr	x8, [x20]
	cmp	x8, x19
	b.eq	LBB0_20
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	mov	x9, x8
	ldr	x8, [x8, #8]
	cmp	x8, x19
	b.ne	LBB0_18
; %bb.19:
	add	x20, x9, #8
LBB0_20:
	ldr	x8, [x19, #8]
	str	x8, [x20]
	str	xzr, [x19, #8]
	b	LBB0_4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_get_io_resource
.subsections_via_symbols
