	.file	"512089.c"
	.intel_syntax noprefix
	.text
	.globl	g_num_inversion
	.bss
	.align 8
	.type	g_num_inversion, @object
	.size	g_num_inversion, 8
g_num_inversion:
	.zero	8
	.text
	.globl	merge_blocks
	.type	merge_blocks, @function
merge_blocks:
.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, 96
	mov	QWORD PTR -72[rbp], rdi
	mov	QWORD PTR -80[rbp], rsi
	mov	QWORD PTR -88[rbp], rdx
	mov	rax, QWORD PTR -88[rbp]
	sub	rax, QWORD PTR -80[rbp]
	add	rax, 1
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -24[rbp]
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -80[rbp]
	mov	QWORD PTR -48[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	sub	rax, QWORD PTR -80[rbp]
	mov	rdx, rax
	shr	rdx, 63
	add	rax, rdx
	sar	rax
	mov	rdx, rax
	mov	rax, QWORD PTR -80[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	add	rax, 1
	mov	QWORD PTR -40[rbp], rax
	mov	QWORD PTR -32[rbp], 0
	jmp	.L2
.L5:
	mov	rax, QWORD PTR -48[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rdx
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR -40[rbp]
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	add	rax, rcx
	mov	rax, QWORD PTR [rax]
	cmp	rdx, rax
	jg	.L3
	mov	rax, QWORD PTR -48[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -48[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR [rcx]
	mov	QWORD PTR [rdx], rax
	jmp	.L2
.L3:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR -48[rbp]
	lea	rdx, 1[rax]
	mov	rax, QWORD PTR g_num_inversion[rip]
	add	rax, rdx
	mov	QWORD PTR g_num_inversion[rip], rax
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -40[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR [rcx]
	mov	QWORD PTR [rdx], rax
.L2:
	mov	rax, QWORD PTR -48[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jg	.L6
	mov	rax, QWORD PTR -40[rbp]
	cmp	rax, QWORD PTR -88[rbp]
	jle	.L5
	jmp	.L6
.L7:
	mov	rax, QWORD PTR -48[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -48[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR [rcx]
	mov	QWORD PTR [rdx], rax
.L6:
	mov	rax, QWORD PTR -48[rbp]
	cmp	rax, QWORD PTR -8[rbp]
	jle	.L7
	jmp	.L8
.L9:
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -40[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -72[rbp]
	lea	rcx, [rdx+rax]
	mov	rax, QWORD PTR -32[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -32[rbp], rdx
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR [rcx]
	mov	QWORD PTR [rdx], rax
.L8:
	mov	rax, QWORD PTR -40[rbp]
	cmp	rax, QWORD PTR -88[rbp]
	jle	.L9
	mov	DWORD PTR -52[rbp], 0
	jmp	.L10
.L11:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -16[rbp]
	add	rax, rdx
	mov	edx, DWORD PTR -52[rbp]
	movsx	rcx, edx
	mov	rdx, QWORD PTR -80[rbp]
	add	rdx, rcx
	lea	rcx, 0[0+rdx*8]
	mov	rdx, QWORD PTR -72[rbp]
	add	rdx, rcx
	mov	rax, QWORD PTR [rax]
	mov	QWORD PTR [rdx], rax
	add	DWORD PTR -52[rbp], 1
.L10:
	mov	eax, DWORD PTR -52[rbp]
	cdqe
	cmp	QWORD PTR -24[rbp], rax
	jg	.L11
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	free@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	merge_blocks, .-merge_blocks
	.globl	merge_sort
	.type	merge_sort, @function
merge_sort:
.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, 48
	mov	QWORD PTR -24[rbp], rdi
	mov	QWORD PTR -32[rbp], rsi
	mov	QWORD PTR -40[rbp], rdx
	mov	rax, QWORD PTR -32[rbp]
	cmp	rax, QWORD PTR -40[rbp]
	jge	.L15
	mov	rax, QWORD PTR -40[rbp]
	sub	rax, QWORD PTR -32[rbp]
	mov	rdx, rax
	shr	rdx, 63
	add	rax, rdx
	sar	rax
	mov	rdx, rax
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	QWORD PTR -8[rbp], rax
	mov	rdx, QWORD PTR -8[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	merge_sort
	mov	rax, QWORD PTR -8[rbp]
	lea	rcx, 1[rax]
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	merge_sort
	mov	rdx, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR -32[rbp]
	mov	rax, QWORD PTR -24[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	merge_blocks
	jmp	.L12
.L15:
	nop
.L12:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	merge_sort, .-merge_sort
	.section	.rodata
.LC0:
	.string	"r"
.LC1:
	.string	"input.txt"
.LC2:
	.string	"%ld"
.LC3:
	.string	"%lld"
.LC4:
	.string	"w"
.LC5:
	.string	"output.txt"
	.text
	.globl	main
	.type	main, @function
main:
.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	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rsi, .LC0[rip]
	lea	rdi, .LC1[rip]
	call	fopen@PLT
	mov	QWORD PTR -32[rbp], rax
	lea	rdx, -56[rbp]
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	rax, QWORD PTR -56[rbp]
	sal	rax, 3
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR -24[rbp], rax
	mov	QWORD PTR -40[rbp], 0
	jmp	.L17
.L18:
	lea	rdx, -48[rbp]
	mov	rax, QWORD PTR -32[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	__isoc99_fscanf@PLT
	mov	rax, QWORD PTR -40[rbp]
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -24[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -48[rbp]
	mov	QWORD PTR [rdx], rax
	add	QWORD PTR -40[rbp], 1
.L17:
	mov	rax, QWORD PTR -56[rbp]
	cmp	QWORD PTR -40[rbp], rax
	jl	.L18
	mov	rax, QWORD PTR -32[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -56[rbp]
	lea	rdx, -1[rax]
	mov	rax, QWORD PTR -24[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	merge_sort
	lea	rsi, .LC4[rip]
	lea	rdi, .LC5[rip]
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rdx, QWORD PTR g_num_inversion[rip]
	mov	rax, QWORD PTR -16[rbp]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	rax, QWORD PTR -24[rbp]
	mov	rdi, rax
	call	free@PLT
	mov	eax, 0
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L20
	call	__stack_chk_fail@PLT
.L20:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.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	"512089.c"
	.text
	.global	g_num_inversion
	.bss
	.align	3
	.type	g_num_inversion, %object
	.size	g_num_inversion, 8
g_num_inversion:
	.space	8
	.text
	.align	2
	.global	merge_blocks
	.syntax unified
	.arm
	.fpu softvfp
	.type	merge_blocks, %function
merge_blocks:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #48
	str	r0, [fp, #-48]
	str	r1, [fp, #-52]
	str	r2, [fp, #-56]
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-52]
	sub	r3, r2, r3
	add	r3, r3, #1
	mov	r2, r3
	asr	r3, r2, #31
	str	r2, [fp, #-20]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #3
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-44]
	ldr	r2, [fp, #-56]
	ldr	r3, [fp, #-52]
	sub	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-52]
	add	r3, r3, r2
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-24]
	add	r3, r3, #1
	str	r3, [fp, #-40]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L2
.L5:
	ldr	r3, [fp, #-44]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-48]
	add	r3, r2, r3
	ldmia	r3, {r2-r3}
	ldr	r1, [fp, #-40]
	lsl	r1, r1, #3
	ldr	r0, [fp, #-48]
	add	r1, r0, r1
	ldmia	r1, {r0-r1}
	cmp	r0, r2
	sbcs	r3, r1, r3
	blt	.L3
	ldr	r3, [fp, #-44]
	add	r2, r3, #1
	str	r2, [fp, #-44]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-48]
	add	r2, r2, r3
	ldr	r3, [fp, #-36]
	add	r1, r3, #1
	str	r1, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r1, [fp, #-28]
	add	r1, r1, r3
	ldmia	r2, {r2-r3}
	stm	r1, {r2-r3}
	b	.L2
.L3:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-44]
	sub	r3, r2, r3
	add	r3, r3, #1
	mov	r0, r3
	asr	r1, r0, #31
	ldr	r3, .L12
	ldmia	r3, {r2-r3}
	adds	r4, r0, r2
	adc	r5, r1, r3
	ldr	r3, .L12
	stm	r3, {r4-r5}
	ldr	r3, [fp, #-40]
	add	r2, r3, #1
	str	r2, [fp, #-40]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-48]
	add	r2, r2, r3
	ldr	r3, [fp, #-36]
	add	r1, r3, #1
	str	r1, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r1, [fp, #-28]
	add	r1, r1, r3
	ldmia	r2, {r2-r3}
	stm	r1, {r2-r3}
.L2:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bgt	.L6
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-56]
	cmp	r2, r3
	ble	.L5
	b	.L6
.L7:
	ldr	r3, [fp, #-44]
	add	r2, r3, #1
	str	r2, [fp, #-44]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-48]
	add	r2, r2, r3
	ldr	r3, [fp, #-36]
	add	r1, r3, #1
	str	r1, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r1, [fp, #-28]
	add	r1, r1, r3
	ldmia	r2, {r2-r3}
	stm	r1, {r2-r3}
.L6:
	ldr	r2, [fp, #-44]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	ble	.L7
	b	.L8
.L9:
	ldr	r3, [fp, #-40]
	add	r2, r3, #1
	str	r2, [fp, #-40]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-48]
	add	r2, r2, r3
	ldr	r3, [fp, #-36]
	add	r1, r3, #1
	str	r1, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r1, [fp, #-28]
	add	r1, r1, r3
	ldmia	r2, {r2-r3}
	stm	r1, {r2-r3}
.L8:
	ldr	r2, [fp, #-40]
	ldr	r3, [fp, #-56]
	cmp	r2, r3
	ble	.L9
	mov	r3, #0
	str	r3, [fp, #-32]
	b	.L10
.L11:
	ldr	r3, [fp, #-32]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-28]
	add	r3, r2, r3
	ldr	r1, [fp, #-52]
	ldr	r2, [fp, #-32]
	add	r2, r1, r2
	lsl	r2, r2, #3
	ldr	r1, [fp, #-48]
	add	r1, r1, r2
	ldmia	r3, {r2-r3}
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-32]
	add	r3, r3, #1
	str	r3, [fp, #-32]
.L10:
	ldr	r3, [fp, #-32]
	mov	r0, r3
	asr	r1, r0, #31
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	cmp	r0, r2
	sbcs	r3, r1, r3
	blt	.L11
	ldr	r0, [fp, #-28]
	bl	free
	nop
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L13:
	.align	2
.L12:
	.word	g_num_inversion
	.size	merge_blocks, .-merge_blocks
	.align	2
	.global	merge_sort
	.syntax unified
	.arm
	.fpu softvfp
	.type	merge_sort, %function
merge_sort:
	@ 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, #-16]
	str	r1, [fp, #-20]
	str	r2, [fp, #-24]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-24]
	cmp	r2, r3
	bge	.L17
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	sub	r3, r2, r3
	lsr	r2, r3, #31
	add	r3, r2, r3
	asr	r3, r3, #1
	mov	r2, r3
	ldr	r3, [fp, #-20]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r2, [fp, #-8]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	merge_sort
	ldr	r3, [fp, #-8]
	add	r3, r3, #1
	ldr	r2, [fp, #-24]
	mov	r1, r3
	ldr	r0, [fp, #-16]
	bl	merge_sort
	ldr	r2, [fp, #-24]
	ldr	r1, [fp, #-20]
	ldr	r0, [fp, #-16]
	bl	merge_blocks
	b	.L14
.L17:
	nop
.L14:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	merge_sort, .-merge_sort
	.section	.rodata
	.align	2
.LC0:
	.ascii	"r\000"
	.align	2
.LC1:
	.ascii	"input.txt\000"
	.align	2
.LC2:
	.ascii	"%ld\000"
	.align	2
.LC3:
	.ascii	"%lld\000"
	.align	2
.LC4:
	.ascii	"w\000"
	.align	2
.LC5:
	.ascii	"output.txt\000"
	.align	2
.LC6:
	.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
	ldr	r3, .L23
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r1, .L23+4
	ldr	r0, .L23+8
	bl	fopen
	str	r0, [fp, #-32]
	sub	r3, fp, #40
	mov	r2, r3
	ldr	r1, .L23+12
	ldr	r0, [fp, #-32]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	mov	r0, r3
	bl	malloc
	mov	r3, r0
	str	r3, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L19
.L20:
	sub	r3, fp, #20
	mov	r2, r3
	ldr	r1, .L23+16
	ldr	r0, [fp, #-32]
	bl	__isoc99_fscanf
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	ldr	r2, [fp, #-28]
	add	r1, r2, r3
	sub	r3, fp, #20
	ldmia	r3, {r2-r3}
	stm	r1, {r2-r3}
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L19:
	ldr	r3, [fp, #-40]
	ldr	r2, [fp, #-36]
	cmp	r2, r3
	blt	.L20
	ldr	r0, [fp, #-32]
	bl	fclose
	ldr	r3, [fp, #-40]
	sub	r3, r3, #1
	mov	r2, r3
	mov	r1, #0
	ldr	r0, [fp, #-28]
	bl	merge_sort
	ldr	r1, .L23+20
	ldr	r0, .L23+24
	bl	fopen
	str	r0, [fp, #-24]
	ldr	r3, .L23+28
	ldmia	r3, {r2-r3}
	ldr	r1, .L23+16
	ldr	r0, [fp, #-24]
	bl	fprintf
	ldr	r0, [fp, #-24]
	bl	fclose
	ldr	r0, [fp, #-28]
	bl	free
	mov	r3, #0
	ldr	r2, .L23
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L22
	bl	__stack_chk_fail
.L22:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L24:
	.align	2
.L23:
	.word	.LC6
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	g_num_inversion
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
