#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*/ CLOCK_StartTimer();
int /*<<< orphan*/ MCU_SerialNumber();
int /*<<< orphan*/ MUSIC_Beep();
int /*<<< orphan*/ PROTO_CS_HI();
int /*<<< orphan*/ PROTO_CS_LO();
int /*<<< orphan*/ TELEMETRY_SetType();
int /*<<< orphan*/ TELEMETRY_SetUpdated();
int /*<<< orphan*/ UART_Stop();
int /*<<< orphan*/ USB_Disable();
int /*<<< orphan*/ _usleep();
int /*<<< orphan*/ rcc_peripheral_disable_clock();
int /*<<< orphan*/ spi_disable();
int /*<<< orphan*/ spi_read();
int /*<<< orphan*/ spi_set_bidirectional_receive_only_mode();
int /*<<< orphan*/ spi_set_unidirectional_mode();
void PROTO_Stubs(int idx) {
  if (!idx)
    return;
  CLOCK_StartTimer();
  spi_disable();
  spi_set_bidirectional_receive_only_mode();
  spi_read();
  spi_set_unidirectional_mode();
  TELEMETRY_SetUpdated();
  TELEMETRY_SetType();
  UART_Stop();
  rcc_peripheral_disable_clock();
  _usleep();
  MCU_SerialNumber();
  USB_Disable();
  PROTO_CS_HI();
  PROTO_CS_LO();
  MUSIC_Beep();
}


x86 assembly (clang, -O0):
<PROTO_Stubs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    120a <PROTO_Stubs+0x1a>
jmp    1273 <PROTO_Stubs+0x83>
mov    $0x0,%al
call   10f0 <CLOCK_StartTimer@plt>
mov    $0x0,%al
call   1110 <spi_disable@plt>
mov    $0x0,%al
call   1080 <spi_set_bidirectional_receive_only_mode@plt>
mov    $0x0,%al
call   10c0 <spi_read@plt>
mov    $0x0,%al
call   10e0 <spi_set_unidirectional_mode@plt>
mov    $0x0,%al
call   1060 <TELEMETRY_SetUpdated@plt>
mov    $0x0,%al
call   10a0 <TELEMETRY_SetType@plt>
mov    $0x0,%al
call   1030 <UART_Stop@plt>
mov    $0x0,%al
call   1100 <rcc_peripheral_disable_clock@plt>
mov    $0x0,%al
call   10d0 <_usleep@plt>
mov    $0x0,%al
call   1070 <MCU_SerialNumber@plt>
mov    $0x0,%al
call   1040 <USB_Disable@plt>
mov    $0x0,%al
call   1050 <PROTO_CS_HI@plt>
mov    $0x0,%al
call   10b0 <PROTO_CS_LO@plt>
mov    $0x0,%al
call   1090 <MUSIC_Beep@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PROTO_Stubs>:
test   %edi,%edi
je     125f <PROTO_Stubs+0x6f>
push   %rax
xor    %eax,%eax
call   10f0 <CLOCK_StartTimer@plt>
xor    %eax,%eax
call   1110 <spi_disable@plt>
xor    %eax,%eax
call   1080 <spi_set_bidirectional_receive_only_mode@plt>
xor    %eax,%eax
call   10c0 <spi_read@plt>
xor    %eax,%eax
call   10e0 <spi_set_unidirectional_mode@plt>
xor    %eax,%eax
call   1060 <TELEMETRY_SetUpdated@plt>
xor    %eax,%eax
call   10a0 <TELEMETRY_SetType@plt>
xor    %eax,%eax
call   1030 <UART_Stop@plt>
xor    %eax,%eax
call   1100 <rcc_peripheral_disable_clock@plt>
xor    %eax,%eax
call   10d0 <_usleep@plt>
xor    %eax,%eax
call   1070 <MCU_SerialNumber@plt>
xor    %eax,%eax
call   1040 <USB_Disable@plt>
xor    %eax,%eax
call   1050 <PROTO_CS_HI@plt>
xor    %eax,%eax
call   10b0 <PROTO_CS_LO@plt>
xor    %eax,%eax
pop    %rcx
jmp    1090 <MUSIC_Beep@plt>
ret

LLVM IR (-O0):
define void @PROTO_Stubs(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %6, label %5
5: ; preds = %1
br label %22
6: ; preds = %1
%7 = call i32 (...) @CLOCK_StartTimer()
%8 = call i32 (...) @spi_disable()
%9 = call i32 (...) @spi_set_bidirectional_receive_only_mode()
%10 = call i32 (...) @spi_read()
%11 = call i32 (...) @spi_set_unidirectional_mode()
%12 = call i32 (...) @TELEMETRY_SetUpdated()
%13 = call i32 (...) @TELEMETRY_SetType()
%14 = call i32 (...) @UART_Stop()
%15 = call i32 (...) @rcc_peripheral_disable_clock()
%16 = call i32 (...) @_usleep()
%17 = call i32 (...) @MCU_SerialNumber()
%18 = call i32 (...) @USB_Disable()
%19 = call i32 (...) @PROTO_CS_HI()
%20 = call i32 (...) @PROTO_CS_LO()
%21 = call i32 (...) @MUSIC_Beep()
br label %22
22: ; preds = %6, %5
ret void
}

LLVM IR (-O2):
define void @PROTO_Stubs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %19, label %3
3: ; preds = %1
%4 = tail call i32 (...) @CLOCK_StartTimer()
%5 = tail call i32 (...) @spi_disable()
%6 = tail call i32 (...) @spi_set_bidirectional_receive_only_mode()
%7 = tail call i32 (...) @spi_read()
%8 = tail call i32 (...) @spi_set_unidirectional_mode()
%9 = tail call i32 (...) @TELEMETRY_SetUpdated()
%10 = tail call i32 (...) @TELEMETRY_SetType()
%11 = tail call i32 (...) @UART_Stop()
%12 = tail call i32 (...) @rcc_peripheral_disable_clock()
%13 = tail call i32 (...) @_usleep()
%14 = tail call i32 (...) @MCU_SerialNumber()
%15 = tail call i32 (...) @USB_Disable()
%16 = tail call i32 (...) @PROTO_CS_HI()
%17 = tail call i32 (...) @PROTO_CS_LO()
%18 = tail call i32 (...) @MUSIC_Beep()
br label %19
19: ; preds = %1, %3
ret void
}