	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function memconsole_ebda_init
_memconsole_ebda_init:                  ## @memconsole_ebda_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r14d, %r14d
	xorl	%eax, %eax
	callq	_get_bios_ebda
	testl	%eax, %eax
	je	LBB0_7
## %bb.1:
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_phys_to_virt
	movq	(%rax), %r14
	shlq	$10, %r14
	je	LBB0_6
## %bb.2:
	movq	_BIOS_MEMCONSOLE_V1_MAGIC@GOTPCREL(%rip), %r15
	movq	_BIOS_MEMCONSOLE_V2_MAGIC@GOTPCREL(%rip), %r12
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_phys_to_virt
	movq	(%rax), %rcx
	cmpq	(%r15), %rcx
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpq	(%r12), %rcx
	je	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	incl	%ebx
	decq	%r14
	jne	LBB0_3
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	callq	_pr_info
	xorl	%r14d, %r14d
	jmp	LBB0_11
LBB0_7:
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
	jmp	LBB0_11
LBB0_8:
	movq	%rax, %rdi
	callq	_found_v1_header
	jmp	LBB0_10
LBB0_9:
	movq	%rax, %rdi
	callq	_found_v2_header
LBB0_10:
	movl	$1, %r14d
LBB0_11:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"memconsole: BIOS EBDA non-existent.\n"

	.comm	_BIOS_MEMCONSOLE_V1_MAGIC,8,3   ## @BIOS_MEMCONSOLE_V1_MAGIC
	.comm	_BIOS_MEMCONSOLE_V2_MAGIC,8,3   ## @BIOS_MEMCONSOLE_V2_MAGIC
L_.str.1:                               ## @.str.1
	.asciz	"memconsole: BIOS console EBDA structure not found!\n"

	.no_dead_strip	_memconsole_ebda_init
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function memconsole_ebda_init
_memconsole_ebda_init:                  ; @memconsole_ebda_init
	.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
	bl	_get_bios_ebda
	cbz	w0, LBB0_7
; %bb.1:
	mov	x19, x0
	bl	_phys_to_virt
	ldr	x8, [x0]
	lsl	x20, x8, #10
	cbz	x20, LBB0_6
; %bb.2:
Lloh0:
	adrp	x21, _BIOS_MEMCONSOLE_V1_MAGIC@GOTPAGE
Lloh1:
	ldr	x21, [x21, _BIOS_MEMCONSOLE_V1_MAGIC@GOTPAGEOFF]
Lloh2:
	adrp	x22, _BIOS_MEMCONSOLE_V2_MAGIC@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BIOS_MEMCONSOLE_V2_MAGIC@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_phys_to_virt
	ldr	x8, [x0]
	ldr	x9, [x21]
	cmp	x8, x9
	b.eq	LBB0_10
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x9, [x22]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	w19, w19, #1
	subs	x20, x20, #1
	b.ne	LBB0_3
LBB0_6:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
LBB0_8:
	bl	_pr_info
	mov	w0, #0
LBB0_9:
	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
LBB0_10:
	bl	_found_v1_header
	mov	w0, #1
	b	LBB0_9
LBB0_11:
	bl	_found_v2_header
	mov	w0, #1
	b	LBB0_9
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"memconsole: BIOS EBDA non-existent.\n"

	.comm	_BIOS_MEMCONSOLE_V1_MAGIC,8,3   ; @BIOS_MEMCONSOLE_V1_MAGIC
	.comm	_BIOS_MEMCONSOLE_V2_MAGIC,8,3   ; @BIOS_MEMCONSOLE_V2_MAGIC
l_.str.1:                               ; @.str.1
	.asciz	"memconsole: BIOS console EBDA structure not found!\n"

	.no_dead_strip	_memconsole_ebda_init
.subsections_via_symbols
