	.file	"extr_652.c_init_socket.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"Socket:"
.LC1:
	.string	"Bind:"
.LC2:
	.string	"Listen:"
	.text
	.p2align 4
	.globl	init_socket
	.type	init_socket, @function
init_socket:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	esi, DWORD PTR SOCK_STREAM[rip]
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	rbp, rdi
	mov	edi, DWORD PTR AF_INET[rip]
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rdx
	xor	edx, edx
	call	socket@PLT
	mov	r12d, eax
	test	eax, eax
	js	.L13
.L2:
	mov	edi, DWORD PTR PORT[rip]
	call	htons@PLT
	mov	edx, 12
	mov	rsi, rbp
	mov	edi, r12d
	mov	DWORD PTR 8[rbp], eax
	mov	eax, DWORD PTR INADDR_ANY[rip]
	mov	DWORD PTR 4[rbp], eax
	mov	eax, DWORD PTR AF_INET[rip]
	mov	DWORD PTR 0[rbp], eax
	call	bind@PLT
	test	rax, rax
	jne	.L14
.L3:
	mov	esi, 128
	mov	edi, r12d
	call	listen@PLT
	test	rax, rax
	jne	.L15
.L4:
	mov	DWORD PTR [rbx], 12
	mov	esi, DWORD PTR check_zombie[rip]
	mov	edi, DWORD PTR SIGCHLD[rip]
	call	signal@PLT
	mov	eax, r12d
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L14:
	.cfi_restore_state
	lea	rdi, .LC1[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L15:
	lea	rdi, .LC2[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L13:
	lea	rdi, .LC0[rip]
	call	perror@PLT
	mov	edi, 1
	call	exit@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	init_socket, .-init_socket
	.comm	check_zombie,4,4
	.comm	SOCK_STREAM,4,4
	.comm	SIGCHLD,4,4
	.comm	PORT,4,4
	.comm	INADDR_ANY,4,4
	.comm	AF_INET,4,4
	.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_652.c_init_socket.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"Socket:\000"
	.align	2
.LC1:
	.ascii	"Bind:\000"
	.align	2
.LC2:
	.ascii	"Listen:\000"
	.text
	.align	2
	.global	init_socket
	.syntax unified
	.arm
	.fpu softvfp
	.type	init_socket, %function
init_socket:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L16
	ldr	r6, .L16+4
	mov	r5, r0
	mov	r7, r2
	ldr	r1, [r3]
	mov	r2, #0
	ldr	r0, [r6]
	bl	socket
	subs	r4, r0, #0
	blt	.L13
.L2:
	ldr	r3, .L16+8
	ldr	r0, [r3]
	bl	htons
	ldr	r3, .L16+12
	ldr	r2, [r6]
	ldr	r3, [r3]
	str	r0, [r5, #8]
	stm	r5, {r2, r3}
	mov	r1, r5
	mov	r2, #12
	mov	r0, r4
	bl	bind
	cmp	r0, #0
	bne	.L14
.L3:
	mov	r1, #128
	mov	r0, r4
	bl	listen
	cmp	r0, #0
	bne	.L15
.L4:
	mov	r1, #12
	ldr	r2, .L16+16
	ldr	r3, .L16+20
	str	r1, [r7]
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	signal
	mov	r0, r4
	pop	{r4, r5, r6, r7, r8, pc}
.L14:
	ldr	r0, .L16+24
	bl	perror
	mov	r0, #1
	bl	exit
	b	.L3
.L15:
	ldr	r0, .L16+28
	bl	perror
	mov	r0, #1
	bl	exit
	b	.L4
.L13:
	ldr	r0, .L16+32
	bl	perror
	mov	r0, #1
	bl	exit
	b	.L2
.L17:
	.align	2
.L16:
	.word	SOCK_STREAM
	.word	AF_INET
	.word	PORT
	.word	INADDR_ANY
	.word	check_zombie
	.word	SIGCHLD
	.word	.LC1
	.word	.LC2
	.word	.LC0
	.size	init_socket, .-init_socket
	.comm	check_zombie,4,4
	.comm	SOCK_STREAM,4,4
	.comm	SIGCHLD,4,4
	.comm	PORT,4,4
	.comm	INADDR_ANY,4,4
	.comm	AF_INET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
