	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_set_speed                 ## -- Begin function ivtv_set_speed
	.p2align	4, 0x90
_ivtv_set_speed:                        ## @ivtv_set_speed
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_CX2341X_MBOX_MAX_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	movq	_wait@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_DEFINE_WAIT
	testl	%r12d, %r12d
	movl	$1000, %r14d                    ## imm = 0x3E8
	cmovnel	%r12d, %r14d
	movl	(%r15), %eax
	cmpl	%eax, %r14d
	jne	LBB0_3
## %bb.1:
	cmpl	$-1, %r12d
	je	LBB0_5
## %bb.2:
	xorl	%ebx, %ebx
	cmpl	$1, %r12d
	je	LBB0_5
	jmp	LBB0_38
LBB0_3:
	cmpl	$1, %r12d
	je	LBB0_5
## %bb.4:
	cmpl	$-1, %r12d
	jne	LBB0_10
LBB0_5:
	xorl	%r14d, %eax
	js	LBB0_7
## %bb.6:
	movq	_CX2341X_DEC_STEP_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ivtv_vapi
	movl	%r14d, (%r15)
	jmp	LBB0_38
LBB0_7:
	cmpl	$1, %r12d
	je	LBB0_9
## %bb.8:
	cmpl	$-1, %r12d
	jne	LBB0_10
LBB0_9:
	testl	%r14d, %r14d
	movl	$-1000, %eax                    ## imm = 0xFC18
	movl	$1000, %r14d                    ## imm = 0x3E8
	cmovsl	%eax, %r14d
LBB0_10:
	leal	-1001(%r14), %eax
	xorl	%ecx, %ecx
	cmpl	$-2001, %eax                    ## imm = 0xF82F
	setb	%cl
	shll	$31, %ecx
	xorl	%ebx, %ebx
	cmpl	$-2501, %eax                    ## imm = 0xF63B
	setb	%bl
	shll	$30, %ebx
	orl	%ecx, %ebx
	movl	%ebx, (%r13)
	movl	%r14d, %eax
	shrl	$31, %eax
	movl	%eax, 4(%r13)
	movl	%r14d, %eax
	notl	%eax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
                                        ## kill: def $eax killed $eax killed $rax
	shrl	$29, %eax
	orl	$3, %eax
	movl	%eax, 8(%r13)
	movl	24(%r15), %edi
	callq	_v4l2_ctrl_g_ctrl
	movl	%eax, 12(%r13)
	cmpl	$1500, %r14d                    ## imm = 0x5DC
	je	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	cmpl	$500, %r14d                     ## imm = 0x1F4
	jne	LBB0_13
LBB0_12:
	movl	4(%r15), %eax
LBB0_13:
	movl	%eax, 16(%r13)
	movq	$0, 20(%r13)
	cmpl	$1499, %r14d                    ## imm = 0x5DB
	jg	LBB0_18
## %bb.14:
	cmpl	$-2000, %r14d                   ## imm = 0xF830
	je	LBB0_21
## %bb.15:
	cmpl	$-1500, %r14d                   ## imm = 0xFA24
	je	LBB0_20
LBB0_16:
	cmpl	$-999, %r14d                    ## imm = 0xFC19
	jb	LBB0_22
## %bb.17:
	movl	%r14d, %ecx
	negl	%ecx
	movw	$1000, %ax                      ## imm = 0x3E8
	xorl	%edx, %edx
	divw	%cx
	jmp	LBB0_24
LBB0_18:
	cmpl	$2000, %r14d                    ## imm = 0x7D0
	je	LBB0_21
## %bb.19:
	cmpl	$1500, %r14d                    ## imm = 0x5DC
	jne	LBB0_16
LBB0_20:
	orl	$1, %ebx
	jmp	LBB0_25
LBB0_21:
	orl	$2, %ebx
	jmp	LBB0_25
LBB0_22:
	leal	-1(%r14), %eax
	cmpl	$998, %eax                      ## imm = 0x3E6
	ja	LBB0_26
## %bb.23:
	movw	$1000, %ax                      ## imm = 0x3E8
	xorl	%edx, %edx
	divw	%r14w
LBB0_24:
	movzwl	%ax, %eax
	orl	%eax, %ebx
LBB0_25:
	movl	%ebx, (%r13)
LBB0_26:
	leaq	20(%r15), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_34
## %bb.27:
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movl	%r12d, -52(%rbp)                ## 4-byte Spill
	movq	_CX2341X_DEC_PAUSE_PLAYBACK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ivtv_vapi
	leaq	8(%r15), %rdi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	callq	_mutex_unlock
	leaq	12(%r15), %rdi
	movq	_TASK_INTERRUPTIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	callq	_prepare_to_wait
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	leaq	16(%r15), %r12
	movq	_IVTV_F_I_DMA@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_32
## %bb.28:
	movq	_current@GOTPCREL(%rip), %r13
	.p2align	4, 0x90
LBB0_29:                                ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	callq	_signal_pending
	testl	%eax, %eax
	jne	LBB0_30
