	.file	"extr_primary.c_DSOUND_CopyFormat.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"out of memory\n"
.LC1:
	.string	"Fixing bad nBlockAlign (%u)\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"Fixing bad nAvgBytesPerSec (%u)\n"
	.text
	.p2align 4
	.globl	DSOUND_CopyFormat
	.type	DSOUND_CopyFormat, @function
DSOUND_CopyFormat:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	rbp, rdi
	call	DSOUND_GetFormatSize@PLT
	mov	r13d, eax
	xor	eax, eax
	call	GetProcessHeap@PLT
	mov	edx, r13d
	xor	esi, esi
	mov	edi, eax
	call	HeapAlloc@PLT
	mov	r12, rax
	test	rax, rax
	je	.L8
	mov	rax, QWORD PTR WAVE_FORMAT_PCM[rip]
	cmp	QWORD PTR 0[rbp], rax
	je	.L4
	mov	edx, r13d
	mov	rsi, rbp
	mov	rdi, r12
	call	CopyMemory@PLT
.L1:
	mov	rax, r12
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L4:
	.cfi_restore_state
	mov	edx, 4
	mov	rsi, rbp
	mov	rdi, r12
	call	CopyMemory@PLT
	mov	eax, DWORD PTR 4[r12]
	imul	eax, DWORD PTR 8[r12]
	mov	QWORD PTR 24[r12], 0
	mov	esi, DWORD PTR [r12]
	mov	edx, eax
	lea	eax, 7[rax]
	test	edx, edx
	cmovns	eax, edx
	sar	eax, 3
	cmp	esi, eax
	jne	.L9
	imul	eax, DWORD PTR 16[r12]
	mov	esi, DWORD PTR 12[r12]
	cmp	esi, eax
	je	.L1
.L10:
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	WARN@PLT
	mov	eax, DWORD PTR 16[r12]
	imul	eax, DWORD PTR [r12]
	mov	DWORD PTR 12[r12], eax
	mov	rax, r12
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	xor	eax, eax
	lea	rdi, .LC1[rip]
	call	WARN@PLT
	mov	eax, DWORD PTR 4[r12]
	imul	eax, DWORD PTR 8[r12]
	mov	esi, DWORD PTR 12[r12]
	mov	edx, eax
	lea	eax, 7[rax]
	test	edx, edx
	cmovns	eax, edx
	sar	eax, 3
	mov	DWORD PTR [r12], eax
	imul	eax, DWORD PTR 16[r12]
	cmp	esi, eax
	je	.L1
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L8:
	lea	rdi, .LC0[rip]
	xor	eax, eax
	call	WARN@PLT
	mov	rax, r12
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	DSOUND_CopyFormat, .-DSOUND_CopyFormat
	.comm	WAVE_FORMAT_PCM,8,8
	.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_primary.c_DSOUND_CopyFormat.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"out of memory\012\000"
	.align	2
.LC1:
	.ascii	"Fixing bad nBlockAlign (%u)\012\000"
	.align	2
.LC2:
	.ascii	"Fixing bad nAvgBytesPerSec (%u)\012\000"
	.text
	.align	2
	.global	DSOUND_CopyFormat
	.syntax unified
	.arm
	.fpu softvfp
	.type	DSOUND_CopyFormat, %function
DSOUND_CopyFormat:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r5, r0
	bl	DSOUND_GetFormatSize
	mov	r6, r0
	bl	GetProcessHeap
	mov	r2, r6
	mov	r1, #0
	bl	HeapAlloc
	subs	r4, r0, #0
	beq	.L8
	ldr	r3, .L10
	ldr	r2, [r5]
	ldr	r3, [r3]
	cmp	r2, r3
	beq	.L4
	mov	r2, r6
	mov	r1, r5
	bl	CopyMemory
.L1:
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L4:
	mov	r1, r5
	mov	r2, #4
	bl	CopyMemory
	mov	r0, #0
	ldr	r2, [r4, #8]
	ldr	r3, [r4, #4]
	ldr	r1, [r4]
	mul	r3, r2, r3
	add	r2, r3, #7
	cmp	r3, r0
	movlt	r3, r2
	cmp	r1, r3, asr #3
	asr	r2, r3, #3
	str	r0, [r4, #20]
	bne	.L9
.L5:
	ldr	r3, [r4, #16]
	ldr	r1, [r4, #12]
	mul	r2, r3, r2
	cmp	r1, r2
	beq	.L1
	ldr	r0, .L10+4
	bl	WARN
	ldr	r3, [r4, #16]
	ldr	r2, [r4]
	mov	r0, r4
	mul	r3, r2, r3
	str	r3, [r4, #12]
	pop	{r4, r5, r6, pc}
.L9:
	ldr	r0, .L10+8
	bl	WARN
	ldmib	r4, {r2, r3}
	mul	r2, r3, r2
	add	r3, r2, #7
	cmp	r2, #0
	movlt	r2, r3
	asr	r2, r2, #3
	str	r2, [r4]
	b	.L5
.L8:
	ldr	r0, .L10+12
	bl	WARN
	mov	r0, r4
	pop	{r4, r5, r6, pc}
.L11:
	.align	2
.L10:
	.word	WAVE_FORMAT_PCM
	.word	.LC2
	.word	.LC1
	.word	.LC0
	.size	DSOUND_CopyFormat, .-DSOUND_CopyFormat
	.comm	WAVE_FORMAT_PCM,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
