	.file	"705664.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
	.align 8
.LC0:
	.string	"posix_openpt(O_RDWR) failed\nerrno %d (%s)\n"
	.align 8
.LC1:
	.string	"grantpt(): expected: return = %d, errno = %d\n"
	.align 8
.LC2:
	.string	"           got: return = %d, errno = %d\n"
	.text
	.type	test_ebadf, @function
test_ebadf:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 24
	.cfi_offset 3, -24
	mov	edi, 2
	mov	eax, 0
	call	posix_openpt@PLT
	mov	DWORD PTR -28[rbp], eax
	cmp	DWORD PTR -28[rbp], -1
	jne	.L2
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	rdx, rbx
	mov	esi, eax
	lea	rdi, .LC0[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L3
.L2:
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	mov	eax, 0
	call	unlockpt@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -28[rbp]
	mov	edi, eax
	mov	eax, 0
	call	grantpt@PLT
	mov	DWORD PTR -24[rbp], eax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -20[rbp], eax
	cmp	DWORD PTR -24[rbp], -1
	jne	.L4
	cmp	DWORD PTR -20[rbp], 9
	je	.L5
.L4:
	mov	edx, 9
	mov	esi, -1
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR -20[rbp]
	mov	eax, DWORD PTR -24[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 1
	jmp	.L3
.L5:
	mov	eax, 0
.L3:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	test_ebadf, .-test_ebadf
	.section	.rodata
	.align 8
.LC3:
	.string	"open(\"%s\", O_RDWR) failed\nerrno %d (%s)\n"
	.text
	.type	test_einval, @function
test_einval:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 56
	.cfi_offset 3, -24
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	movabs	rax, 8103222994356612910
	movabs	rdx, 7809653445423869300
	mov	QWORD PTR -48[rbp], rax
	mov	QWORD PTR -40[rbp], rdx
	mov	BYTE PTR -32[rbp], 0
	lea	rax, -48[rbp]
	mov	edx, 384
	mov	esi, 66
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -56[rbp], eax
	cmp	DWORD PTR -56[rbp], -1
	jne	.L7
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	edi, eax
	call	strerror@PLT
	mov	rbx, rax
	call	__errno_location@PLT
	mov	edx, DWORD PTR [rax]
	lea	rax, -48[rbp]
	mov	rcx, rbx
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, 0
	jmp	.L12
.L7:
	lea	rax, -48[rbp]
	mov	rdi, rax
	call	unlink@PLT
	mov	eax, DWORD PTR -56[rbp]
	mov	edi, eax
	mov	eax, 0
	call	grantpt@PLT
	mov	DWORD PTR -60[rbp], eax
	call	__errno_location@PLT
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -60[rbp], -1
	jne	.L9
	cmp	DWORD PTR -52[rbp], 22
	je	.L10
.L9:
	mov	edx, 22
	mov	esi, -1
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edx, DWORD PTR -52[rbp]
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -60[rbp], 1
	jmp	.L11
.L10:
	mov	DWORD PTR -60[rbp], 0
.L11:
	mov	eax, DWORD PTR -56[rbp]
	mov	edi, eax
	call	close@PLT
	mov	eax, DWORD PTR -60[rbp]
.L12:
	mov	rcx, QWORD PTR -24[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L13
	call	__stack_chk_fail@PLT
.L13:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	test_einval, .-test_einval
	.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, 16
	mov	DWORD PTR -4[rbp], 0
	call	test_ebadf
	add	DWORD PTR -4[rbp], eax
	call	test_einval
	add	DWORD PTR -4[rbp], eax
	mov	eax, DWORD PTR -4[rbp]
	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	"705664.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"posix_openpt(O_RDWR) failed\012errno %d (%s)\012\000"
	.align	2
.LC1:
	.ascii	"grantpt(): expected: return = %d, errno = %d\012\000"
	.align	2
.LC2:
	.ascii	"           got: return = %d, errno = %d\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_ebadf, %function
test_ebadf:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #20
	mov	r0, #2
	bl	posix_openpt
	str	r0, [fp, #-24]
	ldr	r3, [fp, #-24]
	cmn	r3, #1
	bne	.L2
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	mov	r2, r3
	mov	r1, r4
	ldr	r0, .L6
	bl	printf
	mov	r3, #0
	b	.L3
.L2:
	ldr	r0, [fp, #-24]
	bl	unlockpt
	ldr	r0, [fp, #-24]
	bl	close
	ldr	r0, [fp, #-24]
	bl	grantpt
	str	r0, [fp, #-20]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	ldr	r3, [fp, #-20]
	cmn	r3, #1
	bne	.L4
	ldr	r3, [fp, #-16]
	cmp	r3, #9
	beq	.L5
.L4:
	mov	r2, #9
	mvn	r1, #0
	ldr	r0, .L6+4
	bl	printf
	ldr	r2, [fp, #-16]
	ldr	r1, [fp, #-20]
	ldr	r0, .L6+8
	bl	printf
	mov	r3, #1
	b	.L3
.L5:
	mov	r3, #0
.L3:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.size	test_ebadf, .-test_ebadf
	.section	.rodata
	.align	2
.LC4:
	.ascii	"open(\"%s\", O_RDWR) failed\012errno %d (%s)\012\000"
	.align	2
.LC3:
	.ascii	"./grantpt-einval\000"
	.align	2
.LC5:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_einval, %function
test_einval:
	@ args = 0, pretend = 0, frame = 40
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #44
	ldr	r3, .L16
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L16+4
	sub	ip, fp, #36
	mov	lr, r3
	ldmia	lr!, {r0, r1, r2, r3}
	stmia	ip!, {r0, r1, r2, r3}
	ldr	r3, [lr]
	strb	r3, [ip]
	sub	r3, fp, #36
	mov	r2, #384
	mov	r1, #66
	mov	r0, r3
	bl	open
	str	r0, [fp, #-44]
	ldr	r3, [fp, #-44]
	cmn	r3, #1
	bne	.L9
	bl	__errno_location
	mov	r3, r0
	ldr	r4, [r3]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	mov	r0, r3
	bl	strerror
	mov	r3, r0
	sub	r1, fp, #36
	mov	r2, r4
	ldr	r0, .L16+8
	bl	printf
	mov	r3, #0
	b	.L14
.L9:
	sub	r3, fp, #36
	mov	r0, r3
	bl	unlink
	ldr	r0, [fp, #-44]
	bl	grantpt
	str	r0, [fp, #-48]
	bl	__errno_location
	mov	r3, r0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	ldr	r3, [fp, #-48]
	cmn	r3, #1
	bne	.L11
	ldr	r3, [fp, #-40]
	cmp	r3, #22
	beq	.L12
.L11:
	mov	r2, #22
	mvn	r1, #0
	ldr	r0, .L16+12
	bl	printf
	ldr	r2, [fp, #-40]
	ldr	r1, [fp, #-48]
	ldr	r0, .L16+16
	bl	printf
	mov	r3, #1
	str	r3, [fp, #-48]
	b	.L13
.L12:
	mov	r3, #0
	str	r3, [fp, #-48]
.L13:
	ldr	r0, [fp, #-44]
	bl	close
	ldr	r3, [fp, #-48]
.L14:
	ldr	r2, .L16
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L15
	bl	__stack_chk_fail
.L15:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L17:
	.align	2
.L16:
	.word	.LC5
	.word	.LC3
	.word	.LC4
	.word	.LC1
	.word	.LC2
	.size	test_einval, .-test_einval
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	mov	r3, #0
	str	r3, [fp, #-8]
	bl	test_ebadf
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	bl	test_einval
	mov	r2, r0
	ldr	r3, [fp, #-8]
	add	r3, r3, r2
	str	r3, [fp, #-8]
	ldr	r3, [fp, #-8]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
