	.file	"extr_44847.c_main.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"fork failed"
.LC1:
	.string	"nvAccelerator"
.LC2:
	.string	"unable to find service"
.LC3:
	.string	"got service: 0x%x\n"
.LC4:
	.string	"unable to open ioservice"
.LC5:
	.string	"got service"
	.section	.text.startup,"ax",@progbits
	.p2align 4
	.globl	main
	.type	main, @function
main:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	sub	rsp, 32
	.cfi_def_cfa_offset 48
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	call	fork@PLT
	cmp	eax, -1
	je	.L20
	lea	rdi, .LC1[rip]
	test	eax, eax
	je	.L4
	call	IOServiceMatching@PLT
	mov	edi, DWORD PTR kIOMasterPortDefault[rip]
	mov	esi, eax
	call	IOServiceGetMatchingService@PLT
	cmp	QWORD PTR MACH_PORT_NULL[rip], rax
	mov	rbp, rax
	je	.L17
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	printf@PLT
	mov	rax, QWORD PTR MACH_PORT_NULL[rip]
	mov	QWORD PTR 16[rsp], rax
	xor	eax, eax
	call	mach_task_self@PLT
	lea	rcx, 16[rsp]
	mov	edx, 5
	mov	rdi, rbp
	mov	esi, eax
	call	IOServiceOpen@PLT
	cmp	QWORD PTR KERN_SUCCESS[rip], rax
	je	.L7
.L18:
	lea	rdi, .LC4[rip]
	call	puts@PLT
.L3:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L21
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 16
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
.L4:
	.cfi_restore_state
	call	IOServiceMatching@PLT
	mov	edi, DWORD PTR kIOMasterPortDefault[rip]
	mov	esi, eax
	call	IOServiceGetMatchingService@PLT
	cmp	QWORD PTR MACH_PORT_NULL[rip], rax
	mov	rbp, rax
	je	.L17
	mov	rsi, rax
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	printf@PLT
	mov	rax, QWORD PTR MACH_PORT_NULL[rip]
	mov	QWORD PTR 16[rsp], rax
	xor	eax, eax
	call	mach_task_self@PLT
	lea	rcx, 16[rsp]
	mov	edx, 5
	mov	rdi, rbp
	mov	esi, eax
	call	IOServiceOpen@PLT
	cmp	QWORD PTR KERN_SUCCESS[rip], rax
	jne	.L18
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	rdi, QWORD PTR 16[rsp]
	call	set_app_support_bits@PLT
	jmp	.L3
.L7:
	lea	rdi, .LC5[rip]
	call	puts@PLT
	mov	rcx, QWORD PTR 16[rsp]
	mov	edx, DWORD PTR thread_func[rip]
	xor	esi, esi
	lea	rdi, 8[rsp]
	call	pthread_create@PLT
	cmp	DWORD PTR running[rip], 0
	jne	.L15
.L14:
	jmp	.L14
.L15:
	mov	DWORD PTR go[rip], 1
	mov	rdi, QWORD PTR 16[rsp]
	call	set_app_support_bits@PLT
	mov	edi, DWORD PTR 8[rsp]
	xor	esi, esi
	call	pthread_join@PLT
	lea	rdi, 12[rsp]
	mov	DWORD PTR 12[rsp], 0
	call	wait@PLT
	jmp	.L3
.L17:
	lea	rdi, .LC2[rip]
	call	puts@PLT
	jmp	.L3
.L20:
	lea	rdi, .LC0[rip]
	call	puts@PLT
	jmp	.L3
.L21:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	main, .-main
	.comm	thread_func,4,4
	.comm	running,4,4
	.comm	kIOMasterPortDefault,4,4
	.comm	go,4,4
	.comm	MACH_PORT_NULL,8,8
	.comm	KERN_SUCCESS,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.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, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_44847.c_main.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"fork failed\000"
	.align	2
.LC1:
	.ascii	"nvAccelerator\000"
	.align	2
.LC2:
	.ascii	"unable to find service\000"
	.align	2
