// File: /workspace/github_cpp_makefile_star2_O2/Barath-Kannan[P]SignalsAndSlots/test/SignalTest.cpp
// Function: SignalTest_DeferredSynchronousSignal_Test::TestBody()
TEST_F(SignalTest, DeferredSynchronousSignal) {
    cout << "Instantiating signal object" << endl;

    Signal<int, int> testSignal;

    BasicTimer bt;
    cout << "Connecting signal" << endl;
    bt.start();
    testSignal.connectSlot(ExecutorScheme::DEFERRED_SYNCHRONOUS, staticSumFunction);
    bt.stop();
    cout << "Time to connect: " << bt.getElapsedMilliseconds() << "ms" << endl;

    cout << "Emitting signal" << endl;

    bt.start();
    testSignal(1, 2);
    bt.stop();
    cout << "Time to emit: " << bt.getElapsedMilliseconds() << "ms" << endl;

    ASSERT_NE(globalStaticIntX, 3);
    
    testSignal.invokeDeferred();
    
    ASSERT_EQ(globalStaticIntX, 3);

    testSignal.disconnectSlot(0);
}

// Assembly:
pushq %rbx
subq $0x170, %rsp            # imm = 0x170
movq 0x51d51(%rip), %rdi     # 0x5ffb0
leaq 0x2bf22(%rip), %rsi     # 0x3a188
callq 0xb4f0
movq %rax, %rdi
callq 0xb270
leaq 0x58(%rsp), %rdi
callq 0x10606
leaq 0x20(%rsp), %rdi
callq 0xcb2c
movq 0x51d22(%rip), %rdi     # 0x5ffb0
leaq 0x2bf3b(%rip), %rsi     # 0x3a1d0
callq 0xb4f0
movq %rax, %rdi
callq 0xb270
leaq 0x20(%rsp), %rdi
callq 0xcb9a
leaq 0x38(%rsp), %rdx
andq $0x0, 0x8(%rdx)
leaq -0x4a8(%rip), %rax      # 0xde15
movq %rax, (%rdx)
leaq 0x6e7d(%rip), %rax      # 0x15144
movq %rax, 0x18(%rdx)
leaq 0x6e7c(%rip), %rax      # 0x1514e
movq %rax, 0x10(%rdx)
leaq 0x58(%rsp), %rdi
pushq $0x1
popq %rsi
callq 0x10164
leaq 0x38(%rsp), %rdi
callq 0xd31c
leaq 0x20(%rsp), %rdi
callq 0xcbc2
movq 0x51cb2(%rip), %rdi     # 0x5ffb0
leaq 0x2bedd(%rip), %rsi     # 0x3a1e2
callq 0xb4f0
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xcb66
movq %rbx, %rdi
callq 0xb960
leaq 0x2d9dd(%rip), %rsi     # 0x3bd03
movq %rax, %rdi
callq 0xb4f0
movq %rax, %rdi
callq 0xb270
movq 0x51c73(%rip), %rdi     # 0x5ffb0
leaq 0x2beb0(%rip), %rsi     # 0x3a1f4
callq 0xb4f0
movq %rax, %rdi
callq 0xb270
leaq 0x20(%rsp), %rdi
callq 0xcb9a
leaq 0x10(%rsp), %rsi
movl $0x1, (%rsi)
movq %rsp, %rdx
movl $0x2, (%rdx)
leaq 0x58(%rsp), %rdi
callq 0x15170
leaq 0x20(%rsp), %rdi
callq 0xcbc2
movq 0x51c26(%rip), %rdi     # 0x5ffb0
leaq 0x2be73(%rip), %rsi     # 0x3a204
callq 0xb4f0
movq %rax, %rbx
leaq 0x20(%rsp), %rdi
callq 0xcb66
movq %rbx, %rdi
callq 0xb960
leaq 0x2d951(%rip), %rsi     # 0x3bd03
movq %rax, %rdi
callq 0xb4f0
movq %rax, %rdi
callq 0xb270
movq %rsp, %r8
movl $0x3, (%r8)
leaq 0x2be40(%rip), %rsi     # 0x3a213
leaq 0x2be4a(%rip), %rdx     # 0x3a224
leaq 0xa432b(%rip), %rcx     # 0xb270c
leaq 0x10(%rsp), %rdi
callq 0x101b6
cmpb $0x0, 0x10(%rsp)
je 0xe451
leaq 0x18(%rsp), %rdi
callq 0x10766
leaq 0x58(%rsp), %rdi
callq 0x15b36
movq %rsp, %r8
movl $0x3, (%r8)
leaq 0x2bdfc(%rip), %rsi     # 0x3a213
leaq 0x2be06(%rip), %rdx     # 0x3a224
leaq 0xa42e7(%rip), %rcx     # 0xb270c
leaq 0x10(%rsp), %rdi
callq 0x15402
cmpb $0x0, 0x10(%rsp)
je 0xe468
leaq 0x18(%rsp), %rdi
callq 0x10766
leaq 0x58(%rsp), %rdi
xorl %esi, %esi
callq 0x15640
jmp 0xe4f6
movq %rsp, %rdi
callq 0x23d1e
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xe47f
movq (%rax), %r8
jmp 0xe486
movq %rsp, %rdi
callq 0x23d1e
movq 0x18(%rsp), %rax
testq %rax, %rax
je 0xe4ac
movq (%rax), %r8
jmp 0xe4b3
leaq 0x305be(%rip), %r8      # 0x3ea44
leaq 0x2bce7(%rip), %rdx     # 0x3a174
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x67
popq %rcx
callq 0x22794
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x22812
jmp 0xe4d7
leaq 0x30591(%rip), %r8      # 0x3ea44
leaq 0x2bcba(%rip), %rdx     # 0x3a174
leaq 0x8(%rsp), %rdi
pushq $0x2
popq %rsi
pushq $0x6b
popq %rcx
callq 0x22794
leaq 0x8(%rsp), %rdi
movq %rsp, %rsi
callq 0x22812
leaq 0x18(%rsp), %rbx
leaq 0x8(%rsp), %rdi
callq 0x227f4
movq %rsp, %rdi
callq 0x10720
movq %rbx, %rdi
callq 0x10766
leaq 0x58(%rsp), %rdi
callq 0x1352c
addq $0x170, %rsp            # imm = 0x170
popq %rbx
retq
jmp 0xe50f
jmp 0xe51e
jmp 0xe52d
movq %rax, %rbx
leaq 0x8(%rsp), %rdi
callq 0x227f4
jmp 0xe521
movq %rax, %rbx
movq %rsp, %rdi
callq 0x10720
jmp 0xe530
jmp 0xe54f
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0x10766
jmp 0xe552
jmp 0xe54f
jmp 0xe54f
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0xd31c
jmp 0xe552
movq %rax, %rbx
leaq 0x58(%rsp), %rdi
callq 0x1352c
movq %rbx, %rdi
callq 0xba30