	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hw_dac_init
_hw_dac_init:                           ## @hw_dac_init
	.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), %r12
	movq	_CTSB055X@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	movq	_GPIO@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	callq	_hw_read_20kx
	cmpq	%r13, %r12
	jne	LBB0_2
## %bb.1:
	andl	$65469, %eax                    ## imm = 0xFFBD
	orl	$2, %eax
	jmp	LBB0_6
LBB0_2:
	andl	$65471, %eax                    ## imm = 0xFFBF
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_hw_write_20kx
	movq	%rbx, %rdi
	callq	_hw_reset_dac
	movq	%rbx, %rdi
	callq	_i2c_unlock
	movq	%rax, %rcx
	movl	$-1, %eax
	testq	%rcx, %rcx
	jne	LBB0_7
## %bb.3:
	movq	%rbx, %rdi
	movl	$236, %esi
	movl	$5, %edx
	callq	_hw_write_pci
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	movl	$236, %esi
	callq	_hw_read_pci
	testl	$8388608, %eax                  ## imm = 0x800000
	je	LBB0_4
## %bb.5:
	movl	(%r14), %eax
	xorl	%ecx, %ecx
	cmpl	$2, %eax
	sete	%cl
	orl	$36, %ecx
	cmpl	$4, %eax
	movl	$38, %r14d
	cmovnel	%ecx, %r14d
	movq	%rbx, %rdi
	movl	$1572992, %esi                  ## imm = 0x180080
	movl	$6, %edx
	movl	%r14d, %ecx
	callq	_i2c_write
	movq	%rbx, %rdi
	movl	$1572992, %esi                  ## imm = 0x180080
	movl	$9, %edx
	movl	%r14d, %ecx
	callq	_i2c_write
	movq	%rbx, %rdi
	movl	$1572992, %esi                  ## imm = 0x180080
	movl	$12, %edx
	movl	%r14d, %ecx
	callq	_i2c_write
	movq	%rbx, %rdi
	movl	$1572992, %esi                  ## imm = 0x180080
	movl	$15, %edx
	movl	%r14d, %ecx
	callq	_i2c_write
	movq	%rbx, %rdi
	callq	_i2c_lock
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_hw_read_20kx
	orl	$64, %eax
LBB0_6:
	movl	(%r15), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_hw_write_20kx
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CTSB055X,8,3                   ## @CTSB055X
	.comm	_GPIO,4,2                       ## @GPIO
	.no_dead_strip	_hw_dac_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hw_dac_init
_hw_dac_init:                           ; @hw_dac_init
	.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	x20, x1
	mov	x19, x0
	ldr	x22, [x0]
Lloh0:
	adrp	x8, _CTSB055X@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CTSB055X@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
Lloh3:
	adrp	x21, _GPIO@GOTPAGE
Lloh4:
	ldr	x21, [x21, _GPIO@GOTPAGEOFF]
	ldr	w1, [x21]
	bl	_hw_read_20kx
	cmp	x22, x23
	b.ne	LBB0_2
; %bb.1:
	mov	w8, #65469
	and	w8, w0, w8
	orr	w2, w8, #0x2
	b	LBB0_7
LBB0_2:
	mov	w8, #65471
	and	w2, w0, w8
	ldr	w1, [x21]
	mov	x0, x19
	bl	_hw_write_20kx
	mov	x0, x19
	bl	_hw_reset_dac
	mov	x0, x19
	bl	_i2c_unlock
	cbz	x0, LBB0_4
; %bb.3:
	mov	w0, #-1
	b	LBB0_8
LBB0_4:
	mov	x0, x19
	mov	w1, #236
	mov	w2, #5
	bl	_hw_write_pci
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #236
	bl	_hw_read_pci
	tbz	w0, #23, LBB0_5
; %bb.6:
	ldr	w8, [x20]
	cmp	w8, #2
	mov	w9, #36
	cinc	w9, w9, eq
	mov	w10, #38
	cmp	w8, #4
	csel	w20, w10, w9, eq
	mov	x0, x19
	mov	w1, #128
	movk	w1, #24, lsl #16
	mov	w2, #6
	mov	x3, x20
	bl	_i2c_write
	mov	x0, x19
	mov	w1, #128
	movk	w1, #24, lsl #16
	mov	w2, #9
	mov	x3, x20
	bl	_i2c_write
	mov	x0, x19
	mov	w1, #128
	movk	w1, #24, lsl #16
	mov	w2, #12
	mov	x3, x20
	bl	_i2c_write
	mov	x0, x19
	mov	w1, #128
	movk	w1, #24, lsl #16
	mov	w2, #15
	mov	x3, x20
	bl	_i2c_write
	mov	x0, x19
	bl	_i2c_lock
	ldr	w1, [x21]
	mov	x0, x19
	bl	_hw_read_20kx
	orr	w2, w0, #0x40
LBB0_7:
	ldr	w1, [x21]
	mov	x0, x19
	bl	_hw_write_20kx
	mov	w0, #0
LBB0_8:
	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 AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CTSB055X,8,3                   ; @CTSB055X
	.comm	_GPIO,4,2                       ; @GPIO
	.no_dead_strip	_hw_dac_init
.subsections_via_symbols
