	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cdns_i3c_master_bus_init
_cdns_i3c_master_bus_init:              ## @cdns_i3c_master_bus_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
	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, %r12
	callq	_to_cdns_i3c_master
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_i3c_master_get_bus
	movq	%rax, %r13
	movq	$0, -48(%rbp)
	movl	(%rax), %eax
	addl	$-128, %eax
	cmpl	$3, %eax
	jae	LBB0_1
## %bb.3:
	cltq
	leaq	l_switch.table.cdns_i3c_master_bus_init(%rip), %rcx
	movq	(%rcx,%rax,8), %rax
	movl	(%rax), %r14d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	12(%rbx), %edi
	callq	_clk_get_rate
	testq	%rax, %rax
	je	LBB0_1
## %bb.4:
	movq	%rax, %r15
	movl	%r14d, -56(%rbp)                ## 4-byte Spill
	movslq	8(%r13), %rsi
	shlq	$2, %rsi
	movq	%rax, %rdi
	callq	_DIV_ROUND_UP
	movl	%eax, %r14d
	leal	-1(%r14), %edi
	movq	_PRESCL_CTRL0_MAX@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %edi
	jg	LBB0_5
## %bb.6:
	leal	(,%r14,4), %ecx
	movslq	%ecx, %rsi
	movq	%r15, %rax
	orq	%rsi, %rax
	shrq	$32, %rax
	je	LBB0_7
## %bb.8:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rsi
	jmp	LBB0_9
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_7:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_9:
	movl	%eax, 8(%r13)
	callq	_PRESCL_CTRL0_I3C
	movl	%eax, %esi
	movq	_I3C_BUS_TLOW_OD_MIN_NS@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	imulq	%r15, %rax
	movslq	%r14d, %rcx
	movq	%rax, %rdx
	orq	%rcx, %rdx
	shrq	$32, %rdx
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	je	LBB0_10
## %bb.11:
	xorl	%edx, %edx
	divq	%rcx
	movq	%rax, %rdi
	jmp	LBB0_12
LBB0_10:
                                        ## kill: def $eax killed $eax killed $rax
	xorl	%edx, %edx
	divl	%r14d
	movl	%eax, %edi
LBB0_12:
	addl	$-2, %edi
                                        ## kill: def $edi killed $edi killed $rdi
	callq	_PRESCL_CTRL1_OD_LOW
	movq	16(%r13), %rax
	leaq	(%rax,%rax,4), %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_13
## %bb.14:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_15
LBB0_13:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_15:
	leal	-1(%rax), %edi
	cmpl	(%rbx), %edi
	jle	LBB0_16
LBB0_5:
	movq	_ERANGE@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_24:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	shlq	$32, %rax
	leaq	(%rax,%rax,4), %rcx
	sarq	$32, %rcx
	movq	%r15, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_17
## %bb.18:
	movq	%r15, %rax
	xorl	%edx, %edx
	divq	%rcx
	jmp	LBB0_19
LBB0_17:
	movl	%r15d, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_19:
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	%rax, 16(%r13)
	callq	_PRESCL_CTRL0_I2C
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	orl	%eax, %edi
	movq	_PRESCL_CTRL0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movl	8(%r13), %ecx
	shll	$2, %ecx
	movl	$1000000000, %eax               ## imm = 0x3B9ACA00
	xorl	%edx, %edx
	idivl	%ecx
	movslq	%eax, %rsi
	movq	_I3C_BUS_TLOW_OD_MIN_NS@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	callq	_DIV_ROUND_UP
	cmpl	$3, %eax
	movl	$2, %edi
	cmovgel	%eax, %edi
	addl	$-2, %edi
	callq	_PRESCL_CTRL1_OD_LOW
	movq	_PRESCL_CTRL1@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	addq	(%r15), %rsi
	movl	%eax, %edi
	callq	_writel
	movq	%r12, %rdi
	xorl	%esi, %esi
	callq	_i3c_master_get_free_addr
	testl	%eax, %eax
	js	LBB0_24
