	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_of_reserved_mem_device_init_by_idx ## -- Begin function of_reserved_mem_device_init_by_idx
	.p2align	4, 0x90
_of_reserved_mem_device_init_by_idx:    ## @of_reserved_mem_device_init_by_idx
	.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
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.4:
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rax
	movq	%rsi, %rdi
	movq	%rax, %rsi
	callq	_of_parse_phandle
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_of_device_is_available
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movq	%rbx, %rdi
	callq	___find_rmem
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_of_node_put
	testq	%r14, %r14
	je	LBB0_2
## %bb.9:
	movq	8(%r14), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.10:
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.11:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$24, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.13:
	movq	%rax, %r12
	movq	8(%r14), %rax
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	*(%rax)
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:
	movl	%eax, %ebx
	movq	%r12, %rdi
	callq	_kfree
	jmp	LBB0_16
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_3:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_16:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%rbx, %rdi
	callq	_of_node_put
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_12:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_3
LBB0_14:
	movq	%r15, 16(%r12)
	movq	%r14, 8(%r12)
	movq	_of_rmem_assigned_device_mutex@GOTPCREL(%rip), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	_of_rmem_assigned_device_list@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	callq	_list_add
	movq	%rbx, %rdi
	callq	_mutex_unlock
	movl	(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_dev_info
	xorl	%ebx, %ebx
	jmp	LBB0_16
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"memory-region"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_of_rmem_assigned_device_mutex,4,2 ## @of_rmem_assigned_device_mutex
	.comm	_of_rmem_assigned_device_list,4,2 ## @of_rmem_assigned_device_list
L_.str.1:                               ## @.str.1
	.asciz	"assigned reserved memory node %s\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_of_reserved_mem_device_init_by_idx ; -- Begin function of_reserved_mem_device_init_by_idx
	.p2align	2
_of_reserved_mem_device_init_by_idx:    ; @of_reserved_mem_device_init_by_idx
	.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
	cbz	x0, LBB0_10
; %bb.1:
	cbz	x1, LBB0_10
; %bb.2:
	mov	x19, x0
Lloh0:
	adrp	x8, l_.str@PAGE
Lloh1:
	add	x8, x8, l_.str@PAGEOFF
	mov	x0, x1
	mov	x1, x8
	bl	_of_parse_phandle
	cbz	x0, LBB0_11
; %bb.3:
	mov	x21, x0
	bl	_of_device_is_available
	cbz	w0, LBB0_14
; %bb.4:
	mov	x0, x21
	bl	___find_rmem
	mov	x20, x0
	mov	x0, x21
	bl	_of_node_put
	cbz	x20, LBB0_10
; %bb.5:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_10
; %bb.6:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.7:
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_15
; %bb.8:
	mov	x22, x0
	ldr	x8, [x20, #8]
	ldr	x8, [x8]
	mov	x0, x20
	mov	x1, x19
	blr	x8
	cbz	w0, LBB0_16
; %bb.9:
	mov	x21, x0
	mov	x0, x22
	bl	_kfree
	b	LBB0_13
LBB0_10:
Lloh5:
	adrp	x8, _EINVAL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_11:
Lloh7:
	adrp	x8, _ENODEV@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_13:
	mov	x0, x21
	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_14:
	mov	x0, x21
	bl	_of_node_put
	mov	w21, #0
	b	LBB0_13
LBB0_15:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_16:
	stp	x20, x19, [x22, #8]
Lloh11:
	adrp	x21, _of_rmem_assigned_device_mutex@GOTPAGE
Lloh12:
	ldr	x21, [x21, _of_rmem_assigned_device_mutex@GOTPAGEOFF]
	mov	x0, x21
	bl	_mutex_lock
Lloh13:
	adrp	x1, _of_rmem_assigned_device_list@GOTPAGE
Lloh14:
	ldr	x1, [x1, _of_rmem_assigned_device_list@GOTPAGEOFF]
	mov	x0, x22
	bl	_list_add
	mov	x0, x21
	bl	_mutex_unlock
	ldr	w2, [x20]
Lloh15:
	adrp	x1, l_.str.1@PAGE
Lloh16:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_info
	mov	w21, #0
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memory-region"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_of_rmem_assigned_device_mutex,4,2 ; @of_rmem_assigned_device_mutex
	.comm	_of_rmem_assigned_device_list,4,2 ; @of_rmem_assigned_device_list
l_.str.1:                               ; @.str.1
	.asciz	"assigned reserved memory node %s\n"

.subsections_via_symbols
