	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_legacy_device_add          ## -- Begin function ide_legacy_device_add
	.p2align	4, 0x90
_ide_legacy_device_add:                 ## @ide_legacy_device_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	%r14
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -48(%rbp)
	leaq	-56(%rbp), %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movq	_IDE_HFLAG_QD_2ND_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_2
## %bb.1:
	leaq	-48(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	xorl	%edx, %edx
	movq	%rbx, %rcx
	movq	%r14, %r8
	callq	_ide_legacy_init_one
LBB0_2:
	leaq	-52(%rbp), %rsi
	leaq	-48(%rbp), %rdi
	movl	$1, %edx
	movq	%rbx, %rcx
	movq	%r14, %r8
	callq	_ide_legacy_init_one
	movq	-48(%rbp), %rax
	orq	-40(%rbp), %rax
	jne	LBB0_5
## %bb.3:
	movq	_IDE_HFLAG_SINGLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_5
## %bb.4:
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_6
LBB0_5:
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	movl	$2, %edx
	xorl	%ecx, %ecx
	callq	_ide_host_add
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-24(%rbp), %rcx
	jne	LBB0_8
## %bb.7:
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_IDE_HFLAG_QD_2ND_PORT,4,2      ## @IDE_HFLAG_QD_2ND_PORT
	.comm	_IDE_HFLAG_SINGLE,4,2           ## @IDE_HFLAG_SINGLE
	.comm	_ENOENT,4,2                     ## @ENOENT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ide_legacy_device_add          ; -- Begin function ide_legacy_device_add
	.p2align	2
_ide_legacy_device_add:                 ; @ide_legacy_device_add
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
	stp	xzr, xzr, [sp, #8]
	mov	x21, sp
	mov	x0, sp
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldr	w8, [x19]
Lloh3:
	adrp	x9, _IDE_HFLAG_QD_2ND_PORT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _IDE_HFLAG_QD_2ND_PORT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_2
; %bb.1:
	add	x0, sp, #8
	mov	x1, sp
	mov	w2, #0
	mov	x3, x19
	mov	x4, x20
	bl	_ide_legacy_init_one
LBB0_2:
	orr	x1, x21, #0x4
	add	x0, sp, #8
	mov	w2, #1
	mov	x3, x19
	mov	x4, x20
	bl	_ide_legacy_init_one
	ldp	x8, x9, [sp, #8]
	orr	x8, x8, x9
	cbnz	x8, LBB0_5
; %bb.3:
	ldr	w8, [x19]
Lloh6:
	adrp	x9, _IDE_HFLAG_SINGLE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _IDE_HFLAG_SINGLE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh9:
	adrp	x8, _ENOENT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_6
LBB0_5:
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #2
	mov	x3, #0
	bl	_ide_host_add
LBB0_6:
	ldr	x8, [sp, #24]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_IDE_HFLAG_QD_2ND_PORT,4,2      ; @IDE_HFLAG_QD_2ND_PORT
	.comm	_IDE_HFLAG_SINGLE,4,2           ; @IDE_HFLAG_SINGLE
	.comm	_ENOENT,4,2                     ; @ENOENT
.subsections_via_symbols
