// File: /workspace/github_cpp_makefile_star2_O2/halfflat[P]tinyopt/test/test_sink.cc
// Function: sink_refctor_Test::TestBody()
TEST(sink, refctor) {
    int a;
    to::sink sa(a);

    EXPECT_TRUE(sa("312"));
    EXPECT_EQ(312, a);

    EXPECT_FALSE(sa("foo"));
    EXPECT_EQ(312, a);

    to::sink sb(a, [](const char*) { return to::just(17); });
    EXPECT_TRUE(sb("foo"));
    EXPECT_EQ(17, a);

    to::maybe<int> ma;
    to::sink sma(ma);

    ASSERT_FALSE(ma);
    EXPECT_FALSE(sma("foo"));
    EXPECT_FALSE(ma);

    EXPECT_TRUE(sma("312"));
    EXPECT_TRUE(ma);
    EXPECT_EQ(*ma, 312);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0xb8, %rsp
leaq 0x98(%rsp), %rdi
andq $0x0, 0x8(%rdi)
leaq 0x54(%rsp), %rax
movq %rax, (%rdi)
leaq 0x2d9e(%rip), %rax      # 0x138e0
movq %rax, 0x18(%rdi)
leaq 0x2d99(%rip), %rax      # 0x138e6
movq %rax, 0x10(%rdi)
leaq 0x455c2(%rip), %rsi     # 0x5611a
callq 0x1362c
leaq 0x60(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x10beb
leaq 0x28(%rsp), %rdi
callq 0x3d5f6
leaq 0x4559f(%rip), %rdx     # 0x5611e
leaq 0x45589(%rip), %rcx     # 0x5610f
leaq 0x45588(%rip), %r8      # 0x56115
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x399e5
movq 0x78(%rsp), %r8
leaq 0x4550d(%rip), %rdx     # 0x560b5
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x14
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x39b08
leaq 0x18(%rsp), %rdi
callq 0x3b616
leaq 0x78(%rsp), %rdi
callq 0xdbe8
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x10beb
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
leaq 0x58(%rsp), %rcx
movl $0x138, (%rcx)          # imm = 0x138
leaq 0x45515(%rip), %rsi     # 0x5611a
leaq 0x467de(%rip), %rdx     # 0x573ea
leaq 0x78(%rsp), %rdi
leaq 0x54(%rsp), %r8
callq 0x13a52
cmpb $0x0, 0x78(%rsp)
jne 0x10c85
leaq 0x58(%rsp), %rdi
callq 0x3d5f6
movq 0x80(%rsp), %rax
testq %rax, %rax
je 0x10c3e
movq (%rax), %r8
jmp 0x10c45
leaq 0x48425(%rip), %r8      # 0x5906a
leaq 0x45469(%rip), %rdx     # 0x560b5
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x15
popq %rcx
callq 0x3b5b6
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x39b08
leaq 0x28(%rsp), %rdi
callq 0x3b616
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x10c85
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x80(%rsp), %rdi
callq 0x13646
leaq 0x45469(%rip), %rsi     # 0x56102
leaq 0x98(%rsp), %rdi
callq 0x1362c
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x60(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x10d39
leaq 0x28(%rsp), %rdi
callq 0x3d5f6
leaq 0x4545b(%rip), %rdx     # 0x56128
leaq 0x45441(%rip), %rcx     # 0x56115
leaq 0x45434(%rip), %r8      # 0x5610f
leaq 0x78(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x399e5
movq 0x78(%rsp), %r8
leaq 0x453bf(%rip), %rdx     # 0x560b5
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x17
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x39b08
leaq 0x18(%rsp), %rdi
callq 0x3b616
leaq 0x78(%rsp), %rdi
callq 0xdbe8
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x10d39
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
leaq 0x58(%rsp), %rcx
movl $0x138, (%rcx)          # imm = 0x138
leaq 0x453c7(%rip), %rsi     # 0x5611a
leaq 0x46690(%rip), %rdx     # 0x573ea
leaq 0x78(%rsp), %rdi
leaq 0x54(%rsp), %rbx
movq %rbx, %r8
callq 0x13a52
cmpb $0x0, 0x78(%rsp)
jne 0x10dd6
leaq 0x58(%rsp), %rdi
callq 0x3d5f6
movq 0x80(%rsp), %rax
testq %rax, %rax
je 0x10d8f
movq (%rax), %r8
jmp 0x10d96
leaq 0x482d4(%rip), %r8      # 0x5906a
leaq 0x45318(%rip), %rdx     # 0x560b5
leaq 0x28(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x18
popq %rcx
callq 0x3b5b6
leaq 0x28(%rsp), %rdi
leaq 0x58(%rsp), %rsi
callq 0x39b08
leaq 0x28(%rsp), %rdi
callq 0x3b616
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x10dd6
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x80(%rsp), %r14
movq %r14, %rdi
callq 0x13646
andq $0x0, (%r14)
movq %rbx, -0x8(%r14)
leaq 0x2421(%rip), %rax      # 0x13216
movq %rax, 0x10(%r14)
leaq 0x2422(%rip), %rax      # 0x13222
movq %rax, 0x8(%r14)
leaq 0x452f7(%rip), %rsi     # 0x56102
leaq 0x78(%rsp), %rdi
callq 0x1362c
leaq 0x30(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x10ea3
leaq 0x18(%rsp), %rdi
callq 0x3d5f6
leaq 0x452fb(%rip), %rdx     # 0x56132
leaq 0x452d1(%rip), %rcx     # 0x5610f
leaq 0x452d0(%rip), %r8      # 0x56115
leaq 0x58(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x399e5
movq 0x58(%rsp), %r8
leaq 0x45255(%rip), %rdx     # 0x560b5
leaq 0x48(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x1b
popq %rcx
callq 0x3b5b6
leaq 0x48(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x39b08
leaq 0x48(%rsp), %rdi
callq 0x3b616
leaq 0x58(%rsp), %rdi
callq 0xdbe8
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x10ea3
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
leaq 0x28(%rsp), %rcx
movl $0x11, (%rcx)
leaq 0x4527f(%rip), %rsi     # 0x5613c
leaq 0x46526(%rip), %rdx     # 0x573ea
leaq 0x58(%rsp), %rdi
leaq 0x54(%rsp), %r8
callq 0x13a52
cmpb $0x0, 0x58(%rsp)
jne 0x10f3a
leaq 0x28(%rsp), %rdi
callq 0x3d5f6
movq 0x60(%rsp), %rax
testq %rax, %rax
je 0x10ef3
movq (%rax), %r8
jmp 0x10efa
leaq 0x48170(%rip), %r8      # 0x5906a
leaq 0x451b4(%rip), %rdx     # 0x560b5
leaq 0x18(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x1c
popq %rcx
callq 0x3b5b6
leaq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rsi
callq 0x39b08
leaq 0x18(%rsp), %rdi
callq 0x3b616
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x10f3a
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x60(%rsp), %rbx
movq %rbx, %rdi
callq 0x13646
andq $0x0, (%rbx)
leaq 0x48(%rsp), %rax
movb $0x0, (%rax)
movq %rax, -0x8(%rbx)
leaq 0x2c12(%rip), %rax      # 0x13b70
movq %rax, 0x10(%rbx)
leaq 0x2c0d(%rip), %rax      # 0x13b76
movq %rax, 0x8(%rbx)
leaq 0x30(%rsp), %rdi
movb $0x1, -0x8(%rdi)
andq $0x0, (%rdi)
callq 0x13646
leaq 0x4517c(%rip), %rsi     # 0x56102
leaq 0x58(%rsp), %rdi
callq 0x1362c
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x20(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x11023
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x45188(%rip), %rdx     # 0x5613f
leaq 0x45157(%rip), %rcx     # 0x56115
leaq 0x4514a(%rip), %r8      # 0x5610f
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x450d5(%rip), %rdx     # 0x560b5
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x22
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
leaq 0x28(%rsp), %rdi
callq 0xdbe8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11023
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
movb 0x48(%rsp), %al
movl %eax, %ecx
xorb $0x1, %cl
leaq 0x20(%rsp), %r14
movb %cl, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
je 0x110c2
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x45100(%rip), %rdx     # 0x56156
leaq 0x450b8(%rip), %rcx     # 0x56115
leaq 0x450ab(%rip), %r8      # 0x5610f
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x45036(%rip), %rdx     # 0x560b5
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x23
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
leaq 0x28(%rsp), %rdi
callq 0xdbe8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x110c2
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
leaq 0x45049(%rip), %rsi     # 0x5611a
leaq 0x58(%rsp), %rdi
callq 0x1362c
leaq 0x20(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x11169
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x4504d(%rip), %rdx     # 0x5614a
leaq 0x4500b(%rip), %rcx     # 0x5610f
leaq 0x4500a(%rip), %r8      # 0x56115
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x44f8f(%rip), %rdx     # 0x560b5
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x25
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
leaq 0x28(%rsp), %rdi
callq 0xdbe8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11169
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
movb 0x48(%rsp), %al
leaq 0x20(%rsp), %r14
movb %al, -0x8(%r14)
andq $0x0, (%r14)
testb %al, %al
jne 0x11203
leaq 0x8(%rsp), %rdi
callq 0x3d5f6
leaq 0x44fbf(%rip), %rdx     # 0x56156
leaq 0x44f71(%rip), %rcx     # 0x5610f
leaq 0x44f70(%rip), %r8      # 0x56115
leaq 0x28(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x399e5
movq 0x28(%rsp), %r8
leaq 0x44ef5(%rip), %rdx     # 0x560b5
leaq 0x10(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x26
popq %rcx
callq 0x3b5b6
leaq 0x10(%rsp), %rdi
leaq 0x8(%rsp), %rsi
callq 0x39b08
leaq 0x10(%rsp), %rdi
callq 0x3b616
leaq 0x28(%rsp), %rdi
callq 0xdbe8
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x11203
movq (%rdi), %rax
callq *0x8(%rax)
movq %r14, %rdi
callq 0x13646
leaq 0x4c(%rsp), %rcx
leaq 0x18(%rsp), %r8
movl $0x138, (%r8)           # imm = 0x138
leaq 0x44f32(%rip), %rsi     # 0x56155
leaq 0x44ef0(%rip), %rdx     # 0x5611a
leaq 0x28(%rsp), %rdi
callq 0x13a52
cmpb $0x0, 0x28(%rsp)
jne 0x1129b
leaq 0x18(%rsp), %rdi
callq 0x3d5f6
movq 0x30(%rsp), %rax
testq %rax, %rax
je 0x11254
movq (%rax), %r8
jmp 0x1125b
leaq 0x47e0f(%rip), %r8      # 0x5906a
leaq 0x44e53(%rip), %rdx     # 0x560b5
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rsi
pushq $0x27
popq %rcx
callq 0x3b5b6
leaq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0x39b08
leaq 0x8(%rsp), %rdi
callq 0x3b616
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x1129b
movq (%rdi), %rax
callq *0x8(%rax)
leaq 0x30(%rsp), %rdi
callq 0x13646
leaq 0x58(%rsp), %rdi
callq 0x1367e
leaq 0x78(%rsp), %rdi
callq 0x1367e
leaq 0x98(%rsp), %rdi
callq 0x1367e
addq $0xb8, %rsp
popq %rbx
popq %r14
retq
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x3b616
jmp 0x112e3
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x112f8
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x112f8
movq %rax, %rbx
leaq 0x30(%rsp), %rdi
jmp 0x11350
jmp 0x11315
jmp 0x11326
jmp 0x11335
jmp 0x11315
jmp 0x1134a
jmp 0x11326
jmp 0x11335
jmp 0x1134a
jmp 0x11315
jmp 0x11326
jmp 0x11335
movq %rax, %rbx
leaq 0x10(%rsp), %rdi
callq 0x3b616
jmp 0x11329
jmp 0x1134a
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0xdbe8
jmp 0x11338
movq %rax, %rbx
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x1134d
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x1134d
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x11451
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3b616
jmp 0x1136c
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x11381
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x11381
movq %rax, %rbx
leaq 0x60(%rsp), %rdi
jmp 0x113c1
movq %rax, %rbx
leaq 0x48(%rsp), %rdi
callq 0x3b616
jmp 0x1139a
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0xdbe8
jmp 0x113a9
movq %rax, %rbx
movq 0x18(%rsp), %rdi
testq %rdi, %rdi
je 0x113be
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x113be
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x1145b
jmp 0x113d9
jmp 0x113e8
jmp 0x113fd
jmp 0x1140a
jmp 0x11419
jmp 0x11428
jmp 0x1143d
movq %rax, %rbx
leaq 0x28(%rsp), %rdi
callq 0x3b616
jmp 0x113eb
movq %rax, %rbx
movq 0x58(%rsp), %rdi
testq %rdi, %rdi
je 0x11400
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x11400
movq %rax, %rbx
leaq 0x80(%rsp), %rdi
jmp 0x11443
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x3b616
jmp 0x1141c
movq %rax, %rbx
leaq 0x78(%rsp), %rdi
callq 0xdbe8
jmp 0x1142b
movq %rax, %rbx
movq 0x28(%rsp), %rdi
testq %rdi, %rdi
je 0x11440
movq (%rdi), %rax
callq *0x8(%rax)
jmp 0x11440
movq %rax, %rbx
movq %r14, %rdi
callq 0x13646
jmp 0x11465
jmp 0x1144e
jmp 0x1144e
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1367e
leaq 0x78(%rsp), %rdi
callq 0x1367e
leaq 0x98(%rsp), %rdi
callq 0x1367e
movq %rbx, %rdi
callq 0xdaa0
jmp 0x1147c
movq %rax, %rbx
jmp 0x1145b
jmp 0x11487
jmp 0x11487
jmp 0x11487
movq %rax, %rbx
jmp 0x11465