	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bq27xxx_battery_setup          ## -- Begin function bq27xxx_battery_setup
	.p2align	4, 0x90
_bq27xxx_battery_setup:                 ## @bq27xxx_battery_setup
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	%rdi, -32(%rbp)
	movq	16(%rdi), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	addq	$48, %rdi
	movq	_bq27xxx_battery_poll@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_INIT_DELAYED_WORK
	leaq	44(%rbx), %rdi
	callq	_mutex_init
	movq	_bq27xxx_chip_data@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	(%rbx), %rcx
	movq	16(%rbx), %rdi
	leaq	(%rcx,%rcx,2), %rcx
	movups	8(%rax,%rcx,8), %xmm0
	movups	%xmm0, 28(%rbx)
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$24, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movl	24(%rbx), %ecx
	movl	%ecx, 20(%rax)
	movq	_POWER_SUPPLY_TYPE_BATTERY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movq	(%r14), %rcx
	movq	(%rbx), %rdx
	leaq	(%rdx,%rdx,2), %rdx
	movl	4(%rcx,%rdx,8), %esi
	movl	%esi, 12(%rax)
	movl	(%rcx,%rdx,8), %ecx
	movl	%ecx, 8(%rax)
	movq	_bq27xxx_battery_get_property@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 4(%rax)
	movq	_bq27xxx_external_power_changed@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	movq	16(%rbx), %rdi
	leaq	-32(%rbp), %rdx
	movq	%rax, %rsi
	callq	_power_supply_register_no_ws
	movl	%eax, 12(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	16(%rbx), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	movl	12(%rbx), %edi
	callq	_PTR_ERR
	jmp	LBB0_5
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_5
LBB0_4:
	movq	%rbx, %rdi
	callq	_bq27xxx_battery_settings
	movq	%rbx, %rdi
	callq	_bq27xxx_battery_update
	movq	_bq27xxx_list_lock@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	addq	$8, %rbx
	movq	_bq27xxx_battery_devices@GOTPCREL(%rip), %rsi
	movq	%rbx, %rdi
	callq	_list_add
	movq	%r14, %rdi
	callq	_mutex_unlock
	xorl	%eax, %eax
LBB0_5:
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_bq27xxx_battery_poll,4,2       ## @bq27xxx_battery_poll
	.comm	_bq27xxx_chip_data,8,3          ## @bq27xxx_chip_data
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_POWER_SUPPLY_TYPE_BATTERY,4,2  ## @POWER_SUPPLY_TYPE_BATTERY
	.comm	_bq27xxx_battery_get_property,4,2 ## @bq27xxx_battery_get_property
	.comm	_bq27xxx_external_power_changed,4,2 ## @bq27xxx_external_power_changed
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to register battery\n"

	.comm	_bq27xxx_list_lock,4,2          ## @bq27xxx_list_lock
	.comm	_bq27xxx_battery_devices,4,2    ## @bq27xxx_battery_devices
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bq27xxx_battery_setup          ; -- Begin function bq27xxx_battery_setup
	.p2align	2
_bq27xxx_battery_setup:                 ; @bq27xxx_battery_setup
	.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	x19, x0
	str	x0, [sp]
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
	str	w8, [sp, #8]
	add	x0, x0, #48
Lloh0:
	adrp	x8, _bq27xxx_battery_poll@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bq27xxx_battery_poll@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_INIT_DELAYED_WORK
	add	x0, x19, #44
	bl	_mutex_init
Lloh3:
	adrp	x20, _bq27xxx_chip_data@GOTPAGE
Lloh4:
	ldr	x20, [x20, _bq27xxx_chip_data@GOTPAGEOFF]
	ldr	x8, [x20]
	ldr	x9, [x19]
	mov	w10, #24
	madd	x8, x9, x10, x8
	ldur	q0, [x8, #8]
	stur	q0, [x19, #28]
	ldr	x0, [x19, #16]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	w1, #24
	bl	_devm_kzalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x1, x0
	ldr	w8, [x19, #24]
Lloh8:
	adrp	x9, _POWER_SUPPLY_TYPE_BATTERY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _POWER_SUPPLY_TYPE_BATTERY@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #16]
	ldr	x8, [x20]
	ldr	x9, [x19]
	mov	w10, #24
	mul	x9, x9, x10
	ldr	d0, [x8, x9]
	str	d0, [x0, #8]
Lloh11:
	adrp	x8, _bq27xxx_battery_get_property@GOTPAGE
Lloh12:
	ldr	x8, [x8, _bq27xxx_battery_get_property@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
Lloh14:
	adrp	x9, _bq27xxx_external_power_changed@GOTPAGE
Lloh15:
	ldr	x9, [x9, _bq27xxx_external_power_changed@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	stp	w9, w8, [x0]
	ldr	x0, [x19, #16]
	mov	x2, sp
	bl	_power_supply_register_no_ws
	str	w0, [x19, #12]
	bl	_IS_ERR
	cbz	x0, LBB0_4
; %bb.2:
	ldr	x0, [x19, #16]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	ldr	w0, [x19, #12]
	bl	_PTR_ERR
	b	LBB0_5
LBB0_3:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_5
LBB0_4:
	mov	x0, x19
	bl	_bq27xxx_battery_settings
	mov	x0, x19
	bl	_bq27xxx_battery_update
Lloh22:
	adrp	x20, _bq27xxx_list_lock@GOTPAGE
Lloh23:
	ldr	x20, [x20, _bq27xxx_list_lock@GOTPAGEOFF]
	mov	x0, x20
	bl	_mutex_lock
	add	x0, x19, #8
Lloh24:
	adrp	x1, _bq27xxx_battery_devices@GOTPAGE
Lloh25:
	ldr	x1, [x1, _bq27xxx_battery_devices@GOTPAGEOFF]
	bl	_list_add
	mov	x0, x20
	bl	_mutex_unlock
	mov	w0, #0
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_bq27xxx_battery_poll,4,2       ; @bq27xxx_battery_poll
	.comm	_bq27xxx_chip_data,8,3          ; @bq27xxx_chip_data
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_POWER_SUPPLY_TYPE_BATTERY,4,2  ; @POWER_SUPPLY_TYPE_BATTERY
	.comm	_bq27xxx_battery_get_property,4,2 ; @bq27xxx_battery_get_property
	.comm	_bq27xxx_external_power_changed,4,2 ; @bq27xxx_external_power_changed
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to register battery\n"

	.comm	_bq27xxx_list_lock,4,2          ; @bq27xxx_list_lock
	.comm	_bq27xxx_battery_devices,4,2    ; @bq27xxx_battery_devices
.subsections_via_symbols
