	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_bc_add                         ## -- Begin function bc_add
	.p2align	4, 0x90
_bc_add:                                ## @bc_add
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %r15d
	movq	_cdinfo@GOTPCREL(%rip), %rdi
	callq	_STAILQ_EMPTY
	movl	$-1, %r12d
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	movq	_V86_FLAGS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_v86@GOTPCREL(%rip), %rbx
	movl	%eax, 20(%rbx)
	movabsq	$82467667050515, %rax           ## imm = 0x4B0100000013
	movq	%rax, (%rbx)
	movl	%r15d, 8(%rbx)
	leaq	-40(%rbp), %r14
	movq	%r14, %rdi
	callq	_VTOPSEG
	movl	%eax, 16(%rbx)
	movq	%r14, %rdi
	callq	_VTOPOFF
	movl	%eax, 12(%rbx)
	xorl	%eax, %eax
	callq	_v86int
	cmpb	$0, 5(%rbx)
	jne	LBB0_12
## %bb.2:
	movl	$1, %edi
	movl	$24, %esi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_12
## %bb.3:
	movq	%rax, %r14
	movq	_BD_CDROM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%r14)
	movl	%r15d, (%r14)
	movq	%r14, %rdi
	callq	_bd_int13probe
	movl	4(%r14), %eax
	testl	%eax, %eax
	jne	LBB0_5
## %bb.4:
	movl	-40(%rbp), %eax
	movzbl	%ah, %ecx
                                        ## kill: def $eax killed $eax def $rax
	andl	$192, %eax
	leal	(%rcx,%rax,4), %eax
	incl	%eax
	movl	%eax, 4(%r14)
LBB0_5:
	movl	8(%r14), %ecx
	testl	%ecx, %ecx
	jne	LBB0_7
## %bb.6:
	movl	-36(%rbp), %ecx
	incl	%ecx
	movl	%ecx, 8(%r14)
LBB0_7:
	movl	12(%r14), %edx
	testl	%edx, %edx
	je	LBB0_8
## %bb.9:
	cmpl	$0, 16(%r14)
	je	LBB0_10
LBB0_11:
	movq	_bd_link@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_cdinfo@GOTPCREL(%rip), %rdi
	movq	%r14, %rsi
	callq	_STAILQ_INSERT_TAIL
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	xorl	%esi, %esi
	callq	_printf
	movl	$1, %edi
	callq	_bcache_add_dev
LBB0_12:
	movl	%r12d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movl	-40(%rbp), %edx
	andl	$63, %edx
	movl	%edx, 12(%r14)
	cmpl	$0, 16(%r14)
	jne	LBB0_11
LBB0_10:
	imull	%eax, %ecx
	imull	%edx, %ecx
	testl	%ecx, %ecx
	movl	$4173824, %eax                  ## imm = 0x3FB000
	cmovnel	%ecx, %eax
	movl	%eax, 16(%r14)
	jmp	LBB0_11
	.cfi_endproc
                                        ## -- End function
	.comm	_cdinfo,4,2                     ## @cdinfo
	.comm	_V86_FLAGS,4,2                  ## @V86_FLAGS
	.comm	_v86,24,2                       ## @v86
	.comm	_BD_CDROM,4,2                   ## @BD_CDROM
	.comm	_bd_link,4,2                    ## @bd_link
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BIOS CD is cd%d\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function bc_add
lCPI0_0:
	.long	19                              ; 0x13
	.long	19201                           ; 0x4b01
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_bc_add
	.p2align	2
_bc_add:                                ; @bc_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.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
	mov	x20, x0
Lloh0:
	adrp	x0, _cdinfo@GOTPAGE
Lloh1:
	ldr	x0, [x0, _cdinfo@GOTPAGEOFF]
	bl	_STAILQ_EMPTY
	cbz	w0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _V86_FLAGS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _V86_FLAGS@GOTPAGEOFF]
Lloh4:
	adrp	x19, _v86@GOTPAGE
Lloh5:
	ldr	x19, [x19, _v86@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	str	w8, [x19, #20]
Lloh7:
	adrp	x8, lCPI0_0@PAGE
Lloh8:
	ldr	d0, [x8, lCPI0_0@PAGEOFF]
	str	d0, [x19]
	str	w20, [x19, #8]
	add	x0, sp, #8
	bl	_VTOPSEG
	str	w0, [x19, #16]
	add	x0, sp, #8
	bl	_VTOPOFF
	str	w0, [x19, #12]
	bl	_v86int
	ldrb	w8, [x19, #5]
	cbz	w8, LBB0_4
LBB0_2:
	mov	w0, #-1
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
LBB0_4:
	mov	w0, #1
	mov	w1, #24
	bl	_calloc
	cbz	x0, LBB0_2
; %bb.5:
	mov	x19, x0
Lloh9:
	adrp	x8, _BD_CDROM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _BD_CDROM@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x0, #20]
	str	w20, [x0]
	bl	_bd_int13probe
	ldr	w8, [x19, #4]
	cbz	w8, LBB0_10
; %bb.6:
	ldr	w9, [x19, #8]
	cbz	w9, LBB0_11
LBB0_7:
	ldr	w10, [x19, #12]
	cbz	w10, LBB0_12
LBB0_8:
	ldr	w11, [x19, #16]
	cbz	w11, LBB0_13
LBB0_9:
Lloh12:
	adrp	x8, _bd_link@GOTPAGE
Lloh13:
	ldr	x8, [x8, _bd_link@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
Lloh15:
	adrp	x0, _cdinfo@GOTPAGE
Lloh16:
	ldr	x0, [x0, _cdinfo@GOTPAGEOFF]
	mov	x1, x19
	bl	_STAILQ_INSERT_TAIL
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	bl	_printf
	mov	w0, #1
	bl	_bcache_add_dev
	mov	w0, #0
	b	LBB0_3
LBB0_10:
	ldr	w8, [sp, #8]
	lsl	w9, w8, #2
	and	w9, w9, #0x300
	bfxil	w9, w8, #8, #8
	add	w8, w9, #1
	str	w8, [x19, #4]
	ldr	w9, [x19, #8]
	cbnz	w9, LBB0_7
LBB0_11:
	ldr	w9, [sp, #12]
	add	w9, w9, #1
	str	w9, [x19, #8]
	ldr	w10, [x19, #12]
	cbnz	w10, LBB0_8
LBB0_12:
	ldr	w10, [sp, #8]
	and	w10, w10, #0x3f
	str	w10, [x19, #12]
	ldr	w11, [x19, #16]
	cbnz	w11, LBB0_9
LBB0_13:
	mul	w8, w9, w8
	mul	w8, w8, w10
	mov	w9, #45056
	movk	w9, #63, lsl #16
	cmp	w8, #0
	csel	w8, w9, w8, eq
	str	w8, [x19, #16]
	b	LBB0_9
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_cdinfo,4,2                     ; @cdinfo
	.comm	_V86_FLAGS,4,2                  ; @V86_FLAGS
	.comm	_v86,24,2                       ; @v86
	.comm	_BD_CDROM,4,2                   ; @BD_CDROM
	.comm	_bd_link,4,2                    ; @bd_link
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BIOS CD is cd%d\n"

.subsections_via_symbols
