	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_coff_rsrc                 ## -- Begin function read_coff_rsrc
	.p2align	4, 0x90
_read_coff_rsrc:                        ## @read_coff_rsrc
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	testq	%rdi, %rdi
	jne	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_fatal
LBB0_2:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_bfd_openr
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	%r14, %rdi
	callq	_bfd_fatal
LBB0_4:
	movq	_bfd_object@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	-56(%rbp), %rdx
	movq	%r15, %rdi
	callq	_bfd_check_format_matches
	testl	%eax, %eax
	jne	LBB0_8
## %bb.5:
	movq	%r15, %rdi
	callq	_bfd_get_filename
	movl	%eax, %edi
	callq	_bfd_nonfatal
	xorl	%eax, %eax
	callq	_bfd_get_error
	movq	_bfd_error_file_ambiguously_recognized@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_7
## %bb.6:
	movq	-56(%rbp), %rdi
	callq	_list_matching_formats
LBB0_7:
	movl	$1, %edi
	callq	_xexit
LBB0_8:
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_bfd_get_section_by_name
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str.2(%rip), %rdi
	callq	__
	movl	%eax, %edi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_fatal
LBB0_10:
	movq	_WR_KIND_BFD@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-44(%rbp), %rdi
	movq	%r15, %rsi
	movq	%r13, %rdx
	callq	_set_windres_bfd
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_bfd_section_size
	movl	%eax, %r12d
	movl	%eax, %edi
	callq	_res_alloc
	movq	%r14, %rbx
	movq	%rax, %r14
	leaq	-44(%rbp), %rdi
	movq	%rax, %rsi
	xorl	%edx, %edx
	movl	%r12d, %ecx
	callq	_get_windres_bfd_content
	movq	%rbx, -88(%rbp)
	movq	%r14, -64(%rbp)
	movslq	%r12d, %rax
	leaq	(%r14,%rax,4), %rax
	movq	%rax, -72(%rbp)
	movq	%r15, %rdi
	movq	%r13, %rsi
	callq	_bfd_get_section_vma
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_pe_data
	subq	(%rax), %rbx
	movq	%rbx, -80(%rbp)
	leaq	-88(%rbp), %rdx
	leaq	-44(%rbp), %rdi
	movq	%r14, %rsi
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_read_coff_res_dir
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_bfd_close
	movq	%rbx, %rax
	addq	$56, %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	"filename required for COFF input"

	.comm	_bfd_object,4,2                 ## @bfd_object
	.comm	_bfd_error_file_ambiguously_recognized,8,3 ## @bfd_error_file_ambiguously_recognized
L_.str.1:                               ## @.str.1
	.asciz	".rsrc"

L_.str.2:                               ## @.str.2
	.asciz	"%s: no resource section"

	.comm	_WR_KIND_BFD,4,2                ## @WR_KIND_BFD
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_read_coff_rsrc                 ; -- Begin function read_coff_rsrc
	.p2align	2
_read_coff_rsrc:                        ; @read_coff_rsrc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x1
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	bl	_fatal
LBB0_2:
	mov	x0, x20
	mov	x1, x19
	bl	_bfd_openr
	mov	x19, x0
	cbnz	x0, LBB0_4
; %bb.3:
	mov	x0, x20
	bl	_bfd_fatal
LBB0_4:
Lloh2:
	adrp	x8, _bfd_object@GOTPAGE
Lloh3:
	ldr	x8, [x8, _bfd_object@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
	add	x2, sp, #48
	mov	x0, x19
	bl	_bfd_check_format_matches
	cbnz	w0, LBB0_8
; %bb.5:
	mov	x0, x19
	bl	_bfd_get_filename
	bl	_bfd_nonfatal
	bl	_bfd_get_error
Lloh5:
	adrp	x8, _bfd_error_file_ambiguously_recognized@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bfd_error_file_ambiguously_recognized@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	cmp	x0, x8
	b.ne	LBB0_7
; %bb.6:
	ldr	x0, [sp, #48]
	bl	_list_matching_formats
LBB0_7:
	mov	w0, #1
	bl	_xexit
LBB0_8:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_bfd_get_section_by_name
	mov	x21, x0
	cbnz	x0, LBB0_10
; %bb.9:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	__
	str	x20, [sp]
	bl	_fatal
LBB0_10:
Lloh12:
	adrp	x8, _WR_KIND_BFD@GOTPAGE
Lloh13:
	ldr	x8, [x8, _WR_KIND_BFD@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	sub	x0, x29, #52
	mov	x1, x19
	mov	x2, x21
	bl	_set_windres_bfd
	mov	x0, x19
	mov	x1, x21
	bl	_bfd_section_size
	mov	x22, x0
	bl	_res_alloc
	mov	x23, x0
	sub	x0, x29, #52
	mov	x1, x23
	mov	w2, #0
	mov	x3, x22
	bl	_get_windres_bfd_content
	add	x8, x23, w22, sxtw #2
	str	x20, [sp, #16]
	stp	x8, x23, [sp, #32]
	mov	x0, x19
	mov	x1, x21
	bl	_bfd_get_section_vma
	mov	x20, x0
	mov	x0, x19
	bl	_pe_data
	ldr	x8, [x0]
	sub	x8, x20, x8
	str	x8, [sp, #24]
	sub	x0, x29, #52
	add	x2, sp, #16
	mov	x1, x23
	mov	x3, #0
	mov	w4, #0
	bl	_read_coff_res_dir
	mov	x20, x0
	mov	x0, x19
	bl	_bfd_close
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"filename required for COFF input"

	.comm	_bfd_object,4,2                 ; @bfd_object
	.comm	_bfd_error_file_ambiguously_recognized,8,3 ; @bfd_error_file_ambiguously_recognized
l_.str.1:                               ; @.str.1
	.asciz	".rsrc"

l_.str.2:                               ; @.str.2
	.asciz	"%s: no resource section"

	.comm	_WR_KIND_BFD,4,2                ; @WR_KIND_BFD
.subsections_via_symbols
