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

/* Variables and functions */
int /*<<< orphan*/ CloseGPin(int);
int /*<<< orphan*/ GetPinValue(int);
int /*<<< orphan*/ InitPin(int);
int /*<<< orphan*/ LEDOff(int);
int /*<<< orphan*/ LEDOn(int);
int /*<<< orphan*/ Nullize(char *, int);
int /*<<< orphan*/ SetPinDirt(int, char *);
int /*<<< orphan*/ SettingCape();
int /*<<< orphan*/ UART_Baudrate_NonC(int, int, int /*<<< orphan*/, int);
int UART_init(int, char);
int /*<<< orphan*/ printf(char *, ...);
int read(int, char *, int);
int /*<<< orphan*/ sprintf(char *, char *, char *);
int /*<<< orphan*/ strcat(char *, char *);
int strlen(char *);
int /*<<< orphan*/ write(int, char *, int);
int main() {
  int AHRS_ID = 0;
  double AHRS_phi = 0;
  double AHRS_theta = 0;
  double AHRS_psi = 0;
  double AHRS_theta_b = 0;
  double AHRS_theta_f = 0;
  double AHRS_f_tau = 10;
  double PID_CMDtheta = 0;
  double PID_P = 100;
  double PID_I = 0;
  double PID_D = 100;
  double PID_CMDduty = 0;
  double PID_Integral = 0;
  double time_del = 0.01;
  int i1, j1;
  int i2, j2;
  int i4, j4;
  int UART1_News = 1;
  int UART2_News = 1;
  int UART4_News = 1;
  int readfromUART1 = 0;
  int readfromUART2 = 0;
  int readfromUART4 = 0;
  int UART1T = 0;
  int UART1R = 0;
  int UART2T = 0;
  int UART2R = 0;
  int UART4T = 0;
  int UART4R = 0;
  char UART1_buf[100] = {
      '\0',
  };
  char UART2_buf[100] = {
      '\0',
  };
  char UART4_buf[100] = {
      '\0',
  };
  char UART1_data[500] = {
      '\0',
  };
  char UART2_data[500] = {
      '\0',
  };
  char UART4_data[500] = {
      '\0',
  };
  char UART1_forParse[100] = {
      '\0',
  };
  char UART2_forParse[100] = {
      '\0',
  };
  char UART4_forParse[100] = {
      '\0',
  };
  int UART1_position[3] = {0, 0, 0};
  int UART2_position[3] = {0, 0, 0};
  int UART4_position[3] = {0, 0, 0};
  int UART1_cpy_flag = 0;
  int UART2_cpy_flag = 0;
  int UART4_cpy_flag = 0;
  char test1[50] = {
      '\0',
  };
  char test2[50] = {
      '\0',
  };
  char test4[50] = {
      '\0',
  };
  SettingCape();
  LEDOn(23);
  LEDOn(47);
  InitPin(27);
  SetPinDirt(27, "in");
  printf("Start\n");
  UART1T = UART_init(1, 'T');
  printf("UART1T : %d\n", UART1T);
  UART1R = UART_init(1, 'R');
  printf("UART1R : %d\n", UART1R);
  UART_Baudrate_NonC(UART1T, 115200, 0, 1);
  UART2T = UART_init(2, 'T');
  printf("UART2T : %d\n", UART2T);
  UART2R = UART_init(2, 'R');
  printf("UART2R : %d\n", UART2R);
  UART_Baudrate_NonC(UART2T, 115200, 0, 1);
  UART4T = UART_init(4, 'T');
  printf("UART4T : %d\n", UART4T);
  UART4R = UART_init(4, 'R');
  printf("UART4R : %d\n", UART4R);
  UART_Baudrate_NonC(UART4T, 115200, 0, 1);
  printf("START!\n");
  write(UART1T, "START!\n", 8);
  while (!GetPinValue(27)) {
    readfromUART1 = read(UART1R, UART1_buf, 100);
    strcat(UART1_data, UART1_buf);
    Nullize(UART1_buf, readfromUART1);
    if (readfromUART1 != -1) {
      for (i1 = UART1_position[2], UART1_position[0] = UART1_position[2],
          UART1_position[1] = UART1_position[2] + 1, UART1_cpy_flag = 0;
           i1 < sizeof(UART1_data); i1++) {
        if (UART1_data[i1] == '$') {
          UART1_position[0] = i1;
          UART1_cpy_flag = 1;
          i1++;
        }
        if ((UART1_cpy_flag == 1) && (UART1_data[i1 - 3] == '*')) {
          UART1_position[1] = i1;
          UART1_cpy_flag = 2;
          break;
        }
        if ((UART1_data[i1] == '\0') && (UART1_cpy_flag == 1)) {
          UART1_position[0] = UART1_position[2];
          UART1_position[1] = UART1_position[2] + 1;
          break;
        }
      }
      for (j1 = 0; (UART1_cpy_flag == 2) &&
                   (j1 + UART1_position[0] < UART1_position[1]);
           j1++) {
        UART1_forParse[j1] = UART1_data[UART1_position[0] + j1];
        if (UART1_forParse[j1 - 2] == '*') {
          UART1_forParse[j1 + 1] = '\0';
          UART1_cpy_flag = 3;
          UART1_position[2] = UART1_position[1];
          break;
        }
      }
      if (UART1_cpy_flag == 3) {
        sprintf(test1, "1|%s|\n", UART1_forParse);
        write(UART1T, test1, strlen(test1) + 1);
        printf("theta : %.3f\n", AHRS_theta);
        Nullize(UART1_forParse, sizeof(UART1_forParse));
        if (strlen(UART1_data) > 300) {
          Nullize(UART1_data, strlen(UART1_data));
          UART1_position[0] = 0;
          UART1_position[1] = 0;
          UART1_position[2] = 0;
        }
      }
    }
  }
  write(UART4T, "End\n", 5);
  printf("End\n");
  CloseGPin(27);
  LEDOff(23);
  LEDOff(47);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xdb7(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  0xd9a(%rip),%xmm0
movsd  %xmm0,-0x48(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  0xd85(%rip),%xmm0
movsd  %xmm0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0xd60(%rip),%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x1,-0x8c(%rbp)
movl   $0x1,-0x90(%rbp)
movl   $0x1,-0x94(%rbp)
movl   $0x0,-0x98(%rbp)
movl   $0x0,-0x9c(%rbp)
movl   $0x0,-0xa0(%rbp)
movl   $0x0,-0xa4(%rbp)
movl   $0x0,-0xa8(%rbp)
movl   $0x0,-0xac(%rbp)
movl   $0x0,-0xb0(%rbp)
movl   $0x0,-0xb4(%rbp)
movl   $0x0,-0xb8(%rbp)
lea    -0x120(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x190(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x200(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x400(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f4,%edx
call   10b0 <memset@plt>
lea    -0x600(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f4,%edx
call   10b0 <memset@plt>
lea    -0x800(%rbp),%rdi
xor    %esi,%esi
mov    $0x1f4,%edx
call   10b0 <memset@plt>
lea    -0x870(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x8e0(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x950(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   10b0 <memset@plt>
lea    -0x95c(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10b0 <memset@plt>
lea    -0x968(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10b0 <memset@plt>
lea    -0x974(%rbp),%rdi
xor    %esi,%esi
mov    $0xc,%edx
call   10b0 <memset@plt>
movl   $0x0,-0x978(%rbp)
movl   $0x0,-0x97c(%rbp)
movl   $0x0,-0x980(%rbp)
lea    -0x9c0(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   10b0 <memset@plt>
lea    -0xa00(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   10b0 <memset@plt>
lea    -0xa40(%rbp),%rdi
xor    %esi,%esi
mov    $0x32,%edx
call   10b0 <memset@plt>
mov    $0x0,%al
call   10f0 <SettingCape@plt>
mov    $0x17,%edi
call   1120 <LEDOn@plt>
mov    $0x2f,%edi
call   1120 <LEDOn@plt>
mov    $0x1b,%edi
call   1030 <InitPin@plt>
mov    $0x1b,%edi
lea    0xb8f(%rip),%rsi
call   10e0 <SetPinDirt@plt>
lea    0xb86(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x1,%edi
mov    $0x54,%esi
call   1090 <UART_init@plt>
mov    %eax,-0xa4(%rbp)
mov    -0xa4(%rbp),%esi
lea    0xb64(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x1,%edi
mov    $0x52,%esi
call   1090 <UART_init@plt>
mov    %eax,-0xa8(%rbp)
mov    -0xa8(%rbp),%esi
lea    0xb48(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0xa4(%rbp),%edi
mov    $0x1c200,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1050 <UART_Baudrate_NonC@plt>
mov    $0x2,%edi
mov    $0x54,%esi
call   1090 <UART_init@plt>
mov    %eax,-0xac(%rbp)
mov    -0xac(%rbp),%esi
lea    0xb15(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x2,%edi
mov    $0x52,%esi
call   1090 <UART_init@plt>
mov    %eax,-0xb0(%rbp)
mov    -0xb0(%rbp),%esi
lea    0xaf9(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0xac(%rbp),%edi
mov    $0x1c200,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1050 <UART_Baudrate_NonC@plt>
mov    $0x4,%edi
mov    $0x54,%esi
call   1090 <UART_init@plt>
mov    %eax,-0xb4(%rbp)
mov    -0xb4(%rbp),%esi
lea    0xac6(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x4,%edi
mov    $0x52,%esi
call   1090 <UART_init@plt>
mov    %eax,-0xb8(%rbp)
mov    -0xb8(%rbp),%esi
lea    0xaaa(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0xb4(%rbp),%edi
mov    $0x1c200,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1050 <UART_Baudrate_NonC@plt>
lea    0xa92(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0xa4(%rbp),%edi
lea    0xa7e(%rip),%rsi
mov    $0x8,%edx
call   1040 <write@plt>
mov    $0x1b,%edi
call   10d0 <GetPinValue@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    161b <main+0x40b>
jmp    191b <main+0x70b>
mov    -0xa8(%rbp),%edi
lea    -0x120(%rbp),%rsi
mov    $0x64,%edx
call   10c0 <read@plt>
mov    %eax,-0x98(%rbp)
lea    -0x400(%rbp),%rdi
lea    -0x120(%rbp),%rsi
call   1110 <strcat@plt>
lea    -0x120(%rbp),%rdi
mov    -0x98(%rbp),%esi
call   1060 <Nullize@plt>
cmpl   $0xffffffff,-0x98(%rbp)
je     1916 <main+0x706>
mov    -0x954(%rbp),%eax
mov    %eax,-0x74(%rbp)
mov    -0x954(%rbp),%eax
mov    %eax,-0x95c(%rbp)
mov    -0x954(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x958(%rbp)
movl   $0x0,-0x978(%rbp)
movslq -0x74(%rbp),%rax
cmp    $0x1f4,%rax
jae    176c <main+0x55c>
movslq -0x74(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0x24,%eax
jne    16d9 <main+0x4c9>
mov    -0x74(%rbp),%eax
mov    %eax,-0x95c(%rbp)
movl   $0x1,-0x978(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
cmpl   $0x1,-0x978(%rbp)
jne    1717 <main+0x507>
mov    -0x74(%rbp),%eax
sub    $0x3,%eax
cltq
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0x2a,%eax
jne    1717 <main+0x507>
mov    -0x74(%rbp),%eax
mov    %eax,-0x958(%rbp)
movl   $0x2,-0x978(%rbp)
jmp    176c <main+0x55c>
movslq -0x74(%rbp),%rax
movsbl -0x400(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
jne    1759 <main+0x549>
cmpl   $0x1,-0x978(%rbp)
jne    1759 <main+0x549>
mov    -0x954(%rbp),%eax
mov    %eax,-0x95c(%rbp)
mov    -0x954(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x958(%rbp)
jmp    176c <main+0x55c>
jmp    175e <main+0x54e>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1698 <main+0x488>
movl   $0x0,-0x78(%rbp)
xor    %eax,%eax
cmpl   $0x2,-0x978(%rbp)
mov    %al,-0xa41(%rbp)
jne    17a0 <main+0x590>
mov    -0x78(%rbp),%eax
add    -0x95c(%rbp),%eax
cmp    -0x958(%rbp),%eax
setl   %al
mov    %al,-0xa41(%rbp)
mov    -0xa41(%rbp),%al
test   $0x1,%al
jne    17b3 <main+0x5a3>
jmp    1827 <main+0x617>
mov    -0x95c(%rbp),%eax
add    -0x78(%rbp),%eax
cltq
mov    -0x400(%rbp,%rax,1),%cl
movslq -0x78(%rbp),%rax
mov    %cl,-0x870(%rbp,%rax,1)
mov    -0x78(%rbp),%eax
sub    $0x2,%eax
cltq
movsbl -0x870(%rbp,%rax,1),%eax
ff
cmp    $0x2a,%eax
jne    1814 <main+0x604>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
cltq
movb   $0x0,-0x870(%rbp,%rax,1)
movl   $0x3,-0x978(%rbp)
mov    -0x958(%rbp),%eax
mov    %eax,-0x954(%rbp)
jmp    1827 <main+0x617>
jmp    1819 <main+0x609>
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    1773 <main+0x563>
cmpl   $0x3,-0x978(%rbp)
jne    1911 <main+0x701>
lea    -0x9c0(%rbp),%rdi
lea    -0x870(%rbp),%rdx
lea    0x82f(%rip),%rsi
call   1130 <sprintf@plt>
mov    -0xa4(%rbp),%eax
mov    %eax,-0xa54(%rbp)
lea    -0x9c0(%rbp),%rax
mov    %rax,-0xa50(%rbp)
lea    -0x9c0(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xa54(%rbp),%edi
mov    -0xa50(%rbp),%rsi
mov    %eax,%edx
add    $0x1,%edx
call   1040 <write@plt>
movsd  -0x18(%rbp),%xmm0
lea    0x7e8(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
lea    -0x870(%rbp),%rdi
mov    $0x64,%esi
call   1060 <Nullize@plt>
lea    -0x400(%rbp),%rdi
call   1070 <strlen@plt>
cmp    $0x12c,%eax
jle    190c <main+0x6fc>
lea    -0x400(%rbp),%rax
mov    %rax,-0xa60(%rbp)
lea    -0x400(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0xa60(%rbp),%rdi
mov    %eax,%esi
call   1060 <Nullize@plt>
movl   $0x0,-0x95c(%rbp)
movl   $0x0,-0x958(%rbp)
movl   $0x0,-0x954(%rbp)
jmp    1911 <main+0x701>
jmp    1916 <main+0x706>
jmp    15fc <main+0x3ec>
mov    -0xb4(%rbp),%edi
lea    0x765(%rip),%rsi
mov    $0x5,%edx
call   1040 <write@plt>
lea    0x754(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    $0x1b,%edi
call   1100 <CloseGPin@plt>
mov    $0x17,%edi
call   1080 <LEDOff@plt>
mov    $0x2f,%edi
call   1080 <LEDOff@plt>
xor    %eax,%eax
add    $0xa60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x328,%rsp
xorps  %xmm0,%xmm0
movaps %xmm0,0x110(%rsp)
movaps %xmm0,0x100(%rsp)
movaps %xmm0,0xf0(%rsp)
movaps %xmm0,0xe0(%rsp)
movaps %xmm0,0xd0(%rsp)
movaps %xmm0,0xc0(%rsp)
movl   $0x0,0x120(%rsp)
lea    0x130(%rsp),%r12
xor    %r15d,%r15d
mov    $0x1f4,%edx
mov    %r12,%rdi
xor    %esi,%esi
call   10c0 <memset@plt>
xorps  %xmm0,%xmm0
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x30(%rsp)
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x10(%rsp)
movl   $0x0,0x70(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0x80(%rsp)
movw   $0x0,0xb0(%rsp)
xor    %eax,%eax
call   1100 <SettingCape@plt>
mov    $0x17,%edi
call   1130 <LEDOn@plt>
mov    $0x2f,%edi
call   1130 <LEDOn@plt>
mov    $0x1b,%edi
call   1030 <InitPin@plt>
lea    0xd00(%rip),%rsi
mov    $0x1b,%edi
call   10f0 <SetPinDirt@plt>
lea    0xd62(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%r14d
mov    $0x1,%edi
mov    $0x54,%esi
call   10a0 <UART_init@plt>
mov    %eax,%ebx
lea    0xccf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    $0x1,%edi
mov    $0x52,%esi
call   10a0 <UART_init@plt>
mov    %eax,%r13d
lea    0xcba(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %ebx,%edi
mov    $0x1c200,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1060 <UART_Baudrate_NonC@plt>
mov    $0x2,%edi
mov    $0x54,%esi
call   10a0 <UART_init@plt>
mov    %eax,%ebp
lea    0xc93(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    $0x2,%edi
mov    $0x52,%esi
call   10a0 <UART_init@plt>
lea    0xc81(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %ebp,%edi
mov    $0x1c200,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1060 <UART_Baudrate_NonC@plt>
mov    $0x4,%edi
mov    $0x54,%esi
call   10a0 <UART_init@plt>
mov    %eax,%ebp
lea    0xc5a(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    $0x4,%edi
mov    $0x52,%esi
call   10a0 <UART_init@plt>
lea    0xc48(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10b0 <printf@plt>
mov    %ebp,0x8(%rsp)
mov    %ebp,%edi
mov    $0x1c200,%esi
xor    %edx,%edx
mov    $0x1,%ecx
call   1060 <UART_Baudrate_NonC@plt>
lea    0xc56(%rip),%rdi
call   1040 <puts@plt>
lea    0xc22(%rip),%rsi
mov    %ebx,0xc(%rsp)
mov    %ebx,%edi
mov    %r13d,%ebx
mov    $0x8,%edx
call   1050 <write@plt>
mov    $0x1b,%edi
call   10e0 <GetPinValue@plt>
test   %eax,%eax
je     14a3 <main+0x283>
lea    0xc17(%rip),%rsi
mov    0x8(%rsp),%edi
mov    $0x5,%edx
call   1050 <write@plt>
lea    0xc14(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1b,%edi
call   1110 <CloseGPin@plt>
mov    $0x17,%edi
call   1090 <LEDOff@plt>
mov    $0x2f,%edi
call   1090 <LEDOff@plt>
xor    %eax,%eax
add    $0x328,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc0(%rsp),%rbp
jmp    14be <main+0x29e>
mov    %eax,%ebx
nop
mov    $0x1b,%edi
call   10e0 <GetPinValue@plt>
test   %eax,%eax
jne    1450 <main+0x230>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x64,%edx
call   10d0 <read@plt>
mov    %eax,%r13d
mov    %r12,%rdi
mov    %rbp,%rsi
call   1120 <strcat@plt>
mov    %rbp,%rdi
mov    %r13d,%esi
call   1070 <Nullize@plt>
cmp    $0xffffffff,%r13d
je     14b0 <main+0x290>
cmp    $0x1f3,%r15d
ja     14b0 <main+0x290>
mov    %ebx,%eax
lea    0x1(%r15),%r8d
xor    %edx,%edx
mov    %r15d,%edi
mov    %r15d,%ecx
jmp    151b <main+0x2fb>
cs nopw 0x0(%rax,%rax,1)
nop
lea    0x1(%rsi),%edi
cmp    $0x1f3,%esi
jae    1554 <main+0x334>
mov    %edi,%ebx
xor    %esi,%esi
cmpb   $0x24,0x130(%rsp,%rbx,1)
24
sete   %sil
cmove  %edi,%ecx
cmove  %r14d,%edx
add    %rbx,%rsi
cmp    $0x1,%edx
jne    1510 <main+0x2f0>
movslq %esi,%rdi
cmpb   $0x2a,-0x3(%rdi,%r12,1)
je     1565 <main+0x345>
cmpb   $0x0,0x130(%rsp,%rsi,1)
jne    1510 <main+0x2f0>
jmp    14ad <main+0x28d>
cmp    $0x3,%edx
je     15c1 <main+0x3a1>
cmp    $0x2,%edx
mov    %eax,%ebx
je     156a <main+0x34a>
jmp    14b0 <main+0x290>
mov    %esi,%r8d
mov    %eax,%ebx
mov    %r8d,%edx
sub    %ecx,%edx
jle    14b0 <main+0x290>
movslq %ecx,%rcx
neg    %rdx
lea    (%rsp,%rcx,1),%rsi
add    $0x130,%rsi
mov    $0x1,%ecx
nopl   0x0(%rax,%rax,1)
movzbl -0x1(%rsi,%rcx,1),%ebx
mov    %bl,0xf(%rsp,%rcx,1)
cmpb   $0x2a,0xd(%rsp,%rcx,1)
je     15b7 <main+0x397>
lea    (%rdx,%rcx,1),%rdi
add    $0x1,%rdi
add    $0x1,%rcx
cmp    $0x1,%rdi
jne    1590 <main+0x370>
jmp    14ad <main+0x28d>
mov    %ecx,%ecx
movb   $0x0,0x10(%rsp,%rcx,1)
mov    %r8d,%r15d
mov    %eax,%ebx
lea    0x80(%rsp),%r13
mov    %r13,%rdi
lea    0xa84(%rip),%rsi
lea    0x10(%rsp),%rdx
call   1140 <sprintf@plt>
mov    %r13,%rdi
call   1080 <strlen@plt>
lea    0x1(%rax),%edx
mov    0xc(%rsp),%edi
mov    %r13,%rsi
call   1050 <write@plt>
xorps  %xmm0,%xmm0
lea    0xa60(%rip),%rdi
mov    $0x1,%al
call   10b0 <printf@plt>
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
call   1070 <Nullize@plt>
mov    %r12,%rdi
call   1080 <strlen@plt>
cmp    $0x12d,%eax
jl     14b0 <main+0x290>
mov    %r12,%rdi
call   1080 <strlen@plt>
mov    %r12,%rdi
mov    %eax,%esi
call   1070 <Nullize@plt>
xor    %r15d,%r15d
jmp    14b0 <main+0x290>

LLVM IR (-O0):
@.str = [3 x i8] c"in\00"
@.str.1 = [7 x i8] c"Start\0A\00"
@.str.2 = [13 x i8] c"UART1T : %d\0A\00"
@.str.3 = [13 x i8] c"UART1R : %d\0A\00"
@.str.4 = [13 x i8] c"UART2T : %d\0A\00"
@.str.5 = [13 x i8] c"UART2R : %d\0A\00"
@.str.6 = [13 x i8] c"UART4T : %d\0A\00"
@.str.7 = [13 x i8] c"UART4R : %d\0A\00"
@.str.8 = [8 x i8] c"START!\0A\00"
@.str.9 = [7 x i8] c"1|%s|\0A\00"
@.str.10 = [14 x i8] c"theta : %.3f\0A\00"
@.str.11 = [5 x i8] c"End\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
%33 = alloca i32
%34 = alloca [100 x i8]
%35 = alloca [100 x i8]
%36 = alloca [100 x i8]
%37 = alloca [500 x i8]
%38 = alloca [500 x i8]
%39 = alloca [500 x i8]
%40 = alloca [100 x i8]
%41 = alloca [100 x i8]
%42 = alloca [100 x i8]
%43 = alloca [3 x i32]
%44 = alloca [3 x i32]
%45 = alloca [3 x i32]
%46 = alloca i32
%47 = alloca i32
%48 = alloca i32
%49 = alloca [50 x i8]
%50 = alloca [50 x i8]
%51 = alloca [50 x i8]
store i32 0, i32* %1
store i32 0, i32* %2
store double 0.000000e+00, double* %3
store double 0.000000e+00, double* %4
store double 0.000000e+00, double* %5
store double 0.000000e+00, double* %6
store double 0.000000e+00, double* %7
store double 1.000000e+01, double* %8
store double 0.000000e+00, double* %9
store double 1.000000e+02, double* %10
store double 0.000000e+00, double* %11
store double 1.000000e+02, double* %12
store double 0.000000e+00, double* %13
store double 0.000000e+00, double* %14
store double 1.000000e-02, double* %15
store i32 1, i32* %22
store i32 1, i32* %23
store i32 1, i32* %24
store i32 0, i32* %25
store i32 0, i32* %26
store i32 0, i32* %27
store i32 0, i32* %28
store i32 0, i32* %29
store i32 0, i32* %30
store i32 0, i32* %31
store i32 0, i32* %32
store i32 0, i32* %33
%52 = bitcast [100 x i8]* %34 to i8*
%53 = bitcast [100 x i8]* %35 to i8*
%54 = bitcast [100 x i8]* %36 to i8*
%55 = bitcast [500 x i8]* %37 to i8*
%56 = bitcast [500 x i8]* %38 to i8*
%57 = bitcast [500 x i8]* %39 to i8*
%58 = bitcast [100 x i8]* %40 to i8*
%59 = bitcast [100 x i8]* %41 to i8*
%60 = bitcast [100 x i8]* %42 to i8*
%61 = bitcast [3 x i32]* %43 to i8*
%62 = bitcast [3 x i32]* %44 to i8*
%63 = bitcast [3 x i32]* %45 to i8*
store i32 0, i32* %46
store i32 0, i32* %47
store i32 0, i32* %48
%64 = bitcast [50 x i8]* %49 to i8*
%65 = bitcast [50 x i8]* %50 to i8*
%66 = bitcast [50 x i8]* %51 to i8*
%67 = call i32 (...) @SettingCape()
%68 = call i32 @LEDOn(i32 23)
%69 = call i32 @LEDOn(i32 47)
%70 = call i32 @InitPin(i32 27)
%71 = call i32 @SetPinDirt(i32 27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
%73 = call i32 @UART_init(i32 1, i8 signext 84)
store i32 %73, i32* %28
%74 = load i32, i32* %28
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %74)
%76 = call i32 @UART_init(i32 1, i8 signext 82)
store i32 %76, i32* %29
%77 = load i32, i32* %29
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %77)
%79 = load i32, i32* %28
%80 = call i32 @UART_Baudrate_NonC(i32 %79, i32 115200, i32 0, i32 1)
%81 = call i32 @UART_init(i32 2, i8 signext 84)
store i32 %81, i32* %30
%82 = load i32, i32* %30
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %82)
%84 = call i32 @UART_init(i32 2, i8 signext 82)
store i32 %84, i32* %31
%85 = load i32, i32* %31
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %85)
%87 = load i32, i32* %30
%88 = call i32 @UART_Baudrate_NonC(i32 %87, i32 115200, i32 0, i32 1)
%89 = call i32 @UART_init(i32 4, i8 signext 84)
store i32 %89, i32* %32
%90 = load i32, i32* %32
%91 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %90)
%92 = call i32 @UART_init(i32 4, i8 signext 82)
store i32 %92, i32* %33
%93 = load i32, i32* %33
%94 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %93)
%95 = load i32, i32* %32
%96 = call i32 @UART_Baudrate_NonC(i32 %95, i32 115200, i32 0, i32 1)
%97 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0))
%98 = load i32, i32* %28
%99 = call i32 @write(i32 %98, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 8)
br label %100
100: ; preds = %252, %0
%101 = call i32 @GetPinValue(i32 27)
%102 = icmp ne i32 %101, 0
%103 = xor i1 %102, true
br i1 %103, label %104, label %253
104: ; preds = %100
%105 = load i32, i32* %29
%106 = getelementptr inbounds [100 x i8], [100 x i8]* %34, i64 0, i64 0
%107 = call i32 @read(i32 %105, i8* %106, i32 100)
store i32 %107, i32* %25
%108 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 0
%109 = getelementptr inbounds [100 x i8], [100 x i8]* %34, i64 0, i64 0
%110 = call i32 @strcat(i8* %108, i8* %109)
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %34, i64 0, i64 0
%112 = load i32, i32* %25
%113 = call i32 @Nullize(i8* %111, i32 %112)
%114 = load i32, i32* %25
%115 = icmp ne i32 %114, -1
br i1 %115, label %116, label %252
116: ; preds = %104
%117 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 2
%118 = load i32, i32* %117
store i32 %118, i32* %16
%119 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 2
%120 = load i32, i32* %119
%121 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 0
store i32 %120, i32* %121
%122 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 2
%123 = load i32, i32* %122
%124 = add nsw i32 %123, 1
%125 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 1
store i32 %124, i32* %125
store i32 0, i32* %46
br label %126
126: ; preds = %175, %116
%127 = load i32, i32* %16
%128 = sext i32 %127 to i64
%129 = icmp ult i64 %128, 500
br i1 %129, label %130, label %178
130: ; preds = %126
%131 = load i32, i32* %16
%132 = sext i32 %131 to i64
%133 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 %132
%134 = load i8, i8* %133
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 36
br i1 %136, label %137, label %142
137: ; preds = %130
%138 = load i32, i32* %16
%139 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 0
store i32 %138, i32* %139
store i32 1, i32* %46
%140 = load i32, i32* %16
%141 = add nsw i32 %140, 1
store i32 %141, i32* %16
br label %142
142: ; preds = %137, %130
%143 = load i32, i32* %46
%144 = icmp eq i32 %143, 1
br i1 %144, label %145, label %156
145: ; preds = %142
%146 = load i32, i32* %16
%147 = sub nsw i32 %146, 3
%148 = sext i32 %147 to i64
%149 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 %148
%150 = load i8, i8* %149
%151 = sext i8 %150 to i32
%152 = icmp eq i32 %151, 42
br i1 %152, label %153, label %156
153: ; preds = %145
%154 = load i32, i32* %16
%155 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 1
store i32 %154, i32* %155
store i32 2, i32* %46
br label %178
156: ; preds = %145, %142
%157 = load i32, i32* %16
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 %158
%160 = load i8, i8* %159
%161 = sext i8 %160 to i32
%162 = icmp eq i32 %161, 0
br i1 %162, label %163, label %174
163: ; preds = %156
%164 = load i32, i32* %46
%165 = icmp eq i32 %164, 1
br i1 %165, label %166, label %174
166: ; preds = %163
%167 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 2
%168 = load i32, i32* %167
%169 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 0
store i32 %168, i32* %169
%170 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 2
%171 = load i32, i32* %170
%172 = add nsw i32 %171, 1
%173 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 1
store i32 %172, i32* %173
br label %178
174: ; preds = %163, %156
br label %175
175: ; preds = %174
%176 = load i32, i32* %16
%177 = add nsw i32 %176, 1
store i32 %177, i32* %16
br label %126
178: ; preds = %166, %153, %126
store i32 0, i32* %17
br label %179
179: ; preds = %219, %178
%180 = load i32, i32* %46
%181 = icmp eq i32 %180, 2
br i1 %181, label %182, label %190
182: ; preds = %179
%183 = load i32, i32* %17
%184 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 0
%185 = load i32, i32* %184
%186 = add nsw i32 %183, %185
%187 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 1
%188 = load i32, i32* %187
%189 = icmp slt i32 %186, %188
br label %190
190: ; preds = %182, %179
%191 = phi i1 [ false, %179 ], [ %189, %182 ]
br i1 %191, label %192, label %222
192: ; preds = %190
%193 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 0
%194 = load i32, i32* %193
%195 = load i32, i32* %17
%196 = add nsw i32 %194, %195
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 %197
%199 = load i8, i8* %198
%200 = load i32, i32* %17
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [100 x i8], [100 x i8]* %40, i64 0, i64 %201
store i8 %199, i8* %202
%203 = load i32, i32* %17
%204 = sub nsw i32 %203, 2
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [100 x i8], [100 x i8]* %40, i64 0, i64 %205
%207 = load i8, i8* %206
%208 = sext i8 %207 to i32
%209 = icmp eq i32 %208, 42
br i1 %209, label %210, label %218
210: ; preds = %192
%211 = load i32, i32* %17
%212 = add nsw i32 %211, 1
%213 = sext i32 %212 to i64
%214 = getelementptr inbounds [100 x i8], [100 x i8]* %40, i64 0, i64 %213
store i8 0, i8* %214
store i32 3, i32* %46
%215 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 1
%216 = load i32, i32* %215
%217 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 2
store i32 %216, i32* %217
br label %222
218: ; preds = %192
br label %219
219: ; preds = %218
%220 = load i32, i32* %17
%221 = add nsw i32 %220, 1
store i32 %221, i32* %17
br label %179
222: ; preds = %210, %190
%223 = load i32, i32* %46
%224 = icmp eq i32 %223, 3
br i1 %224, label %225, label %251
225: ; preds = %222
%226 = getelementptr inbounds [50 x i8], [50 x i8]* %49, i64 0, i64 0
%227 = getelementptr inbounds [100 x i8], [100 x i8]* %40, i64 0, i64 0
%228 = call i32 @sprintf(i8* %226, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %227)
%229 = load i32, i32* %28
%230 = getelementptr inbounds [50 x i8], [50 x i8]* %49, i64 0, i64 0
%231 = getelementptr inbounds [50 x i8], [50 x i8]* %49, i64 0, i64 0
%232 = call i32 @strlen(i8* %231)
%233 = add nsw i32 %232, 1
%234 = call i32 @write(i32 %229, i8* %230, i32 %233)
%235 = load double, double* %4
%236 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), double %235)
%237 = getelementptr inbounds [100 x i8], [100 x i8]* %40, i64 0, i64 0
%238 = call i32 @Nullize(i8* %237, i32 100)
%239 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 0
%240 = call i32 @strlen(i8* %239)
%241 = icmp sgt i32 %240, 300
br i1 %241, label %242, label %250
242: ; preds = %225
%243 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 0
%244 = getelementptr inbounds [500 x i8], [500 x i8]* %37, i64 0, i64 0
%245 = call i32 @strlen(i8* %244)
%246 = call i32 @Nullize(i8* %243, i32 %245)
%247 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 0
store i32 0, i32* %247
%248 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 1
store i32 0, i32* %248
%249 = getelementptr inbounds [3 x i32], [3 x i32]* %43, i64 0, i64 2
store i32 0, i32* %249
br label %250
250: ; preds = %242, %225
br label %251
251: ; preds = %250, %222
br label %252
252: ; preds = %251, %104
br label %100
253: ; preds = %100
%254 = load i32, i32* %32
%255 = call i32 @write(i32 %254, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 5)
%256 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
%257 = call i32 @CloseGPin(i32 27)
%258 = call i32 @LEDOff(i32 23)
%259 = call i32 @LEDOff(i32 47)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"in\00"
@.str.2 = [13 x i8] c"UART1T : %d\0A\00"
@.str.3 = [13 x i8] c"UART1R : %d\0A\00"
@.str.4 = [13 x i8] c"UART2T : %d\0A\00"
@.str.5 = [13 x i8] c"UART2R : %d\0A\00"
@.str.6 = [13 x i8] c"UART4T : %d\0A\00"
@.str.7 = [13 x i8] c"UART4R : %d\0A\00"
@.str.8 = [8 x i8] c"START!\0A\00"
@.str.9 = [7 x i8] c"1|%s|\0A\00"
@.str.10 = [14 x i8] c"theta : %.3f\0A\00"
@.str.11 = [5 x i8] c"End\0A\00"
@str = [6 x i8] c"Start\00"
@str.12 = [7 x i8] c"START!\00"
@str.13 = [4 x i8] c"End\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = alloca [500 x i8]
%3 = alloca [100 x i8]
%4 = alloca [50 x i8]
%5 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 0
%8 = getelementptr inbounds [50 x i8], [50 x i8]* %4, i64 0, i64 0
%9 = tail call i32 (...) @SettingCape()
%10 = tail call i32 @LEDOn(i32 23)
%11 = tail call i32 @LEDOn(i32 47)
%12 = tail call i32 @InitPin(i32 27)
%13 = tail call i32 @SetPinDirt(i32 27, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
%15 = tail call i32 @UART_init(i32 1, i8 signext 84)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%17 = tail call i32 @UART_init(i32 1, i8 signext 82)
%18 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %17)
%19 = tail call i32 @UART_Baudrate_NonC(i32 %15, i32 115200, i32 0, i32 1)
%20 = tail call i32 @UART_init(i32 2, i8 signext 84)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = tail call i32 @UART_init(i32 2, i8 signext 82)
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i32 %22)
%24 = tail call i32 @UART_Baudrate_NonC(i32 %20, i32 115200, i32 0, i32 1)
%25 = tail call i32 @UART_init(i32 4, i8 signext 84)
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.6, i64 0, i64 0), i32 %25)
%27 = tail call i32 @UART_init(i32 4, i8 signext 82)
%28 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %27)
%29 = tail call i32 @UART_Baudrate_NonC(i32 %25, i32 115200, i32 0, i32 1)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.12, i64 0, i64 0))
%31 = tail call i32 @write(i32 %15, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.8, i64 0, i64 0), i32 8)
%32 = call i32 @GetPinValue(i32 27)
%33 = icmp eq i32 %32, 0
br i1 %33, label %34, label %112
34: ; preds = %0, %108
%35 = phi i32 [ %109, %108 ], [ 0, %0 ]
%36 = call i32 @read(i32 %17, i8* %5, i32 100)
%37 = call i32 @strcat(i8* %6, i8* %5)
%38 = call i32 @Nullize(i8* %5, i32 %36)
%39 = icmp eq i32 %36, -1
br i1 %39, label %108, label %40
40: ; preds = %34
%41 = add nsw i32 %35, 1
%42 = icmp ult i32 %35, 500
br i1 %42, label %43, label %108
43: ; preds = %40, %67
%44 = phi i32 [ %68, %67 ], [ %35, %40 ]
%45 = phi i32 [ %52, %67 ], [ 0, %40 ]
%46 = phi i32 [ %51, %67 ], [ %35, %40 ]
%47 = zext i32 %44 to i64
%48 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = icmp eq i8 %49, 36
%51 = select i1 %50, i32 %44, i32 %46
%52 = select i1 %50, i32 1, i32 %45
%53 = zext i1 %50 to i32
%54 = add nuw nsw i32 %44, %53
%55 = icmp eq i32 %52, 1
br i1 %55, label %56, label %67
56: ; preds = %43
%57 = add nsw i32 %54, -3
%58 = sext i32 %57 to i64
%59 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 %58
%60 = load i8, i8* %59
%61 = icmp eq i8 %60, 42
br i1 %61, label %71, label %62
62: ; preds = %56
%63 = zext i32 %54 to i64
%64 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = icmp eq i8 %65, 0
br i1 %66, label %108, label %67
67: ; preds = %43, %62
%68 = add nuw nsw i32 %54, 1
%69 = icmp ult i32 %54, 499
br i1 %69, label %43, label %70
70: ; preds = %67
switch i32 %52, label %108 [
i32 3, label %95
i32 2, label %71
]
71: ; preds = %56, %70
%72 = phi i32 [ %41, %70 ], [ %54, %56 ]
%73 = icmp sgt i32 %72, %51
br i1 %73, label %74, label %108
74: ; preds = %71
%75 = sext i32 %51 to i64
%76 = sub i32 %72, %51
%77 = zext i32 %76 to i64
br label %78
78: ; preds = %74, %92
%79 = phi i64 [ 0, %74 ], [ %88, %92 ]
%80 = phi i64 [ %75, %74 ], [ %93, %92 ]
%81 = getelementptr inbounds [500 x i8], [500 x i8]* %2, i64 0, i64 %80
%82 = load i8, i8* %81
%83 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %79
store i8 %82, i8* %83
%84 = add nsw i64 %79, -2
%85 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = icmp eq i8 %86, 42
%88 = add nuw i64 %79, 1
br i1 %87, label %89, label %92
89: ; preds = %78
%90 = and i64 %88, 4294967295
%91 = getelementptr inbounds [100 x i8], [100 x i8]* %3, i64 0, i64 %90
store i8 0, i8* %91
br label %95
92: ; preds = %78
%93 = add nsw i64 %80, 1
%94 = icmp eq i64 %88, %77
br i1 %94, label %108, label %78
95: ; preds = %70, %89
%96 = phi i32 [ %72, %89 ], [ %35, %70 ]
%97 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.9, i64 0, i64 0), i8* %7)
%98 = call i32 @strlen(i8* %8)
%99 = add nsw i32 %98, 1
%100 = call i32 @write(i32 %15, i8* %8, i32 %99)
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.10, i64 0, i64 0), double 0.000000e+00)
%102 = call i32 @Nullize(i8* %7, i32 100)
%103 = call i32 @strlen(i8* %6)
%104 = icmp sgt i32 %103, 300
br i1 %104, label %105, label %108
105: ; preds = %95
%106 = call i32 @strlen(i8* %6)
%107 = call i32 @Nullize(i8* %6, i32 %106)
br label %108
108: ; preds = %62, %92, %40, %70, %71, %105, %95, %34
%109 = phi i32 [ 0, %105 ], [ %96, %95 ], [ %35, %34 ], [ %35, %71 ], [ %35, %70 ], [ %35, %40 ], [ %35, %92 ], [ %35, %62 ]
%110 = call i32 @GetPinValue(i32 27)
%111 = icmp eq i32 %110, 0
br i1 %111, label %34, label %112
112: ; preds = %108, %0
%113 = call i32 @write(i32 %25, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0), i32 5)
%114 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @str.13, i64 0, i64 0))
%115 = call i32 @CloseGPin(i32 27)
%116 = call i32 @LEDOff(i32 23)
%117 = call i32 @LEDOff(i32 47)
ret i32 0
}