	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_bo_kmap                 ## -- Begin function amdgpu_bo_kmap
	.p2align	4, 0x90
_amdgpu_bo_kmap:                        ## @amdgpu_bo_kmap
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rdi)
	je	LBB0_2
## %bb.1:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_2:
	movq	%rsi, %r14
	movq	%rdi, %r15
	callq	_amdgpu_bo_kptr
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	xorl	%ebx, %ebx
	testq	%r14, %r14
	je	LBB0_11
LBB0_10:
	movq	%rax, (%r14)
	jmp	LBB0_11
LBB0_4:
	movl	12(%r15), %edi
	movq	_MAX_SCHEDULE_TIMEOUT@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_dma_resv_wait_timeout_rcu
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	leaq	8(%r15), %rdi
	movl	8(%r15), %edx
	leaq	4(%r15), %rcx
	xorl	%ebx, %ebx
	xorl	%esi, %esi
	callq	_ttm_bo_kmap
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_5:
	movq	%rax, %rbx
LBB0_11:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	testq	%r14, %r14
	je	LBB0_11
## %bb.9:
	movq	%r15, %rdi
	callq	_amdgpu_bo_kptr
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS,4,2 ## @AMDGPU_GEM_CREATE_NO_CPU_ACCESS
	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ## @MAX_SCHEDULE_TIMEOUT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_bo_kmap                 ; -- Begin function amdgpu_bo_kmap
	.p2align	2
_amdgpu_bo_kmap:                        ; @amdgpu_bo_kmap
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AMDGPU_GEM_CREATE_NO_CPU_ACCESS@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _EPERM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_11
LBB0_2:
	mov	x19, x1
	mov	x20, x0
	bl	_amdgpu_bo_kptr
	cbz	x0, LBB0_5
; %bb.3:
	cbz	x19, LBB0_10
LBB0_4:
	mov	x8, x0
	mov	w0, #0
	str	x8, [x19]
	b	LBB0_11
LBB0_5:
	ldr	w0, [x20, #12]
Lloh6:
	adrp	x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_SCHEDULE_TIMEOUT@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	w1, #0
	mov	w2, #0
	bl	_dma_resv_wait_timeout_rcu
	tbnz	x0, #63, LBB0_11
; %bb.6:
	mov	x0, x20
	ldr	w2, [x0, #8]!
	sub	x3, x0, #4
	mov	w1, #0
	bl	_ttm_bo_kmap
	cbz	x0, LBB0_8
; %bb.7:
                                        ; kill: def $w0 killed $w0 killed $x0 def $x0
	b	LBB0_11
LBB0_8:
	cbz	x19, LBB0_10
; %bb.9:
	mov	x0, x20
	bl	_amdgpu_bo_kptr
	b	LBB0_4
LBB0_10:
	mov	w0, #0
LBB0_11:
                                        ; kill: def $w0 killed $w0 killed $x0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_AMDGPU_GEM_CREATE_NO_CPU_ACCESS,4,2 ; @AMDGPU_GEM_CREATE_NO_CPU_ACCESS
	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_MAX_SCHEDULE_TIMEOUT,4,2       ; @MAX_SCHEDULE_TIMEOUT
.subsections_via_symbols
