	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lm3533_ctrlbank_set_max_current ## -- Begin function lm3533_ctrlbank_set_max_current
	.p2align	4, 0x90
_lm3533_ctrlbank_set_max_current:       ## @lm3533_ctrlbank_set_max_current
	.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	_LM3533_MAX_CURRENT_MIN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	%rsi, %rax
	jg	LBB0_2
## %bb.1:
	movq	_LM3533_MAX_CURRENT_MAX@GOTPCREL(%rip), %rcx
	cmpq	%rsi, (%rcx)
	jl	LBB0_2
## %bb.3:
	movq	%rdi, %r14
	subq	%rax, %rsi
	movq	_LM3533_MAX_CURRENT_STEP@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rsi, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_4
## %bb.5:
	movq	%rsi, %rax
	cqto
	idivq	%rcx
	movq	%rax, %rbx
	jmp	LBB0_6
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_9
LBB0_4:
	movl	%esi, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%eax, %ebx
LBB0_6:
	movq	_LM3533_REG_MAX_CURRENT_BASE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_lm3533_ctrlbank_get_reg
	movl	4(%r14), %edi
	movq	%rax, %rsi
	movq	%rbx, %rdx
	callq	_lm3533_write
	testl	%eax, %eax
	je	LBB0_7
## %bb.8:
	movl	%eax, %ebx
	movl	(%r14), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_9
LBB0_7:
	xorl	%ebx, %ebx
LBB0_9:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LM3533_MAX_CURRENT_MIN,8,3     ## @LM3533_MAX_CURRENT_MIN
	.comm	_LM3533_MAX_CURRENT_MAX,8,3     ## @LM3533_MAX_CURRENT_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_LM3533_MAX_CURRENT_STEP,8,3    ## @LM3533_MAX_CURRENT_STEP
	.comm	_LM3533_REG_MAX_CURRENT_BASE,4,2 ## @LM3533_REG_MAX_CURRENT_BASE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to set max current\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lm3533_ctrlbank_set_max_current ; -- Begin function lm3533_ctrlbank_set_max_current
	.p2align	2
_lm3533_ctrlbank_set_max_current:       ; @lm3533_ctrlbank_set_max_current
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _LM3533_MAX_CURRENT_MIN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LM3533_MAX_CURRENT_MIN@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _LM3533_MAX_CURRENT_MAX@GOTPAGE
Lloh4:
	ldr	x9, [x9, _LM3533_MAX_CURRENT_MAX@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x1
	ccmp	x9, x1, #8, le
	b.ge	LBB0_2
; %bb.1:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_4
LBB0_2:
	mov	x19, x0
Lloh9:
	adrp	x9, _LM3533_MAX_CURRENT_STEP@GOTPAGE
Lloh10:
	ldr	x9, [x9, _LM3533_MAX_CURRENT_STEP@GOTPAGEOFF]
	sub	x8, x1, x8
Lloh11:
	ldr	x9, [x9]
Lloh12:
	adrp	x10, _LM3533_REG_MAX_CURRENT_BASE@GOTPAGE
Lloh13:
	ldr	x10, [x10, _LM3533_REG_MAX_CURRENT_BASE@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x10]
	sdiv	x20, x8, x9
	bl	_lm3533_ctrlbank_get_reg
	mov	x1, x0
	ldr	w0, [x19, #4]
	mov	x2, x20
	bl	_lm3533_write
	mov	x20, x0
	cbz	w0, LBB0_4
; %bb.3:
	ldr	w0, [x19]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
LBB0_4:
	mov	x0, x20
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_LM3533_MAX_CURRENT_MIN,8,3     ; @LM3533_MAX_CURRENT_MIN
	.comm	_LM3533_MAX_CURRENT_MAX,8,3     ; @LM3533_MAX_CURRENT_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_LM3533_MAX_CURRENT_STEP,8,3    ; @LM3533_MAX_CURRENT_STEP
	.comm	_LM3533_REG_MAX_CURRENT_BASE,4,2 ; @LM3533_REG_MAX_CURRENT_BASE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to set max current\n"

.subsections_via_symbols
