	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function csid_set_clock_rates
_csid_set_clock_rates:                  ## @csid_set_clock_rates
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	40(%rdi), %rax
	movq	(%rax), %rbx
	addq	$32, %rdi
	leaq	-44(%rbp), %rsi
	callq	_camss_get_pixel_clock
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	$0, -44(%rbp)
LBB0_2:
	cmpl	$0, (%r15)
	jle	LBB0_21
## %bb.3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	movq	24(%r15), %r13
	leaq	(%r12,%r12,2), %rbx
	movl	20(%r13,%rbx,8), %edi
	leaq	L_.str(%rip), %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_8
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	20(,%rbx,8), %r14
	addq	%r13, %r14
	movl	(%r14), %edi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r14), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_strcmp
	testl	%eax, %eax
	jne	LBB0_20
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	20(%r15), %edi
	movl	16(%r15), %esi
	movq	8(%r15), %rax
	movq	_MSM_CSIPHY_PAD_SINK@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rax,%rcx,4), %edx
	callq	_csid_get_fmt_entry
	movl	4(%r15), %ecx
	movl	(%rax), %eax
	imull	-44(%rbp), %eax
	shll	$3, %ecx
	cltd
	idivl	%ecx
	cltq
	movq	%rax, -64(%rbp)
	leaq	-64(%rbp), %rdi
	callq	_camss_add_clock_margin
	movl	(%r13,%rbx,8), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	-64(%rbp), %rdx
	movq	8(%r13,%rbx,8), %rsi
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	(%rsi,%rcx,8), %rdx
	jl	LBB0_10
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=2
	incq	%rcx
	cmpq	%rcx, %rax
	jne	LBB0_14
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	xorl	%ecx, %ecx
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%eax, %ecx
	je	LBB0_16
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	decl	%eax
	cmpq	$0, -64(%rbp)
	cmovel	%eax, %ecx
	movl	16(%r13,%rbx,8), %edi
	movq	8(%r13,%rbx,8), %rax
	movslq	%ecx, %rcx
	movq	(%rax,%rcx,8), %rsi
	callq	_clk_round_rate
	testq	%rax, %rax
	js	LBB0_12
## %bb.18:                              ##   in Loop: Header=BB0_4 Depth=1
	leaq	16(,%rbx,8), %rcx
	addq	%r13, %rcx
	movl	(%rcx), %edi
	movq	%rax, %rsi
	callq	_clk_set_rate
	testl	%eax, %eax
	js	LBB0_19
LBB0_20:                                ##   in Loop: Header=BB0_4 Depth=1
	incq	%r12
	movslq	(%r15), %rax
	cmpq	%rax, %r12
	jl	LBB0_4
LBB0_21:
	xorl	%r13d, %r13d
	jmp	LBB0_22
