	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	cmpl	$2, %edi
	jl	LBB0_25
## %bb.1:
	movq	_optind@GOTPCREL(%rip), %r15
	cmpl	%edi, (%r15)
	je	LBB0_25
## %bb.2:
	movl	$4395, %esi                     ## imm = 0x112B
	movl	$1, %edi
	callq	_calloc
	testq	%rax, %rax
	je	LBB0_19
## %bb.3:
	movq	%rax, %r14
	movslq	(%r15), %rax
	movq	(%rbx,%rax,8), %rbx
	movq	%rbx, %rdi
	callq	_remove
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	_O_TRUNC@GOTPCREL(%rip), %rax
	orl	(%rax), %esi
	movq	%rbx, %rdi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_open
	cmpl	$-1, %eax
	je	LBB0_20
## %bb.4:
	movl	%eax, %r15d
	movl	$4395, %edx                     ## imm = 0x112B
	movl	%eax, %edi
	movq	%r14, %rsi
	callq	_write
	cmpl	$4395, %eax                     ## imm = 0x112B
	jne	LBB0_11
## %bb.5:
	movq	_PROT_READ@GOTPCREL(%rip), %rax
	movq	_PROT_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	orl	(%rax), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$4395, %esi                     ## imm = 0x112B
	xorl	%edi, %edi
	movl	%r15d, %r8d
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, %rbx
	movq	_MAP_FAILED@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rbx
	je	LBB0_21
## %bb.6:
	xorl	%edi, %edi
	callq	_time
	movl	%eax, %edi
	callq	_srandom
	xorl	%eax, %eax
	callq	_random
	movq	%rax, %r12
	movabsq	$33577691146684053, %rcx        ## imm = 0x774ABB712D0695
	mulq	%rcx
	shrq	$3, %rdx
	imulq	$4395, %rdx, %rax               ## imm = 0x112B
	subq	%rax, %r12
	movb	$1, (%rbx,%r12)
	movq	_MS_SYNC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$4395, %esi                     ## imm = 0x112B
	movq	%rbx, %rdi
	callq	_msync
	testq	%rax, %rax
	jne	LBB0_22
## %bb.7:
	movl	$4395, %esi                     ## imm = 0x112B
	movq	%rbx, %rdi
	callq	_munmap
	testq	%rax, %rax
	jne	LBB0_23
## %bb.8:
	movl	$4395, %edx                     ## imm = 0x112B
	movl	%r15d, %edi
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	callq	_pread
	cmpl	$4395, %eax                     ## imm = 0x112B
	jne	LBB0_12
## %bb.9:
	movsbl	(%r14,%r12), %edx
	cmpl	$1, %edx
	jne	LBB0_18
## %bb.10:
	leaq	L_.str.10(%rip), %rdi
	xorl	%ebx, %ebx
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_15
LBB0_11:
	movslq	%eax, %rsi
	leaq	L_.str.4(%rip), %rdi
	jmp	LBB0_13
LBB0_12:
	movslq	%eax, %rsi
	leaq	L_.str.8(%rip), %rdi
LBB0_13:
	movl	$4395, %edx                     ## imm = 0x112B
	xorl	%eax, %eax
	callq	_printf
LBB0_14:
	movl	$1, %ebx
LBB0_15:
	movl	%r15d, %edi
	callq	_close
LBB0_16:
	movq	%r14, %rdi
	callq	_free
	movl	%ebx, %eax
LBB0_17:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	leaq	L_.str.9(%rip), %rdi
	movq	%r12, %rsi
	xorl	%eax, %eax
	callq	_printf
	jmp	LBB0_14
LBB0_19:
	callq	_main.cold.1
	xorl	%eax, %eax
	jmp	LBB0_17
LBB0_20:
	leaq	L_.str.3(%rip), %rdi
	callq	_perror
	movl	$1, %ebx
	jmp	LBB0_16
LBB0_21:
	leaq	L_.str.5(%rip), %rdi
	jmp	LBB0_24
