	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipu_csi_set_mipi_datatype      ## -- Begin function ipu_csi_set_mipi_datatype
	.p2align	4, 0x90
_ipu_csi_set_mipi_datatype:             ## @ipu_csi_set_mipi_datatype
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$4, %esi
	jl	LBB0_2
## %bb.1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_4
LBB0_2:
	movl	%esi, %ebx
	movq	%rdi, %r14
	movl	(%rdx), %esi
	movq	_V4L2_MBUS_CSI2_DPHY@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-32(%rbp), %rdi
	callq	_mbus_code_to_bus_cfg
	testl	%eax, %eax
	js	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	_CSI_MIPI_DI@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_ipu_csi_read
	shll	$3, %ebx
	movl	$255, %edx
	movl	%ebx, %ecx
	shll	%cl, %edx
	movl	-32(%rbp), %esi
	shll	%cl, %esi
	notl	%edx
	andl	%eax, %edx
	orl	%edx, %esi
	movl	(%r15), %edx
	movq	%r14, %rdi
	callq	_ipu_csi_write
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	xorl	%eax, %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_V4L2_MBUS_CSI2_DPHY,4,2        ## @V4L2_MBUS_CSI2_DPHY
	.comm	_CSI_MIPI_DI,4,2                ## @CSI_MIPI_DI
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ipu_csi_set_mipi_datatype      ; -- Begin function ipu_csi_set_mipi_datatype
	.p2align	2
_ipu_csi_set_mipi_datatype:             ; @ipu_csi_set_mipi_datatype
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	cmp	w1, #4
	b.lt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	mov	x20, x1
	mov	x19, x0
	ldr	w1, [x2]
Lloh3:
	adrp	x8, _V4L2_MBUS_CSI2_DPHY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _V4L2_MBUS_CSI2_DPHY@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x0, sp, #8
	bl	_mbus_code_to_bus_cfg
	tbnz	w0, #31, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_spin_lock_irqsave
Lloh6:
	adrp	x21, _CSI_MIPI_DI@GOTPAGE
Lloh7:
	ldr	x21, [x21, _CSI_MIPI_DI@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x19
	bl	_ipu_csi_read
	lsl	w8, w20, #3
	mov	w9, #255
	lsl	w9, w9, w8
	bic	w9, w0, w9
	ldr	w10, [sp, #8]
	lsl	w8, w10, w8
	orr	w1, w8, w9
	ldr	w2, [x21]
	mov	x0, x19
	bl	_ipu_csi_write
	mov	x0, x19
	bl	_spin_unlock_irqrestore
	mov	w0, #0
LBB0_4:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_V4L2_MBUS_CSI2_DPHY,4,2        ; @V4L2_MBUS_CSI2_DPHY
	.comm	_CSI_MIPI_DI,4,2                ; @CSI_MIPI_DI
.subsections_via_symbols
