// File: /workspace/github_cpp_makefile_star2_O1/Eba-M[P]E3DC-Control/RscpExampleMain.cpp
// Function: MQTTWB(float&)
int MQTTWB(float &f)
{
    //           Test zur Abfrage einer openWB
    if (strcmp(e3dc_config.WB_ip,"0.0.0.0")!=0)
    {
        
        char buf[127];
        static int WP_status = -1;
        int status;
        char path[1024];
        char var [4] [20];
        memset(path, 0x00, sizeof(path));
        f=-1;

        if (WP_status < 2)
        {
            if (e3dc_config.debug) printf("W1");
            mfp = NULL;
            sprintf(buf,"mosquitto_sub -h %s -t %s -W 1 -C 1",e3dc_config.WB_ip,e3dc_config.WB_topic);
            mfp = popen(buf, "r");
            //            int fd = fileno(mfp);
            //            int flags = fcntl(fd, F_GETFL, 0);
            //            flags |= O_NONBLOCK;
            //            fcntl(fd, F_SETFL, flags);
            WP_status = 2;
        }
        if (mfp != NULL)
            while (fgets(path, 1024, mfp) != NULL)
            {
                status = sscanf(path, "%s", var[0]);
                for (int x1=0;x1<status;x1++)
                    f=atof(var[x1]);
            }
        //        if (WP_status < 2)
        if (mfp != NULL)
            pclose(mfp);
        if (e3dc_config.debug) printf("W2");
        WP_status = 0;
        return f;

    }
    return -1;
}

// Assembly:
movabsq $0x302e302e302e30, %rax # imm = 0x302E302E302E30
cmpq %rax, 0x32310(%rip)     # 0x399ac
je 0x780c
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x4d8, %rsp            # imm = 0x4D8
movq %rdi, %rbx
leaq 0xd0(%rsp), %rdi
movl $0x400, %edx            # imm = 0x400
xorl %esi, %esi
callq 0x2140
movl $0xbf800000, (%rbx)     # imm = 0xBF800000
cmpl $0x1, 0x31c65(%rip)     # 0x3933c
jg 0x773f
cmpb $0x1, 0x32745(%rip)     # 0x39e25
jne 0x76f0
leaq 0x2ae39(%rip), %rdi     # 0x32522
xorl %eax, %eax
callq 0x2040
movq $0x0, 0x347fd(%rip) # 0x3bef8
leaq 0x296f0(%rip), %rsi     # 0x30df2
leaq 0x322a3(%rip), %rdx     # 0x399ac
leaq 0x322b0(%rip), %rcx     # 0x399c0
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2050
leaq 0x2b302(%rip), %rsi     # 0x32a28
movq %r14, %rdi
callq 0x20a0
movq %rax, 0x347c3(%rip)     # 0x3bef8
movl $0x2, 0x31bfd(%rip)     # 0x3933c
cmpq $0x0, 0x347b1(%rip)     # 0x3bef8
je 0x77c4
movq 0x347a8(%rip), %rdx     # 0x3bef8
leaq 0xd0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x2440
testq %rax, %rax
je 0x77c4
leaq 0x2afbb(%rip), %r14     # 0x32729
leaq 0xd0(%rsp), %r15
movq %rsp, %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x2280
testl %eax, %eax
jle 0x77ab
movl %eax, %ebp
movq %r12, %r13
movq %r13, %rdi
callq 0x2310
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
addq $0x14, %r13
decq %rbp
jne 0x7792
movq 0x34746(%rip), %rdx     # 0x3bef8
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x2440
testq %rax, %rax
jne 0x7779
movq 0x3472d(%rip), %rdi     # 0x3bef8
testq %rdi, %rdi
je 0x77d5
callq 0x23a0
cmpb $0x1, 0x32649(%rip)     # 0x39e25
jne 0x77ec
leaq 0x2ad41(%rip), %rdi     # 0x32526
xorl %eax, %eax
callq 0x2040
movl $0x0, 0x31b46(%rip)     # 0x3933c
cvttss2si (%rbx), %eax
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq