	.file	"522714.c"
	.intel_syntax noprefix
	.text
	.globl	g_display
	.bss
	.align 8
	.type	g_display, @object
	.size	g_display, 8
g_display:
	.zero	8
	.local	g_screen
	.comm	g_screen,4,4
	.local	g_window
	.comm	g_window,8,8
	.local	g_gc
	.comm	g_gc,8,8
	.local	g_xshminfo
	.comm	g_xshminfo,32,32
	.local	g_xerror
	.comm	g_xerror,4,4
	.local	g_image
	.comm	g_image,8,8
	.local	g_framebuffer
	.comm	g_framebuffer,8,8
	.local	g_fbpixelwidth
	.comm	g_fbpixelwidth,2,2
	.local	g_fbpixelheight
	.comm	g_fbpixelheight,2,2
	.local	g_shmcheckpoint
	.comm	g_shmcheckpoint,4,4
	.local	b_useshm
	.comm	b_useshm,4,4
	.section	.rodata
.LC0:
	.string	"nuttx"
.LC1:
	.string	"NuttX"
.LC2:
	.string	"NX"
.LC3:
	.string	"Unable to open display.\n"
	.text
	.type	up_x11createframe, @function
up_x11createframe:
.LFB6:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 320
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	lea	rax, .LC0[rip]
	mov	QWORD PTR -32[rbp], rax
	mov	QWORD PTR -24[rbp], 0
	lea	rax, .LC1[rip]
	mov	QWORD PTR -320[rbp], rax
	lea	rax, .LC2[rip]
	mov	QWORD PTR -312[rbp], rax
	mov	edi, 0
	call	XOpenDisplay@PLT
	mov	QWORD PTR g_display[rip], rax
	mov	rax, QWORD PTR g_display[rip]
	test	rax, rax
	jne	.L2
	lea	rsi, .LC3[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, -1
	jmp	.L4
.L2:
	mov	rax, QWORD PTR g_display[rip]
	mov	eax, DWORD PTR 224[rax]
	mov	DWORD PTR g_screen[rip], eax
	mov	rax, QWORD PTR g_display[rip]
	mov	rdx, QWORD PTR 232[rax]
	mov	eax, DWORD PTR g_screen[rip]
	cdqe
	sal	rax, 7
	add	rax, rdx
	mov	rcx, QWORD PTR 96[rax]
	mov	rax, QWORD PTR g_display[rip]
	mov	rdx, QWORD PTR 232[rax]
	mov	eax, DWORD PTR g_screen[rip]
	cdqe
	sal	rax, 7
	add	rax, rdx
	mov	rdx, QWORD PTR 96[rax]
	movzx	eax, WORD PTR g_fbpixelheight[rip]
	movzx	r8d, ax
	movzx	eax, WORD PTR g_fbpixelwidth[rip]
	movzx	edi, ax
	mov	rax, QWORD PTR g_display[rip]
	mov	rsi, QWORD PTR 232[rax]
	mov	rax, QWORD PTR g_display[rip]
	mov	eax, DWORD PTR 224[rax]
	cdqe
	sal	rax, 7
	add	rax, rsi
	mov	rsi, QWORD PTR 16[rax]
	mov	rax, QWORD PTR g_display[rip]
	sub	rsp, 8
	push	rcx
	push	rdx
	push	2
	mov	r9d, r8d
	mov	r8d, edi
	mov	ecx, 0
	mov	edx, 0
	mov	rdi, rax
	call	XCreateSimpleWindow@PLT
	add	rsp, 32
	mov	QWORD PTR g_window[rip], rax
	lea	rdx, -304[rbp]
	lea	rax, -320[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	XStringListToTextProperty@PLT
	lea	rdx, -272[rbp]
	lea	rax, -312[rbp]
	mov	esi, 1
	mov	rdi, rax
	call	XStringListToTextProperty@PLT
	mov	QWORD PTR -240[rbp], 56
	movzx	eax, WORD PTR g_fbpixelwidth[rip]
	movzx	eax, ax
	mov	DWORD PTR -208[rbp], eax
	mov	eax, DWORD PTR -208[rbp]
	mov	DWORD PTR -216[rbp], eax
	mov	eax, DWORD PTR -216[rbp]
	mov	DWORD PTR -224[rbp], eax
	movzx	eax, WORD PTR g_fbpixelheight[rip]
	movzx	eax, ax
	mov	DWORD PTR -204[rbp], eax
	mov	eax, DWORD PTR -204[rbp]
	mov	DWORD PTR -212[rbp], eax
	mov	eax, DWORD PTR -212[rbp]
	mov	DWORD PTR -220[rbp], eax
	mov	rsi, QWORD PTR g_window[rip]
	mov	rax, QWORD PTR g_display[rip]
	lea	r8, -32[rbp]
	lea	rcx, -272[rbp]
	lea	rdx, -304[rbp]
	sub	rsp, 8
	push	0
	push	0
	lea	rdi, -240[rbp]
	push	rdi
	mov	r9d, 1
	mov	rdi, rax
	call	XSetWMProperties@PLT
	add	rsp, 32
	mov	rdx, QWORD PTR g_window[rip]
	mov	rax, QWORD PTR g_display[rip]
	mov	rsi, rdx
	mov	rdi, rax
	call	XMapWindow@PLT
	mov	rcx, QWORD PTR g_window[rip]
	mov	rax, QWORD PTR g_display[rip]
	mov	edx, 77
	mov	rsi, rcx
	mov	rdi, rax
	call	XSelectInput@PLT
	mov	DWORD PTR -60[rbp], 0
	mov	rsi, QWORD PTR g_window[rip]
	mov	rax, QWORD PTR g_display[rip]
	lea	rdx, -160[rbp]
	mov	rcx, rdx
	mov	edx, 65536
	mov	rdi, rax
	call	XCreateGC@PLT
	mov	QWORD PTR g_gc[rip], rax
	mov	eax, 0
.L4:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L5
	call	__stack_chk_fail@PLT
.L5:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE6:
	.size	up_x11createframe, .-up_x11createframe
	.type	up_x11errorhandler, @function
up_x11errorhandler:
.LFB7:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	QWORD PTR -8[rbp], rdi
	mov	QWORD PTR -16[rbp], rsi
	mov	DWORD PTR g_xerror[rip], 1
	mov	eax, 0
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE7:
	.size	up_x11errorhandler, .-up_x11errorhandler
	.type	up_x11traperrors, @function
up_x11traperrors:
.LFB8:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	DWORD PTR g_xerror[rip], 0
	lea	rdi, up_x11errorhandler[rip]
	call	XSetErrorHandler@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE8:
	.size	up_x11traperrors, .-up_x11traperrors
	.type	up_x11untraperrors, @function
up_x11untraperrors:
.LFB9:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	rax, QWORD PTR g_display[rip]
	mov	esi, 0
	mov	rdi, rax
	call	XSync@PLT
	mov	edi, 0
	call	XSetErrorHandler@PLT
	mov	eax, DWORD PTR g_xerror[rip]
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE9:
	.size	up_x11untraperrors, .-up_x11untraperrors
	.type	up_x11uninitX, @function
up_x11uninitX:
.LFB10:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	cmp	eax, 4
	jle	.L12
	mov	rax, QWORD PTR g_display[rip]
	lea	rsi, g_xshminfo[rip]
	mov	rdi, rax
	call	XShmDetach@PLT
.L12:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	cmp	eax, 3
	jle	.L13
	mov	rax, QWORD PTR g_xshminfo[rip+16]
	mov	rdi, rax
	call	shmdt@PLT
.L13:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	cmp	eax, 2
	jle	.L14
	mov	eax, DWORD PTR g_xshminfo[rip+8]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmctl@PLT
.L14:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	cmp	eax, 1
	jle	.L15
	mov	rax, QWORD PTR g_image[rip]
	mov	rdx, QWORD PTR 96[rax]
	mov	rax, QWORD PTR g_image[rip]
	mov	rdi, rax
	call	rdx
.L15:
	mov	rax, QWORD PTR g_display[rip]
	mov	rdi, rax
	call	XCloseDisplay@PLT
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE10:
	.size	up_x11uninitX, .-up_x11uninitX
	.type	up_x11uninitialize, @function
up_x11uninitialize:
.LFB11:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	cmp	eax, 1
	jle	.L17
	mov	eax, DWORD PTR b_useshm[rip]
	test	eax, eax
	jne	.L17
	mov	rax, QWORD PTR g_framebuffer[rip]
	test	rax, rax
	je	.L17
	mov	rax, QWORD PTR g_framebuffer[rip]
	mov	rdi, rax
	call	free@PLT
	mov	QWORD PTR g_framebuffer[rip], 0
.L17:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	test	eax, eax
	jle	.L19
	mov	DWORD PTR g_shmcheckpoint[rip], 1
.L19:
	nop
	pop	rbp
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE11:
	.size	up_x11uninitialize, .-up_x11uninitialize
	.section	.rodata
.LC4:
	.string	"Unable to create g_image.\n"
.LC5:
	.string	"Unable to create g_image\n"
	.text
	.type	up_x11mapsharedmem, @function
up_x11mapsharedmem:
.LFB12:
	.cfi_startproc
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	rbx
	sub	rsp, 40
	.cfi_offset 3, -24
	mov	DWORD PTR -36[rbp], edi
	mov	DWORD PTR -40[rbp], esi
	lea	rdi, up_x11uninitX[rip]
	call	atexit@PLT
	mov	DWORD PTR g_shmcheckpoint[rip], 1
	mov	DWORD PTR b_useshm[rip], 0
	mov	rax, QWORD PTR g_display[rip]
	mov	rdi, rax
	call	XShmQueryExtension@PLT
	test	eax, eax
	je	.L21
	mov	DWORD PTR b_useshm[rip], 1
	call	up_x11traperrors
	movzx	eax, WORD PTR g_fbpixelheight[rip]
	movzx	edi, ax
	movzx	eax, WORD PTR g_fbpixelwidth[rip]
	movzx	ecx, ax
	mov	edx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR g_display[rip]
	mov	rsi, QWORD PTR 232[rax]
	mov	eax, DWORD PTR g_screen[rip]
	cdqe
	sal	rax, 7
	add	rax, rsi
	mov	rsi, QWORD PTR 64[rax]
	mov	rax, QWORD PTR g_display[rip]
	push	rdi
	push	rcx
	lea	r9, g_xshminfo[rip]
	mov	r8d, 0
	mov	ecx, 2
	mov	rdi, rax
	call	XShmCreateImage@PLT
	add	rsp, 16
	mov	QWORD PTR g_image[rip], rax
	call	up_x11untraperrors
	test	eax, eax
	je	.L22
	call	up_x11uninitialize
	jmp	.L23
.L22:
	mov	rax, QWORD PTR g_image[rip]
	test	rax, rax
	jne	.L24
	lea	rsi, .LC4[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, -1
	jmp	.L25
.L24:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	add	eax, 1
	mov	DWORD PTR g_shmcheckpoint[rip], eax
	mov	rax, QWORD PTR g_image[rip]
	mov	edx, DWORD PTR 44[rax]
	mov	rax, QWORD PTR g_image[rip]
	mov	eax, DWORD PTR 4[rax]
	imul	eax, edx
	cdqe
	mov	edx, 1023
	mov	rsi, rax
	mov	edi, 0
	call	shmget@PLT
	mov	DWORD PTR g_xshminfo[rip+8], eax
	mov	eax, DWORD PTR g_xshminfo[rip+8]
	test	eax, eax
	jns	.L26
	call	up_x11uninitialize
	jmp	.L23
.L26:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	add	eax, 1
	mov	DWORD PTR g_shmcheckpoint[rip], eax
	mov	eax, DWORD PTR g_xshminfo[rip+8]
	mov	rbx, QWORD PTR g_image[rip]
	mov	edx, 0
	mov	esi, 0
	mov	edi, eax
	call	shmat@PLT
	mov	QWORD PTR 16[rbx], rax
	mov	rax, QWORD PTR g_image[rip]
	mov	rax, QWORD PTR 16[rax]
	cmp	rax, -1
	jne	.L27
	call	up_x11uninitialize
	jmp	.L23
.L27:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	add	eax, 1
	mov	DWORD PTR g_shmcheckpoint[rip], eax
	mov	rax, QWORD PTR g_image[rip]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR g_xshminfo[rip+16], rax
	mov	DWORD PTR g_xshminfo[rip+24], 0
	call	up_x11traperrors
	mov	rax, QWORD PTR g_display[rip]
	lea	rsi, g_xshminfo[rip]
	mov	rdi, rax
	call	XShmAttach@PLT
	mov	DWORD PTR -20[rbp], eax
	call	up_x11untraperrors
	test	eax, eax
	jne	.L28
	cmp	DWORD PTR -20[rbp], 0
	jne	.L29
.L28:
	call	up_x11uninitialize
	jmp	.L23
.L29:
	mov	rax, QWORD PTR g_image[rip]
	mov	rax, QWORD PTR 16[rax]
	mov	QWORD PTR g_framebuffer[rip], rax
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	add	eax, 1
	mov	DWORD PTR g_shmcheckpoint[rip], eax
	jmp	.L30
.L21:
	mov	eax, DWORD PTR b_useshm[rip]
	test	eax, eax
	jne	.L30
	nop
.L23:
	mov	DWORD PTR b_useshm[rip], 0
	mov	eax, DWORD PTR -40[rbp]
	mov	rdi, rax
	call	malloc@PLT
	mov	QWORD PTR g_framebuffer[rip], rax
	movzx	eax, WORD PTR g_fbpixelheight[rip]
	movzx	edi, ax
	movzx	eax, WORD PTR g_fbpixelwidth[rip]
	movzx	ecx, ax
	mov	r8, QWORD PTR g_framebuffer[rip]
	mov	edx, DWORD PTR -36[rbp]
	mov	rax, QWORD PTR g_display[rip]
	mov	rsi, QWORD PTR 232[rax]
	mov	eax, DWORD PTR g_screen[rip]
	cdqe
	sal	rax, 7
	add	rax, rsi
	mov	rsi, QWORD PTR 64[rax]
	mov	rax, QWORD PTR g_display[rip]
	push	0
	push	8
	push	rdi
	push	rcx
	mov	r9, r8
	mov	r8d, 0
	mov	ecx, 2
	mov	rdi, rax
	call	XCreateImage@PLT
	add	rsp, 32
	mov	QWORD PTR g_image[rip], rax
	mov	rax, QWORD PTR g_image[rip]
	test	rax, rax
	jne	.L31
	lea	rsi, .LC5[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, -1
	jmp	.L25
.L31:
	mov	eax, DWORD PTR g_shmcheckpoint[rip]
	add	eax, 1
	mov	DWORD PTR g_shmcheckpoint[rip], eax
.L30:
	mov	eax, 0
.L25:
	mov	rbx, QWORD PTR -8[rbp]
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE12:
	.size	up_x11mapsharedmem, .-up_x11mapsharedmem
	.globl	up_x11initialize
	.type	up_x11initialize, @function
up_x11initialize:
.LFB13:
	.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	eax, esi
	mov	QWORD PTR -176[rbp], rdx
	mov	QWORD PTR -184[rbp], rcx
	mov	QWORD PTR -192[rbp], r8
	mov	QWORD PTR -200[rbp], r9
	mov	edx, edi
	mov	WORD PTR -164[rbp], dx
	mov	WORD PTR -168[rbp], ax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	movzx	eax, WORD PTR -164[rbp]
	mov	WORD PTR g_fbpixelwidth[rip], ax
	movzx	eax, WORD PTR -168[rbp]
	mov	WORD PTR g_fbpixelheight[rip], ax
	call	up_x11createframe
	mov	DWORD PTR -148[rbp], eax
	cmp	DWORD PTR -148[rbp], 0
	jns	.L33
	mov	eax, DWORD PTR -148[rbp]
	jmp	.L36
.L33:
	mov	rax, QWORD PTR g_display[rip]
	mov	rdx, QWORD PTR 232[rax]
	mov	rax, QWORD PTR g_display[rip]
	mov	eax, DWORD PTR 224[rax]
	cdqe
	sal	rax, 7
	add	rax, rdx
	mov	rcx, QWORD PTR 16[rax]
	mov	rax, QWORD PTR g_display[rip]
	lea	rdx, -144[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	XGetWindowAttributes@PLT
	mov	eax, DWORD PTR -124[rbp]
	mov	DWORD PTR -152[rbp], eax
	cmp	DWORD PTR -152[rbp], 24
	jne	.L35
	mov	DWORD PTR -152[rbp], 32
.L35:
	mov	eax, DWORD PTR -152[rbp]
	mov	edx, eax
	mov	rax, QWORD PTR -192[rbp]
	mov	BYTE PTR [rax], dl
	movzx	eax, WORD PTR -164[rbp]
	imul	eax, DWORD PTR -152[rbp]
	lea	edx, 7[rax]
	test	eax, eax
	cmovs	eax, edx
	sar	eax, 3
	mov	edx, eax
	mov	rax, QWORD PTR -200[rbp]
	mov	WORD PTR [rax], dx
	mov	rax, QWORD PTR -200[rbp]
	movzx	eax, WORD PTR [rax]
	movzx	edx, ax
	movzx	eax, WORD PTR -168[rbp]
	imul	eax, edx
	movsx	rdx, eax
	mov	rax, QWORD PTR -184[rbp]
	mov	QWORD PTR [rax], rdx
	mov	rax, QWORD PTR -184[rbp]
	mov	rax, QWORD PTR [rax]
	mov	edx, eax
	mov	eax, DWORD PTR -124[rbp]
	mov	esi, edx
	mov	edi, eax
	call	up_x11mapsharedmem
	mov	rdx, QWORD PTR g_framebuffer[rip]
	mov	rax, QWORD PTR -176[rbp]
	mov	QWORD PTR [rax], rdx
	mov	eax, 0
.L36:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L37
	call	__stack_chk_fail@PLT
.L37:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE13:
	.size	up_x11initialize, .-up_x11initialize
	.section	.rodata
.LC6:
	.string	"Failed to allocate color%d\n"
	.text
	.globl	up_x11cmap
	.type	up_x11cmap, @function
up_x11cmap:
.LFB14:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	sub	rsp, 96
	mov	eax, esi
	mov	QWORD PTR -64[rbp], rdx
	mov	QWORD PTR -72[rbp], rcx
	mov	QWORD PTR -80[rbp], r8
	mov	QWORD PTR -88[rbp], r9
	mov	edx, edi
	mov	WORD PTR -52[rbp], dx
	mov	WORD PTR -56[rbp], ax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -8[rbp], rax
	xor	eax, eax
	mov	rax, QWORD PTR g_display[rip]
	mov	rdx, QWORD PTR 232[rax]
	mov	eax, DWORD PTR g_screen[rip]
	cdqe
	sal	rax, 7
	add	rax, rdx
	mov	rax, QWORD PTR 80[rax]
	mov	QWORD PTR -40[rbp], rax
	movzx	eax, WORD PTR -52[rbp]
	mov	DWORD PTR -44[rbp], eax
	jmp	.L39
.L42:
	mov	rax, QWORD PTR -64[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -64[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	mov	WORD PTR -24[rbp], ax
	mov	rax, QWORD PTR -72[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -72[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	mov	WORD PTR -22[rbp], ax
	mov	rax, QWORD PTR -80[rbp]
	lea	rdx, 1[rax]
	mov	QWORD PTR -80[rbp], rdx
	movzx	eax, BYTE PTR [rax]
	movzx	eax, al
	sal	eax, 8
	mov	WORD PTR -20[rbp], ax
	mov	BYTE PTR -18[rbp], 7
	mov	rax, QWORD PTR g_display[rip]
	lea	rdx, -32[rbp]
	mov	rcx, QWORD PTR -40[rbp]
	mov	rsi, rcx
	mov	rdi, rax
	call	XAllocColor@PLT
	test	eax, eax
	jne	.L40
	mov	eax, DWORD PTR -44[rbp]
	mov	edx, eax
	lea	rsi, .LC6[rip]
	mov	edi, 3
	mov	eax, 0
	call	syslog@PLT
	mov	eax, -1
	jmp	.L41
.L40:
	add	DWORD PTR -44[rbp], 1
.L39:
	movzx	edx, WORD PTR -52[rbp]
	movzx	eax, WORD PTR -56[rbp]
	add	eax, edx
	cmp	DWORD PTR -44[rbp], eax
	jl	.L42
	mov	eax, 0
.L41:
	mov	rcx, QWORD PTR -8[rbp]
	sub	rcx, QWORD PTR fs:40
	je	.L43
	call	__stack_chk_fail@PLT
.L43:
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE14:
	.size	up_x11cmap, .-up_x11cmap
	.globl	up_x11update
	.type	up_x11update, @function
up_x11update:
.LFB15:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	mov	eax, DWORD PTR b_useshm[rip]
	test	eax, eax
	je	.L45
	movzx	eax, WORD PTR g_fbpixelheight[rip]
	movzx	r8d, ax
	movzx	eax, WORD PTR g_fbpixelwidth[rip]
	movzx	edi, ax
	mov	rcx, QWORD PTR g_image[rip]
	mov	rdx, QWORD PTR g_gc[rip]
	mov	rsi, QWORD PTR g_window[rip]
	mov	rax, QWORD PTR g_display[rip]
	sub	rsp, 8
	push	0
	push	r8
	push	rdi
	push	0
	push	0
	mov	r9d, 0
	mov	r8d, 0
	mov	rdi, rax
	call	XShmPutImage@PLT
	add	rsp, 48
	jmp	.L46
.L45:
	movzx	eax, WORD PTR g_fbpixelheight[rip]
	movzx	r8d, ax
	movzx	eax, WORD PTR g_fbpixelwidth[rip]
	movzx	edi, ax
	mov	rcx, QWORD PTR g_image[rip]
	mov	rdx, QWORD PTR g_gc[rip]
	mov	rsi, QWORD PTR g_window[rip]
	mov	rax, QWORD PTR g_display[rip]
	push	r8
	push	rdi
	push	0
	push	0
	mov	r9d, 0
	mov	r8d, 0
	mov	rdi, rax
	call	XPutImage@PLT
	add	rsp, 32
.L46:
	mov	rax, QWORD PTR g_display[rip]
	mov	esi, 0
	mov	rdi, rax
	call	XSync@PLT
	nop
	leave
	.cfi_def_cfa 7, 8
	ret
	.cfi_endproc
.LFE15:
	.size	up_x11update, .-up_x11update
	.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	"522714.c"
	.text
	.comm	g_display,4,4
	.local	g_screen
	.comm	g_screen,4,4
	.local	g_window
	.comm	g_window,4,4
	.local	g_gc
	.comm	g_gc,4,4
	.local	g_xshminfo
	.comm	g_xshminfo,16,4
	.local	g_xerror
	.comm	g_xerror,4,4
	.local	g_image
	.comm	g_image,4,4
	.local	g_framebuffer
	.comm	g_framebuffer,4,4
	.local	g_fbpixelwidth
	.comm	g_fbpixelwidth,2,2
	.local	g_fbpixelheight
	.comm	g_fbpixelheight,2,2
	.local	g_shmcheckpoint
	.comm	g_shmcheckpoint,4,4
	.local	b_useshm
	.comm	b_useshm,4,4
	.section	.rodata
	.align	2
.LC0:
	.ascii	"nuttx\000"
	.align	2
.LC1:
	.ascii	"NuttX\000"
	.align	2
.LC2:
	.ascii	"NX\000"
	.align	2
.LC3:
	.ascii	"Unable to open display.\012\000"
	.align	2
.LC4:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11createframe, %function
up_x11createframe:
	@ args = 0, pretend = 0, frame = 216
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, fp, lr}
	add	fp, sp, #12
	sub	sp, sp, #240
	ldr	r3, .L6
	ldr	r3, [r3]
	str	r3, [fp, #-16]
	mov	r3,#0
	ldr	r3, .L6+4
	str	r3, [fp, #-24]
	mov	r3, #0
	str	r3, [fp, #-20]
	ldr	r3, .L6+8
	str	r3, [fp, #-228]
	ldr	r3, .L6+12
	str	r3, [fp, #-224]
	mov	r0, #0
	bl	XOpenDisplay
	mov	r3, r0
	ldr	r2, .L6+16
	str	r3, [r2]
	ldr	r3, .L6+16
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L2
	ldr	r1, .L6+20
	mov	r0, #3
	bl	syslog
	mvn	r3, #0
	b	.L4
.L2:
	ldr	r3, .L6+16
	ldr	r3, [r3]
	ldr	r3, [r3, #132]
	ldr	r2, .L6+24
	str	r3, [r2]
	ldr	r3, .L6+16
	ldr	r0, [r3]
	ldr	r3, .L6+16
	ldr	r3, [r3]
	ldr	r2, [r3, #140]
	ldr	r3, .L6+16
	ldr	r3, [r3]
	ldr	r3, [r3, #132]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	ip, [r3, #8]
	ldr	r3, .L6+28
	ldrh	r3, [r3]
	mov	r4, r3
	ldr	r3, .L6+32
	ldrh	r3, [r3]
	mov	r5, r3
	ldr	r3, .L6+16
	ldr	r3, [r3]
	ldr	r2, [r3, #140]
	ldr	r3, .L6+24
	ldr	r3, [r3]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r2, [r3, #56]
	ldr	r3, .L6+16
	ldr	r3, [r3]
	ldr	r1, [r3, #140]
	ldr	r3, .L6+24
	ldr	r3, [r3]
	mov	lr, r3
	mov	r3, lr
	lsl	r3, r3, #2
	add	r3, r3, lr
	lsl	r3, r3, #4
	add	r3, r1, r3
	ldr	r3, [r3, #56]
	str	r3, [sp, #16]
	str	r2, [sp, #12]
	mov	r3, #2
	str	r3, [sp, #8]
	str	r5, [sp, #4]
	str	r4, [sp]
	mov	r3, #0
	mov	r2, #0
	mov	r1, ip
	bl	XCreateSimpleWindow
	mov	r3, r0
	ldr	r2, .L6+36
	str	r3, [r2]
	sub	r2, fp, #220
	sub	r3, fp, #228
	mov	r1, #1
	mov	r0, r3
	bl	XStringListToTextProperty
	sub	r2, fp, #204
	sub	r3, fp, #224
	mov	r1, #1
	mov	r0, r3
	bl	XStringListToTextProperty
	mov	r3, #56
	str	r3, [fp, #-188]
	ldr	r3, .L6+28
	ldrh	r3, [r3]
	str	r3, [fp, #-160]
	ldr	r3, [fp, #-160]
	str	r3, [fp, #-168]
	ldr	r3, [fp, #-168]
	str	r3, [fp, #-176]
	ldr	r3, .L6+32
	ldrh	r3, [r3]
	str	r3, [fp, #-156]
	ldr	r3, [fp, #-156]
	str	r3, [fp, #-164]
	ldr	r3, [fp, #-164]
	str	r3, [fp, #-172]
	ldr	r3, .L6+16
	ldr	r0, [r3]
	ldr	r3, .L6+36
	ldr	r1, [r3]
	sub	ip, fp, #204
	sub	r2, fp, #220
	mov	r3, #0
	str	r3, [sp, #16]
	mov	r3, #0
	str	r3, [sp, #12]
	sub	r3, fp, #188
	str	r3, [sp, #8]
	mov	r3, #1
	str	r3, [sp, #4]
	sub	r3, fp, #24
	str	r3, [sp]
	mov	r3, ip
	bl	XSetWMProperties
	ldr	r3, .L6+16
	ldr	r3, [r3]
	ldr	r2, .L6+36
	ldr	r2, [r2]
	mov	r1, r2
	mov	r0, r3
	bl	XMapWindow
	ldr	r3, .L6+16
	ldr	r3, [r3]
	ldr	r2, .L6+36
	ldr	r1, [r2]
	mov	r2, #77
	mov	r0, r3
	bl	XSelectInput
	mov	r3, #0
	str	r3, [fp, #-48]
	ldr	r3, .L6+16
	ldr	r0, [r3]
	ldr	r3, .L6+36
	ldr	r1, [r3]
	sub	r3, fp, #116
	mov	r2, #65536
	bl	XCreateGC
	mov	r3, r0
	ldr	r2, .L6+40
	str	r3, [r2]
	mov	r3, #0
.L4:
	ldr	r2, .L6
	ldr	r1, [r2]
	ldr	r2, [fp, #-16]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L5
	bl	__stack_chk_fail
.L5:
	mov	r0, r3
	sub	sp, fp, #12
	@ sp needed
	pop	{r4, r5, fp, pc}
.L7:
	.align	2
.L6:
	.word	.LC4
	.word	.LC0
	.word	.LC1
	.word	.LC2
	.word	g_display
	.word	.LC3
	.word	g_screen
	.word	g_fbpixelwidth
	.word	g_fbpixelheight
	.word	g_window
	.word	g_gc
	.size	up_x11createframe, .-up_x11createframe
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11errorhandler, %function
up_x11errorhandler:
	@ args = 0, pretend = 0, frame = 8
	@ frame_needed = 1, uses_anonymous_args = 0
	@ link register save eliminated.
	str	fp, [sp, #-4]!
	add	fp, sp, #0
	sub	sp, sp, #12
	str	r0, [fp, #-8]
	str	r1, [fp, #-12]
	ldr	r3, .L10
	mov	r2, #1
	str	r2, [r3]
	mov	r3, #0
	mov	r0, r3
	add	sp, fp, #0
	@ sp needed
	ldr	fp, [sp], #4
	bx	lr
.L11:
	.align	2
.L10:
	.word	g_xerror
	.size	up_x11errorhandler, .-up_x11errorhandler
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11traperrors, %function
up_x11traperrors:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L13
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, .L13+4
	bl	XSetErrorHandler
	nop
	pop	{fp, pc}
.L14:
	.align	2
.L13:
	.word	g_xerror
	.word	up_x11errorhandler
	.size	up_x11traperrors, .-up_x11traperrors
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11untraperrors, %function
up_x11untraperrors:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L17
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	XSync
	mov	r0, #0
	bl	XSetErrorHandler
	ldr	r3, .L17+4
	ldr	r3, [r3]
	mov	r0, r3
	pop	{fp, pc}
.L18:
	.align	2
.L17:
	.word	g_display
	.word	g_xerror
	.size	up_x11untraperrors, .-up_x11untraperrors
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11uninitX, %function
up_x11uninitX:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L24
	ldr	r3, [r3]
	cmp	r3, #4
	ble	.L20
	ldr	r3, .L24+4
	ldr	r3, [r3]
	ldr	r1, .L24+8
	mov	r0, r3
	bl	XShmDetach
.L20:
	ldr	r3, .L24
	ldr	r3, [r3]
	cmp	r3, #3
	ble	.L21
	ldr	r3, .L24+8
	ldr	r3, [r3, #8]
	mov	r0, r3
	bl	shmdt
.L21:
	ldr	r3, .L24
	ldr	r3, [r3]
	cmp	r3, #2
	ble	.L22
	ldr	r3, .L24+8
	ldr	r3, [r3, #4]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmctl
.L22:
	ldr	r3, .L24
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L23
	ldr	r3, .L24+12
	ldr	r3, [r3]
	ldr	r3, [r3, #68]
	ldr	r2, .L24+12
	ldr	r2, [r2]
	mov	r0, r2
	blx	r3
.L23:
	ldr	r3, .L24+4
	ldr	r3, [r3]
	mov	r0, r3
	bl	XCloseDisplay
	nop
	pop	{fp, pc}
.L25:
	.align	2
.L24:
	.word	g_shmcheckpoint
	.word	g_display
	.word	g_xshminfo
	.word	g_image
	.size	up_x11uninitX, .-up_x11uninitX
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11uninitialize, %function
up_x11uninitialize:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	ldr	r3, .L30
	ldr	r3, [r3]
	cmp	r3, #1
	ble	.L27
	ldr	r3, .L30+4
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L27
	ldr	r3, .L30+8
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L27
	ldr	r3, .L30+8
	ldr	r3, [r3]
	mov	r0, r3
	bl	free
	ldr	r3, .L30+8
	mov	r2, #0
	str	r2, [r3]
.L27:
	ldr	r3, .L30
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L29
	ldr	r3, .L30
	mov	r2, #1
	str	r2, [r3]
.L29:
	nop
	pop	{fp, pc}
.L31:
	.align	2
.L30:
	.word	g_shmcheckpoint
	.word	b_useshm
	.word	g_framebuffer
	.size	up_x11uninitialize, .-up_x11uninitialize
	.section	.rodata
	.align	2
.LC5:
	.ascii	"Unable to create g_image.\012\000"
	.align	2
.LC6:
	.ascii	"Unable to create g_image\012\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11mapsharedmem, %function
up_x11mapsharedmem:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #44
	str	r0, [fp, #-24]
	str	r1, [fp, #-28]
	ldr	r0, .L44
	bl	atexit
	ldr	r3, .L44+4
	mov	r2, #1
	str	r2, [r3]
	ldr	r3, .L44+8
	mov	r2, #0
	str	r2, [r3]
	ldr	r3, .L44+12
	ldr	r3, [r3]
	mov	r0, r3
	bl	XShmQueryExtension
	mov	r3, r0
	cmp	r3, #0
	beq	.L33
	ldr	r3, .L44+8
	mov	r2, #1
	str	r2, [r3]
	bl	up_x11traperrors
	ldr	r3, .L44+12
	ldr	r0, [r3]
	ldr	r3, .L44+12
	ldr	r3, [r3]
	ldr	r2, [r3, #140]
	ldr	r3, .L44+16
	ldr	r3, [r3]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r1, [r3, #40]
	ldr	r2, [fp, #-24]
	ldr	r3, .L44+20
	ldrh	r3, [r3]
	mov	ip, r3
	ldr	r3, .L44+24
	ldrh	r3, [r3]
	str	r3, [sp, #12]
	str	ip, [sp, #8]
	ldr	r3, .L44+28
	str	r3, [sp, #4]
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #2
	bl	XShmCreateImage
	mov	r3, r0
	ldr	r2, .L44+32
	str	r3, [r2]
	bl	up_x11untraperrors
	mov	r3, r0
	cmp	r3, #0
	beq	.L34
	bl	up_x11uninitialize
	b	.L35
.L34:
	ldr	r3, .L44+32
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L36
	ldr	r1, .L44+36
	mov	r0, #3
	bl	syslog
	mvn	r3, #0
	b	.L37
.L36:
	ldr	r3, .L44+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L44+4
	str	r3, [r2]
	ldr	r3, .L44+32
	ldr	r3, [r3]
	ldr	r3, [r3, #40]
	ldr	r2, .L44+32
	ldr	r2, [r2]
	ldr	r2, [r2, #4]
	mul	r3, r2, r3
	ldr	r2, .L44+40
	mov	r1, r3
	mov	r0, #0
	bl	shmget
	mov	r3, r0
	ldr	r2, .L44+28
	str	r3, [r2, #4]
	ldr	r3, .L44+28
	ldr	r3, [r3, #4]
	cmp	r3, #0
	bge	.L38
	bl	up_x11uninitialize
	b	.L35
.L38:
	ldr	r3, .L44+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L44+4
	str	r3, [r2]
	ldr	r3, .L44+28
	ldr	r3, [r3, #4]
	ldr	r2, .L44+32
	ldr	r4, [r2]
	mov	r2, #0
	mov	r1, #0
	mov	r0, r3
	bl	shmat
	mov	r3, r0
	str	r3, [r4, #16]
	ldr	r3, .L44+32
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	cmn	r3, #1
	bne	.L39
	bl	up_x11uninitialize
	b	.L35
.L39:
	ldr	r3, .L44+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L44+4
	str	r3, [r2]
	ldr	r3, .L44+32
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	ldr	r2, .L44+28
	str	r3, [r2, #8]
	ldr	r3, .L44+28
	mov	r2, #0
	str	r2, [r3, #12]
	bl	up_x11traperrors
	ldr	r3, .L44+12
	ldr	r3, [r3]
	ldr	r1, .L44+28
	mov	r0, r3
	bl	XShmAttach
	str	r0, [fp, #-16]
	bl	up_x11untraperrors
	mov	r3, r0
	cmp	r3, #0
	bne	.L40
	ldr	r3, [fp, #-16]
	cmp	r3, #0
	bne	.L41
.L40:
	bl	up_x11uninitialize
	b	.L35
.L41:
	ldr	r3, .L44+32
	ldr	r3, [r3]
	ldr	r3, [r3, #16]
	ldr	r2, .L44+44
	str	r3, [r2]
	ldr	r3, .L44+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L44+4
	str	r3, [r2]
	b	.L42
.L33:
	ldr	r3, .L44+8
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L42
	nop
.L35:
	ldr	r3, .L44+8
	mov	r2, #0
	str	r2, [r3]
	ldr	r0, [fp, #-28]
	bl	malloc
	mov	r3, r0
	mov	r2, r3
	ldr	r3, .L44+44
	str	r2, [r3]
	ldr	r3, .L44+12
	ldr	r0, [r3]
	ldr	r3, .L44+12
	ldr	r3, [r3]
	ldr	r2, [r3, #140]
	ldr	r3, .L44+16
	ldr	r3, [r3]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r1, [r3, #40]
	ldr	r2, [fp, #-24]
	ldr	r3, .L44+44
	ldr	r3, [r3]
	ldr	ip, .L44+20
	ldrh	ip, [ip]
	mov	lr, ip
	ldr	ip, .L44+24
	ldrh	ip, [ip]
	mov	r4, ip
	mov	ip, #0
	str	ip, [sp, #20]
	mov	ip, #8
	str	ip, [sp, #16]
	str	r4, [sp, #12]
	str	lr, [sp, #8]
	str	r3, [sp, #4]
	mov	r3, #0
	str	r3, [sp]
	mov	r3, #2
	bl	XCreateImage
	mov	r3, r0
	ldr	r2, .L44+32
	str	r3, [r2]
	ldr	r3, .L44+32
	ldr	r3, [r3]
	cmp	r3, #0
	bne	.L43
	ldr	r1, .L44+48
	mov	r0, #3
	bl	syslog
	mvn	r3, #0
	b	.L37
.L43:
	ldr	r3, .L44+4
	ldr	r3, [r3]
	add	r3, r3, #1
	ldr	r2, .L44+4
	str	r3, [r2]
.L42:
	mov	r3, #0
.L37:
	mov	r0, r3
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L45:
	.align	2
.L44:
	.word	up_x11uninitX
	.word	g_shmcheckpoint
	.word	b_useshm
	.word	g_display
	.word	g_screen
	.word	g_fbpixelwidth
	.word	g_fbpixelheight
	.word	g_xshminfo
	.word	g_image
	.word	.LC5
	.word	1023
	.word	g_framebuffer
	.word	.LC6
	.size	up_x11mapsharedmem, .-up_x11mapsharedmem
	.section	.rodata
	.align	2
.LC7:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	up_x11initialize
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11initialize, %function
up_x11initialize:
	@ args = 8, pretend = 0, frame = 128
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #128
	str	r2, [fp, #-116]
	str	r3, [fp, #-120]
	mov	r3, r0	@ movhi
	strh	r3, [fp, #-110]	@ movhi
	mov	r3, r1	@ movhi
	strh	r3, [fp, #-112]	@ movhi
	ldr	r3, [fp, #4]
	str	r3, [fp, #-124]
	ldr	r3, [fp, #8]
	str	r3, [fp, #-128]
	ldr	r3, .L52
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r2, .L52+4
	ldrh	r3, [fp, #-110]	@ movhi
	strh	r3, [r2]	@ movhi
	ldr	r2, .L52+8
	ldrh	r3, [fp, #-112]	@ movhi
	strh	r3, [r2]	@ movhi
	bl	up_x11createframe
	str	r0, [fp, #-104]
	ldr	r3, [fp, #-104]
	cmp	r3, #0
	bge	.L47
	ldr	r3, [fp, #-104]
	b	.L50
.L47:
	ldr	r3, .L52+12
	ldr	r0, [r3]
	ldr	r3, .L52+12
	ldr	r3, [r3]
	ldr	r2, [r3, #140]
	ldr	r3, .L52+12
	ldr	r3, [r3]
	ldr	r3, [r3, #132]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #8]
	sub	r2, fp, #100
	mov	r1, r3
	bl	XGetWindowAttributes
	ldr	r3, [fp, #-80]
	str	r3, [fp, #-108]
	ldr	r3, [fp, #-108]
	cmp	r3, #24
	bne	.L49
	mov	r3, #32
	str	r3, [fp, #-108]
.L49:
	ldr	r3, [fp, #-108]
	and	r2, r3, #255
	ldr	r3, [fp, #-124]
	strb	r2, [r3]
	ldrh	r3, [fp, #-110]
	ldr	r2, [fp, #-108]
	mul	r3, r2, r3
	add	r2, r3, #7
	cmp	r3, #0
	movlt	r3, r2
	movge	r3, r3
	asr	r3, r3, #3
	lsl	r3, r3, #16
	lsr	r2, r3, #16
	ldr	r3, [fp, #-128]
	strh	r2, [r3]	@ movhi
	ldr	r3, [fp, #-128]
	ldrh	r3, [r3]
	mov	r2, r3
	ldrh	r3, [fp, #-112]
	mul	r3, r2, r3
	mov	r2, r3
	ldr	r3, [fp, #-120]
	str	r2, [r3]
	ldr	r2, [fp, #-80]
	ldr	r3, [fp, #-120]
	ldr	r3, [r3]
	mov	r1, r3
	mov	r0, r2
	bl	up_x11mapsharedmem
	ldr	r3, .L52+16
	ldr	r2, [r3]
	ldr	r3, [fp, #-116]
	str	r2, [r3]
	mov	r3, #0
.L50:
	ldr	r2, .L52
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L51
	bl	__stack_chk_fail
.L51:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L53:
	.align	2
.L52:
	.word	.LC7
	.word	g_fbpixelwidth
	.word	g_fbpixelheight
	.word	g_display
	.word	g_framebuffer
	.size	up_x11initialize, .-up_x11initialize
	.section	.rodata
	.align	2
.LC8:
	.ascii	"Failed to allocate color%d\012\000"
	.align	2
.LC9:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	up_x11cmap
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11cmap, %function
up_x11cmap:
	@ args = 8, pretend = 0, frame = 48
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{fp, lr}
	add	fp, sp, #4
	sub	sp, sp, #48
	str	r2, [fp, #-36]
	str	r3, [fp, #-40]
	mov	r3, r0	@ movhi
	strh	r3, [fp, #-30]	@ movhi
	mov	r3, r1	@ movhi
	strh	r3, [fp, #-32]	@ movhi
	ldr	r3, [fp, #4]
	str	r3, [fp, #-44]
	ldr	r3, [fp, #8]
	str	r3, [fp, #-48]
	ldr	r3, .L60
	ldr	r3, [r3]
	str	r3, [fp, #-8]
	mov	r3,#0
	ldr	r3, .L60+4
	ldr	r3, [r3]
	ldr	r2, [r3, #140]
	ldr	r3, .L60+8
	ldr	r3, [r3]
	mov	r1, r3
	mov	r3, r1
	lsl	r3, r3, #2
	add	r3, r3, r1
	lsl	r3, r3, #4
	add	r3, r2, r3
	ldr	r3, [r3, #48]
	str	r3, [fp, #-24]
	ldrh	r3, [fp, #-30]
	str	r3, [fp, #-28]
	b	.L55
.L58:
	ldr	r3, [fp, #-36]
	add	r2, r3, #1
	str	r2, [fp, #-36]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strh	r3, [fp, #-16]	@ movhi
	ldr	r3, [fp, #-40]
	add	r2, r3, #1
	str	r2, [fp, #-40]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strh	r3, [fp, #-14]	@ movhi
	ldr	r3, [fp, #-44]
	add	r2, r3, #1
	str	r2, [fp, #-44]
	ldrb	r3, [r3]	@ zero_extendqisi2
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	lsl	r3, r3, #8
	lsl	r3, r3, #16
	lsr	r3, r3, #16
	strh	r3, [fp, #-12]	@ movhi
	mov	r3, #7
	strb	r3, [fp, #-10]
	ldr	r3, .L60+4
	ldr	r3, [r3]
	sub	r2, fp, #20
	ldr	r1, [fp, #-24]
	mov	r0, r3
	bl	XAllocColor
	mov	r3, r0
	cmp	r3, #0
	bne	.L56
	ldr	r2, [fp, #-28]
	ldr	r1, .L60+12
	mov	r0, #3
	bl	syslog
	mvn	r3, #0
	b	.L57
.L56:
	ldr	r3, [fp, #-28]
	add	r3, r3, #1
	str	r3, [fp, #-28]
.L55:
	ldrh	r2, [fp, #-30]
	ldrh	r3, [fp, #-32]
	add	r3, r2, r3
	ldr	r2, [fp, #-28]
	cmp	r2, r3
	blt	.L58
	mov	r3, #0
.L57:
	ldr	r2, .L60
	ldr	r1, [r2]
	ldr	r2, [fp, #-8]
	eors	r1, r2, r1
	mov	r2, #0
	beq	.L59
	bl	__stack_chk_fail
.L59:
	mov	r0, r3
	sub	sp, fp, #4
	@ sp needed
	pop	{fp, pc}
.L61:
	.align	2
.L60:
	.word	.LC9
	.word	g_display
	.word	g_screen
	.word	.LC8
	.size	up_x11cmap, .-up_x11cmap
	.align	2
	.global	up_x11update
	.syntax unified
	.arm
	.fpu softvfp
	.type	up_x11update, %function
up_x11update:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, fp, lr}
	add	fp, sp, #8
	sub	sp, sp, #36
	ldr	r3, .L65
	ldr	r3, [r3]
	cmp	r3, #0
	beq	.L63
	ldr	r3, .L65+4
	ldr	r0, [r3]
	ldr	r3, .L65+8
	ldr	r1, [r3]
	ldr	r3, .L65+12
	ldr	r2, [r3]
	ldr	r3, .L65+16
	ldr	r3, [r3]
	ldr	ip, .L65+20
	ldrh	ip, [ip]
	mov	lr, ip
	ldr	ip, .L65+24
	ldrh	ip, [ip]
	mov	r4, ip
	mov	ip, #0
	str	ip, [sp, #24]
	str	r4, [sp, #20]
	str	lr, [sp, #16]
	mov	ip, #0
	str	ip, [sp, #12]
	mov	ip, #0
	str	ip, [sp, #8]
	mov	ip, #0
	str	ip, [sp, #4]
	mov	ip, #0
	str	ip, [sp]
	bl	XShmPutImage
	b	.L64
.L63:
	ldr	r3, .L65+4
	ldr	r0, [r3]
	ldr	r3, .L65+8
	ldr	r1, [r3]
	ldr	r3, .L65+12
	ldr	r2, [r3]
	ldr	r3, .L65+16
	ldr	r3, [r3]
	ldr	ip, .L65+20
	ldrh	ip, [ip]
	mov	lr, ip
	ldr	ip, .L65+24
	ldrh	ip, [ip]
	str	ip, [sp, #20]
	str	lr, [sp, #16]
	mov	ip, #0
	str	ip, [sp, #12]
	mov	ip, #0
	str	ip, [sp, #8]
	mov	ip, #0
	str	ip, [sp, #4]
	mov	ip, #0
	str	ip, [sp]
	bl	XPutImage
.L64:
	ldr	r3, .L65+4
	ldr	r3, [r3]
	mov	r1, #0
	mov	r0, r3
	bl	XSync
	nop
	sub	sp, fp, #8
	@ sp needed
	pop	{r4, fp, pc}
.L66:
	.align	2
.L65:
	.word	b_useshm
	.word	g_display
	.word	g_window
	.word	g_gc
	.word	g_image
	.word	g_fbpixelwidth
	.word	g_fbpixelheight
	.size	up_x11update, .-up_x11update
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
