	.file	"542853.c"
	.intel_syntax noprefix
	.text
	.type	steal_work, @function
steal_work:
.LFB6:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -40[rbp], rdi
	mov	DWORD PTR -20[rbp], -1
	movabs	rax, 9223372036854775807
	mov	QWORD PTR -16[rbp], rax
	mov	DWORD PTR -24[rbp], 0
	jmp	.L2
.L4:
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR 16[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	sal	rax, 4
	add	rax, rdx
	mov	rax, QWORD PTR 8[rax]
	cmp	QWORD PTR -16[rbp], rax
	jle	.L3
	mov	rax, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR 16[rax]
	mov	eax, DWORD PTR -24[rbp]
	cdqe
	sal	rax, 4
	add	rax, rdx
	mov	rax, QWORD PTR 8[rax]
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR -24[rbp]
	mov	DWORD PTR -20[rbp], eax
.L3:
	add	DWORD PTR -24[rbp], 1
.L2:
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	cmp	DWORD PTR -24[rbp], eax
	jl	.L4
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	rcx, QWORD PTR 16[rax]
	mov	eax, DWORD PTR -20[rbp]
	cdqe
	sal	rax, 4
	add	rax, rcx
	add	rax, 8
	lock xadd	QWORD PTR [rax], rdx
	mov	QWORD PTR -8[rbp], rdx
	mov	rax, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR 8[rax]
	cmp	QWORD PTR -8[rbp], rax
	jge	.L5
	mov	rax, QWORD PTR -8[rbp]
	jmp	.L7
.L5:
	mov	rax, -1
.L7:
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	steal_work, .-steal_work
	.type	ktf_worker, @function
ktf_worker:
.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	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -16[rbp], rax
.L11:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	eax, DWORD PTR [rax]
	movsx	rdx, eax
	mov	rax, QWORD PTR -16[rbp]
	add	rax, 8
	lock xadd	QWORD PTR [rax], rdx
	mov	QWORD PTR -8[rbp], rdx
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR 8[rax]
	cmp	QWORD PTR -8[rbp], rax
	jge	.L15
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	r8, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, rdx
	sar	rax, 4
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR 32[rax]
	mov	rcx, QWORD PTR -8[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	r8
	jmp	.L11
.L15:
	nop
	jmp	.L12
.L13:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	r8, QWORD PTR 24[rax]
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, rdx
	sar	rax, 4
	mov	edx, eax
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rax, QWORD PTR 32[rax]
	mov	rcx, QWORD PTR -8[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	r8
.L12:
	mov	rax, QWORD PTR -16[rbp]
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	steal_work
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	jns	.L13
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.size	ktf_worker, .-ktf_worker
	.globl	kt_for
	.type	kt_for, @function
kt_for:
.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, 96
	mov	DWORD PTR -68[rbp], edi
	mov	QWORD PTR -80[rbp], rsi
	mov	QWORD PTR -88[rbp], rdx
	mov	QWORD PTR -96[rbp], rcx
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -80[rbp]
	mov	QWORD PTR -24[rbp], rax
	mov	rax, QWORD PTR -88[rbp]
	mov	QWORD PTR -16[rbp], rax
	mov	eax, DWORD PTR -68[rbp]
	mov	DWORD PTR -48[rbp], eax
	mov	rax, QWORD PTR -96[rbp]
	mov	QWORD PTR -40[rbp], rax
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	sal	rax, 4
	lea	rdx, 8[rax]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	esi, 16
	mov	edx, 0
	div	rsi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L17:
	cmp	rsp, rdx
	je	.L18
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L17
.L18:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L19
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L19:
	mov	rax, rsp
	add	rax, 15
	shr	rax, 4
	sal	rax, 4
	mov	QWORD PTR -32[rbp], rax
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	sal	rax, 3
	lea	rdx, 8[rax]
	mov	eax, 16
	sub	rax, 1
	add	rax, rdx
	mov	edi, 16
	mov	edx, 0
	div	rdi
	imul	rax, rax, 16
	mov	rcx, rax
	and	rcx, -4096
	mov	rdx, rsp
	sub	rdx, rcx
.L20:
	cmp	rsp, rdx
	je	.L21
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	jmp	.L20
.L21:
	mov	rdx, rax
	and	edx, 4095
	sub	rsp, rdx
	mov	rdx, rax
	and	edx, 4095
	test	rdx, rdx
	je	.L22
	and	eax, 4095
	sub	rax, 8
	add	rax, rsp
	or	QWORD PTR [rax], 0
.L22:
	mov	rax, rsp
	add	rax, 15
	shr	rax, 4
	sal	rax, 4
	mov	QWORD PTR -56[rbp], rax
	mov	DWORD PTR -60[rbp], 0
	jmp	.L23
.L24:
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	sal	rax, 4
	add	rdx, rax
	lea	rax, -48[rbp]
	mov	QWORD PTR [rdx], rax
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	sal	rax, 4
	add	rdx, rax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	mov	QWORD PTR 8[rdx], rax
	add	DWORD PTR -60[rbp], 1
.L23:
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, DWORD PTR -68[rbp]
	jl	.L24
	mov	DWORD PTR -60[rbp], 0
	jmp	.L25
.L26:
	mov	rdx, QWORD PTR -32[rbp]
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	sal	rax, 4
	add	rdx, rax
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rcx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rcx
	mov	rcx, rdx
	lea	rdx, ktf_worker[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	add	DWORD PTR -60[rbp], 1
.L25:
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, DWORD PTR -68[rbp]
	jl	.L26
	mov	DWORD PTR -60[rbp], 0
	jmp	.L27
.L28:
	mov	eax, DWORD PTR -60[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	add	rax, rdx
	mov	rax, QWORD PTR [rax]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	add	DWORD PTR -60[rbp], 1
.L27:
	mov	eax, DWORD PTR -60[rbp]
	cmp	eax, DWORD PTR -68[rbp]
	jl	.L28
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L29
	call	__stack_chk_fail@PLT
.L29:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	kt_for, .-kt_for
	.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	"542853.c"
	.text
	.global	__sync_fetch_and_add_4
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	steal_work, %function
steal_work:
	@ 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]
	mvn	r3, #0
	str	r3, [fp, #-16]
	mvn	r3, #-2147483648
	str	r3, [fp, #-12]
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L2
.L4:
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-12]
	cmp	r2, r3
	ble	.L3
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-20]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r3, [r3, #4]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-20]
	str	r3, [fp, #-16]
.L3:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L2:
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	blt	.L4
	ldr	r3, [fp, #-24]
	ldr	r2, [r3, #8]
	ldr	r3, [fp, #-16]
	lsl	r3, r3, #3
	add	r3, r2, r3
	add	r2, r3, #4
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	__sync_fetch_and_add_4
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-24]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bge	.L5
	ldr	r3, [fp, #-8]
	b	.L7
.L5:
	mvn	r3, #0
.L7:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	steal_work, .-steal_work
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ktf_worker, %function
ktf_worker:
	@ 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]
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-12]
.L11:
	ldr	r3, [fp, #-12]
	add	r2, r3, #4
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	__sync_fetch_and_add_4
	mov	r3, r0
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	ldr	r3, [r3, #4]
	ldr	r2, [fp, #-8]
	cmp	r2, r3
	bge	.L15
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	ldr	r3, [r3, #12]
	ldr	r2, [fp, #-12]
	ldr	r2, [r2]
	ldr	r0, [r2, #16]
	ldr	r2, [fp, #-12]
	ldr	r2, [r2]
	ldr	r2, [r2, #8]
	ldr	r1, [fp, #-12]
	sub	r2, r1, r2
	asr	r2, r2, #3
	ldr	r1, [fp, #-8]
	blx	r3
	b	.L11
.L15:
	nop
	b	.L12
.L13:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	ldr	r3, [r3, #12]
	ldr	r2, [fp, #-12]
	ldr	r2, [r2]
	ldr	r0, [r2, #16]
	ldr	r2, [fp, #-12]
	ldr	r2, [r2]
	ldr	r2, [r2, #8]
	ldr	r1, [fp, #-12]
	sub	r2, r1, r2
	asr	r2, r2, #3
	ldr	r1, [fp, #-8]
	blx	r3
.L12:
	ldr	r3, [fp, #-12]
	ldr	r3, [r3]
	mov	r0, r3
	bl	steal_work
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	bge	.L13
	mov	r0, #0
	bl	pthread_exit
	.size	ktf_worker, .-ktf_worker
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	kt_for
	.syntax unified
	.arm
	.fpu softvfp
	.type	kt_for, %function
kt_for:
	@ 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]
	str	r3, [fp, #-52]
	ldr	r3, .L24
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-44]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-48]
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-40]
	str	r3, [fp, #-28]
	ldr	r3, [fp, #-52]
	str	r3, [fp, #-24]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #3
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-40]
	lsl	r3, r3, #2
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	sub	sp, sp, r3
	mov	r3, sp
	add	r3, r3, #7
	lsr	r3, r3, #3
	lsl	r3, r3, #3
	str	r3, [fp, #-32]
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L17
.L18:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	add	r3, r2, r3
	sub	r2, fp, #28
	str	r2, [r3]
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, [fp, #-36]
	str	r2, [r3, #4]
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L17:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L18
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L19
.L20:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r0, r2, r3
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #3
	add	r3, r2, r3
	ldr	r2, .L24+4
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L19:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L20
	mov	r3, #0
	str	r3, [fp, #-36]
	b	.L21
.L22:
	ldr	r3, [fp, #-36]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-32]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-36]
	add	r3, r3, #1
	str	r3, [fp, #-36]
.L21:
	ldr	r2, [fp, #-36]
	ldr	r3, [fp, #-40]
	cmp	r2, r3
	blt	.L22
	nop
	ldr	r3, .L24
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L23
	bl	__stack_chk_fail
.L23:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	.LC0
	.word	ktf_worker
	.size	kt_for, .-kt_for
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
