	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rescale_current_sense_amplifier_props
_rescale_current_sense_amplifier_props: ## @rescale_current_sense_amplifier_props
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	$1, -32(%rbp)
	movl	$1, -28(%rbp)
	leaq	L_.str(%rip), %rsi
	leaq	-36(%rbp), %rdx
	callq	_device_property_read_u32
	movl	%eax, %r14d
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_dev_err
	jmp	LBB0_3
LBB0_2:
	leaq	L_.str.2(%rip), %rsi
	leaq	-32(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_device_property_read_u32
	leaq	L_.str.3(%rip), %rsi
	leaq	-28(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_device_property_read_u32
	movl	-36(%rbp), %edi
	movl	$1000000, %esi                  ## imm = 0xF4240
	callq	_gcd
	movl	%eax, %ecx
	movl	$1000000, %eax                  ## imm = 0xF4240
	xorl	%edx, %edx
	idivl	%ecx
	movl	%eax, %edi
	movl	%eax, (%r15)
	movl	-36(%rbp), %eax
	cltd
	idivl	%ecx
	movl	%eax, 4(%r15)
	movl	-32(%rbp), %esi
	callq	_gcd
	movl	%eax, %ecx
	movl	(%r15), %eax
	cltd
	idivl	%ecx
	movl	%eax, (%r15)
	movl	-32(%rbp), %eax
	cltd
	idivl	%ecx
	imull	4(%r15), %eax
	movl	%eax, 4(%r15)
	movl	-28(%rbp), %esi
	movl	%eax, %edi
	callq	_gcd
	movl	%eax, %ecx
	movl	-28(%rbp), %eax
	cltd
	idivl	%ecx
	imull	(%r15), %eax
	movl	%eax, (%r15)
	movl	4(%r15), %eax
	cltd
	idivl	%ecx
	movl	%eax, 4(%r15)
LBB0_3:
	movl	%r14d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"sense-resistor-micro-ohms"

L_.str.1:                               ## @.str.1
	.asciz	"failed to read the sense resistance: %d\n"

L_.str.2:                               ## @.str.2
	.asciz	"sense-gain-mult"

L_.str.3:                               ## @.str.3
	.asciz	"sense-gain-div"

	.no_dead_strip	_rescale_current_sense_amplifier_props
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rescale_current_sense_amplifier_props
_rescale_current_sense_amplifier_props: ; @rescale_current_sense_amplifier_props
	.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, x1
	mov	x21, x0
	mov	w8, #1
	stp	w8, w8, [sp, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	add	x2, sp, #12
	bl	_device_property_read_u32
	mov	x20, x0
	cbz	w0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_dev_err
	b	LBB0_3
LBB0_2:
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #8
	mov	x0, x21
	bl	_device_property_read_u32
Lloh6:
	adrp	x1, l_.str.3@PAGE
Lloh7:
	add	x1, x1, l_.str.3@PAGEOFF
	add	x2, sp, #4
	mov	x0, x21
	bl	_device_property_read_u32
	ldr	w0, [sp, #12]
	mov	w21, #16960
	movk	w21, #15, lsl #16
	mov	w1, #16960
	movk	w1, #15, lsl #16
	bl	_gcd
	sdiv	w8, w21, w0
	ldp	w1, w9, [sp, #8]
	sdiv	w9, w9, w0
	stp	w8, w9, [x19]
	mov	x0, x8
	bl	_gcd
	ldp	w1, w8, [sp, #4]
	sdiv	w8, w8, w0
	ldp	w9, w10, [x19]
	mul	w8, w10, w8
	sdiv	w9, w9, w0
	stp	w9, w8, [x19]
	mov	x0, x8
	bl	_gcd
	ldr	w8, [sp, #4]
	sdiv	w8, w8, w0
	ldp	w9, w10, [x19]
	mul	w8, w9, w8
	sdiv	w9, w10, w0
	stp	w8, w9, [x19]
LBB0_3:
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"sense-resistor-micro-ohms"

l_.str.1:                               ; @.str.1
	.asciz	"failed to read the sense resistance: %d\n"

l_.str.2:                               ; @.str.2
	.asciz	"sense-gain-mult"

l_.str.3:                               ; @.str.3
	.asciz	"sense-gain-div"

	.no_dead_strip	_rescale_current_sense_amplifier_props
.subsections_via_symbols
