	.file	"extr_portio.c_InitSoundCard.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"InitSoundCard() called\n"
.LC1:
	.string	"Resetting sound card\n"
.LC2:
	.string	"Waiting for an ACK\n"
.LC3:
	.string	"Querying DSP version\n"
.LC4:
	.string	"DSP v%d.%d\n"
.LC5:
	.string	"Sound card initialized!\n"
	.text
	.p2align 4
	.globl	InitSoundCard
	.type	InitSoundCard, @function
InitSoundCard:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	xor	eax, eax
	mov	ebp, edi
	lea	rdi, .LC0[rip]
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	call	DPRINT@PLT
	lea	rdi, .LC1[rip]
	xor	eax, eax
	call	DPRINT@PLT
	mov	esi, 1
	mov	edi, ebp
	call	SB_WRITE_RESET@PLT
	xor	esi, esi
	mov	edi, ebp
	call	SB_WRITE_RESET@PLT
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	DPRINT@PLT
	mov	edi, ebp
	call	WaitToReceive@PLT
	test	rax, rax
	je	.L2
	mov	ebx, DWORD PTR SB_TIMEOUT[rip]
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L26:
	test	ebx, ebx
	jle	.L2
	sub	ebx, 1
.L3:
	mov	edi, ebp
	call	SB_READ_DATA@PLT
	cmp	QWORD PTR SB_DSP_READY[rip], rax
	jne	.L26
.L2:
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	DPRINT@PLT
	mov	edi, ebp
	call	WaitToSend@PLT
	test	eax, eax
	jne	.L4
.L24:
	mov	eax, DWORD PTR FALSE[rip]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	esi, DWORD PTR SB_GET_DSP_VERSION[rip]
	mov	edi, ebp
	call	SB_WRITE_DATA@PLT
	mov	edi, ebp
	call	WaitToReceive@PLT
	test	rax, rax
	je	.L24
	mov	edi, ebp
	call	SB_READ_DATA@PLT
	mov	edi, ebp
	mov	rbx, rax
	call	SB_READ_DATA@PLT
	mov	esi, ebx
	lea	rdi, .LC4[rip]
	mov	rbp, rax
	mov	edx, eax
	xor	eax, eax
	call	DPRINT@PLT
	cmp	ebx, 255
	jne	.L7
	cmp	ebp, 255
	je	.L24
.L7:
	lea	rdi, .LC5[rip]
	xor	eax, eax
	sal	ebx, 8
	call	DPRINT@PLT
	add	rsp, 8
	.cfi_def_cfa_offset 24
	lea	eax, [rbx+rbp]
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	InitSoundCard, .-InitSoundCard
	.comm	SB_TIMEOUT,4,4
	.comm	SB_GET_DSP_VERSION,4,4
	.comm	SB_DSP_READY,8,8
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_portio.c_InitSoundCard.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"InitSoundCard() called\012\000"
	.align	2
.LC1:
	.ascii	"Resetting sound card\012\000"
	.align	2
.LC2:
	.ascii	"Waiting for an ACK\012\000"
	.align	2
.LC3:
	.ascii	"Querying DSP version\012\000"
	.align	2
.LC4:
	.ascii	"DSP v%d.%d\012\000"
	.align	2
.LC5:
	.ascii	"Sound card initialized!\012\000"
	.text
	.align	2
	.global	InitSoundCard
	.syntax unified
	.arm
	.fpu softvfp
	.type	InitSoundCard, %function
InitSoundCard:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	ldr	r0, .L19
	bl	DPRINT
	ldr	r0, .L19+4
	bl	DPRINT
	mov	r1, #1
	mov	r0, r5
	bl	SB_WRITE_RESET
	mov	r1, #0
	mov	r0, r5
	bl	SB_WRITE_RESET
	ldr	r0, .L19+8
	bl	DPRINT
	mov	r0, r5
	bl	WaitToReceive
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L19+12
	ldr	r6, .L19+16
	ldr	r4, [r3]
	b	.L3
.L18:
	sub	r4, r4, #1
.L3:
	mov	r0, r5
	bl	SB_READ_DATA
	ldr	r3, [r6]
	cmp	r3, r0
	cmpne	r4, #0
	bgt	.L18
.L2:
	ldr	r0, .L19+20
	bl	DPRINT
	mov	r0, r5
	bl	WaitToSend
	cmp	r0, #0
	bne	.L4
.L16:
	ldr	r3, .L19+24
	ldr	r0, [r3]
	pop	{r4, r5, r6, pc}
.L4:
	ldr	r3, .L19+28
	mov	r0, r5
	ldr	r1, [r3]
	bl	SB_WRITE_DATA
	mov	r0, r5
	bl	WaitToReceive
	cmp	r0, #0
	beq	.L16
	mov	r0, r5
	bl	SB_READ_DATA
	mov	r2, r0
	mov	r0, r5
	mov	r5, r2
	bl	SB_READ_DATA
	mov	r4, r0
	mov	r2, r0
	mov	r1, r5
	ldr	r0, .L19+32
	bl	DPRINT
	cmp	r5, #255
	cmpeq	r4, #255
	beq	.L16
	ldr	r0, .L19+36
	bl	DPRINT
	add	r0, r4, r5, lsl #8
	pop	{r4, r5, r6, pc}
.L20:
	.align	2
.L19:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	SB_TIMEOUT
	.word	SB_DSP_READY
	.word	.LC3
	.word	FALSE
	.word	SB_GET_DSP_VERSION
	.word	.LC4
	.word	.LC5
	.size	InitSoundCard, .-InitSoundCard
	.comm	SB_TIMEOUT,4,4
	.comm	SB_GET_DSP_VERSION,4,4
	.comm	SB_DSP_READY,4,4
	.comm	FALSE,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