LBB0_22:
	leaq	L_.str.6(%rip), %rdi
	jmp	LBB0_24
LBB0_23:
	leaq	L_.str.7(%rip), %rdi
LBB0_24:
	callq	_perror
	jmp	LBB0_14
LBB0_25:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rdx
	leaq	L_.str.1(%rip), %rsi
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function main.cold.1
_main.cold.1:                           ## @main.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	leaq	L_.str.2(%rip), %rdi
	callq	_perror
	pushq	$1
	popq	%rdi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_optind,4,2                     ## @optind
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"usage: %s <file name>\n"

L_.str.2:                               ## @.str.2
	.asciz	"calloc"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
L_.str.3:                               ## @.str.3
	.asciz	"open to create"

L_.str.4:                               ## @.str.4
	.asciz	"short write: %d != %ud\n"

	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.5:                               ## @.str.5
	.asciz	"mmap"

	.comm	_MS_SYNC,4,2                    ## @MS_SYNC
L_.str.6:                               ## @.str.6
	.asciz	"msync"

L_.str.7:                               ## @.str.7
	.asciz	"munmap"

L_.str.8:                               ## @.str.8
	.asciz	"short read: %d != %ud\n"

L_.str.9:                               ## @.str.9
	.asciz	"bad data from read!  got buf[%ud]=%d, expected 1\n"

L_.str.10:                              ## @.str.10
	.asciz	"good data from read: buf[%ud]=1\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.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	x20, x1
	cmp	w0, #2
	b.lt	LBB0_23
; %bb.1:
Lloh0:
	adrp	x21, _optind@GOTPAGE
