	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_open_patch_file                ## -- Begin function open_patch_file
	.p2align	4, 0x90
_open_patch_file:                       ## @open_patch_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	%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
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.1:
	movq	%rdi, %rbx
	cmpb	$0, (%rdi)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, %rdi
	callq	_strEQ
	testq	%rax, %rax
	je	LBB0_14
LBB0_3:
	movq	_TMPPATNAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_fopen
	movq	_pfp@GOTPCREL(%rip), %r12
	movq	%rax, (%r12)
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	movq	_TMPPATNAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.2(%rip), %rdi
	callq	_pfatal
LBB0_5:
	movq	_buf@GOTPCREL(%rip), %r13
	movl	(%r13), %edi
	movq	_buf_size@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	_stdin@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movl	$1, %esi
	callq	_fread
	testl	%eax, %eax
	jle	LBB0_10
## %bb.6:
	movl	%eax, %ebx
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r13), %edi
	movl	(%r15), %edx
	movl	(%r14), %ecx
	movl	$1, %esi
	callq	_fread
	movl	%eax, %ebx
	testl	%eax, %eax
	jle	LBB0_10
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r13), %edi
	movq	(%r12), %rcx
	movl	$1, %esi
	movl	%ebx, %edx
	callq	_fwrite
	cmpl	%eax, %ebx
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_TMPPATNAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.3(%rip), %rdi
	callq	_pfatal
	jmp	LBB0_9
LBB0_10:
	movq	(%r12), %rbx
	movq	%rbx, %rdi
	callq	_ferror
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	movq	%rbx, %rdi
	callq	_fclose
	testq	%rax, %rax
	je	LBB0_13
LBB0_12:
	movq	_TMPPATNAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	leaq	L_.str.4(%rip), %rdi
	callq	_pfatal
LBB0_13:
	movq	_TMPPATNAME@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_14:
	leaq	L_.str.5(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fopen
	movq	_pfp@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	testq	%rax, %rax
	jne	LBB0_16
## %bb.15:
	leaq	L_.str.6(%rip), %rdi
	movq	%rbx, %rsi
	callq	_pfatal
	movq	(%r14), %rax
LBB0_16:
	movq	%rax, %rdi
	callq	_fileno
	leaq	-48(%rbp), %rsi
	movl	%eax, %edi
	callq	_fstat
	testq	%rax, %rax
	je	LBB0_18
## %bb.17:
	leaq	L_.str.7(%rip), %rdi
	movq	%rbx, %rsi
	callq	_pfatal
LBB0_18:
	movl	-48(%rbp), %eax
	movq	_p_filesize@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	$1, %esi
	xorl	%edi, %edi
	callq	_next_intuit_at
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_set_hunkmax                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-"

	.comm	_TMPPATNAME,8,3                 ## @TMPPATNAME
L_.str.1:                               ## @.str.1
	.asciz	"w"

	.comm	_pfp,8,3                        ## @pfp
L_.str.2:                               ## @.str.2
	.asciz	"can't create %s"

	.comm	_buf,4,2                        ## @buf
	.comm	_buf_size,4,2                   ## @buf_size
	.comm	_stdin,4,2                      ## @stdin
L_.str.3:                               ## @.str.3
	.asciz	"write error to %s"

L_.str.4:                               ## @.str.4
	.asciz	"can't write %s"

L_.str.5:                               ## @.str.5
	.asciz	"r"

L_.str.6:                               ## @.str.6
	.asciz	"patch file %s not found"

L_.str.7:                               ## @.str.7
	.asciz	"can't stat %s"

	.comm	_p_filesize,4,2                 ## @p_filesize
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_open_patch_file                ; -- Begin function open_patch_file
	.p2align	2
_open_patch_file:                       ; @open_patch_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
Lloh0:
	adrp	x21, _pfp@GOTPAGE
Lloh1:
	ldr	x21, [x21, _pfp@GOTPAGEOFF]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	ldrb	w8, [x0]
	cbz	w8, LBB0_3
; %bb.2:
Lloh2:
	adrp	x1, l_.str@PAGE
Lloh3:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_strEQ
	cbz	x0, LBB0_14
LBB0_3:
Lloh4:
	adrp	x22, _TMPPATNAME@GOTPAGE
Lloh5:
	ldr	x22, [x22, _TMPPATNAME@GOTPAGEOFF]
	ldr	x0, [x22]
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fopen
	str	x0, [x21]
	cbnz	x0, LBB0_5
; %bb.4:
	ldr	x1, [x22]
Lloh8:
	adrp	x0, l_.str.2@PAGE
Lloh9:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_pfatal
LBB0_5:
Lloh10:
	adrp	x23, _buf@GOTPAGE
Lloh11:
	ldr	x23, [x23, _buf@GOTPAGEOFF]
	ldr	w0, [x23]
Lloh12:
	adrp	x24, _buf_size@GOTPAGE
Lloh13:
	ldr	x24, [x24, _buf_size@GOTPAGEOFF]
	ldr	w2, [x24]
Lloh14:
	adrp	x25, _stdin@GOTPAGE
Lloh15:
	ldr	x25, [x25, _stdin@GOTPAGEOFF]
	ldr	w3, [x25]
	mov	w1, #1
	bl	_fread
	cmp	w0, #1
	b.lt	LBB0_10
; %bb.6:
	mov	x20, x0
Lloh16:
	adrp	x19, l_.str.3@PAGE
Lloh17:
	add	x19, x19, l_.str.3@PAGEOFF
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	ldr	w0, [x23]
	ldr	w2, [x24]
	ldr	w3, [x25]
	mov	w1, #1
	bl	_fread
	mov	x20, x0
	cmp	w0, #0
	b.le	LBB0_10
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x23]
	ldr	x3, [x21]
	mov	w1, #1
	mov	x2, x20
	bl	_fwrite
	cmp	w20, w0
	b.eq	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x1, [x22]
	mov	x0, x19
	bl	_pfatal
	b	LBB0_7
