	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_maxaddr2mgaw              ## -- Begin function dmar_maxaddr2mgaw
	.p2align	4, 0x90
_dmar_maxaddr2mgaw:                     ## @dmar_maxaddr2mgaw
	.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
	movq	%rsi, %r13
	movq	%rdi, %r15
	movq	_sagaw_bits@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_nitems
	testl	%eax, %eax
	jle	LBB0_1
## %bb.2:
	xorl	%r14d, %r14d
	xorl	%ebx, %ebx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	incq	%rbx
	callq	_nitems
	cltq
	addq	$16, %r14
	cmpq	%rax, %rbx
	jge	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rdi
	movzbl	(%rdi,%r14), %ecx
	movl	$1, %eax
	shlq	%cl, %rax
	cmpq	%r13, %rax
	jb	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %edi
	callq	_DMAR_CAP_SAGAW
	movq	(%r12), %rdi
	testl	%eax, 8(%rdi,%r14)
	je	LBB0_5
	jmp	LBB0_6
LBB0_1:
	xorl	%ebx, %ebx
LBB0_6:
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	testl	%r13d, %r13d
	je	LBB0_10
## %bb.7:
	movq	(%r12), %rdi
	callq	_nitems
	cmpl	%eax, %ebx
	jne	LBB0_10
## %bb.8:
	movl	%ebx, %r14d
	shlq	$4, %r14
	addq	$-8, %r14
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15), %edi
	callq	_DMAR_CAP_SAGAW
	movq	(%r12), %rcx
	decl	%ebx
	leaq	-16(%r14), %rdx
	testl	%eax, (%rcx,%r14)
	movq	%rdx, %r14
	je	LBB0_9
LBB0_10:
	movq	(%r12), %rdi
	callq	_nitems
	cmpl	%eax, %ebx
	jge	LBB0_12
## %bb.11:
	movq	(%r12), %rax
	movslq	%ebx, %rcx
	shlq	$4, %rcx
	movl	(%rax,%rcx), %eax
	jmp	LBB0_13
LBB0_12:
	movslq	%r13d, %rsi
	xorl	%edi, %edi
	callq	_KASSERT
	movl	$-1, %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_sagaw_bits,8,3                 ## @sagaw_bits
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_dmar_maxaddr2mgaw              ; -- Begin function dmar_maxaddr2mgaw
	.p2align	2
_dmar_maxaddr2mgaw:                     ; @dmar_maxaddr2mgaw
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x21, x1
	mov	x20, x0
Lloh0:
	adrp	x22, _sagaw_bits@GOTPAGE
Lloh1:
	ldr	x22, [x22, _sagaw_bits@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_nitems
	cmp	w0, #1
	b.lt	LBB0_5
; %bb.1:
	mov	x24, #0
	mov	x23, #0
	mov	w25, #1
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x23, x23, #1
	bl	_nitems
	add	x24, x24, #16
	cmp	x23, w0, sxtw
	b.ge	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	ldr	x8, [x0, x24]
	lsl	x8, x25, x8
	cmp	x8, x21
	b.lo	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x20]
	bl	_DMAR_CAP_SAGAW
	mov	x8, x0
	ldr	x0, [x22]
	add	x9, x0, x24
	ldr	w9, [x9, #8]
	tst	w9, w8
	b.eq	LBB0_2
	b	LBB0_6
LBB0_5:
	mov	w23, #0
LBB0_6:
	cbz	w19, LBB0_10
; %bb.7:
	ldr	x0, [x22]
	bl	_nitems
	cmp	w23, w0
	b.ne	LBB0_10
; %bb.8:
	mov	w8, w23
	lsl	x8, x8, #4
	sub	x21, x8, #8
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x20]
	bl	_DMAR_CAP_SAGAW
	ldr	x8, [x22]
	ldr	w8, [x8, x21]
	sub	w23, w23, #1
	sub	x21, x21, #16
	and	w8, w8, w0
	cbz	w8, LBB0_9
LBB0_10:
	ldr	x0, [x22]
	bl	_nitems
	cmp	w23, w0
	b.ge	LBB0_12
; %bb.11:
	ldr	x8, [x22]
                                        ; kill: def $w23 killed $w23 killed $x23 def $x23
	sbfiz	x9, x23, #4, #32
	ldr	w0, [x8, x9]
	b	LBB0_13
LBB0_12:
	sxtw	x1, w19
	mov	w0, #0
	bl	_KASSERT
	mov	w0, #-1
LBB0_13:
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_sagaw_bits,8,3                 ; @sagaw_bits
.subsections_via_symbols
