	.file	"79119.c"
	.intel_syntax noprefix
	.text
	.globl	buffer
	.bss
	.align 32
	.type	buffer, @object
	.size	buffer, 256
buffer:
	.zero	256
	.section	.rodata
.LC0:
	.string	"w"
.LC1:
	.string	"fopen fd: %d\n"
.LC2:
	.string	"test failed: fp != NULL\n"
.LC3:
	.string	"test failed: fileno(fp) == 3\n"
.LC4:
	.string	"foobar and baz"
.LC5:
	.string	"open fd: %d\n"
.LC6:
	.string	"test failed: fd == 3\n"
	.align 8
.LC7:
	.string	"test failed: lseek (fd, 5, SEEK_SET) == 5\n"
.LC8:
	.string	"r"
.LC9:
	.string	"fdopen fd: %d\n"
	.align 8
.LC10:
	.string	"test failed: getc (fp) == 'r'\n"
	.align 8
.LC11:
	.string	"test failed: getc (fp) == ' '\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB0:
	.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	DWORD PTR -36[rbp], edi
	mov	QWORD PTR -48[rbp], rsi
	mov	QWORD PTR -16[rbp], 0
	mov	DWORD PTR -24[rbp], 0
	mov	edi, 0
	call	tmpnam@PLT
	mov	QWORD PTR -8[rbp], rax
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC0[rip]
	mov	rdi, rax
	call	fopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fileno@PLT
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	QWORD PTR -16[rbp], 0
	jne	.L2
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L2:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fileno@PLT
	cmp	eax, 3
	je	.L4
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 29
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L4:
	mov	rax, QWORD PTR -16[rbp]
	mov	rcx, rax
	mov	edx, 14
	mov	esi, 1
	lea	rdi, .LC4[rip]
	call	fwrite@PLT
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
	mov	QWORD PTR -16[rbp], 0
	mov	rax, QWORD PTR -8[rbp]
	mov	esi, 0
	mov	rdi, rax
	mov	eax, 0
	call	open@PLT
	mov	DWORD PTR -20[rbp], eax
	mov	eax, DWORD PTR -20[rbp]
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	DWORD PTR -20[rbp], 3
	je	.L5
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 21
	mov	esi, 1
	lea	rdi, .LC6[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L5:
	mov	eax, DWORD PTR -20[rbp]
	mov	edx, 0
	mov	esi, 5
	mov	edi, eax
	call	lseek@PLT
	cmp	rax, 5
	je	.L6
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 42
	mov	esi, 1
	lea	rdi, .LC7[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L6:
	mov	eax, DWORD PTR -20[rbp]
	lea	rsi, .LC8[rip]
	mov	edi, eax
	call	fdopen@PLT
	mov	QWORD PTR -16[rbp], rax
	mov	rax, QWORD PTR -16[rbp]
	mov	eax, DWORD PTR 112[rax]
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	cmp	QWORD PTR -16[rbp], 0
	jne	.L7
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 24
	mov	esi, 1
	lea	rdi, .LC2[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L7:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fileno@PLT
	cmp	eax, 3
	je	.L8
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 29
	mov	esi, 1
	lea	rdi, .LC3[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L8:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	getc@PLT
	cmp	eax, 114
	je	.L9
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC10[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L9:
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	getc@PLT
	cmp	eax, 32
	je	.L12
	mov	rax, QWORD PTR stderr[rip]
	mov	rcx, rax
	mov	edx, 30
	mov	esi, 1
	lea	rdi, .LC11[rip]
	call	fwrite@PLT
	mov	DWORD PTR -24[rbp], 1
	jmp	.L3
.L12:
	nop
.L3:
	cmp	QWORD PTR -16[rbp], 0
	je	.L10
	mov	rax, QWORD PTR -16[rbp]
	mov	rdi, rax
	call	fclose@PLT
.L10:
	mov	rax, QWORD PTR -8[rbp]
	mov	rdi, rax
	call	unlink@PLT
	mov	eax, DWORD PTR -24[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE0:
	.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	"79119.c"
	.text
	.comm	buffer,256,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"w\000"
	.align	2
.LC1:
	.ascii	"fopen fd: %d\012\000"
	.align	2
.LC2:
	.ascii	"test failed: fp != NULL\012\000"
	.align	2
.LC3:
	.ascii	"test failed: fileno(fp) == 3\012\000"
	.align	2
.LC4:
	.ascii	"foobar and baz\000"
	.align	2
.LC5:
	.ascii	"open fd: %d\012\000"
	.align	2
.LC6:
	.ascii	"test failed: fd == 3\012\000"
	.align	2
.LC7:
	.ascii	"test failed: lseek (fd, 5, SEEK_SET) == 5\012\000"
	.align	2
.LC8:
	.ascii	"r\000"
	.align	2
.LC9:
	.ascii	"fdopen fd: %d\012\000"
	.align	2
.LC10:
	.ascii	"test failed: getc (fp) == 'r'\012\000"
	.align	2
.LC11:
	.ascii	"test failed: getc (fp) == ' '\012\000"
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ 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]
	str	r1, [fp, #-28]
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r3, #0
	str	r3, [fp, #-16]
	mov	r0, #0
	bl	tmpnam
	str	r0, [fp, #-12]
	ldr	r1, .L13
	ldr	r0, [fp, #-12]
	bl	fopen
	str	r0, [fp, #-20]
	ldr	r0, [fp, #-20]
	bl	fileno
	mov	r3, r0
	mov	r1, r3
	ldr	r0, .L13+4
	bl	printf
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L2
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L13+12
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L2:
	ldr	r0, [fp, #-20]
	bl	fileno
	mov	r3, r0
	cmp	r3, #3
	beq	.L4
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #29
	mov	r1, #1
	ldr	r0, .L13+16
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L4:
	ldr	r3, [fp, #-20]
	mov	r2, #14
	mov	r1, #1
	ldr	r0, .L13+20
	bl	fwrite
	ldr	r0, [fp, #-20]
	bl	fclose
	mov	r3, #0
	str	r3, [fp, #-20]
	mov	r1, #0
	ldr	r0, [fp, #-12]
	bl	open
	str	r0, [fp, #-8]
	ldr	r1, [fp, #-8]
	ldr	r0, .L13+24
	bl	printf
	ldr	r3, [fp, #-8]
	cmp	r3, #3
	beq	.L5
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #21
	mov	r1, #1
	ldr	r0, .L13+28
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L5:
	mov	r2, #0
	mov	r1, #5
	ldr	r0, [fp, #-8]
	bl	lseek
	mov	r3, r0
	cmp	r3, #5
	beq	.L6
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #42
	mov	r1, #1
	ldr	r0, .L13+32
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L6:
	ldr	r1, .L13+36
	ldr	r0, [fp, #-8]
	bl	fdopen
	str	r0, [fp, #-20]
	ldr	r3, [fp, #-20]
	ldr	r3, [r3, #56]
	mov	r1, r3
	ldr	r0, .L13+40
	bl	printf
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L7
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #24
	mov	r1, #1
	ldr	r0, .L13+12
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L7:
	ldr	r0, [fp, #-20]
	bl	fileno
	mov	r3, r0
	cmp	r3, #3
	beq	.L8
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #29
	mov	r1, #1
	ldr	r0, .L13+16
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L8:
	ldr	r0, [fp, #-20]
	bl	getc
	mov	r3, r0
	cmp	r3, #114
	beq	.L9
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L13+44
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L9:
	ldr	r0, [fp, #-20]
	bl	getc
	mov	r3, r0
	cmp	r3, #32
	beq	.L12
	ldr	r3, .L13+8
	ldr	r3, [r3]
	mov	r2, #30
	mov	r1, #1
	ldr	r0, .L13+48
	bl	fwrite
	mov	r3, #1
	str	r3, [fp, #-16]
	b	.L3
.L12:
	nop
.L3:
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	beq	.L10
	ldr	r0, [fp, #-20]
	bl	fclose
.L10:
	ldr	r0, [fp, #-12]
	bl	unlink
	ldr	r3, [fp, #-16]
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	.LC0
	.word	.LC1
	.word	stderr
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.word	.LC10
	.word	.LC11
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
