	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bap_setup
_bap_setup:                             ## @bap_setup
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %ebx
	movl	%esi, %edx
	movq	%rdi, %r13
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movslq	%ecx, %r15
	movq	_SELECT0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	callq	_OUT4500
	movq	_OFFSET0@GOTPCREL(%rip), %r14
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, %edx
	callq	_OUT4500
	movl	$-51, %r12d
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	callq	_IN4500
	movq	_BAP_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_14
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	incl	%r12d
	jne	LBB0_1
LBB0_3:
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	movq	_SELECT0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_OUT4500
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_OUT4500
	movl	$-51, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	callq	_IN4500
	movq	_BAP_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_18
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	incl	%ebx
	jne	LBB0_4
LBB0_6:
	movq	_SELECT0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_OUT4500
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_OUT4500
	movl	$-51, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	callq	_IN4500
	movq	_BAP_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_20
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	incl	%ebx
	jne	LBB0_7
LBB0_9:
	movq	_SELECT0@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_OUT4500
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	callq	_OUT4500
	movl	$-51, %ebx
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rsi
	addq	%r15, %rsi
	movq	%r13, %rdi
	callq	_IN4500
	movq	_BAP_BUSY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_22
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	incl	%ebx
	jne	LBB0_10
LBB0_12:
	movq	(%r13), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_airo_print_err
	movq	_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_14:
	movq	_BAP_ERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_17
## %bb.15:
	movl	-52(%rbp), %r12d                ## 4-byte Reload
	jmp	LBB0_16
LBB0_18:
	movq	_BAP_ERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_16
## %bb.19:
	movq	_BAP_DONE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_24
	jmp	LBB0_6
LBB0_17:
	movq	_BAP_DONE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_24
	jmp	LBB0_3
LBB0_20:
	movq	_BAP_ERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_16
## %bb.21:
	movq	_BAP_DONE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_24
	jmp	LBB0_9
LBB0_22:
	movq	_BAP_ERR@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_23
LBB0_16:
	movq	(%r13), %rcx
	movl	(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	movl	%r12d, %ecx
	xorl	%eax, %eax
	callq	_airo_print_err
	movq	_ERROR@GOTPCREL(%rip), %rax
	jmp	LBB0_25
LBB0_23:
	movq	_BAP_DONE@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_12
LBB0_24:
	movq	_SUCCESS@GOTPCREL(%rip), %rax
LBB0_25:
	movl	(%rax), %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SELECT0,8,3                    ## @SELECT0
	.comm	_OFFSET0,8,3                    ## @OFFSET0
	.comm	_BAP_BUSY,4,2                   ## @BAP_BUSY
	.comm	_BAP_ERR,4,2                    ## @BAP_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"BAP error %x %d"

	.comm	_ERROR,4,2                      ## @ERROR
	.comm	_BAP_DONE,4,2                   ## @BAP_DONE
	.comm	_SUCCESS,4,2                    ## @SUCCESS
L_.str.1:                               ## @.str.1
	.asciz	"BAP setup error too many retries\n"

	.no_dead_strip	_bap_setup
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bap_setup
_bap_setup:                             ; @bap_setup
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	mov	x8, x3
	sxtw	x23, w8
Lloh0:
	adrp	x26, _SELECT0@GOTPAGE
Lloh1:
	ldr	x26, [x26, _SELECT0@GOTPAGEOFF]
	ldr	x8, [x26]
	add	x1, x8, x23
	mov	x2, x22
	bl	_OUT4500
Lloh2:
	adrp	x24, _OFFSET0@GOTPAGE
Lloh3:
	ldr	x24, [x24, _OFFSET0@GOTPAGEOFF]
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	mov	x2, x21
	bl	_OUT4500
	mov	w27, #-51
Lloh4:
	adrp	x25, _BAP_BUSY@GOTPAGE
Lloh5:
	ldr	x25, [x25, _BAP_BUSY@GOTPAGEOFF]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	bl	_IN4500
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_13
; %bb.2:                                ;   in Loop: Header=BB0_1 Depth=1
	adds	w27, w27, #1
	b.lo	LBB0_1
LBB0_3:
	ldr	x8, [x26]
	add	x1, x8, x23
	mov	x0, x20
	mov	x2, x22
	bl	_OUT4500
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	mov	x2, x21
	bl	_OUT4500
	mov	w27, #-51
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	bl	_IN4500
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_15
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	adds	w27, w27, #1
	b.lo	LBB0_4
LBB0_6:
	ldr	x8, [x26]
	add	x1, x8, x23
	mov	x0, x20
	mov	x2, x22
	bl	_OUT4500
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	mov	x2, x21
	bl	_OUT4500
	mov	w27, #-51
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	bl	_IN4500
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_17
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	adds	w27, w27, #1
	b.lo	LBB0_7
LBB0_9:
	ldr	x8, [x26]
	add	x1, x8, x23
	mov	x0, x20
	mov	x2, x22
	bl	_OUT4500
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	mov	x2, x21
	bl	_OUT4500
	mov	w21, #-51
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24]
	add	x1, x8, x23
	mov	x0, x20
	bl	_IN4500
                                        ; kill: def $w0 killed $w0 def $x0
	ldr	w8, [x25]
	tst	w8, w0
	b.eq	LBB0_19
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=1
	adds	w21, w21, #1
	b.lo	LBB0_10
