#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*/ show_motors_help();
int /*<<< orphan*/ uart_write(char *);
void show_help() {
  uart_write("\n\n");
  uart_write("Command protocol: [ addr command");
  uart_write(" data ]\n\t broadcast addr: "
             "b"
             "\n");
  uart_write("commands:\n");
  uart_write("0/1 - command for given motor:\n");
  show_motors_help();
  uart_write("r - reset MCU\n");
  uart_write("G - get board address\n");
  uart_write("L 0/1 - LED on/off\n");
  uart_write("P ch val - PWM on channel ch\n");
  uart_write("T - time counter value\n\n");
}


x86 assembly (clang, -O0):
<show_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xfac(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xec9(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xede(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xeef(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xeee(%rip),%rdi
call   1040 <uart_write@plt>
mov    $0x0,%al
call   1030 <show_motors_help@plt>
lea    0xefb(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xefe(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xf09(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xf11(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xf23(%rip),%rdi
call   1040 <uart_write@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xfaf(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xecc(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xee1(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xef2(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xef1(%rip),%rdi
call   1040 <uart_write@plt>
xor    %eax,%eax
call   1030 <show_motors_help@plt>
lea    0xefe(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xf01(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xf0c(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xf14(%rip),%rdi
call   1040 <uart_write@plt>
lea    0xf26(%rip),%rdi
pop    %rax
jmp    1040 <uart_write@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [33 x i8] c"Command protocol: [ addr command\00"
@.str.2 = [29 x i8] c" data ]\0A\09 broadcast addr: b\0A\00"
@.str.3 = [11 x i8] c"commands:\0A\00"
@.str.4 = [32 x i8] c"0/1 - command for given motor:\0A\00"
@.str.5 = [15 x i8] c"r - reset MCU\0A\00"
@.str.6 = [23 x i8] c"G - get board address\0A\00"
@.str.7 = [20 x i8] c"L 0/1 - LED on/off\0A\00"
@.str.8 = [30 x i8] c"P ch val - PWM on channel ch\0A\00"
@.str.9 = [25 x i8] c"T - time counter value\0A\0A\00"
define void @show_help() {
%1 = call i32 @uart_write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @uart_write(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @uart_write(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @uart_write(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%5 = call i32 @uart_write(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%6 = call i32 (...) @show_motors_help()
%7 = call i32 @uart_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%8 = call i32 @uart_write(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%9 = call i32 @uart_write(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%10 = call i32 @uart_write(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%11 = call i32 @uart_write(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"\0A\0A\00"
@.str.1 = [33 x i8] c"Command protocol: [ addr command\00"
@.str.2 = [29 x i8] c" data ]\0A\09 broadcast addr: b\0A\00"
@.str.3 = [11 x i8] c"commands:\0A\00"
@.str.4 = [32 x i8] c"0/1 - command for given motor:\0A\00"
@.str.5 = [15 x i8] c"r - reset MCU\0A\00"
@.str.6 = [23 x i8] c"G - get board address\0A\00"
@.str.7 = [20 x i8] c"L 0/1 - LED on/off\0A\00"
@.str.8 = [30 x i8] c"P ch val - PWM on channel ch\0A\00"
@.str.9 = [25 x i8] c"T - time counter value\0A\0A\00"
define void @show_help() {
%1 = tail call i32 @uart_write(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @uart_write(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @uart_write(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @uart_write(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call i32 @uart_write(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.4, i64 0, i64 0))
%6 = tail call i32 (...) @show_motors_help()
%7 = tail call i32 @uart_write(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%8 = tail call i32 @uart_write(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
%9 = tail call i32 @uart_write(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
%10 = tail call i32 @uart_write(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.8, i64 0, i64 0))
%11 = tail call i32 @uart_write(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.9, i64 0, i64 0))
ret void
}