	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mingw_open_append
_mingw_open_append:                     ## @mingw_open_append
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_O_CREAT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	notl	%ecx
	andl	%esi, %ecx
	movq	_O_WRONLY@GOTPCREL(%rip), %rdx
	movq	_O_APPEND@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
	orl	(%rdx), %ebx
	cmpl	%ebx, %ecx
	jne	LBB0_1
## %bb.3:
	testl	%esi, %eax
	jne	LBB0_4
## %bb.5:
	movq	_OPEN_EXISTING@GOTPCREL(%rip), %rax
	jmp	LBB0_6
LBB0_1:
	movq	_ENOSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	jmp	LBB0_2
LBB0_4:
	movq	_OPEN_ALWAYS@GOTPCREL(%rip), %rax
LBB0_6:
	movl	(%rax), %r8d
	movq	_FILE_APPEND_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_FILE_SHARE_WRITE@GOTPCREL(%rip), %rax
	movq	_FILE_SHARE_READ@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_FILE_ATTRIBUTE_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	$0, (%rsp)
	xorl	%ecx, %ecx
	callq	_CreateFileW
	movq	%rax, %r14
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rax
	cmpq	(%rax), %r14
	jne	LBB0_8
## %bb.7:
	xorl	%eax, %eax
	callq	_GetLastError
	movl	%eax, %edi
	callq	_err_win_to_posix
LBB0_2:
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$-1, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	movq	_O_BINARY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	__open_osfhandle
	movl	%eax, %ebx
	testl	%eax, %eax
	jns	LBB0_10
## %bb.9:
	movq	%r14, %rdi
	callq	_CloseHandle
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_OPEN_ALWAYS,4,2                ## @OPEN_ALWAYS
	.comm	_OPEN_EXISTING,4,2              ## @OPEN_EXISTING
	.comm	_O_WRONLY,4,2                   ## @O_WRONLY
	.comm	_O_APPEND,4,2                   ## @O_APPEND
	.comm	_ENOSYS,4,2                     ## @ENOSYS
	.comm	_errno,4,2                      ## @errno
	.comm	_FILE_APPEND_DATA,4,2           ## @FILE_APPEND_DATA
	.comm	_FILE_SHARE_WRITE,4,2           ## @FILE_SHARE_WRITE
	.comm	_FILE_SHARE_READ,4,2            ## @FILE_SHARE_READ
	.comm	_FILE_ATTRIBUTE_NORMAL,4,2      ## @FILE_ATTRIBUTE_NORMAL
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.comm	_O_BINARY,4,2                   ## @O_BINARY
	.no_dead_strip	_mingw_open_append
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mingw_open_append
_mingw_open_append:                     ; @mingw_open_append
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
Lloh0:
	adrp	x8, _O_CREAT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_CREAT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	bic	w9, w1, w8
Lloh3:
	adrp	x10, _O_WRONLY@GOTPAGE
Lloh4:
	ldr	x10, [x10, _O_WRONLY@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
Lloh6:
	adrp	x11, _O_APPEND@GOTPAGE
Lloh7:
	ldr	x11, [x11, _O_APPEND@GOTPAGEOFF]
Lloh8:
	ldr	w11, [x11]
	orr	w10, w11, w10
	cmp	w9, w10
	b.ne	LBB0_3
; %bb.1:
Lloh9:
	adrp	x9, _OPEN_EXISTING@GOTPAGE
Lloh10:
	ldr	x9, [x9, _OPEN_EXISTING@GOTPAGEOFF]
Lloh11:
	adrp	x10, _OPEN_ALWAYS@GOTPAGE
Lloh12:
	ldr	x10, [x10, _OPEN_ALWAYS@GOTPAGEOFF]
	tst	w8, w1
	csel	x8, x9, x10, eq
Lloh13:
	adrp	x9, _FILE_APPEND_DATA@GOTPAGE
Lloh14:
	ldr	x9, [x9, _FILE_APPEND_DATA@GOTPAGEOFF]
	ldr	w4, [x8]
Lloh15:
	ldr	w1, [x9]
Lloh16:
	adrp	x8, _FILE_SHARE_WRITE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _FILE_SHARE_WRITE@GOTPAGEOFF]
Lloh18:
	adrp	x9, _FILE_SHARE_READ@GOTPAGE
Lloh19:
	ldr	x9, [x9, _FILE_SHARE_READ@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
Lloh21:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh22:
	adrp	x8, _FILE_ATTRIBUTE_NORMAL@GOTPAGE
Lloh23:
	ldr	x8, [x8, _FILE_ATTRIBUTE_NORMAL@GOTPAGEOFF]
Lloh24:
	ldr	w5, [x8]
	mov	x3, #0
	mov	x6, #0
	bl	_CreateFileW
Lloh25:
	adrp	x8, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh26:
	ldr	x8, [x8, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_4
; %bb.2:
	bl	_GetLastError
	bl	_err_win_to_posix
Lloh28:
	adrp	x8, _errno@GOTPAGE
Lloh29:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh30:
	str	w0, [x8]
	mov	w19, #-1
	b	LBB0_6
LBB0_3:
Lloh31:
	adrp	x8, _ENOSYS@GOTPAGE
Lloh32:
	ldr	x8, [x8, _ENOSYS@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
Lloh34:
	adrp	x9, _errno@GOTPAGE
Lloh35:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh36:
	str	w8, [x9]
	mov	w19, #-1
	b	LBB0_6
LBB0_4:
	mov	x20, x0
Lloh37:
	adrp	x8, _O_BINARY@GOTPAGE
Lloh38:
	ldr	x8, [x8, _O_BINARY@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	bl	__open_osfhandle
	mov	x19, x0
	tbz	w0, #31, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_CloseHandle
LBB0_6:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh20
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_OPEN_ALWAYS,4,2                ; @OPEN_ALWAYS
	.comm	_OPEN_EXISTING,4,2              ; @OPEN_EXISTING
	.comm	_O_WRONLY,4,2                   ; @O_WRONLY
	.comm	_O_APPEND,4,2                   ; @O_APPEND
	.comm	_ENOSYS,4,2                     ; @ENOSYS
	.comm	_errno,4,2                      ; @errno
	.comm	_FILE_APPEND_DATA,4,2           ; @FILE_APPEND_DATA
	.comm	_FILE_SHARE_WRITE,4,2           ; @FILE_SHARE_WRITE
	.comm	_FILE_SHARE_READ,4,2            ; @FILE_SHARE_READ
	.comm	_FILE_ATTRIBUTE_NORMAL,4,2      ; @FILE_ATTRIBUTE_NORMAL
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.comm	_O_BINARY,4,2                   ; @O_BINARY
	.no_dead_strip	_mingw_open_append
.subsections_via_symbols
