	.file	"extr_util.c_write_buffer_to_file.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	write_buffer_to_file
	.type	write_buffer_to_file, @function
write_buffer_to_file:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	xor	ecx, ecx
	xor	edx, edx
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	sub	rsp, 32
	.cfi_def_cfa_offset 72
	mov	r9d, DWORD PTR FILE_ATTRIBUTE_NORMAL[rip]
	mov	r8d, DWORD PTR CREATE_ALWAYS[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 16[rsp], rax
	xor	eax, eax
	push	0
	.cfi_def_cfa_offset 80
	mov	esi, DWORD PTR GENERIC_WRITE[rip]
	mov	r13d, DWORD PTR S_OK[rip]
	call	CreateFileW@PLT
	cmp	QWORD PTR INVALID_HANDLE_VALUE[rip], rax
	pop	rdx
	.cfi_def_cfa_offset 72
	pop	rcx
	.cfi_def_cfa_offset 64
	je	.L8
	mov	rdi, r12
	mov	rbp, rax
	call	ID3DXBuffer_GetBufferPointer@PLT
	mov	rdi, r12
	mov	r14, rax
	call	ID3DXBuffer_GetBufferSize@PLT
	xor	r8d, r8d
	lea	rcx, 4[rsp]
	mov	rsi, r14
	mov	edx, eax
	mov	rdi, rbp
	call	WriteFile@PLT
	test	eax, eax
	je	.L9
.L4:
	mov	rdi, rbp
	call	CloseHandle@PLT
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L10
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 40
	mov	eax, r13d
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L9:
	.cfi_restore_state
	call	GetLastError@PLT
	mov	edi, eax
	call	HRESULT_FROM_WIN32@PLT
	mov	r13d, eax
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L8:
	xor	eax, eax
	call	GetLastError@PLT
	mov	edi, eax
	call	HRESULT_FROM_WIN32@PLT
	mov	r13d, eax
	jmp	.L1
.L10:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	write_buffer_to_file, .-write_buffer_to_file
	.comm	S_OK,4,4
	.comm	INVALID_HANDLE_VALUE,8,8
	.comm	GENERIC_WRITE,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	CREATE_ALWAYS,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_util.c_write_buffer_to_file.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	write_buffer_to_file
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_buffer_to_file, %function
write_buffer_to_file:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, #0
	ldr	r2, .L11
	ldr	r3, .L11+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	sub	sp, sp, #24
	mov	r8, r1
	ldr	r1, .L11+8
	str	r2, [sp, #4]
	str	r3, [sp]
	str	r6, [sp, #8]
	ldr	ip, .L11+12
	ldr	lr, .L11+16
	mov	r2, r6
	mov	r3, r6
	ldr	r1, [r1]
	ldr	lr, [lr]
	str	lr, [sp, #20]
	mov	lr,#0
	ldr	r7, [ip]
	bl	CreateFileW
	ldr	r2, .L11+20
	ldr	r2, [r2]
	cmp	r2, r0
	beq	.L8
	mov	r4, r0
	mov	r0, r8
	bl	ID3DXBuffer_GetBufferPointer
	mov	r5, r0
	mov	r0, r8
	bl	ID3DXBuffer_GetBufferSize
	mov	r1, r5
	mov	r2, r0
	str	r6, [sp]
	mov	r0, r4
	add	r3, sp, #16
	bl	WriteFile
	cmp	r0, #0
	beq	.L9
.L4:
	mov	r0, r4
	bl	CloseHandle
.L1:
	ldr	r3, .L11+16
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L10
	mov	r0, r7
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, pc}
.L9:
	bl	GetLastError
	bl	HRESULT_FROM_WIN32
	mov	r7, r0
	b	.L4
.L8:
	bl	GetLastError
	bl	HRESULT_FROM_WIN32
	mov	r7, r0
	b	.L1
.L10:
	bl	__stack_chk_fail
.L12:
	.align	2
.L11:
	.word	FILE_ATTRIBUTE_NORMAL
	.word	CREATE_ALWAYS
	.word	GENERIC_WRITE
	.word	S_OK
	.word	.LC0
	.word	INVALID_HANDLE_VALUE
	.size	write_buffer_to_file, .-write_buffer_to_file
	.comm	S_OK,4,4
	.comm	INVALID_HANDLE_VALUE,4,4
	.comm	GENERIC_WRITE,4,4
	.comm	FILE_ATTRIBUTE_NORMAL,4,4
	.comm	CREATE_ALWAYS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
