	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function adm9240_detect
_adm9240_detect:                        ## @adm9240_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	%rdx, %r14
	movl	%esi, %ebx
	movq	%rdi, %r12
	movq	8(%rdi), %r15
	movl	(%rdi), %r13d
	movq	_I2C_FUNC_SMBUS_BYTE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	testl	%ebx, %ebx
	movq	_adm9240@GOTPCREL(%rip), %rcx
	movl	(%rcx), %eax
	cmovel	%eax, %ebx
	testl	%ebx, %ebx
	js	LBB0_3
## %bb.12:
	cmpl	%eax, %ebx
	jne	LBB0_14
LBB0_13:
	leaq	L_.str.7(%rip), %rsi
	jmp	LBB0_17
LBB0_3:
	movq	%rcx, %rbx
	movq	_ADM9240_REG_I2C_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	cmpl	%r13d, %eax
	jne	LBB0_4
## %bb.6:
	movq	_ADM9240_REG_MAN_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r13d
	movq	%rbx, %rcx
	movq	%rbx, %rax
	cmpl	$35, %r13d
	je	LBB0_11
## %bb.7:
	cmpl	$218, %r13d
	je	LBB0_8
## %bb.9:
	cmpl	$1, %r13d
	jne	LBB0_19
## %bb.10:
	movq	_lm81@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_4:
	leaq	L_.str.1(%rip), %rsi
LBB0_5:
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_dev_err
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_18
LBB0_8:
	movq	_ds1780@GOTPCREL(%rip), %rax
LBB0_11:
	movl	(%rax), %ebx
	movq	_ADM9240_REG_DIE_REV@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movq	%rcx, %r12
	callq	_i2c_smbus_read_byte_data
	cmpl	$218, %r13d
	leaq	L_.str.5(%rip), %rcx
	leaq	L_.str.6(%rip), %rsi
	cmoveq	%rcx, %rsi
	cmpl	$35, %r13d
	leaq	L_.str.4(%rip), %rdx
	cmovneq	%rsi, %rdx
	leaq	L_.str.3(%rip), %rsi
	movq	%r15, %rdi
	movl	%eax, %ecx
	callq	_dev_info
	movl	(%r12), %eax
	cmpl	%eax, %ebx
	je	LBB0_13
LBB0_14:
	movq	_ds1780@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_16
## %bb.15:
	leaq	L_.str.8(%rip), %rsi
	jmp	LBB0_17
LBB0_16:
	movq	_lm81@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	leaq	L_.str.9(%rip), %rax
	leaq	L_.str(%rip), %rsi
	cmoveq	%rax, %rsi
LBB0_17:
	movl	(%r14), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_strlcpy
	xorl	%eax, %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_5
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ## @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_adm9240,4,2                    ## @adm9240
	.comm	_ADM9240_REG_I2C_ADDR,4,2       ## @ADM9240_REG_I2C_ADDR
L_.str.1:                               ## @.str.1
	.asciz	"detect fail: address match, 0x%02x\n"

	.comm	_ADM9240_REG_MAN_ID,4,2         ## @ADM9240_REG_MAN_ID
	.comm	_ds1780,4,2                     ## @ds1780
	.comm	_lm81,4,2                       ## @lm81
L_.str.2:                               ## @.str.2
	.asciz	"detect fail: unknown manuf, 0x%02x\n"

	.comm	_ADM9240_REG_DIE_REV,4,2        ## @ADM9240_REG_DIE_REV
L_.str.3:                               ## @.str.3
	.asciz	"found %s revision %u\n"

L_.str.4:                               ## @.str.4
	.asciz	"ADM9240"

L_.str.5:                               ## @.str.5
	.asciz	"DS1780"

L_.str.6:                               ## @.str.6
	.asciz	"LM81"

L_.str.7:                               ## @.str.7
	.asciz	"adm9240"

L_.str.8:                               ## @.str.8
	.asciz	"ds1780"

L_.str.9:                               ## @.str.9
	.asciz	"lm81"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function adm9240_detect
