	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fpga_mgr_firmware_load
_fpga_mgr_firmware_load:                ## @fpga_mgr_firmware_load
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movq	%rsi, %r15
	movq	%rdi, %rbx
	leaq	8(%rdi), %r12
	movl	4(%rdi), %ecx
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	callq	_dev_info
	movq	_FPGA_MGR_STATE_FIRMWARE_REQ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	leaq	-48(%rbp), %rdi
	movq	%r14, %rsi
	movq	%r12, %rdx
	callq	_request_firmware
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movl	%eax, %r13d
	movq	_FPGA_MGR_STATE_FIRMWARE_REQ_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rbx)
	leaq	L_.str.1(%rip), %rsi
	movq	%r12, %rdi
	movq	%r14, %rdx
	callq	_dev_err
	jmp	LBB0_3
LBB0_2:
	movq	-48(%rbp), %rax
	movl	(%rax), %ecx
	movl	4(%rax), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_fpga_mgr_buf_load
	movl	%eax, %r13d
	movq	-48(%rbp), %rdi
	callq	_release_firmware
LBB0_3:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing %s to %s\n"

	.comm	_FPGA_MGR_STATE_FIRMWARE_REQ,4,2 ## @FPGA_MGR_STATE_FIRMWARE_REQ
	.comm	_FPGA_MGR_STATE_FIRMWARE_REQ_ERR,4,2 ## @FPGA_MGR_STATE_FIRMWARE_REQ_ERR
L_.str.1:                               ## @.str.1
	.asciz	"Error requesting firmware %s\n"

	.no_dead_strip	_fpga_mgr_firmware_load
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fpga_mgr_firmware_load
_fpga_mgr_firmware_load:                ; @fpga_mgr_firmware_load
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	add	x21, x0, #8
	ldr	w3, [x0, #4]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	bl	_dev_info
Lloh2:
	adrp	x8, _FPGA_MGR_STATE_FIRMWARE_REQ@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FPGA_MGR_STATE_FIRMWARE_REQ@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	str	w8, [x20]
	add	x0, sp, #8
	mov	x1, x19
	mov	x2, x21
	bl	_request_firmware
	cbz	w0, LBB0_2
; %bb.1:
	mov	x23, x0
Lloh5:
	adrp	x8, _FPGA_MGR_STATE_FIRMWARE_REQ_ERR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FPGA_MGR_STATE_FIRMWARE_REQ_ERR@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	str	w8, [x20]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	mov	x2, x19
	bl	_dev_err
	b	LBB0_3
LBB0_2:
	ldr	x8, [sp, #8]
	ldp	w3, w2, [x8]
	mov	x0, x20
	mov	x1, x22
	bl	_fpga_mgr_buf_load
	mov	x23, x0
	ldr	x0, [sp, #8]
	bl	_release_firmware
LBB0_3:
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing %s to %s\n"

	.comm	_FPGA_MGR_STATE_FIRMWARE_REQ,4,2 ; @FPGA_MGR_STATE_FIRMWARE_REQ
	.comm	_FPGA_MGR_STATE_FIRMWARE_REQ_ERR,4,2 ; @FPGA_MGR_STATE_FIRMWARE_REQ_ERR
l_.str.1:                               ; @.str.1
	.asciz	"Error requesting firmware %s\n"

	.no_dead_strip	_fpga_mgr_firmware_load
.subsections_via_symbols
