	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function arm_smmu_init_strtab_2lvl
_arm_smmu_init_strtab_2lvl:             ## @arm_smmu_init_strtab_2lvl
	.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
	movq	%rdi, %r15
	movq	_STRTAB_L1_SZ_SHIFT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	_STRTAB_L1_DESC_DWORDS@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_ilog2
	subl	%eax, %ebx
	addl	$-3, %ebx
	movl	(%r15), %esi
	movq	_STRTAB_SPLIT@GOTPCREL(%rip), %r13
	subl	(%r13), %esi
	movl	%ebx, %edi
	callq	_min
	movl	%eax, %r14d
	movl	$1, %esi
	movl	%r14d, %ecx
	shll	%cl, %esi
	movl	%esi, 8(%r15)
	addl	(%r13), %r14d
	movl	(%r15), %ecx
	cmpl	%ecx, %r14d
	jge	LBB0_2
## %bb.1:
	movl	4(%r15), %edi
	leaq	L_.str(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_warn
	movl	8(%r15), %esi
LBB0_2:
	imull	(%r12), %esi
	shll	$3, %esi
	movl	4(%r15), %edi
	leaq	24(%r15), %rdx
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movq	___GFP_ZERO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	callq	_dmam_alloc_coherent
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, 16(%r15)
	movq	_STRTAB_BASE_CFG_FMT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_STRTAB_BASE_CFG_FMT_2LVL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_FIELD_PREP
	movl	%eax, %r12d
	movq	_STRTAB_BASE_CFG_LOG2SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r14d, %esi
	callq	_FIELD_PREP
	movl	%eax, %ebx
	movq	_STRTAB_BASE_CFG_SPLIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %esi
	callq	_FIELD_PREP
	orl	%r12d, %eax
	orl	%ebx, %eax
	movl	%eax, 12(%r15)
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_arm_smmu_init_l1_strtab        ## TAILCALL
LBB0_3:
	movl	4(%r15), %edi
	leaq	L_.str.1(%rip), %rsi
	movl	%r14d, %edx
	callq	_dev_err
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STRTAB_L1_SZ_SHIFT,4,2         ## @STRTAB_L1_SZ_SHIFT
	.comm	_STRTAB_L1_DESC_DWORDS,4,2      ## @STRTAB_L1_DESC_DWORDS
	.comm	_STRTAB_SPLIT,4,2               ## @STRTAB_SPLIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"2-level strtab only covers %u/%u bits of SID\n"

	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ## @__GFP_ZERO
L_.str.1:                               ## @.str.1
	.asciz	"failed to allocate l1 stream table (%u bytes)\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_STRTAB_BASE_CFG_FMT,4,2        ## @STRTAB_BASE_CFG_FMT
	.comm	_STRTAB_BASE_CFG_FMT_2LVL,4,2   ## @STRTAB_BASE_CFG_FMT_2LVL
	.comm	_STRTAB_BASE_CFG_LOG2SIZE,4,2   ## @STRTAB_BASE_CFG_LOG2SIZE
	.comm	_STRTAB_BASE_CFG_SPLIT,4,2      ## @STRTAB_BASE_CFG_SPLIT
	.no_dead_strip	_arm_smmu_init_strtab_2lvl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function arm_smmu_init_strtab_2lvl
_arm_smmu_init_strtab_2lvl:             ; @arm_smmu_init_strtab_2lvl
	.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, x0
Lloh0:
	adrp	x8, _STRTAB_L1_SZ_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STRTAB_L1_SZ_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w20, [x8]
Lloh3:
	adrp	x21, _STRTAB_L1_DESC_DWORDS@GOTPAGE
Lloh4:
	ldr	x21, [x21, _STRTAB_L1_DESC_DWORDS@GOTPAGEOFF]
	ldr	w0, [x21]
	bl	_ilog2
	sub	w8, w20, w0
	sub	w0, w8, #3
	ldr	w8, [x19]
Lloh5:
	adrp	x22, _STRTAB_SPLIT@GOTPAGE
Lloh6:
	ldr	x22, [x22, _STRTAB_SPLIT@GOTPAGEOFF]
	ldr	w9, [x22]
	sub	w1, w8, w9
	bl	_min
	mov	w8, #1
	lsl	w8, w8, w0
	str	w8, [x19, #8]
	ldr	w9, [x22]
	ldr	w3, [x19]
	add	w20, w9, w0
	cmp	w20, w3
	b.ge	LBB0_2
; %bb.1:
	ldr	w0, [x19, #4]
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x20
	bl	_dev_warn
	ldr	w8, [x19, #8]
LBB0_2:
	ldr	w9, [x21]
	mul	w8, w8, w9
	lsl	w1, w8, #3
	ldr	w0, [x19, #4]
Lloh9:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
	add	x2, x19, #24
Lloh11:
	ldr	w8, [x8]
Lloh12:
	adrp	x9, ___GFP_ZERO@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___GFP_ZERO@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	orr	w3, w9, w8
	bl	_dmam_alloc_coherent
	cbz	x0, LBB0_4
; %bb.3:
	str	x0, [x19, #16]
Lloh15:
	adrp	x8, _STRTAB_BASE_CFG_FMT@GOTPAGE
Lloh16:
	ldr	x8, [x8, _STRTAB_BASE_CFG_FMT@GOTPAGEOFF]
Lloh17:
	ldr	w0, [x8]
Lloh18:
	adrp	x8, _STRTAB_BASE_CFG_FMT_2LVL@GOTPAGE
Lloh19:
	ldr	x8, [x8, _STRTAB_BASE_CFG_FMT_2LVL@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_FIELD_PREP
	mov	x21, x0
Lloh21:
	adrp	x8, _STRTAB_BASE_CFG_LOG2SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _STRTAB_BASE_CFG_LOG2SIZE@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_FIELD_PREP
	orr	w20, w0, w21
Lloh24:
	adrp	x8, _STRTAB_BASE_CFG_SPLIT@GOTPAGE
Lloh25:
	ldr	x8, [x8, _STRTAB_BASE_CFG_SPLIT@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
	ldr	w1, [x22]
	bl	_FIELD_PREP
	orr	w8, w20, w0
	str	w8, [x19, #12]
	mov	x0, 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
	b	_arm_smmu_init_l1_strtab
LBB0_4:
	ldr	w0, [x19, #4]
Lloh27:
	adrp	x1, l_.str.1@PAGE
Lloh28:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_dev_err
Lloh29:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh30:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w0, w8
	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 AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_STRTAB_L1_SZ_SHIFT,4,2         ; @STRTAB_L1_SZ_SHIFT
	.comm	_STRTAB_L1_DESC_DWORDS,4,2      ; @STRTAB_L1_DESC_DWORDS
	.comm	_STRTAB_SPLIT,4,2               ; @STRTAB_SPLIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"2-level strtab only covers %u/%u bits of SID\n"

	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	___GFP_ZERO,4,2                 ; @__GFP_ZERO
l_.str.1:                               ; @.str.1
	.asciz	"failed to allocate l1 stream table (%u bytes)\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_STRTAB_BASE_CFG_FMT,4,2        ; @STRTAB_BASE_CFG_FMT
	.comm	_STRTAB_BASE_CFG_FMT_2LVL,4,2   ; @STRTAB_BASE_CFG_FMT_2LVL
	.comm	_STRTAB_BASE_CFG_LOG2SIZE,4,2   ; @STRTAB_BASE_CFG_LOG2SIZE
	.comm	_STRTAB_BASE_CFG_SPLIT,4,2      ; @STRTAB_BASE_CFG_SPLIT
	.no_dead_strip	_arm_smmu_init_strtab_2lvl
.subsections_via_symbols