_adm9240_detect:                        ; @adm9240_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	x19, x2
	mov	x23, x1
	mov	x21, x0
	ldr	x20, [x0, #8]
	ldr	w22, [x0]
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, x20
	bl	_i2c_check_functionality
	cbz	w0, LBB0_11
; %bb.1:
Lloh3:
	adrp	x8, _adm9240@GOTPAGE
Lloh4:
	ldr	x8, [x8, _adm9240@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w23, #0
	csel	w23, w8, w23, eq
	tbnz	w23, #31, LBB0_4
; %bb.2:
	cmp	w23, w8
	b.ne	LBB0_14
LBB0_3:
Lloh6:
	adrp	x1, l_.str.7@PAGE
Lloh7:
	add	x1, x1, l_.str.7@PAGEOFF
	b	LBB0_17
LBB0_4:
Lloh8:
	adrp	x8, _ADM9240_REG_I2C_ADDR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ADM9240_REG_I2C_ADDR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_byte_data
	cmp	w0, w22
	b.ne	LBB0_9
; %bb.5:
Lloh11:
	adrp	x8, _ADM9240_REG_MAN_ID@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ADM9240_REG_MAN_ID@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_byte_data
	mov	x22, x0
Lloh14:
	adrp	x24, _adm9240@GOTPAGE
Lloh15:
	ldr	x24, [x24, _adm9240@GOTPAGEOFF]
	mov	x8, x24
	cmp	w0, #35
	b.eq	LBB0_13
; %bb.6:
	cmp	w22, #218
	b.eq	LBB0_12
; %bb.7:
	cmp	w22, #1
	b.ne	LBB0_19
; %bb.8:
Lloh16:
	adrp	x8, _lm81@GOTPAGE
Lloh17:
	ldr	x8, [x8, _lm81@GOTPAGEOFF]
	b	LBB0_13
LBB0_9:
Lloh18:
	adrp	x1, l_.str.1@PAGE
Lloh19:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_10:
	mov	x0, x20
	mov	x2, x22
	bl	_dev_err
LBB0_11:
Lloh20:
	adrp	x8, _ENODEV@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_18
LBB0_12:
Lloh23:
	adrp	x8, _ds1780@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ds1780@GOTPAGEOFF]
LBB0_13:
	ldr	w23, [x8]
Lloh25:
	adrp	x8, _ADM9240_REG_DIE_REV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ADM9240_REG_DIE_REV@GOTPAGEOFF]
Lloh27:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_byte_data
	mov	x3, x0
Lloh28:
	adrp	x8, l_.str.6@PAGE
Lloh29:
	add	x8, x8, l_.str.6@PAGEOFF
Lloh30:
	adrp	x9, l_.str.5@PAGE
Lloh31:
	add	x9, x9, l_.str.5@PAGEOFF
	cmp	w22, #218
	csel	x8, x9, x8, eq
Lloh32:
	adrp	x9, l_.str.4@PAGE
Lloh33:
	add	x9, x9, l_.str.4@PAGEOFF
	cmp	w22, #35
	csel	x2, x9, x8, eq
Lloh34:
	adrp	x1, l_.str.3@PAGE
Lloh35:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x20
	bl	_dev_info
	ldr	w8, [x24]
	cmp	w23, w8
	b.eq	LBB0_3
LBB0_14:
Lloh36:
	adrp	x8, _ds1780@GOTPAGE
Lloh37:
	ldr	x8, [x8, _ds1780@GOTPAGEOFF]
Lloh38:
	ldr	w8, [x8]
	cmp	w23, w8
	b.ne	LBB0_16
; %bb.15:
Lloh39:
	adrp	x1, l_.str.8@PAGE
Lloh40:
	add	x1, x1, l_.str.8@PAGEOFF
	b	LBB0_17
LBB0_16:
Lloh41:
	adrp	x8, _lm81@GOTPAGE
Lloh42:
	ldr	x8, [x8, _lm81@GOTPAGEOFF]
Lloh43:
	ldr	w8, [x8]
Lloh44:
	adrp	x9, l_.str@PAGE
Lloh45:
	add	x9, x9, l_.str@PAGEOFF
Lloh46:
	adrp	x10, l_.str.9@PAGE
Lloh47:
	add	x10, x10, l_.str.9@PAGEOFF
	cmp	w23, w8
	csel	x1, x10, x9, eq
LBB0_17:
	ldr	w0, [x19]
Lloh48:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh49:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh50:
	ldr	w2, [x8]
	bl	_strlcpy
	mov	w0, #0
LBB0_18:
	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_19:
Lloh51:
	adrp	x1, l_.str.2@PAGE
Lloh52:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_10
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.loh AdrpAdd	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ; @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_adm9240,4,2                    ; @adm9240
	.comm	_ADM9240_REG_I2C_ADDR,4,2       ; @ADM9240_REG_I2C_ADDR
l_.str.1:                               ; @.str.1
	.asciz	"detect fail: address match, 0x%02x\n"

	.comm	_ADM9240_REG_MAN_ID,4,2         ; @ADM9240_REG_MAN_ID
	.comm	_ds1780,4,2                     ; @ds1780
	.comm	_lm81,4,2                       ; @lm81
l_.str.2:                               ; @.str.2
	.asciz	"detect fail: unknown manuf, 0x%02x\n"

	.comm	_ADM9240_REG_DIE_REV,4,2        ; @ADM9240_REG_DIE_REV
l_.str.3:                               ; @.str.3
	.asciz	"found %s revision %u\n"

l_.str.4:                               ; @.str.4
	.asciz	"ADM9240"

l_.str.5:                               ; @.str.5
	.asciz	"DS1780"

l_.str.6:                               ; @.str.6
	.asciz	"LM81"

l_.str.7:                               ; @.str.7
	.asciz	"adm9240"

l_.str.8:                               ; @.str.8
	.asciz	"ds1780"

l_.str.9:                               ; @.str.9
	.asciz	"lm81"

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