	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function blinkm_detect
_blinkm_detect:                         ## @blinkm_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	$40, %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, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_I2C_FUNC_SMBUS_BYTE_DATA@GOTPCREL(%rip), %rax
	movq	_I2C_FUNC_SMBUS_WORD_DATA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	8(%rdi), %rdi
	movq	_I2C_FUNC_SMBUS_WRITE_BYTE@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	callq	_i2c_check_functionality
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	movl	$99, %ebx
	movq	_BLM_GET_ADDR@GOTPCREL(%rip), %r12
	leaq	-80(%rbp), %r15
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_blinkm_write
	testl	%eax, %eax
	jne	LBB0_12
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$5000, %edi                     ## imm = 0x1388
	movl	$10000, %esi                    ## imm = 0x2710
	callq	_usleep_range
	movl	(%r12), %esi
	movq	%r13, %rdi
	movq	%r15, %rdx
	callq	_blinkm_read
	testl	%eax, %eax
	jne	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$5000, %edi                     ## imm = 0x1388
	movl	$10000, %esi                    ## imm = 0x2710
	callq	_usleep_range
	cmpl	$9, -80(%rbp)
	je	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	leal	-1(%rbx), %eax
	cmpl	$1, %ebx
	movl	%eax, %ebx
	jg	LBB0_2
LBB0_6:
	movl	(%r12), %esi
	movq	%r13, %rdi
	xorl	%edx, %edx
	callq	_blinkm_write
	testl	%eax, %eax
	js	LBB0_12
## %bb.7:
	movl	$20000, %edi                    ## imm = 0x4E20
	movl	$30000, %esi                    ## imm = 0x7530
	callq	_usleep_range
	movl	(%r12), %esi
	leaq	-80(%rbp), %rdx
	movq	%r13, %rdi
	callq	_blinkm_read
	testl	%eax, %eax
	js	LBB0_12
## %bb.8:
	movl	-80(%rbp), %edx
	cmpl	$9, %edx
	jne	LBB0_9
## %bb.11:
	movl	(%r14), %edi
	movq	_I2C_NAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.1(%rip), %rsi
	callq	_strlcpy
	xorl	%eax, %eax
	jmp	LBB0_12
LBB0_9:
	leaq	L_.str(%rip), %rsi
	movq	%r13, %rdi
	callq	_dev_err
LBB0_10:
	movq	_ENODEV@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_14
## %bb.13:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.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	_I2C_FUNC_SMBUS_WRITE_BYTE,4,2  ## @I2C_FUNC_SMBUS_WRITE_BYTE
	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_BLM_GET_ADDR,4,2               ## @BLM_GET_ADDR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"enodev DEV ADDR = 0x%02X\n"

L_.str.1:                               ## @.str.1
	.asciz	"blinkm"

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

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function blinkm_detect
_blinkm_detect:                         ; @blinkm_detect
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	ldr	x0, [x0, #8]
Lloh3:
	adrp	x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _I2C_FUNC_SMBUS_BYTE_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _I2C_FUNC_SMBUS_WORD_DATA@GOTPAGE
Lloh7:
	ldr	x9, [x9, _I2C_FUNC_SMBUS_WORD_DATA@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _I2C_FUNC_SMBUS_WRITE_BYTE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _I2C_FUNC_SMBUS_WRITE_BYTE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w8, w9
	bl	_i2c_check_functionality
	cbz	w0, LBB0_11
; %bb.1:
	mov	w22, #99
Lloh12:
	adrp	x21, _BLM_GET_ADDR@GOTPAGE
Lloh13:
	ldr	x21, [x21, _BLM_GET_ADDR@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, #0
	bl	_blinkm_write
	cbnz	w0, LBB0_12
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #5000
	mov	w1, #10000
	bl	_usleep_range
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_blinkm_read
	cbnz	w0, LBB0_12
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w0, #5000
	mov	w1, #10000
	bl	_usleep_range
	ldr	w8, [sp, #12]
	cmp	w8, #9
	b.eq	LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_2 Depth=1
	sub	w8, w22, #1
	cmp	w22, #1
	mov	x22, x8
	b.gt	LBB0_2
LBB0_6:
	ldr	w1, [x21]
	mov	x0, x19
	mov	x2, #0
	bl	_blinkm_write
	tbnz	w0, #31, LBB0_12
; %bb.7:
	mov	w0, #20000
	mov	w1, #30000
	bl	_usleep_range
	ldr	w1, [x21]
	add	x2, sp, #12
	mov	x0, x19
	bl	_blinkm_read
	tbnz	w0, #31, LBB0_12
; %bb.8:
	ldr	w2, [sp, #12]
	cmp	w2, #9
	b.ne	LBB0_10
; %bb.9:
	ldr	w0, [x20]
Lloh14:
	adrp	x8, _I2C_NAME_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _I2C_NAME_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
Lloh17:
	adrp	x1, l_.str.1@PAGE
Lloh18:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strlcpy
	mov	w0, #0
	b	LBB0_12
LBB0_10:
Lloh19:
	adrp	x1, l_.str@PAGE
Lloh20:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_dev_err
LBB0_11:
Lloh21:
	adrp	x8, _ENODEV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	ldr	x8, [sp, #40]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	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
	add	sp, sp, #96
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.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	_I2C_FUNC_SMBUS_WRITE_BYTE,4,2  ; @I2C_FUNC_SMBUS_WRITE_BYTE
	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_BLM_GET_ADDR,4,2               ; @BLM_GET_ADDR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"enodev DEV ADDR = 0x%02X\n"

l_.str.1:                               ; @.str.1
	.asciz	"blinkm"

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