	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_get_dmabuf_info  ## -- Begin function amdgpu_amdkfd_get_dmabuf_info
	.p2align	4, 0x90
_amdgpu_amdkfd_get_dmabuf_info:         ## @amdgpu_amdkfd_get_dmabuf_info
	.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	%r9, -80(%rbp)                  ## 8-byte Spill
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	24(%rbp), %r15
	movq	16(%rbp), %r12
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	movl	%esi, %edi
	callq	_dma_buf_get
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_2:
	movl	%r13d, -44(%rbp)                ## 4-byte Spill
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rax
	cmpq	_amdgpu_dmabuf_ops@GOTPCREL(%rip), %rax
	jne	LBB0_14
## %bb.4:
	movq	(%r14), %rdi
	movq	(%rdi), %rax
	movq	(%rax), %rcx
	movq	(%rbx), %rdx
	cmpq	(%rdx), %rcx
	jne	LBB0_14
## %bb.5:
	movq	8(%rax), %r15
	callq	_gem_to_amdgpu_bo
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rsi
	movq	_AMDGPU_GEM_DOMAIN_GTT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rsi), %edx
	testl	%edx, (%rax)
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	je	LBB0_15
## %bb.6:
	movq	%rax, %rcx
	testq	%r13, %r13
	je	LBB0_8
## %bb.7:
	movq	%r15, (%r13)
LBB0_8:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	testq	%r13, %r13
	movq	%rcx, %r15
	je	LBB0_10
## %bb.9:
	movq	%r15, %rdi
	callq	_amdgpu_bo_size
	movl	%eax, (%r13)
LBB0_10:
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	testq	%rcx, %rcx
	je	LBB0_12
## %bb.11:
	movl	8(%r15), %eax
	movl	%eax, (%rcx)
LBB0_12:
	testq	%r12, %r12
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	je	LBB0_16
## %bb.13:
	leaq	-100(%rbp), %r8
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_amdgpu_bo_get_metadata
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_14:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
LBB0_15:
	movq	%r14, %rdi
	callq	_dma_buf_put
	movl	%ebx, %eax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	xorl	%ebx, %ebx
LBB0_17:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	_AMDGPU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rax
	testq	%rdx, %rdx
	je	LBB0_15
## %bb.18:
	movl	(%rax), %eax
	andl	(%r15), %eax
	jne	LBB0_20
## %bb.19:
	movq	_ALLOC_MEM_FLAGS_GTT@GOTPCREL(%rip), %rax
	jmp	LBB0_21
LBB0_20:
	movq	_ALLOC_MEM_FLAGS_VRAM@GOTPCREL(%rip), %rax
LBB0_21:
	movl	(%rax), %eax
	movl	%eax, (%rdx)
	movq	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, 4(%r15)
	je	LBB0_15
## %bb.22:
	movq	_ALLOC_MEM_FLAGS_PUBLIC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%rdx)
	jmp	LBB0_15
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_amdgpu_dmabuf_ops,4,2          ## @amdgpu_dmabuf_ops
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ## @AMDGPU_GEM_DOMAIN_VRAM
	.comm	_AMDGPU_GEM_DOMAIN_GTT,4,2      ## @AMDGPU_GEM_DOMAIN_GTT
	.comm	_ALLOC_MEM_FLAGS_VRAM,4,2       ## @ALLOC_MEM_FLAGS_VRAM
	.comm	_ALLOC_MEM_FLAGS_GTT,4,2        ## @ALLOC_MEM_FLAGS_GTT
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ## @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_ALLOC_MEM_FLAGS_PUBLIC,4,2     ## @ALLOC_MEM_FLAGS_PUBLIC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_amdkfd_get_dmabuf_info  ; -- Begin function amdgpu_amdkfd_get_dmabuf_info
	.p2align	2
