	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_ioapic_sid
_set_ioapic_sid:                        ## @set_ioapic_sid
	.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	$-1, %r14d
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	movl	%esi, %ebx
	movq	%rdi, %r15
	movq	_dmar_global_lock@GOTPCREL(%rip), %rdi
	callq	_down_read
	movq	_MAX_IO_APICS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	jle	LBB0_6
## %bb.2:
	movq	_ir_ioapic@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	shlq	$3, %rcx
	leaq	(%rcx,%rcx,2), %rdx
	xorl	%ecx, %ecx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	$24, %rcx
	cmpq	%rcx, %rdx
	je	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, 16(%rax,%rcx)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	%ebx, (%rax,%rcx)
	jne	LBB0_5
## %bb.7:
	movl	4(%rax,%rcx), %r13d
	shll	$8, %r13d
	movl	8(%rax,%rcx), %r12d
	movq	_dmar_global_lock@GOTPCREL(%rip), %rdi
	callq	_up_read
	orl	%r13d, %r12d
	je	LBB0_8
## %bb.9:
	movq	_SVT_VERIFY_SID_SQ@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_SQ_ALL_16@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%r12d, %ecx
	callq	_set_irte_sid
	xorl	%r14d, %r14d
	jmp	LBB0_10
LBB0_6:
	movq	_dmar_global_lock@GOTPCREL(%rip), %rdi
	callq	_up_read
LBB0_8:
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_warn
LBB0_10:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dmar_global_lock,4,2           ## @dmar_global_lock
	.comm	_MAX_IO_APICS,4,2               ## @MAX_IO_APICS
	.comm	_ir_ioapic,8,3                  ## @ir_ioapic
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set source-id of IOAPIC (%d)\n"

	.comm	_SVT_VERIFY_SID_SQ,4,2          ## @SVT_VERIFY_SID_SQ
	.comm	_SQ_ALL_16,4,2                  ## @SQ_ALL_16
	.no_dead_strip	_set_ioapic_sid
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_ioapic_sid
_set_ioapic_sid:                        ; @set_ioapic_sid
	.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:
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x0, _dmar_global_lock@GOTPAGE
Lloh1:
	ldr	x0, [x0, _dmar_global_lock@GOTPAGEOFF]
	bl	_down_read
Lloh2:
	adrp	x8, _MAX_IO_APICS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_IO_APICS@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.2:
Lloh5:
	adrp	x9, _ir_ioapic@GOTPAGE
Lloh6:
	ldr	x9, [x9, _ir_ioapic@GOTPAGEOFF]
Lloh7:
	ldr	x9, [x9]
	add	x9, x9, #8
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x9, x9, #24
	subs	x8, x8, #1
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x9, #8]
	cbz	x10, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldur	w10, [x9, #-8]
	cmp	w10, w19
	b.ne	LBB0_3
; %bb.6:
	ldp	w8, w9, [x9, #-4]
	orr	w21, w9, w8, lsl #8
Lloh8:
	adrp	x0, _dmar_global_lock@GOTPAGE
Lloh9:
	ldr	x0, [x0, _dmar_global_lock@GOTPAGEOFF]
	bl	_up_read
	cbz	w21, LBB0_9
; %bb.7:
Lloh10:
	adrp	x8, _SVT_VERIFY_SID_SQ@GOTPAGE
Lloh11:
	ldr	x8, [x8, _SVT_VERIFY_SID_SQ@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _SQ_ALL_16@GOTPAGE
Lloh14:
	ldr	x8, [x8, _SQ_ALL_16@GOTPAGEOFF]
Lloh15:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x3, x21
	bl	_set_irte_sid
	mov	w0, #0
	b	LBB0_11
LBB0_8:
Lloh16:
	adrp	x0, _dmar_global_lock@GOTPAGE
Lloh17:
	ldr	x0, [x0, _dmar_global_lock@GOTPAGEOFF]
	bl	_up_read
LBB0_9:
Lloh18:
	adrp	x0, l_.str@PAGE
Lloh19:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_pr_warn
LBB0_10:
	mov	w0, #-1
LBB0_11:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_dmar_global_lock,4,2           ; @dmar_global_lock
	.comm	_MAX_IO_APICS,4,2               ; @MAX_IO_APICS
	.comm	_ir_ioapic,8,3                  ; @ir_ioapic
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set source-id of IOAPIC (%d)\n"

	.comm	_SVT_VERIFY_SID_SQ,4,2          ; @SVT_VERIFY_SID_SQ
	.comm	_SQ_ALL_16,4,2                  ; @SQ_ALL_16
	.no_dead_strip	_set_ioapic_sid
.subsections_via_symbols