LBB0_10:
	ldr	x19, [x21]
	mov	x0, x19
	bl	_ferror
	cbnz	x0, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_fclose
	cbz	x0, LBB0_13
LBB0_12:
	ldr	x1, [x22]
Lloh18:
	adrp	x0, l_.str.4@PAGE
Lloh19:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pfatal
LBB0_13:
	ldr	x19, [x22]
LBB0_14:
Lloh20:
	adrp	x1, l_.str.5@PAGE
Lloh21:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x0, x19
	bl	_fopen
	str	x0, [x21]
	cbnz	x0, LBB0_16
; %bb.15:
Lloh22:
	adrp	x0, l_.str.6@PAGE
Lloh23:
	add	x0, x0, l_.str.6@PAGEOFF
	mov	x1, x19
	bl	_pfatal
	ldr	x0, [x21]
LBB0_16:
	bl	_fileno
	add	x1, sp, #8
	bl	_fstat
	cbz	x0, LBB0_18
; %bb.17:
Lloh24:
	adrp	x0, l_.str.7@PAGE
Lloh25:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	x1, x19
	bl	_pfatal
LBB0_18:
	ldr	w8, [sp, #8]
Lloh26:
	adrp	x9, _p_filesize@GOTPAGE
Lloh27:
	ldr	x9, [x9, _p_filesize@GOTPAGEOFF]
Lloh28:
	str	w8, [x9]
	mov	w0, #0
	mov	w1, #1
	bl	_next_intuit_at
	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
	add	sp, sp, #96
	b	_set_hunkmax
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotStr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-"

	.comm	_TMPPATNAME,8,3                 ; @TMPPATNAME
l_.str.1:                               ; @.str.1
	.asciz	"w"

	.comm	_pfp,8,3                        ; @pfp
l_.str.2:                               ; @.str.2
	.asciz	"can't create %s"

	.comm	_buf,4,2                        ; @buf
	.comm	_buf_size,4,2                   ; @buf_size
	.comm	_stdin,4,2                      ; @stdin
l_.str.3:                               ; @.str.3
	.asciz	"write error to %s"

l_.str.4:                               ; @.str.4
	.asciz	"can't write %s"

l_.str.5:                               ; @.str.5
	.asciz	"r"

l_.str.6:                               ; @.str.6
	.asciz	"patch file %s not found"

l_.str.7:                               ; @.str.7
	.asciz	"can't stat %s"

	.comm	_p_filesize,4,2                 ; @p_filesize
.subsections_via_symbols
