	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_git_mmap                       ## -- Begin function git_mmap
	.p2align	4, 0x90
_git_mmap:                              ## @git_mmap
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %r15
	movl	%ecx, %r14d
	movl	%edx, %r12d
	movq	%rsi, %r13
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	movl	%r8d, %edi
	callq	__get_osfhandle
	movq	%rax, %rbx
	leaq	-56(%rbp), %rsi
	movq	%rax, %rdi
	callq	_GetFileSizeEx
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_die
LBB0_2:
	leaq	(%r15,%r13), %rax
	movq	-56(%rbp), %rdi
	cmpq	%rdi, %rax
	jbe	LBB0_4
## %bb.3:
	subq	%r15, %rdi
	callq	_xsize_t
	movq	%rax, %r13
LBB0_4:
	movq	_MAP_PRIVATE@GOTPCREL(%rip), %rax
	testl	%r14d, (%rax)
	jne	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rdi
	callq	_die
LBB0_6:
	movq	_PROT_READ@GOTPCREL(%rip), %r14
	cmpl	%r12d, (%r14)
	jne	LBB0_8
## %bb.7:
	movq	_PAGE_READONLY@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_8:
	movq	_PAGE_WRITECOPY@GOTPCREL(%rip), %rax
LBB0_9:
	movl	(%rax), %edx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_CreateFileMapping
	testq	%rax, %rax
	je	LBB0_19
## %bb.10:
	movq	%rax, %rbx
	cmpl	%r12d, (%r14)
	jne	LBB0_13
## %bb.11:
	movq	_FILE_MAP_READ@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_13:
	movq	_FILE_MAP_COPY@GOTPCREL(%rip), %rax
LBB0_14:
	movl	(%rax), %esi
	movq	%rbx, %rdi
	movl	%r15d, %ecx
	movq	%r13, %r8
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	callq	_MapViewOfFileEx
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_CloseHandle
	testl	%eax, %eax
	je	LBB0_16
## %bb.15:
	testq	%r14, %r14
	jne	LBB0_21
	jmp	LBB0_17
LBB0_16:
	leaq	L_.str.2(%rip), %rdi
	callq	_warning
	testq	%r14, %r14
	jne	LBB0_21
LBB0_17:
	xorl	%eax, %eax
	callq	_GetLastError
	movq	_ERROR_COMMITMENT_LIMIT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_19
## %bb.18:
	movq	_EFBIG@GOTPCREL(%rip), %rax
	jmp	LBB0_20
LBB0_19:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_20:
	movl	(%rax), %eax
	movq	_errno@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	movq	(%rax), %r14
LBB0_21:
	movq	%r14, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"mmap: could not determine filesize"

	.comm	_MAP_PRIVATE,4,2                ## @MAP_PRIVATE
L_.str.1:                               ## @.str.1
	.asciz	"Invalid usage of mmap when built with USE_WIN32_MMAP"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PAGE_READONLY,4,2              ## @PAGE_READONLY
	.comm	_PAGE_WRITECOPY,4,2             ## @PAGE_WRITECOPY
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_errno,4,2                      ## @errno
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
	.comm	_FILE_MAP_READ,4,2              ## @FILE_MAP_READ
	.comm	_FILE_MAP_COPY,4,2              ## @FILE_MAP_COPY
L_.str.2:                               ## @.str.2
	.asciz	"unable to close file mapping handle"

	.comm	_ERROR_COMMITMENT_LIMIT,8,3     ## @ERROR_COMMITMENT_LIMIT
	.comm	_EFBIG,4,2                      ## @EFBIG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_git_mmap                       ; -- Begin function git_mmap
	.p2align	2
