#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 */

/* Variables and functions */
int /*<<< orphan*/ AlarmProcedure();
int /*<<< orphan*/ CheckRadarAlarm();
int /*<<< orphan*/ Delay_ms(int);
int /*<<< orphan*/ GetSettings();
int /*<<< orphan*/ InformSwitch();
int /*<<< orphan*/ InformThermostat();
int /*<<< orphan*/ InitNRF(int, int, int, int);
int /*<<< orphan*/ PortInitialization();
int /*<<< orphan*/ SendPacketsToRaspberry();
int /*<<< orphan*/ SerialPort1Read();
int /*<<< orphan*/ SerialPort2Read();
int /*<<< orphan*/ SplitPacketsByDeviceID();
int /*<<< orphan*/ readConfigRegister();
int /*<<< orphan*/ rxPacket();
void main() {
  PortInitialization();
  readConfigRegister();
  InitNRF(0x92, 0xC5, 0xA6, 0xB0);
  Delay_ms(60000);
  GetSettings();
  while (1) {
    rxPacket();
    SplitPacketsByDeviceID();
    SendPacketsToRaspberry();
    CheckRadarAlarm();
    SerialPort1Read();
    SerialPort2Read();
    InformThermostat();
    AlarmProcedure();
    InformSwitch();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1100 <PortInitialization@plt>
mov    $0x0,%al
call   10f0 <readConfigRegister@plt>
mov    $0x92,%edi
mov    $0xc5,%esi
mov    $0xa6,%edx
mov    $0xb0,%ecx
call   10b0 <InitNRF@plt>
mov    $0xea60,%edi
call   10e0 <Delay_ms@plt>
mov    $0x0,%al
call   1050 <GetSettings@plt>
mov    $0x0,%al
call   1080 <rxPacket@plt>
mov    $0x0,%al
call   1060 <SplitPacketsByDeviceID@plt>
mov    $0x0,%al
call   1040 <SendPacketsToRaspberry@plt>
mov    $0x0,%al
call   1090 <CheckRadarAlarm@plt>
mov    $0x0,%al
call   10a0 <SerialPort1Read@plt>
mov    $0x0,%al
call   10d0 <SerialPort2Read@plt>
mov    $0x0,%al
call   1030 <InformThermostat@plt>
mov    $0x0,%al
call   10c0 <AlarmProcedure@plt>
mov    $0x0,%al
call   1070 <InformSwitch@plt>
jmp    121c <main+0x3c>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1100 <PortInitialization@plt>
xor    %eax,%eax
call   10f0 <readConfigRegister@plt>
mov    $0x92,%edi
mov    $0xc5,%esi
mov    $0xa6,%edx
mov    $0xb0,%ecx
call   10b0 <InitNRF@plt>
mov    $0xea60,%edi
call   10e0 <Delay_ms@plt>
xor    %eax,%eax
call   1050 <GetSettings@plt>
nopl   0x0(%rax)
xor    %eax,%eax
call   1080 <rxPacket@plt>
xor    %eax,%eax
call   1060 <SplitPacketsByDeviceID@plt>
xor    %eax,%eax
call   1040 <SendPacketsToRaspberry@plt>
xor    %eax,%eax
call   1090 <CheckRadarAlarm@plt>
xor    %eax,%eax
call   10a0 <SerialPort1Read@plt>
xor    %eax,%eax
call   10d0 <SerialPort2Read@plt>
xor    %eax,%eax
call   1030 <InformThermostat@plt>
xor    %eax,%eax
call   10c0 <AlarmProcedure@plt>
xor    %eax,%eax
call   1070 <InformSwitch@plt>
jmp    1220 <main+0x40>

LLVM IR (-O0):
define void @main() {
%1 = call i32 (...) @PortInitialization()
%2 = call i32 (...) @readConfigRegister()
%3 = call i32 @InitNRF(i32 146, i32 197, i32 166, i32 176)
%4 = call i32 @Delay_ms(i32 60000)
%5 = call i32 (...) @GetSettings()
br label %6
6: ; preds = %0, %6
%7 = call i32 (...) @rxPacket()
%8 = call i32 (...) @SplitPacketsByDeviceID()
%9 = call i32 (...) @SendPacketsToRaspberry()
%10 = call i32 (...) @CheckRadarAlarm()
%11 = call i32 (...) @SerialPort1Read()
%12 = call i32 (...) @SerialPort2Read()
%13 = call i32 (...) @InformThermostat()
%14 = call i32 (...) @AlarmProcedure()
%15 = call i32 (...) @InformSwitch()
br label %6
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 (...) @PortInitialization()
%2 = tail call i32 (...) @readConfigRegister()
%3 = tail call i32 @InitNRF(i32 146, i32 197, i32 166, i32 176)
%4 = tail call i32 @Delay_ms(i32 60000)
%5 = tail call i32 (...) @GetSettings()
br label %6
6: ; preds = %0, %6
%7 = tail call i32 (...) @rxPacket()
%8 = tail call i32 (...) @SplitPacketsByDeviceID()
%9 = tail call i32 (...) @SendPacketsToRaspberry()
%10 = tail call i32 (...) @CheckRadarAlarm()
%11 = tail call i32 (...) @SerialPort1Read()
%12 = tail call i32 (...) @SerialPort2Read()
%13 = tail call i32 (...) @InformThermostat()
%14 = tail call i32 (...) @AlarmProcedure()
%15 = tail call i32 (...) @InformSwitch()
br label %6
}