## %bb.31:                              ##   in Loop: Header=BB0_29 Depth=1
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_schedule
	movl	(%r15), %edi
	movq	%r12, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_29
	jmp	LBB0_32
LBB0_30:
	movl	%eax, %ebx
LBB0_32:
	movq	_wait@GOTPCREL(%rip), %rsi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_finish_wait
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_mutex_lock
	testl	%ebx, %ebx
	je	LBB0_33
## %bb.40:
	movq	_EINTR@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_38
LBB0_33:
	movq	_CX2341X_DEC_SET_PLAYBACK_SPEED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdi
	movl	$7, %edx
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rcx
	callq	_ivtv_api
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	movl	8(%rbx), %ecx
	movl	12(%rbx), %r8d
	movl	16(%rbx), %r9d
	movl	20(%rbx), %eax
	movl	24(%rbx), %ebx
	leaq	L_.str(%rip), %rdi
	pushq	%rbx
	pushq	%rax
	callq	_IVTV_DEBUG_INFO
	addq	$16, %rsp
	movl	-52(%rbp), %r12d                ## 4-byte Reload
LBB0_34:
	cmpl	$1, %r12d
	je	LBB0_36
## %bb.35:
	cmpl	$-1, %r12d
	jne	LBB0_37
LBB0_36:
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	shrl	$31, %eax
	leal	(%rax,%rax), %r14d
	decl	%r14d
	movq	_CX2341X_DEC_STEP_VIDEO@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_ivtv_vapi
LBB0_37:
	movl	%r14d, (%r15)
	xorl	%ebx, %ebx
LBB0_38:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_41
## %bb.39:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_41:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ## @CX2341X_MBOX_MAX_DATA
	.comm	_wait,4,2                       ## @wait
	.comm	_CX2341X_DEC_STEP_VIDEO,4,2     ## @CX2341X_DEC_STEP_VIDEO
	.comm	_CX2341X_DEC_PAUSE_PLAYBACK,4,2 ## @CX2341X_DEC_PAUSE_PLAYBACK
	.comm	_TASK_INTERRUPTIBLE,4,2         ## @TASK_INTERRUPTIBLE
	.comm	_IVTV_F_I_DMA,4,2               ## @IVTV_F_I_DMA
	.comm	_current,4,2                    ## @current
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_CX2341X_DEC_SET_PLAYBACK_SPEED,4,2 ## @CX2341X_DEC_SET_PLAYBACK_SPEED
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Setting Speed to 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_set_speed                 ; -- Begin function ivtv_set_speed
	.p2align	2
_ivtv_set_speed:                        ; @ivtv_set_speed
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _CX2341X_MBOX_MAX_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX2341X_MBOX_MAX_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
Lloh8:
	adrp	x8, _wait@GOTPAGE
