#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*/ ar1010_readall();
char ar1010_rssi();
int /*<<< orphan*/ ar1010_seek();
int /*<<< orphan*/ ar1010_setvolume(char);
int /*<<< orphan*/ ar1010_status();
int /*<<< orphan*/ ar1010_tune_hilo(int);
int /*<<< orphan*/ ar1010_tuneto(int);
int /*<<< orphan*/ ar1010_write_array();
int /*<<< orphan*/ i2c1_setaddr(int);
int /*<<< orphan*/ print_array();
int /*<<< orphan*/ set_array_value();
char uart_getc();
int /*<<< orphan*/ uart_putc(char);
int /*<<< orphan*/ uart_puts(char *);
int /*<<< orphan*/ uart_puts_val(char);
void ar1010_main(void) {
  char option;
  char vol = 21;
  i2c1_setaddr(0x10);
  while (1) {
    uart_puts("\r\n\r\n----AR1010 Configuration----");
    uart_puts("\r\n1) Send array values");
    uart_puts("\r\n2) Read array values");
    uart_puts("\r\n3) Set array value");
    uart_puts("\r\n4) Read All Register values");
    uart_puts("\r\n5) Begin Seek");
    uart_puts("\r\n6) Tune to 97.3");
    uart_puts("\r\n7) Check Status");
    uart_puts("\r\n8) Raise volume");
    uart_puts("\r\n9) Lower volume");
    uart_puts("\r\na) Check RSSI");
    uart_puts("\r\nb) Special tune hi/low to 97.3");
    uart_puts("\r\n");
    option = uart_getc();
    uart_putc(option);
    uart_puts("\r\n");
    if (option == '1') {
      uart_puts("\r\n\r\n\tSending Array Values\r\n");
      ar1010_write_array();
      uart_puts("\r\n\t\tDone\r\n");
    } else if (option == '2') {
      print_array();
    } else if (option == '3') {
      set_array_value();
    } else if (option == '4') {
      uart_puts("\r\n\r\n\tRead All\r\n");
      ar1010_readall();
    } else if (option == '5') {
      ar1010_seek();
    } else if (option == '6') {
      uart_puts("\r\n\t Tune to 97.3\r\n");
      ar1010_tuneto(973);
    } else if (option == '7') {
      ar1010_status();
    } else if (option == '8') {
      if (vol < 21)
        ar1010_setvolume(++vol);
      uart_puts("\r\nVolume = ");
      uart_puts_val(vol);
    } else if (option == '9') {
      if (vol > 0)
        ar1010_setvolume(--vol);
      uart_puts("\r\nVolume = ");
      uart_puts_val(vol);
    } else if (option == 'a') {
      option = ar1010_rssi();
      uart_puts("\r\nRSSI = ");
      uart_puts_val(option);
    } else if (option == 'b') {
      ar1010_tune_hilo(973);
    }
  }
}


