	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function sd_start
_sd_start:                              ## @sd_start
	.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
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	movq	24(%rdi), %rcx
	movl	(%rcx,%rax,4), %r12d
	movq	_SE401_REQ_CAMERA_POWER@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_se401_write_req
	cmpl	$0, 8(%rbx)
	je	LBB0_2
## %bb.1:
	movl	20(%rbx), %edi
	callq	_usb_reset_device
	movl	$0, 8(%rbx)
	movl	(%r14), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_se401_write_req
LBB0_2:
	leaq	8(%rbx), %r15
	movq	_SE401_REQ_LED_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r14d, %r14d
	movq	%rbx, %rdi
	movl	$1, %edx
	xorl	%ecx, %ecx
	callq	_se401_write_req
	movq	_HV7131_REG_MODE_B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$5, %edx
	callq	_se401_set_feature
	movq	_SE401_REQ_SET_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	12(%rbx), %edx
	imull	%r12d, %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_se401_write_req
	movq	_SE401_REQ_SET_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	16(%rbx), %edx
	imull	%r12d, %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_se401_write_req
	cmpl	$4, %r12d
	je	LBB0_7
## %bb.3:
	cmpl	$2, %r12d
	je	LBB0_6
## %bb.4:
	cmpl	$1, %r12d
	jne	LBB0_8
## %bb.5:
	movl	$3, %r14d
	jmp	LBB0_8
LBB0_7:
	movq	_SE401_QUANT_FACT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	shll	$4, %r14d
	orl	$2, %r14d
	jmp	LBB0_8
LBB0_6:
	movq	_SE401_QUANT_FACT@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	shll	$4, %r14d
LBB0_8:
	movq	_SE401_OPERATINGMODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_se401_set_feature
	movq	_HV7131_REG_ARLV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%rbx), %edx
	movq	%rbx, %rdi
	callq	_se401_set_feature
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r15)
	movups	%xmm0, 16(%r15)
	movq	$0, 32(%r15)
	movq	_EXPO_NO_CHANGE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	movq	_SE401_REQ_START_CONTINUOUS_CAPTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_se401_write_req
	movl	8(%rbx), %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SE401_REQ_CAMERA_POWER,4,2     ## @SE401_REQ_CAMERA_POWER
	.comm	_SE401_REQ_LED_CONTROL,4,2      ## @SE401_REQ_LED_CONTROL
	.comm	_HV7131_REG_MODE_B,4,2          ## @HV7131_REG_MODE_B
	.comm	_SE401_REQ_SET_WIDTH,4,2        ## @SE401_REQ_SET_WIDTH
	.comm	_SE401_REQ_SET_HEIGHT,4,2       ## @SE401_REQ_SET_HEIGHT
	.comm	_SE401_QUANT_FACT,4,2           ## @SE401_QUANT_FACT
	.comm	_SE401_OPERATINGMODE,4,2        ## @SE401_OPERATINGMODE
	.comm	_HV7131_REG_ARLV,4,2            ## @HV7131_REG_ARLV
	.comm	_EXPO_NO_CHANGE,4,2             ## @EXPO_NO_CHANGE
	.comm	_SE401_REQ_START_CONTINUOUS_CAPTURE,4,2 ## @SE401_REQ_START_CONTINUOUS_CAPTURE
	.no_dead_strip	_sd_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function sd_start
