	.file	"586449.c"
	.intel_syntax noprefix
	.text
	.globl	rnd
	.type	rnd, @function
rnd:
.LFB6:
	.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	DWORD PTR -8[rbp], esi
	call	random@PLT
	mov	edx, DWORD PTR -8[rbp]
	sub	edx, DWORD PTR -4[rbp]
	add	edx, 1
	movsx	rcx, edx
	cqo
	idiv	rcx
	mov	rax, rdx
	mov	edx, eax
	mov	eax, DWORD PTR -4[rbp]
	add	eax, edx
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	rnd, .-rnd
	.section	.rodata
	.align 8
.LC0:
	.string	"couldn't open '%s' in '%s' mode\n"
	.text
	.globl	tryfopen
	.type	tryfopen, @function
tryfopen:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 32
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	rdx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jne	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, QWORD PTR -32[rbp]
	mov	rdx, QWORD PTR -24[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	edi, 2
	call	exit@PLT
.L4:
	mov	rax, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	tryfopen, .-tryfopen
	.section	.rodata
.LC1:
	.string	"w"
.LC2:
	.string	"%d\n"
	.text
	.globl	write_rnd_numbers
	.type	write_rnd_numbers, @function
write_rnd_numbers:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 64
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	DWORD PTR -52[rbp], edx
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	tryfopen
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	tryfopen
	mov	QWORD PTR -8[rbp], rax
	mov	edi, 235808
	call	srandom@PLT
	mov	DWORD PTR -20[rbp], 0
	jmp	.L7
.L8:
	mov	esi, 1000000
	mov	edi, 0
	call	rnd
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	esi, 1000000
	mov	edi, 0
	call	rnd
	mov	edx, eax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	add	DWORD PTR -20[rbp], 1
.L7:
	mov	eax, DWORD PTR -20[rbp]
	cmp	eax, DWORD PTR -52[rbp]
	jl	.L8
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fflush@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	write_rnd_numbers, .-write_rnd_numbers
	.section	.rodata
.LC3:
	.string	"r"
.LC4:
	.string	"wb"
.LC5:
	.string	"%d"
	.text
	.globl	int_txt2bin
	.type	int_txt2bin, @function
int_txt2bin:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 48
	mov	QWORD PTR -40[rbp], rdi
	mov	QWORD PTR -48[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -40[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	call	tryfopen
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -48[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	tryfopen
	mov	QWORD PTR -16[rbp], rax
	jmp	.L10
.L11:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -28[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
.L10:
	lea	rdx, -28[rbp]
	mov	rax, QWORD PTR -24[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	cmp	eax, -1
	jne	.L11
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L12
	call	__stack_chk_fail@PLT
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	int_txt2bin, .-int_txt2bin
	.section	.rodata
.LC6:
	.string	"rb"
	.text
	.globl	merge_and_sort
	.type	merge_and_sort, @function
merge_and_sort:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 80
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	QWORD PTR -72[rbp], rdx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -56[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	tryfopen
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -64[rbp]
	lea	rsi, .LC6[rip]
	mov	rdi, rax
	call	tryfopen
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -72[rbp]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	call	tryfopen
	mov	QWORD PTR -16[rbp], rax
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -40[rbp], eax
	mov	rdx, QWORD PTR -24[rbp]
	lea	rax, -44[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -36[rbp], eax
	jmp	.L14
.L17:
	mov	edx, DWORD PTR -48[rbp]
	mov	eax, DWORD PTR -44[rbp]
	cmp	edx, eax
	jge	.L15
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -40[rbp], eax
	jmp	.L14
.L15:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -44[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
	mov	rdx, QWORD PTR -24[rbp]
	lea	rax, -44[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	mov	DWORD PTR -36[rbp], eax
.L14:
	cmp	DWORD PTR -40[rbp], 1
	jne	.L16
	cmp	DWORD PTR -36[rbp], 1
	je	.L17
.L16:
	cmp	DWORD PTR -40[rbp], 0
	jle	.L18
.L19:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
	mov	rdx, QWORD PTR -32[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	cmp	rax, 1
	je	.L19
.L18:
	cmp	DWORD PTR -36[rbp], 0
	jle	.L20
.L21:
	mov	rdx, QWORD PTR -16[rbp]
	lea	rax, -44[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fwrite@PLT
	mov	rdx, QWORD PTR -24[rbp]
	lea	rax, -44[rbp]
	mov	rcx, rdx
	mov	edx, 1
	mov	esi, 4
	mov	rdi, rax
	call	fread@PLT
	cmp	rax, 1
	je	.L21
.L20:
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L22
	call	__stack_chk_fail@PLT
.L22:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	merge_and_sort, .-merge_and_sort
	.section	.rodata
.LC7:
	.string	"sort"
.LC8:
	.string	"-o"
.LC9:
	.string	"F1.txt"
.LC10:
	.string	"-n"
.LC11:
	.string	"USAGE: %s [k]\n"
	.align 8
.LC12:
	.string	"ERROR: k must be a positive integer number\n"
.LC13:
	.string	"F2.txt"
.LC14:
	.string	"/bin/sort"
.LC15:
	.string	"F1.bin"
.LC16:
	.string	"F2.bin"
.LC17:
	.string	"F12.sorted"
	.text
	.globl	main
	.type	main, @function
main:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	DWORD PTR -84[rbp], edi
	mov	QWORD PTR -96[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, .LC7[rip]
	mov	QWORD PTR -64[rbp], rax
	lea	rax, .LC8[rip]
	mov	QWORD PTR -56[rbp], rax
	lea	rax, .LC9[rip]
	mov	QWORD PTR -48[rbp], rax
	lea	rax, .LC10[rip]
	mov	QWORD PTR -40[rbp], rax
	lea	rax, .LC9[rip]
	mov	QWORD PTR -32[rbp], rax
	mov	QWORD PTR -24[rbp], 0
	cmp	DWORD PTR -84[rbp], 2
	je	.L24
	mov	rax, QWORD PTR -96[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC11[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L31
.L24:
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	lea	rdx, -68[rbp]
	lea	rsi, .LC5[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_sscanf@PLT
	cmp	eax, 1
	jne	.L26
	mov	eax, DWORD PTR -68[rbp]
	test	eax, eax
	jg	.L27
.L26:
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 43
	mov	esi, 1
	lea	rdi, .LC12[rip]
	call	fwrite@PLT
	mov	eax, 2
	jmp	.L31
.L27:
	mov	eax, DWORD PTR -68[rbp]
	mov	edx, eax
	lea	rsi, .LC13[rip]
	lea	rdi, .LC9[rip]
	call	write_rnd_numbers
	call	fork@PLT
	test	eax, eax
	je	.L28
	call	fork@PLT
	test	eax, eax
	jne	.L29
	lea	rax, -64[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	call	execv@PLT
	mov	edi, 16
	call	exit@PLT
.L29:
	mov	edi, 0
	call	wait@PLT
	mov	edi, 0
	call	wait@PLT
	lea	rsi, .LC15[rip]
	lea	rdi, .LC9[rip]
	call	int_txt2bin
	lea	rsi, .LC16[rip]
	lea	rdi, .LC13[rip]
	call	int_txt2bin
	lea	rdx, .LC17[rip]
	lea	rsi, .LC16[rip]
	lea	rdi, .LC15[rip]
	call	merge_and_sort
	lea	rdi, .LC15[rip]
	call	unlink@PLT
	lea	rdi, .LC16[rip]
	call	unlink@PLT
	mov	eax, 0
	jmp	.L31
.L28:
	lea	rax, .LC13[rip]
	mov	QWORD PTR -32[rbp], rax
	mov	rax, QWORD PTR -32[rbp]
	mov	QWORD PTR -48[rbp], rax
	lea	rax, -64[rbp]
	mov	rsi, rax
	lea	rdi, .LC14[rip]
	call	execv@PLT
	mov	edi, 16
	call	exit@PLT
.L31:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L32
	call	__stack_chk_fail@PLT
.L32:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.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	"586449.c"
	.section	.rodata
	.align	2
.LC0:
	.ascii	"sort\000"
	.align	2
.LC1:
	.ascii	"-o\000"
	.align	2
.LC2:
	.ascii	"F1.txt\000"
	.align	2
.LC3:
	.ascii	"-n\000"
	.text
	.global	__aeabi_idivmod
	.align	2
	.global	rnd
	.syntax unified
	.arm
	.fpu softvfp
	.type	rnd, %function
rnd:
	@ 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]
	bl	random
	ldr	r2, [fp, #-12]
	ldr	r3, [fp, #-8]
	sub	r3, r2, r3
	add	r3, r3, #1
	mov	r1, r3
	bl	__aeabi_idivmod
	mov	r3, r1
	mov	r2, r3
	ldr	r3, [fp, #-8]
	add	r3, r2, r3
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	rnd, .-rnd
	.section	.rodata
	.align	2
.LC5:
	.ascii	"couldn't open '%s' in '%s' mode\012\000"
	.text
	.align	2
	.global	tryfopen
	.syntax unified
	.arm
	.fpu softvfp
	.type	tryfopen, %function
tryfopen:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	str	r1, [fp, #-20]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	fopen
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L6
	ldr	r0, [r3]
	ldr	r3, [fp, #-20]
	ldr	r2, [fp, #-16]
	ldr	r1, .L6+4
	bl	fprintf
	mov	r0, #2
	bl	exit
.L4:
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L7:
	.align	2
.L6:
	.word	stderr
	.word	.LC5
	.size	tryfopen, .-tryfopen
	.section	.rodata
	.align	2
.LC6:
	.ascii	"w\000"
	.align	2
.LC7:
	.ascii	"%d\012\000"
	.text
	.align	2
	.global	write_rnd_numbers
	.syntax unified
	.arm
	.fpu softvfp
	.type	write_rnd_numbers, %function
write_rnd_numbers:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	str	r2, [fp, #-32]
	ldr	r1, .L11
	ldr	r0, [fp, #-24]
	bl	tryfopen
	str	r0, [fp, #-12]
	ldr	r1, .L11
	ldr	r0, [fp, #-28]
	bl	tryfopen
	str	r0, [fp, #-8]
	ldr	r0, .L11+4
	bl	srandom
	mov	r3, #0
	str	r3, [fp, #-16]
	b	.L9
.L10:
	ldr	r1, .L11+8
	mov	r0, #0
	bl	rnd
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L11+12
	ldr	r0, [fp, #-12]
	bl	fprintf
	ldr	r1, .L11+8
	mov	r0, #0
	bl	rnd
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L11+12
	ldr	r0, [fp, #-8]
	bl	fprintf
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L9:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	blt	.L10
	ldr	r0, [fp, #-12]
	bl	fflush
	ldr	r0, [fp, #-8]
	bl	fflush
	ldr	r0, [fp, #-12]
	bl	fclose
	ldr	r0, [fp, #-8]
	bl	fclose
	nop
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L12:
	.align	2
.L11:
	.word	.LC6
	.word	235808
	.word	1000000
	.word	.LC7
	.size	write_rnd_numbers, .-write_rnd_numbers
	.section	.rodata
	.align	2
.LC8:
	.ascii	"r\000"
	.align	2
.LC9:
	.ascii	"wb\000"
	.align	2
.LC10:
	.ascii	"%d\000"
	.align	2
.LC11:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	int_txt2bin
	.syntax unified
	.arm
	.fpu softvfp
	.type	int_txt2bin, %function
int_txt2bin:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #24
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r3, .L17
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L17+4
	ldr	r0, [fp, #-24]
	bl	tryfopen
	str	r0, [fp, #-16]
	ldr	r1, .L17+8
	ldr	r0, [fp, #-28]
	bl	tryfopen
	str	r0, [fp, #-12]
	b	.L14
.L15:
	sub	r0, fp, #20
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
.L14:
	sub	r3, fp, #20
	mov	r2, r3
	ldr	r1, .L17+12
	ldr	r0, [fp, #-16]
	bl	__isoc99_fscanf
	mov	r3, r0
	cmn	r3, #1
	bne	.L15
	ldr	r0, [fp, #-16]
	bl	fclose
	ldr	r0, [fp, #-12]
	bl	fclose
	nop
	ldr	r3, .L17
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L16
	bl	__stack_chk_fail
.L16:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	.LC11
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.size	int_txt2bin, .-int_txt2bin
	.section	.rodata
	.align	2
.LC12:
	.ascii	"rb\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	merge_and_sort
	.syntax unified
	.arm
	.fpu softvfp
	.type	merge_and_sort, %function
merge_and_sort:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	str	r2, [fp, #-48]
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L29+4
	ldr	r0, [fp, #-40]
	bl	tryfopen
	str	r0, [fp, #-20]
	ldr	r1, .L29+4
	ldr	r0, [fp, #-44]
	bl	tryfopen
	str	r0, [fp, #-16]
	ldr	r1, .L29+8
	ldr	r0, [fp, #-48]
	bl	tryfopen
	str	r0, [fp, #-12]
	sub	r0, fp, #36
	ldr	r3, [fp, #-20]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-28]
	sub	r0, fp, #32
	ldr	r3, [fp, #-16]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-24]
	b	.L20
.L23:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-32]
	cmp	r2, r3
	bge	.L21
	sub	r0, fp, #36
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
	sub	r0, fp, #36
	ldr	r3, [fp, #-20]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-28]
	b	.L20
.L21:
	sub	r0, fp, #32
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
	sub	r0, fp, #32
	ldr	r3, [fp, #-16]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	mov	r3, r0
	str	r3, [fp, #-24]
.L20:
	ldr	r3, [fp, #-28]
	cmp	r3, #1
	bne	.L22
	ldr	r3, [fp, #-24]
	cmp	r3, #1
	beq	.L23
.L22:
	ldr	r3, [fp, #-28]
	cmp	r3, #0
	ble	.L24
.L25:
	sub	r0, fp, #36
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
	sub	r0, fp, #36
	ldr	r3, [fp, #-20]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	mov	r3, r0
	cmp	r3, #1
	beq	.L25
.L24:
	ldr	r3, [fp, #-24]
	cmp	r3, #0
	ble	.L26
.L27:
	sub	r0, fp, #32
	ldr	r3, [fp, #-12]
	mov	r2, #1
	mov	r1, #4
	bl	fwrite
	sub	r0, fp, #32
	ldr	r3, [fp, #-16]
	mov	r2, #1
	mov	r1, #4
	bl	fread
	mov	r3, r0
	cmp	r3, #1
	beq	.L27
.L26:
	ldr	r0, [fp, #-20]
	bl	fclose
	ldr	r0, [fp, #-16]
	bl	fclose
	ldr	r0, [fp, #-12]
	bl	fclose
	nop
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L28
	bl	__stack_chk_fail
.L28:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC13
	.word	.LC12
	.word	.LC9
	.size	merge_and_sort, .-merge_and_sort
	.section	.rodata
	.align	2
.LC15:
	.ascii	"USAGE: %s [k]\012\000"
	.align	2
.LC16:
	.ascii	"ERROR: k must be a positive integer number\012\000"
	.align	2
.LC17:
	.ascii	"F2.txt\000"
	.align	2
.LC18:
	.ascii	"/bin/sort\000"
	.align	2
.LC19:
	.ascii	"F1.bin\000"
	.align	2
.LC20:
	.ascii	"F2.bin\000"
	.align	2
.LC21:
	.ascii	"F12.sorted\000"
	.align	2
.LC14:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC2
	.word	0
	.align	2
.LC22:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #40
	str	r0, [fp, #-40]
	str	r1, [fp, #-44]
	ldr	r3, .L41
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L41+4
	sub	ip, fp, #32
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldm	lr, {r0, r1}
	stm	ip, {r0, r1}
	ldr	r3, [fp, #-40]
	cmp	r3, #2
	beq	.L32
	ldr	r3, .L41+8
	ldr	r0, [r3]
	ldr	r3, [fp, #-44]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L41+12
	bl	fprintf
	mov	r3, #1
	b	.L39
.L32:
	ldr	r3, [fp, #-44]
	add	r3, r3, #4
	ldr	r3, [r3]
	sub	r2, fp, #36
	ldr	r1, .L41+16
	mov	r0, r3
	bl	__isoc99_sscanf
	mov	r3, r0
	cmp	r3, #1
	bne	.L34
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	bgt	.L35
.L34:
	ldr	r3, .L41+8
	ldr	r3, [r3]
	mov	r2, #43
	mov	r1, #1
	ldr	r0, .L41+20
	bl	fwrite
	mov	r3, #2
	b	.L39
.L35:
	ldr	r3, [fp, #-36]
	mov	r2, r3
	ldr	r1, .L41+24
	ldr	r0, .L41+28
	bl	write_rnd_numbers
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	beq	.L36
	bl	fork
	mov	r3, r0
	cmp	r3, #0
	bne	.L37
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, .L41+32
	bl	execv
	mov	r0, #16
	bl	exit
.L37:
	mov	r0, #0
	bl	wait
	mov	r0, #0
	bl	wait
	ldr	r1, .L41+36
	ldr	r0, .L41+28
	bl	int_txt2bin
	ldr	r1, .L41+40
	ldr	r0, .L41+24
	bl	int_txt2bin
	ldr	r2, .L41+44
	ldr	r1, .L41+40
	ldr	r0, .L41+36
	bl	merge_and_sort
	ldr	r0, .L41+36
	bl	unlink
	ldr	r0, .L41+40
	bl	unlink
	mov	r3, #0
	b	.L39
.L36:
	ldr	r3, .L41+24
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-24]
	sub	r3, fp, #32
	mov	r1, r3
	ldr	r0, .L41+32
	bl	execv
	mov	r0, #16
	bl	exit
.L39:
	ldr	r2, .L41
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L40
	bl	__stack_chk_fail
.L40:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L42:
	.align	2
.L41:
	.word	.LC22
	.word	.LC14
	.word	stderr
	.word	.LC15
	.word	.LC10
	.word	.LC16
	.word	.LC17
	.word	.LC2
	.word	.LC18
	.word	.LC19
	.word	.LC20
	.word	.LC21
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
