	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdpvr_start_streaming
_hdpvr_start_streaming:                 ## @hdpvr_start_streaming
	.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), %rax
	movq	_STATUS_STREAMING@GOTPCREL(%rip), %r12
	xorl	%ebx, %ebx
	cmpq	(%r12), %rax
	je	LBB0_11
## %bb.1:
	movq	_STATUS_IDLE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.2:
	movq	%rdi, %r15
	leaq	-56(%rbp), %rsi
	callq	_get_video_info
	testl	%eax, %eax
	js	LBB0_8
## %bb.3:
	cmpl	$0, -44(%rbp)
	je	LBB0_9
## %bb.4:
	movq	_MSG_BUFFER@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_hdpvr_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%r15), %r14
	movl	-48(%rbp), %r8d
	movl	-56(%rbp), %ebx
	movl	-52(%rbp), %r9d
	subq	$8, %rsp
	leaq	L_.str.1(%rip), %rcx
	movq	%r14, %rdx
	xorl	%eax, %eax
	pushq	%rbx
	callq	_v4l2_dbg
	addq	$16, %rsp
	movl	16(%r15), %ebx
	movl	%ebx, %edi
	xorl	%esi, %esi
	callq	_usb_sndctrlpipe
	subq	$8, %rsp
	movl	%ebx, %edi
	movl	%eax, %esi
	movl	$184, %edx
	movl	$56, %ecx
	movl	$1, %r8d
	xorl	%r9d, %r9d
	pushq	$8000                           ## imm = 0x1F40
	pushq	$0
	pushq	$0
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	%eax, %ebx
	movl	(%r13), %edi
	movq	_hdpvr_debug@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	L_.str.2(%rip), %rcx
	movq	%r14, %rdx
	movl	%eax, %r8d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	testl	%ebx, %ebx
	js	LBB0_11
## %bb.5:
	movq	_CTRL_START_STREAMING_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_hdpvr_config_call
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movq	(%r12), %rax
	movq	%rax, (%r15)
	addq	$12, %r15
	movq	_hdpvr_transmit_buffers@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_INIT_WORK
	movq	%r15, %rdi
	callq	_schedule_work
	movq	_MSG_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	(%r13), %esi
	leaq	L_.str.3(%rip), %rcx
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_7:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_10:
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_8:
	movl	%eax, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	$250, %edi
	callq	_msleep
	movq	_MSG_INFO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_hdpvr_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	20(%r15), %r8d
	addq	$8, %r15
	leaq	L_.str(%rip), %rcx
	xorl	%ebx, %ebx
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_STATUS_STREAMING,8,3           ## @STATUS_STREAMING
	.comm	_STATUS_IDLE,8,3                ## @STATUS_IDLE
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_MSG_INFO,4,2                   ## @MSG_INFO
	.comm	_hdpvr_debug,4,2                ## @hdpvr_debug
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no video signal at input %d\n"

	.comm	_MSG_BUFFER,4,2                 ## @MSG_BUFFER
L_.str.1:                               ## @.str.1
	.asciz	"video signal: %dx%d@%dhz\n"

L_.str.2:                               ## @.str.2
	.asciz	"encoder start control request returned %d\n"

	.comm	_CTRL_START_STREAMING_VALUE,4,2 ## @CTRL_START_STREAMING_VALUE
	.comm	_hdpvr_transmit_buffers,4,2     ## @hdpvr_transmit_buffers
L_.str.3:                               ## @.str.3
	.asciz	"streaming started\n"

	.no_dead_strip	_hdpvr_start_streaming
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdpvr_start_streaming
_hdpvr_start_streaming:                 ; @hdpvr_start_streaming
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	ldr	x8, [x0]
Lloh0:
	adrp	x22, _STATUS_STREAMING@GOTPAGE
Lloh1:
	ldr	x22, [x22, _STATUS_STREAMING@GOTPAGEOFF]
	ldr	x9, [x22]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w21, #0
	b	LBB0_11
LBB0_2:
Lloh2:
	adrp	x9, _STATUS_IDLE@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STATUS_IDLE@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.3:
	mov	x19, x0
	add	x1, sp, #32
	bl	_get_video_info
	tbnz	w0, #31, LBB0_8
