	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gk20a_instobj_ctor_iommu
_gk20a_instobj_ctor_iommu:              ## @gk20a_instobj_ctor_iommu
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r15
	movl	%edx, -56(%rbp)                 ## 4-byte Spill
	movl	%esi, %r13d
	movq	%rdi, %rbx
	movq	32(%rdi), %rax
	movq	(%rax), %r14
	movl	%esi, %edi
	shll	$4, %edi
	addl	$32, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r12
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	leaq	32(%rbx), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movslq	%r13d, %rax
	leaq	16(%r12), %rcx
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	movq	%rcx, (%r15)
	shlq	$3, %rax
	addq	(%r12), %rax
	movq	%rax, 8(%r12)
	movq	%r12, %rsi
	addq	$24, %rsi
	movq	_gk20a_instobj_func_iommu@GOTPCREL(%rip), %rdi
	callq	_nvkm_memory_ctor
	movq	_gk20a_instobj_ptrs@GOTPCREL(%rip), %rax
	movq	%rax, 24(%r12)
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	testl	%r13d, %r13d
	jle	LBB0_16
## %bb.3:
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_alloc_page
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r12), %rcx
	movq	%rax, (%rcx,%r13,8)
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movq	%r14, %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	callq	_dma_map_page
	movq	%rax, %rbx
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_7
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r12), %rax
	movq	%rbx, (%rax,%r13,8)
	incq	%r13
	cmpq	%r13, %r15
	jne	LBB0_4
LBB0_16:
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	4(%rbx), %edi
	callq	_mutex_lock
	movl	8(%rbx), %edi
	movb	(%rbx), %cl
	movl	-56(%rbp), %r9d                 ## 4-byte Reload
	sarl	%cl, %r9d
	leaq	-80(%rbp), %rax
	movq	%rax, (%rsp)
	xorl	%esi, %esi
	movl	$1, %edx
	movl	-44(%rbp), %r15d                ## 4-byte Reload
	movl	%r15d, %ecx
	movl	%r15d, %r8d
	callq	_nvkm_mm_head
	movl	%eax, %r13d
	movl	4(%rbx), %edi
	callq	_mutex_unlock
	testl	%r13d, %r13d
	je	LBB0_17
## %bb.27:
	leaq	L_.str.1(%rip), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_nvkm_error
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_26
LBB0_5:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	jmp	LBB0_8
LBB0_17:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	testl	%r15d, %r15d
	jle	LBB0_25
## %bb.18:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	xorl	%ebx, %ebx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rsi
	movq	_IOMMU_READ@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	-80(%rbp), %rax
	movl	(%rax), %r15d
	addl	%ebx, %r15d
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movzbl	(%rax), %ecx
	shll	%cl, %r15d
	movl	24(%rax), %edi
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rdx
	movq	%rsi, %r14
	movq	(%rsi), %rcx
	movq	_IOMMU_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	orl	(%r13), %r8d
	movl	%r15d, %esi
	callq	_iommu_map
	testl	%eax, %eax
	js	LBB0_20
## %bb.24:                              ##   in Loop: Header=BB0_19 Depth=1
	incq	%rbx
	cmpq	%rbx, -56(%rbp)                 ## 8-byte Folded Reload
	movq	%r14, %rsi
	jne	LBB0_19
LBB0_25:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	16(%rax), %rdi
	movslq	(%rax), %rax
	subq	%rax, %rdi
	callq	_BIT
	movq	-80(%rbp), %rcx
	orl	%eax, (%rcx)
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	%rcx, (%rax)
	xorl	%r13d, %r13d
	jmp	LBB0_26
LBB0_7:
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_nvkm_error
	movq	_ENOMEM@GOTPCREL(%rip), %rax
LBB0_8:
	subl	(%rax), %r13d
LBB0_9:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	testl	%eax, %eax
	jle	LBB0_26
