	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cardu_set_socket
_cardu_set_socket:                      ## @cardu_set_socket
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	_cardu_sockets@GOTPCREL(%rip), %rax
	movl	%edi, %ebx
	shlq	$2, %rbx
	addq	(%rax), %rbx
	movl	(%rsi), %edi
	cmpl	$33, %edi
	je	LBB0_10
## %bb.1:
	cmpl	$50, %edi
	jne	LBB0_2
LBB0_10:
	cmpl	4(%r14), %edi
	je	LBB0_3
## %bb.11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_12
LBB0_2:
	movl	4(%r14), %edi
LBB0_3:
	callq	_set_Vcc_value
	movl	%eax, %r15d
	movl	(%r14), %edi
	callq	_set_Vpp_value
	orl	%r15d, %eax
	movq	_SS_OUTPUT_ENA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	andl	8(%r14), %ecx
	je	LBB0_5
## %bb.4:
	movq	_CARD_OUT_EN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
LBB0_5:
	orl	%ecx, %eax
	movq	_PWR_CNT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_exca_writeb
	movq	_INT_GEN_CNT@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_exca_readb
	movl	8(%r14), %edx
	movq	_SS_RESET@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	movl	(%rax), %ecx
	movl	$0, %eax
	andl	%edx, %ecx
	jne	LBB0_7
## %bb.6:
	movq	_CARD_REST0@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	movq	_SS_IOCARD@GOTPCREL(%rip), %rcx
	andl	(%rcx), %edx
	je	LBB0_9
## %bb.8:
	movq	_CARD_TYPE_IO@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_9:
	orl	%eax, %edx
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_exca_writeb
LBB0_12:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cardu_sockets,8,3              ## @cardu_sockets
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_SS_OUTPUT_ENA,4,2              ## @SS_OUTPUT_ENA
	.comm	_CARD_OUT_EN,4,2                ## @CARD_OUT_EN
	.comm	_PWR_CNT,4,2                    ## @PWR_CNT
	.comm	_INT_GEN_CNT,4,2                ## @INT_GEN_CNT
	.comm	_CARD_REST0,4,2                 ## @CARD_REST0
	.comm	_SS_RESET,4,2                   ## @SS_RESET
	.comm	_SS_IOCARD,4,2                  ## @SS_IOCARD
	.comm	_CARD_TYPE_IO,4,2               ## @CARD_TYPE_IO
	.no_dead_strip	_cardu_set_socket
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cardu_set_socket
_cardu_set_socket:                      ; @cardu_set_socket
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x1
Lloh0:
	adrp	x8, _cardu_sockets@GOTPAGE
Lloh1:
	ldr	x8, [x8, _cardu_sockets@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x8]
	ldr	w8, [x1]
	cmp	w8, #33
	b.eq	LBB0_2
; %bb.1:
	cmp	w8, #50
	b.ne	LBB0_4
LBB0_2:
	ldr	w10, [x19, #4]
	cmp	w8, w10
	b.eq	LBB0_5
; %bb.3:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_4:
	ldr	w8, [x19, #4]
LBB0_5:
	add	x20, x9, w0, uxtw #2
	mov	x0, x8
	bl	_set_Vcc_value
	mov	x21, x0
	ldr	w0, [x19]
	bl	_set_Vpp_value
	orr	w8, w0, w21
	ldr	w9, [x19, #8]
Lloh6:
	adrp	x10, _SS_OUTPUT_ENA@GOTPAGE
Lloh7:
	ldr	x10, [x10, _SS_OUTPUT_ENA@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
Lloh9:
	adrp	x11, _CARD_OUT_EN@GOTPAGE
Lloh10:
	ldr	x11, [x11, _CARD_OUT_EN@GOTPAGEOFF]
Lloh11:
	ldr	w11, [x11]
	tst	w10, w9
	csel	w9, wzr, w11, eq
	orr	w2, w8, w9
Lloh12:
	adrp	x8, _PWR_CNT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _PWR_CNT@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_exca_writeb
Lloh15:
	adrp	x21, _INT_GEN_CNT@GOTPAGE
Lloh16:
	ldr	x21, [x21, _INT_GEN_CNT@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_exca_readb
	ldr	w8, [x19, #8]
Lloh17:
	adrp	x9, _SS_RESET@GOTPAGE
Lloh18:
	ldr	x9, [x9, _SS_RESET@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
Lloh20:
	adrp	x10, _CARD_REST0@GOTPAGE
Lloh21:
	ldr	x10, [x10, _CARD_REST0@GOTPAGEOFF]
Lloh22:
	ldr	w10, [x10]
	tst	w9, w8
	csel	w9, w10, wzr, eq
Lloh23:
	adrp	x10, _SS_IOCARD@GOTPAGE
Lloh24:
	ldr	x10, [x10, _SS_IOCARD@GOTPAGEOFF]
Lloh25:
	adrp	x11, _CARD_TYPE_IO@GOTPAGE
Lloh26:
	ldr	x11, [x11, _CARD_TYPE_IO@GOTPAGEOFF]
Lloh27:
	ldr	w10, [x10]
Lloh28:
	ldr	w11, [x11]
	tst	w10, w8
	csel	w8, wzr, w11, eq
	orr	w2, w8, w9
	ldr	w1, [x21]
	mov	x0, x20
	bl	_exca_writeb
	mov	w0, #0
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh27
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_cardu_sockets,8,3              ; @cardu_sockets
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_SS_OUTPUT_ENA,4,2              ; @SS_OUTPUT_ENA
	.comm	_CARD_OUT_EN,4,2                ; @CARD_OUT_EN
	.comm	_PWR_CNT,4,2                    ; @PWR_CNT
	.comm	_INT_GEN_CNT,4,2                ; @INT_GEN_CNT
	.comm	_CARD_REST0,4,2                 ; @CARD_REST0
	.comm	_SS_RESET,4,2                   ; @SS_RESET
	.comm	_SS_IOCARD,4,2                  ; @SS_IOCARD
	.comm	_CARD_TYPE_IO,4,2               ; @CARD_TYPE_IO
	.no_dead_strip	_cardu_set_socket
.subsections_via_symbols
