	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function redrat3_get_timeout
_redrat3_get_timeout:                   ## @redrat3_get_timeout
	.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, %r15
	movl	$150, %edi
	callq	_MS_TO_US
	movl	%eax, %r14d
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$4, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r12
	movl	4(%r15), %edi
	xorl	%esi, %esi
	callq	_usb_rcvctrlpipe
	movl	4(%r15), %edi
	movq	_RR3_GET_IR_PARAM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	_USB_TYPE_VENDOR@GOTPCREL(%rip), %rsi
	movq	_USB_RECIP_DEVICE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rsi), %ecx
	movq	_USB_DIR_IN@GOTPCREL(%rip), %rsi
	orl	(%rsi), %ecx
	movq	_RR3_IR_IO_SIG_TIMEOUT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r8d
	movq	_HZ@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	leal	(%rsi,%rsi,4), %ebx
	subq	$8, %rsp
	movl	%eax, %esi
	xorl	%r9d, %r9d
	pushq	%rbx
	pushq	$4
	pushq	%r12
	callq	_usb_control_msg
	addq	$32, %rsp
	cmpl	$4, %eax
	jne	LBB0_2
## %bb.3:
	movq	%r12, %rdi
	callq	_be32_to_cpup
	movl	%eax, %edi
	callq	_redrat3_len_to_us
	movl	%eax, %r14d
	movl	(%r15), %edi
	cltq
	imulq	$274877907, %rax, %rdx          ## imm = 0x10624DD3
	movq	%rdx, %rax
	shrq	$63, %rax
	sarq	$38, %rdx
	addl	%eax, %edx
	leaq	L_.str.1(%rip), %rsi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_dev_dbg
	jmp	LBB0_4
LBB0_2:
	movl	(%r15), %edi
	leaq	L_.str(%rip), %rsi
	callq	_dev_warn
LBB0_4:
	movq	%r12, %rdi
	callq	_kfree
LBB0_5:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_RR3_GET_IR_PARAM,4,2           ## @RR3_GET_IR_PARAM
	.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	_RR3_IR_IO_SIG_TIMEOUT,4,2      ## @RR3_IR_IO_SIG_TIMEOUT
	.comm	_HZ,4,2                         ## @HZ
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Failed to read timeout from hardware\n"

L_.str.1:                               ## @.str.1
	.asciz	"Got timeout of %d ms\n"

	.no_dead_strip	_redrat3_get_timeout
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function redrat3_get_timeout
_redrat3_get_timeout:                   ; @redrat3_get_timeout
	.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	x21, x0
	mov	w0, #150
	bl	_MS_TO_US
	mov	x19, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #4
	bl	_kzalloc
	cbz	x0, LBB0_5
; %bb.1:
	mov	x20, x0
	ldr	w0, [x21, #4]
	mov	w1, #0
	bl	_usb_rcvctrlpipe
	mov	x1, x0
	ldr	w0, [x21, #4]
Lloh3:
	adrp	x8, _RR3_GET_IR_PARAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RR3_GET_IR_PARAM@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
Lloh6:
	adrp	x8, _USB_TYPE_VENDOR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _USB_TYPE_VENDOR@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _USB_RECIP_DEVICE@GOTPAGE
Lloh10:
	ldr	x9, [x9, _USB_RECIP_DEVICE@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh12:
	adrp	x9, _USB_DIR_IN@GOTPAGE
Lloh13:
	ldr	x9, [x9, _USB_DIR_IN@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
Lloh15:
	adrp	x10, _RR3_IR_IO_SIG_TIMEOUT@GOTPAGE
Lloh16:
	ldr	x10, [x10, _RR3_IR_IO_SIG_TIMEOUT@GOTPAGEOFF]
	orr	w3, w8, w9
Lloh17:
	ldr	w4, [x10]
Lloh18:
	adrp	x8, _HZ@GOTPAGE
Lloh19:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	add	w8, w8, w8, lsl #2
	str	w8, [sp]
	mov	w5, #0
	mov	x6, x20
	mov	w7, #4
	bl	_usb_control_msg
	cmp	w0, #4
	b.ne	LBB0_3
; %bb.2:
	mov	x0, x20
	bl	_be32_to_cpup
	bl	_redrat3_len_to_us
	mov	x19, x0
	ldr	w0, [x21]
	mov	w8, #19923
	movk	w8, #4194, lsl #16
	smull	x8, w19, w8
	lsr	x9, x8, #63
	asr	x8, x8, #38
	add	w2, w8, w9
Lloh21:
	adrp	x1, l_.str.1@PAGE
Lloh22:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_dev_dbg
	b	LBB0_4
LBB0_3:
	ldr	w0, [x21]
Lloh23:
	adrp	x1, l_.str@PAGE
Lloh24:
	add	x1, x1, l_.str@PAGEOFF
	bl	_dev_warn
LBB0_4:
	mov	x0, x20
	bl	_kfree
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
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_RR3_GET_IR_PARAM,4,2           ; @RR3_GET_IR_PARAM
	.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	_RR3_IR_IO_SIG_TIMEOUT,4,2      ; @RR3_IR_IO_SIG_TIMEOUT
	.comm	_HZ,4,2                         ; @HZ
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Failed to read timeout from hardware\n"

l_.str.1:                               ; @.str.1
	.asciz	"Got timeout of %d ms\n"

	.no_dead_strip	_redrat3_get_timeout
.subsections_via_symbols
