#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*/ SendByte(int);
int /*<<< orphan*/ SendString(char *);
scalar_t__ Serial_Init(char *, int);
int /*<<< orphan*/ Uninit_Serial();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ strcmp(char *, char *);
int main(int argc, char *argv[]) {
  printf(
      "Ultra-simple CFA-632 / CFA-634 command-line communications example.\n");
  printf("Crystalfontz America, Inc. http://www.crystalfontz.com\n\n");
  printf("Usage:\n");
  printf("%s PORT BAUD\n", argv[0]);
  printf("PORT is something like \"/dev/ttyS0\" or \"/dev/usb/ttyUSB1\"\n");
  printf("BAUD is 1200, 2400, 4800, 9600 or 19200\n");
  printf("To clear the display, enter \"clear\" as an optional third "
         "parameter\n\n");
  if (argc < 3) {
    printf("\nMISSING A PARAMETER. Enter both PORT and BAUD.\n\n");
    return (0);
  }
  int cleardisplay = 0;
  if ((argc > 3) && (!strcmp(argv[3], "clear")))
    cleardisplay = 1;
  int baud;
  if (!strcmp(argv[2], "1200"))
    baud = 1200;
  else if (!strcmp(argv[2], "2400"))
    baud = 2400;
  else if (!strcmp(argv[2], "4800"))
    baud = 4800;
  else if (!strcmp(argv[2], "9600"))
    baud = 9600;
  else
    baud = 19200;
  if (Serial_Init(argv[1], baud)) {
    printf("Could not open port \"%s\" at \"%d\" baud.\n", argv[1], baud);
    return (1);
  } else
    printf("\"%s\" opened at \"%d\" baud.\n\n", argv[1], baud);
  SendByte(20);
  SendByte(24);
  SendByte(17);
  SendByte(0);
  SendByte(3);
  if (cleardisplay == 1) {
    SendString("                    ");
  } else {
    SendString("This is Line 4 *****");
  }
  SendByte(17);
  SendByte(0);
  SendByte(2);
  if (cleardisplay == 1) {
    SendString("                    ");
  } else {
    SendString("This is Line 3 *****");
  }
  SendByte(17);
  SendByte(0);
  SendByte(1);
  if (cleardisplay == 1) {
    SendString("                    ");
  } else {
    SendString("This is Line 2 *****");
  }
  SendByte(17);
  SendByte(0);
  SendByte(0);
  if (cleardisplay == 1) {
    SendString("                    ");
  } else {
    SendString("This is Line 1 *****");
  }
  if (cleardisplay == 1)
    printf("Display Cleared.\n");
  printf("Done.\n\n");
  Uninit_Serial();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe83(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xed8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf05(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf20(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
cmpl   $0x3,-0x8(%rbp)
jge    1203 <main+0xa3>
lea    0xf4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1497 <main+0x337>
movl   $0x0,-0x14(%rbp)
cmpl   $0x3,-0x8(%rbp)
jle    1238 <main+0xd8>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
lea    0xf4c(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1238 <main+0xd8>
movl   $0x1,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xf2e(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    1261 <main+0x101>
movl   $0x4b0,-0x18(%rbp)
jmp    12f2 <main+0x192>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xf0a(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    128a <main+0x12a>
movl   $0x960,-0x18(%rbp)
jmp    12ed <main+0x18d>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xee6(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12b3 <main+0x153>
movl   $0x12c0,-0x18(%rbp)
jmp    12e8 <main+0x188>
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
lea    0xec2(%rip),%rsi
call   1060 <strcmp@plt>
cmp    $0x0,%eax
jne    12dc <main+0x17c>
movl   $0x2580,-0x18(%rbp)
jmp    12e3 <main+0x183>
movl   $0x4b00,-0x18(%rbp)
jmp    12e8 <main+0x188>
jmp    12ed <main+0x18d>
jmp    12f2 <main+0x192>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x18(%rbp),%esi
call   1070 <Serial_Init@plt>
cmp    $0x0,%rax
je     1331 <main+0x1d1>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x18(%rbp),%edx
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1497 <main+0x337>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x18(%rbp),%edx
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x14,%edi
call   1050 <SendByte@plt>
mov    $0x18,%edi
call   1050 <SendByte@plt>
mov    $0x11,%edi
call   1050 <SendByte@plt>
xor    %edi,%edi
call   1050 <SendByte@plt>
mov    $0x3,%edi
call   1050 <SendByte@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1394 <main+0x234>
lea    0xe43(%rip),%rdi
call   1080 <SendString@plt>
jmp    13a0 <main+0x240>
lea    0xe47(%rip),%rdi
call   1080 <SendString@plt>
mov    $0x11,%edi
call   1050 <SendByte@plt>
xor    %edi,%edi
call   1050 <SendByte@plt>
mov    $0x2,%edi
call   1050 <SendByte@plt>
cmpl   $0x1,-0x14(%rbp)
jne    13d6 <main+0x276>
lea    0xe01(%rip),%rdi
call   1080 <SendString@plt>
jmp    13e2 <main+0x282>
lea    0xe1a(%rip),%rdi
call   1080 <SendString@plt>
mov    $0x11,%edi
call   1050 <SendByte@plt>
xor    %edi,%edi
call   1050 <SendByte@plt>
mov    $0x1,%edi
call   1050 <SendByte@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1418 <main+0x2b8>
lea    0xdbf(%rip),%rdi
call   1080 <SendString@plt>
jmp    1424 <main+0x2c4>
lea    0xded(%rip),%rdi
call   1080 <SendString@plt>
mov    $0x11,%edi
call   1050 <SendByte@plt>
xor    %edi,%edi
call   1050 <SendByte@plt>
xor    %edi,%edi
call   1050 <SendByte@plt>
cmpl   $0x1,-0x14(%rbp)
jne    1457 <main+0x2f7>
lea    0xd80(%rip),%rdi
call   1080 <SendString@plt>
jmp    1463 <main+0x303>
lea    0xdc3(%rip),%rdi
call   1080 <SendString@plt>
cmpl   $0x1,-0x14(%rbp)
jne    147b <main+0x31b>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <Uninit_Serial@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xf52(%rip),%rdi
call   1030 <puts@plt>
lea    0xf8a(%rip),%rdi
call   1030 <puts@plt>
lea    0xfb6(%rip),%rdi
call   1030 <puts@plt>
mov    (%r14),%rsi
lea    0xe56(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xf9e(%rip),%rdi
call   1030 <puts@plt>
lea    0xfcc(%rip),%rdi
call   1030 <puts@plt>
lea    0xfe8(%rip),%rdi
call   1030 <puts@plt>
cmp    $0x2,%ebp
jg     11ed <main+0x7d>
lea    0x1033(%rip),%rdi
call   1030 <puts@plt>
jmp    13b8 <main+0x248>
cmp    $0x3,%ebp
jne    11f7 <main+0x87>
xor    %r15d,%r15d
jmp    120d <main+0x9d>
mov    0x18(%r14),%rdi
lea    0xe0c(%rip),%rsi
call   1070 <strcmp@plt>
test   %eax,%eax
sete   %r15b
mov    0x10(%r14),%rbx
lea    0xdfc(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     126a <main+0xfa>
lea    0xdee(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1271 <main+0x101>
lea    0xde0(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
je     1278 <main+0x108>
lea    0xdd2(%rip),%rsi
mov    %rbx,%rdi
call   1070 <strcmp@plt>
test   %eax,%eax
mov    $0x2580,%eax
mov    $0x4b00,%ebx
cmove  %eax,%ebx
jmp    127d <main+0x10d>
mov    $0x4b0,%ebx
jmp    127d <main+0x10d>
mov    $0x960,%ebx
jmp    127d <main+0x10d>
mov    $0x12c0,%ebx
mov    0x8(%r14),%rdi
mov    %ebx,%esi
call   1080 <Serial_Init@plt>
mov    0x8(%r14),%rsi
test   %rax,%rax
je     12ab <main+0x13b>
lea    0xd90(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x1,%ebx
jmp    13b8 <main+0x248>
lea    0xd9e(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    $0x14,%edi
call   1060 <SendByte@plt>
mov    $0x18,%edi
call   1060 <SendByte@plt>
mov    $0x11,%edi
call   1060 <SendByte@plt>
xor    %edi,%edi
call   1060 <SendByte@plt>
mov    $0x3,%edi
call   1060 <SendByte@plt>
lea    0xd7b(%rip),%rax
lea    0xd89(%rip),%rdi
test   %r15b,%r15b
cmovne %rax,%rdi
lea    0xd90(%rip),%rbp
cmovne %rax,%rbp
lea    0xd9a(%rip),%rbx
cmovne %rax,%rbx
call   1090 <SendString@plt>
mov    $0x11,%edi
call   1060 <SendByte@plt>
xor    %edi,%edi
call   1060 <SendByte@plt>
mov    $0x2,%edi
call   1060 <SendByte@plt>
mov    %rbp,%rdi
call   1090 <SendString@plt>
mov    $0x11,%edi
call   1060 <SendByte@plt>
xor    %edi,%edi
call   1060 <SendByte@plt>
mov    $0x1,%edi
call   1060 <SendByte@plt>
mov    %rbx,%rdi
call   1090 <SendString@plt>
mov    $0x11,%edi
call   1060 <SendByte@plt>
xor    %edi,%edi
call   1060 <SendByte@plt>
xor    %edi,%edi
call   1060 <SendByte@plt>
test   %r15b,%r15b
je     1397 <main+0x227>
lea    0xce8(%rip),%rdi
call   1090 <SendString@plt>
lea    0xe75(%rip),%rdi
call   1030 <puts@plt>
jmp    13a3 <main+0x233>
lea    0xd22(%rip),%rdi
call   1090 <SendString@plt>
lea    0xe54(%rip),%rdi
call   1030 <puts@plt>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <Uninit_Serial@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [69 x i8] c"Ultra-simple CFA-632 / CFA-634 command-line communications example.\0A\00"
@.str.1 = [57 x i8] c"Crystalfontz America, Inc. http://www.crystalfontz.com\0A\0A\00"
@.str.2 = [8 x i8] c"Usage:\0A\00"
@.str.3 = [14 x i8] c"%s PORT BAUD\0A\00"
@.str.4 = [59 x i8] c"PORT is something like \22/dev/ttyS0\22 or \22/dev/usb/ttyUSB1\22\0A\00"
@.str.5 = [41 x i8] c"BAUD is 1200, 2400, 4800, 9600 or 19200\0A\00"
@.str.6 = [69 x i8] c"To clear the display, enter \22clear\22 as an optional third parameter\0A\0A\00"
@.str.7 = [50 x i8] c"\0AMISSING A PARAMETER. Enter both PORT and BAUD.\0A\0A\00"
@.str.8 = [6 x i8] c"clear\00"
@.str.9 = [5 x i8] c"1200\00"
@.str.10 = [5 x i8] c"2400\00"
@.str.11 = [5 x i8] c"4800\00"
@.str.12 = [5 x i8] c"9600\00"
@.str.13 = [40 x i8] c"Could not open port \22%s\22 at \22%d\22 baud.\0A\00"
@.str.14 = [28 x i8] c"\22%s\22 opened at \22%d\22 baud.\0A\0A\00"
@.str.15 = [21 x i8] c" \00"
@.str.16 = [21 x i8] c"This is Line 4 *****\00"
@.str.17 = [21 x i8] c"This is Line 3 *****\00"
@.str.18 = [21 x i8] c"This is Line 2 *****\00"
@.str.19 = [21 x i8] c"This is Line 1 *****\00"
@.str.20 = [18 x i8] c"Display Cleared.\0A\00"
@.str.21 = [8 x i8] c"Done.\0A\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([57 x i8], [57 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0))
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 0
%13 = load i8*, i8** %12
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %13)
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.5, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.6, i64 0, i64 0))
%18 = load i32, i32* %4
%19 = icmp slt i32 %18, 3
br i1 %19, label %20, label %22
20: ; preds = %2
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.7, i64 0, i64 0))
store i32 0, i32* %3
br label %133
22: ; preds = %2
store i32 0, i32* %6
%23 = load i32, i32* %4
%24 = icmp sgt i32 %23, 3
br i1 %24, label %25, label %32
25: ; preds = %22
%26 = load i8**, i8*** %5
%27 = getelementptr inbounds i8*, i8** %26, i64 3
%28 = load i8*, i8** %27
%29 = call i32 @strcmp(i8* %28, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%30 = icmp ne i32 %29, 0
br i1 %30, label %32, label %31
31: ; preds = %25
store i32 1, i32* %6
br label %32
32: ; preds = %31, %25, %22
%33 = load i8**, i8*** %5
%34 = getelementptr inbounds i8*, i8** %33, i64 2
%35 = load i8*, i8** %34
%36 = call i32 @strcmp(i8* %35, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%37 = icmp ne i32 %36, 0
br i1 %37, label %39, label %38
38: ; preds = %32
store i32 1200, i32* %7
br label %64
39: ; preds = %32
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = call i32 @strcmp(i8* %42, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%44 = icmp ne i32 %43, 0
br i1 %44, label %46, label %45
45: ; preds = %39
store i32 2400, i32* %7
br label %63
46: ; preds = %39
%47 = load i8**, i8*** %5
%48 = getelementptr inbounds i8*, i8** %47, i64 2
%49 = load i8*, i8** %48
%50 = call i32 @strcmp(i8* %49, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%51 = icmp ne i32 %50, 0
br i1 %51, label %53, label %52
52: ; preds = %46
store i32 4800, i32* %7
br label %62
53: ; preds = %46
%54 = load i8**, i8*** %5
%55 = getelementptr inbounds i8*, i8** %54, i64 2
%56 = load i8*, i8** %55
%57 = call i32 @strcmp(i8* %56, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%58 = icmp ne i32 %57, 0
br i1 %58, label %60, label %59
59: ; preds = %53
store i32 9600, i32* %7
br label %61
60: ; preds = %53
store i32 19200, i32* %7
br label %61
61: ; preds = %60, %59
br label %62
62: ; preds = %61, %52
br label %63
63: ; preds = %62, %45
br label %64
64: ; preds = %63, %38
%65 = load i8**, i8*** %5
%66 = getelementptr inbounds i8*, i8** %65, i64 1
%67 = load i8*, i8** %66
%68 = load i32, i32* %7
%69 = call i64 @Serial_Init(i8* %67, i32 %68)
%70 = icmp ne i64 %69, 0
br i1 %70, label %71, label %77
71: ; preds = %64
%72 = load i8**, i8*** %5
%73 = getelementptr inbounds i8*, i8** %72, i64 1
%74 = load i8*, i8** %73
%75 = load i32, i32* %7
%76 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0), i8* %74, i32 %75)
store i32 1, i32* %3
br label %133
77: ; preds = %64
%78 = load i8**, i8*** %5
%79 = getelementptr inbounds i8*, i8** %78, i64 1
%80 = load i8*, i8** %79
%81 = load i32, i32* %7
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i8* %80, i32 %81)
br label %83
83: ; preds = %77
%84 = call i32 @SendByte(i32 20)
%85 = call i32 @SendByte(i32 24)
%86 = call i32 @SendByte(i32 17)
%87 = call i32 @SendByte(i32 0)
%88 = call i32 @SendByte(i32 3)
%89 = load i32, i32* %6
%90 = icmp eq i32 %89, 1
br i1 %90, label %91, label %93
91: ; preds = %83
%92 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %95
93: ; preds = %83
%94 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0))
br label %95
95: ; preds = %93, %91
%96 = call i32 @SendByte(i32 17)
%97 = call i32 @SendByte(i32 0)
%98 = call i32 @SendByte(i32 2)
%99 = load i32, i32* %6
%100 = icmp eq i32 %99, 1
br i1 %100, label %101, label %103
101: ; preds = %95
%102 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %105
103: ; preds = %95
%104 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0))
br label %105
105: ; preds = %103, %101
%106 = call i32 @SendByte(i32 17)
%107 = call i32 @SendByte(i32 0)
%108 = call i32 @SendByte(i32 1)
%109 = load i32, i32* %6
%110 = icmp eq i32 %109, 1
br i1 %110, label %111, label %113
111: ; preds = %105
%112 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %115
113: ; preds = %105
%114 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0))
br label %115
115: ; preds = %113, %111
%116 = call i32 @SendByte(i32 17)
%117 = call i32 @SendByte(i32 0)
%118 = call i32 @SendByte(i32 0)
%119 = load i32, i32* %6
%120 = icmp eq i32 %119, 1
br i1 %120, label %121, label %123
121: ; preds = %115
%122 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
br label %125
123: ; preds = %115
%124 = call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0))
br label %125
125: ; preds = %123, %121
%126 = load i32, i32* %6
%127 = icmp eq i32 %126, 1
br i1 %127, label %128, label %130
128: ; preds = %125
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.20, i64 0, i64 0))
br label %130
130: ; preds = %128, %125
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.21, i64 0, i64 0))
%132 = call i32 (...) @Uninit_Serial()
store i32 0, i32* %3
br label %133
133: ; preds = %130, %71, %20
%134 = load i32, i32* %3
ret i32 %134
}