; %bb.4:
	ldr	w8, [sp, #44]
	cbz	w8, LBB0_9
; %bb.5:
Lloh5:
	adrp	x23, _MSG_BUFFER@GOTPAGE
Lloh6:
	ldr	x23, [x23, _MSG_BUFFER@GOTPAGEOFF]
Lloh7:
	adrp	x24, _hdpvr_debug@GOTPAGE
Lloh8:
	ldr	x24, [x24, _hdpvr_debug@GOTPAGEOFF]
	ldr	w0, [x23]
	ldr	w1, [x24]
	add	x20, x19, #8
	ldp	w9, w8, [sp, #36]
	ldr	w10, [sp, #32]
	stp	x9, x10, [sp, #8]
	str	x8, [sp]
Lloh9:
	adrp	x3, l_.str.1@PAGE
Lloh10:
	add	x3, x3, l_.str.1@PAGEOFF
	mov	x2, x20
	bl	_v4l2_dbg
	ldr	w21, [x19, #16]
	mov	x0, x21
	mov	w1, #0
	bl	_usb_sndctrlpipe
	mov	x1, x0
	mov	w8, #8000
	str	w8, [sp]
	mov	x0, x21
	mov	w2, #184
	mov	w3, #56
	mov	w4, #1
	mov	w5, #0
	mov	x6, #0
	mov	w7, #0
	bl	_usb_control_msg
	mov	x21, x0
	ldr	w0, [x23]
	ldr	w1, [x24]
	str	x21, [sp]
Lloh11:
	adrp	x3, l_.str.2@PAGE
Lloh12:
	add	x3, x3, l_.str.2@PAGEOFF
	mov	x2, x20
	bl	_v4l2_dbg
	tbnz	w21, #31, LBB0_11
; %bb.6:
Lloh13:
	adrp	x8, _CTRL_START_STREAMING_VALUE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CTRL_START_STREAMING_VALUE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_hdpvr_config_call
	mov	x21, x0
	cbnz	w0, LBB0_11
; %bb.7:
	ldr	x8, [x22]
	str	x8, [x19], #12
Lloh16:
	adrp	x8, _hdpvr_transmit_buffers@GOTPAGE
Lloh17:
	ldr	x8, [x8, _hdpvr_transmit_buffers@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_INIT_WORK
	mov	x0, x19
	bl	_schedule_work
	ldr	w0, [x23]
	ldr	w1, [x24]
Lloh19:
	adrp	x3, l_.str.3@PAGE
Lloh20:
	add	x3, x3, l_.str.3@PAGEOFF
	mov	x2, x20
	bl	_v4l2_dbg
	b	LBB0_11
LBB0_8:
	mov	x21, x0
	b	LBB0_11
LBB0_9:
	mov	w0, #250
	bl	_msleep
Lloh21:
	adrp	x8, _MSG_INFO@GOTPAGE
Lloh22:
	ldr	x8, [x8, _MSG_INFO@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
Lloh24:
	adrp	x8, _hdpvr_debug@GOTPAGE
Lloh25:
	ldr	x8, [x8, _hdpvr_debug@GOTPAGEOFF]
Lloh26:
	ldr	w1, [x8]
	add	x2, x19, #8
	ldr	w8, [x19, #20]
	str	x8, [sp]
Lloh27:
	adrp	x3, l_.str@PAGE
Lloh28:
	add	x3, x3, l_.str@PAGEOFF
	bl	_v4l2_dbg
LBB0_10:
Lloh29:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh30:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_11:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_STATUS_STREAMING,8,3           ; @STATUS_STREAMING
	.comm	_STATUS_IDLE,8,3                ; @STATUS_IDLE
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_MSG_INFO,4,2                   ; @MSG_INFO
	.comm	_hdpvr_debug,4,2                ; @hdpvr_debug
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no video signal at input %d\n"

	.comm	_MSG_BUFFER,4,2                 ; @MSG_BUFFER
l_.str.1:                               ; @.str.1
	.asciz	"video signal: %dx%d@%dhz\n"

l_.str.2:                               ; @.str.2
	.asciz	"encoder start control request returned %d\n"

	.comm	_CTRL_START_STREAMING_VALUE,4,2 ; @CTRL_START_STREAMING_VALUE
	.comm	_hdpvr_transmit_buffers,4,2     ; @hdpvr_transmit_buffers
l_.str.3:                               ; @.str.3
	.asciz	"streaming started\n"

	.no_dead_strip	_hdpvr_start_streaming
.subsections_via_symbols
