	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mx3_camera_activate
_mx3_camera_activate:                   ## @mx3_camera_activate
	.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	%rsi, %r14
	movq	%rdi, %r15
	movq	_CSI_ACT_FRM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$31392383, %esi                 ## imm = 0x1DF027F
	callq	_csi_reg_write
	movq	_CSI_OUT_FRM_CTRL@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r15, %rdi
	callq	_csi_reg_read
	andl	$-65536, %eax                   ## imm = 0xFFFF0000
	movl	(%rbx), %edx
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_csi_reg_write
	movq	_CSI_SENS_CONF_DATA_FMT_BAYER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	(%r15), %r8d
	movq	_MX3_CAMERA_DATAWIDTH_15@GOTPCREL(%rip), %rcx
	testl	%r8d, (%rcx)
	je	LBB0_3
## %bb.1:
	movq	_CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$3, %esi
	jmp	LBB0_2
LBB0_3:
	movq	_MX3_CAMERA_DATAWIDTH_10@GOTPCREL(%rip), %rcx
	testl	%r8d, (%rcx)
	je	LBB0_5
## %bb.4:
	movq	_CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$2, %esi
LBB0_2:
	shll	%cl, %esi
	orl	%esi, %edx
LBB0_7:
	movq	_MX3_CAMERA_CLK_SRC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_CSI_SENS_CONF_SENS_CLKSRC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %esi
	shll	%cl, %esi
	andl	%r8d, %edi
	testl	%edi, %edi
	cmovel	%edi, %esi
	movl	$1, %ebx
	orl	%edx, %esi
	movq	_MX3_CAMERA_EXT_VSYNC@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	andl	%r8d, %edx
	movq	_CSI_SENS_CONF_EXT_VSYNC_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edi
	shll	%cl, %edi
	testl	%edx, %edx
	cmovel	%edx, %edi
	movq	_MX3_CAMERA_DP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	andl	%r8d, %eax
	movq	_CSI_SENS_CONF_DATA_POL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edx
	shll	%cl, %edx
	testl	%eax, %eax
	cmovel	%eax, %edx
	orl	%edi, %edx
	orl	%esi, %edx
	movq	_MX3_CAMERA_PCP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_CSI_SENS_CONF_PIX_CLK_POL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %esi
	shll	%cl, %esi
	andl	%r8d, %eax
	testl	%eax, %eax
	cmovel	%eax, %esi
	movq	_MX3_CAMERA_HSP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_CSI_SENS_CONF_HSYNC_POL_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	movl	$1, %edi
	shll	%cl, %edi
	andl	%r8d, %eax
	testl	%eax, %eax
	cmovel	%eax, %edi
	movq	_MX3_CAMERA_VSP@GOTPCREL(%rip), %rax
	andl	(%rax), %r8d
	movq	_CSI_SENS_CONF_VSYNC_POL_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %ebx
	orl	%esi, %edi
	testl	%r8d, %r8d
	cmovel	%r8d, %ebx
	orl	%edi, %ebx
	orl	%edx, %ebx
	movq	_CSI_SENS_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_csi_reg_write
	movl	4(%r15), %edi
	callq	_clk_enable
	movl	4(%r15), %edi
	movl	8(%r15), %esi
	callq	_clk_round_rate
	movq	%rax, %r12
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movq	%rax, %rcx
	callq	_dev_dbg
	testq	%r12, %r12
	je	LBB0_8
## %bb.9:
	movl	4(%r15), %edi
	movq	%r12, %rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_clk_set_rate                   ## TAILCALL
LBB0_8:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_MX3_CAMERA_DATAWIDTH_8@GOTPCREL(%rip), %rcx
	testl	%r8d, (%rcx)
	je	LBB0_7
