	.file	"616451.c"
	.intel_syntax noprefix
	.text
	.globl	yn_response
	.bss
	.type	yn_response, @object
	.size	yn_response, 2
yn_response:
	.zero	2
	.globl	buffer
	.align 16
	.type	buffer, @object
	.size	buffer, 19
buffer:
	.zero	19
	.globl	byte
	.type	byte, @object
	.size	byte, 1
byte:
	.zero	1
	.globl	i
	.align 4
	.type	i, @object
	.size	i, 4
i:
	.zero	4
	.globl	c
	.align 4
	.type	c, @object
	.size	c, 4
c:
	.zero	4
	.globl	illegal
	.align 8
	.type	illegal, @object
	.size	illegal, 8
illegal:
	.zero	8
	.globl	legal
	.align 8
	.type	legal, @object
	.size	legal, 8
legal:
	.zero	8
	.globl	valid_input
	.align 4
	.type	valid_input, @object
	.size	valid_input, 4
valid_input:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"LegalADX v1.0 By Alex Free (C)2022"
	.align 8
.LC1:
	.ascii	"\nUsage:\nlegaladx <audio.adx> <aud"
	.string	"io.sfa>\n\n<audio.adx> is an ADX file generated by converting a WAV to an ADX file with the adxencd tool.\n\n<audio.sfa> is the output file created by LegalADX, which is compatible with sfdmuxapp.exe and the Dreamcast Movie Creator from the Sega Dreamcast SDK."
.LC2:
	.string	"r"
	.align 8
.LC3:
	.string	"\nWarning: the desired output file %s already exists. Is it OK to overwrite it with a new file of the same name?\n"
.LC4:
	.string	"(y/n): "
.LC5:
	.string	"%*[^\n]"
.LC6:
	.string	"%*c"
.LC7:
	.string	"y"
	.align 8
.LC8:
	.string	"Error: failed to delete the file %s, aborting conversion\n"
	.align 8
.LC9:
	.string	"Successfully deleted the file %s for overwriting\n"
.LC10:
	.string	"n"
.LC11:
	.string	"Aborted conversion"
	.align 8
.LC12:
	.string	"Invalid input, please enter y or n"
.LC13:
	.string	"w+b"
.LC14:
	.string	"r+b"
.LC15:
	.string	"\nConverting..."
	.align 8
.LC16:
	.string	"Error: Can not open the file %s for conversion\n"
	.align 8
.LC17:
	.string	"\nDone! The output file %s is compatible with sfdmuxapp.exe/sfdmux.dll/Dreamcast Movie Creator.\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 16
	mov	DWORD PTR -4[rbp], edi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR valid_input[rip], 0
	lea	rdi, .LC0[rip]
	call	puts@PLT
	cmp	DWORD PTR -4[rbp], 3
	je	.L2
	lea	rdi, .LC1[rip]
	call	puts@PLT
	mov	eax, 1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR legal[rip], rax
	mov	rax, QWORD PTR legal[rip]
	test	rax, rax
	je	.L4
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR legal[rip]
	mov	rdi, rax
	call	fclose@PLT
	jmp	.L5
