	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_dma_buf_map_detach
_amdgpu_dma_buf_map_detach:             ## @amdgpu_dma_buf_map_detach
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	(%rdi), %rdi
	callq	_gem_to_amdgpu_bo
	movq	%rax, %rbx
	movl	8(%rax), %edi
	callq	_amdgpu_ttm_adev
	movq	%rax, %r12
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_amdgpu_bo_reserve
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_5
## %bb.1:
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unpin
	movq	(%r14), %rax
	movq	(%rax), %rax
	movq	(%r12), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_4
## %bb.2:
	movq	(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	decq	%rax
	movq	%rax, (%rbx)
LBB0_4:
	movq	%rbx, %rdi
	callq	_amdgpu_bo_unreserve
LBB0_5:
	movq	%r15, %rdi
	movq	%r14, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_drm_gem_map_detach             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_amdgpu_dma_buf_map_detach
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_dma_buf_map_detach
_amdgpu_dma_buf_map_detach:             ; @amdgpu_dma_buf_map_detach
	.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, x1
	mov	x20, x0
	ldr	x0, [x0]
	bl	_gem_to_amdgpu_bo
	mov	x21, x0
	ldr	w0, [x0, #8]
	bl	_amdgpu_ttm_adev
	mov	x22, x0
	mov	x0, x21
	mov	w1, #1
	bl	_amdgpu_bo_reserve
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_5
; %bb.1:
	mov	x0, x21
	bl	_amdgpu_bo_unpin
	ldr	x8, [x19]
	ldr	x8, [x8]
	ldr	x9, [x22]
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.2:
	ldr	x8, [x21]
	cbz	x8, LBB0_4
; %bb.3:
	sub	x8, x8, #1
	str	x8, [x21]
LBB0_4:
	mov	x0, x21
	bl	_amdgpu_bo_unreserve
LBB0_5:
	mov	x0, x20
	mov	x1, 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	_drm_gem_map_detach
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_amdgpu_dma_buf_map_detach
.subsections_via_symbols
