	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_perfmon_get_values_ioctl   ## -- Begin function vc4_perfmon_get_values_ioctl
	.p2align	4, 0x90
_vc4_perfmon_get_values_ioctl:          ## @vc4_perfmon_get_values_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	callq	_to_vc4_dev
	cmpl	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	(%rbx), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	leaq	4(%rbx), %rdi
	movl	4(%r14), %esi
	callq	_idr_find
	movq	%rax, %r15
	movq	%rax, %rdi
	callq	_vc4_perfmon_get
	movq	%rbx, %rdi
	callq	_mutex_unlock
	testq	%r15, %r15
	je	LBB0_3
## %bb.5:
	movl	(%r14), %edi
	callq	_u64_to_user_ptr
	movl	(%r15), %edx
	movl	4(%r15), %esi
	shll	$2, %edx
	movl	%eax, %edi
	callq	_copy_to_user
	movq	_EFAULT@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	subl	(%rcx), %ebx
	xorl	%ecx, %ecx
	testq	%rax, %rax
	cmovel	%ecx, %ebx
	movq	%r15, %rdi
	callq	_vc4_perfmon_put
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_4:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Getting perfmon no VC4 V3D probed\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EFAULT,4,2                     ## @EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vc4_perfmon_get_values_ioctl   ; -- Begin function vc4_perfmon_get_values_ioctl
	.p2align	2
_vc4_perfmon_get_values_ioctl:          ; @vc4_perfmon_get_values_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	x20, x2
	mov	x19, x1
	bl	_to_vc4_dev
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	x21, [x20]
	mov	x0, x21
	bl	_mutex_lock
	add	x0, x21, #4
	ldr	w1, [x19, #4]
	bl	_idr_find
	mov	x20, x0
	bl	_vc4_perfmon_get
	mov	x0, x21
	bl	_mutex_unlock
	cbz	x20, LBB0_4
; %bb.2:
	ldr	w0, [x19]
	bl	_u64_to_user_ptr
	ldp	w8, w1, [x20]
	lsl	w2, w8, #2
	bl	_copy_to_user
Lloh0:
	adrp	x8, _EFAULT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	x0, #0
	csneg	w19, wzr, w8, eq
	mov	x0, x20
	bl	_vc4_perfmon_put
	b	LBB0_6
LBB0_3:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
Lloh5:
	adrp	x8, _ENODEV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_5:
	ldr	w8, [x8]
	neg	w19, w8
LBB0_6:
	mov	x0, 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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Getting perfmon no VC4 V3D probed\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EFAULT,4,2                     ; @EFAULT
.subsections_via_symbols
