#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*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ stderr;
void __attribute__((noreturn)) errorexit(char **argv, char *reason) {
  fprintf(stderr, "%s: %s\n", argv[0], reason);
  fprintf(stderr, "%s: Usage: \"%s <file>\n", argv[0], argv[0]);
  fprintf(stderr, "    $LPC_PORT is the serial port (default %s)\n",
          "/dev/ttyUSB0");
  fprintf(stderr,
          "    $LPC_CLK is the clock speed in kHz "
          "(default: %i)\n",
          14746);
  fprintf(stderr, "    $LPC_VERBOSE forces verbose mode (default on)\n");
  fprintf(stderr, "    $LPC_QUIET disables verbose mode\n");
  exit(1);
}


x86 assembly (clang, -O0):
<errorexit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rcx
lea    0xeb5(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
lea    0xe98(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e62(%rip),%rax
mov    (%rax),%edi
lea    0xe98(%rip),%rsi
lea    0xec0(%rip),%rdx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0xeb6(%rip),%rsi
mov    $0x399a,%edx
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e28(%rip),%rax
mov    (%rax),%edi
lea    0xed0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e11(%rip),%rax
mov    (%rax),%edi
lea    0xeec(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<errorexit>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rcx
mov    %rdi,%rbx
mov    0x2eaf(%rip),%r14
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xec2(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
mov    (%rbx),%rcx
lea    0xeb6(%rip),%rsi
mov    %rcx,%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xeb9(%rip),%rsi
lea    0xee1(%rip),%rdx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xedd(%rip),%rsi
mov    $0x399a,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xefd(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r14),%edi
lea    0xf1f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [23 x i8] c"%s: Usage: \22%s <file>\0A\00"
@.str.2 = [47 x i8] c" $LPC_PORT is the serial port (default %s)\0A\00"
@.str.3 = [13 x i8] c"/dev/ttyUSB0\00"
@.str.4 = [54 x i8] c" $LPC_CLK is the clock speed in kHz (default: %i)\0A\00"
@.str.5 = [51 x i8] c" $LPC_VERBOSE forces verbose mode (default on)\0A\00"
@.str.6 = [38 x i8] c" $LPC_QUIET disables verbose mode\0A\00"
define void @errorexit(i8** %0, i8* %1) {
%3 = alloca i8**
%4 = alloca i8*
store i8** %0, i8*** %3
store i8* %1, i8** %4
%5 = load i32, i32* @stderr
%6 = load i8**, i8*** %3
%7 = getelementptr inbounds i8*, i8** %6, i64 0
%8 = load i8*, i8** %7
%9 = load i8*, i8** %4
%10 = call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = load i32, i32* @stderr
%12 = load i8**, i8*** %3
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = load i8**, i8*** %3
%16 = getelementptr inbounds i8*, i8** %15, i64 0
%17 = load i8*, i8** %16
%18 = call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %14, i8* %17)
%19 = load i32, i32* @stderr
%20 = call i32 (i32, i8*, ...) @fprintf(i32 %19, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i32 14746)
%23 = load i32, i32* @stderr
%24 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%25 = load i32, i32* @stderr
%26 = call i32 (i32, i8*, ...) @fprintf(i32 %25, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%27 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [23 x i8] c"%s: Usage: \22%s <file>\0A\00"
@.str.2 = [47 x i8] c" $LPC_PORT is the serial port (default %s)\0A\00"
@.str.3 = [13 x i8] c"/dev/ttyUSB0\00"
@.str.4 = [54 x i8] c" $LPC_CLK is the clock speed in kHz (default: %i)\0A\00"
@.str.5 = [51 x i8] c" $LPC_VERBOSE forces verbose mode (default on)\0A\00"
@.str.6 = [38 x i8] c" $LPC_QUIET disables verbose mode\0A\00"
define void @errorexit(i8** nocapture %0, i8* %1) {
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %0
%5 = tail call i32 (i32, i8*, ...) @fprintf(i32 %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4, i8* %1)
%6 = load i32, i32* @stderr
%7 = load i8*, i8** %0
%8 = tail call i32 (i32, i8*, ...) @fprintf(i32 %6, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i8* %7, i8* %7)
%9 = load i32, i32* @stderr
%10 = tail call i32 (i32, i8*, ...) @fprintf(i32 %9, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0))
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.4, i64 0, i64 0), i32 14746)
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.5, i64 0, i64 0))
%15 = load i32, i32* @stderr
%16 = tail call i32 (i32, i8*, ...) @fprintf(i32 %15, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.6, i64 0, i64 0))
%17 = tail call i32 @exit(i32 1)
unreachable
}