	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function loadfw
_loadfw:                                ## @loadfw
	.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	$32, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	$0, -32(%rbp)
	movq	(%rsi), %rbx
	movq	$0, -24(%rbp)
	cmpl	$1, %edi
	jne	LBB0_1
## %bb.2:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_open
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movl	%eax, %r14d
	leaq	-24(%rbp), %rsi
	movl	%eax, %edi
	callq	_fstat
	testq	%rax, %rax
	js	LBB0_6
## %bb.8:
	movl	-24(%rbp), %esi
	movl	%esi, -32(%rbp)
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_MAP_PRIVATE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%edi, %edi
	movl	%r14d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, -40(%rbp)
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_7
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_warnx
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
	movq	%rbx, %rsi
	xorl	%eax, %eax
	callq	_warn
	jmp	LBB0_4
LBB0_6:
	leaq	L_.str.2(%rip), %rdi
LBB0_7:
	xorl	%eax, %eax
	callq	_warn
	movl	%r14d, %edi
	callq	_close
LBB0_4:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_11
LBB0_10:
	movq	_CHELSIO_T4_LOAD_FW@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	-40(%rbp), %rsi
	callq	_doit
	movl	%eax, %ebx
	movq	-40(%rbp), %rdi
	movl	-32(%rbp), %esi
	callq	_munmap
	movl	%r14d, %edi
	callq	_close
LBB0_11:
	movl	%ebx, %eax
	addq	$32, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"loadfw: incorrect number of arguments."

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
L_.str.1:                               ## @.str.1
	.asciz	"open(%s)"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"fstat"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ## @MAP_PRIVATE
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.3:                               ## @.str.3
	.asciz	"mmap"

	.comm	_CHELSIO_T4_LOAD_FW,4,2         ## @CHELSIO_T4_LOAD_FW
	.no_dead_strip	_loadfw
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function loadfw
_loadfw:                                ; @loadfw
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	str	xzr, [sp, #24]
	ldr	x20, [x1]
	str	xzr, [sp, #8]
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.1:
Lloh0:
	adrp	x8, _O_RDONLY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDONLY@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_open
	tbnz	w0, #31, LBB0_6
; %bb.2:
	mov	x19, x0
	add	x1, sp, #8
	bl	_fstat
	tbnz	x0, #63, LBB0_7
; %bb.3:
	ldr	w1, [sp, #8]
	str	w1, [sp, #24]
Lloh3:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _MAP_PRIVATE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAP_PRIVATE@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	mov	w0, #0
	mov	x4, x19
	mov	w5, #0
	bl	_mmap
	str	x0, [sp, #16]
Lloh9:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_10
; %bb.4:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_5:
Lloh14:
	adrp	x0, l_.str@PAGE
Lloh15:
	add	x0, x0, l_.str@PAGEOFF
	bl	_warnx
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh18:
	ldr	w20, [x8]
	b	LBB0_11
LBB0_6:
	str	x20, [sp]
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_warn
	b	LBB0_9
LBB0_7:
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
LBB0_8:
	bl	_warn
	mov	x0, x19
	bl	_close
LBB0_9:
Lloh23:
	adrp	x8, _errno@GOTPAGE
Lloh24:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh25:
	ldr	w20, [x8]
	b	LBB0_11
LBB0_10:
Lloh26:
	adrp	x8, _CHELSIO_T4_LOAD_FW@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CHELSIO_T4_LOAD_FW@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	add	x1, sp, #16
	bl	_doit
	mov	x20, x0
	ldr	x0, [sp, #16]
	ldr	w1, [sp, #24]
	bl	_munmap
	mov	x0, x19
	bl	_close
LBB0_11:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"loadfw: incorrect number of arguments."

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
l_.str.1:                               ; @.str.1
	.asciz	"open(%s)"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"fstat"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_MAP_PRIVATE,4,2                ; @MAP_PRIVATE
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.3:                               ; @.str.3
	.asciz	"mmap"

	.comm	_CHELSIO_T4_LOAD_FW,4,2         ; @CHELSIO_T4_LOAD_FW
	.no_dead_strip	_loadfw
.subsections_via_symbols