LBB0_16:
	leaq	L_.str.4(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_dev_err
LBB0_17:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_22:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	L_.str.5(%rip), %rsi
	xorl	%r13d, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, %rdx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_17
LBB0_19:
	movl	%eax, %r13d
	leaq	L_.str.6(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"csi0"

L_.str.1:                               ## @.str.1
	.asciz	"csi1"

L_.str.2:                               ## @.str.2
	.asciz	"csi2"

L_.str.3:                               ## @.str.3
	.asciz	"csi3"

	.comm	_MSM_CSIPHY_PAD_SINK,8,3        ## @MSM_CSIPHY_PAD_SINK
L_.str.4:                               ## @.str.4
	.asciz	"Pixel clock is too high for CSID\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.5:                               ## @.str.5
	.asciz	"clk round rate failed: %ld\n"

L_.str.6:                               ## @.str.6
	.asciz	"clk set rate failed: %d\n"

	.no_dead_strip	_csid_set_clock_rates
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function csid_set_clock_rates
_csid_set_clock_rates:                  ; @csid_set_clock_rates
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x20, x0
	ldr	x8, [x0, #40]
	ldr	x19, [x8]
	add	x0, x0, #32
	add	x1, sp, #28
	bl	_camss_get_pixel_clock
	cbz	w0, LBB0_2
; %bb.1:
	str	wzr, [sp, #28]
LBB0_2:
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_17
; %bb.3:
	mov	x26, #0
	mov	w27, #24
Lloh0:
	adrp	x21, l_.str@PAGE
Lloh1:
	add	x21, x21, l_.str@PAGEOFF
Lloh2:
	adrp	x28, _MSM_CSIPHY_PAD_SINK@GOTPAGE
Lloh3:
	ldr	x28, [x28, _MSM_CSIPHY_PAD_SINK@GOTPAGEOFF]
Lloh4:
	adrp	x22, l_.str.1@PAGE
Lloh5:
	add	x22, x22, l_.str.1@PAGEOFF
Lloh6:
	adrp	x23, l_.str.2@PAGE
Lloh7:
	add	x23, x23, l_.str.2@PAGEOFF
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	x25, [x20, #24]
	madd	x24, x26, x27, x25
	ldr	w0, [x24, #20]!
	mov	x1, x21
	bl	_strcmp
	cbz	w0, LBB0_8
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x24]
	mov	x1, x22
	bl	_strcmp
	cbz	w0, LBB0_8
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x24]
	mov	x1, x23
	bl	_strcmp
	cbz	w0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x24]
Lloh8:
	adrp	x1, l_.str.3@PAGE
Lloh9:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_strcmp
	cbnz	w0, LBB0_16
LBB0_8:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldp	w1, w0, [x20, #16]
	ldr	x8, [x20, #8]
	ldr	x9, [x28]
	ldr	w2, [x8, x9, lsl #2]
	bl	_csid_get_fmt_entry
	ldr	w8, [x20, #4]
	ldr	w9, [sp, #28]
	ldr	w10, [x0]
	mul	w9, w10, w9
	lsl	w8, w8, #3
	sdiv	w8, w9, w8
	sxtw	x8, w8
	str	x8, [sp, #16]
	add	x0, sp, #16
	bl	_camss_add_clock_margin
	mul	x8, x26, x27
	ldr	w8, [x25, x8]
	cmp	w8, #1
	b.lt	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x9, #0
	ldr	x10, [sp, #16]
	madd	x11, x26, x27, x25
	ldr	x11, [x11, #8]
LBB0_10:                                ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x12, [x11, x9, lsl #3]
	cmp	x10, x12
	b.lt	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_10
	b	LBB0_18
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w9, #0
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w9, w8
	b.eq	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x10, [sp, #16]
	sub	w8, w8, #1
	cmp	x10, #0
	csel	w8, w8, w9, eq
	madd	x24, x26, x27, x25
	ldr	w0, [x24, #16]!
	ldur	x9, [x24, #-8]
	ldr	x1, [x9, w8, sxtw #3]
	bl	_clk_round_rate
	mov	x1, x0
	tbnz	x0, #63, LBB0_21
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x24]
	bl	_clk_set_rate
	tbnz	w0, #31, LBB0_22
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x26, x26, #1
	ldrsw	x8, [x20]
	cmp	x26, x8
	b.lt	LBB0_4
LBB0_17:
	mov	w25, #0
	b	LBB0_20
LBB0_18:
Lloh10:
	adrp	x1, l_.str.4@PAGE
Lloh11:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_19:
	mov	x0, x19
	bl	_dev_err
Lloh12:
	adrp	x8, _EINVAL@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w25, w8
LBB0_20:
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_21:
	str	x1, [sp]
Lloh15:
	adrp	x1, l_.str.5@PAGE
Lloh16:
	add	x1, x1, l_.str.5@PAGEOFF
	b	LBB0_19
LBB0_22:
	mov	x25, x0
	str	x25, [sp]
Lloh17:
	adrp	x1, l_.str.6@PAGE
Lloh18:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x19
	bl	_dev_err
	b	LBB0_20
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"csi0"

l_.str.1:                               ; @.str.1
	.asciz	"csi1"

l_.str.2:                               ; @.str.2
	.asciz	"csi2"

l_.str.3:                               ; @.str.3
	.asciz	"csi3"

	.comm	_MSM_CSIPHY_PAD_SINK,8,3        ; @MSM_CSIPHY_PAD_SINK
l_.str.4:                               ; @.str.4
	.asciz	"Pixel clock is too high for CSID\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.5:                               ; @.str.5
	.asciz	"clk round rate failed: %ld\n"

l_.str.6:                               ; @.str.6
	.asciz	"clk set rate failed: %d\n"

	.no_dead_strip	_csid_set_clock_rates
.subsections_via_symbols
