	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function max8997_haptic_enable
_max8997_haptic_enable:                 ## @max8997_haptic_enable
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	16(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%rbx, %rdi
	callq	_max8997_haptic_set_duty_cycle
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	24(%rbx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_2:
	cmpl	$0, (%rbx)
	jne	LBB0_9
## %bb.3:
	movl	20(%rbx), %edi
	callq	_regulator_enable
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:
	movl	24(%rbx), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_5:
	movq	%rbx, %rdi
	callq	_max8997_haptic_configure
	movq	8(%rbx), %rax
	movq	_MAX8997_EXTERNAL_MODE@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.6:
	movl	28(%rbx), %edi
	callq	_pwm_enable
	testl	%eax, %eax
	je	LBB0_8
## %bb.7:
	movl	24(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	movl	20(%rbx), %edi
	callq	_regulator_disable
	jmp	LBB0_9
LBB0_8:
	movl	$1, (%rbx)
LBB0_9:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"set_pwm_cycle failed, error: %d\n"

L_.str.1:                               ## @.str.1
	.asciz	"Failed to enable regulator\n"

	.comm	_MAX8997_EXTERNAL_MODE,8,3      ## @MAX8997_EXTERNAL_MODE
L_.str.2:                               ## @.str.2
	.asciz	"Failed to enable PWM\n"

	.no_dead_strip	_max8997_haptic_enable
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function max8997_haptic_enable
_max8997_haptic_enable:                 ; @max8997_haptic_enable
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x0
	add	x19, x0, #16
	mov	x0, x19
	bl	_mutex_lock
	mov	x0, x20
	bl	_max8997_haptic_set_duty_cycle
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w8, [x20, #24]
	str	x0, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
	bl	_dev_err
	b	LBB0_9
LBB0_2:
	ldr	w8, [x20]
	cbnz	w8, LBB0_9
; %bb.3:
	ldr	w0, [x20, #20]
	bl	_regulator_enable
	cbz	w0, LBB0_5
; %bb.4:
	ldr	w0, [x20, #24]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_5:
	mov	x0, x20
	bl	_max8997_haptic_configure
	ldr	x8, [x20, #8]
Lloh4:
	adrp	x9, _MAX8997_EXTERNAL_MODE@GOTPAGE
Lloh5:
	ldr	x9, [x9, _MAX8997_EXTERNAL_MODE@GOTPAGEOFF]
Lloh6:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
	ldr	w0, [x20, #28]
	bl	_pwm_enable
	cbz	w0, LBB0_8
; %bb.7:
	ldr	w0, [x20, #24]
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	ldr	w0, [x20, #20]
	bl	_regulator_disable
	b	LBB0_9
LBB0_8:
	mov	w8, #1
	str	w8, [x20]
LBB0_9:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	b	_mutex_unlock
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"set_pwm_cycle failed, error: %d\n"

l_.str.1:                               ; @.str.1
	.asciz	"Failed to enable regulator\n"

	.comm	_MAX8997_EXTERNAL_MODE,8,3      ; @MAX8997_EXTERNAL_MODE
l_.str.2:                               ; @.str.2
	.asciz	"Failed to enable PWM\n"

	.no_dead_strip	_max8997_haptic_enable
.subsections_via_symbols
