	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dmar_device_hotplug
_dmar_device_hotplug:                   ## @dmar_device_hotplug
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	$0, -40(%rbp)
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_dmar_in_use
	testl	%eax, %eax
	je	LBB0_11
## %bb.1:
	movq	_DMAR_DSM_FUNC_DRHD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_dmar_detect_dsm
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, -40(%rbp)
	testq	%rbx, %rbx
	je	LBB0_11
LBB0_7:
	movq	_dmar_global_lock@GOTPCREL(%rip), %rdi
	callq	_down_write
	movq	-40(%rbp), %rdi
	testl	%r14d, %r14d
	je	LBB0_9
## %bb.8:
	callq	_dmar_hotplug_insert
	jmp	LBB0_10
LBB0_3:
	movq	_ACPI_TYPE_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ACPI_UINT32_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_dmar_get_dsm_handle@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-40(%rbp), %rax
	movq	%rax, (%rsp)
	xorl	%r12d, %r12d
	movq	%rbx, %rsi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_acpi_walk_namespace
	movl	%eax, %edi
	callq	_ACPI_FAILURE
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_pr_warn
	movq	_ENXIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	movl	%r12d, %r15d
	jmp	LBB0_11
LBB0_9:
	callq	_dmar_hotplug_remove
LBB0_10:
	movl	%eax, %r15d
	movq	_dmar_global_lock@GOTPCREL(%rip), %rdi
	callq	_up_write
LBB0_11:
	movl	%r15d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	-40(%rbp), %rbx
	testq	%rbx, %rbx
	jne	LBB0_7
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_DSM_FUNC_DRHD,4,2         ## @DMAR_DSM_FUNC_DRHD
	.comm	_ACPI_TYPE_DEVICE,4,2           ## @ACPI_TYPE_DEVICE
	.comm	_ACPI_UINT32_MAX,4,2            ## @ACPI_UINT32_MAX
	.comm	_dmar_get_dsm_handle,4,2        ## @dmar_get_dsm_handle
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to locate _DSM method.\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_dmar_global_lock,4,2           ## @dmar_global_lock
	.no_dead_strip	_dmar_device_hotplug
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dmar_device_hotplug
_dmar_device_hotplug:                   ; @dmar_device_hotplug
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x19, x1
	mov	x20, x0
	str	xzr, [sp, #8]
	bl	_dmar_in_use
	cbz	w0, LBB0_10
; %bb.1:
Lloh0:
	adrp	x8, _DMAR_DSM_FUNC_DRHD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMAR_DSM_FUNC_DRHD@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dmar_detect_dsm
	cbz	x0, LBB0_5
; %bb.2:
	str	x20, [sp, #8]
	cbz	x20, LBB0_10
LBB0_3:
Lloh3:
	adrp	x0, _dmar_global_lock@GOTPAGE
Lloh4:
	ldr	x0, [x0, _dmar_global_lock@GOTPAGEOFF]
	bl	_down_write
	ldr	x0, [sp, #8]
	cbz	w19, LBB0_7
; %bb.4:
	bl	_dmar_hotplug_insert
	b	LBB0_8
LBB0_5:
Lloh5:
	adrp	x8, _ACPI_TYPE_DEVICE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ACPI_TYPE_DEVICE@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
Lloh8:
	adrp	x8, _ACPI_UINT32_MAX@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ACPI_UINT32_MAX@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
Lloh11:
	adrp	x8, _dmar_get_dsm_handle@GOTPAGE
Lloh12:
	ldr	x8, [x8, _dmar_get_dsm_handle@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	add	x6, sp, #8
	mov	x1, x20
	mov	x4, #0
	mov	x5, #0
	bl	_acpi_walk_namespace
	bl	_ACPI_FAILURE
	cbz	x0, LBB0_9
; %bb.6:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
Lloh16:
	adrp	x8, _ENXIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w19, w8
	b	LBB0_11
LBB0_7:
	bl	_dmar_hotplug_remove
LBB0_8:
	mov	x19, x0
Lloh19:
	adrp	x0, _dmar_global_lock@GOTPAGE
Lloh20:
	ldr	x0, [x0, _dmar_global_lock@GOTPAGEOFF]
	bl	_up_write
	b	LBB0_11
LBB0_9:
	ldr	x20, [sp, #8]
	cbnz	x20, LBB0_3
LBB0_10:
	mov	w19, #0
LBB0_11:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_DSM_FUNC_DRHD,4,2         ; @DMAR_DSM_FUNC_DRHD
	.comm	_ACPI_TYPE_DEVICE,4,2           ; @ACPI_TYPE_DEVICE
	.comm	_ACPI_UINT32_MAX,4,2            ; @ACPI_UINT32_MAX
	.comm	_dmar_get_dsm_handle,4,2        ; @dmar_get_dsm_handle
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to locate _DSM method.\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_dmar_global_lock,4,2           ; @dmar_global_lock
	.no_dead_strip	_dmar_device_hotplug
.subsections_via_symbols
