	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function redrat3_get_firmware_rev
_redrat3_get_firmware_rev:              ## @redrat3_get_firmware_rev
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_RR3_FW_VERSION_LEN@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	incq	%rdi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$1, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %rbx
	movl	4(%r14), %r15d
	movl	%r15d, %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rdx
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rdx), %ecx
	movq	_RR3_FW_VERSION@GOTPCREL(%rip), %rdx
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movl	(%rdx), %edx
	movq	_HZ@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	leal	(%rsi,%rsi,4), %r10d
	subq	$8, %rsp
	movl	%r15d, %edi
	movl	%eax, %esi
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	pushq	%r10
	pushq	(%r12)
	pushq	%rbx
	callq	_usb_control_msg
	addq	$32, %rsp
	movl	(%r14), %edi
	testl	%eax, %eax
	js	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdx
	callq	_dev_info
	jmp	LBB0_4
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	leaq	L_.str.1(%rip), %rsi
	callq	_dev_err
LBB0_4:
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_RR3_FW_VERSION_LEN,8,3         ## @RR3_FW_VERSION_LEN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_RR3_FW_VERSION,4,2             ## @RR3_FW_VERSION
	.comm	_USB_TYPE_VENDOR,4,2            ## @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ## @USB_RECIP_DEVICE
	.comm	_USB_DIR_IN,4,2                 ## @USB_DIR_IN
	.comm	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Firmware rev: %s"

L_.str.1:                               ## @.str.1
	.asciz	"Problem fetching firmware ID\n"

	.no_dead_strip	_redrat3_get_firmware_rev
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function redrat3_get_firmware_rev
_redrat3_get_firmware_rev:              ; @redrat3_get_firmware_rev
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	mov	x20, x0
Lloh0:
	adrp	x22, _RR3_FW_VERSION_LEN@GOTPAGE
Lloh1:
	ldr	x22, [x22, _RR3_FW_VERSION_LEN@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x0, x8, #1
Lloh2:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	w1, #1
	bl	_kcalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	w21, [x20, #4]
	mov	x0, x21
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
Lloh5:
	adrp	x8, _RR3_FW_VERSION@GOTPAGE
Lloh6:
	ldr	x8, [x8, _RR3_FW_VERSION@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
Lloh8:
	adrp	x8, _USB_TYPE_VENDOR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh10:
	adrp	x9, _USB_RECIP_DEVICE@GOTPAGE
Lloh11:
	ldr	x9, [x9, _USB_RECIP_DEVICE@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh14:
	adrp	x9, _USB_DIR_IN@GOTPAGE
Lloh15:
	ldr	x9, [x9, _USB_DIR_IN@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	orr	w3, w8, w9
	ldr	x7, [x22]
Lloh17:
	adrp	x8, _HZ@GOTPAGE
Lloh18:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	str	w8, [sp]
	mov	x0, x21
	mov	w4, #0
	mov	w5, #0
	mov	x6, x19
	bl	_usb_control_msg
	mov	x8, x0
	ldr	w0, [x20]
	tbnz	w8, #31, LBB0_4
; %bb.2:
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_dev_info
	b	LBB0_5
LBB0_3:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_4:
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_err
LBB0_5:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_kfree
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_RR3_FW_VERSION_LEN,8,3         ; @RR3_FW_VERSION_LEN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_RR3_FW_VERSION,4,2             ; @RR3_FW_VERSION
	.comm	_USB_TYPE_VENDOR,4,2            ; @USB_TYPE_VENDOR
	.comm	_USB_RECIP_DEVICE,4,2           ; @USB_RECIP_DEVICE
	.comm	_USB_DIR_IN,4,2                 ; @USB_DIR_IN
	.comm	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Firmware rev: %s"

l_.str.1:                               ; @.str.1
	.asciz	"Problem fetching firmware ID\n"

	.no_dead_strip	_redrat3_get_firmware_rev
.subsections_via_symbols
