// File: /workspace/github_c_makefile_star2_O0/uobikiemukot[P]yaft/./terminal.h
// Function: set_cell
int set_cell(struct terminal_t *term, int y, int x, const struct glyph_t *glyphp)
{
	struct cell_t cell, *cellp;
	uint8_t color_tmp;

	cell.glyphp = glyphp;

	cell.color_pair.fg = (term->attribute & attr_mask[ATTR_BOLD] && term->color_pair.fg <= 7) ?
		term->color_pair.fg + BRIGHT_INC: term->color_pair.fg;
	cell.color_pair.bg = (term->attribute & attr_mask[ATTR_BLINK] && term->color_pair.bg <= 7) ?
		term->color_pair.bg + BRIGHT_INC: term->color_pair.bg;

	if (term->attribute & attr_mask[ATTR_REVERSE]) {
		color_tmp          = cell.color_pair.fg;
		cell.color_pair.fg = cell.color_pair.bg;
		cell.color_pair.bg = color_tmp;
	}

	cell.attribute  = term->attribute;
	cell.width      = glyphp->width;
	cell.has_pixmap = false;

	cellp    = &term->cells[y][x];
	*cellp   = cell;
	term->line_dirty[y] = true;

	if (cell.width == WIDE && x + 1 < term->cols) {
		cellp        = &term->cells[y][x + 1];
		*cellp       = cell;
		cellp->width = NEXT_TO_WIDE;
		return WIDE;
	}

	if (cell.width == HALF /* isolated NEXT_TO_WIDE cell */
		&& x + 1 < term->cols
		&& term->cells[y][x + 1].width == NEXT_TO_WIDE) {
		erase_cell(term, y, x + 1);
	}
	return HALF;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x238(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movzbl 0x6b5f(%rip), %ecx      # 0xb411
andl %ecx, %eax
cmpl $0x0, %eax
je 0x48d9
movq -0x10(%rbp), %rax
movzbl 0x4c(%rax), %eax
cmpl $0x7, %eax
jg 0x48d9
movq -0x10(%rbp), %rax
movzbl 0x4c(%rax), %eax
addl $0x8, %eax
movl %eax, -0x248(%rbp)
jmp 0x48e7
movq -0x10(%rbp), %rax
movzbl 0x4c(%rax), %eax
movl %eax, -0x248(%rbp)
movl -0x248(%rbp), %eax
movb %al, -0x230(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movzbl 0x6b14(%rip), %ecx      # 0xb415
andl %ecx, %eax
cmpl $0x0, %eax
je 0x4928
movq -0x10(%rbp), %rax
movzbl 0x4d(%rax), %eax
cmpl $0x7, %eax
jg 0x4928
movq -0x10(%rbp), %rax
movzbl 0x4d(%rax), %eax
addl $0x8, %eax
movl %eax, -0x24c(%rbp)
jmp 0x4936
movq -0x10(%rbp), %rax
movzbl 0x4d(%rax), %eax
movl %eax, -0x24c(%rbp)
movl -0x24c(%rbp), %eax
movb %al, -0x22f(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movzbl 0x6ac7(%rip), %ecx      # 0xb417
andl %ecx, %eax
cmpl $0x0, %eax
je 0x497b
movb -0x230(%rbp), %al
movb %al, -0x241(%rbp)
movb -0x22f(%rbp), %al
movb %al, -0x230(%rbp)
movb -0x241(%rbp), %al
movb %al, -0x22f(%rbp)
movq -0x10(%rbp), %rax
movl 0x50(%rax), %eax
movl %eax, -0x22c(%rbp)
movq -0x20(%rbp), %rax
movzbl 0x4(%rax), %eax
movl %eax, -0x228(%rbp)
movb $0x0, -0x224(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movslq -0x18(%rbp), %rcx
imulq $0x218, %rcx, %rcx      # imm = 0x218
addq %rcx, %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rdi
leaq -0x238(%rbp), %rsi
movl $0x218, %edx            # imm = 0x218
callq 0x21c0
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movslq -0x14(%rbp), %rcx
movb $0x1, (%rax,%rcx)
cmpl $0x2, -0x228(%rbp)
jne 0x4a5b
movl -0x18(%rbp), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x4a5b
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x218, %rcx, %rcx      # imm = 0x218
addq %rcx, %rax
movq %rax, -0x240(%rbp)
movq -0x240(%rbp), %rdi
leaq -0x238(%rbp), %rsi
movl $0x218, %edx            # imm = 0x218
callq 0x21c0
movq -0x240(%rbp), %rax
movl $0x0, 0x10(%rax)
movl $0x2, -0x4(%rbp)
jmp 0x4ab5
cmpl $0x1, -0x228(%rbp)
jne 0x4aae
movl -0x18(%rbp), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl 0xc(%rcx), %eax
jge 0x4aae
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movl -0x18(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
imulq $0x218, %rcx, %rcx      # imm = 0x218
addq %rcx, %rax
cmpl $0x0, 0x10(%rax)
jne 0x4aae
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %esi
movl -0x18(%rbp), %edx
addl $0x1, %edx
callq 0x46f0
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x250, %rsp            # imm = 0x250
popq %rbp
retq
nopw %cs:(%rax,%rax)