	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amc6821_detect
_amc6821_detect:                        ## @amc6821_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, %r15
	movq	%rdi, %rbx
	movq	8(%rdi), %r12
	movl	(%rdi), %r14d
	leaq	L_.str(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
	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.3:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	movq	_AMC6821_REG_DEV_ID@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r13d
	movq	_AMC6821_REG_COMP_ID@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	cmpl	$33, %r13d
	jne	LBB0_5
## %bb.4:
	cmpl	$73, %eax
	jne	LBB0_5
## %bb.6:
	movl	$128, %r13d
	movl	(%r15), %esi
	orl	%r13d, %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, %r15d
	orl	(%r14), %r13d
	movq	%rbx, %rdi
	movl	%r13d, %esi
	callq	_i2c_smbus_read_byte_data
	cmpl	$33, %r15d
	jne	LBB0_5
## %bb.7:
	cmpl	$73, %eax
	jne	LBB0_5
## %bb.8:
	leaq	L_.str.3(%rip), %rsi
	movq	%r12, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_dev_info
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.4(%rip), %rsi
	callq	_strlcpy
	xorl	%r13d, %r13d
	jmp	LBB0_9
LBB0_5:
	leaq	L_.str.2(%rip), %rsi
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_dev_dbg
	jmp	LBB0_2
LBB0_1:
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_dbg
LBB0_2:
	movq	_ENODEV@GOTPCREL(%rip), %rax
	subl	(%rax), %r13d
LBB0_9:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"amc6821_detect called.\n"

	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ## @I2C_FUNC_SMBUS_BYTE_DATA
L_.str.1:                               ## @.str.1
	.asciz	"amc6821: I2C bus doesn't support byte mode, skipping.\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_AMC6821_REG_DEV_ID,4,2         ## @AMC6821_REG_DEV_ID
	.comm	_AMC6821_REG_COMP_ID,4,2        ## @AMC6821_REG_COMP_ID
L_.str.2:                               ## @.str.2
	.asciz	"amc6821: detection failed at 0x%02x.\n"

L_.str.3:                               ## @.str.3
	.asciz	"amc6821: chip found at 0x%02x.\n"

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

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amc6821_detect
_amc6821_detect:                        ; @amc6821_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
	ldr	x19, [x0, #8]
	ldr	w21, [x0]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_dbg
Lloh2:
	adrp	x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_i2c_check_functionality
	cbz	w0, LBB0_6
; %bb.1:
Lloh5:
	adrp	x24, _AMC6821_REG_DEV_ID@GOTPAGE
Lloh6:
	ldr	x24, [x24, _AMC6821_REG_DEV_ID@GOTPAGEOFF]
	ldr	w1, [x24]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	mov	x23, x0
Lloh7:
	adrp	x25, _AMC6821_REG_COMP_ID@GOTPAGE
Lloh8:
	ldr	x25, [x25, _AMC6821_REG_COMP_ID@GOTPAGEOFF]
	ldr	w1, [x25]
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	cmp	w23, #33
	b.ne	LBB0_8
; %bb.2:
	cmp	w0, #73
	b.ne	LBB0_8
; %bb.3:
	ldr	w8, [x24]
	orr	w1, w8, #0x80
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	mov	x23, x0
	ldr	w8, [x25]
	orr	w1, w8, #0x80
	mov	x0, x22
	bl	_i2c_smbus_read_byte_data
	cmp	w23, #33
	b.ne	LBB0_7
; %bb.4:
	cmp	w0, #73
	b.ne	LBB0_7
; %bb.5:
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_dev_info
	ldr	w0, [x20]
Lloh11:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w2, [x8]
Lloh14:
	adrp	x1, l_.str.4@PAGE
Lloh15:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_strlcpy
	mov	w0, #0
	b	LBB0_10
LBB0_6:
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
LBB0_7:
                                        ; kill: def $w21 killed $w21 killed $x21 def $x21
LBB0_8:
	str	x21, [sp]
Lloh18:
	adrp	x1, l_.str.2@PAGE
Lloh19:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x0, x19
	bl	_dev_dbg
Lloh20:
	adrp	x8, _ENODEV@GOTPAGE
Lloh21:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	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
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"amc6821_detect called.\n"

	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ; @I2C_FUNC_SMBUS_BYTE_DATA
l_.str.1:                               ; @.str.1
	.asciz	"amc6821: I2C bus doesn't support byte mode, skipping.\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_AMC6821_REG_DEV_ID,4,2         ; @AMC6821_REG_DEV_ID
	.comm	_AMC6821_REG_COMP_ID,4,2        ; @AMC6821_REG_COMP_ID
l_.str.2:                               ; @.str.2
	.asciz	"amc6821: detection failed at 0x%02x.\n"

l_.str.3:                               ; @.str.3
	.asciz	"amc6821: chip found at 0x%02x.\n"

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

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