// File: snuke[P]a/src/interpreter.cc
// Function: Interpreter::Format(__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>&)
Interpreter::Data Interpreter::Format(State& cur) {
  ++cur;
  std::string fmt = "%";
  while (!islower(*cur)) fmt += *cur, ++cur;
  if (*cur == 'd') fmt += "ll";
  fmt += *cur; ++cur;
  Data x = Expr(cur);
  if (x.type == STR) return NewStr(x.Str());
  if (x.type == INT) snprintf(tmp_s, 1024, fmt.c_str(), x.Int());
  else if (x.type == FLOAT) snprintf(tmp_s, 1024, fmt.c_str(), x.Float());
  else tmp_s[0] = '\0';
  return NewStr(tmp_s);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x90(%rbp)
movq -0x18(%rbp), %rdi
callq 0x7090
leaq -0x39(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x33d0
movq -0x88(%rbp), %rdx
leaq 0xa355(%rip), %rsi      # 0xf08a
leaq -0x38(%rbp), %rdi
callq 0x6d70
jmp 0x4d40
leaq -0x39(%rbp), %rdi
callq 0x32a0
movq -0x18(%rbp), %rdi
callq 0x66b0
movsbl (%rax), %edi
callq 0x3340
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x4d68
jmp 0x4db5
movq -0x18(%rbp), %rdi
callq 0x66b0
movsbl (%rax), %esi
leaq -0x38(%rbp), %rdi
callq 0x3150
jmp 0x4d7f
movq -0x18(%rbp), %rdi
callq 0x7090
jmp 0x4d49
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x39(%rbp), %rdi
callq 0x32a0
jmp 0x5007
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4ffe
movq -0x18(%rbp), %rdi
callq 0x66b0
movsbl (%rax), %eax
cmpl $0x64, %eax
jne 0x4dda
leaq 0xa2bf(%rip), %rsi      # 0xf08c
leaq -0x38(%rbp), %rdi
callq 0x3220
jmp 0x4dd8
jmp 0x4dda
movq -0x18(%rbp), %rdi
callq 0x66b0
movsbl (%rax), %esi
leaq -0x38(%rbp), %rdi
callq 0x3150
jmp 0x4df1
movq -0x18(%rbp), %rdi
callq 0x7090
movq -0x90(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4360
movq %rax, -0x98(%rbp)
jmp 0x4e13
movq -0x98(%rbp), %rax
movq %rax, -0x54(%rbp)
cmpl $0x4, -0x54(%rbp)
jne 0x4e69
leaq -0x54(%rbp), %rdi
callq 0x6570
movq %rax, -0xa0(%rbp)
jmp 0x4e36
movq -0xa0(%rbp), %rsi
movq -0x90(%rbp), %rdi
callq 0x44e0
movq %rax, -0xa8(%rbp)
jmp 0x4e52
movq -0xa8(%rbp), %rax
movq %rax, -0x8(%rbp)
movl $0x1, -0x58(%rbp)
jmp 0x4fe8
cmpl $0x2, -0x54(%rbp)
jne 0x4ecb
movq -0x90(%rbp), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movq %rax, -0xc0(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x30c0
movq %rax, -0xb8(%rbp)
leaq -0x54(%rbp), %rdi
callq 0x6430
movq %rax, -0xb0(%rbp)
jmp 0x4ea5
movq -0xb8(%rbp), %rdx
movq -0xc0(%rbp), %rdi
movq -0xb0(%rbp), %rax
movq (%rax), %rcx
movl $0x400, %esi            # imm = 0x400
movb $0x0, %al
callq 0x3390
jmp 0x4f3e
cmpl $0x3, -0x54(%rbp)
jne 0x4f2e
movq -0x90(%rbp), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movq %rax, -0xd8(%rbp)
leaq -0x38(%rbp), %rdi
callq 0x30c0
movq %rax, -0xd0(%rbp)
leaq -0x54(%rbp), %rdi
callq 0x6460
movq %rax, -0xc8(%rbp)
jmp 0x4f07
movq -0xd0(%rbp), %rdx
movq -0xd8(%rbp), %rdi
movq -0xc8(%rbp), %rax
movsd (%rax), %xmm0
movl $0x400, %esi            # imm = 0x400
movb $0x1, %al
callq 0x3390
jmp 0x4f3c
movq -0x90(%rbp), %rax
movb $0x0, 0x1a0(%rax)
jmp 0x4f3e
movq -0x90(%rbp), %rax
addq $0x1a0, %rax            # imm = 0x1A0
movq %rax, -0xe8(%rbp)
leaq -0x79(%rbp), %rdi
movq %rdi, -0xe0(%rbp)
callq 0x33d0
movq -0xe8(%rbp), %rsi
movq -0xe0(%rbp), %rdx
leaq -0x78(%rbp), %rdi
callq 0x6d70
jmp 0x4f7b
movq -0x90(%rbp), %rdi
leaq -0x78(%rbp), %rsi
callq 0x44e0
movq %rax, -0xf0(%rbp)
jmp 0x4f94
movq -0xf0(%rbp), %rax
movq %rax, -0x8(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3140
leaq -0x79(%rbp), %rdi
callq 0x32a0
movl $0x1, -0x58(%rbp)
jmp 0x4fe8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x4fdd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x78(%rbp), %rdi
callq 0x3140
leaq -0x79(%rbp), %rdi
callq 0x32a0
jmp 0x4ffe
leaq -0x38(%rbp), %rdi
callq 0x3140
movq -0x8(%rbp), %rax
addq $0xf0, %rsp
popq %rbp
retq
leaq -0x38(%rbp), %rdi
callq 0x3140
movq -0x48(%rbp), %rdi
callq 0x33c0