	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function oseama_extract_entity
_oseama_extract_entity:                 ## @oseama_extract_entity
	.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
	movl	$12328, %eax                    ## imm = 0x3028
	callq	____chkstk_darwin
	subq	%rax, %rsp
	popq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -12360(%rbp)              ## 8-byte Spill
	movq	%rdi, %r12
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	-12352(%rbp), %rdi
	movl	$1, %esi
	movl	$12, %edx
	movq	%r12, %rcx
	callq	_fread
	xorl	%r15d, %r15d
	cmpq	$12, %rax
	jne	LBB0_15
## %bb.1:
	movl	$-1, %r13d
	movq	_SEAMA_MAGIC@GOTPCREL(%rip), %r15
	leaq	-12352(%rbp), %r14
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	-12344(%rbp), %ebx
	movl	%ebx, %edi
	callq	_be32_to_cpu
	cmpl	(%r15), %eax
	jne	LBB0_3
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	-12348(%rbp), %edi
	callq	_be16_to_cpu
	movq	%rax, %rbx
	movl	-12352(%rbp), %edi
	callq	_be32_to_cpu
	incl	%r13d
	movq	_entity_idx@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %r13d
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	addl	%ebx, %eax
	movq	_SEEK_CUR@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_fseek
	movq	%r14, %rdi
	movl	$1, %esi
	movl	$12, %edx
	movq	%r12, %rcx
	callq	_fread
	cmpq	$12, %rax
	je	LBB0_2
## %bb.6:
	xorl	%r15d, %r15d
	jmp	LBB0_15
LBB0_3:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	%ebx, %edi
	callq	_be32_to_cpu
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%r14d, %edi
	movl	%eax, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EINVAL@GOTPCREL(%rip), %rax
	jmp	LBB0_14
LBB0_7:
	movslq	%eax, %r14
	movq	_SEEK_CUR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$-12, %esi
	callq	_fseek
	leaq	(%rbx,%r14), %r13
	addq	$12, %r13
	movl	$12288, %edi                    ## imm = 0x3000
	movq	%r13, %rsi
	callq	_oseama_min
	leaq	-12336(%rbp), %rdi
	movl	$1, %esi
	movl	%eax, %edx
	movq	%r12, %rcx
	callq	_fread
	xorl	%r15d, %r15d
	testq	%rax, %rax
	je	LBB0_12
## %bb.8:
	movq	%rax, %rbx
	leaq	-12336(%rbp), %r14
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r14, %rdi
	movl	$1, %esi
	movq	%rbx, %rdx
	movq	-12360(%rbp), %rcx              ## 8-byte Reload
	callq	_fwrite
	cmpq	%rbx, %rax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	subq	%rbx, %r13
	movl	$12288, %edi                    ## imm = 0x3000
	movq	%r13, %rsi
	callq	_oseama_min
	movq	%r14, %rdi
	movl	$1, %esi
	movl	%eax, %edx
	movq	%r12, %rcx
	callq	_fread
	movq	%rax, %rbx
	testq	%rax, %rax
	jne	LBB0_9
	jmp	LBB0_12
LBB0_10:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_out_path@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rsi
	xorl	%r15d, %r15d
	movl	%ebx, %edx
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EIO@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_12:
	testq	%r13, %r13
	je	LBB0_15
## %bb.13:
	movq	_stderr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_entity_idx@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_seama_path@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	leaq	L_.str.2(%rip), %rsi
	xorl	%r15d, %r15d
	movq	%r13, %r8
	xorl	%eax, %eax
	callq	_fprintf
	movq	_EIO@GOTPCREL(%rip), %rax
LBB0_14:
	subl	(%rax), %r15d
LBB0_15:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.16:
	movl	%r15d, %eax
	addq	$12328, %rsp                    ## imm = 0x3028
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_SEAMA_MAGIC,4,2                ## @SEAMA_MAGIC
	.comm	_stderr,4,2                     ## @stderr
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Invalid Seama magic: 0x%08x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_entity_idx,4,2                 ## @entity_idx
	.comm	_SEEK_CUR,4,2                   ## @SEEK_CUR
L_.str.1:                               ## @.str.1
	.asciz	"Couldn't write %zu B to %s\n"

	.comm	_out_path,4,2                   ## @out_path
	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"Couldn't extract whole entity %d from %s (%zu B left)\n"

	.comm	_seama_path,8,3                 ## @seama_path
	.no_dead_strip	_oseama_extract_entity
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function oseama_extract_entity
_oseama_extract_entity:                 ; @oseama_extract_entity
	.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	w9, #12336
Lloh0:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh1:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	sub	sp, sp, #3, lsl #12             ; =12288
	sub	sp, sp, #48
	mov	x19, x1
	mov	x20, x0
Lloh2:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh3:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
	add	x0, sp, #24
	mov	w1, #1
	mov	w2, #12
	mov	x3, x20
	bl	_fread
	cmp	x0, #12
	b.ne	LBB0_5
