	.file	"131962.c"
	.intel_syntax noprefix
	.text
	.section	.rodata
.LC0:
	.string	"WG_COLOR_MODE"
.LC1:
	.string	"always"
.LC2:
	.string	"never"
	.text
	.type	color_mode, @function
color_mode:
.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, 16
	mov	eax, DWORD PTR mode.0[rip]
	cmp	eax, -1
	je	.L2
	mov	eax, DWORD PTR mode.0[rip]
	test	eax, eax
	setne	al
	jmp	.L3
.L2:
	lea	rdi, .LC0[rip]
	call	getenv@PLT
	mov	QWORD PTR -8[rbp], rax
	cmp	QWORD PTR -8[rbp], 0
	je	.L4
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC1[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L4
	mov	DWORD PTR mode.0[rip], 1
	jmp	.L5
.L4:
	cmp	QWORD PTR -8[rbp], 0
	je	.L6
	mov	rax, QWORD PTR -8[rbp]
	lea	rsi, .LC2[rip]
	mov	rdi, rax
	call	strcmp@PLT
	test	eax, eax
	jne	.L6
	mov	DWORD PTR mode.0[rip], 0
	jmp	.L5
.L6:
	mov	rax, QWORD PTR stdout[rip]
	mov	rdi, rax
	call	fileno@PLT
	mov	edi, eax
	call	isatty@PLT
	mov	DWORD PTR mode.0[rip], eax
.L5:
	mov	eax, DWORD PTR mode.0[rip]
	test	eax, eax
	setne	al
.L3:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	color_mode, .-color_mode
	.type	filter_ansi, @function
filter_ansi:
.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, 64
	mov	QWORD PTR -56[rbp], rdi
	mov	QWORD PTR -64[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	QWORD PTR -40[rbp], 0
	call	color_mode
	test	al, al
	je	.L8
	mov	rax, QWORD PTR stdout[rip]
	mov	rdx, QWORD PTR -64[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	vfprintf@PLT
	jmp	.L7
.L8:
	mov	rdx, QWORD PTR -64[rbp]
	mov	rcx, QWORD PTR -56[rbp]
	lea	rax, -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	mov	eax, 0
	call	vasprintf@PLT
	cdqe
	mov	QWORD PTR -16[rbp], rax
	cmp	QWORD PTR -16[rbp], 1
	jbe	.L10
	mov	QWORD PTR -32[rbp], 0
	jmp	.L11
.L17:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 27
	jne	.L12
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 1
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	cmp	al, 91
	jne	.L12
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 1
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	mov	rcx, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	add	rdx, rcx
	movzx	eax, BYTE PTR [rax]
	mov	BYTE PTR [rdx], al
	mov	rax, QWORD PTR -32[rbp]
	add	rax, 2
	mov	QWORD PTR -24[rbp], rax
	jmp	.L13
.L16:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	movsx	eax, al
	mov	edi, eax
	mov	eax, 0
	call	char_is_alpha@PLT
	test	eax, eax
	jne	.L25
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
	add	QWORD PTR -24[rbp], 1
.L13:
	mov	rax, QWORD PTR -24[rbp]
	cmp	rax, QWORD PTR -16[rbp]
	jb	.L16
	jmp	.L15
.L25:
	nop
.L15:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	mov	BYTE PTR [rax], 0
.L12:
	add	QWORD PTR -32[rbp], 1
.L11:
	mov	rax, QWORD PTR -16[rbp]
	sub	rax, 2
	cmp	QWORD PTR -32[rbp], rax
	jb	.L17
.L10:
	mov	QWORD PTR -32[rbp], 0
	jmp	.L18
.L23:
	mov	rax, QWORD PTR stdout[rip]
	mov	rcx, QWORD PTR -40[rbp]
	mov	rdx, QWORD PTR -32[rbp]
	add	rdx, rcx
	mov	rsi, rax
	mov	rdi, rdx
	call	fputs@PLT
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	rdi, rax
	call	strlen@PLT
	mov	rdx, QWORD PTR -32[rbp]
	add	rax, rdx
	mov	QWORD PTR -24[rbp], rax
	jmp	.L19
.L22:
	mov	rdx, QWORD PTR -40[rbp]
	mov	rax, QWORD PTR -24[rbp]
	add	rax, rdx
	movzx	eax, BYTE PTR [rax]
	test	al, al
	jne	.L26
	add	QWORD PTR -24[rbp], 1
.L19:
	mov	rax, QWORD PTR -24[rbp]
	cmp	rax, QWORD PTR -16[rbp]
	jb	.L22
	jmp	.L21
.L26:
	nop
.L21:
	mov	rax, QWORD PTR -24[rbp]
	mov	QWORD PTR -32[rbp], rax
.L18:
	mov	rax, QWORD PTR -32[rbp]
	cmp	rax, QWORD PTR -16[rbp]
	jb	.L23
	mov	rax, QWORD PTR -40[rbp]
	mov	rdi, rax
	call	free@PLT
.L7:
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L24
	call	__stack_chk_fail@PLT
.L24:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	filter_ansi, .-filter_ansi
	.globl	terminal_printf
	.type	terminal_printf, @function
terminal_printf:
.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, 224
	mov	QWORD PTR -216[rbp], rdi
	mov	QWORD PTR -168[rbp], rsi
	mov	QWORD PTR -160[rbp], rdx
	mov	QWORD PTR -152[rbp], rcx
	mov	QWORD PTR -144[rbp], r8
	mov	QWORD PTR -136[rbp], r9
	test	al, al
	je	.L28
	movaps	XMMWORD PTR -128[rbp], xmm0
	movaps	XMMWORD PTR -112[rbp], xmm1
	movaps	XMMWORD PTR -96[rbp], xmm2
	movaps	XMMWORD PTR -80[rbp], xmm3
	movaps	XMMWORD PTR -64[rbp], xmm4
	movaps	XMMWORD PTR -48[rbp], xmm5
	movaps	XMMWORD PTR -32[rbp], xmm6
	movaps	XMMWORD PTR -16[rbp], xmm7
.L28:
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -184[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -208[rbp], 8
	mov	DWORD PTR -204[rbp], 48
	lea	rax, 16[rbp]
	mov	QWORD PTR -200[rbp], rax
	lea	rax, -176[rbp]
	mov	QWORD PTR -192[rbp], rax
	lea	rdx, -208[rbp]
	mov	rax, QWORD PTR -216[rbp]
	mov	rsi, rdx
	mov	rdi, rax
	call	filter_ansi
	nop
	mov	rax, QWORD PTR -184[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	terminal_printf, .-terminal_printf
	.data
	.align 4
	.type	mode.0, @object
	.size	mode.0, 4
mode.0:
	.long	-1
	.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	"131962.c"
	.text
	.section	.rodata
	.align	2
.LC0:
	.ascii	"WG_COLOR_MODE\000"
	.align	2
.LC1:
	.ascii	"always\000"
	.align	2
.LC2:
	.ascii	"never\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	color_mode, %function
color_mode:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #8
	ldr	r3, .L7
	ldr	r3, [r3]
	cmn	r3, #1
	beq	.L2
	ldr	r3, .L7
	ldr	r3, [r3]
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
	b	.L3
.L2:
	ldr	r0, .L7+4
	bl	getenv
	str	r0, [fp, #-8]
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L4
	ldr	r1, .L7+8
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L4
	ldr	r3, .L7
	mov	r2, #1
	str	r2, [r3]
	b	.L5
.L4:
	ldr	r3, [fp, #-8]
	cmp	r3, #0
	beq	.L6
	ldr	r1, .L7+12
	ldr	r0, [fp, #-8]
	bl	strcmp
	mov	r3, r0
	cmp	r3, #0
	bne	.L6
	ldr	r3, .L7
	mov	r2, #0
	str	r2, [r3]
	b	.L5
.L6:
	ldr	r3, .L7+16
	ldr	r3, [r3]
	mov	r0, r3
	bl	fileno
	mov	r3, r0
	mov	r0, r3
	bl	isatty
	mov	r3, r0
	ldr	r2, .L7
	str	r3, [r2]
.L5:
	ldr	r3, .L7
	ldr	r3, [r3]
	cmp	r3, #0
	movne	r3, #1
	moveq	r3, #0
	and	r3, r3, #255
.L3:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L8:
	.align	2
.L7:
	.word	mode.6012
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	stdout
	.size	color_mode, .-color_mode
	.section	.rodata
	.align	2
.LC3:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	filter_ansi, %function
filter_ansi:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-32]
	str	r1, [fp, #-36]
	ldr	r3, .L29
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #0
	str	r3, [fp, #-24]
	bl	color_mode
	mov	r3, r0
	cmp	r3, #0
	beq	.L10
	ldr	r3, .L29+4
	ldr	r3, [r3]
	ldr	r2, [fp, #-36]
	ldr	r1, [fp, #-32]
	mov	r0, r3
	bl	vfprintf
	b	.L9
.L10:
	sub	r3, fp, #24
	ldr	r2, [fp, #-36]
	ldr	r1, [fp, #-32]
	mov	r0, r3
	bl	vasprintf
	mov	r3, r0
	str	r3, [fp, #-12]
	ldr	r3, [fp, #-12]
	cmp	r3, #1
	bls	.L12
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L13
.L19:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #27
	bne	.L14
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #91
	bne	.L14
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r1, [fp, #-24]
	ldr	r2, [fp, #-20]
	add	r2, r1, r2
	ldrb	r3, [r3]	@ zero_extendqisi2
	strb	r3, [r2]
	ldr	r3, [fp, #-20]
	add	r3, r3, #2
	str	r3, [fp, #-16]
	b	.L15
.L18:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	mov	r0, r3
	bl	char_is_alpha
	mov	r3, r0
	cmp	r3, #0
	bne	.L27
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L15:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bcc	.L18
	b	.L17
.L27:
	nop
.L17:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	mov	r2, #0
	strb	r2, [r3]
.L14:
	ldr	r3, [fp, #-20]
	add	r3, r3, #1
	str	r3, [fp, #-20]
.L13:
	ldr	r3, [fp, #-12]
	sub	r3, r3, #2
	ldr	r2, [fp, #-20]
	cmp	r2, r3
	bcc	.L19
.L12:
	mov	r3, #0
	str	r3, [fp, #-20]
	b	.L20
.L25:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	ldr	r2, .L29+4
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	fputs
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-20]
	add	r3, r2, r3
	mov	r0, r3
	bl	strlen
	mov	r2, r0
	ldr	r3, [fp, #-20]
	add	r3, r3, r2
	str	r3, [fp, #-16]
	b	.L21
.L24:
	ldr	r2, [fp, #-24]
	ldr	r3, [fp, #-16]
	add	r3, r2, r3
	ldrb	r3, [r3]	@ zero_extendqisi2
	cmp	r3, #0
	bne	.L28
	ldr	r3, [fp, #-16]
	add	r3, r3, #1
	str	r3, [fp, #-16]
.L21:
	ldr	r2, [fp, #-16]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bcc	.L24
	b	.L23
.L28:
	nop
.L23:
	ldr	r3, [fp, #-16]
	str	r3, [fp, #-20]
.L20:
	ldr	r2, [fp, #-20]
	ldr	r3, [fp, #-12]
	cmp	r2, r3
	bcc	.L25
	ldr	r3, [fp, #-24]
	mov	r0, r3
	bl	free
.L9:
	ldr	r3, .L29
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L26
	bl	__stack_chk_fail
.L26:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L30:
	.align	2
.L29:
	.word	.LC3
	.word	stdout
	.size	filter_ansi, .-filter_ansi
	.section	.rodata
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	terminal_printf
	.syntax unified
	.arm
	.fpu softvfp
	.type	terminal_printf, %function
terminal_printf:
	@ args = 4, pretend = 16, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 1
	push	{r0, r1, r2, r3}
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	ldr	r3, [fp, #4]
	str	r3, [fp, #-16]
	ldr	r3, .L33
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	add	r3, fp, #8
	str	r3, [fp, #-12]
	ldr	r1, [fp, #-12]
	ldr	r0, [fp, #-16]
	bl	filter_ansi
	nop
	ldr	r3, .L33
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L32
	bl	__stack_chk_fail
.L32:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, lr}
	add	sp, sp, #16
	bx	lr
.L34:
	.align	2
.L33:
	.word	.LC4
	.size	terminal_printf, .-terminal_printf
	.data
	.align	2
	.type	mode.6012, %object
	.size	mode.6012, 4
mode.6012:
	.word	-1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
