	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ubd_add
_ubd_add:                               ## @ubd_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_ubd_devs@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	movslq	%edi, %r14
	movq	%r14, %r13
	shlq	$5, %r13
	xorl	%eax, %eax
	cmpq	$0, 24(%rbx,%r13)
	je	LBB0_12
## %bb.1:
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, -56(%rbp)                 ## 4-byte Spill
	leaq	(%rbx,%r13), %r12
	leaq	(%rbx,%r13), %r15
	addq	$8, %r15
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_ubd_file_size
	testl	%eax, %eax
	js	LBB0_2
## %bb.3:
	movl	(%r15), %edi
	callq	_ROUND_BLOCK
	movl	%eax, (%r15)
	leaq	(%rbx,%r13), %rdi
	addq	$20, %rdi
	callq	_INIT_LIST_HEAD
	movl	16(%rbx,%r13), %edi
	movq	_MAX_SG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_sg_init_table
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movq	_do_ubd_request@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	(%rbx,%r13), %rsi
	addq	$12, %rsi
	callq	_blk_init_queue
	movq	%rax, (%r12)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%r12, (%rax)
	movq	_MAX_SG@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movq	%rax, %rdi
	callq	_blk_queue_max_segments
	movq	_UBD_MAJOR@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	(%r15), %esi
	movq	_ubd_gendisk@GOTPCREL(%rip), %rax
	leaq	(,%r14,8), %r13
	movq	(%rax), %rcx
	addq	%r13, %rcx
	movl	%r14d, %edx
	callq	_ubd_disk_register
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	leaq	L_.str.2(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movq	(%r12), %rdi
	callq	_blk_cleanup_queue
	movl	%ebx, %eax
	jmp	LBB0_12
LBB0_2:
	leaq	L_.str(%rip), %rcx
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movq	%rcx, (%rdx)
	jmp	LBB0_12
LBB0_4:
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	negl	%edx
	leaq	L_.str.1(%rip), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	%rax, (%rcx)
	movl	%edx, %eax
	jmp	LBB0_12
LBB0_7:
	movq	_ubd_gendisk@GOTPCREL(%rip), %rbx
	movq	_fake_major@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_UBD_MAJOR@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rdi
	je	LBB0_9
## %bb.8:
	movl	(%r15), %esi
	movq	_fake_gendisk@GOTPCREL(%rip), %rax
	addq	(%rax), %r13
	movl	-56(%rbp), %edx                 ## 4-byte Reload
	movq	%r13, %rcx
	callq	_ubd_disk_register
LBB0_9:
	movq	_fake_ide@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_11
## %bb.10:
	movq	(%rbx), %rax
	movq	(%rax,%r14,8), %rax
	movl	(%rax), %edi
	callq	_make_ide_entries
LBB0_11:
	xorl	%eax, %eax
LBB0_12:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ubd_devs,8,3                   ## @ubd_devs
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't determine size of device's file"

	.comm	_MAX_SG,4,2                     ## @MAX_SG
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_do_ubd_request,4,2             ## @do_ubd_request
L_.str.1:                               ## @.str.1
	.asciz	"Failed to initialize device queue"

	.comm	_UBD_MAJOR,8,3                  ## @UBD_MAJOR
	.comm	_ubd_gendisk,8,3                ## @ubd_gendisk
L_.str.2:                               ## @.str.2
	.asciz	"Failed to register device"

	.comm	_fake_major,8,3                 ## @fake_major
	.comm	_fake_gendisk,8,3               ## @fake_gendisk
	.comm	_fake_ide,8,3                   ## @fake_ide
	.no_dead_strip	_ubd_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ubd_add
_ubd_add:                               ; @ubd_add
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
Lloh0:
	adrp	x8, _ubd_devs@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ubd_devs@GOTPAGEOFF]
Lloh2:
	ldr	x25, [x8]
	sxtw	x24, w19
	add	x21, x25, x24, lsl #5
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_11
; %bb.1:
	mov	x20, x1
	add	x22, x21, #8
	mov	x0, x21
	mov	x1, x22
	bl	_ubd_file_size
	tbnz	w0, #31, LBB0_5
