	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function set_ownership
_set_ownership:                         ## @set_ownership
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r13d
	callq	_device_get_softc
	movq	%rax, %r14
	movq	_PAGE_SIZE@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	_BUS_SPACE_MAXADDR_32BIT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_BUS_SPACE_MAXADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_busdma_lock_mutex@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	-44(%rbp), %rbx
	movq	_Giant@GOTPCREL(%rip), %r10
	xorl	%edi, %edi
	xorl	%edx, %edx
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	%r10
	pushq	%rax
	pushq	$0
	pushq	%rsi
	pushq	$1
	pushq	%rsi
	pushq	$0
	callq	_bus_dma_tag_create
	addq	$64, %rsp
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_2
LBB0_3:
	movl	-44(%rbp), %edi
	leaq	-64(%rbp), %rsi
	movq	_BUS_DMA_NOWAIT@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	leaq	-48(%rbp), %rcx
	callq	_bus_dmamem_alloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	-44(%rbp), %edi
	callq	_bus_dma_tag_destroy
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_2
LBB0_5:
	movl	4(%r14), %eax
	movl	%eax, -56(%rbp)
	movl	(%r14), %eax
	movl	%eax, -60(%rbp)
	movl	-44(%rbp), %edi
	movl	-48(%rbp), %esi
	movl	-64(%rbp), %edx
	movl	(%r15), %ecx
	movq	_set_ownership_cb@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	(%r12), %eax
	subq	$8, %rsp
	leaq	-72(%rbp), %r9
	pushq	%rax
	callq	_bus_dmamap_load
	addq	$16, %rsp
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	movl	-44(%rbp), %edi
	movl	-64(%rbp), %esi
	movl	-48(%rbp), %edx
	callq	_bus_dmamem_free
	movl	-44(%rbp), %edi
	callq	_bus_dma_tag_destroy
	leaq	L_.str.2(%rip), %rsi
LBB0_2:
	movl	%r13d, %edi
	callq	_device_printf
LBB0_8:
	movq	_ENXIO@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_9:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	-72(%rbp), %rdx
	leaq	L_.str.3(%rip), %rsi
	movl	%r13d, %edi
	callq	_DPRINT
	movl	-44(%rbp), %edi
	movl	-48(%rbp), %esi
	callq	_bus_dmamap_unload
	movl	-44(%rbp), %edi
	movl	-64(%rbp), %esi
	movl	-48(%rbp), %edx
	callq	_bus_dmamem_free
	movl	-44(%rbp), %edi
	callq	_bus_dma_tag_destroy
	xorl	%eax, %eax
	cmpq	$0, -72(%rbp)
	jne	LBB0_8
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ## @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ## @BUS_SPACE_MAXADDR
	.comm	_busdma_lock_mutex,4,2          ## @busdma_lock_mutex
	.comm	_Giant,4,2                      ## @Giant
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"can't create mem tag\n"

	.comm	_ENXIO,4,2                      ## @ENXIO
	.comm	_BUS_DMA_NOWAIT,4,2             ## @BUS_DMA_NOWAIT
L_.str.1:                               ## @.str.1
	.asciz	"can't alloc mapped mem\n"

	.comm	_set_ownership_cb,4,2           ## @set_ownership_cb
L_.str.2:                               ## @.str.2
	.asciz	"can't load mem\n"

L_.str.3:                               ## @.str.3
	.asciz	"taking ownership over BIOS return %d\n"

	.no_dead_strip	_set_ownership
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function set_ownership
_set_ownership:                         ; @set_ownership
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	bl	_device_get_softc
	mov	x20, x0
Lloh0:
	adrp	x21, _PAGE_SIZE@GOTPAGE
Lloh1:
	ldr	x21, [x21, _PAGE_SIZE@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh2:
	adrp	x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGE
Lloh3:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR_32BIT@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
Lloh5:
	adrp	x8, _BUS_SPACE_MAXADDR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BUS_SPACE_MAXADDR@GOTPAGEOFF]
Lloh7:
	ldr	w4, [x8]
Lloh8:
	adrp	x8, _busdma_lock_mutex@GOTPAGE