LLVM IR (-O2):
@.str.3 = [14 x i8] c"%s PORT BAUD\0A\00"
@.str.8 = [6 x i8] c"clear\00"
@.str.9 = [5 x i8] c"1200\00"
@.str.10 = [5 x i8] c"2400\00"
@.str.11 = [5 x i8] c"4800\00"
@.str.12 = [5 x i8] c"9600\00"
@.str.13 = [40 x i8] c"Could not open port \22%s\22 at \22%d\22 baud.\0A\00"
@.str.14 = [28 x i8] c"\22%s\22 opened at \22%d\22 baud.\0A\0A\00"
@.str.15 = [21 x i8] c" \00"
@.str.16 = [21 x i8] c"This is Line 4 *****\00"
@.str.17 = [21 x i8] c"This is Line 3 *****\00"
@.str.18 = [21 x i8] c"This is Line 2 *****\00"
@.str.19 = [21 x i8] c"This is Line 1 *****\00"
@str = [68 x i8] c"Ultra-simple CFA-632 / CFA-634 command-line communications example.\00"
@str.22 = [56 x i8] c"Crystalfontz America, Inc. http://www.crystalfontz.com\0A\00"
@str.23 = [7 x i8] c"Usage:\00"
@str.24 = [58 x i8] c"PORT is something like \22/dev/ttyS0\22 or \22/dev/usb/ttyUSB1\22\00"
@str.25 = [40 x i8] c"BAUD is 1200, 2400, 4800, 9600 or 19200\00"
@str.26 = [68 x i8] c"To clear the display, enter \22clear\22 as an optional third parameter\0A\00"
@str.27 = [7 x i8] c"Done.\0A\00"
@str.28 = [17 x i8] c"Display Cleared.\00"
@str.29 = [49 x i8] c"\0AMISSING A PARAMETER. Enter both PORT and BAUD.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([56 x i8], [56 x i8]* @str.22, i64 0, i64 0))
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.23, i64 0, i64 0))
%6 = load i8*, i8** %1
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.3, i64 0, i64 0), i8* %6)
%8 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([58 x i8], [58 x i8]* @str.24, i64 0, i64 0))
%9 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.25, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([68 x i8], [68 x i8]* @str.26, i64 0, i64 0))
%11 = icmp slt i32 %0, 3
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.29, i64 0, i64 0))
br label %76
14: ; preds = %2
%15 = icmp eq i32 %0, 3
br i1 %15, label %21, label %16
16: ; preds = %14
%17 = getelementptr inbounds i8*, i8** %1, i64 3
%18 = load i8*, i8** %17
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %18, i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.8, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br label %21
21: ; preds = %16, %14
%22 = phi i1 [ false, %14 ], [ %20, %16 ]
%23 = getelementptr inbounds i8*, i8** %1, i64 2
%24 = load i8*, i8** %23
%25 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%26 = icmp eq i32 %25, 0
br i1 %26, label %37, label %27
27: ; preds = %21
%28 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
%29 = icmp eq i32 %28, 0
br i1 %29, label %37, label %30
30: ; preds = %27
%31 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%32 = icmp eq i32 %31, 0
br i1 %32, label %37, label %33
33: ; preds = %30
%34 = tail call i32 @strcmp(i8* dereferenceable(1) %24, i8* dereferenceable(5) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
%35 = icmp eq i32 %34, 0
%36 = select i1 %35, i32 9600, i32 19200
br label %37
37: ; preds = %33, %30, %27, %21
%38 = phi i32 [ 1200, %21 ], [ 2400, %27 ], [ 4800, %30 ], [ %36, %33 ]
%39 = getelementptr inbounds i8*, i8** %1, i64 1
%40 = load i8*, i8** %39
%41 = tail call i64 @Serial_Init(i8* %40, i32 %38)
%42 = icmp eq i64 %41, 0
%43 = load i8*, i8** %39
br i1 %42, label %46, label %44
44: ; preds = %37
%45 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.13, i64 0, i64 0), i8* %43, i32 %38)
br label %76
46: ; preds = %37
%47 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.14, i64 0, i64 0), i8* %43, i32 %38)
%48 = tail call i32 @SendByte(i32 20)
%49 = tail call i32 @SendByte(i32 24)
%50 = tail call i32 @SendByte(i32 17)
%51 = tail call i32 @SendByte(i32 0)
%52 = tail call i32 @SendByte(i32 3)
%53 = select i1 %22, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.16, i64 0, i64 0)
%54 = tail call i32 @SendString(i8* %53)
%55 = tail call i32 @SendByte(i32 17)
%56 = tail call i32 @SendByte(i32 0)
%57 = tail call i32 @SendByte(i32 2)
%58 = select i1 %22, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0)
%59 = tail call i32 @SendString(i8* %58)
%60 = tail call i32 @SendByte(i32 17)
%61 = tail call i32 @SendByte(i32 0)
%62 = tail call i32 @SendByte(i32 1)
%63 = select i1 %22, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.18, i64 0, i64 0)
%64 = tail call i32 @SendString(i8* %63)
%65 = tail call i32 @SendByte(i32 17)
%66 = tail call i32 @SendByte(i32 0)
%67 = tail call i32 @SendByte(i32 0)
br i1 %22, label %70, label %68
68: ; preds = %46
%69 = tail call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.19, i64 0, i64 0))
br label %73
70: ; preds = %46
%71 = tail call i32 @SendString(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
%72 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str.28, i64 0, i64 0))
br label %73
73: ; preds = %68, %70
%74 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.27, i64 0, i64 0))
%75 = tail call i32 (...) @Uninit_Serial()
br label %76
76: ; preds = %44, %73, %12
%77 = phi i32 [ 0, %12 ], [ 1, %44 ], [ 0, %73 ]
ret i32 %77
}