	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function w83781d_detect
_w83781d_detect:                        ## @w83781d_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
	subq	$24, %rsp
	.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, %r12
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_w83781d_data_if_isa
	movq	%rax, %r15
	movq	8(%r12), %r13
	movl	(%r12), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_I2C_FUNC_SMBUS_BYTE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_15
## %bb.1:
	testq	%r15, %r15
	je	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_mutex_lock
LBB0_3:
	movq	_W83781D_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	testb	$-128, %al
	jne	LBB0_16
## %bb.4:
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movq	_W83781D_REG_BANK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r14d
	movq	_W83781D_REG_CHIPMAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	testb	$7, %r14b
	je	LBB0_17
LBB0_5:
	testb	$-128, %r14b
	jne	LBB0_7
## %bb.6:
	cmpl	$163, %eax
	je	LBB0_9
LBB0_7:
	testb	$-128, %r14b
	je	LBB0_10
## %bb.8:
	cmpl	$92, %eax
	jne	LBB0_10
LBB0_9:
	movq	_W83781D_REG_I2C_ADDR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jne	LBB0_20
LBB0_10:
	movl	(%rbx), %ebx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_i2c_smbus_read_byte_data
                                        ## kill: def $eax killed $eax def $rax
	andl	$120, %eax
	leal	128(%rax), %edx
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_i2c_smbus_write_byte_data
	movq	_W83781D_REG_CHIPMAN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r14d
	cmpl	$18, %eax
	je	LBB0_12
## %bb.11:
	cmpl	$92, %r14d
	jne	LBB0_24
LBB0_12:
	movq	_W83781D_REG_WCHIPID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %ecx
	andl	$-2, %ecx
	cmpl	$16, %ecx
	jne	LBB0_31
## %bb.13:
	cmpl	$92, %r14d
	jne	LBB0_31
## %bb.14:
	leaq	L_.str.4(%rip), %r14
	jmp	LBB0_34
LBB0_15:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	jmp	LBB0_29
LBB0_16:
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_25
LBB0_17:
	testb	$-128, %r14b
	jne	LBB0_21
## %bb.18:
	cmpl	$163, %eax
	je	LBB0_5
## %bb.19:
	cmpl	$195, %eax
	je	LBB0_5
	jmp	LBB0_23
LBB0_20:
	leaq	L_.str.2(%rip), %rsi
	jmp	LBB0_25
LBB0_21:
	cmpl	$18, %eax
	je	LBB0_5
## %bb.22:
	cmpl	$92, %eax
	je	LBB0_5
LBB0_23:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_25
LBB0_24:
	leaq	L_.str.3(%rip), %rsi
LBB0_25:
	movq	%r13, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_26:
	testq	%r15, %r15
	je	LBB0_28
## %bb.27:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_28:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
LBB0_29:
	subl	(%rax), %ebx
LBB0_30:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_31:
	cmpl	$48, %eax
	jne	LBB0_36
## %bb.32:
	cmpl	$92, %r14d
	jne	LBB0_36
## %bb.33:
	leaq	L_.str.5(%rip), %r14
LBB0_34:
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_w83781d_alias_detect
	testq	%rax, %rax
	je	LBB0_42
## %bb.35:
	leaq	L_.str.8(%rip), %rsi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_26
LBB0_36:
	cmpl	$64, %eax
	jne	LBB0_40
## %bb.37:
	cmpl	$92, %r14d
	jne	LBB0_40
## %bb.38:
	cmpl	$45, -44(%rbp)                  ## 4-byte Folded Reload
	jne	LBB0_40
## %bb.39:
	leaq	L_.str.6(%rip), %r14
	jmp	LBB0_42
LBB0_40:
	cmpl	$49, %eax
	jne	LBB0_26
## %bb.41:
	leaq	L_.str.7(%rip), %r14
LBB0_42:
	testq	%r15, %r15
	je	LBB0_44
## %bb.43:
	movq	%r15, %rdi
	callq	_mutex_unlock
LBB0_44:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	callq	_strlcpy
	xorl	%ebx, %ebx
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ## @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_W83781D_REG_CONFIG,4,2         ## @W83781D_REG_CONFIG
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Detection of w83781d chip failed at step 3\n"

	.comm	_W83781D_REG_BANK,4,2           ## @W83781D_REG_BANK
	.comm	_W83781D_REG_CHIPMAN,4,2        ## @W83781D_REG_CHIPMAN
L_.str.1:                               ## @.str.1
	.asciz	"Detection of w83781d chip failed at step 4\n"

	.comm	_W83781D_REG_I2C_ADDR,4,2       ## @W83781D_REG_I2C_ADDR
L_.str.2:                               ## @.str.2
	.asciz	"Detection of w83781d chip failed at step 5\n"

L_.str.3:                               ## @.str.3
	.asciz	"w83781d chip vendor is neither Winbond nor Asus\n"

	.comm	_W83781D_REG_WCHIPID,4,2        ## @W83781D_REG_WCHIPID
L_.str.4:                               ## @.str.4
	.asciz	"w83781d"

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

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

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

L_.str.8:                               ## @.str.8
	.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	_w83781d_detect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function w83781d_detect
