	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mem_coredump                   ## -- Begin function mem_coredump
	.p2align	4, 0x90
_mem_coredump:                          ## @mem_coredump
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	%rdi, %r14
	movq	_O_TRUNC@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	%rsi, %rdi
	movl	%eax, %esi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_open
	testl	%eax, %eax
	js	LBB0_1
## %bb.3:
	movl	%eax, %r15d
	movl	%eax, %edi
	movl	$-1, %esi
	callq	_ftruncate
	testq	%rax, %rax
	js	LBB0_6
## %bb.4:
	movq	_MEM_PAGES@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jle	LBB0_5
## %bb.7:
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	jmp	LBB0_8
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_8 Depth=1
	incl	%ebx
	movq	_MEM_PAGES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_14
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_mem_pt
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movq	%rax, %r13
	movq	_PAGE_BITS@GOTPCREL(%rip), %rax
	movzbl	(%rax), %ecx
	movl	%ebx, %esi
	shll	%cl, %esi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	callq	_lseek
	testq	%rax, %rax
	js	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_8 Depth=1
	movq	(%r13), %rax
	movl	(%rax), %esi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	callq	_write
	testq	%rax, %rax
	js	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_8 Depth=1
	incl	%r12d
	jmp	LBB0_13
LBB0_5:
	xorl	%r12d, %r12d
LBB0_14:
	leaq	L_.str.4(%rip), %rdi
	movl	%r12d, %esi
	callq	_printk
	movl	%r15d, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_1:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_2
LBB0_6:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_2
LBB0_10:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_2
LBB0_15:
	leaq	L_.str.3(%rip), %rdi
LBB0_2:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_perror                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_TRUNC,4,2                    ## @O_TRUNC
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"open"

L_.str.1:                               ## @.str.1
	.asciz	"ftruncate"

	.comm	_MEM_PAGES,4,2                  ## @MEM_PAGES
	.comm	_PAGE_BITS,4,2                  ## @PAGE_BITS
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.2:                               ## @.str.2
	.asciz	"lseek"

	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
L_.str.3:                               ## @.str.3
	.asciz	"write"

L_.str.4:                               ## @.str.4
	.asciz	"dumped %d pages\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_mem_coredump                   ; -- Begin function mem_coredump
	.p2align	2
_mem_coredump:                          ; @mem_coredump
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x8, x1
	mov	x19, x0
Lloh0:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
Lloh3:
	adrp	x10, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x10, [x10, _O_RDWR@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh6:
	adrp	x10, _O_TRUNC@GOTPAGE
Lloh7:
	ldr	x10, [x10, _O_TRUNC@GOTPAGEOFF]
Lloh8:
	ldr	w10, [x10]
	orr	w1, w9, w10
	mov	x0, x8
	mov	w2, #438
	bl	_open
	tbnz	w0, #31, LBB0_11
; %bb.1:
	mov	x20, x0
	mov	w1, #-1
	bl	_ftruncate
	tbnz	x0, #63, LBB0_12
; %bb.2:
Lloh9:
	adrp	x24, _MEM_PAGES@GOTPAGE
Lloh10:
	ldr	x24, [x24, _MEM_PAGES@GOTPAGEOFF]
	ldr	w8, [x24]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.3:
	mov	w22, #0
	mov	w21, #0
Lloh11:
	adrp	x25, _PAGE_BITS@GOTPAGE
Lloh12:
	ldr	x25, [x25, _PAGE_BITS@GOTPAGEOFF]
Lloh13:
	adrp	x26, _SEEK_SET@GOTPAGE
Lloh14:
	ldr	x26, [x26, _SEEK_SET@GOTPAGEOFF]
Lloh15:
	adrp	x27, _PAGE_SIZE@GOTPAGE
Lloh16:
	ldr	x27, [x27, _PAGE_SIZE@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w22, w22, #1
	ldr	w8, [x24]
	cmp	w22, w8
	b.ge	LBB0_10
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_mem_pt
	cbz	x0, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x0
	ldr	w8, [x25]
	lsl	w1, w22, w8
	ldr	w2, [x26]
	mov	x0, x20
	bl	_lseek
	tbnz	x0, #63, LBB0_13
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x23]
	ldr	w1, [x8]
	ldr	w2, [x27]
	mov	x0, x20
	bl	_write
	tbnz	x0, #63, LBB0_14
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=1
	add	w21, w21, #1
	b	LBB0_4
LBB0_9:
	mov	w21, #0
LBB0_10:
Lloh17:
	adrp	x0, l_.str.4@PAGE
Lloh18:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x21
	bl	_printk
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_close
LBB0_11:
Lloh19:
	adrp	x0, l_.str@PAGE
Lloh20:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_15
LBB0_12:
Lloh21:
	adrp	x0, l_.str.1@PAGE
Lloh22:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_15
LBB0_13:
Lloh23:
	adrp	x0, l_.str.2@PAGE
Lloh24:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_15
LBB0_14:
Lloh25:
	adrp	x0, l_.str.3@PAGE
Lloh26:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_15:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_perror
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh25, Lloh26
	.cfi_endproc
                                        ; -- End function
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_TRUNC,4,2                    ; @O_TRUNC
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"open"

l_.str.1:                               ; @.str.1
	.asciz	"ftruncate"

	.comm	_MEM_PAGES,4,2                  ; @MEM_PAGES
	.comm	_PAGE_BITS,4,2                  ; @PAGE_BITS
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.2:                               ; @.str.2
	.asciz	"lseek"

	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
l_.str.3:                               ; @.str.3
	.asciz	"write"

l_.str.4:                               ; @.str.4
	.asciz	"dumped %d pages\n"

.subsections_via_symbols