Lloh9:
	ldr	x8, [x8, _busdma_lock_mutex@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
Lloh11:
	adrp	x9, _Giant@GOTPAGE
Lloh12:
	ldr	x9, [x9, _Giant@GOTPAGEOFF]
	add	x10, sp, #36
	stp	x9, x10, [sp, #16]
	stp	wzr, w8, [sp, #8]
	mov	w8, #1
	stp	w8, w1, [sp]
	mov	x0, #0
	mov	w2, #0
	mov	x5, #0
	mov	x6, #0
	mov	x7, x1
	bl	_bus_dma_tag_create
	cbz	x0, LBB0_2
; %bb.1:
Lloh13:
	adrp	x1, l_.str@PAGE
Lloh14:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_2:
	ldr	w0, [sp, #36]
	add	x8, sp, #40
	add	x1, x8, #8
Lloh15:
	adrp	x22, _BUS_DMA_NOWAIT@GOTPAGE
Lloh16:
	ldr	x22, [x22, _BUS_DMA_NOWAIT@GOTPAGEOFF]
	ldr	w2, [x22]
	add	x3, sp, #32
	bl	_bus_dmamem_alloc
	cbz	x0, LBB0_4
; %bb.3:
	ldr	w0, [sp, #36]
	bl	_bus_dma_tag_destroy
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	d0, [x20]
	stur	d0, [sp, #52]
	ldp	w1, w0, [sp, #32]
	ldr	w2, [sp, #48]
	ldr	w3, [x21]
Lloh19:
	adrp	x8, _set_ownership_cb@GOTPAGE
Lloh20:
	ldr	x8, [x8, _set_ownership_cb@GOTPAGEOFF]
Lloh21:
	ldr	w4, [x8]
	ldr	w6, [x22]
	add	x5, sp, #40
	bl	_bus_dmamap_load
	cbz	x0, LBB0_8
; %bb.5:
	ldp	w2, w0, [sp, #32]
	ldr	w1, [sp, #48]
	bl	_bus_dmamem_free
	ldr	w0, [sp, #36]
	bl	_bus_dma_tag_destroy
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_6:
	mov	x0, x19
	bl	_device_printf
Lloh24:
	adrp	x8, _ENXIO@GOTPAGE
Lloh25:
	ldr	x8, [x8, _ENXIO@GOTPAGEOFF]
Lloh26:
	ldr	w0, [x8]
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	ldr	x2, [sp, #40]
Lloh27:
	adrp	x1, l_.str.3@PAGE
Lloh28:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_DPRINT
	ldp	w1, w0, [sp, #32]
	bl	_bus_dmamap_unload
	ldp	w2, w0, [sp, #32]
	ldr	w1, [sp, #48]
	bl	_bus_dmamem_free
	ldr	w0, [sp, #36]
	bl	_bus_dma_tag_destroy
	ldr	x8, [sp, #40]
Lloh29:
	adrp	x9, _ENXIO@GOTPAGE
Lloh30:
	ldr	x9, [x9, _ENXIO@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	cmp	x8, #0
	csel	w0, wzr, w9, eq
	b	LBB0_7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_BUS_SPACE_MAXADDR_32BIT,4,2    ; @BUS_SPACE_MAXADDR_32BIT
	.comm	_BUS_SPACE_MAXADDR,4,2          ; @BUS_SPACE_MAXADDR
	.comm	_busdma_lock_mutex,4,2          ; @busdma_lock_mutex
	.comm	_Giant,4,2                      ; @Giant
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"can't create mem tag\n"

	.comm	_ENXIO,4,2                      ; @ENXIO
	.comm	_BUS_DMA_NOWAIT,4,2             ; @BUS_DMA_NOWAIT
l_.str.1:                               ; @.str.1
	.asciz	"can't alloc mapped mem\n"

	.comm	_set_ownership_cb,4,2           ; @set_ownership_cb
l_.str.2:                               ; @.str.2
	.asciz	"can't load mem\n"

l_.str.3:                               ; @.str.3
	.asciz	"taking ownership over BIOS return %d\n"

	.no_dead_strip	_set_ownership
.subsections_via_symbols
