	.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	%rdx, %rbx
	movl	%esi, %r13d
	movq	%rdi, %r15
	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.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	(%r15), %ebx
	movq	8(%r15), %rdi
	callq	_i2c_adapter_id
	leaq	L_.str.1(%rip), %rdi
	xorl	%r12d, %r12d
	movl	%ebx, %esi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_THMC50_REG_COMPANY_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r14d
	movq	_THMC50_REG_DIE_CODE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ebx
	movq	_THMC50_REG_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%r13d, %r13d
	je	LBB0_3
## %bb.4:
	jns	LBB0_12
## %bb.5:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%r12d, %r12d
	subl	(%rcx), %r12d
	cmpl	$192, %ebx
	jb	LBB0_12
## %bb.6:
	movl	%eax, %ecx
	andl	$16, %ecx
	jne	LBB0_12
## %bb.7:
	cmpl	$65, %r14d
	je	LBB0_10
## %bb.8:
	cmpl	$73, %r14d
	jne	LBB0_12
## %bb.9:
	movq	_thmc50@GOTPCREL(%rip), %rcx
	jmp	LBB0_11
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%eax, %eax
	callq	_pr_debug
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r12d
	jmp	LBB0_23
LBB0_3:
	movq	_thmc50@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r13d
LBB0_12:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	addl	%r12d, %ecx
	jne	LBB0_14
## %bb.13:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_debug
	jmp	LBB0_23
LBB0_14:
	movq	_adm1022@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r13d
	jne	LBB0_15
## %bb.16:
	movl	%eax, %r14d
	movq	8(%r15), %rdi
	callq	_i2c_adapter_id
	movq	_adm1022_temp3_num@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	leaq	L_.str.3(%rip), %r13
	cmpl	$2, %ecx
	jl	LBB0_22
## %bb.17:
	movq	_adm1022_temp3@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movl	$1, %esi
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_18 Depth=1
	addq	$2, %rsi
	cmpl	%ecx, %esi
	jge	LBB0_22
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	cmpl	%eax, -4(%rdx,%rsi,4)
	jne	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	(%rdx,%rsi,4), %edi
	cmpl	(%r15), %edi
	jne	LBB0_21
## %bb.20:
	movl	%r14d, %edx
	orl	$128, %edx
	movq	_THMC50_REG_CONF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_write_byte_data
	jmp	LBB0_22
LBB0_15:
	leaq	L_.str.4(%rip), %r13
LBB0_22:
	movl	%ebx, %edx
	shrl	$4, %edx
	addl	$-12, %edx
	andl	$15, %ebx
	leaq	L_.str.5(%rip), %rdi
	xorl	%r12d, %r12d
	movq	%r13, %rsi
	movl	%ebx, %ecx
	xorl	%eax, %eax
	callq	_pr_debug
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rsi
	callq	_strlcpy
LBB0_23:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_adm1022@GOTPCREL(%rip), %rcx
LBB0_11:
	movl	(%rcx), %r13d
	xorl	%r12d, %r12d
	jmp	LBB0_12
	.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
	.comm	_thmc50,4,2                     ## @thmc50
	.comm	_adm1022,4,2                    ## @adm1022
L_.str.2:                               ## @.str.2
	.asciz	"thmc50: Detection of THMC50/ADM1022 failed\n"

L_.str.3:                               ## @.str.3
	.asciz	"adm1022"

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

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, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x2
	mov	x22, 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_4
