	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wdc_do_dump
_wdc_do_dump:                           ## @wdc_do_dump
	.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
	movl	%r9d, %r15d
	movl	%r8d, -56(%rbp)                 ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	_MAXPATHLEN@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movq	%r13, %rcx
	callq	_wdc_append_serial_name
	movq	_O_WRONLY@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$420, %edx                      ## imm = 0x1A4
	callq	_open
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	testl	%eax, %eax
	jns	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	movq	%rbx, %rdx
	xorl	%eax, %eax
	callq	_err
LBB0_2:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_NVME_MAX_XFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%r14d, %esi
	callq	_aligned_alloc
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_errx
	movq	_NVME_MAX_XFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_4:
	movslq	%r14d, %rdx
	movq	%rdx, (%rsp)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	xorl	%ecx, %ecx
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	movq	%r12, %r9
	callq	_wdc_get_data
	movslq	%r15d, %rax
	movq	%r12, %rdi
	addq	%rax, %rdi
	callq	_be32dec
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	movq	%r13, %rdx
	xorl	%eax, %eax
	callq	_errx
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_memcmp
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	leaq	L_.str.4(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_printf
LBB0_8:
	movsbl	8(%r12), %edx
	movsbl	9(%r12), %ecx
	leaq	L_.str.5(%rip), %rdi
	movl	%r15d, %esi
	movq	%rbx, %r8
	xorl	%eax, %eax
	callq	_printf
	cmpl	%r15d, %r14d
	cmovael	%r15d, %r14d
	movslq	%r14d, %rbx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_write
	cmpq	%rbx, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_err
LBB0_10:
	subl	%r14d, %r15d
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	addl	%r13d, %r14d
	subl	%r13d, %r15d
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	testl	%r15d, %r15d
	jle	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_NVME_MAX_XFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	cmpl	%r13d, %r15d
	cmovll	%r15d, %r13d
	movslq	%r13d, %rbx
	movq	%rbx, (%rsp)
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movl	%r14d, %ecx
	movl	-56(%rbp), %r8d                 ## 4-byte Reload
	movq	%r12, %r9
	callq	_wdc_get_data
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	%r12, %rsi
	movq	%rbx, %rdx
	callq	_write
	cmpq	%rbx, %rax
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_11 Depth=1
	movl	$1, %edi
	leaq	L_.str.6(%rip), %rsi
	xorl	%eax, %eax
	callq	_err
	jmp	LBB0_14
LBB0_15:
	movq	%r12, %rdi
	callq	_free
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPATHLEN,4,2                 ## @MAXPATHLEN
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open %s"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_NVME_MAX_XFER_SIZE,4,2         ## @NVME_MAX_XFER_SIZE
L_.str.1:                               ## @.str.1
	.asciz	"Can't get buffer to read dump"

L_.str.2:                               ## @.str.2
	.asciz	"No data for %s"

L_.str.3:                               ## @.str.3
	.asciz	"E6LG"

L_.str.4:                               ## @.str.4
	.asciz	"Expected header of E6LG, found '%4.4s' instead\n"

L_.str.5:                               ## @.str.5
	.asciz	"Dumping %d bytes of version %d.%d log to %s\n"

L_.str.6:                               ## @.str.6
	.asciz	"write"

	.no_dead_strip	_wdc_do_dump
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wdc_do_dump
_wdc_do_dump:                           ; @wdc_do_dump
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x26, x5
	mov	x19, x4
	mov	x20, x3
	mov	x25, x2
	mov	x24, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _MAXPATHLEN@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAXPATHLEN@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x3, x25
	bl	_wdc_append_serial_name
Lloh3:
	adrp	x8, _O_WRONLY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_WRONLY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x24
	mov	w2, #420
	bl	_open
	mov	x22, x0
	tbz	w0, #31, LBB0_2
; %bb.1:
	str	x24, [sp]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_2:
Lloh14:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _NVME_MAX_XFER_SIZE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _NVME_MAX_XFER_SIZE@GOTPAGEOFF]
Lloh19:
	ldr	w27, [x8]
	mov	x1, x27
	bl	_aligned_alloc
	mov	x23, x0
	cbnz	x0, LBB0_4
