	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function thmc50_detect
_thmc50_detect:                         ## @thmc50_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, %r14
	movq	%rdi, %rbx
	movq	8(%rdi), %rdi
	movq	_I2C_FUNC_SMBUS_BYTE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	(%rbx), %r14d
	movq	8(%rbx), %rdi
	callq	_i2c_adapter_id
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%r14d, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_THMC50_REG_COMPANY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r14d
	movq	_THMC50_REG_DIE_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r15d
	movq	_THMC50_REG_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	cmpl	$192, %r15d
	jb	LBB0_5
## %bb.4:
	movl	%eax, %r13d
	andl	$16, %eax
	jne	LBB0_5
## %bb.6:
	cmpl	$73, %r14d
	je	LBB0_7
## %bb.8:
	cmpl	$65, %r14d
	jne	LBB0_17
## %bb.9:
	movq	8(%rbx), %rdi
	callq	_i2c_adapter_id
	movq	_adm1022_temp3_num@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str.2(%rip), %r14
	cmpl	$2, %ecx
	jl	LBB0_15
## %bb.10:
	movq	_adm1022_temp3@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	$1, %esi
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	addq	$2, %rsi
	cmpl	%ecx, %esi
	jge	LBB0_15
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%eax, -4(%rdx,%rsi,4)
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	(%rdx,%rsi,4), %edi
	cmpl	(%rbx), %edi
	jne	LBB0_14
## %bb.13:
	orl	$128, %r13d
	movq	_THMC50_REG_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r13d, %edx
	callq	_i2c_smbus_write_byte_data
	jmp	LBB0_15
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_7:
	leaq	L_.str.3(%rip), %r14
LBB0_15:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movl	%r15d, %edx
	shrl	$4, %edx
	addl	$-12, %edx
	andl	$15, %r15d
	leaq	L_.str.5(%rip), %rdi
	xorl	%r12d, %r12d
	movq	%r14, %rsi
	movl	%r15d, %ecx
	xorl	%eax, %eax
	callq	_pr_debug
	movl	(%rbx), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_strlcpy
	jmp	LBB0_16
LBB0_17:
	leaq	L_.str.4(%rip), %rdi
LBB0_2:
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_pr_debug
LBB0_5:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
LBB0_16:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ## @I2C_FUNC_SMBUS_BYTE_DATA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"thmc50: detect failed, smbus byte data not supported!\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
L_.str.1:                               ## @.str.1
	.asciz	"thmc50: Probing for THMC50 at 0x%2X on bus %d\n"

	.comm	_THMC50_REG_COMPANY_ID,4,2      ## @THMC50_REG_COMPANY_ID
	.comm	_THMC50_REG_DIE_CODE,4,2        ## @THMC50_REG_DIE_CODE
	.comm	_THMC50_REG_CONF,4,2            ## @THMC50_REG_CONF
L_.str.2:                               ## @.str.2
	.asciz	"adm1022"

	.comm	_adm1022_temp3_num,4,2          ## @adm1022_temp3_num
	.comm	_adm1022_temp3,8,3              ## @adm1022_temp3
L_.str.3:                               ## @.str.3
	.asciz	"thmc50"

L_.str.4:                               ## @.str.4
	.asciz	"thmc50: Detection of THMC50/ADM1022 failed\n"

L_.str.5:                               ## @.str.5
	.asciz	"thmc50: Detected %s (version %x, revision %x)\n"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function thmc50_detect