; %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	x25, 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	x26, _THMC50_REG_CONF@GOTPAGE
Lloh12:
	ldr	x26, [x26, _THMC50_REG_CONF@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	mov	x23, x0
Lloh13:
	adrp	x8, _ENODEV@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
	cbz	w22, LBB0_8
; %bb.2:
	tbnz	w22, #31, LBB0_5
; %bb.3:
	mov	w24, #0
	b	LBB0_10
LBB0_4:
Lloh15:
	adrp	x0, l_.str@PAGE
Lloh16:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_debug
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w24, w8
	b	LBB0_22
LBB0_5:
	ldr	w9, [x8]
	neg	w24, w9
	and	w9, w23, #0x10
	cmp	w21, #192
	ccmp	w9, #0, #0, hs
	b.ne	LBB0_10
; %bb.6:
	cmp	w25, #65
	b.eq	LBB0_23
; %bb.7:
	cmp	w25, #73
	b.ne	LBB0_10
LBB0_8:
	mov	w24, #0
Lloh20:
	adrp	x9, _thmc50@GOTPAGE
Lloh21:
	ldr	x9, [x9, _thmc50@GOTPAGEOFF]
LBB0_9:
	ldr	w22, [x9]
LBB0_10:
	ldr	w8, [x8]
	cmn	w24, w8
	b.ne	LBB0_12
; %bb.11:
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_debug
	b	LBB0_22
LBB0_12:
Lloh24:
	adrp	x8, _adm1022@GOTPAGE
Lloh25:
	ldr	x8, [x8, _adm1022@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ne	LBB0_20
; %bb.13:
	ldr	x0, [x20, #8]
	bl	_i2c_adapter_id
Lloh27:
	adrp	x8, _adm1022_temp3_num@GOTPAGE
Lloh28:
	ldr	x8, [x8, _adm1022_temp3_num@GOTPAGEOFF]
Lloh29:
	ldr	w8, [x8]
	cmp	w8, #2
	b.lt	LBB0_19
; %bb.14:
	mov	x9, #0
Lloh30:
	adrp	x10, _adm1022_temp3@GOTPAGE
Lloh31:
	ldr	x10, [x10, _adm1022_temp3@GOTPAGEOFF]
Lloh32:
	ldr	x10, [x10]
Lloh33:
	adrp	x22, l_.str.3@PAGE
Lloh34:
	add	x22, x22, l_.str.3@PAGEOFF
	b	LBB0_16
LBB0_15:                                ;   in Loop: Header=BB0_16 Depth=1
	add	x9, x9, #2
	add	w11, w9, #1
	cmp	w11, w8
	b.ge	LBB0_21
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10, x9, lsl #2]
	cmp	w11, w0
	b.ne	LBB0_15
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	add	x11, x10, x9, lsl #2
	ldr	w11, [x11, #4]
	ldr	w12, [x20]
	cmp	w11, w12
	b.ne	LBB0_15
; %bb.18:
	orr	w2, w23, #0x80
	ldr	w1, [x26]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
LBB0_19:
Lloh35:
	adrp	x22, l_.str.3@PAGE
Lloh36:
	add	x22, x22, l_.str.3@PAGEOFF
	b	LBB0_21
LBB0_20:
Lloh37:
	adrp	x22, l_.str.4@PAGE
Lloh38:
	add	x22, x22, l_.str.4@PAGEOFF
LBB0_21:
	lsr	w8, w21, #4
	sub	w8, w8, #12
	and	w9, w21, #0xf
	stp	x8, x9, [sp, #8]
	str	x22, [sp]
Lloh39:
	adrp	x0, l_.str.5@PAGE
Lloh40:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_debug
	ldr	w0, [x19]
Lloh41:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh43:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_strlcpy
	mov	w24, #0
LBB0_22:
	mov	x0, x24
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_23:
	mov	w24, #0
Lloh44:
	adrp	x9, _adm1022@GOTPAGE
Lloh45:
	ldr	x9, [x9, _adm1022@GOTPAGEOFF]
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh39, Lloh40
	.loh AdrpLdrGot	Lloh44, Lloh45
	.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
	.comm	_thmc50,4,2                     ; @thmc50
	.comm	_adm1022,4,2                    ; @adm1022
l_.str.2:                               ; @.str.2
	.asciz	"thmc50: Detection of THMC50/ADM1022 failed\n"

l_.str.3:                               ; @.str.3
	.asciz	"adm1022"

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

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
