	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dib8000_reset
_dib8000_reset:                         ## @dib8000_reset
	.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	%rdi, %r14
	movq	(%rdi), %r15
	leaq	44(%r15), %rdi
	callq	_dib8000_identify
	movl	%eax, (%r15)
	cmpl	$32912, %eax                    ## imm = 0x8090
	je	LBB0_5
## %bb.1:
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_27
LBB0_3:
	movq	%r15, %rdi
	movl	$1287, %esi                     ## imm = 0x507
	movl	$3, %edx
	callq	_dib8000_write_word
	cmpl	$32768, (%r15)                  ## imm = 0x8000
	jne	LBB0_5
## %bb.4:
	leaq	L_.str(%rip), %rdi
	callq	_dprintk
LBB0_5:
	leaq	40(%r15), %rdi
	callq	_dibx000_reset_i2c_master
	movq	_DIB8000_POWER_ALL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dib8000_set_power_mode
	movq	_DIBX000_ADC_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dib8000_set_adc_state
	movq	%r15, %rdi
	movl	$770, %esi                      ## imm = 0x302
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$771, %esi                      ## imm = 0x303
	movl	$65535, %edx                    ## imm = 0xFFFF
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$772, %esi                      ## imm = 0x304
	movl	$65532, %edx                    ## imm = 0xFFFC
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$898, %esi                      ## imm = 0x382
	movl	$12, %edx
	callq	_dib8000_write_word
	xorl	%eax, %eax
	cmpl	$32912, (%r15)                  ## imm = 0x8090
	setne	%al
	leal	69(,%rax,8), %edx
	movq	%r15, %rdi
	movl	$1280, %esi                     ## imm = 0x500
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$1281, %esi                     ## imm = 0x501
	movl	$12, %edx
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$770, %esi                      ## imm = 0x302
	xorl	%edx, %edx
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$771, %esi                      ## imm = 0x303
	xorl	%edx, %edx
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$772, %esi                      ## imm = 0x304
	xorl	%edx, %edx
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$898, %esi                      ## imm = 0x382
	movl	$4, %edx
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$1280, %esi                     ## imm = 0x500
	xorl	%edx, %edx
	callq	_dib8000_write_word
	movq	%r15, %rdi
	movl	$1281, %esi                     ## imm = 0x501
	xorl	%edx, %edx
	callq	_dib8000_write_word
	cmpl	$32912, (%r15)                  ## imm = 0x8090
	je	LBB0_9
## %bb.6:
	movl	8(%r15), %edx
	testl	%edx, %edx
	jne	LBB0_8
## %bb.7:
	leaq	L_.str.1(%rip), %rdi
	callq	_dprintk
	movl	$11672, %edx                    ## imm = 0x2D98
LBB0_8:
	movq	%r15, %rdi
	movl	$906, %esi                      ## imm = 0x38A
	callq	_dib8000_write_word
LBB0_9:
	movq	%r15, %rdi
	callq	_dib8000_reset_pll
	cmpl	$32912, (%r15)                  ## imm = 0x8090
	je	LBB0_11
## %bb.10:
	movq	%r15, %rdi
	movl	$898, %esi                      ## imm = 0x382
	movl	$4, %edx
	callq	_dib8000_write_word
LBB0_11:
	movq	%r15, %rdi
	callq	_dib8000_reset_gpio
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	callq	_dprintk
LBB0_13:
	cmpl	$32912, (%r15)                  ## imm = 0x8090
	je	LBB0_16
## %bb.14:
	movq	_OUTMODE_HIGH_Z@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_dib8000_set_output_mode
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	leaq	L_.str.3(%rip), %rdi
	callq	_dprintk
