	.file	"extr_oseama.c_oseama_extract.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"No Seama file passed\n"
.LC1:
	.string	"No entity specified\n"
.LC2:
	.string	"No output file specified\n"
.LC3:
	.string	"r"
.LC4:
	.string	"Couldn't open %s\n"
.LC5:
	.string	"w"
.LC6:
	.string	"Couldn't read %s header\n"
	.text
	.p2align 4
	.type	oseama_extract, @function
oseama_extract:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	sub	rsp, 16
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	cmp	edi, 2
	jle	.L15
	mov	DWORD PTR optind[rip], 3
	mov	rax, QWORD PTR 16[rsi]
	mov	QWORD PTR seama_path[rip], rax
	call	oseama_extract_parse_options@PLT
	cmp	QWORD PTR entity_idx[rip], 0
	lea	rsi, .LC1[rip]
	js	.L13
	cmp	QWORD PTR out_path[rip], 0
	je	.L16
	mov	rdi, QWORD PTR seama_path[rip]
	lea	rsi, .LC3[rip]
	call	fopen@PLT
	mov	rbp, rax
	test	rax, rax
	je	.L17
	mov	rdi, QWORD PTR out_path[rip]
	lea	rsi, .LC5[rip]
	call	fopen@PLT
	mov	r13, rax
	test	rax, rax
	je	.L18
	lea	rdi, 4[rsp]
	mov	rcx, rbp
	mov	edx, 4
	mov	esi, 1
	call	fread@PLT
	cmp	rax, 4
	jne	.L19
	mov	edi, DWORD PTR 4[rsp]
	xor	r12d, r12d
	call	be16_to_cpu@PLT
	mov	edx, DWORD PTR SEEK_CUR[rip]
	mov	rdi, rbp
	mov	esi, eax
	call	fseek@PLT
	mov	rsi, r13
	mov	rdi, rbp
	call	oseama_extract_entity@PLT
.L10:
	mov	rdi, r13
	call	fclose@PLT
.L8:
.L3:
	endbr64
	mov	rdi, rbp
	call	fclose@PLT
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L15:
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	call	fprintf@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
.L1:
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L20
	add	rsp, 16
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	mov	eax, r12d
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L16:
	.cfi_restore_state
	lea	rsi, .LC2[rip]
.L13:
	mov	edi, DWORD PTR stderr[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	r12d, DWORD PTR EINVAL[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L19:
	mov	rdx, QWORD PTR seama_path[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC6[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	r12d, DWORD PTR EIO[rip]
	neg	r12d
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L17:
	mov	rdx, QWORD PTR seama_path[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	r12d, DWORD PTR EACCES[rip]
	neg	r12d
	jmp	.L1
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rdx, QWORD PTR out_path[rip]
	mov	edi, DWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	xor	eax, eax
	call	fprintf@PLT
	mov	r12d, DWORD PTR EACCES[rip]
	neg	r12d
	jmp	.L8
.L20:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	oseama_extract, .-oseama_extract
	.comm	stderr,4,4
	.comm	seama_path,8,8
	.comm	out_path,8,8
	.comm	optind,4,4
	.comm	entity_idx,8,8
	.comm	SEEK_CUR,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.comm	EACCES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_oseama.c_oseama_extract.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"No Seama file passed\012\000"
	.align	2
.LC1:
	.ascii	"No entity specified\012\000"
	.align	2
.LC2:
	.ascii	"No output file specified\012\000"
	.align	2
.LC3:
	.ascii	"r\000"
	.align	2
.LC4:
	.ascii	"Couldn't open %s\012\000"
	.align	2
.LC5:
	.ascii	"w\000"
	.align	2
.LC6:
	.ascii	"Couldn't read %s header\012\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	oseama_extract, %function
oseama_extract:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, lr}
	ldr	r3, .L22
	sub	sp, sp, #12
	cmp	r0, #2
	ldr	r3, [r3]
	str	r3, [sp, #4]
	mov	r3,#0
	ble	.L15
	mov	r2, #3
	ldr	r3, .L22+4
	ldr	ip, [r1, #8]
	ldr	r6, .L22+8
	str	r2, [r3]
	str	ip, [r6]
	bl	oseama_extract_parse_options
	ldr	r3, .L22+12
	ldr	r3, [r3]
	cmp	r3, #0
	blt	.L16
	ldr	r4, .L22+16
	ldr	r3, [r4]
	cmp	r3, #0
	beq	.L17
	ldr	r1, .L22+20
	ldr	r0, [r6]
	bl	fopen
	subs	r5, r0, #0
	beq	.L18
	ldr	r1, .L22+24
	ldr	r0, [r4]
	bl	fopen
	subs	r7, r0, #0
	beq	.L19
	mov	r3, r5
	mov	r2, #4
	mov	r1, #1
	mov	r0, sp
	bl	fread
	cmp	r0, #4
	bne	.L20
	ldr	r0, [sp]
	bl	be16_to_cpu
	ldr	r3, .L22+28
	mov	r1, r0
	ldr	r2, [r3]
	mov	r0, r5
	bl	fseek
	mov	r1, r7
	mov	r0, r5
	bl	oseama_extract_entity
	mov	r4, #0
.L10:
	mov	r0, r7
	bl	fclose
.L8:
.L3:
	mov	r0, r5
	bl	fclose
	b	.L1
.L15:
	ldr	r3, .L22+32
	ldr	r1, .L22+36
.L13:
	ldr	r0, [r3]
	bl	fprintf
	ldr	r3, .L22+40
	ldr	r4, [r3]
	rsb	r4, r4, #0
.L1:
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #4]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r0, r4
	add	sp, sp, #12
	@ sp needed
	pop	{r4, r5, r6, r7, pc}
.L20:
	ldr	r3, .L22+32
	ldr	r2, [r6]
	ldr	r0, [r3]
	ldr	r1, .L22+44
	bl	fprintf
	ldr	r3, .L22+48
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L10
.L17:
	ldr	r3, .L22+32
	ldr	r1, .L22+52
	b	.L13
.L16:
	ldr	r3, .L22+32
	ldr	r1, .L22+56
	b	.L13
.L18:
	ldr	r3, .L22+32
	ldr	r2, [r6]
	ldr	r0, [r3]
	ldr	r1, .L22+60
	bl	fprintf
	ldr	r3, .L22+64
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L1
.L19:
	ldr	r3, .L22+32
	ldr	r2, [r4]
	ldr	r0, [r3]
	ldr	r1, .L22+60
	bl	fprintf
	ldr	r3, .L22+64
	ldr	r4, [r3]
	rsb	r4, r4, #0
	b	.L8
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC7
	.word	optind
	.word	seama_path
	.word	entity_idx
	.word	out_path
	.word	.LC3
	.word	.LC5
	.word	SEEK_CUR
	.word	stderr
	.word	.LC0
	.word	EINVAL
	.word	.LC6
	.word	EIO
	.word	.LC2
	.word	.LC1
	.word	.LC4
	.word	EACCES
	.size	oseama_extract, .-oseama_extract
	.comm	stderr,4,4
	.comm	seama_path,4,4
	.comm	out_path,4,4
	.comm	optind,4,4
	.comm	entity_idx,4,4
	.comm	SEEK_CUR,4,4
	.comm	EIO,4,4
	.comm	EINVAL,4,4
	.comm	EACCES,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
