// File: /workspace/github_c_makefile_star2_O0/cktan[P]tomlc99/toml_cat.c
// Function: print_string
static void print_string(const char *s) {
  int ok = 1;
  for (const char *p = s; *p && ok; p++) {
    int ch = *p;
    ok = isprint(ch) && ch != '"' && ch != '\\';
  }

  if (ok) {
    printf("\"%s\"", s);
    return;
  }

  int len = strlen(s);

  printf("\"");
  for (; len; len--, s++) {
    int ch = *s;
    if (isprint(ch) && ch != '"' && ch != '\\') {
      putchar(ch);
      continue;
    }

    switch (ch) {
    case 0x8:
      printf("\\b");
      continue;
    case 0x9:
      printf("\\t");
      continue;
    case 0xa:
      printf("\\n");
      continue;
    case 0xc:
      printf("\\f");
      continue;
    case 0xd:
      printf("\\r");
      continue;
    case '"':
      printf("\\\"");
      continue;
    case '\\':
      printf("\\\\");
      continue;
    default:
      printf("\\0x%02x", ch & 0xff);
      continue;
    }
  }
  printf("\"");
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x1, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x25(%rbp)
je 0x1b76
cmpl $0x0, -0xc(%rbp)
setne %al
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
testb $0x1, %al
jne 0x1b7f
jmp 0x1bd7
movq -0x18(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x1c(%rbp)
callq 0x11d0
movq (%rax), %rax
movslq -0x1c(%rbp), %rcx
movzwl (%rax,%rcx,2), %ecx
andl $0x4000, %ecx           # imm = 0x4000
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x26(%rbp)
je 0x1bbe
xorl %eax, %eax
cmpl $0x22, -0x1c(%rbp)
movb %al, -0x26(%rbp)
je 0x1bbe
cmpl $0x5c, -0x1c(%rbp)
setne %al
movb %al, -0x26(%rbp)
movb -0x26(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0xc(%rbp)
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x1b5b
cmpl $0x0, -0xc(%rbp)
je 0x1bf4
movq -0x8(%rbp), %rsi
leaq 0x64e0(%rip), %rdi      # 0x80c8
movb $0x0, %al
callq 0x10d0
jmp 0x1d4d
movq -0x8(%rbp), %rdi
callq 0x10b0
movl %eax, -0x20(%rbp)
leaq 0x6a55(%rip), %rdi      # 0x865c
movb $0x0, %al
callq 0x10d0
cmpl $0x0, -0x20(%rbp)
je 0x1d3f
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
movl %eax, -0x24(%rbp)
callq 0x11d0
movq (%rax), %rax
movslq -0x24(%rbp), %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x4000, %eax           # imm = 0x4000
cmpl $0x0, %eax
je 0x1c55
cmpl $0x22, -0x24(%rbp)
je 0x1c55
cmpl $0x5c, -0x24(%rbp)
je 0x1c55
movl -0x24(%rbp), %edi
callq 0x1040
jmp 0x1d25
movl -0x24(%rbp), %eax
movl %eax, -0x2c(%rbp)
subl $0x8, %eax
je 0x1c9e
jmp 0x1c62
movl -0x2c(%rbp), %eax
subl $0x9, %eax
je 0x1cae
jmp 0x1c6c
movl -0x2c(%rbp), %eax
subl $0xa, %eax
je 0x1cbe
jmp 0x1c76
movl -0x2c(%rbp), %eax
subl $0xc, %eax
je 0x1cce
jmp 0x1c80
movl -0x2c(%rbp), %eax
subl $0xd, %eax
je 0x1cde
jmp 0x1c8a
movl -0x2c(%rbp), %eax
subl $0x22, %eax
je 0x1cee
jmp 0x1c94
movl -0x2c(%rbp), %eax
subl $0x5c, %eax
je 0x1cfe
jmp 0x1d0e
leaq 0x6428(%rip), %rdi      # 0x80cd
movb $0x0, %al
callq 0x10d0
jmp 0x1d25
leaq 0x641b(%rip), %rdi      # 0x80d0
movb $0x0, %al
callq 0x10d0
jmp 0x1d25
leaq 0x640e(%rip), %rdi      # 0x80d3
movb $0x0, %al
callq 0x10d0
jmp 0x1d25
leaq 0x6401(%rip), %rdi      # 0x80d6
movb $0x0, %al
callq 0x10d0
jmp 0x1d25
leaq 0x63f4(%rip), %rdi      # 0x80d9
movb $0x0, %al
callq 0x10d0
jmp 0x1d25
leaq 0x63e7(%rip), %rdi      # 0x80dc
movb $0x0, %al
callq 0x10d0
jmp 0x1d25
leaq 0x63da(%rip), %rdi      # 0x80df
movb $0x0, %al
callq 0x10d0
jmp 0x1d25
movl -0x24(%rbp), %esi
andl $0xff, %esi
leaq 0x63c4(%rip), %rdi      # 0x80e2
movb $0x0, %al
callq 0x10d0
movl -0x20(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x20(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x1c0e
leaq 0x6916(%rip), %rdi      # 0x865c
movb $0x0, %al
callq 0x10d0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)