; %bb.1:
	mov	w24, #-1
Lloh5:
	adrp	x25, _SEAMA_MAGIC@GOTPAGE
Lloh6:
	ldr	x25, [x25, _SEAMA_MAGIC@GOTPAGEOFF]
Lloh7:
	adrp	x23, _entity_idx@GOTPAGE
Lloh8:
	ldr	x23, [x23, _entity_idx@GOTPAGEOFF]
Lloh9:
	adrp	x26, _SEEK_CUR@GOTPAGE
Lloh10:
	ldr	x26, [x26, _SEEK_CUR@GOTPAGEOFF]
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w21, [sp, #32]
	mov	x0, x21
	bl	_be32_to_cpu
	ldr	w8, [x25]
	cmp	w0, w8
	b.ne	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w0, [sp, #28]
	bl	_be16_to_cpu
	mov	x21, x0
	ldr	w0, [sp, #24]
	bl	_be32_to_cpu
	mov	x22, x0
	ldr	w8, [x23]
	add	w24, w24, #1
	cmp	w24, w8
	b.eq	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	add	w1, w22, w21
	ldr	w2, [x26]
	mov	x0, x20
	bl	_fseek
	add	x0, sp, #24
	mov	w1, #1
	mov	w2, #12
	mov	x3, x20
	bl	_fread
	cmp	x0, #12
	b.eq	LBB0_2
LBB0_5:
	mov	w0, #0
	b	LBB0_15
LBB0_6:
Lloh11:
	adrp	x8, _stderr@GOTPAGE
Lloh12:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh13:
	ldr	w19, [x8]
	mov	x0, x21
	bl	_be32_to_cpu
	mov	x2, x0
Lloh14:
	adrp	x1, l_.str@PAGE
Lloh15:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x19
	bl	_fprintf
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_14
LBB0_7:
	ldr	w2, [x26]
	mov	x0, x20
	mov	w1, #-12
	bl	_fseek
	add	x8, x21, w22, sxtw
	add	x21, x8, #12
	mov	w0, #12288
	mov	x1, x21
	bl	_oseama_min
	mov	x2, x0
	add	x0, sp, #40
	mov	w1, #1
	mov	x3, x20
	bl	_fread
	cbz	x0, LBB0_12
; %bb.8:
	mov	x22, x0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	add	x0, sp, #40
	mov	w1, #1
	mov	x2, x22
	mov	x3, x19
	bl	_fwrite
	cmp	x0, x22
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	sub	x21, x21, x22
	mov	w0, #12288
	mov	x1, x21
	bl	_oseama_min
	mov	x2, x0
	add	x0, sp, #40
	mov	w1, #1
	mov	x3, x20
	bl	_fread
	mov	x22, x0
	cbnz	x0, LBB0_9
	b	LBB0_12
LBB0_11:
Lloh18:
	adrp	x8, _stderr@GOTPAGE
Lloh19:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
Lloh21:
	adrp	x8, _out_path@GOTPAGE
Lloh22:
	ldr	x8, [x8, _out_path@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	str	x8, [sp]
Lloh24:
	adrp	x1, l_.str.1@PAGE
Lloh25:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x2, x22
	bl	_fprintf
Lloh26:
	adrp	x8, _EIO@GOTPAGE
Lloh27:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_12:
	cbz	x21, LBB0_15
; %bb.13:
Lloh29:
	adrp	x8, _stderr@GOTPAGE
Lloh30:
	ldr	x8, [x8, _stderr@GOTPAGEOFF]
Lloh31:
	ldr	w0, [x8]
	ldr	w2, [x23]
Lloh32:
	adrp	x8, _seama_path@GOTPAGE
Lloh33:
	ldr	x8, [x8, _seama_path@GOTPAGEOFF]
Lloh34:
	ldr	x8, [x8]
	stp	x8, x21, [sp]
Lloh35:
	adrp	x1, l_.str.2@PAGE
Lloh36:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_fprintf
Lloh37:
	adrp	x8, _EIO@GOTPAGE
Lloh38:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
LBB0_14:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_15:
	ldur	x8, [x29, #-88]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	add	sp, sp, #3, lsl #12             ; =12288
	add	sp, sp, #48
	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
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh37, Lloh38
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_SEAMA_MAGIC,4,2                ; @SEAMA_MAGIC
	.comm	_stderr,4,2                     ; @stderr
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Invalid Seama magic: 0x%08x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_entity_idx,4,2                 ; @entity_idx
	.comm	_SEEK_CUR,4,2                   ; @SEEK_CUR
l_.str.1:                               ; @.str.1
	.asciz	"Couldn't write %zu B to %s\n"

	.comm	_out_path,4,2                   ; @out_path
	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"Couldn't extract whole entity %d from %s (%zu B left)\n"

	.comm	_seama_path,8,3                 ; @seama_path
	.no_dead_strip	_oseama_extract_entity
.subsections_via_symbols