.LC3:
	.ascii	"got service: 0x%x\012\000"
	.align	2
.LC4:
	.ascii	"unable to open ioservice\000"
	.align	2
.LC5:
	.ascii	"got service\000"
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC6:
	.word	__stack_chk_guard
	.section	.text.startup,"ax",%progbits
	.align	2
	.global	main
	.syntax unified
	.arm
	.fpu softvfp
	.type	main, %function
main:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, lr}
	ldr	r3, .L22
	sub	sp, sp, #20
	ldr	r3, [r3]
	str	r3, [sp, #12]
	mov	r3,#0
	bl	fork
	cmn	r0, #1
	beq	.L20
	ldr	r3, .L22+4
	cmp	r0, #0
	ldr	r4, [r3]
	ldr	r0, .L22+8
	beq	.L4
	bl	IOServiceMatching
	mov	r1, r0
	mov	r0, r4
	bl	IOServiceGetMatchingService
	ldr	r5, .L22+12
	mov	r4, r0
	ldr	r3, [r5]
	cmp	r3, r0
	beq	.L17
	mov	r1, r0
	ldr	r0, .L22+16
	bl	printf
	ldr	r3, [r5]
	str	r3, [sp]
	bl	mach_task_self
	mov	r3, sp
	mov	r1, r0
	mov	r2, #5
	mov	r0, r4
	bl	IOServiceOpen
	ldr	r3, .L22+20
	ldr	r3, [r3]
	cmp	r3, r0
	beq	.L7
.L18:
	ldr	r0, .L22+24
	bl	puts
.L3:
	ldr	r3, .L22
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L21
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, pc}
.L4:
	bl	IOServiceMatching
	mov	r1, r0
	mov	r0, r4
	bl	IOServiceGetMatchingService
	ldr	r5, .L22+12
	mov	r4, r0
	ldr	r3, [r5]
	cmp	r3, r0
	beq	.L17
	mov	r1, r0
	ldr	r0, .L22+16
	bl	printf
	ldr	r3, [r5]
	str	r3, [sp, #8]
	bl	mach_task_self
	add	r3, sp, #8
	mov	r1, r0
	mov	r2, #5
	mov	r0, r4
	bl	IOServiceOpen
	ldr	r3, .L22+20
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L18
	ldr	r0, .L22+28
	bl	puts
	ldr	r0, [sp, #8]
	bl	set_app_support_bits
	b	.L3
.L7:
	ldr	r0, .L22+28
	bl	puts
	ldr	r2, .L22+32
	ldr	r3, [sp]
	mov	r1, #0
	ldr	r2, [r2]
	add	r0, sp, #4
	bl	pthread_create
	ldr	r3, .L22+36
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L15
.L14:
	b	.L14
.L15:
	mov	r2, #1
	ldr	r3, .L22+40
	ldr	r0, [sp]
	str	r2, [r3]
	bl	set_app_support_bits
	mov	r1, #0
	ldr	r0, [sp, #4]
	bl	pthread_join
	mov	r3, #0
	add	r0, sp, #8
	str	r3, [sp, #8]
	bl	wait
	b	.L3
.L17:
	ldr	r0, .L22+44
	bl	puts
	b	.L3
.L20:
	ldr	r0, .L22+48
	bl	puts
	b	.L3
.L21:
	bl	__stack_chk_fail
.L23:
	.align	2
.L22:
	.word	.LC6
	.word	kIOMasterPortDefault
	.word	.LC1
	.word	MACH_PORT_NULL
	.word	.LC3
	.word	KERN_SUCCESS
	.word	.LC4
	.word	.LC5
	.word	thread_func
	.word	running
	.word	go
	.word	.LC2
	.word	.LC0
	.size	main, .-main
	.comm	thread_func,4,4
	.comm	running,4,4
	.comm	kIOMasterPortDefault,4,4
	.comm	go,4,4
	.comm	MACH_PORT_NULL,4,4
	.comm	KERN_SUCCESS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