LBB0_12:
	ldr	x8, [x20]
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_21
LBB0_13:
Lloh8:
	adrp	x8, _BAP_ERR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BAP_ERR@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_20
; %bb.14:
Lloh11:
	adrp	x8, _BAP_DONE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BAP_DONE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_23
	b	LBB0_3
LBB0_15:
Lloh14:
	adrp	x8, _BAP_ERR@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BAP_ERR@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_20
; %bb.16:
Lloh17:
	adrp	x8, _BAP_DONE@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BAP_DONE@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_23
	b	LBB0_6
LBB0_17:
Lloh20:
	adrp	x8, _BAP_ERR@GOTPAGE
Lloh21:
	ldr	x8, [x8, _BAP_ERR@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_20
; %bb.18:
Lloh23:
	adrp	x8, _BAP_DONE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _BAP_DONE@GOTPAGEOFF]
Lloh25:
	ldr	w8, [x8]
	tst	w8, w0
	b.ne	LBB0_23
	b	LBB0_9
LBB0_19:
Lloh26:
	adrp	x8, _BAP_ERR@GOTPAGE
Lloh27:
	ldr	x8, [x8, _BAP_ERR@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_22
LBB0_20:
	ldr	x8, [x20]
	ldr	w8, [x8]
	stp	x0, x19, [sp]
Lloh29:
	adrp	x1, l_.str@PAGE
Lloh30:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x8
LBB0_21:
	bl	_airo_print_err
Lloh31:
	adrp	x8, _ERROR@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
	b	LBB0_24
LBB0_22:
Lloh33:
	adrp	x8, _BAP_DONE@GOTPAGE
Lloh34:
	ldr	x8, [x8, _BAP_DONE@GOTPAGEOFF]
Lloh35:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_12
LBB0_23:
Lloh36:
	adrp	x8, _SUCCESS@GOTPAGE
Lloh37:
	ldr	x8, [x8, _SUCCESS@GOTPAGEOFF]
LBB0_24:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGot	Lloh36, Lloh37
	.cfi_endproc
                                        ; -- End function
	.comm	_SELECT0,8,3                    ; @SELECT0
	.comm	_OFFSET0,8,3                    ; @OFFSET0
	.comm	_BAP_BUSY,4,2                   ; @BAP_BUSY
	.comm	_BAP_ERR,4,2                    ; @BAP_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"BAP error %x %d"

	.comm	_ERROR,4,2                      ; @ERROR
	.comm	_BAP_DONE,4,2                   ; @BAP_DONE
	.comm	_SUCCESS,4,2                    ; @SUCCESS
l_.str.1:                               ; @.str.1
	.asciz	"BAP setup error too many retries\n"

	.no_dead_strip	_bap_setup
.subsections_via_symbols