; %bb.3:
Lloh20:
	adrp	x1, l_.str.1@PAGE
Lloh21:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_errx
Lloh22:
	adrp	x8, _NVME_MAX_XFER_SIZE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _NVME_MAX_XFER_SIZE@GOTPAGEOFF]
Lloh24:
	ldr	w27, [x8]
LBB0_4:
	sxtw	x2, w27
	mov	x0, x21
	mov	x1, x20
	mov	w3, #0
	mov	x4, x19
	mov	x5, x23
	mov	x6, x2
	bl	_wdc_get_data
	add	x0, x23, w26, sxtw
	bl	_be32dec
	mov	x26, x0
	cbnz	w0, LBB0_6
; %bb.5:
	str	x25, [sp]
Lloh25:
	adrp	x1, l_.str.2@PAGE
Lloh26:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_6:
Lloh27:
	adrp	x0, l_.str.3@PAGE
Lloh28:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x23
	mov	w2, #4
	bl	_memcmp
	cbz	x0, LBB0_8
; %bb.7:
	str	x23, [sp]
Lloh29:
	adrp	x0, l_.str.4@PAGE
Lloh30:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_printf
LBB0_8:
	ldrsb	x8, [x23, #8]
	ldrsb	x9, [x23, #9]
	stp	x9, x24, [sp, #16]
	stp	x26, x8, [sp]
Lloh31:
	adrp	x0, l_.str.5@PAGE
Lloh32:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_printf
	cmp	w27, w26
	csel	w24, w27, w26, lo
	sxtw	x25, w24
	mov	x0, x22
	mov	x1, x23
	mov	x2, x25
	bl	_write
	cmp	x0, x25
	b.eq	LBB0_10
; %bb.9:
Lloh33:
	adrp	x1, l_.str.6@PAGE
Lloh34:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_err
LBB0_10:
	sub	w27, w26, w24
	cmp	w27, #1
	b.lt	LBB0_15
; %bb.11:
Lloh35:
	adrp	x25, l_.str.6@PAGE
Lloh36:
	add	x25, x25, l_.str.6@PAGEOFF
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	w24, w24, w28
	sub	w27, w27, w28
	cmp	w27, #0
	b.le	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
Lloh37:
	adrp	x8, _NVME_MAX_XFER_SIZE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _NVME_MAX_XFER_SIZE@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	cmp	w27, w8
	csel	w28, w27, w8, lt
	sxtw	x26, w28
	mov	x0, x21
	mov	x1, x20
	mov	x2, x26
	mov	x3, x24
	mov	x4, x19
	mov	x5, x23
	mov	x6, x26
	bl	_wdc_get_data
	mov	x0, x22
	mov	x1, x23
	mov	x2, x26
	bl	_write
	cmp	x0, x26
	b.eq	LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	mov	w0, #1
	mov	x1, x25
	bl	_err
	b	LBB0_12
LBB0_15:
	mov	x0, x23
	bl	_free
	mov	x0, x22
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_close
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPATHLEN,4,2                 ; @MAXPATHLEN
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open %s"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_NVME_MAX_XFER_SIZE,4,2         ; @NVME_MAX_XFER_SIZE
l_.str.1:                               ; @.str.1
	.asciz	"Can't get buffer to read dump"

l_.str.2:                               ; @.str.2
	.asciz	"No data for %s"

l_.str.3:                               ; @.str.3
	.asciz	"E6LG"

l_.str.4:                               ; @.str.4
	.asciz	"Expected header of E6LG, found '%4.4s' instead\n"

l_.str.5:                               ; @.str.5
	.asciz	"Dumping %d bytes of version %d.%d log to %s\n"

l_.str.6:                               ; @.str.6
	.asciz	"write"

	.no_dead_strip	_wdc_do_dump
.subsections_via_symbols
