	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_instantiate_ctx           ## -- Begin function dmar_instantiate_ctx
	.p2align	4, 0x90
_dmar_instantiate_ctx:                  ## @dmar_instantiate_ctx
	.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
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	%esi, %eax
	movq	%rdi, %r15
	leaq	-48(%rbp), %rsi
	movl	%eax, %edi
	callq	_dmar_get_requester
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_pci_get_domain
	movl	%eax, %r12d
	movl	%ebx, %edi
	callq	_pci_get_bus
	movl	%eax, %r13d
	movl	%ebx, %edi
	callq	_pci_get_slot
	movl	%eax, %r14d
	movl	%ebx, %edi
	callq	_pci_get_function
	movl	%r12d, %edi
	movl	%r13d, %esi
	movl	%r14d, %edx
	movl	%eax, %ecx
	callq	_dmar_bus_dma_is_dev_disabled
	movl	%eax, %r12d
	movl	-48(%rbp), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	%eax, %ecx
	movl	-44(%rbp), %r8d                 ## 4-byte Reload
	callq	_dmar_get_ctx_for_dev
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	testl	%r12d, %r12d
	je	LBB0_6
## %bb.2:
	movq	%r15, %rdi
	callq	_DMAR_LOCK
	movl	(%rbx), %eax
	movq	_DMAR_CTX_DISABLED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_dmar_free_ctx_locked
	jmp	LBB0_5
LBB0_3:
	orl	%eax, %ecx
	movl	%ecx, (%rbx)
	movq	%r15, %rdi
	callq	_DMAR_UNLOCK
LBB0_5:
	xorl	%ebx, %ebx
LBB0_6:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_CTX_DISABLED,4,2          ## @DMAR_CTX_DISABLED
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_instantiate_ctx           ; -- Begin function dmar_instantiate_ctx
	.p2align	2
_dmar_instantiate_ctx:                  ; @dmar_instantiate_ctx
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x2
	mov	x8, x1
	mov	x19, x0
	add	x1, sp, #12
	mov	x0, x8
	bl	_dmar_get_requester
	mov	x22, x0
	bl	_pci_get_domain
	mov	x21, x0
	mov	x0, x22
	bl	_pci_get_bus
	mov	x23, x0
	mov	x0, x22
	bl	_pci_get_slot
	mov	x24, x0
	mov	x0, x22
	bl	_pci_get_function
	mov	x3, x0
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	bl	_dmar_bus_dma_is_dev_disabled
	mov	x21, x0
	ldr	w2, [sp, #12]
	mov	x0, x19
	mov	x1, x22
	mov	x3, x21
	mov	x4, x20
	bl	_dmar_get_ctx_for_dev
	mov	x20, x0
	cbz	x0, LBB0_6
; %bb.1:
	cbz	w21, LBB0_6
; %bb.2:
	mov	x0, x19
	bl	_DMAR_LOCK
	ldr	w8, [x20]
Lloh0:
	adrp	x9, _DMAR_CTX_DISABLED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMAR_CTX_DISABLED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x20
	bl	_dmar_free_ctx_locked
	b	LBB0_5
LBB0_4:
	orr	w8, w9, w8
	str	w8, [x20]
	mov	x0, x19
	bl	_DMAR_UNLOCK
LBB0_5:
	mov	x20, #0
LBB0_6:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_CTX_DISABLED,4,2          ; @DMAR_CTX_DISABLED
.subsections_via_symbols
