	.file	"118366.c"
	.intel_syntax noprefix
	.text
	.globl	signal_handler_stack
	.bss
	.align 16
	.type	signal_handler_stack, @object
	.size	signal_handler_stack, 24
signal_handler_stack:
	.zero	24
	.globl	signal_handler_stack_count
	.align 4
	.type	signal_handler_stack_count, @object
	.size	signal_handler_stack_count, 4
signal_handler_stack_count:
	.zero	4
	.text
	.globl	signal_handler
	.type	signal_handler, @function
signal_handler:
.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, 32
	mov	DWORD PTR -20[rbp], edi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR signal_handler_stack_count[rip]
	lea	edx, 1[rax]
	mov	DWORD PTR signal_handler_stack_count[rip], edx
	mov	eax, eax
	lea	rcx, 0[0+rax*8]
	lea	rdx, signal_handler_stack[rip]
	lea	rax, -9[rbp]
	mov	QWORD PTR [rcx+rdx], rax
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L2
	call	__stack_chk_fail@PLT
.L2:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	signal_handler, .-signal_handler
	.section	.rodata
.LC0:
	.string	"sigaction"
	.align 8
.LC1:
	.string	"test_sigstack: malloced stack %p - %p\n"
	.align 8
.LC2:
	.string	"test_sigstack: current stack %p\n"
.LC3:
	.string	"sigaltstack"
	.align 8
.LC4:
	.string	"signal_handler_stack %p %p %p\n"
	.text
	.globl	test_sigaltstack
	.type	test_sigaltstack, @function
test_sigaltstack:
.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, 208
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -204[rbp], 2097152
	mov	eax, DWORD PTR -204[rbp]
	mov	rsi, rax
	mov	edi, 1
	call	calloc@PLT
	mov	QWORD PTR -200[rbp], rax
	lea	rax, -192[rbp]
	mov	edx, 24
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	lea	rax, -160[rbp]
	mov	edx, 152
	mov	esi, 0
	mov	rdi, rax
	call	memset@PLT
	mov	DWORD PTR -24[rbp], 134217728
	lea	rax, signal_handler[rip]
	mov	QWORD PTR -160[rbp], rax
	lea	rax, -160[rbp]
	mov	edx, 0
	mov	rsi, rax
	mov	edi, 10
	call	sigaction@PLT
	test	eax, eax
	je	.L4
	lea	rdi, .LC0[rip]
	call	perror@PLT
