	.file	"823015.c"
	.intel_syntax noprefix
	.text
	.globl	this_is_global
	.bss
	.align 4
	.type	this_is_global, @object
	.size	this_is_global, 4
this_is_global:
	.zero	4
	.section	.rodata
	.align 8
.LC0:
	.string	"First, we create two threads to see better what context they share..."
.LC1:
	.string	"Set this_is_global=%d\n"
	.align 8
.LC2:
	.string	"After threads, this_is_global=%d\n"
	.align 8
.LC3:
	.string	"Now that the threads are done, let's call fork.."
	.align 8
.LC4:
	.string	"Before fork(), local_main=%d, this_is_global=%d\n"
	.align 8
.LC5:
	.string	"In child, pid %d: &global: %tX, &local: %tX\n"
	.align 8
.LC6:
	.string	"Child set local_main=%d, this_is_global=%d\n"
	.align 8
.LC7:
	.string	"In parent, pid %d: &global: %tX, &local: %tX\n"
	.align 8
.LC8:
	.string	"In parent, local_main=%d, this_is_global=%d\n"
	.text
	.globl	main
	.type	main, @function
main:
.LFB6:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 48
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	DWORD PTR -32[rbp], 1
	mov	DWORD PTR -28[rbp], 2
	lea	rdi, .LC0[rip]
	call	puts@PLT
	mov	DWORD PTR this_is_global[rip], 1000
	mov	eax, DWORD PTR this_is_global[rip]
	mov	esi, eax
	lea	rdi, .LC1[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rdx, -32[rbp]
	lea	rax, -48[rbp]
	mov	rcx, rdx
	lea	rdx, thread_func[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	lea	rax, -32[rbp]
	lea	rdx, 4[rax]
	lea	rax, -40[rbp]
	mov	rcx, rdx
	lea	rdx, thread_func[rip]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_create@PLT
	mov	rax, QWORD PTR -48[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	rax, QWORD PTR -40[rbp]
	mov	esi, 0
	mov	rdi, rax
	call	pthread_join@PLT
	mov	eax, DWORD PTR this_is_global[rip]
	mov	esi, eax
	lea	rdi, .LC2[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 10
	call	putchar@PLT
	lea	rdi, .LC3[rip]
	call	puts@PLT
	mov	DWORD PTR -60[rbp], 17
	mov	DWORD PTR this_is_global[rip], 17
	mov	edx, DWORD PTR this_is_global[rip]
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC4[rip]
	mov	eax, 0
	call	printf@PLT
	call	fork@PLT
	mov	DWORD PTR -52[rbp], eax
	cmp	DWORD PTR -52[rbp], 0
	jne	.L2
	lea	rbx, -60[rbp]
	lea	r12, this_is_global[rip]
	call	getpid@PLT
	mov	rcx, rbx
	mov	rdx, r12
	mov	esi, eax
	lea	rdi, .LC5[rip]
	mov	eax, 0
	call	printf@PLT
	mov	DWORD PTR -60[rbp], 13
	mov	DWORD PTR this_is_global[rip], 23
	mov	edx, DWORD PTR this_is_global[rip]
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC6[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
.L2:
	lea	rbx, -60[rbp]
	lea	r12, this_is_global[rip]
	call	getpid@PLT
	mov	rcx, rbx
	mov	rdx, r12
	mov	esi, eax
	lea	rdi, .LC7[rip]
	mov	eax, 0
	call	printf@PLT
	lea	rax, -56[rbp]
	mov	rdi, rax
	call	wait@PLT
	mov	edx, DWORD PTR this_is_global[rip]
	mov	eax, DWORD PTR -60[rbp]
	mov	esi, eax
	lea	rdi, .LC8[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	exit@PLT
	.cfi_endproc
.LFE6:
	.size	main, .-main
	.section	.rodata
	.align 8
.LC9:
	.string	"Thread %d, pid %d, addresses: &global: %tX, &local: %tX\n"
	.align 8
.LC10:
	.string	"In Thread %d, incremented this_is_global=%d\n"
	.text
	.globl	thread_func
	.type	thread_func, @function
thread_func:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r12
	push	rbx
	sub	rsp, 32
	.cfi_offset 12, -24
	.cfi_offset 3, -32
	mov	QWORD PTR -40[rbp], rdi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -24[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR -40[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR -28[rbp], eax
	lea	r12, -32[rbp]
	lea	rbx, this_is_global[rip]
	call	getpid@PLT
	mov	edx, eax
	mov	eax, DWORD PTR -28[rbp]
	mov	r8, r12
	mov	rcx, rbx
	mov	esi, eax
	lea	rdi, .LC9[rip]
	mov	eax, 0
	call	printf@PLT
	mov	eax, DWORD PTR this_is_global[rip]
	add	eax, 1
	mov	DWORD PTR this_is_global[rip], eax
	mov	edx, DWORD PTR this_is_global[rip]
	mov	eax, DWORD PTR -28[rbp]
	mov	esi, eax
	lea	rdi, .LC10[rip]
	mov	eax, 0
	call	printf@PLT
	mov	edi, 0
	call	pthread_exit@PLT
	.cfi_endproc
.LFE7:
	.size	thread_func, .-thread_func
	.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	"823015.c"
	.text
	.comm	this_is_global,4,4
	.section	.rodata
	.align	2
.LC1:
	.ascii	"First, we create two threads to see better what con"
	.ascii	"text they share...\000"
	.align	2
.LC2:
	.ascii	"Set this_is_global=%d\012\000"
	.align	2
.LC3:
	.ascii	"After threads, this_is_global=%d\012\000"
	.align	2
.LC4:
	.ascii	"Now that the threads are done, let's call fork..\000"
	.align	2
.LC5:
	.ascii	"Before fork(), local_main=%d, this_is_global=%d\012"
	.ascii	"\000"
	.align	2
.LC6:
	.ascii	"In child, pid %d: &global: %tX, &local: %tX\012\000"
	.align	2
.LC7:
	.ascii	"Child set local_main=%d, this_is_global=%d\012\000"
	.align	2
.LC8:
	.ascii	"In parent, pid %d: &global: %tX, &local: %tX\012\000"
	.align	2
.LC9:
	.ascii	"In parent, local_main=%d, this_is_global=%d\012\000"
	.align	2
.LC0:
	.word	1
	.word	2
	.align	2
.LC10:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	ldr	r3, .L4
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, .L4+4
	sub	r3, fp, #16
	ldm	r2, {r0, r1}
	stm	r3, {r0, r1}
	ldr	r0, .L4+8
	bl	puts
	ldr	r3, .L4+12
	mov	r2, #1000
	str	r2, [r3]
	ldr	r3, .L4+12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L4+16
	bl	printf
	sub	r3, fp, #16
	sub	r0, fp, #28
	ldr	r2, .L4+20
	mov	r1, #0
	bl	pthread_create
	sub	r3, fp, #16
	add	r3, r3, #4
	sub	r0, fp, #24
	ldr	r2, .L4+20
	mov	r1, #0
	bl	pthread_create
	ldr	r3, [fp, #-28]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, [fp, #-24]
	mov	r1, #0
	mov	r0, r3
	bl	pthread_join
	ldr	r3, .L4+12
	ldr	r3, [r3]
	mov	r1, r3
	ldr	r0, .L4+24
	bl	printf
	mov	r0, #10
	bl	putchar
	ldr	r0, .L4+28
	bl	puts
	mov	r3, #17
	str	r3, [fp, #-36]
	ldr	r3, .L4+12
	mov	r2, #17
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	ldr	r2, .L4+12
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L4+32
	bl	printf
	bl	fork
	mov	r3, r0
	str	r3, [fp, #-20]
	ldr	r3, [fp, #-20]
	cmp	r3, #0
	bne	.L2
	bl	getpid
	mov	r1, r0
	ldr	r2, .L4+12
	sub	r3, fp, #36
	ldr	r0, .L4+36
	bl	printf
	mov	r3, #13
	str	r3, [fp, #-36]
	ldr	r3, .L4+12
	mov	r2, #23
	str	r2, [r3]
	ldr	r3, [fp, #-36]
	ldr	r2, .L4+12
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L4+40
	bl	printf
	mov	r0, #0
	bl	exit
.L2:
	bl	getpid
	mov	r1, r0
	ldr	r2, .L4+12
	sub	r3, fp, #36
	ldr	r0, .L4+44
	bl	printf
	sub	r3, fp, #32
	mov	r0, r3
	bl	wait
	ldr	r3, [fp, #-36]
	ldr	r2, .L4+12
	ldr	r2, [r2]
	mov	r1, r3
	ldr	r0, .L4+48
	bl	printf
	mov	r0, #0
	bl	exit
.L5:
	.align	2
.L4:
	.word	.LC10
	.word	.LC0
	.word	.LC1
	.word	this_is_global
	.word	.LC2
	.word	thread_func
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	.LC6
	.word	.LC7
	.word	.LC8
	.word	.LC9
	.size	main, .-main
	.section	.rodata
	.align	2
.LC11:
	.ascii	"Thread %d, pid %d, addresses: &global: %tX, &local:"
	.ascii	" %tX\012\000"
	.align	2
.LC12:
	.ascii	"In Thread %d, incremented this_is_global=%d\012\000"
	.align	2
.LC13:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	thread_func
	.syntax unified
	.arm
	.fpu softvfp
	.type	thread_func, %function
thread_func:
	@ args = 0, pretend = 0, frame = 24
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #32
	str	r0, [fp, #-24]
	ldr	r3, .L8
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, [fp, #-24]
	ldr	r3, [r3]
	str	r3, [fp, #-12]
	bl	getpid
	mov	r2, r0
	ldr	r1, .L8+4
	sub	r3, fp, #16
	str	r3, [sp]
	mov	r3, r1
	ldr	r1, [fp, #-12]
	ldr	r0, .L8+8
	bl	printf
	ldr	r3, .L8+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L8+4
	str	r3, [r2]
	ldr	r3, .L8+4
	ldr	r3, [r3]
	mov	r2, r3
	ldr	r1, [fp, #-12]
	ldr	r0, .L8+12
	bl	printf
	mov	r0, #0
	bl	pthread_exit
.L9:
	.align	2
.L8:
	.word	.LC13
	.word	this_is_global
	.word	.LC11
	.word	.LC12
	.size	thread_func, .-thread_func
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
