	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function htcpld_register_chip_i2c
_htcpld_register_chip_i2c:              ## @htcpld_register_chip_i2c
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r14d
	movq	%rdi, %r12
	callq	_dev_get_platdata
	movq	%rax, %rbx
	movq	%r12, %rdi
	callq	_platform_get_drvdata
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movslq	%r14d, %r15
	movq	8(%rbx), %r14
	movl	(%rbx), %edi
	callq	_i2c_get_adapter
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %r13
	movq	_I2C_FUNC_SMBUS_READ_BYTE_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movq	%r15, %rax
	shlq	$4, %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%rax), %rbx
	leaq	-64(%rbp), %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movl	(%r14,%r15,4), %eax
	movl	%eax, -52(%rbp)
	movl	-56(%rbp), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %r14
	movl	(%r14), %edx
	leaq	L_.str.2(%rip), %rsi
	callq	_strlcpy
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)
	movq	%r13, %rdi
	leaq	-64(%rbp), %rsi
	callq	_i2c_new_device
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	movq	%rax, %rbx
	movq	%rax, %rdi
	movq	-80(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rsi
	callq	_i2c_set_clientdata
	movl	(%rbx), %ecx
	movl	4(%rbx), %edi
	movl	(%r14), %esi
	leaq	L_.str.4(%rip), %rdx
	callq	_snprintf
	movq	-88(%rbp), %r14                 ## 8-byte Reload
	movq	-48(%rbp), %r12                 ## 8-byte Reload
	movq	%rbx, 8(%r12,%r14)
	movq	%rbx, %rdi
	callq	_htcpld_chip_reset
	movl	(%r13), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_byte_data
	movl	%eax, 4(%r12,%r14)
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_4:
	movl	(%r14,%r15,4), %edx
	movl	(%rbx), %ecx
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
	jmp	LBB0_7
LBB0_5:
	movl	(%rbx), %edx
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_6:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax,%r15,4), %edx
	leaq	L_.str.3(%rip), %rsi
	xorl	%ebx, %ebx
	movq	%r12, %rdi
	xorl	%eax, %eax
	callq	_dev_warn
LBB0_7:
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_8:
	subl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$56, %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	"Chip at i2c address 0x%x: Invalid i2c adapter %d\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_I2C_FUNC_SMBUS_READ_BYTE_DATA,4,2 ## @I2C_FUNC_SMBUS_READ_BYTE_DATA
L_.str.1:                               ## @.str.1
	.asciz	"i2c adapter %d non-functional\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.2:                               ## @.str.2
	.asciz	"htcpld-chip"

	.comm	_I2C_NAME_SIZE,4,2              ## @I2C_NAME_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"Unable to add I2C device for 0x%x\n"

L_.str.4:                               ## @.str.4
	.asciz	"Chip_0x%x"

	.no_dead_strip	_htcpld_register_chip_i2c
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function htcpld_register_chip_i2c
_htcpld_register_chip_i2c:              ; @htcpld_register_chip_i2c
	.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	x20, x1
	mov	x19, x0
	bl	_dev_get_platdata
	mov	x22, x0
	mov	x0, x19
	bl	_platform_get_drvdata
	ldr	x24, [x0]
	sxtw	x23, w20
	ldr	x25, [x22, #8]
	ldr	w0, [x22]
	bl	_i2c_get_adapter
	cbz	x0, LBB0_4
; %bb.1:
	mov	x21, x0
Lloh0:
	adrp	x8, _I2C_FUNC_SMBUS_READ_BYTE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_READ_BYTE_DATA@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_i2c_check_functionality
	cbz	w0, LBB0_5
; %bb.2:
	add	x20, x24, w20, sxtw #4
	add	x0, sp, #16
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	ldr	w8, [x25, x23, lsl #2]
	str	w8, [sp, #28]
	ldr	w0, [sp, #24]
Lloh3:
	adrp	x22, _I2C_NAME_SIZE@GOTPAGE
Lloh4:
	ldr	x22, [x22, _I2C_NAME_SIZE@GOTPAGEOFF]
	ldr	w2, [x22]
Lloh5:
	adrp	x1, l_.str.2@PAGE
Lloh6:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strlcpy
	str	x20, [sp, #16]
	add	x1, sp, #16
	mov	x0, x21
	bl	_i2c_new_device
	cbz	x0, LBB0_6
; %bb.3:
	mov	x21, x0
	mov	x1, x20
	bl	_i2c_set_clientdata
	ldr	w1, [x22]
	ldp	w3, w0, [x21]
Lloh7:
	adrp	x2, l_.str.4@PAGE
Lloh8:
	add	x2, x2, l_.str.4@PAGEOFF
	bl	_snprintf
	add	x19, x24, x23, lsl #4
	str	x21, [x19, #8]
	mov	x0, x21
	bl	_htcpld_chip_reset
	ldr	w1, [x20]
	mov	x0, x21
	bl	_i2c_smbus_read_byte_data
	mov	x8, x0
	mov	w0, #0
	str	w8, [x19, #4]
	b	LBB0_9
LBB0_4:
	ldr	w2, [x25, x23, lsl #2]
	ldr	w8, [x22]
	str	x8, [sp]
Lloh9:
	adrp	x1, l_.str@PAGE
Lloh10:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_7
LBB0_5:
	ldr	w2, [x22]
Lloh11:
	adrp	x1, l_.str.1@PAGE
Lloh12:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_dev_warn
Lloh13:
	adrp	x8, _EINVAL@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_8
LBB0_6:
	ldr	w2, [x25, x23, lsl #2]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
LBB0_7:
	mov	x0, x19
	bl	_dev_warn
Lloh17:
	adrp	x8, _ENODEV@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_8:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_9:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Chip at i2c address 0x%x: Invalid i2c adapter %d\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_I2C_FUNC_SMBUS_READ_BYTE_DATA,4,2 ; @I2C_FUNC_SMBUS_READ_BYTE_DATA
l_.str.1:                               ; @.str.1
	.asciz	"i2c adapter %d non-functional\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.2:                               ; @.str.2
	.asciz	"htcpld-chip"

	.comm	_I2C_NAME_SIZE,4,2              ; @I2C_NAME_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"Unable to add I2C device for 0x%x\n"

l_.str.4:                               ; @.str.4
	.asciz	"Chip_0x%x"

	.no_dead_strip	_htcpld_register_chip_i2c
.subsections_via_symbols
