	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fw_read_img
_fw_read_img:                           ## @fw_read_img
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r13
	movq	%r8, %rbx
	movl	%ecx, %r15d
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movl	%esi, %r12d
	movq	%rdi, %r14
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r8, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	leaq	-64(%rbp), %rsi
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movl	%eax, %edi
	callq	_fstat
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	movl	-64(%rbp), %ebx
	testl	%ebx, %ebx
	je	LBB0_5
## %bb.8:
	movl	%ebx, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.10:
	movq	%rax, %r8
	movl	(%r13), %eax
	cmpl	$130, %eax
	movl	%ebx, -60(%rbp)                 ## 4-byte Spill
	je	LBB0_21
## %bb.11:
	cmpl	$129, %eax
	je	LBB0_25
## %bb.12:
	cmpl	$128, %eax
	jne	LBB0_13
## %bb.14:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	movq	%r8, %r12
	movq	%r8, %rsi
	movl	$16, %edx
	callq	_read
	cmpl	$16, %eax
	movq	16(%rbp), %r13
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jne	LBB0_15
## %bb.16:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r14d, %edi
	xorl	%esi, %esi
	callq	_lseek
	cmpl	$-1, %eax
	je	LBB0_17
## %bb.19:
	leaq	L_.str.6(%rip), %rsi
	movq	%r12, %rdi
	movl	$16, %edx
	callq	_strncmp
	movl	$80, %r14d
	testl	%eax, %eax
	je	LBB0_26
## %bb.20:
	movl	-60(%rbp), %eax                 ## 4-byte Reload
	andl	$-2147483137, %eax              ## imm = 0x800001FF
	cmpl	$80, %eax
	jne	LBB0_29
	jmp	LBB0_26
LBB0_1:
	leaq	L_.str(%rip), %rdi
	xorl	%r12d, %r12d
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_31
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_7
LBB0_5:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_6
LBB0_9:
	leaq	L_.str.3(%rip), %rdi
LBB0_6:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	callq	_warnx
LBB0_7:
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movq	16(%rbp), %r13
LBB0_24:
	callq	_close
	movl	$0, (%r13)
	xorl	%r12d, %r12d
LBB0_31:
	movq	%r12, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_21:
	movl	4(%r13), %eax
	movq	_T_SEQUENTIAL@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jne	LBB0_13
## %bb.22:
	movl	%r15d, (%rsp)
	movq	%r14, %rdi
	movl	%r12d, %esi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movq	%r8, %r12
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %r9
	callq	_fw_validate_ibm
	testl	%eax, %eax
	movq	16(%rbp), %r13
	jne	LBB0_23
	jmp	LBB0_29
LBB0_13:
	movq	16(%rbp), %r13
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r8, %r12
	jmp	LBB0_29
LBB0_25:
	movslq	%ebx, %rax
	imulq	$2134974035, %rax, %rax         ## imm = 0x7F411E53
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$41, %rax
	addl	%ecx, %eax
	imull	$1030, %eax, %eax               ## imm = 0x406
	movl	%ebx, %r14d
	subl	%eax, %r14d
	movq	16(%rbp), %r13
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r8, %r12
	je	LBB0_29
LBB0_26:
	movq	_stdout@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.7(%rip), %rsi
	movl	%r14d, %edx
	callq	_fprintf
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	movl	%r14d, %esi
	callq	_lseek
	cmpl	$-1, %eax
	je	LBB0_27
## %bb.28:
	subl	%r14d, -60(%rbp)                ## 4-byte Folded Spill
LBB0_29:
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	movl	%r14d, %edi
	movq	%r12, %rsi
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	callq	_read
	cmpl	%ebx, %eax
	jne	LBB0_15
## %bb.30:
	movl	%ebx, (%r13)
	movl	%r14d, %edi
	callq	_close
	jmp	LBB0_31
LBB0_15:
	leaq	L_.str.4(%rip), %rdi
	movq	%r15, %rsi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_23
LBB0_27:
	leaq	L_.str.8(%rip), %rdi
	jmp	LBB0_18
LBB0_17:
	leaq	L_.str.5(%rip), %rdi
LBB0_18:
	xorl	%eax, %eax
	callq	_warn
LBB0_23:
	movq	%r12, %rdi
	callq	_free
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	jmp	LBB0_24
	.cfi_endproc
                                        ## -- End function
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Could not open image file %s"

L_.str.1:                               ## @.str.1
	.asciz	"Could not stat image file %s"

L_.str.2:                               ## @.str.2
	.asciz	"Zero length image file %s"

L_.str.3:                               ## @.str.3
	.asciz	"Could not allocate buffer to read image file %s"

L_.str.4:                               ## @.str.4
	.asciz	"Could not read image file %s"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.5:                               ## @.str.5
	.asciz	"Unable to lseek"

L_.str.6:                               ## @.str.6
	.asciz	"SEAGATE,SEAGATE "

	.comm	_T_SEQUENTIAL,4,2               ## @T_SEQUENTIAL
	.comm	_stdout,4,2                     ## @stdout
L_.str.7:                               ## @.str.7
	.asciz	"Skipping %d byte header.\n"

