#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 */
struct timeval {
  int dummy;
};

/* Variables and functions */
double elapsed_time(struct timeval, struct timeval);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ run_test(char **, int, struct timeval *, struct timeval *);
int /*<<< orphan*/ sleep(int);
int main(int argc, char *argv[]) {
  struct timeval t_start, t_end;
  double acc, avg, speed;
  unsigned int x;
  char *demo_msg1[] = {
      "!AIVDM,1,1,,B,15MqvC0Oh9G?qinK?VlPhA480@2n,0*1F,123,14",
      "!AIVDM,1,1,,B,15Mf@6P001G?v68K??4SejL<00Sl,0*71",
      "!AIVDM,1,1,,B,15Mn4kPP01G?qNvK>:grkOv<0<11,0*55",
      "!AIVDM,1,1,,B,15O1Pv0022o?GeNKB3f7QV2>00SP,0*26",
      "!AIVDM,1,1,,B,15MqvC0Oh:G?qj0K?Vp@di4B0@5>,0*44",
      "!AIVDM,1,1,,B,15NcRf0P3wG?Wq>o=RP?vB0<1J,0*7B",
      "$BSVDM,1,1,,B,15MqvC0Oh:G?qj0K?Vp@di4B0@5>,0*5D",
      "!BSVDM,1,1,,B,15NcRf0P3wG?Wq>o=RP?vB0<1J,0*02,142,aass,12311",
  };
  char *demo_msg5[] = {"!AIVDM,2,1,6,B,55ArUT02:nkG<I8GB20nuJ0p5HTu>"
                       "0hT9860TV16000006420BDi@E53,0*33",
                       "!AIVDM,2,2,6,B,1KUDhH888888880,2*6A",
                       "!AIVDM,2,1,7,B,55N6RQ000001L@?WWC4h5="
                       "B0l4pLv2222222220U1@6335oA0543lU83,0*14",
                       "!AIVDM,2,2,7,B,5A33mp888888880,2*49",
                       "!AIVDM,2,1,8,B,55N0=SP00001Lt??;OL<PTDJ1<D5A@"
                       "hF2222220k2@>2640005h00000,0*70",
                       "!AIVDM,2,2,8,B,000000000000000,2*2F",
                       "!AIVDM,2,1,9,B,55Mj3MP00001LgO73N0dh4PuMT61M<"
                       "J22222220t3iJ??40Ht<Uli`51,0*57",
                       "!AIVDM,2,2,9,B,DSBCPC888888880,2*2B",
                       "!AIVDM,2,1,1,B,55Mj2u01o97qMU;?C;5M<J0dUA<"
                       "522222222220t2Q@>:40Ht<Uli`51,0*16",
                       "!AIVDM,2,2,1,B,DSBCPC888888880,2*23",
                       "!AIVDM,2,1,2,B,54QKkL01uDfUM@k;SO918v1="
                       "E9HETu800000000010e2:40000000000,0*20",
                       "!AIVDM,2,2,2,B,000000000000000,2*25",
                       "!AIVDM,2,1,5,B,54eGL:00543h=WWG7V0`u<"
                       "F0p59H4Eb22222220l10A5262k0<S0APDQ,0*62",
                       "!AIVDM,2,2,5,B,iH4i@E531H88880,2*24"};
  printf("Message1 test\n");
  acc = 0;
  for (x = 0; x < 5; x++) {
    sleep(5);
    run_test(demo_msg1, 7, &t_start, &t_end);
    acc += elapsed_time(t_start, t_end);
    printf("Run #%d = %0.4f\n", x + 1, elapsed_time(t_start, t_end));
  }
  avg = acc / 5.0;
  speed = (250000.0 * 7) / avg;
  printf("Average = %0.4f\n", avg);
  printf("Speed = %0.4f messages/sec\n", speed);
  printf("Message5 test\n");
  acc = 0;
  for (x = 0; x < 5; x++) {
    sleep(5);
    run_test(demo_msg5, 14, &t_start, &t_end);
    acc += elapsed_time(t_start, t_end);
    printf("Run #%d = %0.4f\n", x + 1, elapsed_time(t_start, t_end));
  }
  avg = acc / 5.0;
  speed = (250000.0 * 14) / avg;
  printf("Average = %0.4f\n", avg);
  printf("Speed = %0.4f messages/sec\n", speed);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x80(%rbp),%rdi
lea    0x2bfc(%rip),%rsi
mov    $0x40,%edx
call   1050 <memcpy@plt>
lea    -0xf0(%rbp),%rdi
lea    0x2c24(%rip),%rsi
mov    $0x70,%edx
call   1050 <memcpy@plt>
lea    0x1326(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x5,-0x3c(%rbp)
jae    122b <main+0xdb>
mov    $0x5,%edi
call   1070 <sleep@plt>
lea    -0x80(%rbp),%rdi
mov    $0x7,%esi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1060 <run_test@plt>
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <elapsed_time@plt>
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf4(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <elapsed_time@plt>
mov    -0xf4(%rbp),%esi
lea    0x12bc(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    11b3 <main+0x63>
movsd  -0x28(%rbp),%xmm0
movsd  0xdd0(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xdb7(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0x1284(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0x1282(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0x1290(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
cmpl   $0x5,-0x3c(%rbp)
jae    1311 <main+0x1c1>
mov    $0x5,%edi
call   1070 <sleep@plt>
lea    -0xf0(%rbp),%rdi
mov    $0xe,%esi
lea    -0x18(%rbp),%rdx
lea    -0x20(%rbp),%rcx
call   1060 <run_test@plt>
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <elapsed_time@plt>
addsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xf8(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x20(%rbp),%esi
call   1030 <elapsed_time@plt>
mov    -0xf8(%rbp),%esi
lea    0x11d6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1296 <main+0x146>
movsd  -0x28(%rbp),%xmm0
movsd  0xcea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  0xce1(%rip),%xmm0
divsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x30(%rbp),%xmm0
lea    0x119e(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0x119c(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xd8,%rsp
movaps 0x2c38(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0x2c1c(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0x2c00(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0x2be4(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0x2c78(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0x2c59(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0x2c3a(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0x2c1b(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0x2bfc(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0x2bdd(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movapd 0x2bc0(%rip),%xmm0
movapd %xmm0,0x60(%rsp)
lea    0x130c(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
lea    0x20(%rsp),%rbx
lea    0x10(%rsp),%r15
lea    0x8(%rsp),%r14
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
xorpd  %xmm1,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
lea    0x126e(%rip),%rbp
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0x7,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm0
divsd  0xc3e(%rip),%xmm0
movsd  0xc3e(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
lea    0x1101(%rip),%r12
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x1101(%rip),%r13
mov    %r13,%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
lea    0x1114(%rip),%rdi
call   1030 <puts@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xe,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0xbd9(%rip),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x1,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x2,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x3,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x4,%esi
mov    $0x1,%al
call   1050 <printf@plt>
mov    $0x5,%edi
call   1070 <sleep@plt>
mov    %rbx,%rdi
mov    $0xe,%esi
mov    %r15,%rdx
mov    %r14,%rcx
call   1060 <run_test@plt>
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    0x10(%rsp),%edi
mov    0x8(%rsp),%esi
call   1040 <elapsed_time@plt>
mov    %rbp,%rdi
mov    $0x5,%esi
mov    $0x1,%al
call   1050 <printf@plt>
movsd  0x18(%rsp),%xmm0
divsd  0xa49(%rip),%xmm0
movsd  0xa51(%rip),%xmm1
divsd  %xmm0,%xmm1
movsd  %xmm1,0x18(%rsp)
mov    %r12,%rdi
mov    $0x1,%al
call   1050 <printf@plt>
mov    %r13,%rdi
movsd  0x18(%rsp),%xmm0
mov    $0x1,%al
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xd8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.timeval = type { i32 }
@.str = [55 x i8] c"!AIVDM,1,1,,B,15MqvC0Oh9G?qinK?VlPhA480@2n,0*1F,123,14\00"
@.str.1 = [48 x i8] c"!AIVDM,1,1,,B,15Mf@6P001G?v68K??4SejL<00Sl,0*71\00"
@.str.2 = [48 x i8] c"!AIVDM,1,1,,B,15Mn4kPP01G?qNvK>:grkOv<0<11,0*55\00"
@.str.3 = [48 x i8] c"!AIVDM,1,1,,B,15O1Pv0022o?GeNKB3f7QV2>00SP,0*26\00"
@.str.4 = [48 x i8] c"!AIVDM,1,1,,B,15MqvC0Oh:G?qj0K?Vp@di4B0@5>,0*44\00"
@.str.5 = [47 x i8] c"!AIVDM,1,1,,B,15NcRf0P3wG?Wq\0B>o=RP?vB0<1J,0*7B\00"
@.str.6 = [48 x i8] c"$BSVDM,1,1,,B,15MqvC0Oh:G?qj0K?Vp@di4B0@5>,0*5D\00"
@.str.7 = [62 x i8] c"!BSVDM,1,1,,B,15NcRf0P3wG?Wq\0B>o=RP?vB0<1J,0*02,142,aass,12311\00"
@__const.main.demo_msg1 = [8 x i8*] [i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i32 0, i32 0)]
@.str.8 = [77 x i8] c"!AIVDM,2,1,6,B,55ArUT02:nkG<I8GB20nuJ0p5HTu>0hT9860TV16000006420BDi@E53,0*33\00"
@.str.9 = [36 x i8] c"!AIVDM,2,2,6,B,1KUDhH888888880,2*6A\00"
@.str.10 = [77 x i8] c"!AIVDM,2,1,7,B,55N6RQ000001L@?WWC4h5=B0l4pLv2222222220U1@6335oA0543lU83,0*14\00"
@.str.11 = [36 x i8] c"!AIVDM,2,2,7,B,5A33mp888888880,2*49\00"
@.str.12 = [77 x i8] c"!AIVDM,2,1,8,B,55N0=SP00001Lt??;OL<PTDJ1<D5A@hF2222220k2@>2640005h00000,0*70\00"
@.str.13 = [36 x i8] c"!AIVDM,2,2,8,B,000000000000000,2*2F\00"
@.str.14 = [77 x i8] c"!AIVDM,2,1,9,B,55Mj3MP00001LgO73N0dh4PuMT61M<J22222220t3iJ??40Ht<Uli`51,0*57\00"
@.str.15 = [36 x i8] c"!AIVDM,2,2,9,B,DSBCPC888888880,2*2B\00"
@.str.16 = [77 x i8] c"!AIVDM,2,1,1,B,55Mj2u01o97qMU;?C;5M<J0dUA<522222222220t2Q@>:40Ht<Uli`51,0*16\00"
@.str.17 = [36 x i8] c"!AIVDM,2,2,1,B,DSBCPC888888880,2*23\00"
@.str.18 = [77 x i8] c"!AIVDM,2,1,2,B,54QKkL01uDfUM@k;SO918v1=E9HETu800000000010e2:40000000000,0*20\00"
@.str.19 = [36 x i8] c"!AIVDM,2,2,2,B,000000000000000,2*25\00"
@.str.20 = [77 x i8] c"!AIVDM,2,1,5,B,54eGL:00543h=WWG7V0`u<F0p59H4Eb22222220l10A5262k0<S0APDQ,0*62\00"
@.str.21 = [36 x i8] c"!AIVDM,2,2,5,B,iH4i@E531H88880,2*24\00"
@__const.main.demo_msg5 = [14 x i8*] [i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i32 0, i32 0)]
@.str.22 = [15 x i8] c"Message1 test\0A\00"
@.str.23 = [17 x i8] c"Run #%d = %0.4f\0A\00"
@.str.24 = [17 x i8] c"Average = %0.4f\0A\00"
@.str.25 = [28 x i8] c"Speed = %0.4f messages/sec\0A\00"
@.str.26 = [15 x i8] c"Message5 test\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.timeval
%7 = alloca %struct.timeval
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca i32
%12 = alloca [8 x i8*]
%13 = alloca [14 x i8*]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%14 = bitcast [8 x i8*]* %12 to i8*
%15 = bitcast [14 x i8*]* %13 to i8*
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.22, i64 0, i64 0))
store double 0.000000e+00, double* %8
store i32 0, i32* %11
br label %17
17: ; preds = %39, %2
%18 = load i32, i32* %11
%19 = icmp ult i32 %18, 5
br i1 %19, label %20, label %42
20: ; preds = %17
%21 = call i32 @sleep(i32 5)
%22 = getelementptr inbounds [8 x i8*], [8 x i8*]* %12, i64 0, i64 0
%23 = call i32 @run_test(i8** %22, i32 7, %struct.timeval* %6, %struct.timeval* %7)
%24 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%27 = load i32, i32* %26
%28 = call double @elapsed_time(i32 %25, i32 %27)
%29 = load double, double* %8
%30 = fadd double %29, %28
store double %30, double* %8
%31 = load i32, i32* %11
%32 = add i32 %31, 1
%33 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%34 = load i32, i32* %33
%35 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%36 = load i32, i32* %35
%37 = call double @elapsed_time(i32 %34, i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 %32, double %37)
br label %39
39: ; preds = %20
%40 = load i32, i32* %11
%41 = add i32 %40, 1
store i32 %41, i32* %11
br label %17
42: ; preds = %17
%43 = load double, double* %8
%44 = fdiv double %43, 5.000000e+00
store double %44, double* %9
%45 = load double, double* %9
%46 = fdiv double 1.750000e+06, %45
store double %46, double* %10
%47 = load double, double* %9
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), double %47)
%49 = load double, double* %10
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i64 0, i64 0), double %49)
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.26, i64 0, i64 0))
store double 0.000000e+00, double* %8
store i32 0, i32* %11
br label %52
52: ; preds = %74, %42
%53 = load i32, i32* %11
%54 = icmp ult i32 %53, 5
br i1 %54, label %55, label %77
55: ; preds = %52
%56 = call i32 @sleep(i32 5)
%57 = getelementptr inbounds [14 x i8*], [14 x i8*]* %13, i64 0, i64 0
%58 = call i32 @run_test(i8** %57, i32 14, %struct.timeval* %6, %struct.timeval* %7)
%59 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%60 = load i32, i32* %59
%61 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%62 = load i32, i32* %61
%63 = call double @elapsed_time(i32 %60, i32 %62)
%64 = load double, double* %8
%65 = fadd double %64, %63
store double %65, double* %8
%66 = load i32, i32* %11
%67 = add i32 %66, 1
%68 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%69 = load i32, i32* %68
%70 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i32 0, i32 0
%71 = load i32, i32* %70
%72 = call double @elapsed_time(i32 %69, i32 %71)
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 %67, double %72)
br label %74
74: ; preds = %55
%75 = load i32, i32* %11
%76 = add i32 %75, 1
store i32 %76, i32* %11
br label %52
77: ; preds = %52
%78 = load double, double* %8
%79 = fdiv double %78, 5.000000e+00
store double %79, double* %9
%80 = load double, double* %9
%81 = fdiv double 3.500000e+06, %80
store double %81, double* %10
%82 = load double, double* %9
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), double %82)
%84 = load double, double* %10
%85 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i64 0, i64 0), double %84)
ret i32 0
}

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [55 x i8] c"!AIVDM,1,1,,B,15MqvC0Oh9G?qinK?VlPhA480@2n,0*1F,123,14\00"
@.str.1 = [48 x i8] c"!AIVDM,1,1,,B,15Mf@6P001G?v68K??4SejL<00Sl,0*71\00"
@.str.2 = [48 x i8] c"!AIVDM,1,1,,B,15Mn4kPP01G?qNvK>:grkOv<0<11,0*55\00"
@.str.3 = [48 x i8] c"!AIVDM,1,1,,B,15O1Pv0022o?GeNKB3f7QV2>00SP,0*26\00"
@.str.4 = [48 x i8] c"!AIVDM,1,1,,B,15MqvC0Oh:G?qj0K?Vp@di4B0@5>,0*44\00"
@.str.5 = [47 x i8] c"!AIVDM,1,1,,B,15NcRf0P3wG?Wq\0B>o=RP?vB0<1J,0*7B\00"
@.str.6 = [48 x i8] c"$BSVDM,1,1,,B,15MqvC0Oh:G?qj0K?Vp@di4B0@5>,0*5D\00"
@.str.7 = [62 x i8] c"!BSVDM,1,1,,B,15NcRf0P3wG?Wq\0B>o=RP?vB0<1J,0*02,142,aass,12311\00"
@__const.main.demo_msg1 = [8 x i8*] [i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.7, i32 0, i32 0)]
@.str.8 = [77 x i8] c"!AIVDM,2,1,6,B,55ArUT02:nkG<I8GB20nuJ0p5HTu>0hT9860TV16000006420BDi@E53,0*33\00"
@.str.9 = [36 x i8] c"!AIVDM,2,2,6,B,1KUDhH888888880,2*6A\00"
@.str.10 = [77 x i8] c"!AIVDM,2,1,7,B,55N6RQ000001L@?WWC4h5=B0l4pLv2222222220U1@6335oA0543lU83,0*14\00"
@.str.11 = [36 x i8] c"!AIVDM,2,2,7,B,5A33mp888888880,2*49\00"
@.str.12 = [77 x i8] c"!AIVDM,2,1,8,B,55N0=SP00001Lt??;OL<PTDJ1<D5A@hF2222220k2@>2640005h00000,0*70\00"
@.str.13 = [36 x i8] c"!AIVDM,2,2,8,B,000000000000000,2*2F\00"
@.str.14 = [77 x i8] c"!AIVDM,2,1,9,B,55Mj3MP00001LgO73N0dh4PuMT61M<J22222220t3iJ??40Ht<Uli`51,0*57\00"
@.str.15 = [36 x i8] c"!AIVDM,2,2,9,B,DSBCPC888888880,2*2B\00"
@.str.16 = [77 x i8] c"!AIVDM,2,1,1,B,55Mj2u01o97qMU;?C;5M<J0dUA<522222222220t2Q@>:40Ht<Uli`51,0*16\00"
@.str.17 = [36 x i8] c"!AIVDM,2,2,1,B,DSBCPC888888880,2*23\00"
@.str.18 = [77 x i8] c"!AIVDM,2,1,2,B,54QKkL01uDfUM@k;SO918v1=E9HETu800000000010e2:40000000000,0*20\00"
@.str.19 = [36 x i8] c"!AIVDM,2,2,2,B,000000000000000,2*25\00"
@.str.20 = [77 x i8] c"!AIVDM,2,1,5,B,54eGL:00543h=WWG7V0`u<F0p59H4Eb22222220l10A5262k0<S0APDQ,0*62\00"
@.str.21 = [36 x i8] c"!AIVDM,2,2,5,B,iH4i@E531H88880,2*24\00"
@__const.main.demo_msg5 = [14 x i8*] [i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([77 x i8], [77 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.21, i32 0, i32 0)]
@.str.23 = [17 x i8] c"Run #%d = %0.4f\0A\00"
@.str.24 = [17 x i8] c"Average = %0.4f\0A\00"
@.str.25 = [28 x i8] c"Speed = %0.4f messages/sec\0A\00"
@str = [14 x i8] c"Message1 test\00"
@str.27 = [14 x i8] c"Message5 test\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.timeval
%4 = alloca %struct.timeval
%5 = alloca [8 x i8*]
%6 = alloca [14 x i8*]
%7 = bitcast %struct.timeval* %3 to i8*
%8 = bitcast %struct.timeval* %4 to i8*
%9 = bitcast [8 x i8*]* %5 to i8*
%10 = bitcast [14 x i8*]* %6 to i8*
%11 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%12 = getelementptr inbounds [8 x i8*], [8 x i8*]* %5, i64 0, i64 0
%13 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i64 0, i32 0
%14 = getelementptr inbounds %struct.timeval, %struct.timeval* %4, i64 0, i32 0
%15 = call i32 @sleep(i32 5)
%16 = call i32 @run_test(i8** %12, i32 7, %struct.timeval* %3, %struct.timeval* %4)
%17 = load i32, i32* %13
%18 = load i32, i32* %14
%19 = call double @elapsed_time(i32 %17, i32 %18)
%20 = fadd double %19, 0.000000e+00
%21 = load i32, i32* %13
%22 = load i32, i32* %14
%23 = call double @elapsed_time(i32 %21, i32 %22)
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 1, double %23)
%25 = call i32 @sleep(i32 5)
%26 = call i32 @run_test(i8** %12, i32 7, %struct.timeval* %3, %struct.timeval* %4)
%27 = load i32, i32* %13
%28 = load i32, i32* %14
%29 = call double @elapsed_time(i32 %27, i32 %28)
%30 = fadd double %20, %29
%31 = load i32, i32* %13
%32 = load i32, i32* %14
%33 = call double @elapsed_time(i32 %31, i32 %32)
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 2, double %33)
%35 = call i32 @sleep(i32 5)
%36 = call i32 @run_test(i8** %12, i32 7, %struct.timeval* %3, %struct.timeval* %4)
%37 = load i32, i32* %13
%38 = load i32, i32* %14
%39 = call double @elapsed_time(i32 %37, i32 %38)
%40 = fadd double %30, %39
%41 = load i32, i32* %13
%42 = load i32, i32* %14
%43 = call double @elapsed_time(i32 %41, i32 %42)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 3, double %43)
%45 = call i32 @sleep(i32 5)
%46 = call i32 @run_test(i8** %12, i32 7, %struct.timeval* %3, %struct.timeval* %4)
%47 = load i32, i32* %13
%48 = load i32, i32* %14
%49 = call double @elapsed_time(i32 %47, i32 %48)
%50 = fadd double %40, %49
%51 = load i32, i32* %13
%52 = load i32, i32* %14
%53 = call double @elapsed_time(i32 %51, i32 %52)
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 4, double %53)
%55 = call i32 @sleep(i32 5)
%56 = call i32 @run_test(i8** %12, i32 7, %struct.timeval* %3, %struct.timeval* %4)
%57 = load i32, i32* %13
%58 = load i32, i32* %14
%59 = call double @elapsed_time(i32 %57, i32 %58)
%60 = fadd double %50, %59
%61 = load i32, i32* %13
%62 = load i32, i32* %14
%63 = call double @elapsed_time(i32 %61, i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 5, double %63)
%65 = fdiv double %60, 5.000000e+00
%66 = fdiv double 1.750000e+06, %65
%67 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), double %65)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i64 0, i64 0), double %66)
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str.27, i64 0, i64 0))
%70 = getelementptr inbounds [14 x i8*], [14 x i8*]* %6, i64 0, i64 0
%71 = call i32 @sleep(i32 5)
%72 = call i32 @run_test(i8** %70, i32 14, %struct.timeval* %3, %struct.timeval* %4)
%73 = load i32, i32* %13
%74 = load i32, i32* %14
%75 = call double @elapsed_time(i32 %73, i32 %74)
%76 = fadd double %75, 0.000000e+00
%77 = load i32, i32* %13
%78 = load i32, i32* %14
%79 = call double @elapsed_time(i32 %77, i32 %78)
%80 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 1, double %79)
%81 = call i32 @sleep(i32 5)
%82 = call i32 @run_test(i8** %70, i32 14, %struct.timeval* %3, %struct.timeval* %4)
%83 = load i32, i32* %13
%84 = load i32, i32* %14
%85 = call double @elapsed_time(i32 %83, i32 %84)
%86 = fadd double %76, %85
%87 = load i32, i32* %13
%88 = load i32, i32* %14
%89 = call double @elapsed_time(i32 %87, i32 %88)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 2, double %89)
%91 = call i32 @sleep(i32 5)
%92 = call i32 @run_test(i8** %70, i32 14, %struct.timeval* %3, %struct.timeval* %4)
%93 = load i32, i32* %13
%94 = load i32, i32* %14
%95 = call double @elapsed_time(i32 %93, i32 %94)
%96 = fadd double %86, %95
%97 = load i32, i32* %13
%98 = load i32, i32* %14
%99 = call double @elapsed_time(i32 %97, i32 %98)
%100 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 3, double %99)
%101 = call i32 @sleep(i32 5)
%102 = call i32 @run_test(i8** %70, i32 14, %struct.timeval* %3, %struct.timeval* %4)
%103 = load i32, i32* %13
%104 = load i32, i32* %14
%105 = call double @elapsed_time(i32 %103, i32 %104)
%106 = fadd double %96, %105
%107 = load i32, i32* %13
%108 = load i32, i32* %14
%109 = call double @elapsed_time(i32 %107, i32 %108)
%110 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 4, double %109)
%111 = call i32 @sleep(i32 5)
%112 = call i32 @run_test(i8** %70, i32 14, %struct.timeval* %3, %struct.timeval* %4)
%113 = load i32, i32* %13
%114 = load i32, i32* %14
%115 = call double @elapsed_time(i32 %113, i32 %114)
%116 = fadd double %106, %115
%117 = load i32, i32* %13
%118 = load i32, i32* %14
%119 = call double @elapsed_time(i32 %117, i32 %118)
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.23, i64 0, i64 0), i32 5, double %119)
%121 = fdiv double %116, 5.000000e+00
%122 = fdiv double 3.500000e+06, %121
%123 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.24, i64 0, i64 0), double %121)
%124 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.25, i64 0, i64 0), double %122)
ret i32 0
}