// File: /workspace/github_c_makefile_star2_O0/silverneko[P]miku/isolate/isolate.c
// Function: cg_write
static void __attribute__((format(printf,3,4)))
cg_write(cg_controller controller, const char *attr, const char *fmt, ...)
{
  int maybe = 0;
  if (attr[0] == '?')
    {
      attr++;
      maybe = 1;
    }

  va_list args;
  va_start(args, fmt);

  char buf[CG_BUFSIZE];
  int n = vsnprintf(buf, sizeof(buf), fmt, args);
  if (n >= CG_BUFSIZE)
    die("cg_write: Value for attribute %s is too long", attr);

  if (verbose > 1)
    msg("CG: Write %s = %s", attr, buf);

  char path[256];
  cg_makepath(path, sizeof(path), controller, attr);

  int fd = open(path, O_WRONLY | O_TRUNC);
  if (fd < 0)
    {
      if (maybe)
	return;
      else
	die("Cannot write %s: %m", path);
    }

  int written = write(fd, buf, n);
  if (written < 0)
    {
      if (maybe)
	return;
      else
	die("Cannot set %s to %s: %m", path, buf);
    }
  if (written != n)
    die("Short write to %s (%d out of %d bytes)", path, written, n);

  close(fd);
  va_end(args);
}

// Assembly:
subq $0x608, %rsp            # imm = 0x608
testb %al, %al
je 0x47ac
movaps %xmm0, 0x30(%rsp)
movaps %xmm1, 0x40(%rsp)
movaps %xmm2, 0x50(%rsp)
movaps %xmm3, 0x60(%rsp)
movaps %xmm4, 0x70(%rsp)
movaps %xmm5, 0x80(%rsp)
movaps %xmm6, 0x90(%rsp)
movaps %xmm7, 0xa0(%rsp)
movq %r9, 0x28(%rsp)
movq %r8, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movl %edi, 0x604(%rsp)
movq %rsi, 0x5f8(%rsp)
movq %rdx, 0x5f0(%rsp)
movl $0x0, 0x5ec(%rsp)
movq 0x5f8(%rsp), %rax
movsbl (%rax), %eax
cmpl $0x3f, %eax
jne 0x480c
movq 0x5f8(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x5f8(%rsp)
movl $0x1, 0x5ec(%rsp)
leaq 0x5d0(%rsp), %rax
movq %rsp, %rcx
movq %rcx, 0x10(%rax)
leaq 0x610(%rsp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x18, (%rax)
leaq 0x1d0(%rsp), %rdi
movq 0x5f0(%rsp), %rdx
leaq 0x5d0(%rsp), %rcx
movl $0x400, %esi            # imm = 0x400
callq 0x20f0
movl %eax, 0x1cc(%rsp)
cmpl $0x400, 0x1cc(%rsp) # imm = 0x400
jl 0x4880
movq 0x5f8(%rsp), %rsi
leaq 0x2ae9(%rip), %rdi      # 0x7362
movb $0x0, %al
callq 0x2ed0
cmpl $0x1, 0x5a75(%rip)      # 0xa2fc
jle 0x48a7
movq 0x5f8(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
leaq 0x2aef(%rip), %rdi      # 0x738f
movb $0x0, %al
callq 0x4090
leaq 0xc0(%rsp), %rdi
movl 0x604(%rsp), %edx
movq 0x5f8(%rsp), %rcx
movl $0x100, %esi            # imm = 0x100
callq 0x4010
leaq 0xc0(%rsp), %rdi
movl $0x201, %esi            # imm = 0x201
movb $0x0, %al
callq 0x2400
movl %eax, 0xbc(%rsp)
cmpl $0x0, 0xbc(%rsp)
jge 0x4912
cmpl $0x0, 0x5ec(%rsp)
je 0x48fc
jmp 0x49b1
leaq 0xc0(%rsp), %rsi
leaq 0x2a96(%rip), %rdi      # 0x73a1
movb $0x0, %al
callq 0x2ed0
movl 0xbc(%rsp), %edi
leaq 0x1d0(%rsp), %rsi
movslq 0x1cc(%rsp), %rdx
callq 0x2120
movl %eax, 0xb8(%rsp)
cmpl $0x0, 0xb8(%rsp)
jge 0x4969
cmpl $0x0, 0x5ec(%rsp)
je 0x494b
jmp 0x49b1
leaq 0xc0(%rsp), %rsi
leaq 0x1d0(%rsp), %rdx
leaq 0x2a53(%rip), %rdi      # 0x73b5
movb $0x0, %al
callq 0x2ed0
movl 0xb8(%rsp), %eax
cmpl 0x1cc(%rsp), %eax
je 0x499d
leaq 0xc0(%rsp), %rsi
movl 0xb8(%rsp), %edx
movl 0x1cc(%rsp), %ecx
leaq 0x2a37(%rip), %rdi      # 0x73cd
movb $0x0, %al
callq 0x2ed0
movl 0xbc(%rsp), %edi
callq 0x2280
leaq 0x5d0(%rsp), %rax
addq $0x608, %rsp            # imm = 0x608
retq
nopl (%rax)