## %bb.6:
	movq	_CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	btsl	%ecx, %edx
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_CSI_ACT_FRM_SIZE,4,2           ## @CSI_ACT_FRM_SIZE
	.comm	_CSI_OUT_FRM_CTRL,4,2           ## @CSI_OUT_FRM_CTRL
	.comm	_CSI_SENS_CONF_SENS_PRTCL_SHIFT,4,2 ## @CSI_SENS_CONF_SENS_PRTCL_SHIFT
	.comm	_CSI_SENS_CONF_DATA_FMT_BAYER,4,2 ## @CSI_SENS_CONF_DATA_FMT_BAYER
	.comm	_MX3_CAMERA_DATAWIDTH_15,4,2    ## @MX3_CAMERA_DATAWIDTH_15
	.comm	_CSI_SENS_CONF_DATA_WIDTH_SHIFT,4,2 ## @CSI_SENS_CONF_DATA_WIDTH_SHIFT
	.comm	_MX3_CAMERA_DATAWIDTH_10,4,2    ## @MX3_CAMERA_DATAWIDTH_10
	.comm	_MX3_CAMERA_DATAWIDTH_8,4,2     ## @MX3_CAMERA_DATAWIDTH_8
	.comm	_MX3_CAMERA_CLK_SRC,4,2         ## @MX3_CAMERA_CLK_SRC
	.comm	_CSI_SENS_CONF_SENS_CLKSRC_SHIFT,4,2 ## @CSI_SENS_CONF_SENS_CLKSRC_SHIFT
	.comm	_MX3_CAMERA_EXT_VSYNC,4,2       ## @MX3_CAMERA_EXT_VSYNC
	.comm	_CSI_SENS_CONF_EXT_VSYNC_SHIFT,4,2 ## @CSI_SENS_CONF_EXT_VSYNC_SHIFT
	.comm	_MX3_CAMERA_DP,4,2              ## @MX3_CAMERA_DP
	.comm	_CSI_SENS_CONF_DATA_POL_SHIFT,4,2 ## @CSI_SENS_CONF_DATA_POL_SHIFT
	.comm	_MX3_CAMERA_PCP,4,2             ## @MX3_CAMERA_PCP
	.comm	_CSI_SENS_CONF_PIX_CLK_POL_SHIFT,4,2 ## @CSI_SENS_CONF_PIX_CLK_POL_SHIFT
	.comm	_MX3_CAMERA_HSP,4,2             ## @MX3_CAMERA_HSP
	.comm	_CSI_SENS_CONF_HSYNC_POL_SHIFT,4,2 ## @CSI_SENS_CONF_HSYNC_POL_SHIFT
	.comm	_MX3_CAMERA_VSP,4,2             ## @MX3_CAMERA_VSP
	.comm	_CSI_SENS_CONF_VSYNC_POL_SHIFT,4,2 ## @CSI_SENS_CONF_VSYNC_POL_SHIFT
	.comm	_CSI_SENS_CONF,4,2              ## @CSI_SENS_CONF
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Set SENS_CONF to %x, rate %ld\n"

	.no_dead_strip	_mx3_camera_activate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mx3_camera_activate
_mx3_camera_activate:                   ; @mx3_camera_activate
	.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
	mov	x19, x0
Lloh0:
	adrp	x8, _CSI_ACT_FRM_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CSI_ACT_FRM_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #639
	movk	w1, #479, lsl #16
	bl	_csi_reg_write
Lloh3:
	adrp	x21, _CSI_OUT_FRM_CTRL@GOTPAGE
Lloh4:
	ldr	x21, [x21, _CSI_OUT_FRM_CTRL@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_csi_reg_read
	and	w1, w0, #0xffff0000
	ldr	w2, [x21]
	mov	x0, x19
	bl	_csi_reg_write
Lloh5:
	adrp	x8, _CSI_SENS_CONF_DATA_FMT_BAYER@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CSI_SENS_CONF_DATA_FMT_BAYER@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x8]
	ldr	w8, [x19]
Lloh8:
	adrp	x10, _MX3_CAMERA_DATAWIDTH_15@GOTPAGE