.L9:
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	mov	rax, QWORD PTR stdin[rip]
	mov	rdx, rax
	mov	esi, 2
	lea	rdi, yn_response[rip]
	call	fgets@PLT
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	__isoc99_scanf@PLT
	lea	rsi, .LC7[rip]
	lea	rdi, yn_response[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L6
	mov	DWORD PTR valid_input[rip], 1
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	remove@PLT
	test	eax, eax
	je	.L7
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L3
.L7:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	jmp	.L5
.L6:
	lea	rsi, .LC10[rip]
	lea	rdi, yn_response[rip]
	call	strcmp@PLT
	test	eax, eax
	jne	.L8
	mov	DWORD PTR valid_input[rip], 1
	lea	rdi, .LC11[rip]
	call	puts@PLT
	mov	rax, QWORD PTR legal[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	eax, 1
	jmp	.L3
.L8:
	lea	rdi, .LC12[rip]
	call	puts@PLT
.L5:
	mov	eax, DWORD PTR valid_input[rip]
	test	eax, eax
	je	.L9
.L4:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC13[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR legal[rip], rax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rsi, .LC14[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR illegal[rip], rax
	mov	rax, QWORD PTR illegal[rip]
	test	rax, rax
	je	.L10
	lea	rdi, .LC15[rip]
	call	puts@PLT
	mov	rax, QWORD PTR illegal[rip]
	mov	edx, 0
	mov	esi, 0
	mov	rdi, rax
	call	fseek@PLT
	mov	rax, QWORD PTR illegal[rip]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR c[rip], eax
	mov	eax, DWORD PTR c[rip]
	mov	BYTE PTR buffer[rip], al
	mov	rax, QWORD PTR illegal[rip]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR c[rip], eax
	mov	eax, DWORD PTR c[rip]
	mov	BYTE PTR buffer[rip+1], al
	mov	BYTE PTR buffer[rip+2], 1
	mov	BYTE PTR buffer[rip+3], 28
	mov	rax, QWORD PTR illegal[rip]
	mov	edx, 0
	mov	esi, 4
	mov	rdi, rax
	call	fseek@PLT
	mov	DWORD PTR i[rip], 4
	jmp	.L11
.L12:
	mov	rax, QWORD PTR illegal[rip]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR c[rip], eax
	mov	edx, DWORD PTR c[rip]
	mov	eax, DWORD PTR i[rip]
	mov	ecx, edx
	cdqe
	lea	rdx, buffer[rip]
	mov	BYTE PTR [rax+rdx], cl
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L11:
	mov	eax, DWORD PTR i[rip]
	cmp	eax, 18
	jle	.L12
	jmp	.L18
.L10:
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC16[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L3
.L18:
	mov	eax, DWORD PTR i[rip]
	cdqe
	lea	rdx, buffer[rip]
	mov	BYTE PTR [rax+rdx], 0
	mov	rax, QWORD PTR legal[rip]
	mov	rcx, rax
	mov	edx, 19
	mov	esi, 1
	lea	rdi, buffer[rip]
	call	fwrite@PLT
	mov	DWORD PTR i[rip], 0
	jmp	.L14
.L15:
	mov	rax, QWORD PTR legal[rip]
	mov	rsi, rax
	mov	edi, 0
	call	fputc@PLT
	mov	eax, DWORD PTR i[rip]
	add	eax, 1
	mov	DWORD PTR i[rip], eax
.L14:
	mov	eax, DWORD PTR i[rip]
	cmp	eax, 251
	jle	.L15
	mov	DWORD PTR c[rip], 0
	jmp	.L16
.L17:
	mov	eax, DWORD PTR c[rip]
	mov	BYTE PTR byte[rip], al
	mov	rdx, QWORD PTR legal[rip]
	movzx	eax, BYTE PTR byte[rip]
	movzx	eax, al
	mov	rsi, rdx
	mov	edi, eax
	call	fputc@PLT
.L16:
	mov	rax, QWORD PTR illegal[rip]
	mov	rdi, rax
	call	fgetc@PLT
	mov	DWORD PTR c[rip], eax
	mov	eax, DWORD PTR c[rip]
	cmp	eax, -1
	jne	.L17
	mov	rax, QWORD PTR illegal[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR legal[rip]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 16
	mov	rax, QWORD PTR [rax]
	mov	rsi, rax
	lea	rdi, .LC17[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.ident	"GCC: (Ubuntu 10.5.0-1ubuntu1~20.04) 10.5.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, 6
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"616451.c"
	.text
	.comm	yn_response,2,4
	.comm	buffer,19,4
	.comm	byte,1,1
	.comm	i,4,4
	.comm	c,4,4
	.comm	illegal,4,4
	.comm	legal,4,4
	.comm	valid_input,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"LegalADX v1.0 By Alex Free (C)2022\000"
	.align	2
.LC1:
	.ascii	"\012Usage:\012legaladx <audio.adx> <audio.sfa>\012\012"
	.ascii	"<audio.adx> is an ADX file generated by converting "
	.ascii	"a WAV to an ADX file with the adxencd tool.\012\012"
	.ascii	"<audio.sfa> is the output file created by LegalADX,"
	.ascii	" which is compatible with sfdmuxapp.exe and the Dre"
	.ascii	"amcast Movie Creator from the Sega Dreamcast SDK.\000"
	.align	2
.LC2:
	.ascii	"r\000"
	.align	2
.LC3:
	.ascii	"\012Warning: the desired output file %s already exi"
	.ascii	"sts. Is it OK to overwrite it with a new file of th"
	.ascii	"e same name?\012\000"
	.align	2
.LC4:
	.ascii	"(y/n): \000"
	.align	2
.LC5:
	.ascii	"%*[^\012]\000"
	.align	2
.LC6:
	.ascii	"%*c\000"
	.align	2
.LC7:
	.ascii	"y\000"
	.align	2
.LC8:
	.ascii	"Error: failed to delete the file %s, aborting conve"
	.ascii	"rsion\012\000"
	.align	2
.LC9:
	.ascii	"Successfully deleted the file %s for overwriting\012"
	.ascii	"\000"
	.align	2
.LC10:
	.ascii	"n\000"
	.align	2
.LC11:
	.ascii	"Aborted conversion\000"
	.align	2
.LC12:
	.ascii	"Invalid input, please enter y or n\000"
	.align	2
.LC13:
	.ascii	"w+b\000"
	.align	2
.LC14:
	.ascii	"r+b\000"
	.align	2
.LC15:
	.ascii	"\012Converting...\000"
	.align	2
.LC16:
	.ascii	"Error: Can not open the file %s for conversion\012\000"
	.align	2
.LC17:
	.ascii	"\012Done! The output file %s is compatible with sfd"
	.ascii	"muxapp.exe/sfdmux.dll/Dreamcast Movie Creator.\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, .L19
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L19+4
	bl	puts
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	beq	.L2
	ldr	r0, .L19+8
	bl	puts
	mov	r3, #1
	b	.L3
.L2:
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L19+12
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	ldr	r2, .L19+16
	str	r3, [r2]
	ldr	r3, .L19+16
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L4
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L19+20
	bl	printf
	ldr	r3, .L19+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	b	.L5
.L9:
	ldr	r0, .L19+24
	bl	printf
	ldr	r3, .L19+28
	ldr	r3, [r3]
	mov	r2, r3
	mov	r1, #2
	ldr	r0, .L19+32
	bl	fgets
	ldr	r0, .L19+36
	bl	__isoc99_scanf
	ldr	r0, .L19+40
	bl	__isoc99_scanf
	ldr	r1, .L19+44
	ldr	r0, .L19+32
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L19
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r0, r3
	bl	remove
	mov	r3, r0
	cmp	r3, #0
	beq	.L7
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L19+48
	bl	printf
	mov	r3, #1
	b	.L3
.L7:
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L19+52
	bl	printf
	b	.L5
.L6:
	ldr	r1, .L19+56
	ldr	r0, .L19+32
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L8
	ldr	r3, .L19
	mov	r2, #1
	str	r2, [r3]
	ldr	r0, .L19+60
	bl	puts
	ldr	r3, .L19+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	mov	r3, #1
	b	.L3
.L8:
	ldr	r0, .L19+64
	bl	puts
.L5:
	ldr	r3, .L19
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L9
.L4:
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	ldr	r1, .L19+68
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	ldr	r2, .L19+16
	str	r3, [r2]
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	ldr	r1, .L19+72
	mov	r0, r3
	bl	fopen
	mov	r3, r0
	ldr	r2, .L19+76
	str	r3, [r2]
	ldr	r3, .L19+76
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L10
	ldr	r0, .L19+80
	bl	puts
	ldr	r3, .L19+76
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	fseek
	ldr	r3, .L19+76
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	ldr	r2, .L19+84
	str	r3, [r2]
	ldr	r3, .L19+84
	ldr	r3, [r3]
	and	r2, r3, #255
	ldr	r3, .L19+88
	strb	r2, [r3]
	ldr	r3, .L19+76
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	ldr	r2, .L19+84
	str	r3, [r2]
	ldr	r3, .L19+84
	ldr	r3, [r3]
	and	r2, r3, #255
	ldr	r3, .L19+88
	strb	r2, [r3, #1]
	ldr	r3, .L19+88
	mov	r2, #1
	strb	r2, [r3, #2]
	ldr	r3, .L19+88
	mov	r2, #28
	strb	r2, [r3, #3]
	ldr	r3, .L19+76
	ldr	r3, [r3]
	mov	r2, #0
	mov	r1, #4
	mov	r0, r3
	bl	fseek
	ldr	r3, .L19+92
	mov	r2, #4
	str	r2, [r3]
	b	.L11
.L12:
	ldr	r3, .L19+76
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	ldr	r2, .L19+84
	str	r3, [r2]
	ldr	r3, .L19+84
	ldr	r2, [r3]
	ldr	r3, .L19+92
	ldr	r3, [r3]
	and	r1, r2, #255
	ldr	r2, .L19+88
	strb	r1, [r2, r3]
	ldr	r3, .L19+92
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L19+92
	str	r3, [r2]
.L11:
	ldr	r3, .L19+92
	ldr	r3, [r3]
	cmp	r3, #18
	ble	.L12
	b	.L18
.L10:
	ldr	r3, [fp, #-12]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L19+96
	bl	printf
	mov	r3, #1
	b	.L3
.L18:
	ldr	r3, .L19+92
	ldr	r3, [r3]
	ldr	r2, .L19+88
	mov	r1, #0
	strb	r1, [r2, r3]
	ldr	r3, .L19+16
	ldr	r3, [r3]
	mov	r2, #19
	mov	r1, #1
	ldr	r0, .L19+88
	bl	fwrite
	ldr	r3, .L19+92
	mov	r2, #0
	str	r2, [r3]
	b	.L14
.L15:
	ldr	r3, .L19+16
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, #0
	bl	fputc
	ldr	r3, .L19+92
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L19+92
	str	r3, [r2]
.L14:
	ldr	r3, .L19+92
	ldr	r3, [r3]
	cmp	r3, #251
	ble	.L15
	ldr	r3, .L19+84
	mov	r2, #0
	str	r2, [r3]
	b	.L16
.L17:
	ldr	r3, .L19+84
	ldr	r3, [r3]
	and	r2, r3, #255
	ldr	r3, .L19+100
	strb	r2, [r3]
	ldr	r3, .L19+100
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r2, r3
	ldr	r3, .L19+16
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	fputc
.L16:
	ldr	r3, .L19+76
	ldr	r3, [r3]
	mov	r0, r3
	bl	fgetc
	mov	r3, r0
	ldr	r2, .L19+84
	str	r3, [r2]
	ldr	r3, .L19+84
	ldr	r3, [r3]
	cmn	r3, #1
	bne	.L17
	ldr	r3, .L19+76
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	ldr	r3, .L19+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fclose
	ldr	r3, [fp, #-12]
	add	r3, r3, #8
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L19+104
	bl	printf
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L20:
	.align	2
.L19:
	.word	valid_input
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	legal
	.word	.LC3
	.word	.LC4
	.word	stdin
	.word	yn_response
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.word	.LC12
	.word	.LC13
	.word	.LC14
	.word	illegal
	.word	.LC15
	.word	c
	.word	buffer
	.word	i
	.word	.LC16
	.word	byte
	.word	.LC17
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
