	.file	"extr_zero-to-n.c_thread_setup.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"pthread_setschedparam: %d"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"pthread_set_fixedpriority_self"
	.section	.rodata.str1.1
.LC2:
	.string	"invalid policy type %d"
	.text
	.p2align 4
	.type	thread_setup, @function
thread_setup:
.LFB0:
	.cfi_startproc
	endbr64
	push	r13
	.cfi_def_cfa_offset 16
	.cfi_offset 13, -16
	push	r12
	.cfi_def_cfa_offset 24
	.cfi_offset 12, -24
	push	rbp
	.cfi_def_cfa_offset 32
	.cfi_offset 6, -32
	mov	ebp, edi
	sub	rsp, 48
	.cfi_def_cfa_offset 80
	mov	edx, DWORD PTR g_policy[rip]
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR g_priority[rip]
	test	rax, rax
	je	.L2
	cmp	edx, 130
	mov	DWORD PTR 16[rsp], eax
	mov	r12d, DWORD PTR SCHED_RR[rip]
	cmovne	r12d, DWORD PTR SCHED_OTHER[rip]
	xor	eax, eax
	call	pthread_self@PLT
	lea	rdx, 16[rsp]
	mov	edi, eax
	mov	esi, r12d
	call	pthread_setschedparam@PLT
	test	eax, eax
	jne	.L26
	mov	edx, DWORD PTR g_policy[rip]
.L2:
	cmp	edx, 129
	je	.L5
	cmp	edx, 130
	je	.L6
	cmp	edx, 128
	je	.L7
	mov	edi, DWORD PTR EX_USAGE[rip]
	lea	rsi, .LC2[rip]
	call	errx@PLT
.L7:
	cmp	QWORD PTR g_do_affinity[rip], 0
	jne	.L27
.L9:
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L28
	add	rsp, 48
	.cfi_remember_state
	.cfi_def_cfa_offset 32
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 24
	pop	r12
	.cfi_def_cfa_offset 16
	pop	r13
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L27:
	.cfi_restore_state
	mov	edx, ebp
	mov	r13d, DWORD PTR THREAD_AFFINITY_POLICY_COUNT[rip]
	mov	r12d, DWORD PTR THREAD_AFFINITY_POLICY[rip]
	shr	edx, 31
	lea	eax, 0[rbp+rdx]
	and	eax, 1
	sub	eax, edx
	mov	DWORD PTR 12[rsp], eax
	xor	eax, eax
	call	mach_thread_self@PLT
	mov	esi, r12d
	lea	rdx, 12[rsp]
	mov	ecx, r13d
	mov	edi, eax
	call	thread_policy_set@PLT
	mov	edi, ebp
	mov	esi, eax
	call	mach_assert_zero_t@PLT
	jmp	.L9
	.p2align 4,,10
	.p2align 3
.L6:
	xor	eax, eax
	call	pthread_set_fixedpriority_self@PLT
	test	eax, eax
	je	.L7
	mov	edi, DWORD PTR EX_OSERR[rip]
	mov	esi, eax
	lea	rdx, .LC1[rip]
	xor	eax, eax
	call	errc@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L5:
	mov	edi, DWORD PTR CONSTRAINT_NANOS[rip]
	mov	DWORD PTR 16[rsp], 100000
	call	nanos_to_abs@PLT
	mov	edi, DWORD PTR COMPUTATION_NANOS[rip]
	mov	DWORD PTR 20[rsp], eax
	call	nanos_to_abs@PLT
	mov	r13d, DWORD PTR THREAD_TIME_CONSTRAINT_POLICY_COUNT[rip]
	mov	r12d, DWORD PTR THREAD_TIME_CONSTRAINT_POLICY[rip]
	mov	DWORD PTR 28[rsp], 0
	mov	DWORD PTR 24[rsp], eax
	xor	eax, eax
	call	mach_thread_self@PLT
	mov	esi, r12d
	lea	rdx, 16[rsp]
	mov	ecx, r13d
	mov	edi, eax
	call	thread_policy_set@PLT
	mov	edi, ebp
	mov	esi, eax
	call	mach_assert_zero_t@PLT
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L26:
	mov	edi, DWORD PTR EX_OSERR[rip]
	lea	rdx, .LC0[rip]
	mov	esi, eax
	mov	ecx, ebp
	xor	eax, eax
	call	errc@PLT
	mov	edx, DWORD PTR g_policy[rip]
	jmp	.L2
.L28:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	thread_setup, .-thread_setup
	.comm	g_priority,8,8
	.comm	g_policy,4,4
	.comm	g_do_affinity,8,8
	.comm	THREAD_TIME_CONSTRAINT_POLICY_COUNT,4,4
	.comm	THREAD_TIME_CONSTRAINT_POLICY,4,4
	.comm	THREAD_AFFINITY_POLICY_COUNT,4,4
	.comm	THREAD_AFFINITY_POLICY,4,4
	.comm	SCHED_RR,4,4
	.comm	SCHED_OTHER,4,4
	.comm	EX_USAGE,4,4
	.comm	EX_OSERR,4,4
	.comm	CONSTRAINT_NANOS,4,4
	.comm	COMPUTATION_NANOS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_zero-to-n.c_thread_setup.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"pthread_setschedparam: %d\000"
	.align	2
