	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_via_decoder_futex              ## -- Begin function via_decoder_futex
	.p2align	4, 0x90
_via_decoder_futex:                     ## @via_decoder_futex
	.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	%rsi, %r14
	movq	(%rdi), %r15
	movq	8(%r15), %rbx
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	movq	(%r14), %rsi
	movq	_VIA_NR_XVMC_LOCKS@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	jae	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_XVMCLOCKPTR
	movl	8(%r14), %ecx
	xorl	%ebx, %ebx
	cmpl	$128, %ecx
	je	LBB0_5
## %bb.3:
	cmpl	$129, %ecx
	jne	LBB0_6
## %bb.4:
	movq	(%r15), %rcx
	movq	(%r14), %rdx
	movl	(%rcx,%rdx,4), %esi
	movslq	12(%r14), %rcx
	imulq	$1717986919, %rcx, %rcx         ## imm = 0x66666667
	movq	%rcx, %rdx
	shrq	$63, %rdx
	sarq	$34, %rcx
	addl	%edx, %ecx
	movq	_DRM_HZ@GOTPCREL(%rip), %rdx
	movslq	(%rdx), %rdx
	imulq	$1374389535, %rdx, %rdx         ## imm = 0x51EB851F
	movq	%rdx, %rdi
	shrq	$63, %rdi
	sarq	$37, %rdx
	addl	%edi, %edx
	imull	%ecx, %edx
	movl	(%rax), %eax
	xorl	%ecx, %ecx
	cmpl	16(%r14), %eax
	setne	%cl
	xorl	%ebx, %ebx
	xorl	%edi, %edi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_DRM_WAIT_ON
	jmp	LBB0_6
LBB0_1:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_6
LBB0_5:
	movq	(%r14), %rdi
	shlq	$2, %rdi
	addq	(%r15), %rdi
	callq	_DRM_WAKEUP
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	"\n"

	.comm	_VIA_NR_XVMC_LOCKS,8,3          ## @VIA_NR_XVMC_LOCKS
	.comm	_EFAULT,4,2                     ## @EFAULT
	.comm	_DRM_HZ,4,2                     ## @DRM_HZ
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_via_decoder_futex              ; -- Begin function via_decoder_futex
	.p2align	2
_via_decoder_futex:                     ; @via_decoder_futex
	.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, x1
	ldr	x21, [x0]
	ldr	x20, [x21, #8]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	ldr	x1, [x19]
Lloh2:
	adrp	x8, _VIA_NR_XVMC_LOCKS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VIA_NR_XVMC_LOCKS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x1, x8
	b.hs	LBB0_4
; %bb.1:
	mov	x0, x20
	bl	_XVMCLOCKPTR
	ldr	w8, [x19, #8]
	cmp	w8, #128
	b.eq	LBB0_5
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_6
; %bb.3:
	ldr	x8, [x21]
	ldr	x9, [x19]
	ldr	w1, [x8, x9, lsl #2]
	ldrsw	x8, [x19, #12]
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x8, x8, x9
	lsr	x9, x8, #63
	asr	x8, x8, #34
Lloh5:
	adrp	x10, _DRM_HZ@GOTPAGE
Lloh6:
	ldr	x10, [x10, _DRM_HZ@GOTPAGEOFF]
	add	w8, w8, w9
Lloh7:
	ldrsw	x9, [x10]
	mov	w10, #34079
	movk	w10, #20971, lsl #16
	mul	x9, x9, x10
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	mul	w2, w9, w8
	ldr	w8, [x0]
	ldr	w9, [x19, #16]
	cmp	w8, w9
	cset	w3, ne
	mov	w0, #0
	bl	_DRM_WAIT_ON
	b	LBB0_6
LBB0_4:
Lloh8:
	adrp	x8, _EFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_7
LBB0_5:
	ldr	x8, [x21]
	ldr	x9, [x19]
	add	x0, x8, x9, lsl #2
	bl	_DRM_WAKEUP
LBB0_6:
	mov	w0, #0
LBB0_7:
	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	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\n"

	.comm	_VIA_NR_XVMC_LOCKS,8,3          ; @VIA_NR_XVMC_LOCKS
	.comm	_EFAULT,4,2                     ; @EFAULT
	.comm	_DRM_HZ,4,2                     ; @DRM_HZ
.subsections_via_symbols
