	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amc6821_init_client
_amc6821_init_client:                   ## @amc6821_init_client
	.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
	xorl	%r14d, %r14d
	movq	_init@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_12
## %bb.1:
	movq	%rdi, %r13
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
	movq	_AMC6821_REG_CONF4@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movq	_AMC6821_CONF4_MODE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	(%rbx), %esi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_i2c_smbus_write_byte_data
	testq	%rax, %rax
	je	LBB0_4
LBB0_10:
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_11
LBB0_4:
	movq	_AMC6821_REG_CONF3@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_2
## %bb.5:
	movl	%eax, %r15d
	movl	%eax, %edx
	andl	$15, %edx
	leaq	L_.str.2(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_info
	movq	_AMC6821_CONF3_THERM_FAN_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	notl	%edx
	andl	%r15d, %edx
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_write_byte_data
	testq	%rax, %rax
	jne	LBB0_10
## %bb.6:
	movq	_AMC6821_REG_CONF2@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_2
## %bb.7:
	movq	_AMC6821_CONF2_RTFIE@GOTPCREL(%rip), %rcx
	movq	_AMC6821_CONF2_LTOIE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_AMC6821_CONF2_RTOIE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	notl	%edx
	andl	%edx, %eax
	movl	(%r15), %esi
	movq	%r13, %rdi
	movl	%eax, %edx
	callq	_i2c_smbus_write_byte_data
	testq	%rax, %rax
	jne	LBB0_10
## %bb.8:
	movq	_AMC6821_REG_CONF1@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_read_byte_data
	testl	%eax, %eax
	js	LBB0_2
## %bb.9:
	movq	_AMC6821_CONF1_THERMOVIE@GOTPCREL(%rip), %rcx
	movq	_AMC6821_CONF1_FANIE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	notl	%edx
	andl	%edx, %eax
	movq	_AMC6821_CONF1_START@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_pwminv@GOTPCREL(%rip), %rcx
	movq	_AMC6821_CONF1_PWMINV@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	movl	%edx, %esi
	orl	%eax, %esi
	notl	%edx
	andl	%eax, %edx
	cmpq	$0, (%rcx)
	cmovnel	%esi, %edx
	movl	(%r15), %esi
	movq	%r13, %rdi
	callq	_i2c_smbus_write_byte_data
	testq	%rax, %rax
	jne	LBB0_10
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str(%rip), %rsi
LBB0_11:
	movq	%r13, %rdi
	callq	_dev_err
	movl	%r12d, %r14d
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_init,8,3                       ## @init
	.comm	_AMC6821_REG_CONF4,4,2          ## @AMC6821_REG_CONF4
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error reading configuration register, aborting.\n"

	.comm	_AMC6821_CONF4_MODE,4,2         ## @AMC6821_CONF4_MODE
L_.str.1:                               ## @.str.1
	.asciz	"Configuration register write error, aborting.\n"

	.comm	_AMC6821_REG_CONF3,4,2          ## @AMC6821_REG_CONF3
L_.str.2:                               ## @.str.2
	.asciz	"Revision %d\n"

	.comm	_AMC6821_CONF3_THERM_FAN_EN,4,2 ## @AMC6821_CONF3_THERM_FAN_EN
	.comm	_AMC6821_REG_CONF2,4,2          ## @AMC6821_REG_CONF2
	.comm	_AMC6821_CONF2_RTFIE,4,2        ## @AMC6821_CONF2_RTFIE
	.comm	_AMC6821_CONF2_LTOIE,4,2        ## @AMC6821_CONF2_LTOIE
	.comm	_AMC6821_CONF2_RTOIE,4,2        ## @AMC6821_CONF2_RTOIE
	.comm	_AMC6821_REG_CONF1,4,2          ## @AMC6821_REG_CONF1
	.comm	_AMC6821_CONF1_THERMOVIE,4,2    ## @AMC6821_CONF1_THERMOVIE
	.comm	_AMC6821_CONF1_FANIE,4,2        ## @AMC6821_CONF1_FANIE
	.comm	_AMC6821_CONF1_START,4,2        ## @AMC6821_CONF1_START
	.comm	_pwminv,8,3                     ## @pwminv
	.comm	_AMC6821_CONF1_PWMINV,4,2       ## @AMC6821_CONF1_PWMINV
	.no_dead_strip	_amc6821_init_client
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amc6821_init_client
_amc6821_init_client:                   ; @amc6821_init_client
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _init@GOTPAGE
Lloh1:
	ldr	x8, [x8, _init@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.1:
	mov	x20, x0
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w19, w8
Lloh6:
	adrp	x21, _AMC6821_REG_CONF4@GOTPAGE
Lloh7:
	ldr	x21, [x21, _AMC6821_REG_CONF4@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_11
; %bb.2:
Lloh8:
	adrp	x8, _AMC6821_CONF4_MODE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AMC6821_CONF4_MODE@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	orr	w2, w8, w0
	ldr	w1, [x21]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	cbz	x0, LBB0_4
LBB0_3:
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_12
LBB0_4:
Lloh13:
	adrp	x22, _AMC6821_REG_CONF3@GOTPAGE
Lloh14:
	ldr	x22, [x22, _AMC6821_REG_CONF3@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_11
; %bb.5:
	mov	x21, x0
	and	w2, w0, #0xf
Lloh15:
	adrp	x1, l_.str.2@PAGE
Lloh16:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x20
	bl	_dev_info
Lloh17:
	adrp	x8, _AMC6821_CONF3_THERM_FAN_EN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AMC6821_CONF3_THERM_FAN_EN@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	bic	w2, w21, w8
	ldr	w1, [x22]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	cbnz	x0, LBB0_3
; %bb.6:
Lloh20:
	adrp	x21, _AMC6821_REG_CONF2@GOTPAGE
Lloh21:
	ldr	x21, [x21, _AMC6821_REG_CONF2@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_11
; %bb.7:
Lloh22:
	adrp	x8, _AMC6821_CONF2_RTFIE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AMC6821_CONF2_RTFIE@GOTPAGEOFF]
Lloh24:
	ldr	w8, [x8]
Lloh25:
	adrp	x9, _AMC6821_CONF2_LTOIE@GOTPAGE
Lloh26:
	ldr	x9, [x9, _AMC6821_CONF2_LTOIE@GOTPAGEOFF]
Lloh27:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh28:
	adrp	x9, _AMC6821_CONF2_RTOIE@GOTPAGE
Lloh29:
	ldr	x9, [x9, _AMC6821_CONF2_RTOIE@GOTPAGEOFF]
Lloh30:
	ldr	w9, [x9]
	orr	w8, w8, w9
	bic	w2, w0, w8
	ldr	w1, [x21]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	cbnz	x0, LBB0_3
; %bb.8:
Lloh31:
	adrp	x21, _AMC6821_REG_CONF1@GOTPAGE
Lloh32:
	ldr	x21, [x21, _AMC6821_REG_CONF1@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_i2c_smbus_read_byte_data
	tbnz	w0, #31, LBB0_11
; %bb.9:
Lloh33:
	adrp	x8, _AMC6821_CONF1_THERMOVIE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _AMC6821_CONF1_THERMOVIE@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
Lloh36:
	adrp	x9, _AMC6821_CONF1_FANIE@GOTPAGE
Lloh37:
	ldr	x9, [x9, _AMC6821_CONF1_FANIE@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bic	w8, w0, w8
Lloh39:
	adrp	x9, _AMC6821_CONF1_START@GOTPAGE
Lloh40:
	ldr	x9, [x9, _AMC6821_CONF1_START@GOTPAGEOFF]
Lloh41:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh42:
	adrp	x9, _pwminv@GOTPAGE
Lloh43:
	ldr	x9, [x9, _pwminv@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
Lloh45:
	adrp	x10, _AMC6821_CONF1_PWMINV@GOTPAGE
Lloh46:
	ldr	x10, [x10, _AMC6821_CONF1_PWMINV@GOTPAGEOFF]
Lloh47:
	ldr	w10, [x10]
	orr	w11, w10, w8
	bic	w8, w8, w10
	cmp	x9, #0
	csel	w2, w8, w11, eq
	ldr	w1, [x21]
	mov	x0, x20
	bl	_i2c_smbus_write_byte_data
	cbnz	x0, LBB0_3
LBB0_10:
	mov	w19, #0
	b	LBB0_13
LBB0_11:
Lloh48:
	adrp	x1, l_.str@PAGE
Lloh49:
	add	x1, x1, l_.str@PAGEOFF
LBB0_12:
	mov	x0, x20
	bl	_dev_err
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_init,8,3                       ; @init
	.comm	_AMC6821_REG_CONF4,4,2          ; @AMC6821_REG_CONF4
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error reading configuration register, aborting.\n"

	.comm	_AMC6821_CONF4_MODE,4,2         ; @AMC6821_CONF4_MODE
l_.str.1:                               ; @.str.1
	.asciz	"Configuration register write error, aborting.\n"

	.comm	_AMC6821_REG_CONF3,4,2          ; @AMC6821_REG_CONF3
l_.str.2:                               ; @.str.2
	.asciz	"Revision %d\n"

	.comm	_AMC6821_CONF3_THERM_FAN_EN,4,2 ; @AMC6821_CONF3_THERM_FAN_EN
	.comm	_AMC6821_REG_CONF2,4,2          ; @AMC6821_REG_CONF2
	.comm	_AMC6821_CONF2_RTFIE,4,2        ; @AMC6821_CONF2_RTFIE
	.comm	_AMC6821_CONF2_LTOIE,4,2        ; @AMC6821_CONF2_LTOIE
	.comm	_AMC6821_CONF2_RTOIE,4,2        ; @AMC6821_CONF2_RTOIE
	.comm	_AMC6821_REG_CONF1,4,2          ; @AMC6821_REG_CONF1
	.comm	_AMC6821_CONF1_THERMOVIE,4,2    ; @AMC6821_CONF1_THERMOVIE
	.comm	_AMC6821_CONF1_FANIE,4,2        ; @AMC6821_CONF1_FANIE
	.comm	_AMC6821_CONF1_START,4,2        ; @AMC6821_CONF1_START
	.comm	_pwminv,8,3                     ; @pwminv
	.comm	_AMC6821_CONF1_PWMINV,4,2       ; @AMC6821_CONF1_PWMINV
	.no_dead_strip	_amc6821_init_client
.subsections_via_symbols
