	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function msm_vibrator_start
_msm_vibrator_start:                    ## @msm_vibrator_start
	.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
	movq	%rdi, %rbx
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	cmpl	$0, (%rbx)
	je	LBB0_1
LBB0_9:
	movl	4(%rbx), %eax
	movl	%eax, %ecx
	shll	$7, %ecx
	subl	%eax, %ecx
	subl	%eax, %ecx
	movslq	%ecx, %rax
	imulq	$2147450879, %rax, %rcx         ## imm = 0x7FFF7FFF
	shrq	$32, %rcx
	subl	%eax, %ecx
	movl	%ecx, %eax
	sarl	$15, %eax
	shrl	$31, %ecx
	leal	(%rax,%rcx), %r15d
	addl	$127, %r15d
	movq	_REG_CFG_RCGR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$8199, %edx                     ## imm = 0x2007
	callq	_msm_vibrator_write
	movq	_REG_M@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_msm_vibrator_write
	movq	_REG_N@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$128, %edx
	callq	_msm_vibrator_write
	movq	_REG_D@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_msm_vibrator_write
	movq	_REG_CMD_RCGR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_msm_vibrator_write
	movq	_REG_CBCR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$1, %edx
	callq	_msm_vibrator_write
	xorl	%r15d, %r15d
	jmp	LBB0_10
LBB0_1:
	movl	16(%rbx), %edi
	movl	$24000, %esi                    ## imm = 0x5DC0
	callq	_clk_set_rate
	testl	%eax, %eax
	je	LBB0_4
## %bb.2:
	movl	%eax, %r15d
	movq	24(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_3
LBB0_4:
	movl	16(%rbx), %edi
	callq	_clk_prepare_enable
	testl	%eax, %eax
	je	LBB0_6
## %bb.5:
	movl	%eax, %r15d
	movq	24(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
LBB0_3:
	movl	%r15d, %edx
	callq	_dev_err
LBB0_10:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movl	32(%rbx), %edi
	callq	_regulator_enable
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	%eax, %r15d
	movq	24(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	movl	%eax, %edx
	callq	_dev_err
	movl	16(%rbx), %edi
	callq	_clk_disable
	jmp	LBB0_10
LBB0_8:
	movl	12(%rbx), %edi
	movl	$1, %esi
	callq	_gpiod_set_value_cansleep
	movl	$1, (%rbx)
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to set clock rate: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to enable clock: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"Failed to enable regulator: %d\n"

	.comm	_REG_CFG_RCGR,4,2               ## @REG_CFG_RCGR
	.comm	_REG_M,4,2                      ## @REG_M
	.comm	_REG_N,4,2                      ## @REG_N
	.comm	_REG_D,4,2                      ## @REG_D
	.comm	_REG_CMD_RCGR,4,2               ## @REG_CMD_RCGR
	.comm	_REG_CBCR,4,2                   ## @REG_CBCR
	.no_dead_strip	_msm_vibrator_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function msm_vibrator_start
_msm_vibrator_start:                    ; @msm_vibrator_start
	.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, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	w8, [x20]
	cbz	w8, LBB0_2
LBB0_1:
	ldr	w8, [x20, #4]
	mov	w9, #126
	mul	w8, w8, w9
	mov	w9, #2147450879
	smull	x9, w8, w9
	lsr	x9, x9, #32
	sub	w8, w9, w8
	asr	w9, w8, #15
	add	w8, w9, w8, lsr #31
	add	w21, w8, #127
Lloh0:
	adrp	x8, _REG_CFG_RCGR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REG_CFG_RCGR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #8199
	bl	_msm_vibrator_write
Lloh3:
	adrp	x8, _REG_M@GOTPAGE
Lloh4:
	ldr	x8, [x8, _REG_M@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_msm_vibrator_write
Lloh6:
	adrp	x8, _REG_N@GOTPAGE
Lloh7:
	ldr	x8, [x8, _REG_N@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #128
	bl	_msm_vibrator_write
Lloh9:
	adrp	x8, _REG_D@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REG_D@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x20
	mov	x2, x21
	bl	_msm_vibrator_write
Lloh12:
	adrp	x8, _REG_CMD_RCGR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _REG_CMD_RCGR@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_msm_vibrator_write
Lloh15:
	adrp	x8, _REG_CBCR@GOTPAGE
Lloh16:
	ldr	x8, [x8, _REG_CBCR@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x20
	mov	w2, #1
	bl	_msm_vibrator_write
	mov	w21, #0
	b	LBB0_7
LBB0_2:
	ldr	w0, [x20, #16]
	mov	w1, #24000
	bl	_clk_set_rate
	cbz	w0, LBB0_4
; %bb.3:
	mov	x21, x0
	ldr	x0, [x20, #24]
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_6
LBB0_4:
	ldr	w0, [x20, #16]
	bl	_clk_prepare_enable
	cbz	w0, LBB0_8
; %bb.5:
	mov	x21, x0
	ldr	x0, [x20, #24]
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_6:
	mov	x2, x21
	bl	_dev_err
LBB0_7:
	mov	x0, x19
	bl	_mutex_unlock
	mov	x0, 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
	ret
LBB0_8:
	ldr	w0, [x20, #32]
	bl	_regulator_enable
	cbz	w0, LBB0_10
; %bb.9:
	mov	x21, x0
	ldr	x0, [x20, #24]
Lloh22:
	adrp	x1, l_.str.2@PAGE
Lloh23:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x21
	bl	_dev_err
	ldr	w0, [x20, #16]
	bl	_clk_disable
	b	LBB0_7
LBB0_10:
	ldr	w0, [x20, #12]
	mov	w21, #1
	mov	w1, #1
	bl	_gpiod_set_value_cansleep
	str	w21, [x20]
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to set clock rate: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to enable clock: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"Failed to enable regulator: %d\n"

	.comm	_REG_CFG_RCGR,4,2               ; @REG_CFG_RCGR
	.comm	_REG_M,4,2                      ; @REG_M
	.comm	_REG_N,4,2                      ; @REG_N
	.comm	_REG_D,4,2                      ; @REG_D
	.comm	_REG_CMD_RCGR,4,2               ; @REG_CMD_RCGR
	.comm	_REG_CBCR,4,2                   ; @REG_CBCR
	.no_dead_strip	_msm_vibrator_start
.subsections_via_symbols