LBB0_16:
	movq	$0, 32(%r15)
	movq	16(%r15), %rax
	cmpq	$0, (%rax)
	movl	$1877, %eax                     ## imm = 0x755
	movl	$8021, %edx                     ## imm = 0x1F55
	cmovel	%eax, %edx
	movq	%r15, %rdi
	movl	$40, %esi
	callq	_dib8000_write_word
	movq	_dib8000_defaults@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movl	(%r12), %r13d
	testl	%r13d, %r13d
	je	LBB0_21
## %bb.17:
	addq	$4, %r12
	.p2align	4, 0x90
LBB0_18:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_19 Depth 2
	movl	(%r12), %ebx
	addq	$8, %r12
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_18 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-4(%r12), %edx
	movq	%r15, %rdi
	movl	%ebx, %esi
	callq	_dib8000_write_word
	incl	%ebx
	addq	$4, %r12
	decl	%r13d
	jne	LBB0_19
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	-4(%r12), %r13d
	testl	%r13d, %r13d
	jne	LBB0_18
LBB0_21:
	movq	$0, 24(%r15)
	cmpl	$8090, (%r15)                   ## imm = 0x1F9A
	je	LBB0_24
## %bb.22:
	movl	12(%r15), %edx
	testl	%edx, %edx
	je	LBB0_24
## %bb.23:
	movq	%r15, %rdi
	movl	$903, %esi                      ## imm = 0x387
	callq	_dib8000_write_word
LBB0_24:
	movq	%r15, %rdi
	movl	$1285, %esi                     ## imm = 0x505
	callq	_dib8000_read_word
	andl	$-3, %eax
	movq	%r15, %rdi
	movl	$1285, %esi                     ## imm = 0x505
	movl	%eax, %edx
	callq	_dib8000_write_word
	movq	%r14, %rdi
	movl	$6000, %esi                     ## imm = 0x1770
	callq	_dib8000_set_bandwidth
	movq	_DIBX000_SLOW_ADC_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dib8000_set_adc_state
	movq	%r15, %rdi
	callq	_dib8000_sad_calib
	cmpl	$32912, (%r15)                  ## imm = 0x8090
	je	LBB0_26
## %bb.25:
	movq	_DIBX000_SLOW_ADC_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dib8000_set_adc_state
LBB0_26:
	movq	%r15, %rdi
	movl	$285, %esi                      ## imm = 0x11D
	callq	_dib8000_read_word
	orl	$96, %eax
	movq	%r15, %rdi
	movl	$285, %esi                      ## imm = 0x11D
	movl	%eax, %edx
	callq	_dib8000_write_word
	movq	_DIB8000_POWER_INTERFACE_ONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r15, %rdi
	callq	_dib8000_set_power_mode
	movq	%r14, %rdi
	callq	_dib8000_reset_stats
	xorl	%eax, %eax
LBB0_27:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"error : dib8000 MA not supported\n"

	.comm	_DIB8000_POWER_ALL,4,2          ## @DIB8000_POWER_ALL
	.comm	_DIBX000_ADC_OFF,4,2            ## @DIBX000_ADC_OFF
L_.str.1:                               ## @.str.1
	.asciz	"using standard PAD-drive-settings, please adjust settings in config-struct to be optimal.\n"

L_.str.2:                               ## @.str.2
	.asciz	"GPIO reset was not successful.\n"

	.comm	_OUTMODE_HIGH_Z,4,2             ## @OUTMODE_HIGH_Z
L_.str.3:                               ## @.str.3
	.asciz	"OUTPUT_MODE could not be reset.\n"

	.comm	_dib8000_defaults,8,3           ## @dib8000_defaults
	.comm	_DIBX000_SLOW_ADC_ON,4,2        ## @DIBX000_SLOW_ADC_ON
	.comm	_DIBX000_SLOW_ADC_OFF,4,2       ## @DIBX000_SLOW_ADC_OFF
	.comm	_DIB8000_POWER_INTERFACE_ONLY,4,2 ## @DIB8000_POWER_INTERFACE_ONLY
	.no_dead_strip	_dib8000_reset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dib8000_reset
