	.file	"22376.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"Usage: %s numthreads\n"
	.align 8
.LC1:
	.string	"Failed to allocate memory for thread IDs"
	.align 8
.LC2:
	.string	"Failed to initialize semaphore"
.LC3:
	.string	"Failed to create thread:%s\n"
.LC4:
	.string	"Failed to join thread:%s\n"
	.text
	.globl	main
	.type	main, @function
main:
.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	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
	cmp	DWORD PTR -84[rbp], 2
	je	.L2
	mov	rax, QWORD PTR -96[rbp]
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L12
.L2:
	mov	rax, QWORD PTR -96[rbp]
	add	rax, 8
	mov	rax, QWORD PTR [rax]
	mov	rdi, rax
	call	atoi@PLT
	mov	DWORD PTR -64[rbp], eax
	mov	eax, DWORD PTR -64[rbp]
	cdqe
	mov	esi, 8
	mov	rdi, rax
	call	calloc@PLT
	mov	QWORD PTR -56[rbp], rax
	cmp	QWORD PTR -56[rbp], 0
	jne	.L4
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L12
.L4:
	lea	rax, -48[rbp]
	mov	edx, 1
	mov	esi, 0
	mov	rdi, rax
	call	sem_init@PLT
	cmp	eax, -1
	jne	.L5
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	eax, 1
	jmp	.L12
.L5:
	mov	DWORD PTR -68[rbp], 0
	jmp	.L6
.L8:
	mov	eax, DWORD PTR -68[rbp]
	cdqe
	lea	rdx, 0[0+rax*8]
	mov	rax, QWORD PTR -56[rbp]
	lea	rdi, [rdx+rax]
	lea	rax, -48[rbp]
	mov	rcx, rax
	mov	rax, QWORD PTR threadout@GOTPCREL[rip]
	mov	rdx, rax
	mov	esi, 0
	call	pthread_create@PLT
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], 0
	je	.L7
	mov	eax, DWORD PTR -60[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC3[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L12
.L7:
	add	DWORD PTR -68[rbp], 1
.L6:
	mov	eax, DWORD PTR -68[rbp]
	cmp	eax, DWORD PTR -64[rbp]
	jl	.L8
	mov	DWORD PTR -68[rbp], 0
	jmp	.L9
.L11:
	mov	eax, DWORD PTR -68[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
	mov	DWORD PTR -60[rbp], eax
	cmp	DWORD PTR -60[rbp], 0
	je	.L10
	mov	eax, DWORD PTR -60[rbp]
	mov	edi, eax
	call	strerror@PLT
	mov	rdx, rax
	mov	rax, QWORD PTR stderr[rip]
	lea	rsi, .LC4[rip]
	mov	rdi, rax
	mov	eax, 0
	call	fprintf@PLT
	mov	eax, 1
	jmp	.L12
.L10:
	add	DWORD PTR -68[rbp], 1
.L9:
	mov	eax, DWORD PTR -68[rbp]
	cmp	eax, DWORD PTR -64[rbp]
	jl	.L11
	mov	eax, 0
.L12:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.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	"22376.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"Usage: %s numthreads\012\000"
	.align	2
.LC1:
	.ascii	"Failed to allocate memory for thread IDs\000"
	.align	2
.LC2:
	.ascii	"Failed to initialize semaphore\000"
	.align	2
.LC3:
	.ascii	"Failed to create thread:%s\012\000"
	.align	2
.LC4:
	.ascii	"Failed to join thread:%s\012\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #52
	str	r0, [fp, #-56]
	str	r1, [fp, #-60]
	ldr	r3, .L14
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, [fp, #-56]
	cmp	r3, #2
	beq	.L2
	ldr	r3, .L14+4
	ldr	r0, [r3]
	ldr	r3, [fp, #-60]
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, .L14+8
	bl	fprintf
	mov	r3, #1
	b	.L12
.L2:
	ldr	r3, [fp, #-60]
	add	r3, r3, #4
	ldr	r3, [r3]
	mov	r0, r3
	bl	atoi
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	mov	r1, #4
	mov	r0, r3
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-40]
	cmp	r3, #0
	bne	.L4
	ldr	r0, .L14+12
	bl	perror
	mov	r3, #1
	b	.L12
.L4:
	sub	r3, fp, #32
	mov	r2, #1
	mov	r1, #0
	mov	r0, r3
	bl	sem_init
	mov	r3, r0
	cmn	r3, #1
	bne	.L5
	ldr	r0, .L14+16
	bl	perror
	mov	r3, #1
	b	.L12
.L5:
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L6
.L8:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r0, r2, r3
	sub	r3, fp, #32
	ldr	r2, .L14+20
	mov	r1, #0
	bl	pthread_create
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L7
	ldr	r3, .L14+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-36]
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L14+24
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L12
.L7:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L6:
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L8
	mov	r3, #0
	str	r3, [fp, #-48]
	b	.L9
.L11:
	ldr	r3, [fp, #-48]
	lsl	r3, r3, #2
	ldr	r2, [fp, #-40]
	add	r3, r2, r3
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	str	r0, [fp, #-36]
	ldr	r3, [fp, #-36]
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L14+4
	ldr	r4, [r3]
	ldr	r0, [fp, #-36]
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	ldr	r1, .L14+28
	mov	r0, r4
	bl	fprintf
	mov	r3, #1
	b	.L12
.L10:
	ldr	r3, [fp, #-48]
	add	r3, r3, #1
	str	r3, [fp, #-48]
.L9:
	ldr	r2, [fp, #-48]
	ldr	r3, [fp, #-44]
	cmp	r2, r3
	blt	.L11
	mov	r3, #0
.L12:
	ldr	r2, .L14
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L13
	bl	__stack_chk_fail
.L13:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L15:
	.align	2
.L14:
	.word	.LC5
	.word	stderr
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	threadout
	.word	.LC3
	.word	.LC4
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
