	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function w83795_detect
_w83795_detect:                         ## @w83795_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, %rbx
	movq	%rdi, %r15
	movq	8(%rdi), %r12
	movzwl	(%rdi), %r14d
	movq	_I2C_FUNC_SMBUS_BYTE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movq	_W83795_REG_BANKSEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	$-2147483524, %eax              ## imm = 0x8000007C
	je	LBB0_5
## %bb.3:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.1(%rip), %rcx
	jmp	LBB0_4
LBB0_5:
	movl	%eax, %r13d
	movq	_W83795_REG_VENDORID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	testb	$-128, %r13b
	movl	$163, %ecx
	movl	$92, %edx
	cmovel	%ecx, %edx
	cmpl	%edx, %eax
	jne	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	callq	_w83795_get_device_id
	movl	%eax, %ebx
	movq	_W83795_REG_CHIPID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	shll	$8, %eax
	movl	%ebx, %ecx
	andl	$-16, %ecx
	orl	%eax, %ecx
	cmpl	$31056, %ecx                    ## imm = 0x7950
	jne	LBB0_8
## %bb.9:
	testb	$7, %r13b
	je	LBB0_10
## %bb.12:
	movq	_W83795_REG_BANKSEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	andl	$-8, %r13d
	movq	%r15, %rdi
	movl	%r13d, %edx
	callq	_i2c_smbus_write_byte_data
	jmp	LBB0_13
LBB0_6:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.2(%rip), %rcx
	jmp	LBB0_4
LBB0_8:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.3(%rip), %rcx
LBB0_4:
	movq	%r12, %rdi
	movl	%r14d, %edx
	callq	_dev_dbg
LBB0_1:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_W83795_REG_I2C_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	andl	$127, %eax
	cmpl	%r14d, %eax
	jne	LBB0_11
LBB0_13:
	movq	_W83795_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_i2c_smbus_read_byte_data
	movq	_W83795_REG_CONFIG_CONFIG48@GOTPCREL(%rip), %rcx
	andl	(%rcx), %eax
	leaq	L_.str.6(%rip), %rax
	leaq	L_.str.5(%rip), %r15
	cmoveq	%rax, %r15
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rsi
	callq	_strlcpy
	andb	$15, %bl
	addb	$65, %bl
	movzbl	%bl, %ecx
	leaq	L_.str.7(%rip), %rsi
	movq	%r12, %rdi
	movq	%r15, %rdx
	movl	%r14d, %r8d
	callq	_dev_info
	xorl	%eax, %eax
	jmp	LBB0_14
LBB0_11:
	leaq	L_.str(%rip), %rsi
	leaq	L_.str.4(%rip), %rcx
	jmp	LBB0_4
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ## @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_W83795_REG_BANKSEL,4,2         ## @W83795_REG_BANKSEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"w83795: Detection failed at addr 0x%02hx, check %s\n"

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

	.comm	_W83795_REG_VENDORID,4,2        ## @W83795_REG_VENDORID
L_.str.2:                               ## @.str.2
	.asciz	"vendor id"

	.comm	_W83795_REG_CHIPID,4,2          ## @W83795_REG_CHIPID
L_.str.3:                               ## @.str.3
	.asciz	"device id\n"

	.comm	_W83795_REG_I2C_ADDR,4,2        ## @W83795_REG_I2C_ADDR
L_.str.4:                               ## @.str.4
	.asciz	"i2c addr"

	.comm	_W83795_REG_CONFIG,4,2          ## @W83795_REG_CONFIG
	.comm	_W83795_REG_CONFIG_CONFIG48,4,2 ## @W83795_REG_CONFIG_CONFIG48
L_.str.5:                               ## @.str.5
	.asciz	"w83795adg"

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

	.comm	_I2C_NAME_SIZE,4,2              ## @I2C_NAME_SIZE
L_.str.7:                               ## @.str.7
	.asciz	"Found %s rev. %c at 0x%02hx\n"

	.no_dead_strip	_w83795_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function w83795_detect