_thmc50_detect:                         ; @thmc50_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x1
	mov	x20, x0
	ldr	x0, [x0, #8]
Lloh0:
	adrp	x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_i2c_check_functionality
	cbz	w0, LBB0_11
; %bb.1:
	ldr	x0, [x20, #8]
	ldr	w21, [x20]
	bl	_i2c_adapter_id
                                        ; kill: def $w0 killed $w0 def $x0
	stp	x21, x0, [sp]
Lloh3:
	adrp	x0, l_.str.1@PAGE
Lloh4:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_pr_debug
Lloh5:
	adrp	x8, _THMC50_REG_COMPANY_ID@GOTPAGE
Lloh6:
	ldr	x8, [x8, _THMC50_REG_COMPANY_ID@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	mov	x22, x0
Lloh8:
	adrp	x8, _THMC50_REG_DIE_CODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _THMC50_REG_DIE_CODE@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	mov	x21, x0
Lloh11:
	adrp	x24, _THMC50_REG_CONF@GOTPAGE
Lloh12:
	ldr	x24, [x24, _THMC50_REG_CONF@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	and	w8, w0, #0x10
	cmp	w21, #192
	ccmp	w8, #0, #0, hs
	b.ne	LBB0_16
; %bb.2:
	cmp	w22, #73
	b.eq	LBB0_12
; %bb.3:
	cmp	w22, #65
	b.ne	LBB0_14
; %bb.4:
	mov	x23, x0
	ldr	x0, [x20, #8]
	bl	_i2c_adapter_id
Lloh13:
	adrp	x8, _adm1022_temp3_num@GOTPAGE
Lloh14:
	ldr	x8, [x8, _adm1022_temp3_num@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	cmp	w8, #2
	b.lt	LBB0_10
; %bb.5:
	mov	x9, #0
Lloh16:
	adrp	x10, _adm1022_temp3@GOTPAGE
Lloh17:
	ldr	x10, [x10, _adm1022_temp3@GOTPAGEOFF]
Lloh18:
	ldr	x10, [x10]
Lloh19:
	adrp	x22, l_.str.2@PAGE
Lloh20:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x9, x9, #2
	add	w11, w9, #1
	cmp	w11, w8
	b.ge	LBB0_13
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x9, lsl #2]
	cmp	w11, w0
	b.ne	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	add	x11, x10, x9, lsl #2
	ldr	w11, [x11, #4]
	ldr	w12, [x20]
	cmp	w11, w12
	b.ne	LBB0_6
; %bb.9:
	orr	w2, w23, #0x80
	ldr	w1, [x24]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
LBB0_10:
Lloh21:
	adrp	x22, l_.str.2@PAGE
Lloh22:
	add	x22, x22, l_.str.2@PAGEOFF
	b	LBB0_13
LBB0_11:
Lloh23:
	adrp	x0, l_.str@PAGE
Lloh24:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_15
LBB0_12:
Lloh25:
	adrp	x22, l_.str.3@PAGE
Lloh26:
	add	x22, x22, l_.str.3@PAGEOFF
LBB0_13:
	lsr	w8, w21, #4
	sub	w8, w8, #12
	and	w9, w21, #0xf
	stp	x8, x9, [sp, #8]
	str	x22, [sp]
Lloh27:
	adrp	x0, l_.str.5@PAGE
Lloh28:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_debug
	ldr	w0, [x19]
Lloh29:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh31:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_strlcpy
	mov	w0, #0
	b	LBB0_17
LBB0_14:
Lloh32:
	adrp	x0, l_.str.4@PAGE
Lloh33:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_15:
	bl	_pr_debug
LBB0_16:
Lloh34:
	adrp	x8, _ENODEV@GOTPAGE
Lloh35:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_17:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ; @I2C_FUNC_SMBUS_BYTE_DATA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"thmc50: detect failed, smbus byte data not supported!\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
l_.str.1:                               ; @.str.1
	.asciz	"thmc50: Probing for THMC50 at 0x%2X on bus %d\n"

	.comm	_THMC50_REG_COMPANY_ID,4,2      ; @THMC50_REG_COMPANY_ID
	.comm	_THMC50_REG_DIE_CODE,4,2        ; @THMC50_REG_DIE_CODE
	.comm	_THMC50_REG_CONF,4,2            ; @THMC50_REG_CONF
l_.str.2:                               ; @.str.2
	.asciz	"adm1022"

	.comm	_adm1022_temp3_num,4,2          ; @adm1022_temp3_num
	.comm	_adm1022_temp3,8,3              ; @adm1022_temp3
l_.str.3:                               ; @.str.3
	.asciz	"thmc50"

l_.str.4:                               ; @.str.4
	.asciz	"thmc50: Detection of THMC50/ADM1022 failed\n"

l_.str.5:                               ; @.str.5
	.asciz	"thmc50: Detected %s (version %x, revision %x)\n"

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