x86 assembly (clang, -O0):
<ar1010_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movb   $0x15,-0x2(%rbp)
mov    $0x10,%edi
call   10c0 <i2c1_setaddr@plt>
lea    0xdf3(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe08(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe13(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe1e(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe27(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe39(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe3d(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe43(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe49(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe4f(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe55(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xe59(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xeb5(%rip),%rdi
call   1100 <uart_puts@plt>
mov    $0x0,%al
call   10a0 <uart_getc@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <uart_putc@plt>
lea    0xe96(%rip),%rdi
call   1100 <uart_puts@plt>
movsbl -0x1(%rbp),%eax
cmp    $0x31,%eax
jne    12f2 <ar1010_main+0x102>
lea    0xe36(%rip),%rdi
call   1100 <uart_puts@plt>
mov    $0x0,%al
call   1040 <ar1010_write_array@plt>
lea    0xe3f(%rip),%rdi
call   1100 <uart_puts@plt>
jmp    14a5 <ar1010_main+0x2b5>
movsbl -0x1(%rbp),%eax
cmp    $0x32,%eax
jne    130b <ar1010_main+0x11b>
mov    $0x0,%al
call   1050 <print_array@plt>
jmp    14a0 <ar1010_main+0x2b0>
movsbl -0x1(%rbp),%eax
cmp    $0x33,%eax
jne    1324 <ar1010_main+0x134>
mov    $0x0,%al
call   10f0 <set_array_value@plt>
jmp    149b <ar1010_main+0x2ab>
movsbl -0x1(%rbp),%eax
cmp    $0x34,%eax
jne    1349 <ar1010_main+0x159>
lea    0xdfa(%rip),%rdi
call   1100 <uart_puts@plt>
mov    $0x0,%al
call   10d0 <ar1010_readall@plt>
jmp    1496 <ar1010_main+0x2a6>
movsbl -0x1(%rbp),%eax
cmp    $0x35,%eax
jne    1362 <ar1010_main+0x172>
mov    $0x0,%al
call   1090 <ar1010_seek@plt>
jmp    1491 <ar1010_main+0x2a1>
movsbl -0x1(%rbp),%eax
cmp    $0x36,%eax
jne    138a <ar1010_main+0x19a>
lea    0xdcc(%rip),%rdi
call   1100 <uart_puts@plt>
mov    $0x3cd,%edi
call   1110 <ar1010_tuneto@plt>
jmp    148c <ar1010_main+0x29c>
movsbl -0x1(%rbp),%eax
cmp    $0x37,%eax
jne    13a3 <ar1010_main+0x1b3>
mov    $0x0,%al
call   10b0 <ar1010_status@plt>
jmp    1487 <ar1010_main+0x297>
movsbl -0x1(%rbp),%eax
cmp    $0x38,%eax
jne    13e7 <ar1010_main+0x1f7>
movsbl -0x2(%rbp),%eax
cmp    $0x15,%eax
jge    13cd <ar1010_main+0x1dd>
mov    -0x2(%rbp),%al
add    $0x1,%al
mov    %al,-0x2(%rbp)
movsbl %al,%edi
call   1070 <ar1010_setvolume@plt>
lea    0xd81(%rip),%rdi
call   1100 <uart_puts@plt>
movsbl -0x2(%rbp),%edi
call   1060 <uart_puts_val@plt>
jmp    1482 <ar1010_main+0x292>
movsbl -0x1(%rbp),%eax
cmp    $0x39,%eax
jne    142b <ar1010_main+0x23b>
movsbl -0x2(%rbp),%eax
cmp    $0x0,%eax
jle    1411 <ar1010_main+0x221>
mov    -0x2(%rbp),%al
add    $0xff,%al
mov    %al,-0x2(%rbp)
movsbl %al,%edi
call   1070 <ar1010_setvolume@plt>
lea    0xd3d(%rip),%rdi
call   1100 <uart_puts@plt>
movsbl -0x2(%rbp),%edi
call   1060 <uart_puts_val@plt>
jmp    147d <ar1010_main+0x28d>
movsbl -0x1(%rbp),%eax
cmp    $0x61,%eax
jne    145c <ar1010_main+0x26c>
mov    $0x0,%al
call   10e0 <ar1010_rssi@plt>
mov    %al,-0x1(%rbp)
lea    0xd18(%rip),%rdi
call   1100 <uart_puts@plt>
movsbl -0x1(%rbp),%edi
call   1060 <uart_puts_val@plt>
jmp    1478 <ar1010_main+0x288>
movsbl -0x1(%rbp),%eax
cmp    $0x62,%eax
jne    1473 <ar1010_main+0x283>
mov    $0x3cd,%edi
call   1080 <ar1010_tune_hilo@plt>
jmp    1478 <ar1010_main+0x288>
jmp    147d <ar1010_main+0x28d>
jmp    1482 <ar1010_main+0x292>
jmp    1487 <ar1010_main+0x297>
jmp    148c <ar1010_main+0x29c>
jmp    1491 <ar1010_main+0x2a1>
jmp    1496 <ar1010_main+0x2a6>
jmp    149b <ar1010_main+0x2ab>
jmp    14a0 <ar1010_main+0x2b0>
jmp    14a5 <ar1010_main+0x2b5>
jmp    1206 <ar1010_main+0x16>

x86 assembly (clang, -O2):
<ar1010_main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x10,%edi
call   10c0 <i2c1_setaddr@plt>
mov    $0x15,%r13b
lea    0xeb9(%rip),%rbx
lea    0xed3(%rip),%rbp
lea    0xffd(%rip),%r14
lea    0xddc(%rip),%r12
jmp    1230 <ar1010_main+0x40>
mov    $0x3cd,%edi
call   1080 <ar1010_tune_hilo@plt>
mov    %rbx,%rdi
call   1100 <uart_puts@plt>
mov    %rbp,%rdi
call   1100 <uart_puts@plt>
lea    0xeb9(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xec4(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xecd(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xedf(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xee3(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xee9(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xeef(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xef5(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xefb(%rip),%rdi
call   1100 <uart_puts@plt>
lea    0xeff(%rip),%rdi
call   1100 <uart_puts@plt>
mov    %r14,%rdi
call   1100 <uart_puts@plt>
xor    %eax,%eax
call   10a0 <uart_getc@plt>
movsbl %al,%r15d
mov    %r15d,%edi
call   1030 <uart_putc@plt>
mov    %r14,%rdi
call   1100 <uart_puts@plt>
add    $0xcf,%r15b
cmp    $0x31,%r15b
ja     1230 <ar1010_main+0x40>
movzbl %r15b,%eax
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
lea    0xed6(%rip),%rdi
call   1100 <uart_puts@plt>
xor    %eax,%eax
call   1040 <ar1010_write_array@plt>
lea    0xedf(%rip),%rdi
call   1100 <uart_puts@plt>
jmp    1230 <ar1010_main+0x40>
xor    %eax,%eax
call   1050 <print_array@plt>
jmp    1230 <ar1010_main+0x40>
xor    %eax,%eax
call   10f0 <set_array_value@plt>
jmp    1230 <ar1010_main+0x40>
lea    0xec1(%rip),%rdi
call   1100 <uart_puts@plt>
xor    %eax,%eax
call   10d0 <ar1010_readall@plt>
jmp    1230 <ar1010_main+0x40>
xor    %eax,%eax
call   1090 <ar1010_seek@plt>
jmp    1230 <ar1010_main+0x40>
lea    0xead(%rip),%rdi
call   1100 <uart_puts@plt>
mov    $0x3cd,%edi
call   1110 <ar1010_tuneto@plt>
jmp    1230 <ar1010_main+0x40>
xor    %eax,%eax
call   10b0 <ar1010_status@plt>
jmp    1230 <ar1010_main+0x40>
cmp    $0x14,%r13b
jg     139b <ar1010_main+0x1ab>
add    $0x1,%r13b
jmp    1392 <ar1010_main+0x1a2>
test   %r13b,%r13b
jle    139b <ar1010_main+0x1ab>
add    $0xff,%r13b
movsbl %r13b,%edi
call   1070 <ar1010_setvolume@plt>
lea    0xe7b(%rip),%rdi
call   1100 <uart_puts@plt>
movsbl %r13b,%edi
call   1060 <uart_puts_val@plt>
jmp    1230 <ar1010_main+0x40>
xor    %eax,%eax
call   10e0 <ar1010_rssi@plt>
mov    %rbp,%r15
mov    %rbx,%rbp
mov    %eax,%ebx
lea    0xe5e(%rip),%rdi
call   1100 <uart_puts@plt>
movsbl %bl,%edi
mov    %rbp,%rbx
mov    %r15,%rbp
call   1060 <uart_puts_val@plt>
jmp    1230 <ar1010_main+0x40>

LLVM IR (-O0):
@.str = [33 x i8] c"\0D\0A\0D\0A----AR1010 Configuration----\00"
@.str.1 = [23 x i8] c"\0D\0A1) Send array values\00"
@.str.2 = [23 x i8] c"\0D\0A2) Read array values\00"
@.str.3 = [21 x i8] c"\0D\0A3) Set array value\00"
@.str.4 = [30 x i8] c"\0D\0A4) Read All Register values\00"
@.str.5 = [16 x i8] c"\0D\0A5) Begin Seek\00"
@.str.6 = [18 x i8] c"\0D\0A6) Tune to 97.3\00"
@.str.7 = [18 x i8] c"\0D\0A7) Check Status\00"
@.str.8 = [18 x i8] c"\0D\0A8) Raise volume\00"
@.str.9 = [18 x i8] c"\0D\0A9) Lower volume\00"
@.str.10 = [16 x i8] c"\0D\0Aa) Check RSSI\00"
@.str.11 = [33 x i8] c"\0D\0Ab) Special tune hi/low to 97.3\00"
@.str.12 = [3 x i8] c"\0D\0A\00"
@.str.13 = [28 x i8] c"\0D\0A\0D\0A\09Sending Array Values\0D\0A\00"
@.str.14 = [11 x i8] c"\0D\0A\09\09Done\0D\0A\00"
@.str.15 = [16 x i8] c"\0D\0A\0D\0A\09Read All\0D\0A\00"
@.str.16 = [19 x i8] c"\0D\0A\09 Tune to 97.3\0D\0A\00"
@.str.17 = [12 x i8] c"\0D\0AVolume = \00"
@.str.18 = [10 x i8] c"\0D\0ARSSI = \00"
define void @ar1010_main() {
%1 = alloca i8
%2 = alloca i8
store i8 21, i8* %2
%3 = call i32 @i2c1_setaddr(i32 16)
br label %4
4: ; preds = %0, %124
%5 = call i32 @uart_puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%6 = call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%7 = call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%8 = call i32 @uart_puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%9 = call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%10 = call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%12 = call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%13 = call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%14 = call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%15 = call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
%16 = call i32 @uart_puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
%17 = call i32 @uart_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%18 = call signext i8 (...) @uart_getc()
store i8 %18, i8* %1
%19 = load i8, i8* %1
%20 = call i32 @uart_putc(i8 signext %19)
%21 = call i32 @uart_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%22 = load i8, i8* %1
%23 = sext i8 %22 to i32
%24 = icmp eq i32 %23, 49
br i1 %24, label %25, label %29
25: ; preds = %4
%26 = call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%27 = call i32 (...) @ar1010_write_array()
%28 = call i32 @uart_puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
br label %124
29: ; preds = %4
%30 = load i8, i8* %1
%31 = sext i8 %30 to i32
%32 = icmp eq i32 %31, 50
br i1 %32, label %33, label %35
33: ; preds = %29
%34 = call i32 (...) @print_array()
br label %123
35: ; preds = %29
%36 = load i8, i8* %1
%37 = sext i8 %36 to i32
%38 = icmp eq i32 %37, 51
br i1 %38, label %39, label %41
39: ; preds = %35
%40 = call i32 (...) @set_array_value()
br label %122
41: ; preds = %35
%42 = load i8, i8* %1
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 52
br i1 %44, label %45, label %48
45: ; preds = %41
%46 = call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0))
%47 = call i32 (...) @ar1010_readall()
br label %121
48: ; preds = %41
%49 = load i8, i8* %1
%50 = sext i8 %49 to i32
%51 = icmp eq i32 %50, 53
br i1 %51, label %52, label %54
52: ; preds = %48
%53 = call i32 (...) @ar1010_seek()
br label %120
54: ; preds = %48
%55 = load i8, i8* %1
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 54
br i1 %57, label %58, label %61
58: ; preds = %54
%59 = call i32 @uart_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0))
%60 = call i32 @ar1010_tuneto(i32 973)
br label %119
61: ; preds = %54
%62 = load i8, i8* %1
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 55
br i1 %64, label %65, label %67
65: ; preds = %61
%66 = call i32 (...) @ar1010_status()
br label %118
67: ; preds = %61
%68 = load i8, i8* %1
%69 = sext i8 %68 to i32
%70 = icmp eq i32 %69, 56
br i1 %70, label %71, label %83
71: ; preds = %67
%72 = load i8, i8* %2
%73 = sext i8 %72 to i32
%74 = icmp slt i32 %73, 21
br i1 %74, label %75, label %79
75: ; preds = %71
%76 = load i8, i8* %2
%77 = add i8 %76, 1
store i8 %77, i8* %2
%78 = call i32 @ar1010_setvolume(i8 signext %77)
br label %79
79: ; preds = %75, %71
%80 = call i32 @uart_puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%81 = load i8, i8* %2
%82 = call i32 @uart_puts_val(i8 signext %81)
br label %117
83: ; preds = %67
%84 = load i8, i8* %1
%85 = sext i8 %84 to i32
%86 = icmp eq i32 %85, 57
br i1 %86, label %87, label %99
87: ; preds = %83
%88 = load i8, i8* %2
%89 = sext i8 %88 to i32
%90 = icmp sgt i32 %89, 0
br i1 %90, label %91, label %95
91: ; preds = %87
%92 = load i8, i8* %2
%93 = add i8 %92, -1
store i8 %93, i8* %2
%94 = call i32 @ar1010_setvolume(i8 signext %93)
br label %95
95: ; preds = %91, %87
%96 = call i32 @uart_puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%97 = load i8, i8* %2
%98 = call i32 @uart_puts_val(i8 signext %97)
br label %116
99: ; preds = %83
%100 = load i8, i8* %1
%101 = sext i8 %100 to i32
%102 = icmp eq i32 %101, 97
br i1 %102, label %103, label %108
103: ; preds = %99
%104 = call signext i8 (...) @ar1010_rssi()
store i8 %104, i8* %1
%105 = call i32 @uart_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%106 = load i8, i8* %1
%107 = call i32 @uart_puts_val(i8 signext %106)
br label %115
108: ; preds = %99
%109 = load i8, i8* %1
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 98
br i1 %111, label %112, label %114
112: ; preds = %108
%113 = call i32 @ar1010_tune_hilo(i32 973)
br label %114
114: ; preds = %112, %108
br label %115
115: ; preds = %114, %103
br label %116
116: ; preds = %115, %95
br label %117
117: ; preds = %116, %79
br label %118
118: ; preds = %117, %65
br label %119
119: ; preds = %118, %58
br label %120
120: ; preds = %119, %52
br label %121
121: ; preds = %120, %45
br label %122
122: ; preds = %121, %39
br label %123
123: ; preds = %122, %33
br label %124
124: ; preds = %123, %25
br label %4
}

LLVM IR (-O2):
@.str = [33 x i8] c"\0D\0A\0D\0A----AR1010 Configuration----\00"
@.str.1 = [23 x i8] c"\0D\0A1) Send array values\00"
@.str.2 = [23 x i8] c"\0D\0A2) Read array values\00"
@.str.3 = [21 x i8] c"\0D\0A3) Set array value\00"
@.str.4 = [30 x i8] c"\0D\0A4) Read All Register values\00"
@.str.5 = [16 x i8] c"\0D\0A5) Begin Seek\00"
@.str.6 = [18 x i8] c"\0D\0A6) Tune to 97.3\00"
@.str.7 = [18 x i8] c"\0D\0A7) Check Status\00"
@.str.8 = [18 x i8] c"\0D\0A8) Raise volume\00"
@.str.9 = [18 x i8] c"\0D\0A9) Lower volume\00"
@.str.10 = [16 x i8] c"\0D\0Aa) Check RSSI\00"
@.str.11 = [33 x i8] c"\0D\0Ab) Special tune hi/low to 97.3\00"
@.str.12 = [3 x i8] c"\0D\0A\00"
@.str.13 = [28 x i8] c"\0D\0A\0D\0A\09Sending Array Values\0D\0A\00"
@.str.14 = [11 x i8] c"\0D\0A\09\09Done\0D\0A\00"
@.str.15 = [16 x i8] c"\0D\0A\0D\0A\09Read All\0D\0A\00"
@.str.16 = [19 x i8] c"\0D\0A\09 Tune to 97.3\0D\0A\00"
@.str.17 = [12 x i8] c"\0D\0AVolume = \00"
@.str.18 = [10 x i8] c"\0D\0ARSSI = \00"
define void @ar1010_main() {
%1 = tail call i32 @i2c1_setaddr(i32 16)
br label %2
2: ; preds = %20, %0
%3 = phi i8 [ 21, %0 ], [ %21, %20 ]
%4 = tail call i32 @uart_puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @uart_puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @uart_puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%8 = tail call i32 @uart_puts(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
%10 = tail call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0))
%11 = tail call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.7, i64 0, i64 0))
%12 = tail call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%13 = tail call i32 @uart_puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.9, i64 0, i64 0))
%14 = tail call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.10, i64 0, i64 0))
%15 = tail call i32 @uart_puts(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.11, i64 0, i64 0))
%16 = tail call i32 @uart_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
%17 = tail call signext i8 (...) @uart_getc()
%18 = tail call i32 @uart_putc(i8 signext %17)
%19 = tail call i32 @uart_puts(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
switch i8 %17, label %20 [
i8 49, label %22
i8 50, label %26
i8 51, label %28
i8 52, label %30
i8 53, label %33
i8 54, label %35
i8 55, label %38
i8 56, label %40
i8 57, label %49
i8 97, label %58
i8 98, label %62
]
20: ; preds = %2, %26, %30, %35, %45, %58, %62, %54, %38, %33, %28, %22
%21 = phi i8 [ %3, %22 ], [ %3, %26 ], [ %3, %28 ], [ %3, %30 ], [ %3, %33 ], [ %3, %35 ], [ %3, %38 ], [ %46, %45 ], [ %55, %54 ], [ %3, %58 ], [ %3, %62 ], [ %3, %2 ]
br label %2
22: ; preds = %2
%23 = tail call i32 @uart_puts(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.13, i64 0, i64 0))
%24 = tail call i32 (...) @ar1010_write_array()
%25 = tail call i32 @uart_puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.14, i64 0, i64 0))
br label %20
26: ; preds = %2
%27 = tail call i32 (...) @print_array()
br label %20
28: ; preds = %2
%29 = tail call i32 (...) @set_array_value()
br label %20
30: ; preds = %2
%31 = tail call i32 @uart_puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.15, i64 0, i64 0))
%32 = tail call i32 (...) @ar1010_readall()
br label %20
33: ; preds = %2
%34 = tail call i32 (...) @ar1010_seek()
br label %20
35: ; preds = %2
%36 = tail call i32 @uart_puts(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.16, i64 0, i64 0))
%37 = tail call i32 @ar1010_tuneto(i32 973)
br label %20
38: ; preds = %2
%39 = tail call i32 (...) @ar1010_status()
br label %20
40: ; preds = %2
%41 = icmp slt i8 %3, 21
br i1 %41, label %42, label %45
42: ; preds = %40
%43 = add nsw i8 %3, 1
%44 = tail call i32 @ar1010_setvolume(i8 signext %43)
br label %45
45: ; preds = %42, %40
%46 = phi i8 [ %43, %42 ], [ %3, %40 ]
%47 = tail call i32 @uart_puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%48 = tail call i32 @uart_puts_val(i8 signext %46)
br label %20
49: ; preds = %2
%50 = icmp sgt i8 %3, 0
br i1 %50, label %51, label %54
51: ; preds = %49
%52 = add nsw i8 %3, -1
%53 = tail call i32 @ar1010_setvolume(i8 signext %52)
br label %54
54: ; preds = %51, %49
%55 = phi i8 [ %52, %51 ], [ %3, %49 ]
%56 = tail call i32 @uart_puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.17, i64 0, i64 0))
%57 = tail call i32 @uart_puts_val(i8 signext %55)
br label %20
58: ; preds = %2
%59 = tail call signext i8 (...) @ar1010_rssi()
%60 = tail call i32 @uart_puts(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.18, i64 0, i64 0))
%61 = tail call i32 @uart_puts_val(i8 signext %59)
br label %20
62: ; preds = %2
%63 = tail call i32 @ar1010_tune_hilo(i32 973)
br label %20
}