	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lm78_i2c_detect
_lm78_i2c_detect:                       ## @lm78_i2c_detect
	.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
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_lm78_data_if_isa
	movq	%rax, %r13
	movq	8(%rbx), %r12
	movl	(%rbx), %r15d
	movq	_I2C_FUNC_SMBUS_BYTE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_17
## %bb.1:
	testq	%r13, %r13
	je	LBB0_3
## %bb.2:
	movq	%r13, %rdi
	callq	_mutex_lock
LBB0_3:
	movq	_LM78_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	testb	$-128, %al
	jne	LBB0_14
## %bb.4:
	movq	_LM78_REG_I2C_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	cmpl	%r15d, %eax
	jne	LBB0_14
## %bb.5:
	movq	%rbx, %rdi
	movl	$79, %esi
	callq	_i2c_smbus_read_byte_data
	cmpl	$92, %eax
	je	LBB0_14
## %bb.6:
	cmpl	$163, %eax
	je	LBB0_14
## %bb.7:
	movq	_LM78_REG_CHIPID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	leaq	L_.str(%rip), %r14
	testl	%eax, %eax
	je	LBB0_12
## %bb.8:
	cmpl	$32, %eax
	je	LBB0_12
## %bb.9:
	cmpl	$64, %eax
	je	LBB0_12
## %bb.10:
	movl	%eax, %ecx
	andl	$254, %ecx
	cmpl	$192, %ecx
	jne	LBB0_14
## %bb.11:
	leaq	L_.str.1(%rip), %r14
LBB0_12:
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_lm78_alias_detect
	testq	%rax, %rax
	je	LBB0_20
## %bb.13:
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_dev_dbg
LBB0_14:
	testq	%r13, %r13
	je	LBB0_16
## %bb.15:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_16:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	jmp	LBB0_18
LBB0_17:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_18:
	subl	(%rax), %r14d
LBB0_19:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_20:
	testq	%r13, %r13
	je	LBB0_22
## %bb.21:
	movq	%r13, %rdi
	callq	_mutex_unlock
LBB0_22:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_strlcpy
	xorl	%r14d, %r14d
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ## @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_LM78_REG_CONFIG,4,2            ## @LM78_REG_CONFIG
	.comm	_LM78_REG_I2C_ADDR,4,2          ## @LM78_REG_I2C_ADDR
	.comm	_LM78_REG_CHIPID,4,2            ## @LM78_REG_CHIPID
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lm78"

L_.str.1:                               ## @.str.1
	.asciz	"lm79"

L_.str.2:                               ## @.str.2
	.asciz	"Device at 0x%02x appears to be the same as ISA device\n"

	.comm	_I2C_NAME_SIZE,4,2              ## @I2C_NAME_SIZE
	.no_dead_strip	_lm78_i2c_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lm78_i2c_detect
_lm78_i2c_detect:                       ; @lm78_i2c_detect
	.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	x20, x1
	mov	x23, x0
	bl	_lm78_data_if_isa
	mov	x19, x0
	ldr	x22, [x23, #8]
	ldr	w21, [x23]
Lloh0:
	adrp	x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_check_functionality
	cbz	w0, LBB0_16
; %bb.1:
	cbz	x19, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_mutex_lock
LBB0_3:
Lloh3:
	adrp	x8, _LM78_REG_CONFIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LM78_REG_CONFIG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #7, LBB0_14
; %bb.4:
Lloh6:
	adrp	x8, _LM78_REG_I2C_ADDR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _LM78_REG_I2C_ADDR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_i2c_smbus_read_byte_data
	cmp	w0, w21
	b.ne	LBB0_14
; %bb.5:
	mov	x0, x23
	mov	w1, #79
	bl	_i2c_smbus_read_byte_data
	cmp	w0, #92
	b.eq	LBB0_14
; %bb.6:
	cmp	w0, #163
	b.eq	LBB0_14
; %bb.7:
Lloh9:
	adrp	x8, _LM78_REG_CHIPID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _LM78_REG_CHIPID@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x23
	bl	_i2c_smbus_read_byte_data
	mov	x1, x0
Lloh12:
	adrp	x24, l_.str@PAGE
Lloh13:
	add	x24, x24, l_.str@PAGEOFF
	cbz	w0, LBB0_12
; %bb.8:
	cmp	w1, #32
	b.eq	LBB0_12
; %bb.9:
	cmp	w1, #64
	b.eq	LBB0_12
; %bb.10:
	and	w8, w1, #0xfe
	cmp	w8, #192
	b.ne	LBB0_14
; %bb.11:
Lloh14:
	adrp	x24, l_.str.1@PAGE
Lloh15:
	add	x24, x24, l_.str.1@PAGEOFF
LBB0_12:
	mov	x0, x23
	bl	_lm78_alias_detect
	cbz	x0, LBB0_18
; %bb.13:
Lloh16:
	adrp	x1, l_.str.2@PAGE
Lloh17:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x22
	mov	x2, x21
	bl	_dev_dbg
LBB0_14:
	cbz	x19, LBB0_16
; %bb.15:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_16:
Lloh18:
	adrp	x8, _ENODEV@GOTPAGE
Lloh19:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	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_18:
	cbz	x19, LBB0_20
; %bb.19:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_20:
	ldr	w0, [x20]
Lloh21:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
	mov	x1, x24
	bl	_strlcpy
	mov	w0, #0
	b	LBB0_17
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ; @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_LM78_REG_CONFIG,4,2            ; @LM78_REG_CONFIG
	.comm	_LM78_REG_I2C_ADDR,4,2          ; @LM78_REG_I2C_ADDR
	.comm	_LM78_REG_CHIPID,4,2            ; @LM78_REG_CHIPID
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lm78"

l_.str.1:                               ; @.str.1
	.asciz	"lm79"

l_.str.2:                               ; @.str.2
	.asciz	"Device at 0x%02x appears to be the same as ISA device\n"

	.comm	_I2C_NAME_SIZE,4,2              ; @I2C_NAME_SIZE
	.no_dead_strip	_lm78_i2c_detect
.subsections_via_symbols
