	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function kvaser_pciefd_read_cfg
_kvaser_pciefd_read_cfg:                ## @kvaser_pciefd_read_cfg
	.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	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_KVASER_PCIEFD_FLASH_RES_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	$0, -44(%rbp)
	movl	$0, -36(%rbp)
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_ARRAY_SIZE
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	movq	%rbx, %rcx
	movl	$1, %r8d
	callq	_kvaser_pciefd_spi_cmd
	testl	%eax, %eax
	je	LBB0_3
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_13
LBB0_3:
	movq	_KVASER_PCIEFD_CFG_IMG_SZ@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_9
## %bb.4:
	movq	%rax, %r14
	movl	-48(%rbp), %edx
	movq	_KVASER_PCIEFD_FLASH_ID_EPCS16@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %edx
	jne	LBB0_10
## %bb.5:
	movq	_KVASER_PCIEFD_FLASH_STATUS_CMD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	leaq	-48(%rbp), %rcx
	movq	%r15, %rdi
	movq	%rcx, %rsi
	movl	$1, %edx
	movl	$1, %r8d
	callq	_kvaser_pciefd_spi_cmd
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.6:
	testb	$1, -48(%rbp)
	jne	LBB0_15
## %bb.7:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_kvaser_pciefd_cfg_read_and_verify
	testl	%eax, %eax
	je	LBB0_16
## %bb.8:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_9:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_10:
	movq	(%r15), %rdi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_dev_err
	movq	_ENODEV@GOTPCREL(%rip), %rax
LBB0_11:
	subl	(%rax), %ebx
LBB0_12:
	movq	%r14, %rdi
	callq	_kfree
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_17
## %bb.14:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	movq	(%r15), %rdi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_dev_err
	jmp	LBB0_12
LBB0_16:
	movq	%r15, %rdi
	movq	%r14, %rsi
	callq	_kvaser_pciefd_cfg_read_params
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_KVASER_PCIEFD_FLASH_RES_CMD,4,2 ## @KVASER_PCIEFD_FLASH_RES_CMD
	.comm	_EIO,4,2                        ## @EIO
	.comm	_KVASER_PCIEFD_CFG_IMG_SZ,4,2   ## @KVASER_PCIEFD_CFG_IMG_SZ
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_KVASER_PCIEFD_FLASH_ID_EPCS16,4,2 ## @KVASER_PCIEFD_FLASH_ID_EPCS16
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Flash id is 0x%x instead of expected EPCS16 (0x%x)\n"

	.comm	_ENODEV,4,2                     ## @ENODEV
	.comm	_KVASER_PCIEFD_FLASH_STATUS_CMD,4,2 ## @KVASER_PCIEFD_FLASH_STATUS_CMD
L_.str.1:                               ## @.str.1
	.asciz	"Unexpected WIP bit set in flash\n"

	.no_dead_strip	_kvaser_pciefd_read_cfg
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function kvaser_pciefd_read_cfg
_kvaser_pciefd_read_cfg:                ; @kvaser_pciefd_read_cfg
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _KVASER_PCIEFD_FLASH_RES_CMD@GOTPAGE
Lloh4:
	ldr	x9, [x9, _KVASER_PCIEFD_FLASH_RES_CMD@GOTPAGEOFF]
	str	x8, [sp, #40]
Lloh5:
	ldr	w8, [x9]
	stp	w8, wzr, [sp, #24]
	str	xzr, [sp, #32]
	add	x0, sp, #24
	bl	_ARRAY_SIZE
	mov	x2, x0
	add	x1, sp, #24
	add	x3, sp, #24
	mov	x0, x20
	mov	w4, #1
	bl	_kvaser_pciefd_spi_cmd
	cbz	w0, LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _EIO@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_2:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_13
LBB0_3:
Lloh8:
	adrp	x8, _KVASER_PCIEFD_CFG_IMG_SZ@GOTPAGE
Lloh9:
	ldr	x8, [x8, _KVASER_PCIEFD_CFG_IMG_SZ@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
Lloh11:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	bl	_kmalloc
	cbz	x0, LBB0_9
; %bb.4:
	mov	x19, x0
	ldr	w8, [sp, #24]
Lloh14:
	adrp	x9, _KVASER_PCIEFD_FLASH_ID_EPCS16@GOTPAGE
Lloh15:
	ldr	x9, [x9, _KVASER_PCIEFD_FLASH_ID_EPCS16@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	cmp	w8, w9
	b.ne	LBB0_10
; %bb.5:
Lloh17:
	adrp	x8, _KVASER_PCIEFD_FLASH_STATUS_CMD@GOTPAGE
Lloh18:
	ldr	x8, [x8, _KVASER_PCIEFD_FLASH_STATUS_CMD@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	add	x1, sp, #24
	add	x3, sp, #24
	mov	x0, x20
	mov	w2, #1
	mov	w4, #1
	bl	_kvaser_pciefd_spi_cmd
	mov	x21, x0
	cbnz	w0, LBB0_12
; %bb.6:
	ldrb	w8, [sp, #24]
	tbnz	w8, #0, LBB0_15
; %bb.7:
	mov	x0, x20
	mov	x1, x19
	bl	_kvaser_pciefd_cfg_read_and_verify
	cbz	w0, LBB0_16
; %bb.8:
Lloh20:
	adrp	x8, _EIO@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_11
LBB0_9:
Lloh22:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh23:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_2
LBB0_10:
	ldr	x0, [x20]
	stp	x8, x9, [sp]
Lloh24:
	adrp	x1, l_.str@PAGE
Lloh25:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_err
Lloh26:
	adrp	x8, _ENODEV@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ENODEV@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x19
	bl	_kfree
LBB0_13:
	ldr	x8, [sp, #40]
Lloh28:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh29:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh30:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.14:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_15:
Lloh31:
	adrp	x8, _EIO@GOTPAGE
Lloh32:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	neg	w21, w8
	ldr	x0, [x20]
Lloh34:
	adrp	x1, l_.str.1@PAGE
Lloh35:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
	b	LBB0_12
LBB0_16:
	mov	x0, x20
	mov	x1, x19
	bl	_kvaser_pciefd_cfg_read_params
	mov	w21, #0
	b	LBB0_12
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_KVASER_PCIEFD_FLASH_RES_CMD,4,2 ; @KVASER_PCIEFD_FLASH_RES_CMD
	.comm	_EIO,4,2                        ; @EIO
	.comm	_KVASER_PCIEFD_CFG_IMG_SZ,4,2   ; @KVASER_PCIEFD_CFG_IMG_SZ
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_KVASER_PCIEFD_FLASH_ID_EPCS16,4,2 ; @KVASER_PCIEFD_FLASH_ID_EPCS16
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Flash id is 0x%x instead of expected EPCS16 (0x%x)\n"

	.comm	_ENODEV,4,2                     ; @ENODEV
	.comm	_KVASER_PCIEFD_FLASH_STATUS_CMD,4,2 ; @KVASER_PCIEFD_FLASH_STATUS_CMD
l_.str.1:                               ; @.str.1
	.asciz	"Unexpected WIP bit set in flash\n"

	.no_dead_strip	_kvaser_pciefd_read_cfg
.subsections_via_symbols
