	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ## -- Begin function amradio_setfreq
LCPI0_0:
	.long	0                               ## 0x0
	.long	85                              ## 0x55
	.long	170                             ## 0xaa
	.long	3                               ## 0x3
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	4, 0x90
_amradio_setfreq:                       ## @amradio_setfreq
	.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
	cmpq	$0, 16(%rdi)
	je	LBB0_2
## %bb.1:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_2:
	movl	%esi, %r15d
	movq	%rdi, %r12
	leaq	8(%rdi), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	(%r12), %rax
	movaps	LCPI0_0(%rip), %xmm0            ## xmm0 = [0,85,170,3]
	movups	%xmm0, (%rax)
	movq	_AMRADIO_SET_FREQ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 16(%rax)
	movq	$0, 20(%rax)
	movl	$8, 28(%rax)
	movl	12(%r12), %ebx
	movl	%ebx, %edi
	movl	$2, %esi
	callq	_usb_sndintpipe
	movq	(%r12), %rdx
	movq	_BUFFER_LENGTH@GOTPCREL(%rip), %r13
	movl	(%r13), %ecx
	movq	_USB_TIMEOUT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	leaq	-44(%rbp), %r8
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_usb_bulk_msg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.3:
	movl	-44(%rbp), %eax
	cmpl	(%r13), %eax
	jne	LBB0_6
## %bb.4:
	sarl	$3, %r15d
	movslq	%r15d, %rax
	imulq	$1374389535, %rax, %rax         ## imm = 0x51EB851F
	movq	%rax, %rcx
	sarq	$35, %rcx
	shrq	$63, %rax
	addl	%ecx, %eax
	addl	$16, %eax
	movzbl	%ah, %ecx
	movq	(%r12), %rdx
	movl	%ecx, (%rdx)
	movzbl	%al, %eax
	movl	%eax, 4(%rdx)
	movq	$1, 8(%rdx)
	movl	$0, 16(%rdx)
	movl	$0, 28(%rdx)
	movl	12(%r12), %ebx
	movl	%ebx, %edi
	movl	$2, %esi
	callq	_usb_sndintpipe
	movq	(%r12), %rdx
	movl	(%r13), %ecx
	movq	_USB_TIMEOUT@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	leaq	-44(%rbp), %r8
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_usb_bulk_msg
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_6
## %bb.5:
	movl	-44(%rbp), %eax
	cmpl	(%r13), %eax
LBB0_6:
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_7:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EIO,4,2                        ## @EIO
	.comm	_AMRADIO_SET_FREQ,4,2           ## @AMRADIO_SET_FREQ
	.comm	_BUFFER_LENGTH,4,2              ## @BUFFER_LENGTH
	.comm	_USB_TIMEOUT,4,2                ## @USB_TIMEOUT
	.no_dead_strip	_amradio_setfreq
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal16,16byte_literals
	.p2align	4                               ; -- Begin function amradio_setfreq
lCPI0_0:
	.long	0                               ; 0x0
	.long	85                              ; 0x55
	.long	170                             ; 0xaa
	.long	3                               ; 0x3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3
lCPI0_1:
	.long	1                               ; 0x1
	.long	0                               ; 0x0
	.section	__TEXT,__text,regular,pure_instructions
	.p2align	2
_amradio_setfreq:                       ; @amradio_setfreq
	.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
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _EIO@GOTPAGE
Lloh1:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_7
LBB0_2:
	mov	x21, x1
	mov	x20, x0
	add	x19, x0, #8
	mov	x0, x19
	bl	_mutex_lock
	ldr	x8, [x20]
Lloh3:
	adrp	x9, lCPI0_0@PAGE
Lloh4:
	ldr	q0, [x9, lCPI0_0@PAGEOFF]
	str	q0, [x8]
Lloh5:
	adrp	x9, _AMRADIO_SET_FREQ@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AMRADIO_SET_FREQ@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	stp	w9, wzr, [x8, #16]
	mov	w9, #8
	stp	wzr, w9, [x8, #24]
	ldr	w22, [x20, #12]
	mov	x0, x22
	mov	w1, #2
	bl	_usb_sndintpipe
	mov	x1, x0
	ldr	x2, [x20]
Lloh8:
	adrp	x23, _BUFFER_LENGTH@GOTPAGE
Lloh9:
	ldr	x23, [x23, _BUFFER_LENGTH@GOTPAGEOFF]
	ldr	w3, [x23]
Lloh10:
	adrp	x24, _USB_TIMEOUT@GOTPAGE
Lloh11:
	ldr	x24, [x24, _USB_TIMEOUT@GOTPAGEOFF]
	ldr	w5, [x24]
	add	x4, sp, #12
	mov	x0, x22
	bl	_usb_bulk_msg
	mov	x22, x0
	tbnz	w0, #31, LBB0_6
; %bb.3:
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	cmp	w8, w9
	b.ne	LBB0_6
; %bb.4:
	asr	w8, w21, #3
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #35
	add	w8, w8, w9
	add	w8, w8, #16
	ubfx	w9, w8, #8, #8
	ldr	x10, [x20]
	and	w8, w8, #0xff
	stp	w9, w8, [x10]
Lloh12:
	adrp	x8, lCPI0_1@PAGE
Lloh13:
	ldr	d0, [x8, lCPI0_1@PAGEOFF]
	str	d0, [x10, #8]
	str	wzr, [x10, #16]
	str	wzr, [x10, #28]
	ldr	w21, [x20, #12]
	mov	x0, x21
	mov	w1, #2
	bl	_usb_sndintpipe
	mov	x1, x0
	ldr	x2, [x20]
	ldr	w3, [x23]
	ldr	w5, [x24]
	add	x4, sp, #12
	mov	x0, x21
	bl	_usb_bulk_msg
	mov	x22, x0
	tbnz	w0, #31, LBB0_6
; %bb.5:
	ldr	w8, [sp, #12]
	ldr	w9, [x23]
	cmp	w8, w9
LBB0_6:
	mov	x0, x19
	bl	_mutex_unlock
LBB0_7:
	mov	x0, x22
	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	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdrp	Lloh3, Lloh5
	.loh AdrpLdr	Lloh3, Lloh4
	.loh AdrpLdr	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_EIO,4,2                        ; @EIO
	.comm	_AMRADIO_SET_FREQ,4,2           ; @AMRADIO_SET_FREQ
	.comm	_BUFFER_LENGTH,4,2              ; @BUFFER_LENGTH
	.comm	_USB_TIMEOUT,4,2                ; @USB_TIMEOUT
	.no_dead_strip	_amradio_setfreq
.subsections_via_symbols