; %bb.2:
	ldr	w0, [x22]
	bl	_ROUND_BLOCK
	str	w0, [x22]
	add	x26, x25, x24, lsl #5
	add	x0, x26, #20
	bl	_INIT_LIST_HEAD
	ldr	w0, [x26, #16]
Lloh3:
	adrp	x23, _MAX_SG@GOTPAGE
Lloh4:
	ldr	x23, [x23, _MAX_SG@GOTPAGEOFF]
	ldr	w1, [x23]
	bl	_sg_init_table
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w25, [x8]
Lloh8:
	adrp	x8, _do_ubd_request@GOTPAGE
Lloh9:
	ldr	x8, [x8, _do_ubd_request@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	add	x1, x26, #12
	bl	_blk_init_queue
	str	x0, [x21]
	cbz	x0, LBB0_6
; %bb.3:
	str	x21, [x0]
	ldr	w1, [x23]
	bl	_blk_queue_max_segments
Lloh11:
	adrp	x26, _UBD_MAJOR@GOTPAGE
Lloh12:
	ldr	x26, [x26, _UBD_MAJOR@GOTPAGEOFF]
	ldr	x0, [x26]
	ldr	w1, [x22]
Lloh13:
	adrp	x25, _ubd_gendisk@GOTPAGE
Lloh14:
	ldr	x25, [x25, _ubd_gendisk@GOTPAGEOFF]
	ldr	x8, [x25]
	add	x3, x8, x24, lsl #3
	mov	x2, x19
	bl	_ubd_disk_register
	cbz	w0, LBB0_7
; %bb.4:
	mov	x23, x0
Lloh15:
	adrp	x8, l_.str.2@PAGE
Lloh16:
	add	x8, x8, l_.str.2@PAGEOFF
	str	x8, [x20]
	ldr	x0, [x21]
	bl	_blk_cleanup_queue
	b	LBB0_12
LBB0_5:
	mov	x23, x0
Lloh17:
	adrp	x8, l_.str@PAGE
Lloh18:
	add	x8, x8, l_.str@PAGEOFF
	str	x8, [x20]
	b	LBB0_12
LBB0_6:
	neg	w23, w25
Lloh19:
	adrp	x8, l_.str.1@PAGE
Lloh20:
	add	x8, x8, l_.str.1@PAGEOFF
	str	x8, [x20]
	b	LBB0_12
LBB0_7:
Lloh21:
	adrp	x8, _fake_major@GOTPAGE
Lloh22:
	ldr	x8, [x8, _fake_major@GOTPAGEOFF]
Lloh23:
	ldr	x0, [x8]
	ldr	x8, [x26]
	cmp	x0, x8
	b.eq	LBB0_9
; %bb.8:
	ldr	w1, [x22]
Lloh24:
	adrp	x8, _fake_gendisk@GOTPAGE
Lloh25:
	ldr	x8, [x8, _fake_gendisk@GOTPAGEOFF]
Lloh26:
	ldr	x8, [x8]
	add	x3, x8, x24, lsl #3
	mov	x2, x19
	bl	_ubd_disk_register
LBB0_9:
Lloh27:
	adrp	x8, _fake_ide@GOTPAGE
Lloh28:
	ldr	x8, [x8, _fake_ide@GOTPAGEOFF]
Lloh29:
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.10:
	ldr	x8, [x25]
	ldr	x8, [x8, x24, lsl #3]
	ldr	w0, [x8]
	bl	_make_ide_entries
LBB0_11:
	mov	w23, #0
LBB0_12:
	mov	x0, x23
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_ubd_devs,8,3                   ; @ubd_devs
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't determine size of device's file"

	.comm	_MAX_SG,4,2                     ; @MAX_SG
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_do_ubd_request,4,2             ; @do_ubd_request
l_.str.1:                               ; @.str.1
	.asciz	"Failed to initialize device queue"

	.comm	_UBD_MAJOR,8,3                  ; @UBD_MAJOR
	.comm	_ubd_gendisk,8,3                ; @ubd_gendisk
l_.str.2:                               ; @.str.2
	.asciz	"Failed to register device"

	.comm	_fake_major,8,3                 ; @fake_major
	.comm	_fake_gendisk,8,3               ; @fake_gendisk
	.comm	_fake_ide,8,3                   ; @fake_ide
	.no_dead_strip	_ubd_add
.subsections_via_symbols