.LC1:
	.ascii	"pthread_set_fixedpriority_self\000"
	.align	2
.LC2:
	.ascii	"invalid policy type %d\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_setup, %function
thread_setup:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	ldr	r3, .L32
	ldr	r2, .L32+4
	ldr	r3, [r3]
	ldr	r5, .L32+8
	sub	sp, sp, #24
	cmp	r3, #0
	ldr	r2, [r2]
	str	r2, [sp, #20]
	mov	r2,#0
	mov	r4, r0
	ldr	r2, [r5]
	beq	.L2
	cmp	r2, #130
	ldreq	r2, .L32+12
	ldr	r1, .L32+16
	str	r3, [sp, #4]
	ldr	r6, [r1]
	ldreq	r6, [r2]
	bl	pthread_self
	mov	r1, r6
	add	r2, sp, #4
	bl	pthread_setschedparam
	subs	r1, r0, #0
	bne	.L29
	ldr	r2, [r5]
.L2:
	cmp	r2, #129
	beq	.L5
	cmp	r2, #130
	beq	.L6
	cmp	r2, #128
	beq	.L7
	ldr	r3, .L32+20
	ldr	r1, .L32+24
	ldr	r0, [r3]
	bl	errx
.L7:
	ldr	r3, .L32+28
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L30
.L9:
	ldr	r3, .L32+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L31
	mov	r0, #0
	add	sp, sp, #24
	@ sp needed
	pop	{r4, r5, r6, pc}
.L30:
	and	r3, r4, #1
	cmp	r4, #0
	rsblt	r3, r3, #0
	str	r3, [sp]
	bl	mach_thread_self
	ldr	r2, .L32+32
	ldr	r3, .L32+36
	ldr	r1, [r2]
	ldr	r3, [r3]
	mov	r2, sp
	bl	thread_policy_set
	mov	r1, r0
	mov	r0, r4
	bl	mach_assert_zero_t
	b	.L9
.L6:
	bl	pthread_set_fixedpriority_self
	subs	r1, r0, #0
	beq	.L7
	ldr	r3, .L32+40
	ldr	r2, .L32+44
	ldr	r0, [r3]
	bl	errc
	b	.L7
.L5:
	ldr	r2, .L32+48
	ldr	r3, .L32+52
	ldr	r0, [r2]
	str	r3, [sp, #4]
	bl	nanos_to_abs
	ldr	r3, .L32+56
	str	r0, [sp, #8]
	ldr	r0, [r3]
	bl	nanos_to_abs
	mov	r3, #0
	str	r0, [sp, #12]
	str	r3, [sp, #16]
	bl	mach_thread_self
	ldr	r2, .L32+60
	ldr	r3, .L32+64
	ldr	r1, [r2]
	ldr	r3, [r3]
	add	r2, sp, #4
	bl	thread_policy_set
	mov	r1, r0
	mov	r0, r4
	bl	mach_assert_zero_t
	b	.L7
.L29:
	ldr	r3, .L32+40
	ldr	r2, .L32+68
	ldr	r0, [r3]
	mov	r3, r4
	bl	errc
	ldr	r2, [r5]
	b	.L2
.L31:
	bl	__stack_chk_fail
.L33:
	.align	2
.L32:
	.word	g_priority
	.word	.LC3
	.word	g_policy
	.word	SCHED_RR
	.word	SCHED_OTHER
	.word	EX_USAGE
	.word	.LC2
	.word	g_do_affinity
	.word	THREAD_AFFINITY_POLICY
	.word	THREAD_AFFINITY_POLICY_COUNT
	.word	EX_OSERR
	.word	.LC1
	.word	CONSTRAINT_NANOS
	.word	100000
	.word	COMPUTATION_NANOS
	.word	THREAD_TIME_CONSTRAINT_POLICY
	.word	THREAD_TIME_CONSTRAINT_POLICY_COUNT
	.word	.LC0
	.size	thread_setup, .-thread_setup
	.comm	g_priority,4,4
	.comm	g_policy,4,4
	.comm	g_do_affinity,4,4
	.comm	THREAD_TIME_CONSTRAINT_POLICY_COUNT,4,4
	.comm	THREAD_TIME_CONSTRAINT_POLICY,4,4
	.comm	THREAD_AFFINITY_POLICY_COUNT,4,4
	.comm	THREAD_AFFINITY_POLICY,4,4
	.comm	SCHED_RR,4,4
	.comm	SCHED_OTHER,4,4
	.comm	EX_USAGE,4,4
	.comm	EX_OSERR,4,4
	.comm	CONSTRAINT_NANOS,4,4
	.comm	COMPUTATION_NANOS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