Lloh9:
	ldr	x8, [x8, _wait@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_DEFINE_WAIT
	mov	w8, #1000
	cmp	w20, #0
	csel	w26, w8, w20, eq
	ldr	w8, [x19]
	cmp	w26, w8
	b.ne	LBB0_4
; %bb.1:
	cmn	w20, #1
	b.eq	LBB0_6
; %bb.2:
	cmp	w20, #1
	b.eq	LBB0_6
; %bb.3:
	mov	w0, #0
	b	LBB0_42
LBB0_4:
	cmp	w20, #1
	b.eq	LBB0_6
; %bb.5:
	cmn	w20, #1
	b.ne	LBB0_10
LBB0_6:
	eor	w8, w8, w26
	tbz	w8, #31, LBB0_40
; %bb.7:
	cmp	w20, #1
	b.eq	LBB0_9
; %bb.8:
	cmn	w20, #1
	b.ne	LBB0_10
LBB0_9:
	cmp	w26, #0
	mov	w8, #-1000
	cneg	w26, w8, ge
LBB0_10:
	sub	w8, w26, #1001
	cmn	w8, #2001
	cset	w9, lo
	cmn	w8, #2501
	cset	w8, lo
	lsl	w22, w8, #30
	bfi	w22, w9, #31, #1
	lsr	w8, w26, #31
	stp	w22, w8, [x21]
	mov	w8, #7
	mov	w9, #3
	cmp	w26, #0
	csel	w8, w9, w8, lt
	str	w8, [x21, #8]
	ldr	w0, [x19, #24]
	bl	_v4l2_ctrl_g_ctrl
	str	w0, [x21, #12]
	cmp	w26, #1500
	b.eq	LBB0_12
; %bb.11:
	cmp	w26, #500
	b.ne	LBB0_13
LBB0_12:
	ldr	w8, [x19, #4]
	b	LBB0_14
LBB0_13:
	mov	w8, #0
LBB0_14:
	stp	wzr, wzr, [x21, #20]
	str	w8, [x21, #16]
	cmp	w26, #1499
	b.gt	LBB0_19
; %bb.15:
	cmn	w26, #2000
	b.eq	LBB0_22
; %bb.16:
	cmn	w26, #1500
	b.eq	LBB0_21
LBB0_17:
	cmn	w26, #999
	b.lo	LBB0_23
; %bb.18:
	neg	w8, w26
	and	w8, w8, #0xffff
	b	LBB0_25
LBB0_19:
	cmp	w26, #2000
	b.eq	LBB0_22
; %bb.20:
	cmp	w26, #1500
	b.ne	LBB0_17
LBB0_21:
	orr	w8, w22, #0x1
	b	LBB0_26
LBB0_22:
	orr	w8, w22, #0x2
	b	LBB0_26
LBB0_23:
	sub	w8, w26, #1
	cmp	w8, #998
	b.hi	LBB0_27
; %bb.24:
	and	w8, w26, #0xffff
LBB0_25:
	mov	w9, #1000
	udiv	w8, w9, w8
	orr	w8, w22, w8
LBB0_26:
	str	w8, [x21]
LBB0_27:
	add	x0, x19, #20
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_37
; %bb.28:
Lloh11:
	adrp	x8, _CX2341X_DEC_PAUSE_PLAYBACK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _CX2341X_DEC_PAUSE_PLAYBACK@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_ivtv_vapi
	add	x22, x19, #8
	mov	x0, x22
	bl	_mutex_unlock
	add	x23, x19, #12
Lloh14:
	adrp	x8, _TASK_INTERRUPTIBLE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _TASK_INTERRUPTIBLE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x1, _wait@GOTPAGE
Lloh18:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x23
	bl	_prepare_to_wait
	add	x24, x19, #16
Lloh19:
	adrp	x27, _IVTV_F_I_DMA@GOTPAGE
Lloh20:
	ldr	x27, [x27, _IVTV_F_I_DMA@GOTPAGEOFF]
	ldr	w0, [x27]
	mov	x1, x24
	bl	_test_bit
	cbz	x0, LBB0_32
; %bb.29:
Lloh21:
	adrp	x28, _current@GOTPAGE
Lloh22:
	ldr	x28, [x28, _current@GOTPAGEOFF]
LBB0_30:                                ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x28]
	bl	_signal_pending
	cbnz	w0, LBB0_33
; %bb.31:                               ;   in Loop: Header=BB0_30 Depth=1
	bl	_schedule
	ldr	w0, [x27]
	mov	x1, x24
	bl	_test_bit
	cbnz	x0, LBB0_30
LBB0_32:
	mov	w25, #0
	b	LBB0_34
LBB0_33:
	mov	x25, x0
LBB0_34:
Lloh23:
	adrp	x1, _wait@GOTPAGE
Lloh24:
	ldr	x1, [x1, _wait@GOTPAGEOFF]
	mov	x0, x23
	bl	_finish_wait
	mov	x0, x22
	bl	_mutex_lock
	cbz	w25, LBB0_36
; %bb.35:
Lloh25:
	adrp	x8, _EINTR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EINTR@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_42
LBB0_36:
Lloh28:
	adrp	x8, _CX2341X_DEC_SET_PLAYBACK_SPEED@GOTPAGE
Lloh29:
	ldr	x8, [x8, _CX2341X_DEC_SET_PLAYBACK_SPEED@GOTPAGEOFF]
Lloh30:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #7
	mov	x3, x21
	bl	_ivtv_api
	ldp	w1, w2, [x21]
	ldp	w3, w4, [x21, #8]
	ldp	w5, w6, [x21, #16]
	ldr	w7, [x21, #24]
Lloh31:
	adrp	x0, l_.str@PAGE
Lloh32:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_INFO
LBB0_37:
	cmp	w20, #1
	b.eq	LBB0_39
; %bb.38:
	cmn	w20, #1
	b.ne	LBB0_41
LBB0_39:
	cmp	w26, #0
	mov	w8, #-1
	cneg	w26, w8, ge
LBB0_40:
Lloh33:
	adrp	x8, _CX2341X_DEC_STEP_VIDEO@GOTPAGE
Lloh34:
	ldr	x8, [x8, _CX2341X_DEC_STEP_VIDEO@GOTPAGEOFF]
Lloh35:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_ivtv_vapi
LBB0_41:
	mov	w0, #0
	str	w26, [x19]
LBB0_42:
	ldur	x8, [x29, #-88]
Lloh36:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh37:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh38:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_44
; %bb.43:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_44:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.cfi_endproc
                                        ; -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ; @CX2341X_MBOX_MAX_DATA
	.comm	_wait,4,2                       ; @wait
	.comm	_CX2341X_DEC_STEP_VIDEO,4,2     ; @CX2341X_DEC_STEP_VIDEO
	.comm	_CX2341X_DEC_PAUSE_PLAYBACK,4,2 ; @CX2341X_DEC_PAUSE_PLAYBACK
	.comm	_TASK_INTERRUPTIBLE,4,2         ; @TASK_INTERRUPTIBLE
	.comm	_IVTV_F_I_DMA,4,2               ; @IVTV_F_I_DMA
	.comm	_current,4,2                    ; @current
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_CX2341X_DEC_SET_PLAYBACK_SPEED,4,2 ; @CX2341X_DEC_SET_PLAYBACK_SPEED
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Setting Speed to 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x 0x%08x\n"

.subsections_via_symbols
