	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdcs_set_exposure
_hdcs_set_exposure:                     ## @hdcs_set_exposure
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	(%rdi), %r14
	movq	_HDCS_CLK_FREQ_MHZ@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%esi, -116(%rbp)                ## 4-byte Spill
	imull	%esi, %ecx
	movl	%ecx, %eax
	shll	$8, %eax
	addl	%ecx, %eax
	movl	8(%r14), %ecx
	movq	_HDCS_ADC_START_SIG_DUR@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	(%r14), %esi
	addl	%ecx, %esi
	leal	(%rdx,%rsi), %r13d
	addl	$2, %r13d
	movl	4(%r14), %edx
	imull	%r13d, %edx
	movl	%edx, %r15d
	shrl	$31, %r15d
	addl	%edx, %r15d
	sarl	%r15d
	addl	%ecx, %r15d
	movl	12(%r14), %ecx
	addl	%r15d, %ecx
	cltd
	idivl	%ecx
	movl	%edx, %ebx
	movl	%eax, -120(%rbp)                ## 4-byte Spill
	callq	_IS_1020
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movl	4(%r14), %ecx
	movl	16(%r14), %edi
	leal	(%rbx,%rdi), %eax
	addl	$13, %eax
	cltd
	idivl	%r13d
	movl	%ecx, %esi
	subl	%eax, %esi
	leal	(%rdi,%r13), %eax
	addl	$11, %eax
	cltd
	idivl	%r13d
	subl	%eax, %ecx
	jmp	LBB0_3
LBB0_2:
	movl	16(%r14), %eax
	addl	%eax, %ebx
	negl	%ebx
	leal	(%r15,%rbx), %esi
	addl	$-6, %esi
	leal	(%rax,%r13), %ecx
	addl	$4, %ecx
	movl	%ecx, %eax
	cltd
	idivl	%r13d
	notl	%ecx
	addl	%r15d, %ecx
	addl	%edx, %ecx
LBB0_3:
	cmpl	%ecx, %esi
	cmovll	%esi, %ecx
	xorl	%r13d, %r13d
	testl	%esi, %esi
	cmovnsl	%ecx, %r13d
	movq	%r12, %rdi
	callq	_IS_1020
	testq	%rax, %rax
	movl	-120(%rbp), %r14d               ## 4-byte Reload
	je	LBB0_5
## %bb.4:
	movq	_HDCS20_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -112(%rbp)
	movl	$0, -108(%rbp)
	movq	_HDCS_ROWEXPL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -104(%rbp)
	movzbl	%r14b, %ecx
	movl	%ecx, -100(%rbp)
	movq	_HDCS_ROWEXPH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -96(%rbp)
	movl	%r14d, %ecx
	sarl	$8, %ecx
	movl	%ecx, -92(%rbp)
	movq	_HDCS20_SROWEXP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -88(%rbp)
	movl	%r13d, %ecx
	shrl	$2, %ecx
	movzbl	%cl, %ecx
	movl	%ecx, -84(%rbp)
	movq	_HDCS20_ERROR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -80(%rbp)
	movl	$16, -76(%rbp)
	movl	%eax, -72(%rbp)
	movl	$4, -68(%rbp)
	leaq	-112(%rbp), %rsi
	movq	%r12, %rdi
	movl	$6, %edx
	callq	_stv06xx_write_sensor_bytes
	movl	%eax, %ebx
	jmp	LBB0_6
LBB0_5:
	movq	_HDCS00_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -112(%rbp)
	movl	$0, -108(%rbp)
	movq	_HDCS_ROWEXPL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -104(%rbp)
	movzbl	%r14b, %ecx
	movl	%ecx, -100(%rbp)
	movq	_HDCS_ROWEXPH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -96(%rbp)
	movl	%r14d, %ecx
	sarl	$8, %ecx
	movl	%ecx, -92(%rbp)
	movq	_HDCS00_SROWEXPL@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -88(%rbp)
	movzbl	%r13b, %ecx
	movl	%ecx, -84(%rbp)
	movq	_HDCS00_SROWEXPH@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -80(%rbp)
	movl	%r13d, %ecx
	sarl	$8, %ecx
	movl	%ecx, -76(%rbp)
	movq	_HDCS_STATUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, -72(%rbp)
	movl	$16, -68(%rbp)
	movl	%eax, -64(%rbp)
	movl	$4, -60(%rbp)
	leaq	-112(%rbp), %rsi
	movq	%r12, %rdi
	movl	$7, %edx
	callq	_stv06xx_write_sensor_bytes
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
LBB0_6:
	movq	_D_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	movl	-116(%rbp), %ecx                ## 4-byte Reload
	movl	%r14d, %r8d
	movl	%r13d, %r9d
	callq	_gspca_dbg
