	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_label_bo_ioctl             ## -- Begin function vc4_label_bo_ioctl
	.p2align	4, 0x90
_vc4_label_bo_ioctl:                    ## @vc4_label_bo_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, %r15
	movq	%rsi, %rbx
	callq	_to_vc4_dev
	cmpq	$0, 8(%rbx)
	je	LBB0_1
## %bb.3:
	movq	%rax, %r14
	movl	16(%rbx), %edi
	callq	_u64_to_user_ptr
	movq	8(%rbx), %rsi
	incq	%rsi
	movl	%eax, %edi
	callq	_strndup_user
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.11:
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PTR_ERR                        ## TAILCALL
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movq	%rax, %r15
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r14, %rdi
	movq	%r12, %rsi
	callq	_vc4_get_user_label
	cmpl	$-1, %eax
	je	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_vc4_bo_set_label
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_5:
	movl	(%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_DRM_ERROR
	movq	%r12, %rdi
	callq	_kfree
	movq	_ENOENT@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_drm_gem_object_put_unlocked
LBB0_10:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to look up GEM BO %d\n"

	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_label_bo_ioctl             ; -- Begin function vc4_label_bo_ioctl
	.p2align	2
_vc4_label_bo_ioctl:                    ; @vc4_label_bo_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	x21, x2
	mov	x20, x1
	bl	_to_vc4_dev
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w0, [x20, #16]
	bl	_u64_to_user_ptr
	ldr	x8, [x20, #8]
	add	x1, x8, #1
	bl	_strndup_user
	mov	x22, x0
	bl	_IS_ERR
	cbz	x0, LBB0_5
; %bb.2:
	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
	b	_PTR_ERR
LBB0_3:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_5:
	ldr	w1, [x20]
	mov	x0, x21
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_8
; %bb.6:
	mov	x21, x0
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x19
	mov	x1, x22
	bl	_vc4_get_user_label
	cmn	w0, #1
	b.eq	LBB0_9
; %bb.7:
	mov	x1, x0
	mov	x0, x21
	bl	_vc4_bo_set_label
	mov	w20, #0
	b	LBB0_10
LBB0_8:
	ldr	w1, [x20]
Lloh2:
	adrp	x0, l_.str@PAGE
Lloh3:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_ERROR
	mov	x0, x22
	bl	_kfree
Lloh4:
	adrp	x8, _ENOENT@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
	b	LBB0_4
LBB0_9:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, x21
	bl	_drm_gem_object_put_unlocked
LBB0_11:
	mov	x0, x20
	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
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to look up GEM BO %d\n"

	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
