#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*/ printf(char *, int, int, int, int, int, int, int, int, int,
                          int);
int *rdp_stats();
void rdp_receiver_stats() {
  int *stats = rdp_stats();
  printf("\n\n"
         "total data bytes received: %d\n"
         "unique data bytes received: %d\n"
         "total data packets received: %d\n"
         "unique data packets received: %d\n"
         "SYN packets received: %d\n"
         "FIN packets received: %d\n"
         "RST packets received: %d\n"
         "ACK packets sent: %d\n"
         "RST packets sent: %d\n"
         "total time duration (second): %d\n",
         stats[4], stats[5], stats[8], stats[9], stats[15], stats[16],
         stats[17], stats[14], stats[12], (stats[1] - stats[0]));
}


x86 assembly (clang, -O0):
<rdp_receiver_stats>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x30,%rsp
mov    $0x0,%al
call   1040 <rdp_stats@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%esi
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x24(%rax),%r8d
mov    -0x18(%rbp),%rax
mov    0x3c(%rax),%r9d
mov    -0x18(%rbp),%rax
mov    0x40(%rax),%r14d
mov    -0x18(%rbp),%rax
mov    0x44(%rax),%ebx
mov    -0x18(%rbp),%rax
mov    0x38(%rax),%r11d
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%r10d
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x18(%rbp),%rdi
sub    (%rdi),%eax
lea    0xe72(%rip),%rdi
mov    %r14d,(%rsp)
mov    %ebx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10d,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdp_receiver_stats>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <rdp_stats@plt>
mov    0x4(%rax),%r10d
mov    0x10(%rax),%esi
mov    0x14(%rax),%edx
mov    0x20(%rax),%ecx
mov    0x24(%rax),%r8d
mov    0x3c(%rax),%r9d
mov    0x40(%rax),%r11d
mov    0x44(%rax),%r14d
mov    0x38(%rax),%r15d
mov    0x30(%rax),%ebx
sub    (%rax),%r10d
sub    $0x8,%rsp
lea    0xea2(%rip),%rdi
push   %r10
push   %rbx
push   %r15
push   %r14
push   %r11
call   1030 <printf@plt>
add    $0x30,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [279 x i8] c"\0A\0Atotal data bytes received: %d\0Aunique data bytes received: %d\0Atotal data packets received: %d\0Aunique data packets received: %d\0ASYN packets received: %d\0AFIN packets received: %d\0ARST packets received: %d\0AACK packets sent: %d\0ARST packets sent: %d\0Atotal time duration (second): %d\0A\00"
define void @rdp_receiver_stats() {
%1 = alloca i32*
%2 = call i32* (...) @rdp_stats()
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = getelementptr inbounds i32, i32* %3, i64 4
%5 = load i32, i32* %4
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 5
%8 = load i32, i32* %7
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = load i32, i32* %10
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i64 9
%14 = load i32, i32* %13
%15 = load i32*, i32** %1
%16 = getelementptr inbounds i32, i32* %15, i64 15
%17 = load i32, i32* %16
%18 = load i32*, i32** %1
%19 = getelementptr inbounds i32, i32* %18, i64 16
%20 = load i32, i32* %19
%21 = load i32*, i32** %1
%22 = getelementptr inbounds i32, i32* %21, i64 17
%23 = load i32, i32* %22
%24 = load i32*, i32** %1
%25 = getelementptr inbounds i32, i32* %24, i64 14
%26 = load i32, i32* %25
%27 = load i32*, i32** %1
%28 = getelementptr inbounds i32, i32* %27, i64 12
%29 = load i32, i32* %28
%30 = load i32*, i32** %1
%31 = getelementptr inbounds i32, i32* %30, i64 1
%32 = load i32, i32* %31
%33 = load i32*, i32** %1
%34 = getelementptr inbounds i32, i32* %33, i64 0
%35 = load i32, i32* %34
%36 = sub nsw i32 %32, %35
%37 = call i32 @printf(i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8, i32 %11, i32 %14, i32 %17, i32 %20, i32 %23, i32 %26, i32 %29, i32 %36)
ret void
}

LLVM IR (-O2):
@.str = [279 x i8] c"\0A\0Atotal data bytes received: %d\0Aunique data bytes received: %d\0Atotal data packets received: %d\0Aunique data packets received: %d\0ASYN packets received: %d\0AFIN packets received: %d\0ARST packets received: %d\0AACK packets sent: %d\0ARST packets sent: %d\0Atotal time duration (second): %d\0A\00"
define void @rdp_receiver_stats() {
%1 = tail call i32* (...) @rdp_stats()
%2 = getelementptr inbounds i32, i32* %1, i64 4
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %1, i64 5
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 8
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 9
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 15
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %1, i64 16
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 17
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %1, i64 14
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %1, i64 12
%19 = load i32, i32* %18
%20 = getelementptr inbounds i32, i32* %1, i64 1
%21 = load i32, i32* %20
%22 = load i32, i32* %1
%23 = sub nsw i32 %21, %22
%24 = tail call i32 @printf(i8* getelementptr inbounds ([279 x i8], [279 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19, i32 %23)
ret void
}