_sd_start:                              ; @sd_start
	.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	x19, x0
	ldr	x8, [x0, #24]
	ldr	x9, [x0]
	ldr	w21, [x8, x9, lsl #2]
Lloh0:
	adrp	x22, _SE401_REQ_CAMERA_POWER@GOTPAGE
Lloh1:
	ldr	x22, [x22, _SE401_REQ_CAMERA_POWER@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	w2, #1
	mov	w3, #1
	bl	_se401_write_req
	mov	x20, x19
	ldr	w8, [x20, #8]!
	cbz	w8, LBB0_2
; %bb.1:
	ldr	w0, [x19, #20]
	bl	_usb_reset_device
	str	wzr, [x19, #8]
	ldr	w1, [x22]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_se401_write_req
LBB0_2:
Lloh2:
	adrp	x8, _SE401_REQ_LED_CONTROL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _SE401_REQ_LED_CONTROL@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #1
	mov	w3, #0
	bl	_se401_write_req
Lloh5:
	adrp	x8, _HV7131_REG_MODE_B@GOTPAGE
Lloh6:
	ldr	x8, [x8, _HV7131_REG_MODE_B@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #5
	bl	_se401_set_feature
Lloh8:
	adrp	x8, _SE401_REQ_SET_WIDTH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SE401_REQ_SET_WIDTH@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	ldr	w8, [x19, #12]
	mul	w2, w8, w21
	mov	x0, x19
	mov	w3, #0
	bl	_se401_write_req
Lloh11:
	adrp	x8, _SE401_REQ_SET_HEIGHT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _SE401_REQ_SET_HEIGHT@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	ldr	w8, [x19, #16]
	mul	w2, w8, w21
	mov	x0, x19
	mov	w3, #0
	bl	_se401_write_req
	cmp	w21, #4
	b.eq	LBB0_5
; %bb.3:
	cmp	w21, #2
	b.eq	LBB0_6
; %bb.4:
	mov	w8, #3
	cmp	w21, #1
	csel	w2, wzr, w8, ne
	b	LBB0_7
LBB0_5:
Lloh14:
	adrp	x8, _SE401_QUANT_FACT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _SE401_QUANT_FACT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	mov	w2, #2
	bfi	w2, w8, #4, #28
	b	LBB0_7
LBB0_6:
Lloh17:
	adrp	x8, _SE401_QUANT_FACT@GOTPAGE
Lloh18:
	ldr	x8, [x8, _SE401_QUANT_FACT@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	lsl	w2, w8, #4
LBB0_7:
Lloh20:
	adrp	x8, _SE401_OPERATINGMODE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _SE401_OPERATINGMODE@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_se401_set_feature
Lloh23:
	adrp	x8, _HV7131_REG_ARLV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _HV7131_REG_ARLV@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	ldr	w2, [x19]
	mov	x0, x19
	bl	_se401_set_feature
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [x20]
Lloh26:
	adrp	x8, _EXPO_NO_CHANGE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EXPO_NO_CHANGE@GOTPAGEOFF]
	str	xzr, [x20, #32]
Lloh28:
	ldr	w8, [x8]
	str	w8, [x19, #4]
Lloh29:
	adrp	x8, _SE401_REQ_START_CONTINUOUS_CAPTURE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _SE401_REQ_START_CONTINUOUS_CAPTURE@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	mov	w3, #0
	bl	_se401_write_req
	ldr	w0, [x19, #8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_SE401_REQ_CAMERA_POWER,4,2     ; @SE401_REQ_CAMERA_POWER
	.comm	_SE401_REQ_LED_CONTROL,4,2      ; @SE401_REQ_LED_CONTROL
	.comm	_HV7131_REG_MODE_B,4,2          ; @HV7131_REG_MODE_B
	.comm	_SE401_REQ_SET_WIDTH,4,2        ; @SE401_REQ_SET_WIDTH
	.comm	_SE401_REQ_SET_HEIGHT,4,2       ; @SE401_REQ_SET_HEIGHT
	.comm	_SE401_QUANT_FACT,4,2           ; @SE401_QUANT_FACT
	.comm	_SE401_OPERATINGMODE,4,2        ; @SE401_OPERATINGMODE
	.comm	_HV7131_REG_ARLV,4,2            ; @HV7131_REG_ARLV
	.comm	_EXPO_NO_CHANGE,4,2             ; @EXPO_NO_CHANGE
	.comm	_SE401_REQ_START_CONTINUOUS_CAPTURE,4,2 ; @SE401_REQ_START_CONTINUOUS_CAPTURE
	.no_dead_strip	_sd_start
.subsections_via_symbols
