	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function viper_pcmcia_hw_init
_viper_pcmcia_hw_init:                  ## @viper_pcmcia_hw_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_viper_get_pdata
	movq	%rax, %rbx
	movl	8(%rax), %eax
	movq	(%r15), %rcx
	movq	_SOC_STAT_CD@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	shlq	$4, %rdx
	movl	%eax, 8(%rcx,%rdx)
	leaq	L_.str(%rip), %rax
	movq	%rax, (%rcx,%rdx)
	movl	4(%rbx), %eax
	movq	_SOC_STAT_RDY@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	shlq	$4, %rdx
	movl	%eax, 8(%rcx,%rdx)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%rcx,%rdx)
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_gpio_request
	testq	%rax, %rax
	jne	LBB0_3
## %bb.1:
	callq	_local_irq_save
	movl	(%rbx), %edi
	xorl	%esi, %esi
	callq	_gpio_direction_output
	movq	%rax, %r15
	callq	_local_irq_restore
	testq	%r15, %r15
	je	LBB0_4
## %bb.2:
	movl	(%rbx), %edi
	callq	_gpio_free
LBB0_3:
	movq	_arcom_pcmcia_dev@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_dev_err
	movl	$-1, %r14d
LBB0_4:
	movl	%r14d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SOC_STAT_CD,8,3                ## @SOC_STAT_CD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"PCMCIA_CD"

	.comm	_SOC_STAT_RDY,8,3               ## @SOC_STAT_RDY
L_.str.1:                               ## @.str.1
	.asciz	"CF ready"

L_.str.2:                               ## @.str.2
	.asciz	"CF power"

	.comm	_arcom_pcmcia_dev,8,3           ## @arcom_pcmcia_dev
L_.str.3:                               ## @.str.3
	.asciz	"Failed to setup PCMCIA GPIOs\n"

	.no_dead_strip	_viper_pcmcia_hw_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function viper_pcmcia_hw_init
_viper_pcmcia_hw_init:                  ; @viper_pcmcia_hw_init
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	bl	_viper_get_pdata
	mov	x19, x0
	ldr	w8, [x0, #8]
	ldr	x9, [x20]
Lloh0:
	adrp	x10, _SOC_STAT_CD@GOTPAGE
Lloh1:
	ldr	x10, [x10, _SOC_STAT_CD@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
	add	x10, x9, x10, lsl #4
Lloh3:
	adrp	x11, l_.str@PAGE
Lloh4:
	add	x11, x11, l_.str@PAGEOFF
	str	w8, [x10, #8]
	str	x11, [x10]
Lloh5:
	adrp	x8, _SOC_STAT_RDY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SOC_STAT_RDY@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	add	x8, x9, x8, lsl #4
	ldp	w0, w9, [x0]
	str	w9, [x8, #8]
Lloh8:
	adrp	x9, l_.str.1@PAGE
Lloh9:
	add	x9, x9, l_.str.1@PAGEOFF
	str	x9, [x8]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_gpio_request
	cbnz	x0, LBB0_3
; %bb.1:
	bl	_local_irq_save
	ldr	w0, [x19]
	mov	w1, #0
	bl	_gpio_direction_output
	mov	x20, x0
	bl	_local_irq_restore
	cbz	x20, LBB0_5
; %bb.2:
	ldr	w0, [x19]
	bl	_gpio_free
LBB0_3:
Lloh12:
	adrp	x8, _arcom_pcmcia_dev@GOTPAGE
Lloh13:
	ldr	x8, [x8, _arcom_pcmcia_dev@GOTPAGEOFF]
Lloh14:
	ldr	x0, [x8]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_dev_err
	mov	w0, #-1
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	mov	w0, #0
	b	LBB0_4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_SOC_STAT_CD,8,3                ; @SOC_STAT_CD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"PCMCIA_CD"

	.comm	_SOC_STAT_RDY,8,3               ; @SOC_STAT_RDY
l_.str.1:                               ; @.str.1
	.asciz	"CF ready"

l_.str.2:                               ; @.str.2
	.asciz	"CF power"

	.comm	_arcom_pcmcia_dev,8,3           ; @arcom_pcmcia_dev
l_.str.3:                               ; @.str.3
	.asciz	"Failed to setup PCMCIA GPIOs\n"

	.no_dead_strip	_viper_pcmcia_hw_init
.subsections_via_symbols
