	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fm_tx_set_pwr_lvl              ## -- Begin function fm_tx_set_pwr_lvl
	.p2align	4, 0x90
_fm_tx_set_pwr_lvl:                     ## @fm_tx_set_pwr_lvl
	.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), %rax
	movq	_FM_MODE_TX@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_fmdbg
	movq	_FM_CORE_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	8(%r15), %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_3
## %bb.4:
	movq	_FM_PWR_LVL_HIGH@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	subq	%r14, %rax
	movq	%rax, -32(%rbp)
	movq	_POWER_LEV_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_REG_WR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	$0, (%rsp)
	xorl	%ebx, %ebx
	leaq	-32(%rbp), %rcx
	movq	%r15, %rdi
	movl	$8, %r8d
	xorl	%r9d, %r9d
	callq	_fmc_send_cmd
	testl	%eax, %eax
	js	LBB0_5
## %bb.6:
	movq	%r14, 16(%r15)
	jmp	LBB0_7
LBB0_1:
	movq	_EPERM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_7
LBB0_3:
	movq	%r14, 16(%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_7
LBB0_5:
	movl	%eax, %ebx
LBB0_7:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_FM_MODE_TX,8,3                 ## @FM_MODE_TX
	.comm	_EPERM,4,2                      ## @EPERM
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"tx: pwr_level_to_set %ld\n"

	.comm	_FM_CORE_READY,4,2              ## @FM_CORE_READY
	.comm	_FM_PWR_LVL_HIGH,8,3            ## @FM_PWR_LVL_HIGH
	.comm	_POWER_LEV_SET,4,2              ## @POWER_LEV_SET
	.comm	_REG_WR,4,2                     ## @REG_WR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_fm_tx_set_pwr_lvl              ; -- Begin function fm_tx_set_pwr_lvl
	.p2align	2
_fm_tx_set_pwr_lvl:                     ; @fm_tx_set_pwr_lvl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #48
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _FM_MODE_TX@GOTPAGE
Lloh1:
	ldr	x9, [x9, _FM_MODE_TX@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.1:
	mov	x19, x1
	mov	x20, x0
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_fmdbg
Lloh5:
	adrp	x8, _FM_CORE_READY@GOTPAGE
Lloh6:
	ldr	x8, [x8, _FM_CORE_READY@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	add	x1, x20, #8
	bl	_test_bit
	cbz	w0, LBB0_4
; %bb.2:
Lloh8:
	adrp	x8, _FM_PWR_LVL_HIGH@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FM_PWR_LVL_HIGH@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	sub	x8, x8, x19
	str	x8, [sp, #8]
Lloh11:
	adrp	x8, _POWER_LEV_SET@GOTPAGE
Lloh12:
	ldr	x8, [x8, _POWER_LEV_SET@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
Lloh14:
	adrp	x8, _REG_WR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _REG_WR@GOTPAGEOFF]
Lloh16:
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x20
	mov	w4, #8
	mov	x5, #0
	mov	x6, #0
	bl	_fmc_send_cmd
	tbnz	w0, #31, LBB0_6
; %bb.3:
	mov	w0, #0
LBB0_4:
	str	x19, [x20, #16]
	b	LBB0_6
LBB0_5:
Lloh17:
	adrp	x8, _EPERM@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #48
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_FM_MODE_TX,8,3                 ; @FM_MODE_TX
	.comm	_EPERM,4,2                      ; @EPERM
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"tx: pwr_level_to_set %ld\n"

	.comm	_FM_CORE_READY,4,2              ; @FM_CORE_READY
	.comm	_FM_PWR_LVL_HIGH,8,3            ; @FM_PWR_LVL_HIGH
	.comm	_POWER_LEV_SET,4,2              ; @POWER_LEV_SET
	.comm	_REG_WR,4,2                     ; @REG_WR
.subsections_via_symbols
