	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function balloon3_pcmcia_hw_init
_balloon3_pcmcia_hw_init:               ## @balloon3_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	%rdi, %rbx
	movq	_BALLOON3_FPGA_VER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	___raw_readw
	cmpl	$20231, %eax                    ## imm = 0x4F07
	jg	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_pr_warn
LBB0_2:
	movq	_BALLOON3_BP_CF_NRDY_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_BALLOON3_GPIO_S0_CD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rcx
	movq	_SOC_STAT_CD@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	shlq	$4, %rdx
	movl	%eax, 12(%rcx,%rdx)
	leaq	L_.str.1(%rip), %rax
	movq	%rax, (%rcx,%rdx)
	movq	_BALLOON3_BP_NSTSCHG_IRQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_SOC_STAT_BVD1@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	shlq	$4, %rdx
	movl	%eax, 8(%rcx,%rdx)
	leaq	L_.str.2(%rip), %rax
	movq	%rax, (%rcx,%rdx)
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_BALLOON3_FPGA_VER,4,2          ## @BALLOON3_FPGA_VER
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"The FPGA code, version 0x%04x, is too old. PCMCIA/CF support might be broken in this version!"

	.comm	_BALLOON3_BP_CF_NRDY_IRQ,4,2    ## @BALLOON3_BP_CF_NRDY_IRQ
	.comm	_BALLOON3_GPIO_S0_CD,4,2        ## @BALLOON3_GPIO_S0_CD
	.comm	_SOC_STAT_CD,8,3                ## @SOC_STAT_CD
L_.str.1:                               ## @.str.1
	.asciz	"PCMCIA0 CD"

	.comm	_BALLOON3_BP_NSTSCHG_IRQ,4,2    ## @BALLOON3_BP_NSTSCHG_IRQ
	.comm	_SOC_STAT_BVD1,8,3              ## @SOC_STAT_BVD1
L_.str.2:                               ## @.str.2
	.asciz	"PCMCIA0 STSCHG"

	.no_dead_strip	_balloon3_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 balloon3_pcmcia_hw_init
_balloon3_pcmcia_hw_init:               ; @balloon3_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	x19, x0
Lloh0:
	adrp	x8, _BALLOON3_FPGA_VER@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BALLOON3_FPGA_VER@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	___raw_readw
	mov	w8, #20231
	cmp	w0, w8
	b.gt	LBB0_2
; %bb.1:
	mov	x1, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_warn
LBB0_2:
Lloh5:
	adrp	x8, _BALLOON3_BP_CF_NRDY_IRQ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _BALLOON3_BP_CF_NRDY_IRQ@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x19, #8]
Lloh8:
	adrp	x8, _BALLOON3_GPIO_S0_CD@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BALLOON3_GPIO_S0_CD@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	x9, [x19]
Lloh11:
	adrp	x10, _SOC_STAT_CD@GOTPAGE
Lloh12:
	ldr	x10, [x10, _SOC_STAT_CD@GOTPAGEOFF]
Lloh13:
	ldr	x10, [x10]
	add	x10, x9, x10, lsl #4
	str	w8, [x10, #12]
Lloh14:
	adrp	x8, l_.str.1@PAGE
Lloh15:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x10]
Lloh16:
	adrp	x8, _BALLOON3_BP_NSTSCHG_IRQ@GOTPAGE
Lloh17:
	ldr	x8, [x8, _BALLOON3_BP_NSTSCHG_IRQ@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
Lloh19:
	adrp	x10, _SOC_STAT_BVD1@GOTPAGE
Lloh20:
	ldr	x10, [x10, _SOC_STAT_BVD1@GOTPAGEOFF]
Lloh21:
	ldr	x10, [x10]
	add	x9, x9, x10, lsl #4
	str	w8, [x9, #8]
Lloh22:
	adrp	x8, l_.str.2@PAGE
Lloh23:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x8, [x9]
	mov	w0, #0
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_BALLOON3_FPGA_VER,4,2          ; @BALLOON3_FPGA_VER
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"The FPGA code, version 0x%04x, is too old. PCMCIA/CF support might be broken in this version!"

	.comm	_BALLOON3_BP_CF_NRDY_IRQ,4,2    ; @BALLOON3_BP_CF_NRDY_IRQ
	.comm	_BALLOON3_GPIO_S0_CD,4,2        ; @BALLOON3_GPIO_S0_CD
	.comm	_SOC_STAT_CD,8,3                ; @SOC_STAT_CD
l_.str.1:                               ; @.str.1
	.asciz	"PCMCIA0 CD"

	.comm	_BALLOON3_BP_NSTSCHG_IRQ,4,2    ; @BALLOON3_BP_NSTSCHG_IRQ
	.comm	_SOC_STAT_BVD1,8,3              ; @SOC_STAT_BVD1
l_.str.2:                               ; @.str.2
	.asciz	"PCMCIA0 STSCHG"

	.no_dead_strip	_balloon3_pcmcia_hw_init
.subsections_via_symbols
