	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_calc_am                        ## -- Begin function calc_am
	.p2align	4, 0x90
_calc_am:                               ## @calc_am
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movl	%edx, %r15d
	movl	%esi, %ebx
	movl	(%rdi), %edi
	callq	_DMAR_CAP_MAMV
                                        ## kill: def $eax killed $eax def $rax
	movq	_DMAR_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, %eax
	je	LBB0_6
LBB0_4:                                 ##   in Loop: Header=BB0_1 Depth=1
	decl	%eax
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	leal	(%rdx,%rax), %ecx
	movl	$1, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	shlq	%cl, %rsi
	leal	-1(%rsi), %ecx
	testl	%ebx, %ecx
	jne	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%r15d, %esi
	jle	LBB0_7
## %bb.3:                               ##   in Loop: Header=BB0_1 Depth=1
	testl	%eax, %eax
	jne	LBB0_4
	jmp	LBB0_7
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	movl	%esi, (%r14)
                                        ## kill: def $eax killed $eax killed $rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DMAR_PAGE_SHIFT,4,2            ## @DMAR_PAGE_SHIFT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_calc_am                        ; -- Begin function calc_am
	.p2align	2
_calc_am:                               ; @calc_am
	.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
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	ldr	w0, [x0]
	bl	_DMAR_CAP_MAMV
Lloh0:
	adrp	x8, _DMAR_PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMAR_PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	mov	w10, #1
	b	LBB0_3
LBB0_1:                                 ;   in Loop: Header=BB0_3 Depth=1
	cmp	w9, w20
	ccmp	w0, #0, #4, gt
	b.eq	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	w0, w0, #1
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	add	w9, w8, w0
	lsl	x9, x10, x9
	sub	w11, w9, #1
	tst	w11, w21
	b.eq	LBB0_1
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cbnz	w0, LBB0_2
LBB0_5:
	str	w9, [x19]
	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	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DMAR_PAGE_SHIFT,4,2            ; @DMAR_PAGE_SHIFT
.subsections_via_symbols