LBB0_7:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_9
## %bb.8:
	movl	%ebx, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HDCS_CLK_FREQ_MHZ,4,2          ## @HDCS_CLK_FREQ_MHZ
	.comm	_HDCS_ADC_START_SIG_DUR,4,2     ## @HDCS_ADC_START_SIG_DUR
	.comm	_HDCS20_CONTROL,4,2             ## @HDCS20_CONTROL
	.comm	_HDCS_ROWEXPL,4,2               ## @HDCS_ROWEXPL
	.comm	_HDCS_ROWEXPH,4,2               ## @HDCS_ROWEXPH
	.comm	_HDCS20_SROWEXP,4,2             ## @HDCS20_SROWEXP
	.comm	_HDCS20_ERROR,4,2               ## @HDCS20_ERROR
	.comm	_HDCS00_CONTROL,4,2             ## @HDCS00_CONTROL
	.comm	_HDCS00_SROWEXPL,4,2            ## @HDCS00_SROWEXPL
	.comm	_HDCS00_SROWEXPH,4,2            ## @HDCS00_SROWEXPH
	.comm	_HDCS_STATUS,4,2                ## @HDCS_STATUS
	.comm	_D_CONF,4,2                     ## @D_CONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Writing exposure %d, rowexp %d, srowexp %d\n"

	.no_dead_strip	_hdcs_set_exposure
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdcs_set_exposure
_hdcs_set_exposure:                     ; @hdcs_set_exposure
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #56]
	ldr	x22, [x0]
Lloh3:
	adrp	x8, _HDCS_CLK_FREQ_MHZ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HDCS_CLK_FREQ_MHZ@GOTPAGEOFF]
Lloh5:
	adrp	x9, _HDCS_ADC_START_SIG_DUR@GOTPAGE
