// File: /workspace/github_c_makefile_star2_O0/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:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x5dbc
movb 0x9a31(%rip), %al       # 0xf7e3
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5dc1
jmp 0x6236
movl -0xc(%rbp), %edi
callq 0xb910
movl %eax, -0xc(%rbp)
movl -0x10(%rbp), %edi
callq 0xb910
movl %eax, -0x10(%rbp)
movsbl 0x99e2(%rip), %eax      # 0xf7c0
movl %eax, -0x14(%rbp)
movq 0x95f0(%rip), %rdi      # 0xf3d8
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq -0x14(%rbp), %rcx
movl $0x10, %edx
callq 0x3200
movl %eax, -0x18(%rbp)
movsbl 0x99bb(%rip), %eax      # 0xf7c1
cmpl $0x0, %eax
jne 0x5e2f
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x95c0(%rip), %rdi      # 0xf3d8
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq -0x14(%rbp), %rcx
movl $0x8, %edx
callq 0x3460
movl %eax, -0x1c(%rbp)
movsbl 0x998b(%rip), %eax      # 0xf7c1
cmpl $0x0, %eax
je 0x6236
movsbl 0x997a(%rip), %eax      # 0xf7c0
movsbl 0x9974(%rip), %ecx      # 0xf7c1
subl %ecx, %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movw 0x8(%rax), %ax
movw %ax, -0x50(%rbp)
movw $0x0, -0x4e(%rbp)
movsbl 0x9955(%rip), %eax      # 0xf7c0
subl -0x20(%rbp), %eax
movw %ax, -0x4c(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x993f(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
subl -0x20(%rbp), %eax
movw %ax, -0x4a(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x9927(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
addl -0x20(%rbp), %eax
movw %ax, -0x48(%rbp)
movw $0x0, -0x46(%rbp)
movsbl 0x9911(%rip), %eax      # 0xf7c0
subl -0x20(%rbp), %eax
movw %ax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x98fb(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
subl -0x20(%rbp), %eax
movw %ax, -0x42(%rbp)
movw $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movw 0xa(%rax), %ax
movw %ax, -0x3e(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x98d1(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
subl -0x20(%rbp), %eax
movw %ax, -0x3c(%rbp)
movsbl 0x98c1(%rip), %eax      # 0xf7c0
subl -0x20(%rbp), %eax
movw %ax, -0x3a(%rbp)
movw $0x0, -0x38(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x98a5(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
addl -0x20(%rbp), %eax
movw %ax, -0x36(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x988d(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
subl -0x20(%rbp), %eax
movw %ax, -0x34(%rbp)
movsbl 0x987d(%rip), %eax      # 0xf7c0
subl -0x20(%rbp), %eax
movw %ax, -0x32(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x9867(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
addl -0x20(%rbp), %eax
movw %ax, -0x30(%rbp)
movsbl 0x9857(%rip), %eax      # 0xf7c0
movq -0x8(%rbp), %rcx
movzwl 0xa(%rcx), %ecx
addl %ecx, %eax
addl -0x20(%rbp), %eax
movw %ax, -0x2e(%rbp)
movsbl 0x983f(%rip), %eax      # 0xf7c0
movw %ax, -0x2c(%rbp)
movsbl 0x9834(%rip), %eax      # 0xf7c0
movw %ax, -0x2a(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x9821(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
subl -0x20(%rbp), %eax
movw %ax, -0x80(%rbp)
movw $0x0, -0x7e(%rbp)
movl -0x20(%rbp), %eax
movw %ax, -0x7c(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x97fc(%rip), %ecx      # 0xf7c0
shll %ecx
addl %ecx, %eax
movw %ax, -0x7a(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x97e5(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
movw %ax, -0x78(%rbp)
movw $0x0, -0x76(%rbp)
movl -0x20(%rbp), %eax
movw %ax, -0x74(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x97c3(%rip), %ecx      # 0xf7c0
shll %ecx
addl %ecx, %eax
movw %ax, -0x72(%rbp)
movw $0x0, -0x70(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x97a6(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
subl -0x20(%rbp), %eax
movw %ax, -0x6e(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x978e(%rip), %ecx      # 0xf7c0
shll %ecx
addl %ecx, %eax
movw %ax, -0x6c(%rbp)
movl -0x20(%rbp), %eax
movw %ax, -0x6a(%rbp)
movw $0x0, -0x68(%rbp)
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x976a(%rip), %ecx      # 0xf7c0
addl %ecx, %eax
movw %ax, -0x66(%rbp)
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x9755(%rip), %ecx      # 0xf7c0
shll %ecx
addl %ecx, %eax
movw %ax, -0x64(%rbp)
movl -0x20(%rbp), %eax
movw %ax, -0x62(%rbp)
movw $0x1, -0x60(%rbp)
movw $0x1, -0x5e(%rbp)
movw $0x1, -0x5c(%rbp)
movw $0x1, -0x5a(%rbp)
movq 0x933f(%rip), %rdi      # 0xf3d8
callq 0x35f0
movl %eax, -0x84(%rbp)
movq 0x932d(%rip), %rdi      # 0xf3d8
movq -0x8(%rbp), %rax
movb 0x5c(%rax), %sil
movl -0x84(%rbp), %edx
movq 0x9738(%rip), %rax      # 0xf7f8
movl (%rax), %ecx
movq -0x8(%rbp), %rax
movzwl 0x8(%rax), %eax
movsbl 0x96ee(%rip), %r8d      # 0xf7c0
shll %r8d
addl %r8d, %eax
movw %ax, %r8w
movq -0x8(%rbp), %rax
movzwl 0xa(%rax), %eax
movsbl 0x96d4(%rip), %r9d      # 0xf7c0
shll %r9d
addl %r9d, %eax
movzbl %sil, %esi
movzwl %r8w, %r8d
movzwl %ax, %r9d
callq 0x3110
movl %eax, -0x88(%rbp)
movq 0x92c8(%rip), %rdi      # 0xf3d8
callq 0x35f0
movl %eax, -0x8c(%rbp)
movq 0x92b6(%rip), %rdi      # 0xf3d8
movl -0x8c(%rbp), %esi
movl -0x84(%rbp), %edx
xorl %ecx, %ecx
xorl %eax, %eax
movl %eax, %r8d
callq 0x3530
movl %eax, -0x90(%rbp)
movl -0xc(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x928b(%rip), %rdi      # 0xf3d8
movl -0x8c(%rbp), %esi
leaq -0x14(%rbp), %rcx
movl $0x4, %edx
callq 0x3100
movl %eax, -0x94(%rbp)
movq 0x926a(%rip), %rdi      # 0xf3d8
movl -0x84(%rbp), %esi
movl -0x8c(%rbp), %edx
leaq -0x80(%rbp), %r8
movl $0x5, %ecx
callq 0x36d0
movl %eax, -0x98(%rbp)
movl -0x10(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x923d(%rip), %rdi      # 0xf3d8
movl -0x8c(%rbp), %esi
leaq -0x14(%rbp), %rcx
movl $0x4, %edx
callq 0x3100
movl %eax, -0x9c(%rbp)
movq 0x921c(%rip), %rdi      # 0xf3d8
movl -0x84(%rbp), %esi
movl -0x8c(%rbp), %edx
leaq -0x50(%rbp), %r8
movl $0x5, %ecx
callq 0x36d0
movl %eax, -0xa0(%rbp)
movl -0x84(%rbp), %eax
movl %eax, -0x14(%rbp)
movq 0x91ec(%rip), %rdi      # 0xf3d8
movq -0x8(%rbp), %rax
movl (%rax), %esi
leaq -0x14(%rbp), %rcx
movl $0x4, %edx
callq 0x3460
movl %eax, -0xa4(%rbp)
movq 0x91cb(%rip), %rdi      # 0xf3d8
movl -0x84(%rbp), %esi
callq 0x3580
movl %eax, -0xa8(%rbp)
movq 0x91b3(%rip), %rdi      # 0xf3d8
movl -0x8c(%rbp), %esi
callq 0x31d0
movl %eax, -0xac(%rbp)
addq $0xb0, %rsp
popq %rbp
retq
nop