	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bd_tag_destroy                 ## -- Begin function bd_tag_destroy
	.p2align	4, 0x90
_bd_tag_destroy:                        ## @bd_tag_destroy
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_OBJ_TYPE_TAG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_obj_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	cmpl	$2, (%rax)
	jl	LBB0_4
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_4:
	leaq	-24(%rbp), %r14
	movq	%r14, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_PROTO_IOC_BUSDMA_TAG_DESTROY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -20(%rbp)
	movl	16(%rbx), %eax
	movl	%eax, -24(%rbp)
	movl	4(%rbx), %edi
	movq	_PROTO_IOC_BUSDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_ioctl
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.5:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:
	decl	(%rax)
	jmp	LBB0_8
LBB0_1:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_9
LBB0_7:
	movl	4(%rbx), %edi
	callq	_close
LBB0_8:
	movq	%rbx, %rdi
	callq	_obj_free
	xorl	%eax, %eax
LBB0_9:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OBJ_TYPE_TAG,4,2               ## @OBJ_TYPE_TAG
	.comm	_errno,4,2                      ## @errno
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_PROTO_IOC_BUSDMA_TAG_DESTROY,4,2 ## @PROTO_IOC_BUSDMA_TAG_DESTROY
	.comm	_PROTO_IOC_BUSDMA,4,2           ## @PROTO_IOC_BUSDMA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bd_tag_destroy                 ; -- Begin function bd_tag_destroy
	.p2align	2
_bd_tag_destroy:                        ; @bd_tag_destroy
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
Lloh0:
	adrp	x8, _OBJ_TYPE_TAG@GOTPAGE
Lloh1:
	ldr	x8, [x8, _OBJ_TYPE_TAG@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_obj_lookup
	cbz	x0, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #2
	b.lt	LBB0_3
; %bb.2:
Lloh3:
	adrp	x8, _EBUSY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_3:
	add	x0, sp, #8
	mov	w1, #0
	mov	w2, #8
	bl	_memset
Lloh6:
	adrp	x8, _PROTO_IOC_BUSDMA_TAG_DESTROY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PROTO_IOC_BUSDMA_TAG_DESTROY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w9, [x19, #16]
	stp	w9, w8, [sp, #8]
	ldr	w0, [x19, #4]
Lloh9:
	adrp	x8, _PROTO_IOC_BUSDMA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PROTO_IOC_BUSDMA@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	add	x2, sp, #8
	bl	_ioctl
	cmn	w0, #1
	b.eq	LBB0_6
; %bb.4:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_7
; %bb.5:
	ldr	w9, [x8]
	sub	w9, w9, #1
	str	w9, [x8]
	b	LBB0_8
LBB0_6:
Lloh12:
	adrp	x8, _errno@GOTPAGE
Lloh13:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	b	LBB0_9
LBB0_7:
	ldr	w0, [x19, #4]
	bl	_close
LBB0_8:
	mov	x0, x19
	bl	_obj_free
	mov	w0, #0
LBB0_9:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_OBJ_TYPE_TAG,4,2               ; @OBJ_TYPE_TAG
	.comm	_errno,4,2                      ; @errno
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_PROTO_IOC_BUSDMA_TAG_DESTROY,4,2 ; @PROTO_IOC_BUSDMA_TAG_DESTROY
	.comm	_PROTO_IOC_BUSDMA,4,2           ; @PROTO_IOC_BUSDMA
.subsections_via_symbols
