	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function jc42_detect
_jc42_detect:                           ## @jc42_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, %r14
	movq	%rdi, %rbx
	movq	(%rdi), %rdi
	movq	_I2C_FUNC_SMBUS_BYTE_DATA@GOTPCREL(%rip), %rax
	movq	_I2C_FUNC_SMBUS_WORD_DATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_JC42_REG_CAP@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %r13d
	movq	_JC42_REG_CONFIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %r14d
	movq	_JC42_REG_MANID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_word_swapped
	movl	%eax, %r12d
	movq	_JC42_REG_DEVICEID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_i2c_smbus_read_word_swapped
	testl	%r13d, %r13d
	js	LBB0_12
## %bb.2:
	testl	%r14d, %r14d
	js	LBB0_12
## %bb.3:
	testl	%r12d, %r12d
	js	LBB0_12
## %bb.4:
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_12
## %bb.5:
	andl	$65280, %r13d                   ## imm = 0xFF00
	andl	$63488, %r14d                   ## imm = 0xF800
	orl	%r13d, %r14d
	jne	LBB0_12
## %bb.6:
	movq	_jc42_chips@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_ARRAY_SIZE
	testl	%eax, %eax
	jle	LBB0_12
## %bb.7:
	movl	$8, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_8 Depth=1
	incq	%r13
	callq	_ARRAY_SIZE
	cltq
	addq	$12, %rbx
	cmpq	%rax, %r13
	jge	LBB0_12
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rdi
	cmpl	-8(%rdi,%rbx), %r12d
	jne	LBB0_11
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	-4(%rdi,%rbx), %eax
	andl	%r15d, %eax
	cmpl	(%rdi,%rbx), %eax
	jne	LBB0_11
## %bb.10:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_strlcpy
	xorl	%eax, %eax
	jmp	LBB0_13
LBB0_12:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ## @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_I2C_FUNC_SMBUS_WORD_DATA,4,2   ## @I2C_FUNC_SMBUS_WORD_DATA
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_JC42_REG_CAP,4,2               ## @JC42_REG_CAP
	.comm	_JC42_REG_CONFIG,4,2            ## @JC42_REG_CONFIG
	.comm	_JC42_REG_MANID,4,2             ## @JC42_REG_MANID
	.comm	_JC42_REG_DEVICEID,4,2          ## @JC42_REG_DEVICEID
	.comm	_jc42_chips,8,3                 ## @jc42_chips
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"jc42"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function jc42_detect
_jc42_detect:                           ; @jc42_detect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGE
Lloh1:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGEOFF]
	ldr	x0, [x0]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _I2C_FUNC_SMBUS_WORD_DATA@GOTPAGE
Lloh4:
	ldr	x9, [x9, _I2C_FUNC_SMBUS_WORD_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
	bl	_i2c_check_functionality
	cbz	w0, LBB0_12
; %bb.1:
Lloh6:
	adrp	x8, _JC42_REG_CAP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _JC42_REG_CAP@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_word_swapped
	mov	x22, x0
Lloh9:
	adrp	x8, _JC42_REG_CONFIG@GOTPAGE
Lloh10:
	ldr	x8, [x8, _JC42_REG_CONFIG@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_word_swapped
	mov	x23, x0
Lloh12:
	adrp	x8, _JC42_REG_MANID@GOTPAGE
Lloh13:
	ldr	x8, [x8, _JC42_REG_MANID@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_word_swapped
	mov	x20, x0
Lloh15:
	adrp	x8, _JC42_REG_DEVICEID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _JC42_REG_DEVICEID@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x21
	bl	_i2c_smbus_read_word_swapped
	tbnz	w22, #31, LBB0_12
; %bb.2:
	tbnz	w23, #31, LBB0_12
; %bb.3:
	tbnz	w20, #31, LBB0_12
; %bb.4:
	mov	x21, x0
	tbnz	w0, #31, LBB0_12
; %bb.5:
	and	w8, w22, #0xff00
	and	w9, w23, #0xf800
	orr	w8, w8, w9
	cbnz	w8, LBB0_12
; %bb.6:
Lloh18:
	adrp	x22, _jc42_chips@GOTPAGE
Lloh19:
	ldr	x22, [x22, _jc42_chips@GOTPAGEOFF]
	ldr	x0, [x22]
	bl	_ARRAY_SIZE
	cmp	w0, #1
	b.lt	LBB0_12
; %bb.7:
	mov	x23, #0
	mov	x24, #0
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x24, x24, #1
	bl	_ARRAY_SIZE
	add	x23, x23, #12
	cmp	x24, w0, sxtw
	b.ge	LBB0_12
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22]
	ldr	w8, [x0, x23]
	cmp	w20, w8
	b.ne	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	add	x8, x0, x23
	ldp	w9, w8, [x8, #4]
	and	w9, w9, w21
	cmp	w9, w8
	b.ne	LBB0_8
; %bb.11:
	ldr	w0, [x19]
Lloh20:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh21:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_strlcpy
	mov	w0, #0
	b	LBB0_13
LBB0_12:
Lloh25:
	adrp	x8, _ENODEV@GOTPAGE
Lloh26:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_13:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_I2C_FUNC_SMBUS_BYTE_DATA,4,2   ; @I2C_FUNC_SMBUS_BYTE_DATA
	.comm	_I2C_FUNC_SMBUS_WORD_DATA,4,2   ; @I2C_FUNC_SMBUS_WORD_DATA
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_JC42_REG_CAP,4,2               ; @JC42_REG_CAP
	.comm	_JC42_REG_CONFIG,4,2            ; @JC42_REG_CONFIG
	.comm	_JC42_REG_MANID,4,2             ; @JC42_REG_MANID
	.comm	_JC42_REG_DEVICEID,4,2          ; @JC42_REG_DEVICEID
	.comm	_jc42_chips,8,3                 ; @jc42_chips
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"jc42"

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