// File: /workspace/github_c_makefile_star2_O3/tudurom[P]windowchef/wm.c
// Function: set_borders
static void
set_borders(struct client *client, uint32_t color, uint32_t internal_color)
{
	if (client == NULL || conf.borders == false)
		return;
	uint32_t values[1];

	color = get_color_pixel(color);
	internal_color = get_color_pixel(internal_color);

	values[0] = conf.border_width;
	xcb_configure_window(conn, client->window,
			XCB_CONFIG_WINDOW_BORDER_WIDTH, values);

	if (conf.internal_border_width == 0) {
		values[0] = color;
		xcb_change_window_attributes(conn, client->window, XCB_CW_BORDER_PIXEL, values);
	}

	if (conf.internal_border_width != 0) {
		uint32_t calc_iborder = conf.border_width - conf.internal_border_width;
		xcb_rectangle_t rect_inner[] = {
			{
				client->geom.width,
				0,
				conf.border_width - calc_iborder,
				client->geom.height + conf.border_width - calc_iborder
			},
			{
				client->geom.width + conf.border_width + calc_iborder,
				0,
				conf.border_width - calc_iborder,
				client->geom.height + conf.border_width - calc_iborder
			},
			{
				0,
				client->geom.height,
				client->geom.width + conf.border_width - calc_iborder,
				conf.border_width - calc_iborder
			},
			{
				0,
				client->geom.height + conf.border_width + calc_iborder,
				client->geom.width + conf.border_width - calc_iborder,
				conf.border_width - calc_iborder
			},
			{
				client->geom.width + conf.border_width + calc_iborder,
				conf.border_width + client->geom.height + calc_iborder,
				conf.border_width,
				conf.border_width
			}
		};

		xcb_rectangle_t rect_outer[] = {
			{
				client->geom.width + conf.border_width - calc_iborder,
				0,
				calc_iborder,
				client->geom.height + conf.border_width * 2
			},
			{
				client->geom.width + conf.border_width,
				0,
				calc_iborder,
				client->geom.height + conf.border_width * 2
			},
			{
				0,
				client->geom.height + conf.border_width - calc_iborder,
				client->geom.width + conf.border_width * 2,
				calc_iborder
			},
			{
				0,
				client->geom.height + conf.border_width,
				client->geom.width + conf.border_width * 2,
				calc_iborder
			},
			{
				1,1,1,1
			}
		};

		xcb_pixmap_t pmap = xcb_generate_id(conn);
		xcb_create_pixmap(conn, client->depth, pmap, scr->root,
			client->geom.width + (conf.border_width * 2),
			client->geom.height + (conf.border_width * 2)
		);

		xcb_gcontext_t gc = xcb_generate_id(conn);
		xcb_create_gc(conn, gc, pmap, 0, NULL);

		values[0] = color;
		xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, &values[0]);
		xcb_poly_fill_rectangle(conn, pmap, gc, 5, rect_outer);

		values[0] = internal_color;
		xcb_change_gc(conn, gc, XCB_GC_FOREGROUND, &values[0]);
		xcb_poly_fill_rectangle(conn, pmap, gc, 5, rect_inner);

		values[0] = pmap;
		xcb_change_window_attributes(conn,client->window, XCB_CW_BORDER_PIXMAP,
				&values[0]);

		xcb_free_pixmap(conn,pmap);
		xcb_free_gc(conn,gc);
	}
}