Lloh1:
	ldr	x21, [x21, _optind@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, w0
	b.eq	LBB0_23
; %bb.2:
	mov	w0, #1
	mov	w1, #4395
	bl	_calloc
	cbz	x0, LBB0_24
; %bb.3:
	mov	x19, x0
	ldrsw	x8, [x21]
	ldr	x20, [x20, x8, lsl #3]
	mov	x0, x20
	bl	_remove
Lloh2:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh8:
	adrp	x9, _O_TRUNC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _O_TRUNC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w1, w8, w9
	mov	x0, x20
	mov	w2, #438
	bl	_open
	cmn	w0, #1
	b.eq	LBB0_18
; %bb.4:
	mov	x20, x0
	mov	w21, #4395
	mov	x1, x19
	mov	w2, #4395
	bl	_write
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, w21
	b.ne	LBB0_11
; %bb.5:
Lloh11:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh12:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh13:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh14:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
Lloh16:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh17:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh18:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh19:
	ldr	w3, [x8]
	mov	w0, #0
	mov	w1, #4395
	mov	x4, x20
	mov	w5, #0
	bl	_mmap
Lloh20:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh21:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_19
; %bb.6:
	mov	x22, x0
	mov	x0, #0
	bl	_time
	bl	_srandom
	bl	_random
	mov	x8, #1685
	movk	x8, #28973, lsl #16
	movk	x8, #19131, lsl #32
	movk	x8, #119, lsl #48
	umulh	x8, x0, x8
	lsr	x8, x8, #3
	mov	w9, #4395
	msub	x21, x8, x9, x0
	mov	w8, #1
	strb	w8, [x22, x21]
Lloh23:
	adrp	x8, _MS_SYNC@GOTPAGE
Lloh24:
	ldr	x8, [x8, _MS_SYNC@GOTPAGEOFF]
Lloh25:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #4395
	bl	_msync
	cbnz	x0, LBB0_20
; %bb.7:
	mov	w23, #4395
	mov	x0, x22
	mov	w1, #4395
	bl	_munmap
	cbnz	x0, LBB0_21
; %bb.8:
	mov	x0, x20
	mov	x1, x19
	mov	w2, #4395
	mov	w3, #0
	bl	_pread
                                        ; kill: def $w0 killed $w0 def $x0
	cmp	w0, w23
	b.ne	LBB0_12
; %bb.9:
	ldrsb	w8, [x19, x21]
	cmp	w8, #1
	b.ne	LBB0_13
; %bb.10:
Lloh26:
	adrp	x0, l_.str.10@PAGE
Lloh27:
	add	x0, x0, l_.str.10@PAGEOFF
	mov	x1, x21
	bl	_printf
	mov	w21, #0
	b	LBB0_16
LBB0_11:
	sxtw	x1, w0
	mov	w8, #4395
	str	x8, [sp]
Lloh28:
	adrp	x0, l_.str.4@PAGE
Lloh29:
	add	x0, x0, l_.str.4@PAGEOFF
	b	LBB0_14
LBB0_12:
	sxtw	x1, w0
	mov	w8, #4395
	str	x8, [sp]
Lloh30:
	adrp	x0, l_.str.8@PAGE
Lloh31:
	add	x0, x0, l_.str.8@PAGEOFF
	b	LBB0_14
LBB0_13:
	str	x8, [sp]
Lloh32:
	adrp	x0, l_.str.9@PAGE
Lloh33:
	add	x0, x0, l_.str.9@PAGEOFF
	mov	x1, x21
LBB0_14:
	bl	_printf
LBB0_15:
	mov	w21, #1
LBB0_16:
	mov	x0, x20
	bl	_close
LBB0_17:
	mov	x0, x19
	bl	_free
	mov	x0, x21
	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
LBB0_18:
Lloh34:
	adrp	x0, l_.str.3@PAGE
Lloh35:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_perror
	mov	w21, #1
	b	LBB0_17
LBB0_19:
Lloh36:
	adrp	x0, l_.str.5@PAGE
Lloh37:
	add	x0, x0, l_.str.5@PAGEOFF
	b	LBB0_22
LBB0_20:
Lloh38:
	adrp	x0, l_.str.6@PAGE
Lloh39:
	add	x0, x0, l_.str.6@PAGEOFF
	b	LBB0_22
LBB0_21:
Lloh40:
	adrp	x0, l_.str.7@PAGE
Lloh41:
	add	x0, x0, l_.str.7@PAGEOFF
LBB0_22:
	bl	_perror
	b	LBB0_15
LBB0_23:
Lloh42:
	adrp	x8, _stderr@GOTPAGE
Lloh43:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh44:
	ldr	w0, [x8]
	ldr	x2, [x20]
Lloh45:
	adrp	x1, l_.str.1@PAGE
Lloh46:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	mov	w0, #1
	bl	_exit
LBB0_24:
	bl	_main.cold.1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh15
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpAdd	Lloh32, Lloh33
	.loh AdrpAdd	Lloh34, Lloh35
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpAdd	Lloh38, Lloh39
	.loh AdrpAdd	Lloh40, Lloh41
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function main.cold.1
_main.cold.1:                           ; @main.cold.1
	.cfi_startproc
; %bb.0:
	stp	x29, x30, [sp, #-16]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 16
	mov	x29, sp
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
Lloh47:
	adrp	x0, l_.str.2@PAGE
Lloh48:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_perror
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_optind,4,2                     ; @optind
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"usage: %s <file name>\n"

l_.str.2:                               ; @.str.2
	.asciz	"calloc"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
l_.str.3:                               ; @.str.3
	.asciz	"open to create"

l_.str.4:                               ; @.str.4
	.asciz	"short write: %d != %ud\n"

	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.5:                               ; @.str.5
	.asciz	"mmap"

	.comm	_MS_SYNC,4,2                    ; @MS_SYNC
l_.str.6:                               ; @.str.6
	.asciz	"msync"

l_.str.7:                               ; @.str.7
	.asciz	"munmap"

l_.str.8:                               ; @.str.8
	.asciz	"short read: %d != %ud\n"

l_.str.9:                               ; @.str.9
	.asciz	"bad data from read!  got buf[%ud]=%d, expected 1\n"

l_.str.10:                              ; @.str.10
	.asciz	"good data from read: buf[%ud]=1\n"

.subsections_via_symbols