.L4:
	mov	edi, 10
	call	raise@PLT
	mov	edi, 10
	call	raise@PLT
	mov	rdx, QWORD PTR -200[rbp]
	mov	eax, DWORD PTR -204[rbp]
	add	rdx, rax
	mov	rax, QWORD PTR -200[rbp]
	mov	rsi, rax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -200[rbp]
	mov	rsi, rax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR -204[rbp]
	shr	eax
	mov	eax, eax
	mov	QWORD PTR -176[rbp], rax
	mov	DWORD PTR -184[rbp], 0
	mov	rdx, QWORD PTR -200[rbp]
	mov	eax, DWORD PTR -204[rbp]
	shr	eax
	mov	eax, eax
	add	rax, rdx
	mov	QWORD PTR -192[rbp], rax
	lea	rax, -192[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	sigaltstack@PLT
	test	eax, eax
	jns	.L5
	lea	rdi, .LC3[rip]
	call	perror@PLT
.L5:
	mov	edi, 10
	call	raise@PLT
	mov	rcx, QWORD PTR signal_handler_stack[rip+16]
	mov	rdx, QWORD PTR signal_handler_stack[rip+8]
	mov	rax, QWORD PTR signal_handler_stack[rip]
	mov	rsi, rax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	nop
	mov	rax, QWORD PTR -8[rbp]
	sub	rax, QWORD PTR fs:40
	je	.L6
	call	__stack_chk_fail@PLT
.L6:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	test_sigaltstack, .-test_sigaltstack
	.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
	mov	eax, 0
	call	test_sigaltstack
	mov	eax, 0
	pop	rbp
	.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	"118366.c"
	.text
	.comm	signal_handler_stack,12,4
	.comm	signal_handler_stack_count,4,4
	.section	.rodata
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	signal_handler
	.syntax unified
	.arm
	.fpu softvfp
	.type	signal_handler, %function
signal_handler:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #16
	str	r0, [fp, #-16]
	ldr	r3, .L3
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L3+4
	ldr	r3, [r3]
	add	r2, r3, #1
	ldr	r1, .L3+4
	str	r2, [r1]
	ldr	r1, .L3+8
	sub	r2, fp, #9
	str	r2, [r1, r3, lsl #2]
	nop
	ldr	r3, .L3
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L2
	bl	__stack_chk_fail
.L2:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L4:
	.align	2
.L3:
	.word	.LC0
	.word	signal_handler_stack_count
	.word	signal_handler_stack
	.size	signal_handler, .-signal_handler
	.section	.rodata
	.align	2
.LC1:
	.ascii	"sigaction\000"
	.align	2
.LC2:
	.ascii	"test_sigstack: malloced stack %p - %p\012\000"
	.align	2
.LC3:
	.ascii	"test_sigstack: current stack %p\012\000"
	.align	2
.LC4:
	.ascii	"sigaltstack\000"
	.align	2
.LC5:
	.ascii	"signal_handler_stack %p %p %p\012\000"
	.align	2
.LC6:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	test_sigaltstack
	.syntax unified
	.arm
	.fpu softvfp
	.type	test_sigaltstack, %function
test_sigaltstack:
	@ args = 0, pretend = 0, frame = 168
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #168
	ldr	r3, .L9
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	mov	r3, #2097152
	str	r3, [fp, #-164]
	ldr	r1, [fp, #-164]
	mov	r0, #1
	bl	calloc
	mov	r3, r0
	str	r3, [fp, #-168]
	sub	r3, fp, #160
	mov	r2, #12
	mov	r1, #0
	mov	r0, r3
	bl	memset
	sub	r3, fp, #148
	mov	r2, #140
	mov	r1, #0
	mov	r0, r3
	bl	memset
	mov	r3, #134217728
	str	r3, [fp, #-16]
	ldr	r3, .L9+4
	str	r3, [fp, #-148]
	sub	r3, fp, #148
	mov	r2, #0
	mov	r1, r3
	mov	r0, #10
	bl	sigaction
	mov	r3, r0
	cmp	r3, #0
	beq	.L6
	ldr	r0, .L9+8
	bl	perror
.L6:
	mov	r0, #10
	bl	raise
	mov	r0, #10
	bl	raise
	ldr	r1, [fp, #-168]
	ldr	r2, [fp, #-168]
	ldr	r3, [fp, #-164]
	add	r3, r2, r3
	mov	r2, r3
	ldr	r0, .L9+12
	bl	printf
	sub	r3, fp, #168
	mov	r1, r3
	ldr	r0, .L9+16
	bl	printf
	ldr	r3, [fp, #-164]
	lsr	r3, r3, #1
	str	r3, [fp, #-152]
	mov	r3, #0
	str	r3, [fp, #-156]
	ldr	r2, [fp, #-168]
	ldr	r3, [fp, #-164]
	lsr	r3, r3, #1
	add	r3, r2, r3
	str	r3, [fp, #-160]
	sub	r3, fp, #160
	mov	r1, #0
	mov	r0, r3
	bl	sigaltstack
	mov	r3, r0
	cmp	r3, #0
	bge	.L7
	ldr	r0, .L9+20
	bl	perror
.L7:
	mov	r0, #10
	bl	raise
	ldr	r3, .L9+24
	ldr	r1, [r3]
	ldr	r3, .L9+24
	ldr	r2, [r3, #4]
	ldr	r3, .L9+24
	ldr	r3, [r3, #8]
	ldr	r0, .L9+28
	bl	printf
	nop
	ldr	r3, .L9
	ldr	r2, [r3]
	ldr	r3, [fp, #-8]
	eors	r2, r3, r2
	mov	r3, #0
	beq	.L8
	bl	__stack_chk_fail
.L8:
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L10:
	.align	2
.L9:
	.word	.LC6
	.word	signal_handler
	.word	.LC1
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	signal_handler_stack
	.word	.LC5
	.size	test_sigaltstack, .-test_sigaltstack
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	bl	test_sigaltstack
	mov	r3, #0
	mov	r0, r3
	pop	{fp, pc}
	.size	main, .-main
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
