	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ibmpex_register_bmc
_ibmpex_register_bmc:                   ## @ibmpex_register_bmc
	.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	%rsi, %r15
	movl	%edi, %r12d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$80, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	movq	%rax, %rbx
	movq	_IPMI_SYSTEM_INTERFACE_ADDR_TYPE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 76(%rbx)
	movq	_IPMI_BMC_CHANNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 72(%rbx)
	movq	64(%rbx), %rax
	movq	$0, (%rax)
	movl	%r12d, (%rbx)
	movq	%r15, 16(%rbx)
	leaq	4(%rbx), %r14
	movq	_driver_data@GOTPCREL(%rip), %rsi
	addq	$4, %rsi
	movl	%r12d, %edi
	movq	%rbx, %rdx
	movq	%r14, %rcx
	callq	_ipmi_create_user
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	leaq	56(%rbx), %rdi
	callq	_mutex_init
	movq	$0, 48(%rbx)
	leaq	44(%rbx), %rdi
	callq	_init_completion
	movq	_PEX_NET_FUNCTION@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 40(%rbx)
	movq	_PEX_COMMAND@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 36(%rbx)
	movl	28(%rbx), %eax
	movl	%eax, 32(%rbx)
	movq	%rbx, %rdi
	callq	_ibmpex_ver_check
	testl	%eax, %eax
	jne	LBB0_8
## %bb.4:
	movq	16(%rbx), %rdi
	callq	_hwmon_device_register
	movl	%eax, 8(%rbx)
	movl	%eax, %edi
	callq	_IS_ERR
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	16(%rbx), %rdi
	movl	(%rbx), %edx
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_8
LBB0_11:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dev_err                        ## TAILCALL
LBB0_2:
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_9
LBB0_6:
	movq	%r15, %rdi
	movq	%rbx, %rsi
	callq	_dev_set_drvdata
	movq	%rbx, %rdi
	addq	$24, %rdi
	movq	_driver_data@GOTPCREL(%rip), %rsi
	callq	_list_add_tail
	movq	%rbx, %rdi
	callq	_ibmpex_find_sensors
	testl	%eax, %eax
	je	LBB0_10
## %bb.7:
	movq	16(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_dev_err
	movl	8(%rbx), %edi
	callq	_hwmon_device_unregister
LBB0_8:
	movl	(%r14), %edi
	callq	_ipmi_destroy_user
LBB0_9:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_10:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Insufficient memory for BMC interface.\n"

	.comm	_IPMI_SYSTEM_INTERFACE_ADDR_TYPE,4,2 ## @IPMI_SYSTEM_INTERFACE_ADDR_TYPE
	.comm	_IPMI_BMC_CHANNEL,4,2           ## @IPMI_BMC_CHANNEL
	.comm	_driver_data,8,2                ## @driver_data
L_.str.1:                               ## @.str.1
	.asciz	"Unable to register user with IPMI interface %d\n"

	.comm	_PEX_NET_FUNCTION,4,2           ## @PEX_NET_FUNCTION
	.comm	_PEX_COMMAND,4,2                ## @PEX_COMMAND
L_.str.2:                               ## @.str.2
	.asciz	"Unable to register hwmon device for IPMI interface %d\n"

L_.str.3:                               ## @.str.3
	.asciz	"Error %d finding sensors\n"

	.no_dead_strip	_ibmpex_register_bmc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ibmpex_register_bmc
_ibmpex_register_bmc:                   ; @ibmpex_register_bmc
	.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	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #80
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
Lloh3:
	adrp	x8, _IPMI_SYSTEM_INTERFACE_ADDR_TYPE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _IPMI_SYSTEM_INTERFACE_ADDR_TYPE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _IPMI_BMC_CHANNEL@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IPMI_BMC_CHANNEL@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [x0, #72]
	ldr	x8, [x0, #64]
	str	xzr, [x8]
	str	w22, [x0]
	str	x21, [x0, #16]
	add	x20, x0, #4
Lloh9:
	adrp	x8, _driver_data@GOTPAGE
Lloh10:
	ldr	x8, [x8, _driver_data@GOTPAGEOFF]
	add	x1, x8, #4
	mov	x0, x22
	mov	x2, x19
	mov	x3, x20
	bl	_ipmi_create_user
	tbnz	w0, #31, LBB0_6
; %bb.2:
	add	x0, x19, #56
	bl	_mutex_init
	str	xzr, [x19, #48]
	add	x0, x19, #44
	bl	_init_completion
Lloh11:
	adrp	x8, _PEX_NET_FUNCTION@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PEX_NET_FUNCTION@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	str	w8, [x19, #40]
Lloh14:
	adrp	x8, _PEX_COMMAND@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PEX_COMMAND@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x19, #28]
	stp	w9, w8, [x19, #32]
	mov	x0, x19
	bl	_ibmpex_ver_check
	cbnz	w0, LBB0_9
; %bb.3:
	ldr	x0, [x19, #16]
	bl	_hwmon_device_register
	str	w0, [x19, #8]
	bl	_IS_ERR
	cbz	x0, LBB0_7
; %bb.4:
	ldr	x0, [x19, #16]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_dev_err
	b	LBB0_9
LBB0_5:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	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
	b	_dev_err
LBB0_6:
	ldr	w8, [x19]
	str	x8, [sp]
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_dev_err
	b	LBB0_10
LBB0_7:
	mov	x0, x21
	mov	x1, x19
	bl	_dev_set_drvdata
	add	x0, x19, #24
Lloh23:
	adrp	x1, _driver_data@GOTPAGE
Lloh24:
	ldr	x1, [x1, _driver_data@GOTPAGEOFF]
	bl	_list_add_tail
	mov	x0, x19
	bl	_ibmpex_find_sensors
                                        ; kill: def $w0 killed $w0 def $x0
	cbz	w0, LBB0_11
; %bb.8:
	ldr	x8, [x19, #16]
	str	x0, [sp]
Lloh25:
	adrp	x1, l_.str.3@PAGE
Lloh26:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x8
	bl	_dev_err
	ldr	w0, [x19, #8]
	bl	_hwmon_device_unregister
LBB0_9:
	ldr	w0, [x20]
	bl	_ipmi_destroy_user
LBB0_10:
	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
	add	sp, sp, #64
	b	_kfree
LBB0_11:
	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 AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Insufficient memory for BMC interface.\n"

	.comm	_IPMI_SYSTEM_INTERFACE_ADDR_TYPE,4,2 ; @IPMI_SYSTEM_INTERFACE_ADDR_TYPE
	.comm	_IPMI_BMC_CHANNEL,4,2           ; @IPMI_BMC_CHANNEL
	.comm	_driver_data,8,2                ; @driver_data
l_.str.1:                               ; @.str.1
	.asciz	"Unable to register user with IPMI interface %d\n"

	.comm	_PEX_NET_FUNCTION,4,2           ; @PEX_NET_FUNCTION
	.comm	_PEX_COMMAND,4,2                ; @PEX_COMMAND
l_.str.2:                               ; @.str.2
	.asciz	"Unable to register hwmon device for IPMI interface %d\n"

l_.str.3:                               ; @.str.3
	.asciz	"Error %d finding sensors\n"

	.no_dead_strip	_ibmpex_register_bmc
.subsections_via_symbols
