#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*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf(
      "Usage: brfpatch INPUT OUTPUT\n"
      "\n"
      "\tGenerates bluetooth firmware\n"
      "\n"
      "INPUT: Bluetooth script in ASCII format.\n"
      "       For TI BRF chips this can be generated from .bts files using the "
      "TI Bluetooth\n"
      "       script pad to save as .txt. This txt file can be used as input.\n"
      "       Alternately, run strings on the .bts and manually edit to change "
      "decimal\n"
      "       arguments into hex of the appropriate number of octets.\n"
      "       FORMAT: Send_HCI_xxxx OPCODE DATA1 DATA2 DATA3 ...\n"
      "       where OPCODE, DATA1 etc are one of:\n"
      "       0x12          (1 byte)\n"
      "       0x1234        (2 byte)\n"
      "       0x12345678    (4 byte)\n"
      "       \"0123456789ABCDEF0123\"            (multibyte)\n"
      "       \"01:23:45:67:89:AB:CD:EF:01:23\"   (multibyte)\n"
      "\n"
      "OUTPUT: Binary firmware\n"
      "        FORMAT: 0x01 OPCODE DATA_LEN DATA\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [766 x i8] c"Usage: brfpatch INPUT OUTPUT\0A\0A\09Generates bluetooth firmware\0A\0AINPUT: Bluetooth script in ASCII format.\0A For TI BRF chips this can be generated from .bts files using the TI Bluetooth\0A script pad to save as .txt. This txt file can be used as input.\0A Alternately, run strings on the .bts and manually edit to change decimal\0A arguments into hex of the appropriate number of octets.\0A FORMAT: Send_HCI_xxxx OPCODE DATA1 DATA2 DATA3 ...\0A where OPCODE, DATA1 etc are one of:\0A 0x12 (1 byte)\0A 0x1234 (2 byte)\0A 0x12345678 (4 byte)\0A \220123456789ABCDEF0123\22 (multibyte)\0A \2201:23:45:67:89:AB:CD:EF:01:23\22 (multibyte)\0A\0AOUTPUT: Binary firmware\0A FORMAT: 0x01 OPCODE DATA_LEN DATA\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([766 x i8], [766 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [765 x i8] c"Usage: brfpatch INPUT OUTPUT\0A\0A\09Generates bluetooth firmware\0A\0AINPUT: Bluetooth script in ASCII format.\0A For TI BRF chips this can be generated from .bts files using the TI Bluetooth\0A script pad to save as .txt. This txt file can be used as input.\0A Alternately, run strings on the .bts and manually edit to change decimal\0A arguments into hex of the appropriate number of octets.\0A FORMAT: Send_HCI_xxxx OPCODE DATA1 DATA2 DATA3 ...\0A where OPCODE, DATA1 etc are one of:\0A 0x12 (1 byte)\0A 0x1234 (2 byte)\0A 0x12345678 (4 byte)\0A \220123456789ABCDEF0123\22 (multibyte)\0A \2201:23:45:67:89:AB:CD:EF:01:23\22 (multibyte)\0A\0AOUTPUT: Binary firmware\0A FORMAT: 0x01 OPCODE DATA_LEN DATA\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([765 x i8], [765 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}