	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function prepare_read_prog_cmd
_prepare_read_prog_cmd:                 ## @prepare_read_prog_cmd
	.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
	movl	%ecx, %r15d
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movq	32(%rdi), %rax
	movq	8(%rax), %r12
	movl	(%rax), %eax
	cmpl	$512, %eax                      ## imm = 0x200
	je	LBB0_4
## %bb.1:
	cmpl	$2048, %eax                     ## imm = 0x800
	jne	LBB0_3
## %bb.2:
	cmpl	$0, 24(%rbx)
	movl	$2112, %ecx                     ## imm = 0x840
	movl	$2088, %eax                     ## imm = 0x828
	cmovel	%ecx, %eax
	jmp	LBB0_5
LBB0_4:
	xorl	%eax, %eax
	cmpl	$0, 24(%rbx)
	sete	%al
	leal	520(,%rax,8), %eax
LBB0_5:
	movl	%eax, (%rbx)
	movl	%r14d, %eax
	andl	$65280, %eax                    ## imm = 0xFF00
	je	LBB0_7
## %bb.6:
	movq	_NDCB0_DBC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_7:
	orl	%r14d, %eax
	movl	%eax, 4(%rbx)
	movq	$0, 8(%rbx)
	movl	20(%rbx), %edi
	addl	16(%rbx), %edi
	callq	_NDCB0_ADDR_CYC
	orl	%eax, 4(%rbx)
	cmpl	$2, 20(%rbx)
	jne	LBB0_10
## %bb.8:
	movl	%r15d, %eax
	shll	$16, %eax
	orl	%eax, 8(%rbx)
	cmpl	$3, 16(%rbx)
	jne	LBB0_11
## %bb.9:
	shrl	$16, %r15d
	movzbl	%r15b, %eax
	movl	%eax, 12(%rbx)
	jmp	LBB0_11
LBB0_3:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r15d, %r15d
	subl	(%rax), %r15d
	jmp	LBB0_13
LBB0_10:
	shll	$8, %r15d
	movl	%r15d, 8(%rbx)
LBB0_11:
	xorl	%r15d, %r15d
	cmpl	%r14d, (%r12)
	jne	LBB0_13
## %bb.12:
	movl	$1, %edi
	callq	_NDCB0_CMD_TYPE
	movq	_NDCB0_AUTO_RS@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	%eax, 4(%rbx)
LBB0_13:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NDCB0_DBC,4,2                  ## @NDCB0_DBC
	.comm	_NDCB0_AUTO_RS,4,2              ## @NDCB0_AUTO_RS
	.no_dead_strip	_prepare_read_prog_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function prepare_read_prog_cmd
_prepare_read_prog_cmd:                 ; @prepare_read_prog_cmd
	.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
	mov	x21, x3
	mov	x20, x1
	mov	x19, x0
	ldr	x8, [x0, #32]
	ldr	x22, [x8, #8]
	ldr	w8, [x8]
	cmp	w8, #512
	b.eq	LBB0_3
; %bb.1:
	cmp	w8, #2048
	b.ne	LBB0_7
; %bb.2:
	ldr	w8, [x19, #24]
	mov	w9, #2088
	mov	w10, #2112
	b	LBB0_4
LBB0_3:
	ldr	w8, [x19, #24]
	mov	w9, #520
	mov	w10, #528
LBB0_4:
	cmp	w8, #0
	csel	w8, w10, w9, eq
	str	w8, [x19]
Lloh0:
	adrp	x8, _NDCB0_DBC@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NDCB0_DBC@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	tst	w20, #0xff00
	csel	w8, wzr, w8, eq
	orr	w8, w8, w20
	str	xzr, [x19, #8]
	str	w8, [x19, #4]
	ldp	w8, w9, [x19, #16]
	add	w0, w9, w8
	bl	_NDCB0_ADDR_CYC
	ldr	w8, [x19, #4]
	orr	w8, w8, w0
	str	w8, [x19, #4]
	ldr	w8, [x19, #20]
	cmp	w8, #2
	b.ne	LBB0_8
; %bb.5:
	ldr	w8, [x19, #8]
	orr	w8, w8, w21, lsl #16
	str	w8, [x19, #8]
	ldr	w8, [x19, #16]
	cmp	w8, #3
	b.ne	LBB0_9
; %bb.6:
	ubfx	w8, w21, #16, #8
	str	w8, [x19, #12]
	b	LBB0_9
LBB0_7:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_8:
	lsl	w8, w21, #8
	str	w8, [x19, #8]
LBB0_9:
	ldr	w8, [x22]
	cmp	w8, w20
	b.ne	LBB0_11
; %bb.10:
	mov	w0, #1
	bl	_NDCB0_CMD_TYPE
	mov	x8, x0
	mov	w0, #0
Lloh6:
	adrp	x9, _NDCB0_AUTO_RS@GOTPAGE
Lloh7:
	ldr	x9, [x9, _NDCB0_AUTO_RS@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
	ldr	w9, [x19, #4]
	orr	w8, w8, w9
	str	w8, [x19, #4]
	b	LBB0_12
LBB0_11:
	mov	w0, #0
LBB0_12:
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NDCB0_DBC,4,2                  ; @NDCB0_DBC
	.comm	_NDCB0_AUTO_RS,4,2              ; @NDCB0_AUTO_RS
	.no_dead_strip	_prepare_read_prog_cmd
.subsections_via_symbols