## %bb.10:
	movl	%eax, %r15d
	xorl	%ebx, %ebx
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	callq	___free_page
	incq	%rbx
	cmpq	%rbx, %r15
	je	LBB0_26
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_26
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	callq	_dma_unmap_page
	movq	(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	jmp	LBB0_14
LBB0_26:
	movl	%r13d, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	leaq	L_.str.2(%rip), %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_nvkm_error
	testl	%ebx, %ebx
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	je	LBB0_23
## %bb.21:
	incq	%rbx
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdx
	subl	%edx, %r15d
	movl	24(%r13), %edi
	movl	%r15d, %esi
	callq	_iommu_unmap
	decl	%ebx
	cmpl	$1, %ebx
	jg	LBB0_22
LBB0_23:
	movl	4(%r13), %edi
	callq	_mutex_lock
	movl	8(%r13), %edi
	leaq	-80(%rbp), %rsi
	callq	_nvkm_mm_free
	movl	4(%r13), %edi
	callq	_mutex_unlock
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movl	-56(%rbp), %r13d                ## 4-byte Reload
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_gk20a_instobj_func_iommu,4,2   ## @gk20a_instobj_func_iommu
	.comm	_gk20a_instobj_ptrs,4,2         ## @gk20a_instobj_ptrs
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA mapping error!\n"

L_.str.1:                               ## @.str.1
	.asciz	"IOMMU space is full!\n"

	.comm	_IOMMU_READ,4,2                 ## @IOMMU_READ
	.comm	_IOMMU_WRITE,4,2                ## @IOMMU_WRITE
L_.str.2:                               ## @.str.2
	.asciz	"IOMMU mapping failure: %d\n"

	.no_dead_strip	_gk20a_instobj_ctor_iommu
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gk20a_instobj_ctor_iommu
_gk20a_instobj_ctor_iommu:              ; @gk20a_instobj_ctor_iommu
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x3
	mov	x24, x2
	mov	x21, x1
	mov	x22, x0
	mov	x23, x0
	ldr	x8, [x23, #32]!
	ldr	x19, [x8]
	lsl	w8, w1, #4
	add	w0, w8, #32
Lloh0:
	adrp	x28, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x28, [x28, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w1, [x28]
	bl	_kzalloc
	cbz	x0, LBB0_8
; %bb.1:
	mov	x20, x0
	str	w24, [sp, #20]                  ; 4-byte Folded Spill
	add	x8, x0, #16
	str	x8, [sp, #8]                    ; 8-byte Folded Spill
	str	x8, [x25]
	ldr	x8, [x0]
	add	x8, x8, w21, sxtw #3
	str	x8, [x0, #8]
	add	x1, x0, #24
Lloh2:
	adrp	x0, _gk20a_instobj_func_iommu@GOTPAGE
Lloh3:
	ldr	x0, [x0, _gk20a_instobj_func_iommu@GOTPAGEOFF]
	bl	_nvkm_memory_ctor
Lloh4:
	adrp	x8, _gk20a_instobj_ptrs@GOTPAGE
Lloh5:
	ldr	x8, [x8, _gk20a_instobj_ptrs@GOTPAGEOFF]
	str	x8, [x20, #24]
	cmp	w21, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x27, #0
	mov	w8, w21
	lsl	x24, x8, #3
Lloh6:
	adrp	x26, _PAGE_SIZE@GOTPAGE
Lloh7:
	ldr	x26, [x26, _PAGE_SIZE@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x28]
	bl	_alloc_page
	cbz	x0, LBB0_15
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x1, x0
	ldr	x8, [x20]
	str	x0, [x8, x27]
	ldr	x3, [x26]
Lloh8:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh10:
	ldr	w4, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_dma_map_page
	mov	x25, x0
	mov	x0, x19
	mov	x1, x25
	bl	_dma_mapping_error
	cbnz	x0, LBB0_14
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x20, #8]
	str	x25, [x8, x27]
	add	x27, x27, #8
	cmp	x24, x27
	b.ne	LBB0_3
LBB0_6:
	ldr	w0, [x22, #4]
	bl	_mutex_lock
	ldr	w0, [x22, #8]
	ldr	w8, [x22]
	ldr	w9, [sp, #20]                   ; 4-byte Folded Reload
	asr	w5, w9, w8
	add	x6, sp, #24
	mov	w1, #0
	mov	w2, #1
	mov	x3, x21
	mov	x4, x21
	bl	_nvkm_mm_head
	mov	x24, x0
	ldr	w0, [x22, #4]
	bl	_mutex_unlock
	cbz	w24, LBB0_9
; %bb.7:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_nvkm_error
	cmp	w21, #1
	b.ge	LBB0_16
	b	LBB0_25
LBB0_8:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_25
LBB0_9:
	cmp	w21, #1
	b.lt	LBB0_13
; %bb.10:
	mov	x27, #0
Lloh16:
	adrp	x28, _IOMMU_WRITE@GOTPAGE
Lloh17:
	ldr	x28, [x28, _IOMMU_WRITE@GOTPAGEOFF]
	mov	w26, w21
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [sp, #24]
	ldr	w8, [x8]
	add	w8, w27, w8
	ldr	w9, [x22]
	lsl	w25, w8, w9
	ldr	w0, [x22, #24]
	ldr	x8, [x20, #8]
	ldr	x2, [x8, x27, lsl #3]
Lloh18:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh20:
	ldr	x3, [x8]
Lloh21:
	adrp	x8, _IOMMU_READ@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IOMMU_READ@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	ldr	w9, [x28]
	orr	w4, w9, w8
	mov	x1, x25
	bl	_iommu_map
	tbnz	w0, #31, LBB0_21
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	add	x27, x27, #1
	cmp	x26, x27
	b.ne	LBB0_11
LBB0_13:
	ldr	x8, [x22, #16]
	ldrsw	x9, [x22]
	sub	x0, x8, x9
	bl	_BIT
	mov	w24, #0
	ldr	x8, [sp, #24]
	ldr	w9, [x8]
	orr	w9, w9, w0
	str	w9, [x8]
	ldr	x9, [sp, #8]                    ; 8-byte Folded Reload
	str	x8, [x9]
	b	LBB0_25
LBB0_14:
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x23
	bl	_nvkm_error
LBB0_15:
Lloh26:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w24, w8
	cmp	w21, #1
	b.lt	LBB0_25
LBB0_16:
	mov	x22, #0
	mov	w8, w21
	lsl	x21, x8, #3
Lloh29:
	adrp	x23, _PAGE_SIZE@GOTPAGE
Lloh30:
	ldr	x23, [x23, _PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_18
LBB0_17:                                ;   in Loop: Header=BB0_18 Depth=1
	bl	___free_page
	add	x22, x22, #8
	cmp	x21, x22
	b.eq	LBB0_25
LBB0_18:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20]
	ldr	x0, [x8, x22]
	cbz	x0, LBB0_25
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x8, [x20, #8]
	ldr	x1, [x8, x22]
	cbz	x1, LBB0_17
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	ldr	x2, [x23]
Lloh31:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh32:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh33:
	ldr	w3, [x8]
	mov	x0, x19
	bl	_dma_unmap_page
	ldr	x8, [x20]
	ldr	x0, [x8, x22]
	b	LBB0_17
LBB0_21:
	mov	x24, x0
	str	x24, [sp]
Lloh34:
	adrp	x1, l_.str.2@PAGE
Lloh35:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x23
	bl	_nvkm_error
Lloh36:
	adrp	x26, _PAGE_SIZE@GOTPAGE
Lloh37:
	ldr	x26, [x26, _PAGE_SIZE@GOTPAGEOFF]
	cbz	w27, LBB0_24
; %bb.22:
	add	x23, x27, #1
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x2, [x26]
	sub	w25, w25, w2
	ldr	w0, [x22, #24]
	mov	x1, x25
	bl	_iommu_unmap
	sub	w23, w23, #1
	cmp	w23, #1
	b.gt	LBB0_23
LBB0_24:
	ldr	w0, [x22, #4]
	bl	_mutex_lock
	ldr	w0, [x22, #8]
	add	x1, sp, #24
	bl	_nvkm_mm_free
	ldr	w0, [x22, #4]
	bl	_mutex_unlock
	cmp	w21, #1
	b.ge	LBB0_16
LBB0_25:
	mov	x0, x24
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpAdd	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_gk20a_instobj_func_iommu,4,2   ; @gk20a_instobj_func_iommu
	.comm	_gk20a_instobj_ptrs,4,2         ; @gk20a_instobj_ptrs
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA mapping error!\n"

l_.str.1:                               ; @.str.1
	.asciz	"IOMMU space is full!\n"

	.comm	_IOMMU_READ,4,2                 ; @IOMMU_READ
	.comm	_IOMMU_WRITE,4,2                ; @IOMMU_WRITE
l_.str.2:                               ; @.str.2
	.asciz	"IOMMU mapping failure: %d\n"

	.no_dead_strip	_gk20a_instobj_ctor_iommu
.subsections_via_symbols
