	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oseama_extract
_oseama_extract:                        ## @oseama_extract
	.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
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$2, %edi
	jg	LBB0_2
## %bb.1:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	jmp	LBB0_10
LBB0_2:
	movq	16(%rsi), %rax
	movq	_seama_path@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_optind@GOTPCREL(%rip), %rax
	movl	$3, (%rax)
	callq	_oseama_extract_parse_options
	movq	_entity_idx@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	js	LBB0_8
## %bb.3:
	movq	_out_path@GOTPCREL(%rip), %r12
	cmpq	$0, (%r12)
	je	LBB0_9
## %bb.4:
	movq	(%rbx), %rdi
	leaq	L_.str.3(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_13
## %bb.5:
	movq	%rax, %r14
	movq	(%r12), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_14
## %bb.6:
	movq	%rax, %r15
	leaq	-40(%rbp), %rdi
	movl	$1, %esi
	movl	$4, %edx
	movq	%r14, %rcx
	callq	_fread
	cmpq	$4, %rax
	jne	LBB0_15
## %bb.7:
	movl	-40(%rbp), %edi
	callq	_be16_to_cpu
	movq	_SEEK_CUR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_fseek
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_oseama_extract_entity
	xorl	%ebx, %ebx
	jmp	LBB0_16
LBB0_8:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_10
LBB0_9:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_10:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_11:
	subl	(%rax), %ebx
LBB0_12:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rdx
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EACCES@GOTPCREL(%rip), %rax
	jmp	LBB0_11
LBB0_14:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r12), %rdx
	leaq	L_.str.4(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EACCES@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_17
LBB0_15:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%rbx), %rdx
	leaq	L_.str.6(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
LBB0_16:
	movq	%r15, %rdi
	callq	_fclose
LBB0_17:
	movq	%r14, %rdi
	callq	_fclose
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"No Seama file passed\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_seama_path,8,3                 ## @seama_path
	.comm	_optind,4,2                     ## @optind
	.comm	_entity_idx,8,3                 ## @entity_idx
L_.str.1:                               ## @.str.1
	.asciz	"No entity specified\n"

	.comm	_out_path,8,3                   ## @out_path
L_.str.2:                               ## @.str.2
	.asciz	"No output file specified\n"

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

L_.str.4:                               ## @.str.4
	.asciz	"Couldn't open %s\n"

	.comm	_EACCES,4,2                     ## @EACCES
L_.str.5:                               ## @.str.5
	.asciz	"w"

L_.str.6:                               ## @.str.6
	.asciz	"Couldn't read %s header\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
	.no_dead_strip	_oseama_extract
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oseama_extract
_oseama_extract:                        ; @oseama_extract
	.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
	cmp	w0, #2
	b.gt	LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _stderr@GOTPAGE
Lloh1:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	b	LBB0_10
LBB0_2:
Lloh5:
	adrp	x21, _seama_path@GOTPAGE
Lloh6:
	ldr	x21, [x21, _seama_path@GOTPAGEOFF]
	ldr	x8, [x1, #16]
	str	x8, [x21]
Lloh7:
	adrp	x8, _optind@GOTPAGE
Lloh8:
	ldr	x8, [x8, _optind@GOTPAGEOFF]
	mov	w9, #3
Lloh9:
	str	w9, [x8]
	bl	_oseama_extract_parse_options
Lloh10:
	adrp	x8, _entity_idx@GOTPAGE
Lloh11:
	ldr	x8, [x8, _entity_idx@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	tbnz	x8, #63, LBB0_8
; %bb.3:
Lloh13:
	adrp	x22, _out_path@GOTPAGE
Lloh14:
	ldr	x22, [x22, _out_path@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_9
; %bb.4:
	ldr	x0, [x21]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_13
; %bb.5:
	mov	x19, x0
	ldr	x0, [x22]
Lloh17:
	adrp	x1, l_.str.5@PAGE
Lloh18:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_fopen
	cbz	x0, LBB0_14
; %bb.6:
	mov	x20, x0
	add	x0, sp, #8
	mov	w1, #1
	mov	w2, #4
	mov	x3, x19
	bl	_fread
	cmp	x0, #4
	b.ne	LBB0_15
; %bb.7:
	ldr	w0, [sp, #8]
	bl	_be16_to_cpu
	mov	x1, x0
Lloh19:
	adrp	x8, _SEEK_CUR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _SEEK_CUR@GOTPAGEOFF]
Lloh21:
	ldr	w2, [x8]
	mov	x0, x19
	bl	_fseek
	mov	x0, x19
	mov	x1, x20
	bl	_oseama_extract_entity
	mov	w21, #0
	b	LBB0_16
LBB0_8:
Lloh22:
	adrp	x8, _stderr@GOTPAGE
Lloh23:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_10
LBB0_9:
Lloh27:
	adrp	x8, _stderr@GOTPAGE
Lloh28:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh29:
	ldr	w0, [x8]
Lloh30:
	adrp	x1, l_.str.2@PAGE
Lloh31:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_10:
	bl	_fprintf
Lloh32:
	adrp	x8, _EINVAL@GOTPAGE
Lloh33:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_11:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_12:
	mov	x0, x21
	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_13:
Lloh34:
	adrp	x8, _stderr@GOTPAGE
Lloh35:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	ldr	x8, [x21]
	str	x8, [sp]
Lloh37:
	adrp	x1, l_.str.4@PAGE
Lloh38:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
Lloh39:
	adrp	x8, _EACCES@GOTPAGE
Lloh40:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
	b	LBB0_11
LBB0_14:
Lloh41:
	adrp	x8, _stderr@GOTPAGE
Lloh42:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	ldr	x8, [x22]
	str	x8, [sp]
Lloh44:
	adrp	x1, l_.str.4@PAGE
Lloh45:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_fprintf
Lloh46:
	adrp	x8, _EACCES@GOTPAGE
Lloh47:
	ldr	x8, [x8, _EACCES@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_17
LBB0_15:
Lloh49:
	adrp	x8, _stderr@GOTPAGE
Lloh50:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh51:
	ldr	w0, [x8]
	ldr	x8, [x21]
	str	x8, [sp]
Lloh52:
	adrp	x1, l_.str.6@PAGE
Lloh53:
	add	x1, x1, l_.str.6@PAGEOFF
	bl	_fprintf
Lloh54:
	adrp	x8, _EIO@GOTPAGE
Lloh55:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh56:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_16:
	mov	x0, x20
	bl	_fclose
LBB0_17:
	mov	x0, x19
	bl	_fclose
	b	LBB0_12
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpAdd	Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh54, Lloh55, Lloh56
	.loh AdrpAdd	Lloh52, Lloh53
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.cfi_endproc
                                        ; -- End function
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"No Seama file passed\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_seama_path,8,3                 ; @seama_path
	.comm	_optind,4,2                     ; @optind
	.comm	_entity_idx,8,3                 ; @entity_idx
l_.str.1:                               ; @.str.1
	.asciz	"No entity specified\n"

	.comm	_out_path,8,3                   ; @out_path
l_.str.2:                               ; @.str.2
	.asciz	"No output file specified\n"

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

l_.str.4:                               ; @.str.4
	.asciz	"Couldn't open %s\n"

	.comm	_EACCES,4,2                     ; @EACCES
l_.str.5:                               ; @.str.5
	.asciz	"w"

l_.str.6:                               ; @.str.6
	.asciz	"Couldn't read %s header\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
	.no_dead_strip	_oseama_extract
.subsections_via_symbols