Lloh6:
	ldr	x9, [x9, _HDCS_ADC_START_SIG_DUR@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	ldp	w10, w11, [x22]
	ldp	w12, w13, [x22, #8]
	add	w10, w12, w10
	add	w9, w10, w9
Lloh8:
	ldr	w8, [x8]
	mul	w8, w1, w8
	add	w8, w8, w8, lsl #8
	add	w23, w9, #2
	mul	w9, w11, w23
	cmp	w9, #0
	cinc	w9, w9, lt
	add	w24, w12, w9, asr #1
	add	w9, w24, w13
	sdiv	w21, w8, w9
	msub	w25, w9, w21, w8
	bl	_IS_1020
	cbz	x0, LBB0_2
; %bb.1:
	ldr	w9, [x22, #4]
	ldr	w10, [x22, #16]
	add	w8, w25, w10
	add	w8, w8, #13
	sdiv	w8, w8, w23
	sub	w8, w9, w8
	add	w10, w23, w10
	add	w10, w10, #11
	sdiv	w10, w10, w23
	sub	w9, w9, w10
	b	LBB0_3
LBB0_2:
	ldr	w9, [x22, #16]
	add	w8, w25, w9
	sub	w8, w24, w8
	sub	w8, w8, #6
	add	w9, w23, w9
	add	w9, w9, #4
	sdiv	w10, w9, w23
	msub	w10, w10, w23, w9
	mvn	w9, w9
	add	w9, w24, w9
	add	w9, w9, w10
LBB0_3:
	cmp	w8, w9
	csel	w9, w8, w9, lt
	cmp	w8, #0
	csel	w22, wzr, w9, lt
	mov	x0, x20
	bl	_IS_1020
	cbz	x0, LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, _HDCS20_CONTROL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _HDCS20_CONTROL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	stp	w8, wzr, [sp]
Lloh12:
	adrp	x9, _HDCS_ROWEXPL@GOTPAGE
Lloh13:
	ldr	x9, [x9, _HDCS_ROWEXPL@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	and	w10, w21, #0xff
	stp	w9, w10, [sp, #8]
Lloh15:
	adrp	x9, _HDCS_ROWEXPH@GOTPAGE
Lloh16:
	ldr	x9, [x9, _HDCS_ROWEXPH@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	asr	w10, w21, #8
	stp	w9, w10, [sp, #16]
Lloh18:
	adrp	x9, _HDCS20_SROWEXP@GOTPAGE
Lloh19:
	ldr	x9, [x9, _HDCS20_SROWEXP@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	ubfx	w10, w22, #2, #8
	stp	w9, w10, [sp, #24]
Lloh21:
	adrp	x9, _HDCS20_ERROR@GOTPAGE
Lloh22:
	ldr	x9, [x9, _HDCS20_ERROR@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	mov	w10, #16
	stp	w9, w10, [sp, #32]
	mov	w9, #4
	stp	w8, w9, [sp, #40]
	mov	x1, sp
	mov	x0, x20
	mov	w2, #6
	bl	_stv06xx_write_sensor_bytes
	mov	x23, x0
	b	LBB0_6
LBB0_5:
Lloh24:
	adrp	x8, _HDCS00_CONTROL@GOTPAGE
Lloh25:
	ldr	x8, [x8, _HDCS00_CONTROL@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	stp	w8, wzr, [sp]
Lloh27:
	adrp	x9, _HDCS_ROWEXPL@GOTPAGE
Lloh28:
	ldr	x9, [x9, _HDCS_ROWEXPL@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	and	w10, w21, #0xff
	stp	w9, w10, [sp, #8]
Lloh30:
	adrp	x9, _HDCS_ROWEXPH@GOTPAGE
Lloh31:
	ldr	x9, [x9, _HDCS_ROWEXPH@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	asr	w10, w21, #8
	stp	w9, w10, [sp, #16]
Lloh33:
	adrp	x9, _HDCS00_SROWEXPL@GOTPAGE
Lloh34:
	ldr	x9, [x9, _HDCS00_SROWEXPL@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	and	w10, w22, #0xff
	stp	w9, w10, [sp, #24]
Lloh36:
	adrp	x9, _HDCS00_SROWEXPH@GOTPAGE
Lloh37:
	ldr	x9, [x9, _HDCS00_SROWEXPH@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	asr	w10, w22, #8
	stp	w9, w10, [sp, #32]
Lloh39:
	adrp	x9, _HDCS_STATUS@GOTPAGE
Lloh40:
	ldr	x9, [x9, _HDCS_STATUS@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	mov	w10, #16
	stp	w9, w10, [sp, #40]
	mov	w9, #4
	stp	w8, w9, [sp, #48]
	mov	x1, sp
	mov	x0, x20
	mov	w2, #7
	bl	_stv06xx_write_sensor_bytes
	mov	x23, x0
	tbnz	w0, #31, LBB0_7
LBB0_6:
Lloh42:
	adrp	x8, _D_CONF@GOTPAGE
Lloh43:
	ldr	x8, [x8, _D_CONF@GOTPAGEOFF]
Lloh44:
	ldr	w1, [x8]
Lloh45:
	adrp	x2, l_.str@PAGE
Lloh46:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	mov	x3, x19
	mov	x4, x21
	mov	x5, x22
	bl	_gspca_dbg
LBB0_7:
	ldr	x8, [sp, #56]
Lloh47:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh48:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh49:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x23
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh8
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_HDCS_CLK_FREQ_MHZ,4,2          ; @HDCS_CLK_FREQ_MHZ
	.comm	_HDCS_ADC_START_SIG_DUR,4,2     ; @HDCS_ADC_START_SIG_DUR
	.comm	_HDCS20_CONTROL,4,2             ; @HDCS20_CONTROL
	.comm	_HDCS_ROWEXPL,4,2               ; @HDCS_ROWEXPL
	.comm	_HDCS_ROWEXPH,4,2               ; @HDCS_ROWEXPH
	.comm	_HDCS20_SROWEXP,4,2             ; @HDCS20_SROWEXP
	.comm	_HDCS20_ERROR,4,2               ; @HDCS20_ERROR
	.comm	_HDCS00_CONTROL,4,2             ; @HDCS00_CONTROL
	.comm	_HDCS00_SROWEXPL,4,2            ; @HDCS00_SROWEXPL
	.comm	_HDCS00_SROWEXPH,4,2            ; @HDCS00_SROWEXPH
	.comm	_HDCS_STATUS,4,2                ; @HDCS_STATUS
	.comm	_D_CONF,4,2                     ; @D_CONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Writing exposure %d, rowexp %d, srowexp %d\n"

	.no_dead_strip	_hdcs_set_exposure
.subsections_via_symbols
