	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function aem_init_aem1_inst
_aem_init_aem1_inst:                    ## @aem_init_aem1_inst
	.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, %r15d
	movq	%rdi, %r12
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$64, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	movq	%rax, %rbx
	leaq	56(%rax), %rdi
	callq	_mutex_init
	movl	$1, (%rbx)
	movq	$0, 32(%rbx)
	movl	%r15d, 28(%rbx)
	movq	_AEM1_NUM_ENERGY_REGS@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_4
## %bb.2:
	movq	48(%rbx), %rcx
	xorl	%edx, %edx
	movq	_AEM_DEFAULT_POWER_INTERVAL@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	movl	%edi, (%rcx,%rdx,4)
	incq	%rdx
	movslq	(%rax), %rdi
	cmpq	%rdi, %rdx
	jl	LBB0_3
LBB0_4:
	leaq	4(%rbx), %r15
	movq	%r15, %rdi
	callq	_aem_idr_get
	testq	%rax, %rax
	jne	LBB0_16
## %bb.5:
	movq	_DRVNAME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	4(%rbx), %esi
	callq	_platform_device_alloc
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_15
## %bb.6:
	movq	_aem_driver@GOTPCREL(%rip), %rcx
	movq	%rcx, (%rax)
	movq	%rax, %rdi
	callq	_platform_device_add
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_14
## %bb.7:
	movq	8(%rbx), %rdi
	movq	%rbx, %rsi
	callq	_dev_set_drvdata
	leaq	16(%rbx), %r13
	movl	(%r12), %esi
	movl	4(%r12), %edx
	movq	%r13, %rdi
	callq	_aem_init_ipmi_data
	testq	%rax, %rax
	jne	LBB0_14