// Assembly:
testq %rdi, %rdi
je 0x5535
cmpb $0x0, 0x7540(%rip)      # 0xc7c3
je 0x5535
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movl %edx, %ebp
movq %rdi, %rbx
movl %esi, %edi
callq 0x8695
movl %eax, %r14d
movl %ebp, %edi
callq 0x8695
movl %eax, %ebp
movsbl 0x74ea(%rip), %eax      # 0xc7a0
leaq 0x4(%rsp), %rcx
movl %eax, (%rcx)
movq 0x70f4(%rip), %rdi      # 0xc3b8
movl (%rbx), %esi
movl $0x10, %edx
callq 0x3200
movb 0x74cb(%rip), %al       # 0xc7a1
testb %al, %al
jne 0x5303
leaq 0x4(%rsp), %rcx
movl %r14d, (%rcx)
movq 0x70cf(%rip), %rdi      # 0xc3b8
movl (%rbx), %esi
movl $0x8, %edx
callq 0x3460
movb 0x74a6(%rip), %al       # 0xc7a1
testb %al, %al
je 0x5527
movsbl %al, %r9d
movsbl 0x7492(%rip), %ecx      # 0xc7a0
movl %ecx, %eax
subl %r9d, %eax
movzwl 0x8(%rbx), %edx
leaq 0x40(%rsp), %r15
movw %dx, (%r15)
xorl %esi, %esi
movw %si, 0x2(%r15)
movw %r9w, 0x4(%r15)
movzwl 0xa(%rbx), %r10d
leal (%r10,%rcx), %edi
movl %edi, %r8d
subl %eax, %r8d
movw %r8w, 0x6(%r15)
leal (%rdx,%rcx), %r11d
movl %ebp, 0xc(%rsp)
leal (%r11,%rax), %ebp
movw %bp, 0x8(%r15)
movw %si, 0xa(%r15)
movw %r9w, 0xc(%r15)
movw %r8w, 0xe(%r15)
movw %si, 0x10(%r15)
movw %r10w, 0x12(%r15)
movl %r14d, 0x8(%rsp)
movl %r11d, %r14d
subl %eax, %r14d
movw %r14w, 0x14(%r15)
movw %r9w, 0x16(%r15)
movw %si, 0x18(%r15)
leal (%rdi,%rax), %r12d
movw %r12w, 0x1a(%r15)
movw %r14w, 0x1c(%r15)
movw %r9w, 0x1e(%r15)
movw %bp, 0x20(%r15)
movw %r12w, 0x22(%r15)
movw %cx, 0x24(%r15)
movw %cx, 0x26(%r15)
leaq 0x10(%rsp), %r13
movw %r14w, (%r13)
movw %si, 0x2(%r13)
movw %ax, 0x4(%r13)
leal (%r10,%rcx,2), %r9d
movw %r9w, 0x6(%r13)
movw %r11w, 0x8(%r13)
movw %si, 0xa(%r13)
movw %ax, 0xc(%r13)
movw %r9w, 0xe(%r13)
movw %si, 0x10(%r13)
movw %r8w, 0x12(%r13)
leal (%rdx,%rcx,2), %ecx
movw %cx, 0x14(%r13)
movw %ax, 0x16(%r13)
movw %si, 0x18(%r13)
movw %di, 0x1a(%r13)
movw %cx, 0x1c(%r13)
movw %ax, 0x1e(%r13)
movabsq $0x1000100010001, %rax  # imm = 0x1000100010001
movq %rax, 0x20(%r13)
movq 0x6f9c(%rip), %rdi      # 0xc3b8
callq 0x35f0
movl %eax, %r12d
movq 0x6f8d(%rip), %rdi      # 0xc3b8
movzbl 0x5c(%rbx), %esi
movq 0x73a2(%rip), %rax      # 0xc7d8
movl (%rax), %ecx
movsbl 0x7361(%rip), %eax      # 0xc7a0
addl %eax, %eax
movzwl 0x8(%rbx), %edx
addw %ax, %dx
addw 0xa(%rbx), %ax
movzwl %dx, %r8d
movzwl %ax, %r9d
movl %r12d, %edx
callq 0x3110
movq 0x6f55(%rip), %rdi      # 0xc3b8
callq 0x35f0
movl %eax, %ebp
movq 0x6f47(%rip), %rdi      # 0xc3b8
movl %eax, %esi
movl %r12d, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x3530
leaq 0x4(%rsp), %r14
movl 0x8(%rsp), %eax
movl %eax, (%r14)
movq 0x6f25(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
movl $0x4, %edx
movq %r14, %rcx
callq 0x3100
movq 0x6f0f(%rip), %rdi      # 0xc3b8
movl %r12d, %esi
movl %ebp, %edx
movl $0x5, %ecx
movq %r13, %r8
callq 0x36e0
movl 0xc(%rsp), %eax
movl %eax, (%r14)
movq 0x6eef(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
movl $0x4, %edx
movq %r14, %rcx
callq 0x3100
movq 0x6ed9(%rip), %rdi      # 0xc3b8
movl %r12d, %esi
movl %ebp, %edx
movl $0x5, %ecx
movq %r15, %r8
callq 0x36e0
movl %r12d, (%r14)
movq 0x6ebd(%rip), %rdi      # 0xc3b8
movl (%rbx), %esi
movl $0x4, %edx
movq %r14, %rcx
callq 0x3460
movq 0x6ea7(%rip), %rdi      # 0xc3b8
movl %r12d, %esi
callq 0x3580
movq 0x6e98(%rip), %rdi      # 0xc3b8
movl %ebp, %esi
callq 0x31d0
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq