#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ getFrSkyTelemetryProviderBaudRate();
int /*<<< orphan*/ getHoTTTelemetryProviderBaudRate();
int /*<<< orphan*/ getMSPTelemetryProviderBaudRate();
scalar_t__ isTelemetryProviderFrSky();
scalar_t__ isTelemetryProviderHoTT();
scalar_t__ isTelemetryProviderMSP();
uint32_t getTelemetryProviderBaudRate(void) {
  if (isTelemetryProviderFrSky()) {
    return getFrSkyTelemetryProviderBaudRate();
  }
  if (isTelemetryProviderHoTT()) {
    return getHoTTTelemetryProviderBaudRate();
  }
  if (isTelemetryProviderMSP()) {
    return getMSPTelemetryProviderBaudRate();
  }
  return 0;
}


x86 assembly (clang, -O0):
<getTelemetryProviderBaudRate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <isTelemetryProviderFrSky@plt>
cmp    $0x0,%rax
je     1188 <getTelemetryProviderBaudRate+0x28>
mov    $0x0,%al
call   1060 <getFrSkyTelemetryProviderBaudRate@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <getTelemetryProviderBaudRate+0x6f>
mov    $0x0,%al
call   1030 <isTelemetryProviderHoTT@plt>
cmp    $0x0,%rax
je     11a8 <getTelemetryProviderBaudRate+0x48>
mov    $0x0,%al
call   1080 <getHoTTTelemetryProviderBaudRate@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <getTelemetryProviderBaudRate+0x6f>
mov    $0x0,%al
call   1070 <isTelemetryProviderMSP@plt>
cmp    $0x0,%rax
je     11c8 <getTelemetryProviderBaudRate+0x68>
mov    $0x0,%al
call   1050 <getMSPTelemetryProviderBaudRate@plt>
mov    %eax,-0x4(%rbp)
jmp    11cf <getTelemetryProviderBaudRate+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTelemetryProviderBaudRate>:
push   %rax
xor    %eax,%eax
call   1040 <isTelemetryProviderFrSky@plt>
test   %rax,%rax
je     1175 <getTelemetryProviderBaudRate+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1060 <getFrSkyTelemetryProviderBaudRate@plt>
xor    %eax,%eax
call   1030 <isTelemetryProviderHoTT@plt>
test   %rax,%rax
je     1189 <getTelemetryProviderBaudRate+0x29>
xor    %eax,%eax
pop    %rcx
jmp    1080 <getHoTTTelemetryProviderBaudRate@plt>
xor    %eax,%eax
call   1070 <isTelemetryProviderMSP@plt>
test   %rax,%rax
je     119d <getTelemetryProviderBaudRate+0x3d>
xor    %eax,%eax
pop    %rcx
jmp    1050 <getMSPTelemetryProviderBaudRate@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getTelemetryProviderBaudRate() {
%1 = alloca i32
%2 = call i64 (...) @isTelemetryProviderFrSky()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (...) @getFrSkyTelemetryProviderBaudRate()
store i32 %5, i32* %1
br label %17
6: ; preds = %0
%7 = call i64 (...) @isTelemetryProviderHoTT()
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @getHoTTTelemetryProviderBaudRate()
store i32 %10, i32* %1
br label %17
11: ; preds = %6
%12 = call i64 (...) @isTelemetryProviderMSP()
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 (...) @getMSPTelemetryProviderBaudRate()
store i32 %15, i32* %1
br label %17
16: ; preds = %11
store i32 0, i32* %1
br label %17
17: ; preds = %16, %14, %9, %4
%18 = load i32, i32* %1
ret i32 %18
}

LLVM IR (-O2):
define i32 @getTelemetryProviderBaudRate() {
%1 = tail call i64 (...) @isTelemetryProviderFrSky()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @getFrSkyTelemetryProviderBaudRate()
br label %15
5: ; preds = %0
%6 = tail call i64 (...) @isTelemetryProviderHoTT()
%7 = icmp eq i64 %6, 0
br i1 %7, label %10, label %8
8: ; preds = %5
%9 = tail call i32 (...) @getHoTTTelemetryProviderBaudRate()
br label %15
10: ; preds = %5
%11 = tail call i64 (...) @isTelemetryProviderMSP()
%12 = icmp eq i64 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %10
%14 = tail call i32 (...) @getMSPTelemetryProviderBaudRate()
br label %15
15: ; preds = %10, %13, %8, %3
%16 = phi i32 [ %4, %3 ], [ %9, %8 ], [ %14, %13 ], [ 0, %10 ]
ret i32 %16
}