// File: /workspace/github_c_makefile_star2_O0/mati75[P]evilwm/client_new.c
// Function: reparent
static void reparent(struct client *c) {
	XSetWindowAttributes p_attr;

	// Default border is unselected (bg)
	p_attr.border_pixel = c->screen->bg.pixel;
	// We want to handle events for this parent window
	p_attr.override_redirect = True;
	// The events we need to manage the window
	p_attr.event_mask = SubstructureRedirectMask | SubstructureNotifyMask
	                    | ButtonPressMask | EnterWindowMask;

	// Create parent window, accounting for border width
	c->parent = XCreateWindow(display.dpy, c->screen->root, c->x-c->border, c->y-c->border,
		c->width, c->height, c->border,
		DefaultDepth(display.dpy, c->screen->screen), CopyFromParent,
		DefaultVisual(display.dpy, c->screen->screen),
		CWOverrideRedirect | CWBorderPixel | CWEventMask, &p_attr);

	// Adding the original window to our "save set" means that if we die
	// unexpectedly, the window will be reparented back to the root.
	XAddToSaveSet(display.dpy, c->window);

	// Kill any internal border on the application window
	XSetWindowBorderWidth(display.dpy, c->window, 0);

	// Reparent into our new parent window
	XReparentWindow(display.dpy, c->window, c->parent, 0, 0);

	// Map the window (shows up within parent)
	XMapWindow(display.dpy, c->window);

	// Grab mouse button actions on the parent window
	bind_grab_for_client(c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
subq $0xa8, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x40(%rax), %rax
movq %rax, -0x68(%rbp)
movl $0x1, -0x28(%rbp)
movq $0x180014, -0x38(%rbp)  # imm = 0x180014
leaq 0xa57a(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x28(%rax), %edx
movq -0x10(%rbp), %rax
subl 0x3c(%rax), %edx
movq -0x10(%rbp), %rax
movl 0x2c(%rax), %ecx
movq -0x10(%rbp), %rax
subl 0x3c(%rax), %ecx
movq -0x10(%rbp), %rax
movl 0x30(%rax), %r8d
movq -0x10(%rbp), %rax
movl 0x34(%rax), %r9d
movq -0x10(%rbp), %rax
movl 0x3c(%rax), %ebx
leaq 0xa531(%rip), %rax      # 0x12d80
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x10(%rbp), %r10
movq 0x10(%r10), %r10
movslq (%r10), %r10
shlq $0x7, %r10
addq %r10, %rax
movl 0x38(%rax), %r11d
leaq 0xa50a(%rip), %rax      # 0x12d80
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x10(%rbp), %r10
movq 0x10(%r10), %r10
movslq (%r10), %r10
shlq $0x7, %r10
addq %r10, %rax
movq 0x40(%rax), %r10
xorl %eax, %eax
leaq -0x80(%rbp), %rax
movl %ebx, (%rsp)
movl %r11d, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq $0xa08, 0x20(%rsp)      # imm = 0xA08
movq %rax, 0x28(%rsp)
callq 0x4260
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
leaq 0xa4aa(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x4360
leaq 0xa494(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
xorl %edx, %edx
callq 0x45b0
leaq 0xa47c(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdx
xorl %r8d, %r8d
movl %r8d, %ecx
callq 0x46d0
leaq 0xa458(%rip), %rax      # 0x12d80
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
callq 0x4450
movq -0x10(%rbp), %rdi
callq 0x5150
addq $0xa8, %rsp
popq %rbx
popq %rbp
retq
nopw (%rax,%rax)