#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_sender_stats() {
  int *stats = rdp_stats();
  printf("\n\n"
         "total data bytes sent: %d\n"
         "unique data bytes sent: %d\n"
         "total data packets sent: %d\n"
         "unique data packets sent: %d\n"
         "SYN packets sent: %d\n"
         "FIN packets sent: %d\n"
         "RST packets sent: %d\n"
         "ACK packets received: %d\n"
         "RST packets received: %d\n"
         "total time duration (second): %d\n",
         stats[2], stats[3], stats[6], stats[7], stats[10], stats[11],
         stats[12], stats[18], stats[17], (stats[1] - stats[0]));
}


x86 assembly (clang, -O0):
<rdp_sender_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    0x8(%rax),%esi
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edx
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%ecx
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%r8d
mov    -0x18(%rbp),%rax
mov    0x28(%rax),%r9d
mov    -0x18(%rbp),%rax
mov    0x2c(%rax),%r14d
mov    -0x18(%rbp),%rax
mov    0x30(%rax),%ebx
mov    -0x18(%rbp),%rax
mov    0x48(%rax),%r11d
mov    -0x18(%rbp),%rax
mov    0x44(%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_sender_stats>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <rdp_stats@plt>
mov    0x4(%rax),%r10d
mov    0x8(%rax),%esi
mov    0xc(%rax),%edx
mov    0x18(%rax),%ecx
mov    0x1c(%rax),%r8d
mov    0x28(%rax),%r9d
mov    0x2c(%rax),%r11d
mov    0x30(%rax),%r14d
mov    0x48(%rax),%r15d
mov    0x44(%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 = [259 x i8] c"\0A\0Atotal data bytes sent: %d\0Aunique data bytes sent: %d\0Atotal data packets sent: %d\0Aunique data packets sent: %d\0ASYN packets sent: %d\0AFIN packets sent: %d\0ARST packets sent: %d\0AACK packets received: %d\0ARST packets received: %d\0Atotal time duration (second): %d\0A\00"
define void @rdp_sender_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 2
%5 = load i32, i32* %4
%6 = load i32*, i32** %1
%7 = getelementptr inbounds i32, i32* %6, i64 3
%8 = load i32, i32* %7
%9 = load i32*, i32** %1
%10 = getelementptr inbounds i32, i32* %9, i64 6
%11 = load i32, i32* %10
%12 = load i32*, i32** %1
%13 = getelementptr inbounds i32, i32* %12, i64 7
%14 = load i32, i32* %13
%15 = load i32*, i32** %1
%16 = getelementptr inbounds i32, i32* %15, i64 10
%17 = load i32, i32* %16
%18 = load i32*, i32** %1
%19 = getelementptr inbounds i32, i32* %18, i64 11
%20 = load i32, i32* %19
%21 = load i32*, i32** %1
%22 = getelementptr inbounds i32, i32* %21, i64 12
%23 = load i32, i32* %22
%24 = load i32*, i32** %1
%25 = getelementptr inbounds i32, i32* %24, i64 18
%26 = load i32, i32* %25
%27 = load i32*, i32** %1
%28 = getelementptr inbounds i32, i32* %27, i64 17
%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 ([259 x i8], [259 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 = [259 x i8] c"\0A\0Atotal data bytes sent: %d\0Aunique data bytes sent: %d\0Atotal data packets sent: %d\0Aunique data packets sent: %d\0ASYN packets sent: %d\0AFIN packets sent: %d\0ARST packets sent: %d\0AACK packets received: %d\0ARST packets received: %d\0Atotal time duration (second): %d\0A\00"
define void @rdp_sender_stats() {
%1 = tail call i32* (...) @rdp_stats()
%2 = getelementptr inbounds i32, i32* %1, i64 2
%3 = load i32, i32* %2
%4 = getelementptr inbounds i32, i32* %1, i64 3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %1, i64 6
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %1, i64 7
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %1, i64 10
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %1, i64 11
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %1, i64 12
%15 = load i32, i32* %14
%16 = getelementptr inbounds i32, i32* %1, i64 18
%17 = load i32, i32* %16
%18 = getelementptr inbounds i32, i32* %1, i64 17
%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 ([259 x i8], [259 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
}