	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_buffer_to_file           ## -- Begin function write_buffer_to_file
	.p2align	4, 0x90
_write_buffer_to_file:                  ## @write_buffer_to_file
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	_S_OK@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_GENERIC_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_CREATE_ALWAYS@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_FILE_ATTRIBUTE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	$0, (%rsp)
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_CreateFileW
	movq	%rax, %rbx
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	jne	LBB0_1
## %bb.4:
	xorl	%eax, %eax
	callq	_GetLastError
	movl	%eax, %edi
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HRESULT_FROM_WIN32             ## TAILCALL
LBB0_1:
	movq	%r15, %rdi
	callq	_ID3DXBuffer_GetBufferPointer
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_ID3DXBuffer_GetBufferSize
	leaq	-36(%rbp), %rcx
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%eax, %edx
	xorl	%r8d, %r8d
	callq	_WriteFile
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	xorl	%eax, %eax
	callq	_GetLastError
	movl	%eax, %edi
	callq	_HRESULT_FROM_WIN32
	movl	%eax, %r14d
LBB0_3:
	movq	%rbx, %rdi
	callq	_CloseHandle
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_S_OK,4,2                       ## @S_OK
	.comm	_GENERIC_WRITE,4,2              ## @GENERIC_WRITE
	.comm	_CREATE_ALWAYS,4,2              ## @CREATE_ALWAYS
	.comm	_FILE_ATTRIBUTE_NORMAL,4,2      ## @FILE_ATTRIBUTE_NORMAL
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_buffer_to_file           ; -- Begin function write_buffer_to_file
	.p2align	2
_write_buffer_to_file:                  ; @write_buffer_to_file
	.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
Lloh0:
	adrp	x8, _S_OK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _S_OK@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
Lloh3:
	adrp	x8, _GENERIC_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _GENERIC_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _CREATE_ALWAYS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CREATE_ALWAYS@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
Lloh9:
	adrp	x8, _FILE_ATTRIBUTE_NORMAL@GOTPAGE
Lloh10:
	ldr	x8, [x8, _FILE_ATTRIBUTE_NORMAL@GOTPAGEOFF]
Lloh11:
	ldr	w5, [x8]
	mov	w2, #0
	mov	x3, #0
	mov	x6, #0
	bl	_CreateFileW
Lloh12:
	adrp	x8, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_2
; %bb.1:
	bl	_GetLastError
	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
	b	_HRESULT_FROM_WIN32
LBB0_2:
	mov	x20, x0
	mov	x0, x21
	bl	_ID3DXBuffer_GetBufferPointer
	mov	x22, x0
	mov	x0, x21
	bl	_ID3DXBuffer_GetBufferSize
	mov	x2, x0
	add	x3, sp, #12
	mov	x0, x20
	mov	x1, x22
	mov	x4, #0
	bl	_WriteFile
	cbnz	w0, LBB0_4
; %bb.3:
	bl	_GetLastError
	bl	_HRESULT_FROM_WIN32
	mov	x19, x0
LBB0_4:
	mov	x0, x20
	bl	_CloseHandle
	mov	x0, x19
	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	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_S_OK,4,2                       ; @S_OK
	.comm	_GENERIC_WRITE,4,2              ; @GENERIC_WRITE
	.comm	_CREATE_ALWAYS,4,2              ; @CREATE_ALWAYS
	.comm	_FILE_ATTRIBUTE_NORMAL,4,2      ; @FILE_ATTRIBUTE_NORMAL
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
.subsections_via_symbols