_dib8000_reset:                         ; @dib8000_reset
	.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, x0
	ldr	x20, [x0]
	add	x0, x20, #44
	bl	_dib8000_identify
	str	w0, [x20]
	mov	w21, #32912
	cmp	w0, w21
	b.eq	LBB0_5
; %bb.1:
	cbnz	w0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _EINVAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_27
LBB0_3:
	mov	x0, x20
	mov	w1, #1287
	mov	w2, #3
	bl	_dib8000_write_word
	ldr	w8, [x20]
	cmp	w8, #8, lsl #12                 ; =32768
	b.ne	LBB0_5
; %bb.4:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dprintk
LBB0_5:
	add	x0, x20, #40
	bl	_dibx000_reset_i2c_master
Lloh5:
	adrp	x8, _DIB8000_POWER_ALL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _DIB8000_POWER_ALL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dib8000_set_power_mode
Lloh8:
	adrp	x8, _DIBX000_ADC_OFF@GOTPAGE
Lloh9:
	ldr	x8, [x8, _DIBX000_ADC_OFF@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dib8000_set_adc_state
	mov	x0, x20
	mov	w1, #770
	mov	w2, #65535
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #771
	mov	w2, #65535
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #772
	mov	w2, #65532
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #898
	mov	w2, #12
	bl	_dib8000_write_word
	ldr	w8, [x20]
	mov	w9, #77
	mov	w10, #69
	cmp	w8, w21
	csel	w2, w10, w9, eq
	mov	x0, x20
	mov	w1, #1280
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #1281
	mov	w2, #12
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #770
	mov	w2, #0
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #771
	mov	w2, #0
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #772
	mov	w2, #0
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #898
	mov	w2, #4
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #1280
	mov	w2, #0
	bl	_dib8000_write_word
	mov	x0, x20
	mov	w1, #1281
	mov	w2, #0
	bl	_dib8000_write_word
	ldr	w8, [x20]
	cmp	w8, w21
	b.eq	LBB0_9
; %bb.6:
	ldr	w2, [x20, #8]
	cbnz	w2, LBB0_8
; %bb.7:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_dprintk
	mov	w2, #11672
LBB0_8:
	mov	x0, x20
	mov	w1, #906
	bl	_dib8000_write_word
LBB0_9:
	mov	x0, x20
	bl	_dib8000_reset_pll
	ldr	w8, [x20]
	mov	w9, #32912
	cmp	w8, w9
	b.eq	LBB0_11
; %bb.10:
	mov	x0, x20
	mov	w1, #898
	mov	w2, #4
	bl	_dib8000_write_word
LBB0_11:
	mov	x0, x20
	bl	_dib8000_reset_gpio
	cbz	x0, LBB0_13
; %bb.12:
Lloh13:
	adrp	x0, l_.str.2@PAGE
Lloh14:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_dprintk
LBB0_13:
	ldr	w8, [x20]
	mov	w9, #32912
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.14:
Lloh15:
	adrp	x8, _OUTMODE_HIGH_Z@GOTPAGE
Lloh16:
	ldr	x8, [x8, _OUTMODE_HIGH_Z@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_dib8000_set_output_mode
	cbz	x0, LBB0_16
; %bb.15:
Lloh18:
	adrp	x0, l_.str.3@PAGE
Lloh19:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_dprintk
LBB0_16:
	str	xzr, [x20, #32]
	ldr	x8, [x20, #16]
	ldr	x8, [x8]
	cmp	x8, #0
	mov	w8, #8021
	mov	w9, #1877
	csel	w2, w9, w8, eq
	mov	x0, x20
	mov	w1, #40
	bl	_dib8000_write_word
Lloh20:
	adrp	x8, _dib8000_defaults@GOTPAGE
Lloh21:
	ldr	x8, [x8, _dib8000_defaults@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	ldr	w22, [x8]
	cbz	w22, LBB0_21
; %bb.17:
	add	x23, x8, #4
LBB0_18:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	ldr	w21, [x23], #8
LBB0_19:                                ;   Parent Loop BB0_18 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldur	w2, [x23, #-4]
	mov	x0, x20
	mov	x1, x21
	bl	_dib8000_write_word
	add	w21, w21, #1
	add	x23, x23, #4
	subs	w22, w22, #1
	b.ne	LBB0_19
; %bb.20:                               ;   in Loop: Header=BB0_18 Depth=1
	ldur	w22, [x23, #-4]
	cbnz	w22, LBB0_18
LBB0_21:
	str	xzr, [x20, #24]
	ldr	w8, [x20]
	mov	w9, #8090
	cmp	w8, w9
	b.eq	LBB0_24
; %bb.22:
	ldr	w2, [x20, #12]
	cbz	w2, LBB0_24
; %bb.23:
	mov	x0, x20
	mov	w1, #903
	bl	_dib8000_write_word
LBB0_24:
	mov	x0, x20
	mov	w1, #1285
	bl	_dib8000_read_word
	and	w2, w0, #0xfffffffd
	mov	x0, x20
	mov	w1, #1285
	bl	_dib8000_write_word
	mov	x0, x19
	mov	w1, #6000
	bl	_dib8000_set_bandwidth
Lloh23:
	adrp	x8, _DIBX000_SLOW_ADC_ON@GOTPAGE
Lloh24:
	ldr	x8, [x8, _DIBX000_SLOW_ADC_ON@GOTPAGEOFF]
Lloh25:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dib8000_set_adc_state
	mov	x0, x20
	bl	_dib8000_sad_calib
	ldr	w8, [x20]
	mov	w9, #32912
	cmp	w8, w9
	b.eq	LBB0_26
; %bb.25:
Lloh26:
	adrp	x8, _DIBX000_SLOW_ADC_OFF@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DIBX000_SLOW_ADC_OFF@GOTPAGEOFF]
Lloh28:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dib8000_set_adc_state
LBB0_26:
	mov	x0, x20
	mov	w1, #285
	bl	_dib8000_read_word
	orr	w2, w0, #0x60
	mov	x0, x20
	mov	w1, #285
	bl	_dib8000_write_word
Lloh29:
	adrp	x8, _DIB8000_POWER_INTERFACE_ONLY@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DIB8000_POWER_INTERFACE_ONLY@GOTPAGEOFF]
Lloh31:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_dib8000_set_power_mode
	mov	x0, x19
	bl	_dib8000_reset_stats
	mov	w0, #0
LBB0_27:
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"error : dib8000 MA not supported\n"

	.comm	_DIB8000_POWER_ALL,4,2          ; @DIB8000_POWER_ALL
	.comm	_DIBX000_ADC_OFF,4,2            ; @DIBX000_ADC_OFF
l_.str.1:                               ; @.str.1
	.asciz	"using standard PAD-drive-settings, please adjust settings in config-struct to be optimal.\n"

l_.str.2:                               ; @.str.2
	.asciz	"GPIO reset was not successful.\n"

	.comm	_OUTMODE_HIGH_Z,4,2             ; @OUTMODE_HIGH_Z
l_.str.3:                               ; @.str.3
	.asciz	"OUTPUT_MODE could not be reset.\n"

	.comm	_dib8000_defaults,8,3           ; @dib8000_defaults
	.comm	_DIBX000_SLOW_ADC_ON,4,2        ; @DIBX000_SLOW_ADC_ON
	.comm	_DIBX000_SLOW_ADC_OFF,4,2       ; @DIBX000_SLOW_ADC_OFF
	.comm	_DIB8000_POWER_INTERFACE_ONLY,4,2 ; @DIB8000_POWER_INTERFACE_ONLY
	.no_dead_strip	_dib8000_reset
.subsections_via_symbols
