	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdcs_init
_hdcs_init:                             ## @hdcs_init
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	8(%rdi), %r15
	movq	_BRIDGE_STV602@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.1:
	movq	_STV_STV0600_EMULATION@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movl	$1, %edx
	callq	_stv06xx_write_bridge
LBB0_2:
	movq	_stv_bridge_init@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_3
## %bb.4:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	-8(%rax,%rbx,8), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movq	%r14, %rdi
	callq	_stv06xx_write_bridge
	movl	%eax, %r13d
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rbx
	testl	%r13d, %r13d
	je	LBB0_5
LBB0_7:
	testl	%r13d, %r13d
	jns	LBB0_8
	jmp	LBB0_17
LBB0_3:
	xorl	%r13d, %r13d
LBB0_8:
	movq	%r14, %rdi
	callq	_hdcs_reset
	movq	_stv_sensor_init@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_14
## %bb.9:
	testl	%r13d, %r13d
	jne	LBB0_14
## %bb.10:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r12), %rax
	movq	-8(%rax,%rbx,8), %rax
	movl	(%rax), %esi
	movl	4(%rax), %edx
	movq	%r14, %rdi
	callq	_stv06xx_write_sensor
	movl	%eax, %r13d
	movq	(%r12), %rdi
	callq	_ARRAY_SIZE
	cltq
	cmpq	%rax, %rbx
	jge	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	incq	%rbx
	testl	%r13d, %r13d
	je	LBB0_11
LBB0_13:
	testl	%r13d, %r13d
	js	LBB0_17
LBB0_14:
	movq	%r14, %rdi
	callq	_HDCS_REG_CONFIG
	movl	%eax, %ebx
	movl	$3, %edi
	callq	_BIT
	movq	%r14, %rdi
	movl	%ebx, %esi
	movl	%eax, %edx
	callq	_stv06xx_write_sensor
	testl	%eax, %eax
	js	LBB0_16
## %bb.15:
	movq	%r14, %rdi
	callq	_IS_1020
	movq	_HDCS_ADC_START_SIG_DUR@GOTPCREL(%rip), %rdx
	cmpq	$1, %rax
	movb	$6, %cl
	sbbb	$0, %cl
	movl	(%rdx), %edx
	shll	%cl, %edx
	movq	_HDCS_TCTRL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	orl	(%r15), %edx
	movq	%r14, %rdi
	callq	_stv06xx_write_sensor
	testl	%eax, %eax
	js	LBB0_16
## %bb.18:
	movl	4(%r15), %edx
	movl	8(%r15), %esi
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_hdcs_set_size                  ## TAILCALL
LBB0_16:
	movl	%eax, %r13d
LBB0_17:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BRIDGE_STV602,8,3              ## @BRIDGE_STV602
	.comm	_STV_STV0600_EMULATION,4,2      ## @STV_STV0600_EMULATION
	.comm	_stv_bridge_init,8,3            ## @stv_bridge_init
	.comm	_stv_sensor_init,8,3            ## @stv_sensor_init
	.comm	_HDCS_TCTRL,4,2                 ## @HDCS_TCTRL
	.comm	_HDCS_ADC_START_SIG_DUR,4,2     ## @HDCS_ADC_START_SIG_DUR
	.no_dead_strip	_hdcs_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdcs_init
_hdcs_init:                             ; @hdcs_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	ldp	x8, x21, [x0]
Lloh0:
	adrp	x9, _BRIDGE_STV602@GOTPAGE
Lloh1:
	ldr	x9, [x9, _BRIDGE_STV602@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
Lloh3:
	adrp	x8, _STV_STV0600_EMULATION@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STV_STV0600_EMULATION@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	bl	_stv06xx_write_bridge
LBB0_2:
Lloh6:
	adrp	x22, _stv_bridge_init@GOTPAGE
Lloh7:
	ldr	x22, [x22, _stv_bridge_init@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_6
; %bb.3:
	mov	x23, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x8, [x8, x23, lsl #3]
	ldp	w1, w2, [x8]
	mov	x0, x19
	bl	_stv06xx_write_bridge
	mov	x20, x0
	add	x23, x23, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	ccmp	w20, #0, #0, lt
	b.eq	LBB0_4
; %bb.5:
	tbz	w20, #31, LBB0_7
	b	LBB0_15
LBB0_6:
	mov	w20, #0
LBB0_7:
	mov	x0, x19
	bl	_hdcs_reset
Lloh8:
	adrp	x22, _stv_sensor_init@GOTPAGE
Lloh9:
	ldr	x22, [x22, _stv_sensor_init@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	ccmp	w20, #0, #0, ge
	b.ne	LBB0_11
; %bb.8:
	mov	x23, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	ldr	x8, [x8, x23, lsl #3]
	ldp	w1, w2, [x8]
	mov	x0, x19
	bl	_stv06xx_write_sensor
	mov	x20, x0
	add	x23, x23, #1
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	x23, w0, sxtw
	ccmp	w20, #0, #0, lt
	b.eq	LBB0_9
; %bb.10:
	tbnz	w20, #31, LBB0_15
LBB0_11:
	mov	x0, x19
	bl	_HDCS_REG_CONFIG
	mov	x20, x0
	mov	w0, #3
	bl	_BIT
	mov	x2, x0
	mov	x0, x19
	mov	x1, x20
	bl	_stv06xx_write_sensor
	tbnz	w0, #31, LBB0_14
; %bb.12:
	mov	x0, x19
	bl	_IS_1020
Lloh10:
	adrp	x8, _HDCS_TCTRL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _HDCS_TCTRL@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x8, _HDCS_ADC_START_SIG_DUR@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HDCS_ADC_START_SIG_DUR@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	x0, #0
	mov	w9, #5
	cinc	w9, w9, ne
	lsl	w8, w8, w9
	ldr	w9, [x21]
	orr	w2, w8, w9
	mov	x0, x19
	bl	_stv06xx_write_sensor
	tbnz	w0, #31, LBB0_14
; %bb.13:
	ldp	w2, w1, [x21, #4]
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_hdcs_set_size
LBB0_14:
	mov	x20, x0
LBB0_15:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_BRIDGE_STV602,8,3              ; @BRIDGE_STV602
	.comm	_STV_STV0600_EMULATION,4,2      ; @STV_STV0600_EMULATION
	.comm	_stv_bridge_init,8,3            ; @stv_bridge_init
	.comm	_stv_sensor_init,8,3            ; @stv_sensor_init
	.comm	_HDCS_TCTRL,4,2                 ; @HDCS_TCTRL
	.comm	_HDCS_ADC_START_SIG_DUR,4,2     ; @HDCS_ADC_START_SIG_DUR
	.no_dead_strip	_hdcs_init
.subsections_via_symbols