_git_mmap:                              ; @git_mmap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x19, x5
	mov	x24, x3
	mov	x21, x2
	mov	x22, x1
	mov	x20, x0
	mov	x0, x4
	bl	__get_osfhandle
	mov	x23, x0
	add	x1, sp, #8
	bl	_GetFileSizeEx
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_die
LBB0_2:
	ldr	x8, [sp, #8]
	add	x9, x19, x22
	cmp	x9, x8
	b.ls	LBB0_4
; %bb.3:
	sub	x0, x8, x19
	bl	_xsize_t
	mov	x22, x0
LBB0_4:
Lloh2:
	adrp	x8, _MAP_PRIVATE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAP_PRIVATE@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	tst	w8, w24
	b.ne	LBB0_6
; %bb.5:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_die
LBB0_6:
Lloh7:
	adrp	x24, _PROT_READ@GOTPAGE
Lloh8:
	ldr	x24, [x24, _PROT_READ@GOTPAGEOFF]
Lloh9:
	adrp	x8, _PAGE_READONLY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_READONLY@GOTPAGEOFF]
	ldr	w9, [x24]
Lloh11:
	adrp	x10, _PAGE_WRITECOPY@GOTPAGE
Lloh12:
	ldr	x10, [x10, _PAGE_WRITECOPY@GOTPAGEOFF]
	cmp	w9, w21
	csel	x8, x8, x10, eq
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, #0
	mov	w3, #0
	mov	w4, #0
	mov	x5, #0
	bl	_CreateFileMapping
	cbz	x0, LBB0_9
; %bb.7:
	mov	x23, x0
Lloh13:
	adrp	x8, _FILE_MAP_READ@GOTPAGE
Lloh14:
	ldr	x8, [x8, _FILE_MAP_READ@GOTPAGEOFF]
	ldr	w9, [x24]
Lloh15:
	adrp	x10, _FILE_MAP_COPY@GOTPAGE
Lloh16:
	ldr	x10, [x10, _FILE_MAP_COPY@GOTPAGEOFF]
	cmp	w9, w21
	csel	x8, x8, x10, eq
	ldr	w1, [x8]
	mov	x3, x19
	mov	x4, x22
	mov	x5, x20
	bl	_MapViewOfFileEx
	mov	x19, x0
	mov	x0, x23
	bl	_CloseHandle
	cbz	w0, LBB0_10
; %bb.8:
	cbnz	x19, LBB0_13
	b	LBB0_11
LBB0_9:
Lloh17:
	adrp	x8, _EINVAL@GOTPAGE
Lloh18:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_12
LBB0_10:
Lloh19:
	adrp	x0, l_.str.2@PAGE
Lloh20:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_warning
	cbnz	x19, LBB0_13
LBB0_11:
	bl	_GetLastError
Lloh21:
	adrp	x8, _ERROR_COMMITMENT_LIMIT@GOTPAGE
Lloh22:
	ldr	x8, [x8, _ERROR_COMMITMENT_LIMIT@GOTPAGEOFF]
Lloh23:
	adrp	x9, _EFBIG@GOTPAGE
Lloh24:
	ldr	x9, [x9, _EFBIG@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
Lloh26:
	adrp	x10, _EINVAL@GOTPAGE
Lloh27:
	ldr	x10, [x10, _EINVAL@GOTPAGEOFF]
	cmp	x0, x8
	csel	x8, x9, x10, eq
LBB0_12:
	ldr	w8, [x8]
Lloh28:
	adrp	x9, _errno@GOTPAGE
Lloh29:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh30:
	str	w8, [x9]
Lloh31:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh32:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh33:
	ldr	x19, [x8]
LBB0_13:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh25
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"mmap: could not determine filesize"

	.comm	_MAP_PRIVATE,4,2                ; @MAP_PRIVATE
l_.str.1:                               ; @.str.1
	.asciz	"Invalid usage of mmap when built with USE_WIN32_MMAP"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PAGE_READONLY,4,2              ; @PAGE_READONLY
	.comm	_PAGE_WRITECOPY,4,2             ; @PAGE_WRITECOPY
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_errno,4,2                      ; @errno
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
	.comm	_FILE_MAP_READ,4,2              ; @FILE_MAP_READ
	.comm	_FILE_MAP_COPY,4,2              ; @FILE_MAP_COPY
l_.str.2:                               ; @.str.2
	.asciz	"unable to close file mapping handle"

	.comm	_ERROR_COMMITMENT_LIMIT,8,3     ; @ERROR_COMMITMENT_LIMIT
	.comm	_EFBIG,4,2                      ; @EFBIG
.subsections_via_symbols
