#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 */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ OutCRLF();
int /*<<< orphan*/ PLL_Init();
int /*<<< orphan*/ UART_InString(char *, int);
int /*<<< orphan*/ UART_InUDec();
int /*<<< orphan*/ UART_InUHex();
int /*<<< orphan*/ UART_Init();
int /*<<< orphan*/ UART_OutChar(char);
int /*<<< orphan*/ UART_OutString(char *);
int /*<<< orphan*/ UART_OutUDec(int /*<<< orphan*/);
int /*<<< orphan*/ UART_OutUHex(int /*<<< orphan*/);
int main(void) {
  char ch;
  char string[20];
  uint32_t n;
  PLL_Init();
  UART_Init();
  OutCRLF();
  for (ch = 'A'; ch <= 'Z'; ch = ch + 1) {
    UART_OutChar(ch);
  }
  OutCRLF();
  UART_OutChar(' ');
  for (ch = 'a'; ch <= 'z'; ch = ch + 1) {
    UART_OutChar(ch);
  }
  OutCRLF();
  UART_OutChar('-');
  UART_OutChar('-');
  UART_OutChar('>');
  while (1) {
    UART_OutString("InString: ");
    UART_InString(string, 19);
    UART_OutString(" OutString=");
    UART_OutString(string);
    OutCRLF();
    UART_OutString("InUDec: ");
    n = UART_InUDec();
    UART_OutString(" OutUDec=");
    UART_OutUDec(n);
    OutCRLF();
    UART_OutString("InUHex: ");
    n = UART_InUHex();
    UART_OutString(" OutUHex=");
    UART_OutUHex(n);
    OutCRLF();
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   10b0 <PLL_Init@plt>
mov    $0x0,%al
call   10a0 <UART_Init@plt>
mov    $0x0,%al
call   1070 <OutCRLF@plt>
movb   $0x41,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jg     11ed <main+0x4d>
movsbl -0x5(%rbp),%edi
call   1030 <UART_OutChar@plt>
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x5(%rbp)
jmp    11c8 <main+0x28>
mov    $0x0,%al
call   1070 <OutCRLF@plt>
mov    $0x20,%edi
call   1030 <UART_OutChar@plt>
movb   $0x61,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1227 <main+0x87>
movsbl -0x5(%rbp),%edi
call   1030 <UART_OutChar@plt>
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %al,-0x5(%rbp)
jmp    1202 <main+0x62>
mov    $0x0,%al
call   1070 <OutCRLF@plt>
mov    $0x2d,%edi
call   1030 <UART_OutChar@plt>
mov    $0x2d,%edi
call   1030 <UART_OutChar@plt>
mov    $0x3e,%edi
call   1030 <UART_OutChar@plt>
lea    0xdad(%rip),%rdi
call   1050 <UART_OutString@plt>
lea    -0x20(%rbp),%rdi
mov    $0x13,%esi
call   1060 <UART_InString@plt>
lea    0xd9e(%rip),%rdi
call   1050 <UART_OutString@plt>
lea    -0x20(%rbp),%rdi
call   1050 <UART_OutString@plt>
mov    $0x0,%al
call   1070 <OutCRLF@plt>
lea    0xd8e(%rip),%rdi
call   1050 <UART_OutString@plt>
mov    $0x0,%al
call   10c0 <UART_InUDec@plt>
mov    %eax,-0x24(%rbp)
lea    0xd81(%rip),%rdi
call   1050 <UART_OutString@plt>
mov    -0x24(%rbp),%edi
call   1080 <UART_OutUDec@plt>
mov    $0x0,%al
call   1070 <OutCRLF@plt>
lea    0xd70(%rip),%rdi
call   1050 <UART_OutString@plt>
mov    $0x0,%al
call   1040 <UART_InUHex@plt>
mov    %eax,-0x24(%rbp)
lea    0xd63(%rip),%rdi
call   1050 <UART_OutString@plt>
mov    -0x24(%rbp),%edi
call   1090 <UART_OutUHex@plt>
mov    $0x0,%al
call   1070 <OutCRLF@plt>
jmp    124c <main+0xac>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   10b0 <PLL_Init@plt>
xor    %eax,%eax
call   10a0 <UART_Init@plt>
xor    %eax,%eax
call   1070 <OutCRLF@plt>
mov    $0x41,%edi
call   1030 <UART_OutChar@plt>
mov    $0x42,%edi
call   1030 <UART_OutChar@plt>
mov    $0x43,%edi
call   1030 <UART_OutChar@plt>
mov    $0x44,%edi
call   1030 <UART_OutChar@plt>
mov    $0x45,%edi
call   1030 <UART_OutChar@plt>
mov    $0x46,%edi
call   1030 <UART_OutChar@plt>
mov    $0x47,%edi
call   1030 <UART_OutChar@plt>
mov    $0x48,%edi
call   1030 <UART_OutChar@plt>
mov    $0x49,%edi
call   1030 <UART_OutChar@plt>
mov    $0x4a,%edi
call   1030 <UART_OutChar@plt>
mov    $0x4b,%edi
call   1030 <UART_OutChar@plt>
mov    $0x4c,%edi
call   1030 <UART_OutChar@plt>
mov    $0x4d,%edi
call   1030 <UART_OutChar@plt>
mov    $0x4e,%edi
call   1030 <UART_OutChar@plt>
mov    $0x4f,%edi
call   1030 <UART_OutChar@plt>
mov    $0x50,%edi
call   1030 <UART_OutChar@plt>
mov    $0x51,%edi
call   1030 <UART_OutChar@plt>
mov    $0x52,%edi
call   1030 <UART_OutChar@plt>
mov    $0x53,%edi
call   1030 <UART_OutChar@plt>
mov    $0x54,%edi
call   1030 <UART_OutChar@plt>
mov    $0x55,%edi
call   1030 <UART_OutChar@plt>
mov    $0x56,%edi
call   1030 <UART_OutChar@plt>
mov    $0x57,%edi
call   1030 <UART_OutChar@plt>
mov    $0x58,%edi
call   1030 <UART_OutChar@plt>
mov    $0x59,%edi
call   1030 <UART_OutChar@plt>
mov    $0x5a,%edi
call   1030 <UART_OutChar@plt>
xor    %eax,%eax
call   1070 <OutCRLF@plt>
mov    $0x20,%edi
call   1030 <UART_OutChar@plt>
mov    $0x61,%edi
call   1030 <UART_OutChar@plt>
mov    $0x62,%edi
call   1030 <UART_OutChar@plt>
mov    $0x63,%edi
call   1030 <UART_OutChar@plt>
mov    $0x64,%edi
call   1030 <UART_OutChar@plt>
mov    $0x65,%edi
call   1030 <UART_OutChar@plt>
mov    $0x66,%edi
call   1030 <UART_OutChar@plt>
mov    $0x67,%edi
call   1030 <UART_OutChar@plt>
mov    $0x68,%edi
call   1030 <UART_OutChar@plt>
mov    $0x69,%edi
call   1030 <UART_OutChar@plt>
mov    $0x6a,%edi
call   1030 <UART_OutChar@plt>
mov    $0x6b,%edi
call   1030 <UART_OutChar@plt>
mov    $0x6c,%edi
call   1030 <UART_OutChar@plt>
mov    $0x6d,%edi
call   1030 <UART_OutChar@plt>
mov    $0x6e,%edi
call   1030 <UART_OutChar@plt>
mov    $0x6f,%edi
call   1030 <UART_OutChar@plt>
mov    $0x70,%edi
call   1030 <UART_OutChar@plt>
mov    $0x71,%edi
call   1030 <UART_OutChar@plt>
mov    $0x72,%edi
call   1030 <UART_OutChar@plt>
mov    $0x73,%edi
call   1030 <UART_OutChar@plt>
mov    $0x74,%edi
call   1030 <UART_OutChar@plt>
mov    $0x75,%edi
call   1030 <UART_OutChar@plt>
mov    $0x76,%edi
call   1030 <UART_OutChar@plt>
mov    $0x77,%edi
call   1030 <UART_OutChar@plt>
mov    $0x78,%edi
call   1030 <UART_OutChar@plt>
mov    $0x79,%edi
call   1030 <UART_OutChar@plt>
mov    $0x7a,%edi
call   1030 <UART_OutChar@plt>
xor    %eax,%eax
call   1070 <OutCRLF@plt>
mov    $0x2d,%edi
call   1030 <UART_OutChar@plt>
mov    $0x2d,%edi
call   1030 <UART_OutChar@plt>
mov    $0x3e,%edi
call   1030 <UART_OutChar@plt>
mov    %rsp,%rbx
lea    0xc15(%rip),%r13
lea    0xc18(%rip),%r12
lea    0xc1a(%rip),%r14
nopl   0x0(%rax)
lea    0xbd9(%rip),%rdi
call   1050 <UART_OutString@plt>
mov    %rbx,%rdi
mov    $0x13,%esi
call   1060 <UART_InString@plt>
lea    0xbcb(%rip),%rdi
call   1050 <UART_OutString@plt>
mov    %rbx,%rdi
call   1050 <UART_OutString@plt>
xor    %eax,%eax
call   1070 <OutCRLF@plt>
lea    0xbbc(%rip),%rdi
call   1050 <UART_OutString@plt>
xor    %eax,%eax
call   10c0 <UART_InUDec@plt>
mov    %eax,%r15d
mov    %r13,%rdi
call   1050 <UART_OutString@plt>
mov    %r15d,%edi
call   1080 <UART_OutUDec@plt>
xor    %eax,%eax
call   1070 <OutCRLF@plt>
mov    %r12,%rdi
call   1050 <UART_OutString@plt>
xor    %eax,%eax
call   1040 <UART_InUHex@plt>
mov    %eax,%ebp
mov    %r14,%rdi
call   1050 <UART_OutString@plt>
mov    %ebp,%edi
call   1090 <UART_OutUHex@plt>
xor    %eax,%eax
call   1070 <OutCRLF@plt>
jmp    1420 <main+0x280>

LLVM IR (-O0):
@.str = [11 x i8] c"InString: \00"
@.str.1 = [12 x i8] c" OutString=\00"
@.str.2 = [9 x i8] c"InUDec: \00"
@.str.3 = [10 x i8] c" OutUDec=\00"
@.str.4 = [9 x i8] c"InUHex: \00"
@.str.5 = [10 x i8] c" OutUHex=\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [20 x i8]
%4 = alloca i32
store i32 0, i32* %1
%5 = call i32 (...) @PLL_Init()
%6 = call i32 (...) @UART_Init()
%7 = call i32 (...) @OutCRLF()
store i8 65, i8* %2
br label %8
8: ; preds = %15, %0
%9 = load i8, i8* %2
%10 = sext i8 %9 to i32
%11 = icmp sle i32 %10, 90
br i1 %11, label %12, label %20
12: ; preds = %8
%13 = load i8, i8* %2
%14 = call i32 @UART_OutChar(i8 signext %13)
br label %15
15: ; preds = %12
%16 = load i8, i8* %2
%17 = sext i8 %16 to i32
%18 = add nsw i32 %17, 1
%19 = trunc i32 %18 to i8
store i8 %19, i8* %2
br label %8
20: ; preds = %8
%21 = call i32 (...) @OutCRLF()
%22 = call i32 @UART_OutChar(i8 signext 32)
store i8 97, i8* %2
br label %23
23: ; preds = %30, %20
%24 = load i8, i8* %2
%25 = sext i8 %24 to i32
%26 = icmp sle i32 %25, 122
br i1 %26, label %27, label %35
27: ; preds = %23
%28 = load i8, i8* %2
%29 = call i32 @UART_OutChar(i8 signext %28)
br label %30
30: ; preds = %27
%31 = load i8, i8* %2
%32 = sext i8 %31 to i32
%33 = add nsw i32 %32, 1
%34 = trunc i32 %33 to i8
store i8 %34, i8* %2
br label %23
35: ; preds = %23
%36 = call i32 (...) @OutCRLF()
%37 = call i32 @UART_OutChar(i8 signext 45)
%38 = call i32 @UART_OutChar(i8 signext 45)
%39 = call i32 @UART_OutChar(i8 signext 62)
br label %40
40: ; preds = %35, %40
%41 = call i32 @UART_OutString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%42 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%43 = call i32 @UART_InString(i8* %42, i32 19)
%44 = call i32 @UART_OutString(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%45 = getelementptr inbounds [20 x i8], [20 x i8]* %3, i64 0, i64 0
%46 = call i32 @UART_OutString(i8* %45)
%47 = call i32 (...) @OutCRLF()
%48 = call i32 @UART_OutString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%49 = call i32 (...) @UART_InUDec()
store i32 %49, i32* %4
%50 = call i32 @UART_OutString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%51 = load i32, i32* %4
%52 = call i32 @UART_OutUDec(i32 %51)
%53 = call i32 (...) @OutCRLF()
%54 = call i32 @UART_OutString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%55 = call i32 (...) @UART_InUHex()
store i32 %55, i32* %4
%56 = call i32 @UART_OutString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%57 = load i32, i32* %4
%58 = call i32 @UART_OutUHex(i32 %57)
%59 = call i32 (...) @OutCRLF()
br label %40
}

LLVM IR (-O2):
@.str = [11 x i8] c"InString: \00"
@.str.1 = [12 x i8] c" OutString=\00"
@.str.2 = [9 x i8] c"InUDec: \00"
@.str.3 = [10 x i8] c" OutUDec=\00"
@.str.4 = [9 x i8] c"InUHex: \00"
@.str.5 = [10 x i8] c" OutUHex=\00"
define i32 @main() {
%1 = alloca [20 x i8]
%2 = getelementptr inbounds [20 x i8], [20 x i8]* %1, i64 0, i64 0
%3 = tail call i32 (...) @PLL_Init()
%4 = tail call i32 (...) @UART_Init()
%5 = tail call i32 (...) @OutCRLF()
%6 = tail call i32 @UART_OutChar(i8 signext 65)
%7 = tail call i32 @UART_OutChar(i8 signext 66)
%8 = tail call i32 @UART_OutChar(i8 signext 67)
%9 = tail call i32 @UART_OutChar(i8 signext 68)
%10 = tail call i32 @UART_OutChar(i8 signext 69)
%11 = tail call i32 @UART_OutChar(i8 signext 70)
%12 = tail call i32 @UART_OutChar(i8 signext 71)
%13 = tail call i32 @UART_OutChar(i8 signext 72)
%14 = tail call i32 @UART_OutChar(i8 signext 73)
%15 = tail call i32 @UART_OutChar(i8 signext 74)
%16 = tail call i32 @UART_OutChar(i8 signext 75)
%17 = tail call i32 @UART_OutChar(i8 signext 76)
%18 = tail call i32 @UART_OutChar(i8 signext 77)
%19 = tail call i32 @UART_OutChar(i8 signext 78)
%20 = tail call i32 @UART_OutChar(i8 signext 79)
%21 = tail call i32 @UART_OutChar(i8 signext 80)
%22 = tail call i32 @UART_OutChar(i8 signext 81)
%23 = tail call i32 @UART_OutChar(i8 signext 82)
%24 = tail call i32 @UART_OutChar(i8 signext 83)
%25 = tail call i32 @UART_OutChar(i8 signext 84)
%26 = tail call i32 @UART_OutChar(i8 signext 85)
%27 = tail call i32 @UART_OutChar(i8 signext 86)
%28 = tail call i32 @UART_OutChar(i8 signext 87)
%29 = tail call i32 @UART_OutChar(i8 signext 88)
%30 = tail call i32 @UART_OutChar(i8 signext 89)
%31 = tail call i32 @UART_OutChar(i8 signext 90)
%32 = tail call i32 (...) @OutCRLF()
%33 = tail call i32 @UART_OutChar(i8 signext 32)
%34 = tail call i32 @UART_OutChar(i8 signext 97)
%35 = tail call i32 @UART_OutChar(i8 signext 98)
%36 = tail call i32 @UART_OutChar(i8 signext 99)
%37 = tail call i32 @UART_OutChar(i8 signext 100)
%38 = tail call i32 @UART_OutChar(i8 signext 101)
%39 = tail call i32 @UART_OutChar(i8 signext 102)
%40 = tail call i32 @UART_OutChar(i8 signext 103)
%41 = tail call i32 @UART_OutChar(i8 signext 104)
%42 = tail call i32 @UART_OutChar(i8 signext 105)
%43 = tail call i32 @UART_OutChar(i8 signext 106)
%44 = tail call i32 @UART_OutChar(i8 signext 107)
%45 = tail call i32 @UART_OutChar(i8 signext 108)
%46 = tail call i32 @UART_OutChar(i8 signext 109)
%47 = tail call i32 @UART_OutChar(i8 signext 110)
%48 = tail call i32 @UART_OutChar(i8 signext 111)
%49 = tail call i32 @UART_OutChar(i8 signext 112)
%50 = tail call i32 @UART_OutChar(i8 signext 113)
%51 = tail call i32 @UART_OutChar(i8 signext 114)
%52 = tail call i32 @UART_OutChar(i8 signext 115)
%53 = tail call i32 @UART_OutChar(i8 signext 116)
%54 = tail call i32 @UART_OutChar(i8 signext 117)
%55 = tail call i32 @UART_OutChar(i8 signext 118)
%56 = tail call i32 @UART_OutChar(i8 signext 119)
%57 = tail call i32 @UART_OutChar(i8 signext 120)
%58 = tail call i32 @UART_OutChar(i8 signext 121)
%59 = tail call i32 @UART_OutChar(i8 signext 122)
%60 = tail call i32 (...) @OutCRLF()
%61 = tail call i32 @UART_OutChar(i8 signext 45)
%62 = tail call i32 @UART_OutChar(i8 signext 45)
%63 = tail call i32 @UART_OutChar(i8 signext 62)
br label %64
64: ; preds = %64, %0
%65 = call i32 @UART_OutString(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%66 = call i32 @UART_InString(i8* %2, i32 19)
%67 = call i32 @UART_OutString(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%68 = call i32 @UART_OutString(i8* %2)
%69 = call i32 (...) @OutCRLF()
%70 = call i32 @UART_OutString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0))
%71 = call i32 (...) @UART_InUDec()
%72 = call i32 @UART_OutString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%73 = call i32 @UART_OutUDec(i32 %71)
%74 = call i32 (...) @OutCRLF()
%75 = call i32 @UART_OutString(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0))
%76 = call i32 (...) @UART_InUHex()
%77 = call i32 @UART_OutString(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
%78 = call i32 @UART_OutUHex(i32 %76)
%79 = call i32 (...) @OutCRLF()
br label %64
}