// File: /workspace/github_c_makefile_star2_O0/neovim[P]libvterm/src/pen.c
// Function: vterm_state_getpen
INTERNAL int vterm_state_getpen(VTermState *state, long args[], int argcount)
{
  int argi = 0;

  if(state->pen.bold)
    args[argi++] = 1;

  if(state->pen.italic)
    args[argi++] = 3;

  if(state->pen.underline == VTERM_UNDERLINE_SINGLE)
    args[argi++] = 4;
  if(state->pen.underline == VTERM_UNDERLINE_CURLY)
    args[argi++] = 4 | CSI_ARG_FLAG_MORE, args[argi++] = 3;

  if(state->pen.blink)
    args[argi++] = 5;

  if(state->pen.reverse)
    args[argi++] = 7;

  if(state->pen.conceal)
    args[argi++] = 8;

  if(state->pen.strike)
    args[argi++] = 9;

  if(state->pen.font)
    args[argi++] = 10 + state->pen.font;

  if(state->pen.underline == VTERM_UNDERLINE_DOUBLE)
    args[argi++] = 21;

  argi = vterm_state_getpen_color(&state->pen.fg, argi, args, true);

  argi = vterm_state_getpen_color(&state->pen.bg, argi, args, false);

  if(state->pen.small) {
    if(state->pen.baseline == VTERM_BASELINE_RAISE)
      args[argi++] = 73;
    else if(state->pen.baseline == VTERM_BASELINE_LOWER)
      args[argi++] = 74;
  }

  return argi;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5adb
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x1, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x3, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5b10
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x3, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw %ax
andw $0x3, %ax
movzwl %ax, %eax
cmpl $0x1, %eax
jne 0x5b44
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x4, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw %ax
andw $0x3, %ax
movzwl %ax, %eax
cmpl $0x3, %eax
jne 0x5b93
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movl $0x80000004, %edx       # imm = 0x80000004
movq %rdx, (%rax,%rcx,8)
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x3, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x4, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5bc8
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x5, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x5, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5bfd
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x7, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x6, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5c32
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x8, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x7, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5c67
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x9, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x8, %ax
andw $0xf, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5cb4
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0x8, %ax
andw $0xf, %ax
movzwl %ax, %eax
addl $0xa, %eax
movslq %eax, %rdx
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x18(%rbp)
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw %ax
andw $0x3, %ax
movzwl %ax, %eax
cmpl $0x2, %eax
jne 0x5ce8
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x15, (%rax,%rcx,8)
movq -0x8(%rbp), %rdi
addq $0x134, %rdi            # imm = 0x134
movl -0x18(%rbp), %esi
movq -0x10(%rbp), %rdx
movl $0x1, %ecx
callq 0x5dc0
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rdi
addq $0x134, %rdi            # imm = 0x134
addq $0x4, %rdi
movl -0x18(%rbp), %esi
movq -0x10(%rbp), %rdx
xorl %ecx, %ecx
callq 0x5dc0
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0xc, %ax
andw $0x1, %ax
movzwl %ax, %eax
cmpl $0x0, %eax
je 0x5db2
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0xd, %ax
andw $0x3, %ax
movzwl %ax, %eax
cmpl $0x1, %eax
jne 0x5d79
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x49, (%rax,%rcx,8)
jmp 0x5db0
movq -0x8(%rbp), %rax
movw 0x13c(%rax), %ax
shrw $0xd, %ax
andw $0x3, %ax
movzwl %ax, %eax
cmpl $0x2, %eax
jne 0x5dae
movq -0x10(%rbp), %rax
movl -0x18(%rbp), %ecx
movl %ecx, %edx
addl $0x1, %edx
movl %edx, -0x18(%rbp)
movslq %ecx, %rcx
movq $0x4a, (%rax,%rcx,8)
jmp 0x5db0
jmp 0x5db2
movl -0x18(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)