// File: WayfireWM[P]wf-utils/wayfire/variant.cpp
// Function: wf::to_string(std::variant<int, char, bool, float, double, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>> const&)
std::string to_string(const variant_t &v)
{
    std::string out = "variant: [type: ";
    if (is_int(v))
    {
        out.append("int, value: ").append(std::to_string(get_int(v)));
    }
    else if (is_char(v))
    {
        out.append("char, value: ").append(std::to_string(get_char(v)));
    }
    else if (is_bool(v))
    {
        out.append("bool, value: ").append(std::to_string(static_cast<unsigned int>(get_bool(v))));
    }
    else if (is_float(v))
    {
        out.append("float, value: ").append(std::to_string(get_float(v)));
    }
    else if (is_double(v))
    {
        out.append("double, value: ").append(std::to_string(get_double(v)));
    }
    else if (is_string(v))
    {
        out.append("string, value: ").append(get_string(v));
    }
    else
    {
        out.append("invalid. WTF?!?");
    }

    out.append("]");
    return out;
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movq %rdi, 0x60(%rsp)
movq %rdi, %rax
movq %rax, 0x58(%rsp)
movq %rdi, 0x150(%rsp)
movq %rsi, 0x148(%rsp)
movb $0x0, 0x147(%rsp)
leaq 0x146(%rsp), %rdi
movq %rdi, 0x68(%rsp)
callq 0x6500
movq 0x60(%rsp), %rdi
movq 0x68(%rsp), %rdx
leaq 0x3dd3(%rip), %rsi      # 0x1fd12
callq 0x8280
jmp 0x1bf46
leaq 0x146(%rsp), %rdi
callq 0x6360
movq 0x148(%rsp), %rdi
callq 0x1bc30
testb $0x1, %al
jne 0x1bf69
jmp 0x1c032
movq 0x60(%rsp), %rdi
leaq 0x3dae(%rip), %rsi      # 0x1fd23
callq 0x6540
movq %rax, 0x50(%rsp)
jmp 0x1bf81
movq 0x148(%rsp), %rdi
callq 0x1bdb0
movl %eax, 0x4c(%rsp)
jmp 0x1bf94
movl 0x4c(%rsp), %esi
leaq 0x110(%rsp), %rdi
callq 0x1c3b0
jmp 0x1bfa7
movq 0x50(%rsp), %rdi
leaq 0x110(%rsp), %rsi
callq 0x6560
jmp 0x1bfbb
leaq 0x110(%rsp), %rdi
callq 0x61d0
jmp 0x1c35c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x146(%rsp), %rdi
callq 0x6360
jmp 0x1c3a2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
jmp 0x1c398
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x110(%rsp), %rdi
callq 0x61d0
jmp 0x1c398
movq 0x148(%rsp), %rdi
callq 0x1bc70
testb $0x1, %al
jne 0x1c048
jmp 0x1c0d5
movq 0x60(%rsp), %rdi
leaq 0x3cdc(%rip), %rsi      # 0x1fd30
callq 0x6540
movq %rax, 0x40(%rsp)
jmp 0x1c060
movq 0x148(%rsp), %rdi
callq 0x1bde0
movb %al, 0x3f(%rsp)
jmp 0x1c073
movb 0x3f(%rsp), %al
movsbl %al, %esi
leaq 0xf0(%rsp), %rdi
callq 0x1c3b0
jmp 0x1c089
movq 0x40(%rsp), %rdi
leaq 0xf0(%rsp), %rsi
callq 0x6560
jmp 0x1c09d
leaq 0xf0(%rsp), %rdi
callq 0x61d0
jmp 0x1c35a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0xf0(%rsp), %rdi
callq 0x61d0
jmp 0x1c398
movq 0x148(%rsp), %rdi
callq 0x1bcb0
testb $0x1, %al
jne 0x1c0eb
jmp 0x1c17b
movq 0x60(%rsp), %rdi
leaq 0x3c47(%rip), %rsi      # 0x1fd3e
callq 0x6540
movq %rax, 0x30(%rsp)
jmp 0x1c103
movq 0x148(%rsp), %rdi
callq 0x1be10
movb %al, 0x2f(%rsp)
jmp 0x1c116
movb 0x2f(%rsp), %al
movzbl %al, %esi
andl $0x1, %esi
leaq 0xd0(%rsp), %rdi
callq 0x1c4f0
jmp 0x1c12f
movq 0x30(%rsp), %rdi
leaq 0xd0(%rsp), %rsi
callq 0x6560
jmp 0x1c143
leaq 0xd0(%rsp), %rdi
callq 0x61d0
jmp 0x1c358
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0xd0(%rsp), %rdi
callq 0x61d0
jmp 0x1c398
movq 0x148(%rsp), %rdi
callq 0x1bcf0
testb $0x1, %al
jne 0x1c191
jmp 0x1c21f
movq 0x60(%rsp), %rdi
leaq 0x3baf(%rip), %rsi      # 0x1fd4c
callq 0x6540
movq %rax, 0x20(%rsp)
jmp 0x1c1a9
movq 0x148(%rsp), %rdi
callq 0x1be40
vmovss %xmm0, 0x1c(%rsp)
jmp 0x1c1be
vmovss 0x1c(%rsp), %xmm0
leaq 0xb0(%rsp), %rdi
callq 0x1c5f0
jmp 0x1c1d3
movq 0x20(%rsp), %rdi
leaq 0xb0(%rsp), %rsi
callq 0x6560
jmp 0x1c1e7
leaq 0xb0(%rsp), %rdi
callq 0x61d0
jmp 0x1c356
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0xb0(%rsp), %rdi
callq 0x61d0
jmp 0x1c398
movq 0x148(%rsp), %rdi
callq 0x1bd30
testb $0x1, %al
jne 0x1c235
jmp 0x1c2c3
movq 0x60(%rsp), %rdi
leaq 0x3b1a(%rip), %rsi      # 0x1fd5b
callq 0x6540
movq %rax, 0x10(%rsp)
jmp 0x1c24d
movq 0x148(%rsp), %rdi
callq 0x1be70
vmovsd %xmm0, 0x8(%rsp)
jmp 0x1c262
vmovsd 0x8(%rsp), %xmm0
leaq 0x90(%rsp), %rdi
callq 0x1c640
jmp 0x1c277
movq 0x10(%rsp), %rdi
leaq 0x90(%rsp), %rsi
callq 0x6560
jmp 0x1c28b
leaq 0x90(%rsp), %rdi
callq 0x61d0
jmp 0x1c354
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x90(%rsp), %rdi
callq 0x61d0
jmp 0x1c398
movq 0x148(%rsp), %rdi
callq 0x1bd70
testb $0x1, %al
jne 0x1c2d6
jmp 0x1c33d
movq 0x60(%rsp), %rdi
leaq 0x3a89(%rip), %rsi      # 0x1fd6b
callq 0x6540
movq %rax, (%rsp)
jmp 0x1c2ed
movq 0x148(%rsp), %rsi
leaq 0x70(%rsp), %rdi
callq 0x1bea0
jmp 0x1c301
movq (%rsp), %rdi
leaq 0x70(%rsp), %rsi
callq 0x6560
jmp 0x1c311
leaq 0x70(%rsp), %rdi
callq 0x61d0
jmp 0x1c352
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x138(%rsp)
movl %eax, 0x134(%rsp)
leaq 0x70(%rsp), %rdi
callq 0x61d0
jmp 0x1c398
movq 0x60(%rsp), %rdi
leaq 0x3a32(%rip), %rsi      # 0x1fd7b
callq 0x6540
jmp 0x1c350
jmp 0x1c352
jmp 0x1c354
jmp 0x1c356
jmp 0x1c358
jmp 0x1c35a
jmp 0x1c35c
movq 0x60(%rsp), %rdi
leaq 0x2cb5(%rip), %rsi      # 0x1f01d
callq 0x6540
jmp 0x1c36f
movb $0x1, 0x147(%rsp)
testb $0x1, 0x147(%rsp)
jne 0x1c38b
movq 0x60(%rsp), %rdi
callq 0x61d0
movq 0x58(%rsp), %rax
addq $0x158, %rsp            # imm = 0x158
retq
movq 0x60(%rsp), %rdi
callq 0x61d0
movq 0x138(%rsp), %rdi
callq 0x64f0
nop