	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bluecard_hci_set_baud_rate
_bluecard_hci_set_baud_rate:            ## @bluecard_hci_set_baud_rate
	.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
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %ebx
	movq	(%rdi), %r14
	movq	_HCI_COMMAND_PKT@GOTPCREL(%rip), %rax
	movb	(%rax), %al
	movb	%al, -29(%rbp)
	movw	$-1015, -28(%rbp)               ## imm = 0xFC09
	movb	$1, -26(%rbp)
	movq	_HCI_MAX_FRAME_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GFP_ATOMIC@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_bt_skb_alloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	cmpl	$115200, %ebx                   ## imm = 0x1C200
	je	LBB0_7
## %bb.3:
	cmpl	$460800, %ebx                   ## imm = 0x70800
	je	LBB0_4
## %bb.5:
	cmpl	$230400, %ebx                   ## imm = 0x38400
	jne	LBB0_8
## %bb.6:
	movq	_PKT_BAUD_RATE_230400@GOTPCREL(%rip), %rax
	movb	$1, %cl
	jmp	LBB0_9
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	_BT_ERR
	movl	$-1, %eax
	jmp	LBB0_10
LBB0_7:
	movq	_PKT_BAUD_RATE_115200@GOTPCREL(%rip), %rax
	movb	$2, %cl
	jmp	LBB0_9
LBB0_4:
	movq	_PKT_BAUD_RATE_460800@GOTPCREL(%rip), %rax
	xorl	%ecx, %ecx
	jmp	LBB0_9
LBB0_8:
	movq	_PKT_BAUD_RATE_57600@GOTPCREL(%rip), %rax
	movb	$3, %cl
LBB0_9:
	movb	%cl, -25(%rbp)
	movl	(%rax), %ebx
	movq	%r15, %rdi
	callq	_bt_cb
	movl	%ebx, (%rax)
	movq	%r15, %rdi
	movl	$5, %esi
	callq	_skb_put
	leaq	-29(%rbp), %rsi
	movl	%eax, %edi
	movl	$5, %edx
	callq	_memcpy
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_skb_queue_tail
	movq	%r14, %rdi
	callq	_bluecard_write_wakeup
	xorl	%eax, %eax
LBB0_10:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_HCI_COMMAND_PKT,4,2            ## @HCI_COMMAND_PKT
	.comm	_HCI_MAX_FRAME_SIZE,4,2         ## @HCI_MAX_FRAME_SIZE
	.comm	_GFP_ATOMIC,4,2                 ## @GFP_ATOMIC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Can't allocate mem for new packet"

	.comm	_PKT_BAUD_RATE_460800,4,2       ## @PKT_BAUD_RATE_460800
	.comm	_PKT_BAUD_RATE_230400,4,2       ## @PKT_BAUD_RATE_230400
	.comm	_PKT_BAUD_RATE_115200,4,2       ## @PKT_BAUD_RATE_115200
	.comm	_PKT_BAUD_RATE_57600,4,2        ## @PKT_BAUD_RATE_57600
	.no_dead_strip	_bluecard_hci_set_baud_rate
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bluecard_hci_set_baud_rate
_bluecard_hci_set_baud_rate:            ; @bluecard_hci_set_baud_rate
	.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, x1
	ldr	x19, [x0]
Lloh0:
	adrp	x8, _HCI_COMMAND_PKT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _HCI_COMMAND_PKT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	strb	w8, [sp, #11]
	mov	w8, #64521
	sturh	w8, [sp, #12]
	mov	w8, #1
	strb	w8, [sp, #14]
Lloh3:
	adrp	x8, _HCI_MAX_FRAME_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HCI_MAX_FRAME_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x8, _GFP_ATOMIC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GFP_ATOMIC@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_bt_skb_alloc
	cbz	x0, LBB0_2
; %bb.1:
	mov	x20, x0
Lloh9:
	adrp	x8, _PKT_BAUD_RATE_460800@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PKT_BAUD_RATE_460800@GOTPAGEOFF]
	mov	w9, #49664
	movk	w9, #1, lsl #16
Lloh11:
	adrp	x10, _PKT_BAUD_RATE_115200@GOTPAGE
Lloh12:
	ldr	x10, [x10, _PKT_BAUD_RATE_115200@GOTPAGEOFF]
	mov	w11, #2
	mov	w12, #2048
	movk	w12, #7, lsl #16
	mov	w13, #33792
	movk	w13, #3, lsl #16
Lloh13:
	adrp	x14, _PKT_BAUD_RATE_57600@GOTPAGE
Lloh14:
	ldr	x14, [x14, _PKT_BAUD_RATE_57600@GOTPAGEOFF]
	mov	w15, #3
Lloh15:
	adrp	x16, _PKT_BAUD_RATE_230400@GOTPAGE
Lloh16:
	ldr	x16, [x16, _PKT_BAUD_RATE_230400@GOTPAGEOFF]
	mov	w17, #1
	cmp	w21, w13
	csel	w13, w15, w17, ne
	csel	x14, x14, x16, ne
	cmp	w21, w12
	csel	w12, wzr, w13, eq
	csel	x8, x8, x14, eq
	cmp	w21, w9
	csel	w9, w11, w12, eq
	csel	x8, x10, x8, eq
	strb	w9, [sp, #15]
	ldr	w21, [x8]
	bl	_bt_cb
	str	w21, [x0]
	mov	x0, x20
	mov	w1, #5
	bl	_skb_put
	add	x1, sp, #11
	mov	w2, #5
	bl	_memcpy
	mov	x0, x19
	mov	x1, x20
	bl	_skb_queue_tail
	mov	x0, x19
	bl	_bluecard_write_wakeup
	mov	w0, #0
	b	LBB0_3
LBB0_2:
Lloh17:
	adrp	x0, l_.str@PAGE
Lloh18:
	add	x0, x0, l_.str@PAGEOFF
	bl	_BT_ERR
	mov	w0, #-1
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
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_HCI_COMMAND_PKT,4,2            ; @HCI_COMMAND_PKT
	.comm	_HCI_MAX_FRAME_SIZE,4,2         ; @HCI_MAX_FRAME_SIZE
	.comm	_GFP_ATOMIC,4,2                 ; @GFP_ATOMIC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Can't allocate mem for new packet"

	.comm	_PKT_BAUD_RATE_460800,4,2       ; @PKT_BAUD_RATE_460800
	.comm	_PKT_BAUD_RATE_230400,4,2       ; @PKT_BAUD_RATE_230400
	.comm	_PKT_BAUD_RATE_115200,4,2       ; @PKT_BAUD_RATE_115200
	.comm	_PKT_BAUD_RATE_57600,4,2        ; @PKT_BAUD_RATE_57600
	.no_dead_strip	_bluecard_hci_set_baud_rate
.subsections_via_symbols
