	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_open_file                      ## -- Begin function open_file
	.p2align	4, 0x90
_open_file:                             ## @open_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	_fnames@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	%edi, %rbx
	movq	%rsi, (%rax,%rbx,8)
	testl	%edx, %edx
	jg	LBB0_1
## %bb.2:
	movq	_O_RDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	jmp	LBB0_3
LBB0_1:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movq	_O_CREAT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
LBB0_3:
	movq	%r14, %rdi
	movl	$384, %edx                      ## imm = 0x180
	callq	_open
	movq	_fd@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movl	%eax, (%rcx,%rbx,4)
	testl	%r15d, %r15d
	js	LBB0_4
## %bb.6:
	testl	%eax, %eax
	jns	LBB0_7
## %bb.12:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$1, %edi
	callq	_exit
LBB0_4:
	testl	%eax, %eax
	js	LBB0_5
LBB0_7:
	movq	_SEEK_END@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%eax, %edi
	xorl	%esi, %esi
	callq	_lseek
	movq	_fsize@GOTPCREL(%rip), %r15
	movq	(%r15), %rcx
	movq	%rax, (%rcx,%rbx,8)
	testq	%rax, %rax
	js	LBB0_13
## %bb.8:
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	xorl	%esi, %esi
	callq	_lseek
	movq	_verbosity@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_10
## %bb.9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %ecx
	movq	(%r15), %rax
	movq	(%rax,%rbx,8), %r8
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
	xorl	%eax, %eax
	callq	_fprintf
LBB0_10:
	movq	(%r12), %rax
	movl	(%rax,%rbx,4), %eax
LBB0_11:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_5:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str(%rip), %rsi
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$-1, %eax
	jmp	LBB0_11
LBB0_13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_progname@GOTPCREL(%rip), %rax
	movq	(%rax), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%r14, %rcx
	xorl	%eax, %eax
	callq	_fprintf
	movl	$2, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_fnames,8,3                     ## @fnames
	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_O_CREAT,4,2                    ## @O_CREAT
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_fd,8,3                         ## @fd
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s: cannot open %s: %m\n"

	.comm	_progname,8,3                   ## @progname
	.comm	_SEEK_END,4,2                   ## @SEEK_END
	.comm	_fsize,8,3                      ## @fsize
L_.str.1:                               ## @.str.1
	.asciz	"%s: cannot seek %s: %m\n"

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_verbosity,8,3                  ## @verbosity
L_.str.2:                               ## @.str.2
	.asciz	"opened file %s, fd=%d, size=%lld\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_open_file                      ; -- Begin function open_file
	.p2align	2
_open_file:                             ; @open_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x21, x2
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _fnames@GOTPAGE
Lloh1:
	ldr	x8, [x8, _fnames@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x1, [x8, w0, sxtw #3]
Lloh3:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _O_CREAT@GOTPAGE
Lloh7:
	ldr	x9, [x9, _O_CREAT@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh9:
	adrp	x9, _O_RDONLY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _O_RDONLY@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	cmp	w2, #0
	csel	w1, w8, w9, gt
	mov	x0, x19
	mov	w2, #384
	bl	_open
Lloh12:
	adrp	x22, _fd@GOTPAGE
Lloh13:
	ldr	x22, [x22, _fd@GOTPAGEOFF]
	ldr	x8, [x22]
	str	w0, [x8, w20, sxtw #2]
	tbnz	w21, #31, LBB0_3
; %bb.1:
	tbz	w0, #31, LBB0_4
; %bb.2:
Lloh14:
	adrp	x8, _stderr@GOTPAGE
Lloh15:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
Lloh17:
	adrp	x8, _progname@GOTPAGE
Lloh18:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh19:
	ldr	x2, [x8]
	str	x19, [sp]
Lloh20:
	adrp	x1, l_.str@PAGE
Lloh21:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #1
	bl	_exit
LBB0_3:
	tbnz	w0, #31, LBB0_9
LBB0_4:
	sxtw	x20, w20
Lloh22:
	adrp	x8, _SEEK_END@GOTPAGE
Lloh23:
	ldr	x8, [x8, _SEEK_END@GOTPAGEOFF]
Lloh24:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
Lloh25:
	adrp	x21, _fsize@GOTPAGE
Lloh26:
	ldr	x21, [x21, _fsize@GOTPAGEOFF]
	ldr	x8, [x21]
	str	x0, [x8, x20, lsl #3]
	tbnz	x0, #63, LBB0_10
; %bb.5:
	ldr	x8, [x22]
	ldr	w0, [x8, x20, lsl #2]
Lloh27:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh28:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh29:
	ldr	w2, [x8]
	mov	w1, #0
	bl	_lseek
Lloh30:
	adrp	x8, _verbosity@GOTPAGE
Lloh31:
	ldr	x8, [x8, _verbosity@GOTPAGEOFF]
Lloh32:
	ldr	x8, [x8]
	cbz	x8, LBB0_7
; %bb.6:
Lloh33:
	adrp	x8, _stderr@GOTPAGE
Lloh34:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh35:
	ldr	w0, [x8]
	ldr	x8, [x22]
	ldr	x9, [x21]
	ldr	x9, [x9, x20, lsl #3]
	ldr	w8, [x8, x20, lsl #2]
	stp	x8, x9, [sp]
Lloh36:
	adrp	x1, l_.str.2@PAGE
Lloh37:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x2, x19
	bl	_fprintf
LBB0_7:
	ldr	x8, [x22]
	ldr	w0, [x8, x20, lsl #2]
LBB0_8:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_9:
Lloh38:
	adrp	x8, _stderr@GOTPAGE
Lloh39:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh40:
	ldr	w0, [x8]
Lloh41:
	adrp	x8, _progname@GOTPAGE
Lloh42:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh43:
	ldr	x2, [x8]
	str	x19, [sp]
Lloh44:
	adrp	x1, l_.str@PAGE
Lloh45:
	add	x1, x1, l_.str@PAGEOFF
	bl	_fprintf
	mov	w0, #-1
	b	LBB0_8
LBB0_10:
Lloh46:
	adrp	x8, _stderr@GOTPAGE
Lloh47:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh48:
	ldr	w0, [x8]
Lloh49:
	adrp	x8, _progname@GOTPAGE
Lloh50:
	ldr	x8, [x8, _progname@GOTPAGEOFF]
Lloh51:
	ldr	x2, [x8]
	str	x19, [sp]
Lloh52:
	adrp	x1, l_.str.1@PAGE
Lloh53:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_fprintf
	mov	w0, #2
	bl	_exit
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.cfi_endproc
                                        ; -- End function
	.comm	_fnames,8,3                     ; @fnames
	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_O_CREAT,4,2                    ; @O_CREAT
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_fd,8,3                         ; @fd
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s: cannot open %s: %m\n"

	.comm	_progname,8,3                   ; @progname
	.comm	_SEEK_END,4,2                   ; @SEEK_END
	.comm	_fsize,8,3                      ; @fsize
l_.str.1:                               ; @.str.1
	.asciz	"%s: cannot seek %s: %m\n"

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_verbosity,8,3                  ; @verbosity
l_.str.2:                               ; @.str.2
	.asciz	"opened file %s, fd=%d, size=%lld\n"

.subsections_via_symbols