_w83795_detect:                         ; @w83795_detect
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x21, x1
	mov	x22, x0
	ldr	x20, [x0, #8]
	ldrh	w19, [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_10
; %bb.1:
Lloh3:
	adrp	x25, _W83795_REG_BANKSEL@GOTPAGE
Lloh4:
	ldr	x25, [x25, _W83795_REG_BANKSEL@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	mov	w8, #124
	movk	w8, #32768, lsl #16
	tst	w0, w8
	b.eq	LBB0_3
; %bb.2:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
Lloh7:
	adrp	x3, l_.str.1@PAGE
Lloh8:
	add	x3, x3, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_3:
	mov	x24, x0
Lloh9:
	adrp	x8, _W83795_REG_VENDORID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _W83795_REG_VENDORID@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	tst	w24, #0x80
	mov	w8, #92
	mov	w9, #163
	csel	w8, w9, w8, eq
	cmp	w0, w8
	b.ne	LBB0_7
; %bb.4:
	mov	x0, x22
	bl	_w83795_get_device_id
	mov	x23, x0
Lloh12:
	adrp	x8, _W83795_REG_CHIPID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _W83795_REG_CHIPID@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	and	w8, w23, #0xfffffff0
	orr	w8, w8, w0, lsl #8
	mov	w9, #31056
	cmp	w8, w9
	b.ne	LBB0_8
; %bb.5:
	tst	w24, #0x7
	b.eq	LBB0_12
; %bb.6:
	ldr	w1, [x25]
	and	w2, w24, #0xfffffff8
	mov	x0, x22
	bl	_i2c_smbus_write_byte_data
	b	LBB0_13
LBB0_7:
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
Lloh17:
	adrp	x3, l_.str.2@PAGE
Lloh18:
	add	x3, x3, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
Lloh21:
	adrp	x3, l_.str.3@PAGE
Lloh22:
	add	x3, x3, l_.str.3@PAGEOFF
LBB0_9:
	mov	x0, x20
	mov	x2, x19
	bl	_dev_dbg
LBB0_10:
Lloh23:
	adrp	x8, _ENODEV@GOTPAGE
Lloh24:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_11:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_12:
Lloh26:
	adrp	x8, _W83795_REG_I2C_ADDR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _W83795_REG_I2C_ADDR@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	and	w8, w0, #0x7f
	cmp	w8, w19
	b.ne	LBB0_14
LBB0_13:
Lloh29:
	adrp	x8, _W83795_REG_CONFIG@GOTPAGE
Lloh30:
	ldr	x8, [x8, _W83795_REG_CONFIG@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
Lloh32:
	adrp	x8, _W83795_REG_CONFIG_CONFIG48@GOTPAGE
Lloh33:
	ldr	x8, [x8, _W83795_REG_CONFIG_CONFIG48@GOTPAGEOFF]
Lloh34:
	ldr	w8, [x8]
Lloh35:
	adrp	x9, l_.str.5@PAGE
Lloh36:
	add	x9, x9, l_.str.5@PAGEOFF
Lloh37:
	adrp	x10, l_.str.6@PAGE
Lloh38:
	add	x10, x10, l_.str.6@PAGEOFF
	tst	w8, w0
	csel	x22, x10, x9, eq
	ldr	w0, [x21]
Lloh39:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh40:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh41:
	ldr	w2, [x8]
	mov	x1, x22
	bl	_strlcpy
	and	w8, w23, #0xf
	add	w3, w8, #65
Lloh42:
	adrp	x1, l_.str.7@PAGE
Lloh43:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x0, x20
	mov	x2, x22
	mov	x4, x19
	bl	_dev_info
	mov	w0, #0
	b	LBB0_11
LBB0_14:
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
Lloh46:
	adrp	x3, l_.str.4@PAGE
Lloh47:
	add	x3, x3, l_.str.4@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpAdd	Lloh44, Lloh45
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ; @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_W83795_REG_BANKSEL,4,2         ; @W83795_REG_BANKSEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"w83795: Detection failed at addr 0x%02hx, check %s\n"

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

	.comm	_W83795_REG_VENDORID,4,2        ; @W83795_REG_VENDORID
l_.str.2:                               ; @.str.2
	.asciz	"vendor id"

	.comm	_W83795_REG_CHIPID,4,2          ; @W83795_REG_CHIPID
l_.str.3:                               ; @.str.3
	.asciz	"device id\n"

	.comm	_W83795_REG_I2C_ADDR,4,2        ; @W83795_REG_I2C_ADDR
l_.str.4:                               ; @.str.4
	.asciz	"i2c addr"

	.comm	_W83795_REG_CONFIG,4,2          ; @W83795_REG_CONFIG
	.comm	_W83795_REG_CONFIG_CONFIG48,4,2 ; @W83795_REG_CONFIG_CONFIG48
l_.str.5:                               ; @.str.5
	.asciz	"w83795adg"

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

	.comm	_I2C_NAME_SIZE,4,2              ; @I2C_NAME_SIZE
l_.str.7:                               ; @.str.7
	.asciz	"Found %s rev. %c at 0x%02hx\n"

	.no_dead_strip	_w83795_detect
.subsections_via_symbols
