	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sync
_sync:                                  ## @sync
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	16(%rdi), %rax
	movslq	%esi, %rcx
	shlq	$4, %rcx
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	leaq	(%rax,%rcx), %r13
	leaq	4(%rdi), %r14
	movq	_FRAME_READY@GOTPCREL(%rip), %r15
	movq	_current@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r15), %rcx
	xorl	%eax, %eax
	cmpq	%rcx, (%r13)
	je	LBB0_12
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpl	$0, 8(%rbx)
	je	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r14, %rdi
	callq	_mutex_unlock
	cmpl	$0, 8(%rbx)
	je	LBB0_5
## %bb.6:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r13), %rax
	cmpq	(%r15), %rax
	sete	%al
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	movb	$1, %al
LBB0_7:                                 ##   in Loop: Header=BB0_1 Depth=1
	movl	12(%rbx), %edi
	movzbl	%al, %esi
	callq	_wait_event_interruptible
	movq	%r14, %rdi
	callq	_mutex_lock
	movl	(%r12), %edi
	callq	_signal_pending
	testq	%rax, %rax
	jne	LBB0_8
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%rbx, %rdi
	callq	_video_is_registered
	testl	%eax, %eax
	jne	LBB0_1
## %bb.10:
	movq	_ENOTTY@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
LBB0_3:
	movq	%rcx, (%r13)
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	$0, 8(%rcx,%rdx)
	jmp	LBB0_12
LBB0_8:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rcx
LBB0_11:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FRAME_READY,8,3                ## @FRAME_READY
	.comm	_current,4,2                    ## @current
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_ENOTTY,4,2                     ## @ENOTTY
	.no_dead_strip	_sync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sync
_sync:                                  ; @sync
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
                                        ; kill: def $w1 killed $w1 def $x1
	mov	x19, x0
	ldr	x21, [x0, #16]
	sxtw	x22, w1
	add	x23, x21, w1, sxtw #4
	add	x20, x0, #4
Lloh0:
	adrp	x24, _FRAME_READY@GOTPAGE
Lloh1:
	ldr	x24, [x24, _FRAME_READY@GOTPAGEOFF]
Lloh2:
	adrp	x25, _current@GOTPAGE
Lloh3:
	ldr	x25, [x25, _current@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x23]
	ldr	x8, [x24]
	cmp	x9, x8
	b.eq	LBB0_9
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	w9, [x19, #8]
	cbz	w9, LBB0_10
; %bb.3:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x20
	bl	_mutex_unlock
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_1 Depth=1
	ldr	x8, [x23]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w1, eq
	b	LBB0_6
LBB0_5:                                 ;   in Loop: Header=BB0_1 Depth=1
	mov	w1, #1
LBB0_6:                                 ;   in Loop: Header=BB0_1 Depth=1
	ldr	w0, [x19, #12]
	bl	_wait_event_interruptible
	mov	x0, x20
	bl	_mutex_lock
	ldr	w0, [x25]
	bl	_signal_pending
	cbnz	x0, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_1 Depth=1
	mov	x0, x19
	bl	_video_is_registered
	cbnz	w0, LBB0_1
; %bb.8:
Lloh4:
	adrp	x8, _ENOTTY@GOTPAGE
Lloh5:
	ldr	x8, [x8, _ENOTTY@GOTPAGEOFF]
	b	LBB0_12
LBB0_9:
	mov	w0, #0
	b	LBB0_13
LBB0_10:
	mov	w0, #0
	str	x8, [x23]
	add	x8, x21, x22, lsl #4
	str	xzr, [x8, #8]
	b	LBB0_13
LBB0_11:
Lloh6:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
LBB0_12:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_FRAME_READY,8,3                ; @FRAME_READY
	.comm	_current,4,2                    ; @current
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_ENOTTY,4,2                     ; @ENOTTY
	.no_dead_strip	_sync
.subsections_via_symbols
