	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_altera_sdcard_get_present      ## -- Begin function altera_sdcard_get_present
	.p2align	4, 0x90
_altera_sdcard_get_present:             ## @altera_sdcard_get_present
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_ALTERA_SDCARD_CSD_SIZE@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	andq	$-4, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_altera_sdcard_read_asr
	movq	_ALTERA_SDCARD_ASR_CARDPRESENT@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_1
## %bb.2:
	movq	%rbx, %rdi
	callq	_altera_sdcard_read_csd
	movq	_ALTERA_SDCARD_CSD_STRUCTURE_BYTE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ALTERA_SDCARD_CSD_STRUCTURE_MASK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	andl	(%rbx,%rax,4), %esi
	movq	_ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %esi
	testl	%esi, %esi
	je	LBB0_3
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_5
LBB0_1:
	leaq	L_str(%rip), %rdi
	callq	_puts
	jmp	LBB0_5
LBB0_3:
	movl	$1, %r14d
LBB0_5:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	movl	%r14d, %eax
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_7:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_ALTERA_SDCARD_CSD_SIZE,4,2     ## @ALTERA_SDCARD_CSD_SIZE
	.comm	_ALTERA_SDCARD_ASR_CARDPRESENT,4,2 ## @ALTERA_SDCARD_ASR_CARDPRESENT
	.comm	_ALTERA_SDCARD_CSD_STRUCTURE_BYTE,8,3 ## @ALTERA_SDCARD_CSD_STRUCTURE_BYTE
	.comm	_ALTERA_SDCARD_CSD_STRUCTURE_MASK,4,2 ## @ALTERA_SDCARD_CSD_STRUCTURE_MASK
	.comm	_ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT,4,2 ## @ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"SD Card: unrecognised csd %u\n"

L_str:                                  ## @str
	.asciz	"SD Card: not present"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_altera_sdcard_get_present      ; -- Begin function altera_sdcard_get_present
	.p2align	2
_altera_sdcard_get_present:             ; @altera_sdcard_get_present
	.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
	sub	sp, sp, #16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _ALTERA_SDCARD_CSD_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ALTERA_SDCARD_CSD_SIZE@GOTPAGEOFF]
Lloh5:
	ldrsw	x8, [x8]
	and	x8, x8, #0xfffffffffffffffc
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xfffffffffffffff0
	sub	x19, x9, x8
	mov	sp, x19
	bl	_altera_sdcard_read_asr
Lloh8:
	adrp	x8, _ALTERA_SDCARD_ASR_CARDPRESENT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ALTERA_SDCARD_ASR_CARDPRESENT@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_altera_sdcard_read_csd
Lloh11:
	adrp	x8, _ALTERA_SDCARD_CSD_STRUCTURE_BYTE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ALTERA_SDCARD_CSD_STRUCTURE_BYTE@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	ldr	w8, [x19, x8, lsl #2]
Lloh14:
	adrp	x9, _ALTERA_SDCARD_CSD_STRUCTURE_MASK@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ALTERA_SDCARD_CSD_STRUCTURE_MASK@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	and	w8, w9, w8
Lloh17:
	adrp	x9, _ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT@GOTPAGE
Lloh18:
	ldr	x9, [x9, _ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	asr	w8, w8, w9
	cbz	w8, LBB0_5
; %bb.2:
	str	x8, [sp, #-16]!
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	add	sp, sp, #16
	b	LBB0_4
LBB0_3:
Lloh22:
	adrp	x0, l_str@PAGE
Lloh23:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_4:
	mov	w0, #0
	b	LBB0_6
LBB0_5:
	mov	w0, #1
LBB0_6:
	ldur	x8, [x29, #-24]
Lloh24:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh25:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	sub	sp, x29, #16
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_ALTERA_SDCARD_CSD_SIZE,4,2     ; @ALTERA_SDCARD_CSD_SIZE
	.comm	_ALTERA_SDCARD_ASR_CARDPRESENT,4,2 ; @ALTERA_SDCARD_ASR_CARDPRESENT
	.comm	_ALTERA_SDCARD_CSD_STRUCTURE_BYTE,8,3 ; @ALTERA_SDCARD_CSD_STRUCTURE_BYTE
	.comm	_ALTERA_SDCARD_CSD_STRUCTURE_MASK,4,2 ; @ALTERA_SDCARD_CSD_STRUCTURE_MASK
	.comm	_ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT,4,2 ; @ALTERA_SDCARD_CSD_STRUCTURE_RSHIFT
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"SD Card: unrecognised csd %u\n"

l_str:                                  ; @str
	.asciz	"SD Card: not present"

.subsections_via_symbols
