	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cros_usbpd_charger_set_prop
_cros_usbpd_charger_set_prop:           ## @cros_usbpd_charger_set_prop
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movl	%esi, %r12d
	callq	_power_supply_get_drvdata
	movl	(%rbx), %ecx
	movq	_U16_MAX@GOTPCREL(%rip), %rdx
	imull	$1000, (%rdx), %edx             ## imm = 0x3E8
	cmpl	%edx, %ecx
	jge	LBB0_16
## %bb.1:
	movq	(%rax), %rdi
	testl	%ecx, %ecx
	js	LBB0_2
## %bb.3:
	movl	%ecx, %eax
	imulq	$274877907, %rax, %r14          ## imm = 0x10624DD3
	shrq	$38, %r14
	jmp	LBB0_4
LBB0_2:
	movq	_EC_POWER_LIMIT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_4:
	movq	(%rdi), %r15
	cmpl	$128, %r12d
	je	LBB0_12
## %bb.5:
	cmpl	$129, %r12d
	jne	LBB0_16
## %bb.6:
	movq	_input_voltage_limit@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %esi
	callq	_cros_usbpd_charger_set_ext_power_limit
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_17
## %bb.7:
	movq	_input_current_limit@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	movq	_EC_POWER_LIMIT_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_10
## %bb.8:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_9
LBB0_16:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_17:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_input_current_limit@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	%r14d, %edx
	callq	_cros_usbpd_charger_set_ext_power_limit
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_17
## %bb.13:
	movq	_input_voltage_limit@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	movq	_EC_POWER_LIMIT_NONE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_17
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_11
LBB0_15:
	leaq	L_.str.3(%rip), %rsi
LBB0_11:
	movq	%r15, %rdi
	movl	%r14d, %edx
	xorl	%eax, %eax
	callq	_dev_info
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_U16_MAX,4,2                    ## @U16_MAX
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_EC_POWER_LIMIT_NONE,4,2        ## @EC_POWER_LIMIT_NONE
	.comm	_input_voltage_limit,4,2        ## @input_voltage_limit
	.comm	_input_current_limit,4,2        ## @input_current_limit
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"External Current Limit cleared for all ports\n"

L_.str.1:                               ## @.str.1
	.asciz	"External Current Limit set to %dmA for all ports\n"

L_.str.2:                               ## @.str.2
	.asciz	"External Voltage Limit cleared for all ports\n"

L_.str.3:                               ## @.str.3
	.asciz	"External Voltage Limit set to %dmV for all ports\n"

	.no_dead_strip	_cros_usbpd_charger_set_prop
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cros_usbpd_charger_set_prop
_cros_usbpd_charger_set_prop:           ; @cros_usbpd_charger_set_prop
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x19, x2
	mov	x20, x1
	bl	_power_supply_get_drvdata
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _U16_MAX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _U16_MAX@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mov	w10, #1000
	mul	w9, w9, w10
	cmp	w8, w9
	b.ge	LBB0_7
; %bb.1:
	ldr	x0, [x0]
	ldr	x19, [x0]
	tbnz	w8, #31, LBB0_8
; %bb.2:
	mov	w9, #19923
	movk	w9, #4194, lsl #16
	umull	x8, w8, w9
	lsr	x21, x8, #38
	cmp	w20, #128
	b.eq	LBB0_9
LBB0_3:
	cmp	w20, #129
	b.ne	LBB0_7
; %bb.4:
Lloh3:
	adrp	x8, _input_voltage_limit@GOTPAGE
Lloh4:
	ldr	x8, [x8, _input_voltage_limit@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_cros_usbpd_charger_set_ext_power_limit
	mov	x20, x0
	tbnz	w0, #31, LBB0_15
; %bb.5:
Lloh6:
	adrp	x8, _input_current_limit@GOTPAGE
Lloh7:
	ldr	x8, [x8, _input_current_limit@GOTPAGEOFF]
Lloh8:
	str	w21, [x8]
Lloh9:
	adrp	x8, _EC_POWER_LIMIT_NONE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EC_POWER_LIMIT_NONE@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_12
; %bb.6:
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_14
LBB0_7:
Lloh14:
	adrp	x8, _EINVAL@GOTPAGE
Lloh15:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_15
LBB0_8:
Lloh17:
	adrp	x8, _EC_POWER_LIMIT_NONE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EC_POWER_LIMIT_NONE@GOTPAGEOFF]
Lloh19:
	ldr	w21, [x8]
	cmp	w20, #128
	b.ne	LBB0_3
LBB0_9:
Lloh20:
	adrp	x8, _input_current_limit@GOTPAGE
Lloh21:
	ldr	x8, [x8, _input_current_limit@GOTPAGEOFF]
Lloh22:
	ldr	w1, [x8]
	mov	x2, x21
	bl	_cros_usbpd_charger_set_ext_power_limit
	mov	x20, x0
	tbnz	w0, #31, LBB0_15
; %bb.10:
Lloh23:
	adrp	x8, _input_voltage_limit@GOTPAGE
Lloh24:
	ldr	x8, [x8, _input_voltage_limit@GOTPAGEOFF]
Lloh25:
	str	w21, [x8]
Lloh26:
	adrp	x8, _EC_POWER_LIMIT_NONE@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EC_POWER_LIMIT_NONE@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	cmp	w21, w8
	b.ne	LBB0_13
; %bb.11:
Lloh29:
	adrp	x1, l_.str.2@PAGE
Lloh30:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_12:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	str	x21, [sp]
Lloh31:
	adrp	x1, l_.str.1@PAGE
Lloh32:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_14
LBB0_13:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
	str	x21, [sp]
Lloh33:
	adrp	x1, l_.str.3@PAGE
Lloh34:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_14:
	mov	x0, x19
	bl	_dev_info
LBB0_15:
	mov	x0, x20
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotStr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotStr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_U16_MAX,4,2                    ; @U16_MAX
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_EC_POWER_LIMIT_NONE,4,2        ; @EC_POWER_LIMIT_NONE
	.comm	_input_voltage_limit,4,2        ; @input_voltage_limit
	.comm	_input_current_limit,4,2        ; @input_current_limit
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"External Current Limit cleared for all ports\n"

l_.str.1:                               ; @.str.1
	.asciz	"External Current Limit set to %dmA for all ports\n"

l_.str.2:                               ; @.str.2
	.asciz	"External Voltage Limit cleared for all ports\n"

l_.str.3:                               ; @.str.3
	.asciz	"External Voltage Limit set to %dmV for all ports\n"

	.no_dead_strip	_cros_usbpd_charger_set_prop
.subsections_via_symbols
