// File: /workspace/github_c_makefile_star2_O1/kaiserschmarrn0[P]mywm/mywm.c
// Function: main
int main(void) {
	signal(SIGINT, catch);
	signal(SIGTERM, catch);

	dpy = XOpenDisplay(0);
	conn = XGetXCBConnection(dpy);
	XSetEventQueueOwner(dpy, XCBOwnsEventQueue);
	scr = xcb_setup_roots_iterator(xcb_get_setup(conn)).data;

	XVisualInfo xv, *res = NULL;
	xv.depth = 32;
	int flag = 0;
	res = XGetVisualInfo(dpy, VisualDepthMask, &xv, &flag);
	if (flag > 0) {
		vis_ptr = res->visual;
		vis = res->visualid;
	} else {
		vis_ptr = DefaultVisual(dpy, 0);
		vis = scr->root_visual;
	}

	cm = xcb_generate_id(conn);
	xcb_create_colormap(conn, XCB_COLORMAP_ALLOC_NONE, cm, scr->root, vis);

	depth = (vis == scr->root_visual) ? XCB_COPY_FROM_PARENT : 32;

	for (int i = 0; i < LEN(fonts); i++) {
		xfts[i] = XftFontOpenName(dpy, 0, fonts[i]);
	}

	for (int i = 0; i < LEN(controls); i++) {
		for (int j = 0; j < PM_COUNT; j++) {
			pixmaps[i][j] = xcb_generate_id(conn);
			xcb_create_pixmap(conn, depth, pixmaps[i][j], scr->root,
					controls[i].geom.width, controls[i].geom.height);

			int w = controls[i].geom.width;
			int h = controls[i].geom.height;

			xcb_gcontext_t gc = xcb_generate_id(conn);
			uint32_t mask = XCB_GC_FOREGROUND | XCB_GC_GRAPHICS_EXPOSURES;
			uint32_t vals[2];
			vals[0] = controls[i].colors[PM_BG(j)];
			vals[1] = 0;
			xcb_create_gc(conn, gc, pixmaps[i][j], mask, vals);

			xcb_rectangle_t rect = { 0, 0, w, h };
			xcb_poly_fill_rectangle_checked(conn, pixmaps[i][j], gc, 1, &rect);

			xcb_free_gc(conn, gc);

			XftFont *font = xfts[controls[i].font_index];
			char *icon = controls[i].shape_fg;
			int len = strlen(icon);

			XGlyphInfo ret;
			XftTextExtentsUtf8(dpy, font, (XftChar8 *)icon, len, &ret);
			int x = (w - ret.width) / 2;
			int y = (controls[i].geom.height + font->ascent - font->descent) / 2;

			XftDraw *draw = XftDrawCreate(dpy, pixmaps[i][j], vis_ptr, cm);
			XftColor fg = xft_color(controls[i].colors[PM_FG(j)]);

			XftDrawStringUtf8(draw, &fg, font, x, y, (XftChar8 *)icon, len);
		}
	}

	uint32_t mask = XCB_CW_EVENT_MASK;
	uint32_t val = XCB_EVENT_MASK_POINTER_MOTION | XCB_EVENT_MASK_SUBSTRUCTURE_NOTIFY | XCB_EVENT_MASK_SUBSTRUCTURE_REDIRECT;

	xcb_change_window_attributes(conn, scr->root, mask, &val);
	xcb_flush(conn);
	
	const xcb_query_extension_reply_t *shape_reply = xcb_get_extension_data(conn, &xcb_shape_id);
	if (!shape_reply->present) {
		fprintf(stderr, "x server doesn't have xshape\n");
		return 1;
	}

	ewmh = calloc(1, sizeof(xcb_ewmh_connection_t));
	if (!ewmh) {
		fprintf(stderr, "couldn't allocate ewmh connection\n");
		return 1;
	}
	xcb_ewmh_init_atoms_replies(ewmh, xcb_ewmh_init_atoms(conn, ewmh), (void *)0);

	const char *wm_atom_name[3]; 
	wm_atom_name[0] = "WM_PROTOCOLS";
	wm_atom_name[1] = "WM_DELETE_WINDOW";
	wm_atom_name[2] = "WM_STATE";
	get_atoms(wm_atom_name, wm_atoms, WM_COUNT);

	const char *net_atom_name[1];
	net_atom_name[0] = "_NET_WM_STATE_FOCUSED";
	get_atoms(net_atom_name, &ewmh__NET_WM_STATE_FOCUSED, 0);

	xcb_atom_t supported_atoms[] = {
		ewmh->_NET_SUPPORTED,
		ewmh->_NET_WM_STATE,
		ewmh->_NET_WM_STATE_FULLSCREEN,
		ewmh->_NET_WM_STATE_STICKY,
		ewmh->_NET_WM_STATE_ABOVE,
		ewmh->_NET_WM_STATE_HIDDEN,
		ewmh->_NET_WM_WINDOW_TYPE,
		ewmh->_NET_WM_WINDOW_TYPE_DOCK,
		ewmh->_NET_FRAME_EXTENTS,

		ewmh__NET_WM_STATE_FOCUSED,

		wm_atoms[WM_PROTOCOLS],
		wm_atoms[WM_DELETE_WINDOW],
		wm_atoms[WM_STATE],
	};

	xcb_ewmh_set_supported(ewmh, 0, LEN(supported_atoms), supported_atoms);
	xcb_ewmh_set_wm_name(ewmh, scr->root, 4, "mywm");
	
	mask = XCB_EVENT_MASK_BUTTON_PRESS | XCB_EVENT_MASK_BUTTON_RELEASE;
	for (int i = 0; i < LEN(grab_buttons); i++) {
		xcb_grab_button(conn, 0, scr->root, mask, XCB_GRAB_MODE_ASYNC, XCB_GRAB_MODE_ASYNC,
				scr->root, XCB_NONE, grab_buttons[i].button, grab_buttons[i].mod);
	}

	grab_keys();

	for (int i = 0; i < XCB_NO_OPERATION; i++) events[i] = NULL;

	events[XCB_BUTTON_PRESS]      = button_press;
	events[XCB_CLIENT_MESSAGE]    = client_message;
	events[XCB_CONFIGURE_REQUEST] = configure_request;
	events[XCB_KEY_PRESS]         = key_press;
	events[XCB_KEY_RELEASE]       = key_release;
	events[XCB_MAP_REQUEST]       = map_request;
	events[XCB_UNMAP_NOTIFY]      = unmap_notify;
	events[XCB_DESTROY_NOTIFY]    = destroy_notify;
	events[XCB_ENTER_NOTIFY]      = enter_notify;
	events[XCB_LEAVE_NOTIFY]      = leave_notify;
	events[XCB_MAPPING_NOTIFY]    = mapping_notify;
	events[XCB_EXPOSE]            = expose;
	events[XCB_FOCUS_IN]          = focus_in;

	keysyms = xcb_key_symbols_alloc(conn);

#ifdef ROUNDED
	init_rounded_corners();
#endif
	
	create_snap_regions();
	create_margins();
	cursor_init();
	
	xcb_query_tree_reply_t *tr_reply = xcb_query_tree_reply(conn,
			xcb_query_tree(conn, scr->root), 0);

	stack[0].fwin = NULL;
	stack[1].fwin = NULL;
	stack[2].fwin = NULL;
	stack[3].fwin = NULL;

#ifdef PICKUP
	int ch_len = xcb_query_tree_children_length(tr_reply);
	xcb_window_t *children = xcb_query_tree_children(tr_reply);

	for (int i = 0; i < ch_len; i++) {
		xcb_get_window_attributes_reply_t *attr = xcb_get_window_attributes_reply(conn,
				xcb_get_window_attributes_unchecked(conn, children[i]), NULL);

		if (!attr || attr->override_redirect || attr->map_state != XCB_MAP_STATE_VIEWABLE) {
			continue;
		}

		create_window_existing(children[i]);
	}

	free(tr_reply);
#endif

	struct pollfd fd;
	fd.fd = xcb_get_file_descriptor(conn);
	fd.events = POLLIN;

	xcb_flush(conn);
	for (; !xcb_connection_has_error(conn) && sigcode == 0;) {
		if (poll(&fd, 1, -1) == -1) {
			break;
		}

		xcb_generic_event_t *ev;
		while((ev = xcb_poll_for_event(conn))) {
			if (ev->response_type == 0) {
				xcb_generic_error_t *error = (xcb_generic_error_t *) ev;
				printf("mywm: error:\n\terror_code: %d\n\tmajor_code: "
						"%d\n\tminor_code: %d\n", error->error_code,
						error->major_code, error->minor_code);
			}
	
			if (events[ev->response_type & ~0x80]) {
				events[ev->response_type & ~0x80](ev);
			}
			free(ev);
			
			xcb_flush(conn);
		}
	}

	die();

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xe8, %rsp
leaq 0x7ba(%rip), %rbx       # 0x4296
movl $0x2, %edi
movq %rbx, %rsi
callq 0x33d0
movl $0xf, %edi
movq %rbx, %rsi
callq 0x33d0
xorl %edi, %edi
callq 0x3230
movq %rax, 0x999c(%rip)      # 0xd4a0
movq %rax, %rdi
callq 0x3070
movq %rax, 0x9935(%rip)      # 0xd448
movq 0x9986(%rip), %rdi      # 0xd4a0
movl $0x1, %esi
callq 0x3480
movq 0x991d(%rip), %rdi      # 0xd448
callq 0x32c0
movq %rax, %rdi
callq 0x3250
movq %rax, 0x9911(%rip)      # 0xd450
leaq -0x110(%rbp), %rdx
movl $0x20, 0x14(%rdx)
leaq -0x74(%rbp), %rbx
movl $0x0, (%rbx)
movq 0x9942(%rip), %rdi      # 0xd4a0
movl $0x4, %esi
movq %rbx, %rcx
callq 0x3520
cmpl $0x0, (%rbx)
jle 0x3b7f
movq (%rax), %rcx
movq %rcx, 0x9936(%rip)      # 0xd4b0
movl 0x8(%rax), %eax
jmp 0x3ba2
movq 0x991a(%rip), %rax      # 0xd4a0
movq 0xe8(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, 0x9918(%rip)      # 0xd4b0
movq 0x98b1(%rip), %rax      # 0xd450
movl 0x20(%rax), %eax
movl %eax, 0x9910(%rip)      # 0xd4b8
movq 0x9899(%rip), %rdi      # 0xd448
callq 0x3560
movl %eax, 0x9902(%rip)      # 0xd4bc
movq 0x9887(%rip), %rdi      # 0xd448
movq 0x9888(%rip), %rcx      # 0xd450
movl (%rcx), %ecx
movl 0x98e7(%rip), %r8d      # 0xd4b8
xorl %esi, %esi
movl %eax, %edx
callq 0x3440
movl 0x98d8(%rip), %eax      # 0xd4b8
movq 0x9869(%rip), %rcx      # 0xd450
xorl %edx, %edx
cmpl 0x20(%rcx), %eax
setne %dl
shll $0x5, %edx
movl %edx, 0x98c8(%rip)      # 0xd4c0
movq 0x98a1(%rip), %rdi      # 0xd4a0
leaq 0x54c9(%rip), %rdx      # 0x90cf
xorl %esi, %esi
callq 0x3430
movq %rax, 0x9894(%rip)      # 0xd4a8
leaq 0x9865(%rip), %rax      # 0xd480
leaq 0x8e12(%rip), %rcx      # 0xca34
xorl %edx, %edx
movq %rcx, -0x50(%rbp)
movq %rax, -0x30(%rbp)
movq %rdx, -0x60(%rbp)
leaq (%rdx,%rdx,4), %rax
shlq $0x4, %rax
leaq 0x8dc1(%rip), %rdx      # 0xca00
addq %rdx, %rax
movq %rax, -0x58(%rbp)
xorl %r15d, %r15d
movq 0x97f8(%rip), %rdi      # 0xd448
callq 0x3560
movq -0x30(%rbp), %r12
movl %eax, (%r12,%r15,4)
movq 0x97e4(%rip), %rdi      # 0xd448
movzbl 0x9855(%rip), %esi      # 0xd4c0
movq 0x97de(%rip), %rcx      # 0xd450
movl (%rcx), %ecx
movq -0x58(%rbp), %rdx
movzwl 0x4(%rdx), %r13d
movzwl 0x6(%rdx), %ebx
movl %eax, %edx
movl %r13d, %r8d
movl %ebx, %r9d
callq 0x3100
movq 0x97b3(%rip), %rdi      # 0xd448
callq 0x3560
movl %eax, %r14d
movq -0x50(%rbp), %rax
movl -0x4(%rax,%r15,8), %ecx
movl %ecx, -0x44(%rbp)
movl (%rax,%r15,8), %eax
movl %eax, -0x38(%rbp)
xorl %eax, %eax
movl %eax, -0x34(%rbp)
movq 0x978c(%rip), %rdi      # 0xd448
movl (%r12,%r15,4), %edx
movl %r14d, %esi
movl $0x10004, %ecx          # imm = 0x10004
leaq -0x38(%rbp), %r8
callq 0x3490
xorl %eax, %eax
movl %eax, -0x40(%rbp)
movw %r13w, -0x3c(%rbp)
movw %bx, -0x3a(%rbp)
movq 0x9762(%rip), %rdi      # 0xd448
movl (%r12,%r15,4), %esi
movl %r14d, %edx
movl $0x1, %ecx
leaq -0x40(%rbp), %r8
callq 0x34a0
movq 0x9746(%rip), %rdi      # 0xd448
movl %r14d, %esi
callq 0x31a0
movq -0x58(%rbp), %rdx
movslq 0x2c(%rdx), %rax
leaq 0x978f(%rip), %rcx      # 0xd4a8
movq (%rcx,%rax,8), %r12
movq 0x10(%rdx), %r14
movq %r14, -0x68(%rbp)
movq %r14, %rdi
callq 0x3290
movq %rax, -0x70(%rbp)
movq 0x9768(%rip), %rdi      # 0xd4a0
movq %r12, %rsi
movq %r14, %rdx
movl %eax, %ecx
leaq -0x90(%rbp), %r8
callq 0x34f0
movzwl -0x90(%rbp), %eax
subl %eax, %r13d
movl %r13d, %r14d
shrl $0x1f, %r14d
addl %r13d, %r14d
sarl %r14d
addl (%r12), %ebx
subl 0x4(%r12), %ebx
movl %ebx, %r13d
shrl $0x1f, %r13d
addl %ebx, %r13d
sarl %r13d
movq 0x9720(%rip), %rdi      # 0xd4a0
movq -0x30(%rbp), %rax
movl (%rax,%r15,4), %esi
movq 0x9721(%rip), %rdx      # 0xd4b0
movl 0x9727(%rip), %ecx      # 0xd4bc
callq 0x35e0
movq %rax, %rbx
movl -0x44(%rbp), %edi
callq 0x894e
movq %rax, -0xd0(%rbp)
movq %rdx, -0xc8(%rbp)
subq $0x8, %rsp
movq %rbx, %rdi
leaq -0xd0(%rbp), %rsi
movq %r12, %rdx
movl %r14d, %ecx
movl %r13d, %r8d
movq -0x68(%rbp), %r9
pushq -0x70(%rbp)
callq 0x3190
addq $0x10, %rsp
incq %r15
cmpq $0x4, %r15
jne 0x3c49
movq -0x60(%rbp), %rcx
leaq 0x1(%rcx), %rdx
movq -0x30(%rbp), %rsi
addq $0x10, %rsi
movq -0x50(%rbp), %rdi
addq $0x50, %rdi
testq %rcx, %rcx
movq %rsi, %rax
movq %rdi, %rcx
je 0x3c24
leaq -0x40(%rbp), %rcx
movl $0x180040, (%rcx)       # imm = 0x180040
movq 0x9629(%rip), %rdi      # 0xd448
movq 0x962a(%rip), %rax      # 0xd450
movl (%rax), %esi
movl $0x800, %edx            # imm = 0x800
callq 0x33b0
movq 0x960f(%rip), %rdi      # 0xd448
callq 0x3360
movq 0x9603(%rip), %rdi      # 0xd448
movq 0x9194(%rip), %rsi      # 0xcfe0
callq 0x3180
cmpb $0x0, 0x8(%rax)
je 0x4283
movl $0x1, %edi
movl $0x168, %esi            # imm = 0x168
callq 0x34d0
movq %rax, 0x95e7(%rip)      # 0xd458
testq %rax, %rax
je 0x428a
movq %rax, %rbx
movq 0x95c4(%rip), %rdi      # 0xd448
movq %rax, %rsi
callq 0x3210
xorl %r14d, %r14d
movq %rbx, %rdi
movq %rax, %rsi
xorl %edx, %edx
callq 0x32b0
leaq 0x51c2(%rip), %rax      # 0x9065
leaq -0x90(%rbp), %rdi
movq %rax, (%rdi)
leaq 0x51be(%rip), %rax      # 0x9072
movq %rax, 0x8(%rdi)
leaq 0x51c4(%rip), %rax      # 0x9083
movq %rax, 0x10(%rdi)
leaq 0x9596(%rip), %rsi      # 0xd460
movl $0x3, %edx
callq 0x42a2
movq 0x957d(%rip), %rdi      # 0xd458
movl 0x20(%rdi), %eax
leaq -0xd0(%rbp), %rcx
movl %eax, (%rcx)
movl 0x84(%rdi), %eax
movl %eax, 0x4(%rcx)
movl 0x128(%rdi), %eax
movl %eax, 0x8(%rcx)
movl 0x10c(%rdi), %eax
movl %eax, 0xc(%rcx)
movl 0x12c(%rdi), %eax
movl %eax, 0x10(%rcx)
movl 0x124(%rdi), %eax
movl %eax, 0x14(%rcx)
movl 0x80(%rdi), %eax
movl %eax, 0x18(%rcx)
movl 0xd4(%rdi), %eax
movl %eax, 0x1c(%rcx)
movl 0xac(%rdi), %eax
movl %eax, 0x20(%rcx)
movl 0x958f(%rip), %eax      # 0xd4c4
movl %eax, 0x24(%rcx)
movl 0x9522(%rip), %eax      # 0xd460
movl %eax, 0x28(%rcx)
movl 0x951d(%rip), %eax      # 0xd464
movl %eax, 0x2c(%rcx)
movl 0x9518(%rip), %eax      # 0xd468
movl %eax, 0x30(%rcx)
xorl %esi, %esi
movl $0xd, %edx
callq 0x34b0
movq 0x94f2(%rip), %rdi      # 0xd458
movq 0x94e3(%rip), %rax      # 0xd450
movl (%rax), %esi
leaq 0x5116(%rip), %rcx      # 0x908c
movl $0x4, %edx
callq 0x33c0
leaq 0x8b19(%rip), %rbx      # 0xcaa0
movq 0x94ba(%rip), %rdi      # 0xd448
movq 0x94bb(%rip), %rax      # 0xd450
movl (%rax), %edx
movzbl 0x4(%r14,%rbx), %eax
movzwl (%r14,%rbx), %r10d
xorl %esi, %esi
movl $0xc, %ecx
movl $0x1, %r8d
movl $0x1, %r9d
pushq %r10
pushq %rax
pushq $0x0
pushq %rdx
callq 0x32d0
addq $0x20, %rsp
addq $0x10, %r14
cmpq $0x10, %r14
je 0x3f87
callq 0x49eb
leaq 0x94f6(%rip), %rbx      # 0xd4d0
xorl %r15d, %r15d
movl $0x3f8, %edx            # imm = 0x3F8
movq %rbx, %rdi
xorl %esi, %esi
callq 0x30a0
leaq 0x368(%rip), %rax       # 0x435b
movq %rax, 0x94f6(%rip)      # 0xd4f0
leaq 0x631(%rip), %rax       # 0x4632
movq %rax, 0x95d0(%rip)      # 0xd5d8
leaq 0x6b0(%rip), %rax       # 0x46bf
movq %rax, 0x9572(%rip)      # 0xd588
leaq 0x803(%rip), %rax       # 0x4820
movq %rax, 0x94bc(%rip)      # 0xd4e0
leaq 0x864(%rip), %rax       # 0x488f
movq %rax, 0x94b6(%rip)      # 0xd4e8
leaq 0x887(%rip), %rax       # 0x48c0
movq %rax, 0x9530(%rip)      # 0xd570
leaq 0x8aa(%rip), %rax       # 0x48f1
movq %rax, 0x9512(%rip)      # 0xd560
leaq 0x8e8(%rip), %rax       # 0x493d
movq %rax, 0x94fc(%rip)      # 0xd558
leaq -0x7ab(%rip), %rax      # 0x38b8
movq %rax, 0x949e(%rip)      # 0xd508
leaq -0x705(%rip), %rax      # 0x396c
movq %rax, 0x9498(%rip)      # 0xd510
leaq 0x8ec(%rip), %rax       # 0x496b
movq %rax, 0x955a(%rip)      # 0xd5e0
leaq 0x908(%rip), %rax       # 0x4995
movq %rax, 0x949c(%rip)      # 0xd530
leaq 0x93f(%rip), %rax       # 0x49da
movq %rax, 0x9476(%rip)      # 0xd518
movq 0x939f(%rip), %rdi      # 0xd448
callq 0x3300
movq %rax, 0x93bb(%rip)      # 0xd470
xorl %eax, %eax
callq 0x8300
xorl %eax, %eax
callq 0x84d0
callq 0x597d
movq 0x9379(%rip), %r14      # 0xd448
movq 0x937a(%rip), %rax      # 0xd450
movl (%rax), %esi
movq %r14, %rdi
callq 0x31f0
movq %r14, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x3320
movq %rax, %r14
leaq 0x983a(%rip), %rax      # 0xd930
movq %r15, 0x48(%rax)
movq %r15, 0x98(%rax)
movq %r15, 0xe8(%rax)
movq %r15, 0x138(%rax)
movq %r14, %rdi
callq 0x35f0
movl %eax, %r12d
movq %r14, -0x30(%rbp)
movq %r14, %rdi
callq 0x3410
testl %r12d, %r12d
jle 0x4175
movq %rax, %r15
movl %r12d, %r13d
xorl %r14d, %r14d
movq 0x930d(%rip), %r12      # 0xd448
movl (%r15,%r14,4), %esi
movq %r12, %rdi
callq 0x35a0
movq %r12, %rdi
movl %eax, %esi
xorl %edx, %edx
callq 0x32a0
testq %rax, %rax
je 0x416d
cmpb $0x0, 0x1b(%rax)
jne 0x416d
cmpb $0x2, 0x1a(%rax)
jne 0x416d
movl (%r15,%r14,4), %edi
callq 0x630a
incq %r14
cmpq %r14, %r13
jne 0x4134
movq -0x30(%rbp), %rdi
callq 0x3280
movq 0x92c3(%rip), %rdi      # 0xd448
callq 0x3200
movl %eax, -0x38(%rbp)
movw $0x1, -0x34(%rbp)
movq 0x92ae(%rip), %rdi      # 0xd448
callq 0x3360
movq 0x92a2(%rip), %rdi      # 0xd448
callq 0x30b0
orl 0x928f(%rip), %eax      # 0xd440
jne 0x426a
leaq -0x38(%rbp), %r14
leaq 0x4ecf(%rip), %r15      # 0x9091
movl $0x1, %esi
movq %r14, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3340
cmpl $-0x1, %eax
je 0x426a
movq 0x9264(%rip), %rdi      # 0xd448
callq 0x3390
testq %rax, %rax
je 0x4252
movq %rax, %r12
cmpb $0x0, (%r12)
jne 0x4214
movzbl 0x1(%r12), %esi
movzbl 0xa(%r12), %edx
movzwl 0x8(%r12), %ecx
movq %r15, %rdi
xorl %eax, %eax
callq 0x3060
movzbl (%r12), %eax
andl $0x7f, %eax
movq (%rbx,%rax,8), %rax
testq %rax, %rax
je 0x422a
movq %r12, %rdi
callq *%rax
movq %r12, %rdi
callq 0x3280
movq 0x920f(%rip), %rdi      # 0xd448
callq 0x3360
movq 0x9203(%rip), %rdi      # 0xd448
callq 0x3390
movq %rax, %r12
testq %rax, %rax
jne 0x41f1
movq 0x91ef(%rip), %rdi      # 0xd448
callq 0x30b0
orl 0x91dc(%rip), %eax      # 0xd440
je 0x41c2
callq 0x39e5
xorl %eax, %eax
addq $0xe8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x3672
jmp 0x428f
callq 0x3650
movl $0x1, %eax
jmp 0x4271