	.file	"extr_cs2.c_Cs2GetMPEGRom.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"rb"
	.text
	.p2align 4
	.globl	Cs2GetMPEGRom
	.type	Cs2GetMPEGRom, @function
Cs2GetMPEGRom:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 8[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR Cs2Area[rip]
	mov	rdx, QWORD PTR 72[rax]
	mov	rdi, QWORD PTR 56[rax]
	mov	QWORD PTR 64[rax], 0
	or	DWORD PTR [rax], 768
	mov	QWORD PTR 48[rax], rdx
	test	rdi, rdi
	jne	.L21
.L2:
	mov	edi, DWORD PTR 40[rax]
	call	doCDReport@PLT
	mov	rdx, QWORD PTR Cs2Area[rip]
	mov	eax, DWORD PTR CDB_HIRQ_CMOK[rip]
	or	eax, DWORD PTR CDB_HIRQ_MPED[rip]
	or	DWORD PTR 32[rdx], eax
	mov	rax, QWORD PTR 8[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L22
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L21:
	.cfi_restore_state
	lea	rsi, .LC0[rip]
	call	fopen@PLT
	mov	rbp, rax
	mov	rax, QWORD PTR Cs2Area[rip]
	test	rbp, rbp
	je	.L2
	mov	esi, DWORD PTR 16[rax]
	mov	edx, DWORD PTR SEEK_SET[rip]
	mov	rdi, rbp
	mov	r12, QWORD PTR 24[rax]
	sal	esi, 8
	movzx	esi, si
	or	esi, DWORD PTR 20[rax]
	imul	esi, DWORD PTR 4[rax]
	call	fseek@PLT
	mov	rax, QWORD PTR Cs2Area[rip]
	mov	rdi, QWORD PTR 48[rax]
	call	Cs2GetPartition@PLT
	mov	rbx, rax
	test	rax, rax
	je	.L4
	mov	rax, QWORD PTR Cs2Area[rip]
	mov	edx, DWORD PTR 44[rax]
	test	edx, edx
	jne	.L4
	mov	QWORD PTR [rsp], 0
	mov	QWORD PTR 8[rbx], 0
	test	r12, r12
	jle	.L5
	xor	r13d, r13d
	mov	r14, rsp
	.p2align 4,,10
	.p2align 3
.L7:
	mov	rax, QWORD PTR [rbx]
	mov	rdx, QWORD PTR 16[rbx]
	lea	r15, [rdx+rax*8]
	mov	rdx, QWORD PTR 24[rbx]
	lea	rdi, [rdx+rax*4]
	call	Cs2AllocateBlock@PLT
	mov	rdx, QWORD PTR [rbx]
	mov	QWORD PTR [r15], rax
	mov	rax, QWORD PTR 16[rbx]
	mov	rax, QWORD PTR [rax+rdx*8]
	test	rax, rax
	je	.L6
	mov	rdx, QWORD PTR Cs2Area[rip]
	mov	rsi, QWORD PTR [rax]
	mov	r8, rbp
	mov	rdi, r14
	mov	ecx, DWORD PTR 4[rdx]
	mov	edx, 1
	call	yread@PLT
	mov	rax, QWORD PTR Cs2Area[rip]
	add	QWORD PTR [rbx], 1
	movsx	rax, DWORD PTR 4[rax]
	add	QWORD PTR 8[rbx], rax
.L6:
	add	r13, 1
	cmp	r12, r13
	jne	.L7
	mov	rax, QWORD PTR Cs2Area[rip]
.L5:
	mov	edx, DWORD PTR CDB_HIRQ_CSCT[rip]
	or	DWORD PTR 32[rax], edx
	mov	DWORD PTR 8[rax], 1
.L4:
	mov	rdi, rbp
	call	fclose@PLT
	mov	rax, QWORD PTR Cs2Area[rip]
	jmp	.L2
.L22:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	Cs2GetMPEGRom, .-Cs2GetMPEGRom
	.comm	SEEK_SET,4,4
	.comm	Cs2Area,8,8
	.comm	CDB_HIRQ_MPED,4,4
	.comm	CDB_HIRQ_CSCT,4,4
	.comm	CDB_HIRQ_CMOK,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_cs2.c_Cs2GetMPEGRom.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"rb\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	Cs2GetMPEGRom
	.syntax unified
	.arm
	.fpu softvfp
	.type	Cs2GetMPEGRom, %function
Cs2GetMPEGRom:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	mov	r1, #0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L24
	ldr	r4, .L24+4
	sub	sp, sp, #24
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	ldr	r3, [r4]
	ldr	r2, [r3]
	ldr	r0, [r3, #40]
	ldr	ip, [r3, #48]
	orr	r2, r2, #768
	cmp	r0, r1
	str	r2, [r3]
	str	ip, [r3, #36]
	str	r1, [r3, #44]
	bne	.L22
.L2:
	ldr	r0, [r3, #28]
	bl	doCDReport
	ldr	r3, .L24+8
	ldr	r2, .L24+12
	ldr	r1, [r4]
	ldr	r0, [r3]
	ldr	r2, [r2]
	ldr	r3, [r1, #24]
	orr	r2, r2, r0
	orr	r3, r3, r2
	str	r3, [r1, #24]
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L23
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L22:
	ldr	r1, .L24+16
	bl	fopen
	subs	r8, r0, #0
	beq	.L20
	ldr	ip, [r4]
	ldr	r3, .L24+20
	ldr	r1, [ip, #12]
	ldr	r2, [ip, #16]
	and	r3, r3, r1, lsl #8
	orr	r3, r3, r2
	ldr	r1, [ip, #4]
	ldr	r2, .L24+24
	mul	r1, r3, r1
	ldr	r2, [r2]
	ldr	r9, [ip, #20]
	bl	fseek
	ldr	r3, [r4]
	ldr	r0, [r3, #36]
	bl	Cs2GetPartition
	subs	r5, r0, #0
	beq	.L4
	ldr	r3, [r4]
	ldr	r7, [r3, #32]
	cmp	r7, #0
	bne	.L4
	cmp	r9, #0
	str	r7, [sp, #16]
	str	r7, [sp, #12]
	str	r7, [r5, #4]
	ble	.L5
	ldr	r6, [r5]
.L7:
	ldr	r0, [r5, #12]
	ldr	r10, [r5, #8]
	add	r0, r0, r6, lsl #2
	bl	Cs2AllocateBlock
	ldr	r3, [r5, #8]
	str	r0, [r10, r6, lsl #2]
	ldr	r6, [r5]
	ldr	r3, [r3, r6, lsl #2]
	cmp	r3, #0
	beq	.L6
	ldr	r2, [r4]
	ldr	r1, [r3]
	add	r0, sp, #12
	ldr	r3, [r2, #4]
	mov	r2, #1
	str	r8, [sp]
	bl	yread
	ldr	r2, [r4]
	ldr	r3, [r5, #4]
	ldr	r2, [r2, #4]
	ldr	r6, [r5]
	add	r3, r3, r2
	add	r6, r6, #1
	str	r3, [r5, #4]
	str	r6, [r5]
.L6:
	add	r7, r7, #1
	cmp	r9, r7
	bne	.L7
	ldr	r3, [r4]
.L5:
	mov	r0, #1
	ldr	r1, .L24+28
	ldr	r2, [r3, #24]
	ldr	r1, [r1]
	str	r0, [r3, #8]
	orr	r2, r2, r1
	str	r2, [r3, #24]
.L4:
	mov	r0, r8
	bl	fclose
.L20:
	ldr	r3, [r4]
	b	.L2
.L23:
	bl	__stack_chk_fail
.L25:
	.align	2
.L24:
	.word	.LC1
	.word	Cs2Area
	.word	CDB_HIRQ_MPED
	.word	CDB_HIRQ_CMOK
	.word	.LC0
	.word	65535
	.word	SEEK_SET
	.word	CDB_HIRQ_CSCT
	.size	Cs2GetMPEGRom, .-Cs2GetMPEGRom
	.comm	SEEK_SET,4,4
	.comm	Cs2Area,4,4
	.comm	CDB_HIRQ_MPED,4,4
	.comm	CDB_HIRQ_CSCT,4,4
	.comm	CDB_HIRQ_CMOK,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
