	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ocores_init
_ocores_init:                           ## @ocores_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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r12
	movq	_OCI2C_CONTROL@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r14, %rdi
	callq	_oc_getreg
	movq	_OCI2C_CTRL_EN@GOTPCREL(%rip), %rdx
	movq	_OCI2C_CTRL_IEN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ebx
	orl	(%rdx), %ebx
	notl	%ebx
	andl	%eax, %ebx
	movl	(%r15), %esi
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_oc_setreg
	movl	(%r14), %eax
	movl	4(%r14), %ecx
	leal	(%rcx,%rcx,4), %ecx
	cltd
	idivl	%ecx
                                        ## kill: def $eax killed $eax def $rax
	leal	-1(%rax), %edi
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_clamp
	movl	%eax, %r13d
	movl	(%r14), %r8d
	leal	5(%r13,%r13,4), %ecx
	movl	%r8d, %eax
	cltd
	idivl	%ecx
	movslq	4(%r14), %rcx
	subl	%ecx, %eax
	movl	%eax, %edx
	negl	%edx
	cmovsl	%eax, %edx
	imulq	$1717986919, %rcx, %rax         ## imm = 0x66666667
	movq	%rax, %rsi
	shrq	$63, %rsi
	sarq	$34, %rax
	addl	%esi, %eax
	cmpl	%eax, %edx
	jle	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r8d, %edx
                                        ## kill: def $ecx killed $ecx killed $rcx
	callq	_dev_err
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_3
LBB0_2:
	movq	_OCI2C_PRELOW@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movzbl	%r13b, %edx
	movq	%r14, %rdi
	callq	_oc_setreg
	movq	_OCI2C_PREHIGH@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	sarl	$8, %r13d
	movq	%r14, %rdi
	movl	%r13d, %edx
	callq	_oc_setreg
	movq	_OCI2C_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OCI2C_CMD_IACK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	callq	_oc_setreg
	movq	_OCI2C_CONTROL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_OCI2C_CTRL_EN@GOTPCREL(%rip), %rax
	orl	(%rax), %ebx
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_oc_setreg
LBB0_3:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_OCI2C_CONTROL,4,2              ## @OCI2C_CONTROL
	.comm	_OCI2C_CTRL_EN,4,2              ## @OCI2C_CTRL_EN
	.comm	_OCI2C_CTRL_IEN,4,2             ## @OCI2C_CTRL_IEN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unsupported clock settings: core: %d KHz, bus: %d KHz\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_OCI2C_PRELOW,4,2               ## @OCI2C_PRELOW
	.comm	_OCI2C_PREHIGH,4,2              ## @OCI2C_PREHIGH
	.comm	_OCI2C_CMD,4,2                  ## @OCI2C_CMD
	.comm	_OCI2C_CMD_IACK,4,2             ## @OCI2C_CMD_IACK
	.no_dead_strip	_ocores_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ocores_init
_ocores_init:                           ; @ocores_init
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x23, _OCI2C_CONTROL@GOTPAGE
Lloh1:
	ldr	x23, [x23, _OCI2C_CONTROL@GOTPAGEOFF]
	ldr	w1, [x23]
	mov	x0, x19
	bl	_oc_getreg
Lloh2:
	adrp	x24, _OCI2C_CTRL_EN@GOTPAGE
Lloh3:
	ldr	x24, [x24, _OCI2C_CTRL_EN@GOTPAGEOFF]
	ldr	w8, [x24]
Lloh4:
	adrp	x9, _OCI2C_CTRL_IEN@GOTPAGE
Lloh5:
	ldr	x9, [x9, _OCI2C_CTRL_IEN@GOTPAGEOFF]
Lloh6:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w20, w0, w8
	ldr	w1, [x23]
	mov	x0, x19
	mov	x2, x20
	bl	_oc_setreg
	ldp	w8, w9, [x19]
	add	w9, w9, w9, lsl #2
	sdiv	w8, w8, w9
	sub	w0, w8, #1
	mov	w1, #0
	mov	w2, #65535
	bl	_clamp
	add	w8, w0, w0, lsl #2
	add	w8, w8, #5
	ldp	w2, w3, [x19]
                                        ; kill: def $w3 killed $w3 def $x3
	sxtw	x3, w3
	sdiv	w8, w2, w8
	subs	w8, w8, w3
	cneg	w8, w8, mi
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	mul	x9, x3, x9
	lsr	x10, x9, #63
	asr	x9, x9, #34
	add	w9, w9, w10
	cmp	w8, w9
	b.le	LBB0_2
; %bb.1:
Lloh7:
	adrp	x1, l_.str@PAGE
Lloh8:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
                                        ; kill: def $w3 killed $w3 killed $x3
	bl	_dev_err
Lloh9:
	adrp	x8, _EINVAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	mov	x22, x0
Lloh12:
	adrp	x8, _OCI2C_PRELOW@GOTPAGE
Lloh13:
	ldr	x8, [x8, _OCI2C_PRELOW@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	and	w2, w0, #0xff
	mov	x0, x19
	bl	_oc_setreg
Lloh15:
	adrp	x8, _OCI2C_PREHIGH@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OCI2C_PREHIGH@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	asr	w2, w22, #8
	mov	x0, x19
	bl	_oc_setreg
Lloh18:
	adrp	x8, _OCI2C_CMD@GOTPAGE
Lloh19:
	ldr	x8, [x8, _OCI2C_CMD@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
Lloh21:
	adrp	x8, _OCI2C_CMD_IACK@GOTPAGE
Lloh22:
	ldr	x8, [x8, _OCI2C_CMD_IACK@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_oc_setreg
	ldr	w1, [x23]
	ldr	w8, [x24]
	orr	w2, w8, w20
	mov	x0, x19
	bl	_oc_setreg
	mov	w0, #0
LBB0_3:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_OCI2C_CONTROL,4,2              ; @OCI2C_CONTROL
	.comm	_OCI2C_CTRL_EN,4,2              ; @OCI2C_CTRL_EN
	.comm	_OCI2C_CTRL_IEN,4,2             ; @OCI2C_CTRL_IEN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unsupported clock settings: core: %d KHz, bus: %d KHz\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_OCI2C_PRELOW,4,2               ; @OCI2C_PRELOW
	.comm	_OCI2C_PREHIGH,4,2              ; @OCI2C_PREHIGH
	.comm	_OCI2C_CMD,4,2                  ; @OCI2C_CMD
	.comm	_OCI2C_CMD_IACK,4,2             ; @OCI2C_CMD_IACK
	.no_dead_strip	_ocores_init
.subsections_via_symbols
