// File: /workspace/github_cpp_makefile_star2_O3/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, 0x322c2(%rip)     # 0x399ac
je 0x7792
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, 0x31c17(%rip)     # 0x3933c
jg 0x7798
cmpb $0x1, 0x326f7(%rip)     # 0x39e25
jne 0x773e
leaq 0x2adf3(%rip), %rdi     # 0x3252a
xorl %eax, %eax
callq 0x2040
movq $0x0, 0x347af(%rip) # 0x3bef8
leaq 0x296a6(%rip), %rsi     # 0x30df6
leaq 0x32255(%rip), %rdx     # 0x399ac
leaq 0x32262(%rip), %rcx     # 0x399c0
leaq 0x50(%rsp), %r14
movq %r14, %rdi
xorl %eax, %eax
callq 0x2050
leaq 0x2b2bc(%rip), %rsi     # 0x32a30
movq %r14, %rdi
callq 0x20a0
movq %rax, %rdx
movq %rax, 0x34772(%rip)     # 0x3bef8
movl $0x2, 0x31bac(%rip)     # 0x3933c
jmp 0x779f
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
movq 0x34759(%rip), %rdx     # 0x3bef8
testq %rdx, %rdx
je 0x7818
leaq 0xd0(%rsp), %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x2440
testq %rax, %rax
je 0x7818
leaq 0x2af6f(%rip), %r14     # 0x32731
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 0x77ff
movl %eax, %ebp
movq %r12, %r13
movq %r13, %rdi
callq 0x2310
cvtsd2ss %xmm0, %xmm0
movss %xmm0, (%rbx)
addq $0x14, %r13
decq %rbp
jne 0x77e6
movq 0x346f2(%rip), %rdx     # 0x3bef8
movq %r15, %rdi
movl $0x400, %esi            # imm = 0x400
callq 0x2440
testq %rax, %rax
jne 0x77cd
movq 0x346d9(%rip), %rdi     # 0x3bef8
testq %rdi, %rdi
je 0x7829
callq 0x23a0
cmpb $0x1, 0x325f5(%rip)     # 0x39e25
jne 0x7840
leaq 0x2acf5(%rip), %rdi     # 0x3252e
xorl %eax, %eax
callq 0x2040
movl $0x0, 0x31af2(%rip)     # 0x3933c
cvttss2si (%rbx), %eax
addq $0x4d8, %rsp            # imm = 0x4D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq