	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcf50633_mbc_usb_curlim_set    ## -- Begin function pcf50633_mbc_usb_curlim_set
	.p2align	4, 0x90
_pcf50633_mbc_usb_curlim_set:           ## @pcf50633_mbc_usb_curlim_set
	.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
	movl	%esi, %ebx
	movq	%rdi, %r12
	movl	4(%rdi), %edi
	callq	_platform_get_drvdata
	movq	%rax, %r14
	cmpl	$999, %ebx                      ## imm = 0x3E7
	jle	LBB0_2
## %bb.1:
	movl	$1000, %ebx                     ## imm = 0x3E8
	movq	_PCF50633_MBCC7_USB_1000mA@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	cmpl	$499, %ebx                      ## imm = 0x1F3
	jle	LBB0_4
## %bb.3:
	movl	$500, %ebx                      ## imm = 0x1F4
	movq	_PCF50633_MBCC7_USB_500mA@GOTPCREL(%rip), %rax
	jmp	LBB0_5
LBB0_4:
	xorl	%ecx, %ecx
	cmpl	$100, %ebx
	movq	_PCF50633_MBCC7_USB_SUSPEND@GOTPCREL(%rip), %rax
	cmovgeq	_PCF50633_MBCC7_USB_100mA@GOTPCREL(%rip), %rax
	movl	$100, %ebx
	cmovll	%ecx, %ebx
LBB0_5:
	movl	(%rax), %ecx
	movq	_PCF50633_REG_MBCC7@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_PCF50633_MBCC7_USB_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	callq	_pcf50633_reg_set_bit_mask
	movl	%eax, %r15d
	movl	(%r12), %edi
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_err
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rsi
	movl	%ebx, %edx
	callq	_dev_info
LBB0_8:
	movq	8(%r14), %rdi
	movq	(%rdi), %rax
	movl	(%rax), %ecx
	testl	%ecx, %ecx
	je	LBB0_10
## %bb.9:
	shll	$8, %ebx
	movl	%ebx, %eax
	xorl	%edx, %edx
	idivl	%ecx
	cmpl	$255, %eax
	movl	$255, %edx
	cmovbl	%eax, %edx
	movq	_PCF50633_REG_MBCC5@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pcf50633_reg_write
	movq	8(%r14), %rdi
LBB0_10:
	movq	_PCF50633_REG_MBCS2@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_pcf50633_reg_read
	movq	_PCF50633_MBCS2_MBC_MASK@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	movq	_PCF50633_MBCS2_MBC_BAT_FULL@GOTPCREL(%rip), %rcx
	movq	_PCF50633_REG_MBCC1@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	movq	_PCF50633_MBCC1_CHGENA@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	cmpl	(%rcx), %eax
	jne	LBB0_11
## %bb.12:
	movq	%r12, %rdi
	callq	_pcf50633_reg_clear_bits
	movl	(%r13), %esi
	movl	(%rbx), %ecx
	movq	%r12, %rdi
	movl	%ecx, %edx
	jmp	LBB0_13
LBB0_11:
	movq	%r12, %rdi
	movl	%edx, %ecx
LBB0_13:
	callq	_pcf50633_reg_set_bit_mask
	movl	(%r14), %edi
	callq	_power_supply_changed
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCF50633_MBCC7_USB_1000mA,4,2  ## @PCF50633_MBCC7_USB_1000mA
	.comm	_PCF50633_MBCC7_USB_500mA,4,2   ## @PCF50633_MBCC7_USB_500mA
	.comm	_PCF50633_MBCC7_USB_100mA,4,2   ## @PCF50633_MBCC7_USB_100mA
	.comm	_PCF50633_MBCC7_USB_SUSPEND,4,2 ## @PCF50633_MBCC7_USB_SUSPEND
	.comm	_PCF50633_REG_MBCC7,4,2         ## @PCF50633_REG_MBCC7
	.comm	_PCF50633_MBCC7_USB_MASK,4,2    ## @PCF50633_MBCC7_USB_MASK
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error setting usb curlim to %d mA\n"

L_.str.1:                               ## @.str.1
	.asciz	"usb curlim to %d mA\n"

	.comm	_PCF50633_REG_MBCC5,4,2         ## @PCF50633_REG_MBCC5
	.comm	_PCF50633_REG_MBCS2,4,2         ## @PCF50633_REG_MBCS2
	.comm	_PCF50633_MBCS2_MBC_MASK,4,2    ## @PCF50633_MBCS2_MBC_MASK
	.comm	_PCF50633_MBCS2_MBC_BAT_FULL,4,2 ## @PCF50633_MBCS2_MBC_BAT_FULL
	.comm	_PCF50633_REG_MBCC1,4,2         ## @PCF50633_REG_MBCC1
	.comm	_PCF50633_MBCC1_CHGENA,4,2      ## @PCF50633_MBCC1_CHGENA
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_pcf50633_mbc_usb_curlim_set    ; -- Begin function pcf50633_mbc_usb_curlim_set
	.p2align	2
_pcf50633_mbc_usb_curlim_set:           ; @pcf50633_mbc_usb_curlim_set
	.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	x21, x1
	mov	x20, x0
	ldr	w0, [x0, #4]
	bl	_platform_get_drvdata
	mov	x19, x0
	mov	w8, #1000
Lloh0:
	adrp	x9, _PCF50633_MBCC7_USB_1000mA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PCF50633_MBCC7_USB_1000mA@GOTPAGEOFF]
	mov	w10, #500
Lloh2:
	adrp	x11, _PCF50633_MBCC7_USB_SUSPEND@GOTPAGE
Lloh3:
	ldr	x11, [x11, _PCF50633_MBCC7_USB_SUSPEND@GOTPAGEOFF]
Lloh4:
	adrp	x12, _PCF50633_MBCC7_USB_100mA@GOTPAGE
Lloh5:
	ldr	x12, [x12, _PCF50633_MBCC7_USB_100mA@GOTPAGEOFF]
	mov	w13, #100
	cmp	w21, #99
	csel	w13, w13, wzr, gt
	csel	x11, x12, x11, gt
Lloh6:
	adrp	x12, _PCF50633_MBCC7_USB_500mA@GOTPAGE
Lloh7:
	ldr	x12, [x12, _PCF50633_MBCC7_USB_500mA@GOTPAGEOFF]
	cmp	w21, #499
	csel	w10, w10, w13, gt
	csel	x11, x12, x11, gt
	cmp	w21, #999
	csel	w22, w8, w10, gt
	csel	x8, x9, x11, gt
	ldr	w3, [x8]
Lloh8:
	adrp	x8, _PCF50633_REG_MBCC7@GOTPAGE
Lloh9:
	ldr	x8, [x8, _PCF50633_REG_MBCC7@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _PCF50633_MBCC7_USB_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PCF50633_MBCC7_USB_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
	mov	x0, x20
	bl	_pcf50633_reg_set_bit_mask
	mov	x21, x0
	ldr	w0, [x20]
	cbz	w21, LBB0_2
; %bb.1:
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x22
	bl	_dev_err
	b	LBB0_3
LBB0_2:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_dev_info
LBB0_3:
	ldr	x0, [x19, #8]
	ldr	x8, [x0]
	ldr	w8, [x8]
	cbz	w8, LBB0_5
; %bb.4:
	lsl	w9, w22, #8
	sdiv	w8, w9, w8
	mov	w9, #255
	cmp	w8, #255
	csel	w2, w8, w9, lo
Lloh18:
	adrp	x8, _PCF50633_REG_MBCC5@GOTPAGE
Lloh19:
	ldr	x8, [x8, _PCF50633_REG_MBCC5@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	bl	_pcf50633_reg_write
	ldr	x0, [x19, #8]
LBB0_5:
Lloh21:
	adrp	x8, _PCF50633_REG_MBCS2@GOTPAGE
Lloh22:
	ldr	x8, [x8, _PCF50633_REG_MBCS2@GOTPAGEOFF]
Lloh23:
	ldr	w1, [x8]
	bl	_pcf50633_reg_read
Lloh24:
	adrp	x8, _PCF50633_MBCS2_MBC_MASK@GOTPAGE
Lloh25:
	ldr	x8, [x8, _PCF50633_MBCS2_MBC_MASK@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	and	w8, w8, w0
Lloh27:
	adrp	x9, _PCF50633_MBCS2_MBC_BAT_FULL@GOTPAGE
Lloh28:
	ldr	x9, [x9, _PCF50633_MBCS2_MBC_BAT_FULL@GOTPAGEOFF]
Lloh29:
	adrp	x22, _PCF50633_REG_MBCC1@GOTPAGE
Lloh30:
	ldr	x22, [x22, _PCF50633_REG_MBCC1@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	ldr	w1, [x22]
Lloh32:
	adrp	x23, _PCF50633_MBCC1_CHGENA@GOTPAGE
Lloh33:
	ldr	x23, [x23, _PCF50633_MBCC1_CHGENA@GOTPAGEOFF]
	ldr	w2, [x23]
	cmp	w8, w9
	b.ne	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_pcf50633_reg_clear_bits
	ldr	w1, [x22]
	ldr	w2, [x23]
LBB0_7:
	mov	x0, x20
	mov	x3, x2
	bl	_pcf50633_reg_set_bit_mask
	ldr	w0, [x19]
	bl	_power_supply_changed
	mov	x0, x21
	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	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh31
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_PCF50633_MBCC7_USB_1000mA,4,2  ; @PCF50633_MBCC7_USB_1000mA
	.comm	_PCF50633_MBCC7_USB_500mA,4,2   ; @PCF50633_MBCC7_USB_500mA
	.comm	_PCF50633_MBCC7_USB_100mA,4,2   ; @PCF50633_MBCC7_USB_100mA
	.comm	_PCF50633_MBCC7_USB_SUSPEND,4,2 ; @PCF50633_MBCC7_USB_SUSPEND
	.comm	_PCF50633_REG_MBCC7,4,2         ; @PCF50633_REG_MBCC7
	.comm	_PCF50633_MBCC7_USB_MASK,4,2    ; @PCF50633_MBCC7_USB_MASK
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error setting usb curlim to %d mA\n"

l_.str.1:                               ; @.str.1
	.asciz	"usb curlim to %d mA\n"

	.comm	_PCF50633_REG_MBCC5,4,2         ; @PCF50633_REG_MBCC5
	.comm	_PCF50633_REG_MBCS2,4,2         ; @PCF50633_REG_MBCS2
	.comm	_PCF50633_MBCS2_MBC_MASK,4,2    ; @PCF50633_MBCS2_MBC_MASK
	.comm	_PCF50633_MBCS2_MBC_BAT_FULL,4,2 ; @PCF50633_MBCS2_MBC_BAT_FULL
	.comm	_PCF50633_REG_MBCC1,4,2         ; @PCF50633_REG_MBCC1
	.comm	_PCF50633_MBCC1_CHGENA,4,2      ; @PCF50633_MBCC1_CHGENA
.subsections_via_symbols
