#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*/ text_led;

/* Variables and functions */
int /*<<< orphan*/ __delay();
int /*<<< orphan*/ rotate_display_hex(unsigned char *, int);
int /*<<< orphan*/ write_LW(unsigned int *, int, int);
int main(void) {
  unsigned int led_data = 0xAAA;
  int fir_lp[128] = {
      -525,    2432,    3524,    1703,    -1811,   -4234,   -3285,   792,
      4950,    5446,    1054,    -5263,   -8121,   -4123,   4551,    10919,
      8609,    -2094,   -13097,  -14355,  -2757,   13616,   20741,   10379,
      -11283,  -26643,  -20673,  4950,    30481,   32913,   6232,    -30358,
      -45655,  -22576,  24272,   56744,   43636,   -10366,  -63397,  -68071,
      -12834,  62325,   93576,   46269,   -49823,  -116872, -90359,  21631,
      133636,  145374,  27863,   -138082, -212562, -108368, 121153,  297626,
      243694,  -62703,  -424951, -522329, -118440, 752057,  1754741, 2422425,
      2422425, 1754741, 752057,  -118440, -522329, -424951, -62703,  243694,
      297626,  121153,  -108368, -212562, -138082, 27863,   145374,  133636,
      21631,   -90359,  -116872, -49823,  46269,   93576,   62325,   -12834,
      -68071,  -63397,  -10366,  43636,   56744,   24272,   -22576,  -45655,
      -30358,  6232,    32913,   30481,   4950,    -20673,  -26643,  -11283,
      10379,   20741,   13616,   -2757,   -14355,  -13097,  -2094,   8609,
      10919,   4551,    -4123,   -8121,   -5263,   1054,    5446,    4950,
      792,     -3285,   -4234,   -1811,   1703,    3524,    2432,    -525};
  unsigned int mul[2] = {0.5 / 0.00000011920928955078125f,
                         0.25 / 0.00000011920928955078125f};
  unsigned int delay = 10;
  unsigned int white_noise_enable = 0;
  unsigned int seven_seg1 = 0x39 | (0x5C << 7) | (0x6D << 14);
  unsigned int seven_seg2 = (0x73) | (0x6D << 7) | (0x77 << 14);
  unsigned int fir_enable = 1;
  unsigned char text_led[10] = {0x77, 0x6D, 0x73, 0x40, 0x6D,
                                0x5C, 0x39, 0x00, 0x00, 0x00};
  write_LW(&seven_seg1, 0x40, 1);
  write_LW(&seven_seg2, 0x30, 1);
  write_LW(&white_noise_enable, 0x64, 1);
  write_LW(&white_noise_enable, 0x80, 1);
  write_LW(&delay, 0x8c, 1);
  write_LW(&delay, 0x88, 1);
  write_LW(mul, 0x68, 2);
  write_LW((unsigned int *)fir_lp, 0x400, 128);
  write_LW((unsigned int *)fir_lp, 0x200, 128);
  write_LW(&fir_enable, 0xa4, 1);
  write_LW(&fir_enable, 0xa8, 1);
  while (1) {
    __delay();
    led_data = ~led_data;
    write_LW(&led_data, 0x10, 1);
    rotate_display_hex(text_led, sizeof(text_led));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x240,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xaaa,-0x8(%rbp)
lea    -0x210(%rbp),%rdi
lea    0xe99(%rip),%rsi
mov    $0x200,%edx
call   1060 <memcpy@plt>
mov    0x1094(%rip),%rax
mov    %rax,-0x218(%rbp)
movl   $0xa,-0x21c(%rbp)
movl   $0x0,-0x220(%rbp)
movl   $0x1b6e39,-0x224(%rbp)
movl   $0x1df6f3,-0x228(%rbp)
movl   $0x1,-0x22c(%rbp)
mov    0x1048(%rip),%rax
mov    %rax,-0x236(%rbp)
mov    0x1042(%rip),%ax
mov    %ax,-0x22e(%rbp)
lea    -0x224(%rbp),%rdi
mov    $0x40,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x228(%rbp),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x220(%rbp),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x220(%rbp),%rdi
mov    $0x80,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x21c(%rbp),%rdi
mov    $0x8c,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x21c(%rbp),%rdi
mov    $0x88,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x218(%rbp),%rdi
mov    $0x68,%esi
mov    $0x2,%edx
call   1040 <write_LW@plt>
lea    -0x210(%rbp),%rdi
mov    $0x400,%esi
mov    $0x80,%edx
call   1040 <write_LW@plt>
lea    -0x210(%rbp),%rdi
mov    $0x200,%esi
mov    $0x80,%edx
call   1040 <write_LW@plt>
lea    -0x22c(%rbp),%rdi
mov    $0xa4,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x22c(%rbp),%rdi
mov    $0xa8,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
mov    $0x0,%al
call   1050 <__delay@plt>
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x23c(%rbp)
mov    %eax,-0x8(%rbp)
lea    -0x8(%rbp),%rdi
mov    $0x10,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    -0x236(%rbp),%rdi
mov    $0xa,%esi
call   1030 <rotate_display_hex@plt>
jmp    12bf <main+0x17f>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x238,%rsp
movl   $0xaaa,(%rsp)
lea    0xea8(%rip),%rsi
lea    0x30(%rsp),%r14
mov    $0x200,%edx
mov    %r14,%rdi
call   1060 <memcpy@plt>
movabs $0x20000000400000,%rax
mov    %rax,0x28(%rsp)
movl   $0xa,0x14(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x1b6e39,0xc(%rsp)
movl   $0x1df6f3,0x8(%rsp)
movl   $0x1,0x4(%rsp)
movabs $0x395c6d40736d77,%rax
mov    %rax,0x18(%rsp)
movw   $0x0,0x20(%rsp)
lea    0xc(%rsp),%rdi
mov    $0x40,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    0x8(%rsp),%rdi
mov    $0x30,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x64,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    0x14(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x8c,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
mov    %rbx,%rdi
mov    $0x88,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
lea    0x28(%rsp),%rdi
mov    $0x68,%esi
mov    $0x2,%edx
call   1040 <write_LW@plt>
mov    %r14,%rdi
mov    $0x400,%esi
mov    $0x80,%edx
call   1040 <write_LW@plt>
mov    %r14,%rdi
mov    $0x200,%esi
mov    $0x80,%edx
call   1040 <write_LW@plt>
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xa4,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
mov    %rbx,%rdi
mov    $0xa8,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
mov    %rsp,%r14
lea    0x18(%rsp),%rbx
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1050 <__delay@plt>
notl   (%rsp)
mov    %r14,%rdi
mov    $0x10,%esi
mov    $0x1,%edx
call   1040 <write_LW@plt>
mov    %rbx,%rdi
mov    $0xa,%esi
call   1030 <rotate_display_hex@plt>
jmp    12a0 <main+0x160>

LLVM IR (-O0):
@__const.main.fir_lp = [128 x i32] [i32 -525, i32 2432, i32 3524, i32 1703, i32 -1811, i32 -4234, i32 -3285, i32 792, i32 4950, i32 5446, i32 1054, i32 -5263, i32 -8121, i32 -4123, i32 4551, i32 10919, i32 8609, i32 -2094, i32 -13097, i32 -14355, i32 -2757, i32 13616, i32 20741, i32 10379, i32 -11283, i32 -26643, i32 -20673, i32 4950, i32 30481, i32 32913, i32 6232, i32 -30358, i32 -45655, i32 -22576, i32 24272, i32 56744, i32 43636, i32 -10366, i32 -63397, i32 -68071, i32 -12834, i32 62325, i32 93576, i32 46269, i32 -49823, i32 -116872, i32 -90359, i32 21631, i32 133636, i32 145374, i32 27863, i32 -138082, i32 -212562, i32 -108368, i32 121153, i32 297626, i32 243694, i32 -62703, i32 -424951, i32 -522329, i32 -118440, i32 752057, i32 1754741, i32 2422425, i32 2422425, i32 1754741, i32 752057, i32 -118440, i32 -522329, i32 -424951, i32 -62703, i32 243694, i32 297626, i32 121153, i32 -108368, i32 -212562, i32 -138082, i32 27863, i32 145374, i32 133636, i32 21631, i32 -90359, i32 -116872, i32 -49823, i32 46269, i32 93576, i32 62325, i32 -12834, i32 -68071, i32 -63397, i32 -10366, i32 43636, i32 56744, i32 24272, i32 -22576, i32 -45655, i32 -30358, i32 6232, i32 32913, i32 30481, i32 4950, i32 -20673, i32 -26643, i32 -11283, i32 10379, i32 20741, i32 13616, i32 -2757, i32 -14355, i32 -13097, i32 -2094, i32 8609, i32 10919, i32 4551, i32 -4123, i32 -8121, i32 -5263, i32 1054, i32 5446, i32 4950, i32 792, i32 -3285, i32 -4234, i32 -1811, i32 1703, i32 3524, i32 2432, i32 -525]
@__const.main.mul = [2 x i32] [i32 4194304, i32 2097152]
@__const.main.text_led = [10 x i8] c"wms@m\\9\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [128 x i32]
%4 = alloca [2 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [10 x i8]
store i32 0, i32* %1
store i32 2730, i32* %2
%11 = bitcast [128 x i32]* %3 to i8*
%12 = bitcast [2 x i32]* %4 to i8*
store i32 10, i32* %5
store i32 0, i32* %6
store i32 1797689, i32* %7
store i32 1963763, i32* %8
store i32 1, i32* %9
%13 = bitcast [10 x i8]* %10 to i8*
%14 = call i32 @write_LW(i32* %7, i32 64, i32 1)
%15 = call i32 @write_LW(i32* %8, i32 48, i32 1)
%16 = call i32 @write_LW(i32* %6, i32 100, i32 1)
%17 = call i32 @write_LW(i32* %6, i32 128, i32 1)
%18 = call i32 @write_LW(i32* %5, i32 140, i32 1)
%19 = call i32 @write_LW(i32* %5, i32 136, i32 1)
%20 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 0
%21 = call i32 @write_LW(i32* %20, i32 104, i32 2)
%22 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 0
%23 = call i32 @write_LW(i32* %22, i32 1024, i32 128)
%24 = getelementptr inbounds [128 x i32], [128 x i32]* %3, i64 0, i64 0
%25 = call i32 @write_LW(i32* %24, i32 512, i32 128)
%26 = call i32 @write_LW(i32* %9, i32 164, i32 1)
%27 = call i32 @write_LW(i32* %9, i32 168, i32 1)
br label %28
28: ; preds = %0, %28
%29 = call i32 (...) @__delay()
%30 = load i32, i32* %2
%31 = xor i32 %30, -1
store i32 %31, i32* %2
%32 = call i32 @write_LW(i32* %2, i32 16, i32 1)
%33 = getelementptr inbounds [10 x i8], [10 x i8]* %10, i64 0, i64 0
%34 = call i32 @rotate_display_hex(i8* %33, i32 10)
br label %28
}

LLVM IR (-O2):
@__const.main.fir_lp = [128 x i32] [i32 -525, i32 2432, i32 3524, i32 1703, i32 -1811, i32 -4234, i32 -3285, i32 792, i32 4950, i32 5446, i32 1054, i32 -5263, i32 -8121, i32 -4123, i32 4551, i32 10919, i32 8609, i32 -2094, i32 -13097, i32 -14355, i32 -2757, i32 13616, i32 20741, i32 10379, i32 -11283, i32 -26643, i32 -20673, i32 4950, i32 30481, i32 32913, i32 6232, i32 -30358, i32 -45655, i32 -22576, i32 24272, i32 56744, i32 43636, i32 -10366, i32 -63397, i32 -68071, i32 -12834, i32 62325, i32 93576, i32 46269, i32 -49823, i32 -116872, i32 -90359, i32 21631, i32 133636, i32 145374, i32 27863, i32 -138082, i32 -212562, i32 -108368, i32 121153, i32 297626, i32 243694, i32 -62703, i32 -424951, i32 -522329, i32 -118440, i32 752057, i32 1754741, i32 2422425, i32 2422425, i32 1754741, i32 752057, i32 -118440, i32 -522329, i32 -424951, i32 -62703, i32 243694, i32 297626, i32 121153, i32 -108368, i32 -212562, i32 -138082, i32 27863, i32 145374, i32 133636, i32 21631, i32 -90359, i32 -116872, i32 -49823, i32 46269, i32 93576, i32 62325, i32 -12834, i32 -68071, i32 -63397, i32 -10366, i32 43636, i32 56744, i32 24272, i32 -22576, i32 -45655, i32 -30358, i32 6232, i32 32913, i32 30481, i32 4950, i32 -20673, i32 -26643, i32 -11283, i32 10379, i32 20741, i32 13616, i32 -2757, i32 -14355, i32 -13097, i32 -2094, i32 8609, i32 10919, i32 4551, i32 -4123, i32 -8121, i32 -5263, i32 1054, i32 5446, i32 4950, i32 792, i32 -3285, i32 -4234, i32 -1811, i32 1703, i32 3524, i32 2432, i32 -525]
@__const.main.text_led = [10 x i8] c"wms@m\\9\00\00\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x i32]
%3 = alloca i64
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [10 x i8]
%10 = bitcast i32* %1 to i8*
store i32 2730, i32* %1
%11 = bitcast [128 x i32]* %2 to i8*
%12 = bitcast i64* %3 to i8*
store i64 9007199258935296, i64* %3
%13 = bitcast i32* %4 to i8*
store i32 10, i32* %4
%14 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%15 = bitcast i32* %6 to i8*
store i32 1797689, i32* %6
%16 = bitcast i32* %7 to i8*
store i32 1963763, i32* %7
%17 = bitcast i32* %8 to i8*
store i32 1, i32* %8
%18 = getelementptr inbounds [10 x i8], [10 x i8]* %9, i64 0, i64 0
%19 = call i32 @write_LW(i32* %6, i32 64, i32 1)
%20 = call i32 @write_LW(i32* %7, i32 48, i32 1)
%21 = call i32 @write_LW(i32* %5, i32 100, i32 1)
%22 = call i32 @write_LW(i32* %5, i32 128, i32 1)
%23 = call i32 @write_LW(i32* %4, i32 140, i32 1)
%24 = call i32 @write_LW(i32* %4, i32 136, i32 1)
%25 = bitcast i64* %3 to i32*
%26 = call i32 @write_LW(i32* %25, i32 104, i32 2)
%27 = getelementptr inbounds [128 x i32], [128 x i32]* %2, i64 0, i64 0
%28 = call i32 @write_LW(i32* %27, i32 1024, i32 128)
%29 = call i32 @write_LW(i32* %27, i32 512, i32 128)
%30 = call i32 @write_LW(i32* %8, i32 164, i32 1)
%31 = call i32 @write_LW(i32* %8, i32 168, i32 1)
br label %32
32: ; preds = %32, %0
%33 = call i32 (...) @__delay()
%34 = load i32, i32* %1
%35 = xor i32 %34, -1
store i32 %35, i32* %1
%36 = call i32 @write_LW(i32* %1, i32 16, i32 1)
%37 = call i32 @rotate_display_hex(i8* %18, i32 10)
br label %32
}