	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function smiapp_set_stream
_smiapp_set_stream:                     ## @smiapp_set_stream
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r12d
	callq	_to_smiapp_sensor
	movq	%rax, %rbx
	movq	8(%rax), %rdi
	callq	_v4l2_get_subdevdata
	xorl	%r15d, %r15d
	cmpl	%r12d, (%rbx)
	je	LBB0_10
## %bb.1:
	movq	%rax, %r14
	testl	%r12d, %r12d
	je	LBB0_9
## %bb.2:
	movq	%r14, %rdi
	callq	_pm_runtime_get_sync
	testl	%eax, %eax
	js	LBB0_3
## %bb.7:
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	callq	_smiapp_start_streaming
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_10
## %bb.8:
	movl	$0, (%rbx)
	jmp	LBB0_10
LBB0_9:
	movq	%rbx, %rdi
	callq	_smiapp_stop_streaming
	movl	%eax, %r15d
	movl	$0, (%rbx)
	movq	%r14, %rdi
	callq	_pm_runtime_mark_last_busy
	movq	%r14, %rdi
	callq	_pm_runtime_put_autosuspend
	jmp	LBB0_10
LBB0_3:
	movl	%eax, %r15d
	movq	_EBUSY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	je	LBB0_6
## %bb.4:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r15d, %eax
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_pm_runtime_set_active
LBB0_6:
	movq	%r14, %rdi
	callq	_pm_runtime_put
LBB0_10:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.no_dead_strip	_smiapp_set_stream
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function smiapp_set_stream
_smiapp_set_stream:                     ; @smiapp_set_stream
	.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, x1
	bl	_to_smiapp_sensor
	mov	x21, x0
	ldr	x0, [x0, #8]
	bl	_v4l2_get_subdevdata
	ldr	w8, [x21]
	cmp	w8, w20
	b.ne	LBB0_2
; %bb.1:
	mov	w20, #0
	b	LBB0_11
LBB0_2:
	mov	x19, x0
	cbz	w20, LBB0_6
; %bb.3:
	mov	x0, x19
	bl	_pm_runtime_get_sync
	tbnz	w0, #31, LBB0_7
; %bb.4:
	mov	w8, #1
	str	w8, [x21]
	mov	x0, x21
	bl	_smiapp_start_streaming
	mov	x20, x0
	tbz	w0, #31, LBB0_11
; %bb.5:
	str	wzr, [x21]
	b	LBB0_11
LBB0_6:
	mov	x0, x21
	bl	_smiapp_stop_streaming
	mov	x20, x0
	str	wzr, [x21]
	mov	x0, x19
	bl	_pm_runtime_mark_last_busy
	mov	x0, x19
	bl	_pm_runtime_put_autosuspend
	b	LBB0_11
LBB0_7:
	mov	x20, x0
Lloh0:
	adrp	x8, _EBUSY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w0, w8
	b.eq	LBB0_10
; %bb.8:
Lloh3:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmn	w20, w8
	b.eq	LBB0_10
; %bb.9:
	mov	x0, x19
	bl	_pm_runtime_set_active
LBB0_10:
	mov	x0, x19
	bl	_pm_runtime_put
LBB0_11:
	mov	x0, x20
	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 AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.no_dead_strip	_smiapp_set_stream
.subsections_via_symbols
