	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bq27xxx_battery_i2c_probe
_bq27xxx_battery_i2c_probe:             ## @bq27xxx_battery_i2c_probe
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	_battery_mutex@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_GFP_KERNEL@GOTPCREL(%rip), %r15
	movl	(%r15), %r8d
	movq	_battery_id@GOTPCREL(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_idr_alloc
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_mutex_unlock
	testl	%r13d, %r13d
	js	LBB0_11
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%rbx), %r14
	movl	(%r15), %esi
	movl	4(%r12), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movl	%r13d, %r8d
	callq	_devm_kasprintf
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	%rax, %rbx
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	$48, %esi
	callq	_devm_kzalloc
	testq	%rax, %rax
	je	LBB0_8
## %bb.3:
	movq	%rax, %r15
	movl	%r13d, (%rax)
	movq	%r14, 40(%rax)
	movl	(%r12), %eax
	movl	%eax, 36(%r15)
	movq	%rbx, 8(%r15)
	movq	_bq27xxx_battery_i2c_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 32(%r15)
	movq	_bq27xxx_battery_i2c_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r15)
	movq	_bq27xxx_battery_i2c_bulk_read@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%r15)
	movq	_bq27xxx_battery_i2c_bulk_write@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r15)
	movq	%r15, %rdi
	callq	_bq27xxx_battery_setup
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.4:
	movq	%r15, %rdi
	addq	$16, %rdi
	movq	_HZ@GOTPCREL(%rip), %rax
	imull	$60, (%rax), %esi
	callq	_schedule_delayed_work
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_i2c_set_clientdata
	movq	(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.6:
	movq	_bq27xxx_battery_irq_handler_thread@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_IRQF_ONESHOT@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	8(%r15), %r9
	movq	%r15, (%rsp)
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	xorl	%edx, %edx
	callq	_devm_request_threaded_irq
	testl	%eax, %eax
	je	LBB0_11
## %bb.7:
	movl	%eax, %ebx
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rdi
	movl	%ebx, %ecx
	callq	_dev_err
	jmp	LBB0_10
LBB0_8:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_9:
	movq	_battery_mutex@GOTPCREL(%rip), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	_battery_id@GOTPCREL(%rip), %rdi
	movl	%r13d, %esi
	callq	_idr_remove
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_10:
	movl	%ebx, %r13d
LBB0_11:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	xorl	%r13d, %r13d
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_battery_mutex,4,2              ## @battery_mutex
	.comm	_battery_id,4,2                 ## @battery_id
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s-%d"

	.comm	_bq27xxx_battery_i2c_read,4,2   ## @bq27xxx_battery_i2c_read
	.comm	_bq27xxx_battery_i2c_write,4,2  ## @bq27xxx_battery_i2c_write
	.comm	_bq27xxx_battery_i2c_bulk_read,4,2 ## @bq27xxx_battery_i2c_bulk_read
	.comm	_bq27xxx_battery_i2c_bulk_write,4,2 ## @bq27xxx_battery_i2c_bulk_write
	.comm	_HZ,4,2                         ## @HZ
	.comm	_bq27xxx_battery_irq_handler_thread,4,2 ## @bq27xxx_battery_irq_handler_thread
	.comm	_IRQF_ONESHOT,4,2               ## @IRQF_ONESHOT
L_.str.1:                               ## @.str.1
	.asciz	"Unable to register IRQ %d error %d\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_bq27xxx_battery_i2c_probe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bq27xxx_battery_i2c_probe
_bq27xxx_battery_i2c_probe:             ; @bq27xxx_battery_i2c_probe
	.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	x23, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _battery_mutex@GOTPAGE
Lloh1:
	ldr	x21, [x21, _battery_mutex@GOTPAGEOFF]
	mov	x0, x21
	bl	_mutex_lock
Lloh2:
	adrp	x22, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x22, [x22, _GFP_KERNEL@GOTPAGEOFF]
	ldr	w4, [x22]
Lloh4:
	adrp	x0, _battery_id@GOTPAGE
Lloh5:
	ldr	x0, [x0, _battery_id@GOTPAGEOFF]
	mov	x1, x19
	mov	w2, #0
	mov	w3, #0
	bl	_idr_alloc
	mov	x20, x0
	mov	x0, x21
	bl	_mutex_unlock
	tbnz	w20, #31, LBB0_9
; %bb.1:
	add	x21, x19, #8
	ldr	w1, [x22]
	ldr	w3, [x23, #4]
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x21
	mov	x4, x20
	bl	_devm_kasprintf
	cbz	x0, LBB0_7
; %bb.2:
	mov	x24, x0
	ldr	w2, [x22]
	mov	x0, x21
	mov	w1, #48
	bl	_devm_kzalloc
	cbz	x0, LBB0_7
; %bb.3:
	mov	x22, x0
	str	w20, [x0]
	str	x21, [x0, #40]
	ldr	w8, [x23]
	str	w8, [x0, #36]
	str	x24, [x0, #8]
Lloh8:
	adrp	x8, _bq27xxx_battery_i2c_read@GOTPAGE
Lloh9:
	ldr	x8, [x8, _bq27xxx_battery_i2c_read@GOTPAGEOFF]
Lloh10:
	adrp	x9, _bq27xxx_battery_i2c_write@GOTPAGE
Lloh11:
	ldr	x9, [x9, _bq27xxx_battery_i2c_write@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #28]
Lloh14:
	adrp	x8, _bq27xxx_battery_i2c_bulk_read@GOTPAGE
Lloh15:
	ldr	x8, [x8, _bq27xxx_battery_i2c_bulk_read@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
Lloh17:
	adrp	x9, _bq27xxx_battery_i2c_bulk_write@GOTPAGE
Lloh18:
	ldr	x9, [x9, _bq27xxx_battery_i2c_bulk_write@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #20]
	bl	_bq27xxx_battery_setup
	mov	x23, x0
	cbnz	w0, LBB0_8
; %bb.4:
	add	x0, x22, #16
Lloh20:
	adrp	x8, _HZ@GOTPAGE
Lloh21:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	mov	w9, #60
	mul	w1, w8, w9
	bl	_schedule_delayed_work
	mov	x0, x19
	mov	x1, x22
	bl	_i2c_set_clientdata
	ldr	x1, [x19]
	cbz	x1, LBB0_10
; %bb.5:
Lloh23:
	adrp	x8, _bq27xxx_battery_irq_handler_thread@GOTPAGE
Lloh24:
	ldr	x8, [x8, _bq27xxx_battery_irq_handler_thread@GOTPAGEOFF]
Lloh25:
	ldr	w3, [x8]
Lloh26:
	adrp	x8, _IRQF_ONESHOT@GOTPAGE
Lloh27:
	ldr	x8, [x8, _IRQF_ONESHOT@GOTPAGEOFF]
Lloh28:
	ldr	w4, [x8]
	ldr	x5, [x22, #8]
	mov	x0, x21
	mov	x2, #0
	mov	x6, x22
	bl	_devm_request_threaded_irq
	mov	x20, x0
	cbz	w0, LBB0_9
; %bb.6:
	ldr	x2, [x19]
Lloh29:
	adrp	x1, l_.str.1@PAGE
Lloh30:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x3, x20
	bl	_dev_err
	b	LBB0_9
LBB0_7:
Lloh31:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_8:
Lloh34:
	adrp	x19, _battery_mutex@GOTPAGE
Lloh35:
	ldr	x19, [x19, _battery_mutex@GOTPAGEOFF]
	mov	x0, x19
	bl	_mutex_lock
Lloh36:
	adrp	x0, _battery_id@GOTPAGE
Lloh37:
	ldr	x0, [x0, _battery_id@GOTPAGEOFF]
	mov	x1, x20
	bl	_idr_remove
	mov	x0, x19
	bl	_mutex_unlock
	mov	x20, x23
LBB0_9:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_10:
	mov	w20, #0
	b	LBB0_9
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_battery_mutex,4,2              ; @battery_mutex
	.comm	_battery_id,4,2                 ; @battery_id
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s-%d"

	.comm	_bq27xxx_battery_i2c_read,4,2   ; @bq27xxx_battery_i2c_read
	.comm	_bq27xxx_battery_i2c_write,4,2  ; @bq27xxx_battery_i2c_write
	.comm	_bq27xxx_battery_i2c_bulk_read,4,2 ; @bq27xxx_battery_i2c_bulk_read
	.comm	_bq27xxx_battery_i2c_bulk_write,4,2 ; @bq27xxx_battery_i2c_bulk_write
	.comm	_HZ,4,2                         ; @HZ
	.comm	_bq27xxx_battery_irq_handler_thread,4,2 ; @bq27xxx_battery_irq_handler_thread
	.comm	_IRQF_ONESHOT,4,2               ; @IRQF_ONESHOT
l_.str.1:                               ; @.str.1
	.asciz	"Unable to register IRQ %d error %d\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_bq27xxx_battery_i2c_probe
.subsections_via_symbols