## %bb.20:
	movl	%eax, %edi
	callq	_prepare_rr0_dev_address
	movl	%eax, %r14d
	movq	_DEV_ID_RR0_IS_I3C@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	movq	(%r15), %rbx
	xorl	%edi, %edi
	callq	_DEV_ID_RR0
	addq	%rax, %rbx
	movl	%r14d, %edi
	movq	%rbx, %rsi
	callq	_writel
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_cdns_i3c_master_dev_rr_to_info
	movq	_I3C_BCR_HDR_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, -48(%rbp)
	je	LBB0_22
## %bb.21:
	movq	_I3C_HDR_DDR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_I3C_CCC_HDR_MODE
	movl	%eax, -44(%rbp)
LBB0_22:
	movq	%r15, %rdi
	addq	$8, %rdi
	leaq	-48(%rbp), %rsi
	callq	_i3c_master_set_info
	testl	%eax, %eax
	movl	-56(%rbp), %edi                 ## 4-byte Reload
	jne	LBB0_24
## %bb.23:
	movq	_CTRL_HJ_ACK@GOTPCREL(%rip), %rax
	movq	_CTRL_HJ_DISEC@GOTPCREL(%rip), %rcx
	movq	_CTRL_HALT_EN@GOTPCREL(%rip), %rdx
	movq	_CTRL_MCS_EN@GOTPCREL(%rip), %rsi
	orl	(%rax), %edi
	orl	(%rcx), %edi
	orl	(%rdx), %edi
	orl	(%rsi), %edi
	movq	_CTRL@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	(%r15), %rsi
	callq	_writel
	movq	%r15, %rdi
	callq	_cdns_i3c_master_enable
	xorl	%eax, %eax
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_CTRL_PURE_BUS_MODE,4,2         ## @CTRL_PURE_BUS_MODE
	.comm	_CTRL_MIXED_FAST_BUS_MODE,4,2   ## @CTRL_MIXED_FAST_BUS_MODE
	.comm	_CTRL_MIXED_SLOW_BUS_MODE,4,2   ## @CTRL_MIXED_SLOW_BUS_MODE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PRESCL_CTRL0_MAX,4,2           ## @PRESCL_CTRL0_MAX
	.comm	_ERANGE,4,2                     ## @ERANGE
	.comm	_I3C_BUS_TLOW_OD_MIN_NS,8,3     ## @I3C_BUS_TLOW_OD_MIN_NS
	.comm	_PRESCL_CTRL0,8,3               ## @PRESCL_CTRL0
	.comm	_PRESCL_CTRL1,8,3               ## @PRESCL_CTRL1
	.comm	_DEV_ID_RR0_IS_I3C,4,2          ## @DEV_ID_RR0_IS_I3C
	.comm	_I3C_BCR_HDR_CAP,4,2            ## @I3C_BCR_HDR_CAP
	.comm	_I3C_HDR_DDR,4,2                ## @I3C_HDR_DDR
	.comm	_CTRL_HJ_ACK,4,2                ## @CTRL_HJ_ACK
	.comm	_CTRL_HJ_DISEC,4,2              ## @CTRL_HJ_DISEC
	.comm	_CTRL_HALT_EN,4,2               ## @CTRL_HALT_EN
	.comm	_CTRL_MCS_EN,4,2                ## @CTRL_MCS_EN
	.comm	_CTRL,8,3                       ## @CTRL
	.no_dead_strip	_cdns_i3c_master_bus_init
	.section	__DATA,__const
	.p2align	3                               ## @switch.table.cdns_i3c_master_bus_init
