	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function drx_ctrl_u_code
_drx_ctrl_u_code:                       ## @drx_ctrl_u_code
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	testq	%rsi, %rsi
	je	LBB0_2
## %bb.1:
	movq	(%rsi), %r14
	testq	%r14, %r14
	je	LBB0_2
## %bb.3:
	movl	%edx, %r15d
	movq	%rdi, %r13
	movq	16(%rdi), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	movq	(%rdi), %rax
	testq	%rax, %rax
	je	LBB0_4
LBB0_8:
	movl	%r15d, -56(%rbp)                ## 4-byte Spill
	movq	8(%rax), %rbx
	movl	(%rax), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	movl	(%rbx), %edi
	callq	_be16_to_cpu
	movq	%rax, %r12
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	32(%rbx), %edi
	callq	_be16_to_cpu
	movq	%rax, %r15
	movq	_DRX_UCODE_MAGIC_WORD@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	jne	LBB0_10
## %bb.9:
	testq	%r15, %r15
	je	LBB0_10
## %bb.13:
	cmpl	$129, -56(%rbp)                 ## 4-byte Folded Reload
	jne	LBB0_16
## %bb.14:
	movq	%r13, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_drx_check_firmware
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_29
## %bb.15:
	leaq	L_.str.4(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_info
	jmp	LBB0_17
LBB0_4:
	movq	$0, -120(%rbp)
	movq	8(%r13), %rax
	movl	(%rax), %edx
	leaq	-120(%rbp), %rdi
	movq	%r14, %rsi
	callq	_request_firmware
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	-120(%rbp), %rax
	movq	%rax, (%r13)
	movl	(%rax), %edx
	cmpl	$16, %edx
	jae	LBB0_7
## %bb.11:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_12
LBB0_10:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.3(%rip), %rdi
LBB0_12:
	xorl	%eax, %eax
	callq	_pr_err
LBB0_29:
	movq	(%r13), %rdi
	callq	_release_firmware
	movq	$0, (%r13)
	jmp	LBB0_41
LBB0_16:
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_info
LBB0_17:
	xorl	%ebx, %ebx
	testq	%r15, %r15
	jle	LBB0_41
## %bb.18:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	addq	$64, %rax
	cmpq	$2, %r15
	movl	$1, %ecx
	cmovgeq	%r15, %rcx
	movq	%rcx, -128(%rbp)                ## 8-byte Spill
	movq	%rax, %r15
	xorl	%eax, %eax
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_19
LBB0_5:
	movl	%eax, %ebx
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_41
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_pr_info
	movq	(%r13), %rax
	jmp	LBB0_8
LBB0_38:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	-80(%rbp), %rsp                 ## 8-byte Reload
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
LBB0_39:                                ##   in Loop: Header=BB0_19 Depth=1
	leaq	(%r15,%rbx,4), %r15
LBB0_40:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	-136(%rbp), %rax                ## 8-byte Reload
	incq	%rax
	xorl	%ebx, %ebx
	cmpq	-128(%rbp), %rax                ## 8-byte Folded Reload
	je	LBB0_41
LBB0_19:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_32 Depth 2
	movq	%rax, -136(%rbp)                ## 8-byte Spill
	movl	(%r15), %edi
	callq	_be32_to_cpu
	movl	%eax, %r14d
	movl	16(%r15), %edi
	callq	_be16_to_cpu
	movq	%rax, %r13
	movl	48(%r15), %edi
	callq	_be16_to_cpu
	movq	%rax, %rbx
	movl	80(%r15), %edi
	callq	_be16_to_cpu
	movq	%rax, %r12
	addq	$112, %r15
	movq	%r15, %rsi
	subq	-64(%rbp), %rsi                 ## 8-byte Folded Reload
	sarq	$2, %rsi
	leaq	L_.str.6(%rip), %rdi
	movq	%rsi, -104(%rbp)                ## 8-byte Spill
                                        ## kill: def $esi killed $esi killed $rsi
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	movl	%r14d, %edx
	movl	%r13d, %ecx
	movl	%ebx, %r8d
	movq	%rax, %r9
	callq	_pr_debug
	cmpl	$32767, %r13d                   ## imm = 0x7FFF
	jg	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	_DRX_UCODE_CRC_FLAG@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_drx_u_code_compute_crc
	cmpq	%r12, %rax
	jne	LBB0_22
LBB0_23:                                ##   in Loop: Header=BB0_19 Depth=1
	testl	%r13d, %r13d
	je	LBB0_40
## %bb.24:                              ##   in Loop: Header=BB0_19 Depth=1
	movslq	%r13d, %rbx
	shlq	$3, %rbx
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	cmpl	$128, %eax
	je	LBB0_30
## %bb.25:                              ##   in Loop: Header=BB0_19 Depth=1
	cmpl	$129, %eax
	jne	LBB0_2
## %bb.26:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	movq	%rbx, %rdx
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_drxdap_fasi_write_block
	testl	%eax, %eax
	je	LBB0_39
	jmp	LBB0_27
LBB0_30:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	%rsp, -80(%rbp)                 ## 8-byte Spill
	movq	_DRX_UCODE_MAX_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	je	LBB0_38
## %bb.31:                              ##   in Loop: Header=BB0_19 Depth=1
	movq	-96(%rbp), %r12                 ## 8-byte Reload
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %r15d
	movq	%r14, -144(%rbp)                ## 8-byte Spill
	.p2align	4, 0x90
LBB0_32:                                ##   Parent Loop BB0_19 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_DRX_UCODE_MAX_BUF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	cmpl	%ebx, %r15d
	cmovll	%r15d, %ebx
	movslq	%ebx, %r13
	movq	-112(%rbp), %rdi                ## 8-byte Reload
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdx
	movq	%r14, %rcx
	xorl	%r8d, %r8d
	callq	_drxdap_fasi_read_block
	testl	%eax, %eax
	jne	LBB0_33
## %bb.34:                              ##   in Loop: Header=BB0_32 Depth=2
	movq	%r12, %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_memcmp
	testl	%eax, %eax
	jne	LBB0_35
## %bb.37:                              ##   in Loop: Header=BB0_32 Depth=2
	movl	%ebx, %eax
	shrl	$31, %eax
	addl	%ebx, %eax
	sarl	%eax
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	addl	%eax, %esi
	leaq	(%r12,%r13,4), %r12
	subl	%ebx, %r15d
	movq	-144(%rbp), %r14                ## 8-byte Reload
	jne	LBB0_32
	jmp	LBB0_38
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_41:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_43
## %bb.42:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_33:
	leaq	L_.str.9(%rip), %rdi
	jmp	LBB0_36
LBB0_35:
	leaq	L_.str.10(%rip), %rdi
LBB0_36:
	xorl	%ebx, %ebx
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pr_err
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	-80(%rbp), %rsp                 ## 8-byte Reload
	jmp	LBB0_41
LBB0_22:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.7(%rip), %rdi
	xorl	%eax, %eax
	callq	_pr_err
LBB0_28:
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_29
LBB0_27:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	leaq	L_.str.8(%rip), %rdi
	movq	-104(%rbp), %rsi                ## 8-byte Reload
	xorl	%eax, %eax
	callq	_pr_err
	jmp	LBB0_28
LBB0_43:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Couldn't read firmware %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"Firmware is too short!\n"

L_.str.2:                               ## @.str.2
	.asciz	"Firmware %s, size %zu\n"

	.comm	_DRX_UCODE_MAGIC_WORD,8,3       ## @DRX_UCODE_MAGIC_WORD
L_.str.3:                               ## @.str.3
	.asciz	"Firmware magic word doesn't match\n"

L_.str.4:                               ## @.str.4
	.asciz	"Uploading firmware %s\n"

L_.str.5:                               ## @.str.5
	.asciz	"Verifying if firmware upload was ok.\n"

L_.str.6:                               ## @.str.6
	.asciz	"%zd: addr %u, size %u, flags 0x%04x, CRC 0x%04x\n"

	.comm	_DRX_UCODE_CRC_FLAG,4,2         ## @DRX_UCODE_CRC_FLAG
L_.str.7:                               ## @.str.7
	.asciz	"firmware CRC is wrong\n"

	.comm	_EIO,4,2                        ## @EIO
L_.str.8:                               ## @.str.8
	.asciz	"error writing firmware at pos %zd\n"

	.comm	_DRX_UCODE_MAX_BUF_SIZE,4,2     ## @DRX_UCODE_MAX_BUF_SIZE
L_.str.9:                               ## @.str.9
	.asciz	"error reading firmware at pos %zd\n"

L_.str.10:                              ## @.str.10
	.asciz	"error verifying firmware at pos %zd\n"

	.no_dead_strip	_drx_ctrl_u_code
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function drx_ctrl_u_code
_drx_ctrl_u_code:                       ; @drx_ctrl_u_code
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #64
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	cbz	x1, LBB0_31
; %bb.1:
	ldr	x23, [x1]
	cbz	x23, LBB0_31
; %bb.2:
	mov	x20, x2
	mov	x19, x0
	ldr	x8, [x0, #16]
	stur	x8, [x29, #-104]                ; 8-byte Folded Spill
	ldr	x8, [x0]
	cbz	x8, LBB0_5
LBB0_3:
	ldr	x22, [x8, #8]
	ldr	w25, [x8]
	ldr	w0, [x22]
	bl	_be16_to_cpu
	mov	x26, x0
	ldr	w0, [x22, #32]
	bl	_be16_to_cpu
Lloh3:
	adrp	x8, _DRX_UCODE_MAGIC_WORD@GOTPAGE
Lloh4:
	ldr	x8, [x8, _DRX_UCODE_MAGIC_WORD@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	cmp	x8, x26
	ccmp	x0, #0, #4, eq
	b.ne	LBB0_8
; %bb.4:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w27, w8
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_36
LBB0_5:
	stur	xzr, [x29, #-96]
	ldr	x8, [x19, #8]
	ldr	w2, [x8]
	sub	x0, x29, #96
	mov	x1, x23
	bl	_request_firmware
	tbnz	w0, #31, LBB0_14
; %bb.6:
	ldur	x8, [x29, #-96]
	str	x8, [x19]
	ldr	w8, [x8]
	cmp	w8, #16
	b.hs	LBB0_15
; %bb.7:
Lloh11:
	adrp	x8, _EINVAL@GOTPAGE
Lloh12:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	neg	w27, w8
Lloh14:
	adrp	x0, l_.str.1@PAGE
Lloh15:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_36
LBB0_8:
	mov	x24, x0
	cmp	w20, #129
	b.ne	LBB0_12
; %bb.9:
	mov	x0, x19
	mov	x1, x22
	mov	x2, x25
	bl	_drx_check_firmware
	mov	x27, x0
	cbnz	w0, LBB0_37
; %bb.10:
	str	x23, [sp, #-16]!
Lloh16:
	adrp	x0, l_.str.4@PAGE
Lloh17:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pr_info
	add	sp, sp, #16
	cmp	x24, #1
	b.ge	LBB0_13
LBB0_11:
	mov	w27, #0
	b	LBB0_38
LBB0_12:
Lloh18:
	adrp	x0, l_.str.5@PAGE
Lloh19:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pr_info
	cmp	x24, #1
	b.lt	LBB0_11
LBB0_13:
	mov	x21, #0
	add	x25, x22, #64
	csinc	x8, x24, xzr, gt
	stur	x8, [x29, #-112]                ; 8-byte Folded Spill
	stur	w20, [x29, #-132]               ; 4-byte Folded Spill
	b	LBB0_19
LBB0_14:
	mov	x27, x0
	str	x23, [sp, #-16]!
Lloh20:
	adrp	x0, l_.str@PAGE
Lloh21:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_err
	add	sp, sp, #16
	b	LBB0_38
LBB0_15:
	stp	x23, x8, [sp, #-16]!
Lloh22:
	adrp	x0, l_.str.2@PAGE
Lloh23:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pr_info
	add	sp, sp, #16
	ldr	x8, [x19]
	b	LBB0_3
LBB0_16:                                ;   in Loop: Header=BB0_19 Depth=1
	ldp	x24, x8, [x29, #-128]           ; 16-byte Folded Reload
	mov	sp, x8
	ldur	w20, [x29, #-132]               ; 4-byte Folded Reload
LBB0_17:                                ;   in Loop: Header=BB0_19 Depth=1
	add	x25, x25, x24, lsl #2
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	mov	w27, #0
	add	x21, x21, #1
	ldur	x8, [x29, #-112]                ; 8-byte Folded Reload
	cmp	x21, x8
	b.eq	LBB0_38
LBB0_19:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_28 Depth 2
	ldr	w0, [x25]
	bl	_be32_to_cpu
	mov	x27, x0
	ldr	w0, [x25, #16]
	bl	_be16_to_cpu
	mov	x23, x0
	ldr	w0, [x25, #48]
	bl	_be16_to_cpu
	mov	x28, x0
	ldr	w0, [x25, #80]
	bl	_be16_to_cpu
	mov	x24, x0
	add	x25, x25, #112
	sub	x8, x25, x22
	asr	x26, x8, #2
Lloh24:
	adrp	x0, l_.str.6@PAGE
Lloh25:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x26
	mov	x2, x27
	mov	x3, x23
	mov	x4, x28
	mov	x5, x24
	bl	_pr_debug
	cmp	w23, #8, lsl #12                ; =32768
	b.ge	LBB0_35
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
Lloh26:
	adrp	x8, _DRX_UCODE_CRC_FLAG@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DRX_UCODE_CRC_FLAG@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	tst	w8, w28
	b.eq	LBB0_22
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=1
	mov	x0, x25
	mov	x1, x23
	bl	_drx_u_code_compute_crc
	cmp	x0, x24
	b.ne	LBB0_35
LBB0_22:                                ;   in Loop: Header=BB0_19 Depth=1
	cbz	w23, LBB0_18
; %bb.23:                               ;   in Loop: Header=BB0_19 Depth=1
	sbfiz	x24, x23, #3, #32
	cmp	w20, #128
	b.eq	LBB0_26
; %bb.24:                               ;   in Loop: Header=BB0_19 Depth=1
	cmp	w20, #129
	b.ne	LBB0_31
; %bb.25:                               ;   in Loop: Header=BB0_19 Depth=1
	ldur	x0, [x29, #-104]                ; 8-byte Folded Reload
	mov	x1, x27
	mov	x2, x24
	mov	x3, x25
	mov	w4, #0
	bl	_drxdap_fasi_write_block
	cbz	w0, LBB0_17
	b	LBB0_40
LBB0_26:                                ;   in Loop: Header=BB0_19 Depth=1
	mov	x8, sp
	stp	x24, x8, [x29, #-128]           ; 16-byte Folded Spill
	lsl	x8, x23, #32
	lsr	x20, x8, #29
Lloh29:
	adrp	x8, _DRX_UCODE_MAX_BUF_SIZE@GOTPAGE
Lloh30:
	ldr	x8, [x8, _DRX_UCODE_MAX_BUF_SIZE@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh32:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh33:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x23, x9, x8
	mov	sp, x23
	cbz	w20, LBB0_16
; %bb.27:                               ;   in Loop: Header=BB0_19 Depth=1
	mov	x24, x25
LBB0_28:                                ;   Parent Loop BB0_19 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
Lloh34:
	adrp	x8, _DRX_UCODE_MAX_BUF_SIZE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _DRX_UCODE_MAX_BUF_SIZE@GOTPAGEOFF]
Lloh36:
	ldr	w8, [x8]
	cmp	w20, w8
	csel	w8, w20, w8, lt
	sxtw	x28, w8
	ldur	x0, [x29, #-104]                ; 8-byte Folded Reload
	mov	x1, x27
	mov	x2, x28
	mov	x3, x23
	mov	w4, #0
	bl	_drxdap_fasi_read_block
	cbnz	w0, LBB0_32
; %bb.29:                               ;   in Loop: Header=BB0_28 Depth=2
	mov	x0, x24
	mov	x1, x23
	mov	x2, x28
	bl	_memcmp
	cbnz	w0, LBB0_33
; %bb.30:                               ;   in Loop: Header=BB0_28 Depth=2
	cmp	w28, #0
	cinc	w8, w28, lt
	add	w27, w27, w8, asr #1
	add	x24, x24, x28, lsl #2
	subs	w20, w20, w28
	b.ne	LBB0_28
	b	LBB0_16
LBB0_31:
Lloh37:
	adrp	x8, _EINVAL@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_38
LBB0_32:
Lloh40:
	adrp	x0, l_.str.9@PAGE
Lloh41:
	add	x0, x0, l_.str.9@PAGEOFF
	b	LBB0_34
LBB0_33:
Lloh42:
	adrp	x0, l_.str.10@PAGE
Lloh43:
	add	x0, x0, l_.str.10@PAGEOFF
LBB0_34:
	str	x26, [sp, #-16]!
	bl	_pr_err
	add	sp, sp, #16
Lloh44:
	adrp	x8, _EIO@GOTPAGE
Lloh45:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh46:
	ldr	w8, [x8]
	neg	w27, w8
	ldur	x8, [x29, #-120]                ; 8-byte Folded Reload
	mov	sp, x8
	b	LBB0_38
LBB0_35:
Lloh47:
	adrp	x8, _EINVAL@GOTPAGE
Lloh48:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh49:
	ldr	w8, [x8]
	neg	w27, w8
Lloh50:
	adrp	x0, l_.str.7@PAGE
Lloh51:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_36:
	bl	_pr_err
LBB0_37:
	ldr	x0, [x19]
	bl	_release_firmware
	str	xzr, [x19]
LBB0_38:
	ldur	x8, [x29, #-88]
Lloh52:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh53:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh54:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_41
; %bb.39:
	mov	x0, x27
	sub	sp, x29, #80
	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
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_40:
Lloh55:
	adrp	x8, _EIO@GOTPAGE
Lloh56:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh57:
	ldr	w8, [x8]
	neg	w27, w8
	str	x26, [sp, #-16]!
Lloh58:
	adrp	x0, l_.str.8@PAGE
Lloh59:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_pr_err
	add	sp, sp, #16
	b	LBB0_37
LBB0_41:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpAdd	Lloh58, Lloh59
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Couldn't read firmware %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"Firmware is too short!\n"

l_.str.2:                               ; @.str.2
	.asciz	"Firmware %s, size %zu\n"

	.comm	_DRX_UCODE_MAGIC_WORD,8,3       ; @DRX_UCODE_MAGIC_WORD
l_.str.3:                               ; @.str.3
	.asciz	"Firmware magic word doesn't match\n"

l_.str.4:                               ; @.str.4
	.asciz	"Uploading firmware %s\n"

l_.str.5:                               ; @.str.5
	.asciz	"Verifying if firmware upload was ok.\n"

l_.str.6:                               ; @.str.6
	.asciz	"%zd: addr %u, size %u, flags 0x%04x, CRC 0x%04x\n"

	.comm	_DRX_UCODE_CRC_FLAG,4,2         ; @DRX_UCODE_CRC_FLAG
l_.str.7:                               ; @.str.7
	.asciz	"firmware CRC is wrong\n"

	.comm	_EIO,4,2                        ; @EIO
l_.str.8:                               ; @.str.8
	.asciz	"error writing firmware at pos %zd\n"

	.comm	_DRX_UCODE_MAX_BUF_SIZE,4,2     ; @DRX_UCODE_MAX_BUF_SIZE
l_.str.9:                               ; @.str.9
	.asciz	"error reading firmware at pos %zd\n"

l_.str.10:                              ; @.str.10
	.asciz	"error verifying firmware at pos %zd\n"

	.no_dead_strip	_drx_ctrl_u_code
.subsections_via_symbols