_w83781d_detect:                        ; @w83781d_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x20, x1
	mov	x22, x0
	bl	_w83781d_data_if_isa
	mov	x19, x0
	ldr	x21, [x22, #8]
	ldr	w24, [x22]
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, x21
	bl	_i2c_check_functionality
	cbz	w0, LBB0_32
; %bb.1:
	cbz	x19, LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_mutex_lock
LBB0_3:
Lloh3:
	adrp	x8, _W83781D_REG_CONFIG@GOTPAGE
Lloh4:
	ldr	x8, [x8, _W83781D_REG_CONFIG@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #7, LBB0_15
; %bb.4:
Lloh6:
	adrp	x26, _W83781D_REG_BANK@GOTPAGE
Lloh7:
	ldr	x26, [x26, _W83781D_REG_BANK@GOTPAGEOFF]
	ldr	w1, [x26]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	mov	x23, x0
Lloh8:
	adrp	x25, _W83781D_REG_CHIPMAN@GOTPAGE
Lloh9:
	ldr	x25, [x25, _W83781D_REG_CHIPMAN@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	tst	w23, #0x7
	b.eq	LBB0_16
LBB0_5:
	tbnz	w23, #7, LBB0_7
; %bb.6:
	cmp	w0, #163
	b.eq	LBB0_9
LBB0_7:
	tbz	w23, #7, LBB0_10
; %bb.8:
	cmp	w0, #92
	b.ne	LBB0_10
LBB0_9:
Lloh10:
	adrp	x8, _W83781D_REG_I2C_ADDR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _W83781D_REG_I2C_ADDR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	cmp	w0, w24
	b.ne	LBB0_19
LBB0_10:
	ldr	w23, [x26]
	mov	x0, x22
	mov	x1, x23
	bl	_i2c_smbus_read_byte_data
	and	w8, w0, #0x78
	orr	w2, w8, #0x80
	mov	x0, x22
	mov	x1, x23
	bl	_i2c_smbus_write_byte_data
	ldr	w1, [x25]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	mov	x23, x0
	cmp	w0, #18
	b.eq	LBB0_12
; %bb.11:
	cmp	w23, #92
	b.ne	LBB0_23
LBB0_12:
Lloh13:
	adrp	x8, _W83781D_REG_WCHIPID@GOTPAGE
Lloh14:
	ldr	x8, [x8, _W83781D_REG_WCHIPID@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	mov	x1, x0
	and	w8, w0, #0xfffffffe
	cmp	w8, #16
	b.ne	LBB0_24
; %bb.13:
	cmp	w23, #92
	b.ne	LBB0_24
; %bb.14:
Lloh16:
	adrp	x23, l_.str.4@PAGE
Lloh17:
	add	x23, x23, l_.str.4@PAGEOFF
	b	LBB0_27
LBB0_15:
Lloh18:
	adrp	x1, l_.str@PAGE
Lloh19:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_29
LBB0_16:
	tbnz	w23, #7, LBB0_20
; %bb.17:
	cmp	w0, #163
	b.eq	LBB0_5
; %bb.18:
	cmp	w0, #195
	b.eq	LBB0_5
	b	LBB0_22
LBB0_19:
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_29
LBB0_20:
	cmp	w0, #18
	b.eq	LBB0_5
; %bb.21:
	cmp	w0, #92
	b.eq	LBB0_5
LBB0_22:
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_29
LBB0_23:
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_29
LBB0_24:
	cmp	w1, #48
	b.ne	LBB0_34
; %bb.25:
	cmp	w23, #92
	b.ne	LBB0_34
; %bb.26:
Lloh26:
	adrp	x23, l_.str.5@PAGE
Lloh27:
	add	x23, x23, l_.str.5@PAGEOFF
LBB0_27:
	mov	x0, x22
	bl	_w83781d_alias_detect
	cbz	x0, LBB0_40
; %bb.28:
	str	x24, [sp]
Lloh28:
	adrp	x1, l_.str.8@PAGE
Lloh29:
	add	x1, x1, l_.str.8@PAGEOFF
LBB0_29:
	mov	x0, x21
	bl	_dev_dbg
LBB0_30:
	cbz	x19, LBB0_32
; %bb.31:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_32:
Lloh30:
	adrp	x8, _ENODEV@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_33:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_34:
	cmp	w1, #64
	b.ne	LBB0_38
; %bb.35:
	cmp	w23, #92
	b.ne	LBB0_38
; %bb.36:
	cmp	w24, #45
	b.ne	LBB0_38
; %bb.37:
Lloh33:
	adrp	x23, l_.str.6@PAGE
Lloh34:
	add	x23, x23, l_.str.6@PAGEOFF
	b	LBB0_40
LBB0_38:
	cmp	w1, #49
	b.ne	LBB0_30
; %bb.39:
Lloh35:
	adrp	x23, l_.str.7@PAGE
Lloh36:
	add	x23, x23, l_.str.7@PAGEOFF
LBB0_40:
	cbz	x19, LBB0_42
; %bb.41:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_42:
	ldr	w0, [x20]
Lloh37:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh39:
	ldr	w2, [x8]
	mov	x1, x23
	bl	_strlcpy
	mov	w0, #0
	b	LBB0_33
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ; @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_W83781D_REG_CONFIG,4,2         ; @W83781D_REG_CONFIG
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Detection of w83781d chip failed at step 3\n"

	.comm	_W83781D_REG_BANK,4,2           ; @W83781D_REG_BANK
	.comm	_W83781D_REG_CHIPMAN,4,2        ; @W83781D_REG_CHIPMAN
l_.str.1:                               ; @.str.1
	.asciz	"Detection of w83781d chip failed at step 4\n"

	.comm	_W83781D_REG_I2C_ADDR,4,2       ; @W83781D_REG_I2C_ADDR
l_.str.2:                               ; @.str.2
	.asciz	"Detection of w83781d chip failed at step 5\n"

l_.str.3:                               ; @.str.3
	.asciz	"w83781d chip vendor is neither Winbond nor Asus\n"

	.comm	_W83781D_REG_WCHIPID,4,2        ; @W83781D_REG_WCHIPID
l_.str.4:                               ; @.str.4
	.asciz	"w83781d"

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

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

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

l_.str.8:                               ; @.str.8
	.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	_w83781d_detect
.subsections_via_symbols