l_switch.table.cdns_i3c_master_bus_init:
	.quad	_CTRL_PURE_BUS_MODE
	.quad	_CTRL_MIXED_SLOW_BUS_MODE
	.quad	_CTRL_MIXED_FAST_BUS_MODE

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cdns_i3c_master_bus_init
_cdns_i3c_master_bus_init:              ; @cdns_i3c_master_bus_init
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	bl	_to_cdns_i3c_master
	mov	x19, x0
	mov	x0, x20
	bl	_i3c_master_get_bus
	str	xzr, [sp, #8]
	ldr	w8, [x0]
	sub	w8, w8, #128
	cmp	w8, #3
	b.hs	LBB0_5
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x9, l_switch.table.cdns_i3c_master_bus_init@PAGE
Lloh1:
	add	x9, x9, l_switch.table.cdns_i3c_master_bus_init@PAGEOFF
	ldr	x8, [x9, w8, sxtw #3]
	ldr	w25, [x8]
	ldr	w0, [x19, #12]
	bl	_clk_get_rate
	cbz	x0, LBB0_5
; %bb.2:
	mov	x22, x0
	ldrsw	x8, [x21, #8]
	lsl	x1, x8, #2
	bl	_DIV_ROUND_UP
	mov	x24, x0
	sub	w0, w0, #1
Lloh2:
	adrp	x27, _PRESCL_CTRL0_MAX@GOTPAGE
Lloh3:
	ldr	x27, [x27, _PRESCL_CTRL0_MAX@GOTPAGEOFF]
	ldr	w8, [x27]
	cmp	w0, w8
	b.gt	LBB0_4
; %bb.3:
	lsl	w8, w24, #2
	sxtw	x8, w8
	udiv	x8, x22, x8
	str	w8, [x21, #8]
	bl	_PRESCL_CTRL0_I3C
	mov	x23, x0
Lloh4:
	adrp	x26, _I3C_BUS_TLOW_OD_MIN_NS@GOTPAGE
Lloh5:
	ldr	x26, [x26, _I3C_BUS_TLOW_OD_MIN_NS@GOTPAGEOFF]
	ldr	x8, [x26]
	mul	x8, x8, x22
	sxtw	x9, w24
	udiv	x8, x8, x9
	sub	w0, w8, #2
	bl	_PRESCL_CTRL1_OD_LOW
	ldr	x8, [x21, #16]
	add	x8, x8, x8, lsl #2
	udiv	x8, x22, x8
	sub	w0, w8, #1
	ldr	w9, [x27]
	cmp	w0, w9
	b.le	LBB0_8
LBB0_4:
Lloh6:
	adrp	x8, _ERANGE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ERANGE@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh8:
	adrp	x8, _EINVAL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_8:
	add	w8, w8, w8, lsl #2
	sxtw	x8, w8
	udiv	x8, x22, x8
	str	x8, [x21, #16]
	bl	_PRESCL_CTRL0_I2C
	orr	w0, w0, w23
	ldr	x8, [x19]
Lloh10:
	adrp	x9, _PRESCL_CTRL0@GOTPAGE
Lloh11:
	ldr	x9, [x9, _PRESCL_CTRL0@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	ldr	w8, [x21, #8]
	lsl	w8, w8, #2
	mov	w9, #51712
	movk	w9, #15258, lsl #16
	sdiv	w8, w9, w8
	sxtw	x1, w8
	ldr	x0, [x26]
	bl	_DIV_ROUND_UP
	mov	w8, #2
	cmp	w0, #2
	csel	w8, w0, w8, gt
	sub	w0, w8, #2
	bl	_PRESCL_CTRL1_OD_LOW
	ldr	x8, [x19]
Lloh13:
	adrp	x9, _PRESCL_CTRL1@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PRESCL_CTRL1@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x20
	mov	w1, #0
	bl	_i3c_master_get_free_addr
	tbnz	w0, #31, LBB0_7
; %bb.9:
	bl	_prepare_rr0_dev_address
Lloh16:
	adrp	x8, _DEV_ID_RR0_IS_I3C@GOTPAGE
Lloh17:
	ldr	x8, [x8, _DEV_ID_RR0_IS_I3C@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	orr	w20, w8, w0
	ldr	x21, [x19]
	mov	w0, #0
	bl	_DEV_ID_RR0
	add	x1, x0, x21
	mov	x0, x20
	bl	_writel
	add	x2, sp, #8
	mov	x0, x19
	mov	w1, #0
	bl	_cdns_i3c_master_dev_rr_to_info
	ldr	w8, [sp, #8]
Lloh19:
	adrp	x9, _I3C_BCR_HDR_CAP@GOTPAGE
Lloh20:
	ldr	x9, [x9, _I3C_BCR_HDR_CAP@GOTPAGEOFF]
Lloh21:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_11
; %bb.10:
Lloh22:
	adrp	x8, _I3C_HDR_DDR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _I3C_HDR_DDR@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	bl	_I3C_CCC_HDR_MODE
	str	w0, [sp, #12]
LBB0_11:
	add	x0, x19, #8
	add	x1, sp, #8
	bl	_i3c_master_set_info
	cbnz	w0, LBB0_7
; %bb.12:
Lloh25:
	adrp	x8, _CTRL_HJ_ACK@GOTPAGE
Lloh26:
	ldr	x8, [x8, _CTRL_HJ_ACK@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _CTRL_HJ_DISEC@GOTPAGE
Lloh29:
	ldr	x9, [x9, _CTRL_HJ_DISEC@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
Lloh31:
	adrp	x10, _CTRL_HALT_EN@GOTPAGE
Lloh32:
	ldr	x10, [x10, _CTRL_HALT_EN@GOTPAGEOFF]
Lloh33:
	ldr	w10, [x10]
Lloh34:
	adrp	x11, _CTRL_MCS_EN@GOTPAGE
Lloh35:
	ldr	x11, [x11, _CTRL_MCS_EN@GOTPAGEOFF]
Lloh36:
	ldr	w11, [x11]
	orr	w8, w8, w25
	orr	w8, w8, w9
	orr	w8, w8, w10
	orr	w0, w8, w11
	ldr	x8, [x19]
Lloh37:
	adrp	x9, _CTRL@GOTPAGE
Lloh38:
	ldr	x9, [x9, _CTRL@GOTPAGEOFF]
Lloh39:
	ldr	x9, [x9]
	add	x1, x9, x8
	bl	_writel
	mov	x0, x19
	bl	_cdns_i3c_master_enable
	mov	w0, #0
	b	LBB0_7
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_CTRL_PURE_BUS_MODE,4,2         ; @CTRL_PURE_BUS_MODE
	.comm	_CTRL_MIXED_FAST_BUS_MODE,4,2   ; @CTRL_MIXED_FAST_BUS_MODE
	.comm	_CTRL_MIXED_SLOW_BUS_MODE,4,2   ; @CTRL_MIXED_SLOW_BUS_MODE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PRESCL_CTRL0_MAX,4,2           ; @PRESCL_CTRL0_MAX
	.comm	_ERANGE,4,2                     ; @ERANGE
	.comm	_I3C_BUS_TLOW_OD_MIN_NS,8,3     ; @I3C_BUS_TLOW_OD_MIN_NS
	.comm	_PRESCL_CTRL0,8,3               ; @PRESCL_CTRL0
	.comm	_PRESCL_CTRL1,8,3               ; @PRESCL_CTRL1
	.comm	_DEV_ID_RR0_IS_I3C,4,2          ; @DEV_ID_RR0_IS_I3C
	.comm	_I3C_BCR_HDR_CAP,4,2            ; @I3C_BCR_HDR_CAP
	.comm	_I3C_HDR_DDR,4,2                ; @I3C_HDR_DDR
	.comm	_CTRL_HJ_ACK,4,2                ; @CTRL_HJ_ACK
	.comm	_CTRL_HJ_DISEC,4,2              ; @CTRL_HJ_DISEC
	.comm	_CTRL_HALT_EN,4,2               ; @CTRL_HALT_EN
	.comm	_CTRL_MCS_EN,4,2                ; @CTRL_MCS_EN
	.comm	_CTRL,8,3                       ; @CTRL
	.no_dead_strip	_cdns_i3c_master_bus_init
	.section	__DATA,__const
	.p2align	3                               ; @switch.table.cdns_i3c_master_bus_init
l_switch.table.cdns_i3c_master_bus_init:
	.quad	_CTRL_PURE_BUS_MODE
	.quad	_CTRL_MIXED_SLOW_BUS_MODE
	.quad	_CTRL_MIXED_FAST_BUS_MODE

.subsections_via_symbols
