	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_metadata_ioctl      ## -- Begin function amdgpu_gem_metadata_ioctl
	.p2align	4, 0x90
_amdgpu_gem_metadata_ioctl:             ## @amdgpu_gem_metadata_ioctl
	.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	%rdx, %rbx
	movq	%rsi, %r12
	movl	24(%rsi), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movl	24(%r12), %esi
	movq	%rbx, %rdi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_gem_to_amdgpu_bo
	movq	%rax, %r14
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_amdgpu_bo_reserve
	movl	%eax, %ebx
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_12
## %bb.3:
	movq	(%r12), %rax
	movq	_AMDGPU_GEM_METADATA_OP_GET_METADATA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_5
## %bb.4:
	leaq	8(%r12), %rbx
	leaq	20(%r12), %rsi
	movq	%r14, %rdi
	callq	_amdgpu_bo_get_tiling_flags
	movl	16(%r12), %esi
	addq	$12, %r12
	movq	%r14, %rdi
	movl	$4, %edx
	movq	%rbx, %rcx
	movq	%r12, %r8
	callq	_amdgpu_bo_get_metadata
LBB0_10:
	movl	%eax, %ebx
	jmp	LBB0_11
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_5:
	movq	_AMDGPU_GEM_METADATA_OP_SET_METADATA@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.6:
	cmpl	$5, 8(%r12)
	jb	LBB0_8
## %bb.7:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movl	20(%r12), %esi
	movq	%r14, %rdi
	callq	_amdgpu_bo_set_tiling_flags
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_9
LBB0_11:
	movq	%r14, %rdi
	callq	_amdgpu_bo_unreserve
LBB0_12:
	movq	%r15, %rdi
	callq	_drm_gem_object_put_unlocked
LBB0_13:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	16(%r12), %esi
	movl	8(%r12), %edx
	movl	12(%r12), %ecx
	movq	%r14, %rdi
	callq	_amdgpu_bo_set_metadata
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d \n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_AMDGPU_GEM_METADATA_OP_GET_METADATA,8,3 ## @AMDGPU_GEM_METADATA_OP_GET_METADATA
	.comm	_AMDGPU_GEM_METADATA_OP_SET_METADATA,8,3 ## @AMDGPU_GEM_METADATA_OP_SET_METADATA
	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_amdgpu_gem_metadata_ioctl      ; -- Begin function amdgpu_gem_metadata_ioctl
	.p2align	2
_amdgpu_gem_metadata_ioctl:             ; @amdgpu_gem_metadata_ioctl
	.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, x2
	mov	x21, x1
	ldr	w1, [x1, #24]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldr	w1, [x21, #24]
	mov	x0, x19
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	bl	_gem_to_amdgpu_bo
	mov	x20, x0
	mov	w1, #0
	bl	_amdgpu_bo_reserve
	mov	x22, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_11
; %bb.2:
	ldr	x8, [x21]
Lloh2:
	adrp	x9, _AMDGPU_GEM_METADATA_OP_GET_METADATA@GOTPAGE
Lloh3:
	ldr	x9, [x9, _AMDGPU_GEM_METADATA_OP_GET_METADATA@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.3:
	add	x22, x21, #8
	add	x1, x21, #20
	mov	x0, x20
	bl	_amdgpu_bo_get_tiling_flags
	ldr	w1, [x21, #16]
	add	x4, x21, #12
	mov	x0, x20
	mov	w2, #4
	mov	x3, x22
	bl	_amdgpu_bo_get_metadata
LBB0_4:
	mov	x22, x0
	b	LBB0_10
LBB0_5:
Lloh5:
	adrp	x8, _ENOENT@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_12
LBB0_6:
Lloh8:
	adrp	x9, _AMDGPU_GEM_METADATA_OP_SET_METADATA@GOTPAGE
Lloh9:
	ldr	x9, [x9, _AMDGPU_GEM_METADATA_OP_SET_METADATA@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.7:
	ldr	w8, [x21, #8]
	cmp	w8, #5
	b.lo	LBB0_9
; %bb.8:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_10
LBB0_9:
	ldr	w1, [x21, #20]
	mov	x0, x20
	bl	_amdgpu_bo_set_tiling_flags
	mov	x22, x0
	cbz	w0, LBB0_13
LBB0_10:
	mov	x0, x20
	bl	_amdgpu_bo_unreserve
LBB0_11:
	mov	x0, x19
	bl	_drm_gem_object_put_unlocked
LBB0_12:
	mov	x0, x22
	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
	ret
LBB0_13:
	ldp	w3, w1, [x21, #12]
	ldr	w2, [x21, #8]
	mov	x0, x20
	bl	_amdgpu_bo_set_metadata
	b	LBB0_4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d \n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_AMDGPU_GEM_METADATA_OP_GET_METADATA,8,3 ; @AMDGPU_GEM_METADATA_OP_GET_METADATA
	.comm	_AMDGPU_GEM_METADATA_OP_SET_METADATA,8,3 ; @AMDGPU_GEM_METADATA_OP_SET_METADATA
	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