_amdgpu_amdkfd_get_dmabuf_info:         ; @amdgpu_amdkfd_get_dmabuf_info
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	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
	.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	x20, x7
	mov	x21, x6
	mov	x22, x5
	mov	x23, x4
	mov	x25, x3
	mov	x27, x2
	mov	x26, x0
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	mov	x0, x1
	bl	_dma_buf_get
	mov	x19, x0
	bl	_IS_ERR
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x19
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_PTR_ERR
LBB0_2:
	neg	w24, w24
	ldr	x8, [x19, #8]
Lloh3:
	adrp	x9, _amdgpu_dmabuf_ops@GOTPAGE
Lloh4:
	ldr	x9, [x9, _amdgpu_dmabuf_ops@GOTPAGEOFF]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.3:
	ldr	x0, [x19]
	ldr	x8, [x0]
	ldr	x9, [x8]
	ldr	x10, [x26]
	ldr	x10, [x10]
	cmp	x9, x10
	b.ne	LBB0_17
; %bb.4:
	ldr	x28, [x8, #8]
	bl	_gem_to_amdgpu_bo
	ldr	w8, [x0]
Lloh5:
	adrp	x9, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
Lloh8:
	adrp	x10, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGE
Lloh9:
	ldr	x10, [x10, _AMDGPU_GEM_DOMAIN_GTT@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_17
; %bb.5:
	mov	x26, x0
	cbz	x27, LBB0_7
; %bb.6:
	str	x28, [x27]
LBB0_7:
	cbz	x25, LBB0_9
; %bb.8:
	mov	x0, x26
	bl	_amdgpu_bo_size
	str	w0, [x25]
LBB0_9:
	cbz	x21, LBB0_11
; %bb.10:
	ldr	w8, [x26, #8]
	str	w8, [x21]
LBB0_11:
	cbz	x23, LBB0_13
; %bb.12:
	add	x4, sp, #12
	mov	x0, x26
	mov	x1, x23
	mov	x2, x22
	mov	x3, x21
	bl	_amdgpu_bo_get_metadata
	mov	x24, x0
	b	LBB0_14
LBB0_13:
	mov	w24, #0
LBB0_14:
	cbz	x20, LBB0_17
; %bb.15:
	ldr	w8, [x26]
Lloh11:
	adrp	x9, _ALLOC_MEM_FLAGS_VRAM@GOTPAGE
Lloh12:
	ldr	x9, [x9, _ALLOC_MEM_FLAGS_VRAM@GOTPAGEOFF]
Lloh13:
	adrp	x10, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh14:
	ldr	x10, [x10, _AMDGPU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh15:
	ldr	w10, [x10]
Lloh16:
	adrp	x11, _ALLOC_MEM_FLAGS_GTT@GOTPAGE
Lloh17:
	ldr	x11, [x11, _ALLOC_MEM_FLAGS_GTT@GOTPAGEOFF]
	tst	w10, w8
	csel	x8, x11, x9, eq
	ldr	w8, [x8]
	str	w8, [x20]
	ldr	w9, [x26, #4]
Lloh18:
	adrp	x10, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGE
Lloh19:
	ldr	x10, [x10, _AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED@GOTPAGEOFF]
Lloh20:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_17
; %bb.16:
Lloh21:
	adrp	x9, _ALLOC_MEM_FLAGS_PUBLIC@GOTPAGE
Lloh22:
	ldr	x9, [x9, _ALLOC_MEM_FLAGS_PUBLIC@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	orr	w8, w9, w8
	str	w8, [x20]
LBB0_17:
	mov	x0, x19
	bl	_dma_buf_put
	mov	x0, x24
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_amdgpu_dmabuf_ops,4,2          ; @amdgpu_dmabuf_ops
	.comm	_AMDGPU_GEM_DOMAIN_VRAM,4,2     ; @AMDGPU_GEM_DOMAIN_VRAM
	.comm	_AMDGPU_GEM_DOMAIN_GTT,4,2      ; @AMDGPU_GEM_DOMAIN_GTT
	.comm	_ALLOC_MEM_FLAGS_VRAM,4,2       ; @ALLOC_MEM_FLAGS_VRAM
	.comm	_ALLOC_MEM_FLAGS_GTT,4,2        ; @ALLOC_MEM_FLAGS_GTT
	.comm	_AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED,4,2 ; @AMDGPU_GEM_CREATE_CPU_ACCESS_REQUIRED
	.comm	_ALLOC_MEM_FLAGS_PUBLIC,4,2     ; @ALLOC_MEM_FLAGS_PUBLIC
.subsections_via_symbols