L_.str.8:                               ## @.str.8
	.asciz	"Could not lseek"

	.no_dead_strip	_fw_read_img
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fw_read_img
_fw_read_img:                           ; @fw_read_img
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x6
	mov	x28, x5
	mov	x21, x4
	mov	x24, x3
	mov	x25, x2
	mov	x26, x1
	mov	x27, x0
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x4
	bl	_open
	tbnz	w0, #31, LBB0_11
; %bb.1:
	mov	x20, x0
	add	x1, sp, #8
	bl	_fstat
	tbnz	x0, #63, LBB0_12
; %bb.2:
	ldr	w23, [sp, #8]
	cbz	w23, LBB0_13
; %bb.3:
	mov	x0, x23
	bl	_malloc
	cbz	x0, LBB0_14
; %bb.4:
	mov	x22, x0
	ldr	w8, [x28]
	cmp	w8, #130
	b.eq	LBB0_16
; %bb.5:
	cmp	w8, #129
	b.eq	LBB0_18
; %bb.6:
	cmp	w8, #128
	b.ne	LBB0_21
; %bb.7:
	mov	x0, x20
	mov	x1, x22
	mov	w2, #16
	bl	_read
	cmp	w0, #16
	b.ne	LBB0_23
; %bb.8:
Lloh3:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x20
	mov	w1, #0
	bl	_lseek
	cmn	w0, #1
	b.eq	LBB0_29
; %bb.9:
Lloh6:
	adrp	x1, l_.str.6@PAGE
Lloh7:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	x0, x22
	mov	w2, #16
	bl	_strncmp
	mov	w24, #80
	cbz	w0, LBB0_19
; %bb.10:
	and	w8, w23, #0x800001ff
	cmp	w8, #80
	b.ne	LBB0_21
	b	LBB0_19
LBB0_11:
	str	x21, [sp]
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warn
	mov	x22, #0
	b	LBB0_27
LBB0_12:
	str	x21, [sp]
Lloh10:
	adrp	x0, l_.str.1@PAGE
Lloh11:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	b	LBB0_26
LBB0_13:
Lloh12:
	adrp	x0, l_.str.2@PAGE
Lloh13:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_14:
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_15:
	mov	x1, x21
	bl	_warnx
	b	LBB0_26
LBB0_16:
	ldr	w8, [x28, #4]
Lloh16:
	adrp	x9, _T_SEQUENTIAL@GOTPAGE
Lloh17:
	ldr	x9, [x9, _T_SEQUENTIAL@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_21
; %bb.17:
	mov	x0, x27
	mov	x1, x26
	mov	x2, x25
	mov	x3, x20
	mov	x4, x22
	mov	x5, x21
	mov	x6, x24
	bl	_fw_validate_ibm
	cbnz	w0, LBB0_25
	b	LBB0_21
LBB0_18:
	mov	w8, #7763
	movk	w8, #32577, lsl #16
	smull	x8, w23, w8
	lsr	x9, x8, #63
	asr	x8, x8, #41
	add	w8, w8, w9
	mov	w9, #1030
	msub	w24, w8, w9, w23
	cbz	w24, LBB0_21
LBB0_19:
Lloh19:
	adrp	x8, _stdout@GOTPAGE
Lloh20:
	ldr	x8, [x8, _stdout@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x1, l_.str.7@PAGE
Lloh23:
	add	x1, x1, l_.str.7@PAGEOFF
	mov	x2, x24
	bl	_fprintf
Lloh24:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh25:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh26:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x24
	bl	_lseek
	cmn	w0, #1
	b.eq	LBB0_28
; %bb.20:
	sub	w23, w23, w24
LBB0_21:
	mov	x0, x20
	mov	x1, x22
	mov	x2, x23
	bl	_read
	cmp	w0, w23
	b.ne	LBB0_23
; %bb.22:
	str	w23, [x19]
	mov	x0, x20
	bl	_close
	b	LBB0_27
LBB0_23:
	str	x21, [sp]
Lloh27:
	adrp	x0, l_.str.4@PAGE
Lloh28:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_24:
	bl	_warn
LBB0_25:
	mov	x0, x22
	bl	_free
LBB0_26:
	mov	x0, x20
	bl	_close
	mov	x22, #0
	str	wzr, [x19]
LBB0_27:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_28:
Lloh29:
	adrp	x0, l_.str.8@PAGE
Lloh30:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_24
LBB0_29:
Lloh31:
	adrp	x0, l_.str.5@PAGE
Lloh32:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_24
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Could not open image file %s"

l_.str.1:                               ; @.str.1
	.asciz	"Could not stat image file %s"

l_.str.2:                               ; @.str.2
	.asciz	"Zero length image file %s"

l_.str.3:                               ; @.str.3
	.asciz	"Could not allocate buffer to read image file %s"

l_.str.4:                               ; @.str.4
	.asciz	"Could not read image file %s"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.5:                               ; @.str.5
	.asciz	"Unable to lseek"

l_.str.6:                               ; @.str.6
	.asciz	"SEAGATE,SEAGATE "

	.comm	_T_SEQUENTIAL,4,2               ; @T_SEQUENTIAL
	.comm	_stdout,4,2                     ; @stdout
l_.str.7:                               ; @.str.7
	.asciz	"Skipping %d byte header.\n"

l_.str.8:                               ; @.str.8
	.asciz	"Could not lseek"

	.no_dead_strip	_fw_read_img
.subsections_via_symbols