Lloh9:
	ldr	x10, [x10, _MX3_CAMERA_DATAWIDTH_15@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_2
; %bb.1:
Lloh11:
	adrp	x10, _CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPAGE
Lloh12:
	ldr	x10, [x10, _CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	mov	w11, #3
	b	LBB0_6
LBB0_2:
Lloh14:
	adrp	x10, _MX3_CAMERA_DATAWIDTH_10@GOTPAGE
Lloh15:
	ldr	x10, [x10, _MX3_CAMERA_DATAWIDTH_10@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_4
; %bb.3:
Lloh17:
	adrp	x10, _CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPAGE
Lloh18:
	ldr	x10, [x10, _CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w10, [x10]
	mov	w11, #2
	b	LBB0_6
LBB0_4:
Lloh20:
	adrp	x10, _MX3_CAMERA_DATAWIDTH_8@GOTPAGE
Lloh21:
	ldr	x10, [x10, _MX3_CAMERA_DATAWIDTH_8@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_7
; %bb.5:
Lloh23:
	adrp	x10, _CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPAGE
Lloh24:
	ldr	x10, [x10, _CSI_SENS_CONF_DATA_WIDTH_SHIFT@GOTPAGEOFF]
Lloh25:
	ldr	w10, [x10]
	mov	w11, #1
LBB0_6:
	lsl	w10, w11, w10
	orr	w9, w10, w9
LBB0_7:
Lloh26:
	adrp	x10, _MX3_CAMERA_CLK_SRC@GOTPAGE
Lloh27:
	ldr	x10, [x10, _MX3_CAMERA_CLK_SRC@GOTPAGEOFF]
Lloh28:
	adrp	x11, _CSI_SENS_CONF_SENS_CLKSRC_SHIFT@GOTPAGE
Lloh29:
	ldr	x11, [x11, _CSI_SENS_CONF_SENS_CLKSRC_SHIFT@GOTPAGEOFF]
Lloh30:
	ldr	w10, [x10]
Lloh31:
	ldr	w11, [x11]
	mov	w12, #1
	lsl	w11, w12, w11
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w10, w9
Lloh32:
	adrp	x10, _MX3_CAMERA_EXT_VSYNC@GOTPAGE
Lloh33:
	ldr	x10, [x10, _MX3_CAMERA_EXT_VSYNC@GOTPAGEOFF]
Lloh34:
	ldr	w10, [x10]
Lloh35:
	adrp	x11, _CSI_SENS_CONF_EXT_VSYNC_SHIFT@GOTPAGE
Lloh36:
	ldr	x11, [x11, _CSI_SENS_CONF_EXT_VSYNC_SHIFT@GOTPAGEOFF]
Lloh37:
	ldr	w11, [x11]
	lsl	w11, w12, w11
	tst	w10, w8
	csel	w10, wzr, w11, eq
Lloh38:
	adrp	x11, _MX3_CAMERA_DP@GOTPAGE
Lloh39:
	ldr	x11, [x11, _MX3_CAMERA_DP@GOTPAGEOFF]
	orr	w9, w9, w10
Lloh40:
	ldr	w10, [x11]
Lloh41:
	adrp	x11, _CSI_SENS_CONF_DATA_POL_SHIFT@GOTPAGE
Lloh42:
	ldr	x11, [x11, _CSI_SENS_CONF_DATA_POL_SHIFT@GOTPAGEOFF]
Lloh43:
	ldr	w11, [x11]
	lsl	w11, w12, w11
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w9, w10
Lloh44:
	adrp	x10, _MX3_CAMERA_PCP@GOTPAGE
Lloh45:
	ldr	x10, [x10, _MX3_CAMERA_PCP@GOTPAGEOFF]
Lloh46:
	ldr	w10, [x10]
Lloh47:
	adrp	x11, _CSI_SENS_CONF_PIX_CLK_POL_SHIFT@GOTPAGE
Lloh48:
	ldr	x11, [x11, _CSI_SENS_CONF_PIX_CLK_POL_SHIFT@GOTPAGEOFF]
Lloh49:
	ldr	w11, [x11]
	lsl	w11, w12, w11
	tst	w10, w8
	csel	w10, wzr, w11, eq
	orr	w9, w9, w10
Lloh50:
	adrp	x10, _MX3_CAMERA_HSP@GOTPAGE
Lloh51:
	ldr	x10, [x10, _MX3_CAMERA_HSP@GOTPAGEOFF]
Lloh52:
	ldr	w10, [x10]
Lloh53:
	adrp	x11, _CSI_SENS_CONF_HSYNC_POL_SHIFT@GOTPAGE
Lloh54:
	ldr	x11, [x11, _CSI_SENS_CONF_HSYNC_POL_SHIFT@GOTPAGEOFF]
Lloh55:
	ldr	w11, [x11]
	lsl	w11, w12, w11
	tst	w10, w8
	csel	w10, wzr, w11, eq
Lloh56:
	adrp	x11, _MX3_CAMERA_VSP@GOTPAGE
Lloh57:
	ldr	x11, [x11, _MX3_CAMERA_VSP@GOTPAGEOFF]
	orr	w9, w9, w10
Lloh58:
	ldr	w10, [x11]
Lloh59:
	adrp	x11, _CSI_SENS_CONF_VSYNC_POL_SHIFT@GOTPAGE
Lloh60:
	ldr	x11, [x11, _CSI_SENS_CONF_VSYNC_POL_SHIFT@GOTPAGEOFF]
Lloh61:
	ldr	w11, [x11]
	lsl	w11, w12, w11
	tst	w10, w8
	csel	w8, wzr, w11, eq
	orr	w22, w9, w8
Lloh62:
	adrp	x8, _CSI_SENS_CONF@GOTPAGE
Lloh63:
	ldr	x8, [x8, _CSI_SENS_CONF@GOTPAGEOFF]
Lloh64:
	ldr	w2, [x8]
	mov	x0, x19
	mov	x1, x22
	bl	_csi_reg_write
	ldr	w0, [x19, #4]
	bl	_clk_enable
	ldp	w0, w1, [x19, #4]
	bl	_clk_round_rate
	mov	x21, x0
	ldr	w0, [x20]
Lloh65:
	adrp	x1, l_.str@PAGE
Lloh66:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	mov	x3, x21
	bl	_dev_dbg
	cbz	x21, LBB0_9
; %bb.8:
	ldr	w0, [x19, #4]
	mov	x1, x21
	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
	b	_clk_set_rate
LBB0_9:
	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	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh30
	.cfi_endproc
                                        ; -- End function
	.comm	_CSI_ACT_FRM_SIZE,4,2           ; @CSI_ACT_FRM_SIZE
	.comm	_CSI_OUT_FRM_CTRL,4,2           ; @CSI_OUT_FRM_CTRL
	.comm	_CSI_SENS_CONF_SENS_PRTCL_SHIFT,4,2 ; @CSI_SENS_CONF_SENS_PRTCL_SHIFT
	.comm	_CSI_SENS_CONF_DATA_FMT_BAYER,4,2 ; @CSI_SENS_CONF_DATA_FMT_BAYER
	.comm	_MX3_CAMERA_DATAWIDTH_15,4,2    ; @MX3_CAMERA_DATAWIDTH_15
	.comm	_CSI_SENS_CONF_DATA_WIDTH_SHIFT,4,2 ; @CSI_SENS_CONF_DATA_WIDTH_SHIFT
	.comm	_MX3_CAMERA_DATAWIDTH_10,4,2    ; @MX3_CAMERA_DATAWIDTH_10
	.comm	_MX3_CAMERA_DATAWIDTH_8,4,2     ; @MX3_CAMERA_DATAWIDTH_8
	.comm	_MX3_CAMERA_CLK_SRC,4,2         ; @MX3_CAMERA_CLK_SRC
	.comm	_CSI_SENS_CONF_SENS_CLKSRC_SHIFT,4,2 ; @CSI_SENS_CONF_SENS_CLKSRC_SHIFT
	.comm	_MX3_CAMERA_EXT_VSYNC,4,2       ; @MX3_CAMERA_EXT_VSYNC
	.comm	_CSI_SENS_CONF_EXT_VSYNC_SHIFT,4,2 ; @CSI_SENS_CONF_EXT_VSYNC_SHIFT
	.comm	_MX3_CAMERA_DP,4,2              ; @MX3_CAMERA_DP
	.comm	_CSI_SENS_CONF_DATA_POL_SHIFT,4,2 ; @CSI_SENS_CONF_DATA_POL_SHIFT
	.comm	_MX3_CAMERA_PCP,4,2             ; @MX3_CAMERA_PCP
	.comm	_CSI_SENS_CONF_PIX_CLK_POL_SHIFT,4,2 ; @CSI_SENS_CONF_PIX_CLK_POL_SHIFT
	.comm	_MX3_CAMERA_HSP,4,2             ; @MX3_CAMERA_HSP
	.comm	_CSI_SENS_CONF_HSYNC_POL_SHIFT,4,2 ; @CSI_SENS_CONF_HSYNC_POL_SHIFT
	.comm	_MX3_CAMERA_VSP,4,2             ; @MX3_CAMERA_VSP
	.comm	_CSI_SENS_CONF_VSYNC_POL_SHIFT,4,2 ; @CSI_SENS_CONF_VSYNC_POL_SHIFT
	.comm	_CSI_SENS_CONF,4,2              ; @CSI_SENS_CONF
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Set SENS_CONF to %x, rate %ld\n"

	.no_dead_strip	_mx3_camera_activate
.subsections_via_symbols