## %bb.8:
	movq	8(%rbx), %rdi
	callq	_hwmon_device_register
	movl	%eax, 24(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	movq	8(%rbx), %rdi
	movl	(%r12), %edx
	leaq	L_.str(%rip), %rsi
	callq	_dev_err
	jmp	LBB0_13
LBB0_10:
	movq	_update_aem1_sensors@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 44(%rbx)
	movq	%rbx, %rdi
	callq	_aem1_find_sensors
	testq	%rax, %rax
	je	LBB0_11
## %bb.12:
	movl	24(%rbx), %edi
	callq	_hwmon_device_unregister
LBB0_13:
	movl	(%r13), %edi
	callq	_ipmi_destroy_user
LBB0_14:
	movq	8(%rbx), %rdi
	xorl	%esi, %esi
	callq	_dev_set_drvdata
	movq	8(%rbx), %rdi
	callq	_platform_device_unregister
LBB0_15:
	movl	(%r15), %edi
	callq	_aem_idr_put
LBB0_16:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_17:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%rbx, %rdi
	addq	$40, %rdi
	movq	_driver_data@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	movl	(%rbx), %edx
	movl	20(%rbx), %edi
	movq	32(%rbx), %rcx
	movl	28(%rbx), %r8d
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_info
	xorl	%r14d, %r14d
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_AEM1_NUM_ENERGY_REGS,4,2       ## @AEM1_NUM_ENERGY_REGS
	.comm	_AEM_DEFAULT_POWER_INTERVAL,4,2 ## @AEM_DEFAULT_POWER_INTERVAL
	.comm	_DRVNAME,4,2                    ## @DRVNAME
	.comm	_aem_driver,4,2                 ## @aem_driver
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to register hwmon device for IPMI interface %d\n"

	.comm	_update_aem1_sensors,4,2        ## @update_aem1_sensors
	.comm	_driver_data,4,2                ## @driver_data
L_.str.1:                               ## @.str.1
	.asciz	"Found AEM v%d.%d at 0x%X\n"

	.no_dead_strip	_aem_init_aem1_inst
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function aem_init_aem1_inst
_aem_init_aem1_inst:                    ; @aem_init_aem1_inst
	.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	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w19, w8
Lloh3:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	w0, #64
	bl	_kzalloc
	cbz	x0, LBB0_16
; %bb.1:
	mov	x20, x0
	add	x0, x0, #56
	bl	_mutex_init
	mov	w8, #1
	str	w8, [x20]
	str	xzr, [x20, #32]
	str	w22, [x20, #28]
Lloh6:
	adrp	x8, _AEM1_NUM_ENERGY_REGS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AEM1_NUM_ENERGY_REGS@GOTPAGEOFF]
	ldr	w9, [x8]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.2:
	mov	x9, #0
	ldr	x10, [x20, #48]
Lloh8:
	adrp	x11, _AEM_DEFAULT_POWER_INTERVAL@GOTPAGE
Lloh9:
	ldr	x11, [x11, _AEM_DEFAULT_POWER_INTERVAL@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	str	w12, [x10, x9, lsl #2]
	add	x9, x9, #1
	ldrsw	x12, [x8]
	cmp	x9, x12
	b.lt	LBB0_3
LBB0_4:
	add	x22, x20, #4
	mov	x0, x22
	bl	_aem_idr_get
	cbnz	x0, LBB0_15
; %bb.5:
Lloh10:
	adrp	x8, _DRVNAME@GOTPAGE
Lloh11:
	ldr	x8, [x8, _DRVNAME@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	ldr	w1, [x20, #4]
	bl	_platform_device_alloc
	str	x0, [x20, #8]
	cbz	x0, LBB0_14
; %bb.6:
Lloh13:
	adrp	x8, _aem_driver@GOTPAGE
Lloh14:
	ldr	x8, [x8, _aem_driver@GOTPAGEOFF]
	str	x8, [x0]
	bl	_platform_device_add
	mov	x19, x0
	cbnz	w0, LBB0_13
; %bb.7:
	ldr	x0, [x20, #8]
	mov	x1, x20
	bl	_dev_set_drvdata
	add	x23, x20, #16
	ldp	w1, w2, [x21]
	mov	x0, x23
	bl	_aem_init_ipmi_data
	cbnz	x0, LBB0_13
; %bb.8:
	ldr	x0, [x20, #8]
	bl	_hwmon_device_register
	str	w0, [x20, #24]
	bl	_IS_ERR
	cbz	x0, LBB0_10
; %bb.9:
	ldr	x0, [x20, #8]
	ldr	w2, [x21]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_10:
Lloh17:
	adrp	x8, _update_aem1_sensors@GOTPAGE
Lloh18:
	ldr	x8, [x8, _update_aem1_sensors@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [x20, #44]
	mov	x0, x20
	bl	_aem1_find_sensors
	cbz	x0, LBB0_17
; %bb.11:
	ldr	w0, [x20, #24]
	bl	_hwmon_device_unregister
LBB0_12:
	ldr	w0, [x23]
	bl	_ipmi_destroy_user
LBB0_13:
	ldr	x0, [x20, #8]
	mov	x1, #0
	bl	_dev_set_drvdata
	ldr	x0, [x20, #8]
	bl	_platform_device_unregister
LBB0_14:
	ldr	w0, [x22]
	bl	_aem_idr_put
LBB0_15:
	mov	x0, x20
	bl	_kfree
LBB0_16:
	mov	x0, x19
	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_17:
	add	x0, x20, #40
Lloh20:
	adrp	x1, _driver_data@GOTPAGE
Lloh21:
	ldr	x1, [x1, _driver_data@GOTPAGEOFF]
	bl	_list_add_tail
	ldr	w0, [x20, #20]
	ldr	w2, [x20]
	ldr	x3, [x20, #32]
	ldr	w4, [x20, #28]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_info
	mov	w19, #0
	b	LBB0_16
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_AEM1_NUM_ENERGY_REGS,4,2       ; @AEM1_NUM_ENERGY_REGS
	.comm	_AEM_DEFAULT_POWER_INTERVAL,4,2 ; @AEM_DEFAULT_POWER_INTERVAL
	.comm	_DRVNAME,4,2                    ; @DRVNAME
	.comm	_aem_driver,4,2                 ; @aem_driver
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to register hwmon device for IPMI interface %d\n"

	.comm	_update_aem1_sensors,4,2        ; @update_aem1_sensors
	.comm	_driver_data,4,2                ; @driver_data
l_.str.1:                               ; @.str.1
	.asciz	"Found AEM v%d.%d at 0x%X\n"

	.no_dead_strip	_aem_init_aem1_inst
.subsections_via_symbols
