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

/* Variables and functions */
int /*<<< orphan*/ A_BOLD;
int /*<<< orphan*/ wattroff(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ wattron(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ whline(int /*<<< orphan*/ *, int /*<<< orphan*/, int);
int /*<<< orphan*/ wmove(int /*<<< orphan*/ *, int, int);
int /*<<< orphan*/ wprintw(int /*<<< orphan*/ *, char *, ...);
void show_size(WINDOW *win, int bytes, int packets) {
  wmove(win, 1, 1);
  wattron(win, A_BOLD);
  wprintw(win, "Amount of Data Captured\n");
  wattroff(win, A_BOLD);
  wmove(win, 2, 1);
  whline(win, 0, 5000);
  if (bytes != 0) {
    wmove(win, 3, 1);
    wprintw(win, "Bytes:   %u\n", bytes, packets);
  }
  if (packets != 0) {
    wmove(win, 4, 1);
    wprintw(win, "Packets: %u\n", packets);
  }
}


x86 assembly (clang, -O0):
<show_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x1,%edx
mov    %edx,%esi
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e63(%rip),%rax
mov    (%rax),%esi
call   1060 <wattron@plt>
mov    -0x8(%rbp),%rdi
lea    0xe71(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
mov    -0x8(%rbp),%rdi
mov    0x2e3f(%rip),%rax
mov    (%rax),%esi
call   1050 <wattroff@plt>
mov    -0x8(%rbp),%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
mov    $0x1388,%edx
call   1030 <whline@plt>
cmpl   $0x0,-0xc(%rbp)
je     1200 <show_size+0xb0>
mov    -0x8(%rbp),%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe20(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
cmpl   $0x0,-0x10(%rbp)
je     1232 <show_size+0xe2>
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%edx
lea    0xdfb(%rip),%rsi
mov    $0x0,%al
call   1040 <wprintw@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_size>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%r15d
mov    %rdi,%rbx
mov    $0x1,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    0x2e6a(%rip),%rbp
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   1060 <wattron@plt>
lea    0xe78(%rip),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <wprintw@plt>
mov    0x0(%rbp),%esi
mov    %rbx,%rdi
call   1050 <wattroff@plt>
mov    %rbx,%rdi
mov    $0x2,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x1388,%edx
call   1030 <whline@plt>
test   %r15d,%r15d
je     11ec <show_size+0x9c>
mov    %rbx,%rdi
mov    $0x3,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
lea    0xe3d(%rip),%rsi
mov    %rbx,%rdi
mov    %r15d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1040 <wprintw@plt>
test   %r14d,%r14d
je     1221 <show_size+0xd1>
mov    %rbx,%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1070 <wmove@plt>
lea    0xe1c(%rip),%rsi
mov    %rbx,%rdi
mov    %r14d,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <wprintw@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@A_BOLD = global i32 0
@.str = [25 x i8] c"Amount of Data Captured\0A\00"
@.str.1 = [13 x i8] c"Bytes: %u\0A\00"
@.str.2 = [13 x i8] c"Packets: %u\0A\00"
define void @show_size(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = call i32 @wmove(i32* %7, i32 1, i32 1)
%9 = load i32*, i32** %4
%10 = load i32, i32* @A_BOLD
%11 = call i32 @wattron(i32* %9, i32 %10)
%12 = load i32*, i32** %4
%13 = call i32 (i32*, i8*, ...) @wprintw(i32* %12, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%14 = load i32*, i32** %4
%15 = load i32, i32* @A_BOLD
%16 = call i32 @wattroff(i32* %14, i32 %15)
%17 = load i32*, i32** %4
%18 = call i32 @wmove(i32* %17, i32 2, i32 1)
%19 = load i32*, i32** %4
%20 = call i32 @whline(i32* %19, i32 0, i32 5000)
%21 = load i32, i32* %5
%22 = icmp ne i32 %21, 0
br i1 %22, label %23, label %30
23: ; preds = %3
%24 = load i32*, i32** %4
%25 = call i32 @wmove(i32* %24, i32 3, i32 1)
%26 = load i32*, i32** %4
%27 = load i32, i32* %5
%28 = load i32, i32* %6
%29 = call i32 (i32*, i8*, ...) @wprintw(i32* %26, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %27, i32 %28)
br label %30
30: ; preds = %23, %3
%31 = load i32, i32* %6
%32 = icmp ne i32 %31, 0
br i1 %32, label %33, label %39
33: ; preds = %30
%34 = load i32*, i32** %4
%35 = call i32 @wmove(i32* %34, i32 4, i32 1)
%36 = load i32*, i32** %4
%37 = load i32, i32* %6
%38 = call i32 (i32*, i8*, ...) @wprintw(i32* %36, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %37)
br label %39
39: ; preds = %33, %30
ret void
}

LLVM IR (-O2):
@A_BOLD = global i32 0
@.str = [25 x i8] c"Amount of Data Captured\0A\00"
@.str.1 = [13 x i8] c"Bytes: %u\0A\00"
@.str.2 = [13 x i8] c"Packets: %u\0A\00"
define void @show_size(i32* %0, i32 %1, i32 %2) {
%4 = tail call i32 @wmove(i32* %0, i32 1, i32 1)
%5 = load i32, i32* @A_BOLD
%6 = tail call i32 @wattron(i32* %0, i32 %5)
%7 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%8 = load i32, i32* @A_BOLD
%9 = tail call i32 @wattroff(i32* %0, i32 %8)
%10 = tail call i32 @wmove(i32* %0, i32 2, i32 1)
%11 = tail call i32 @whline(i32* %0, i32 0, i32 5000)
%12 = icmp eq i32 %1, 0
br i1 %12, label %16, label %13
13: ; preds = %3
%14 = tail call i32 @wmove(i32* %0, i32 3, i32 1)
%15 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 %2)
br label %16
16: ; preds = %13, %3
%17 = icmp eq i32 %2, 0
br i1 %17, label %21, label %18
18: ; preds = %16
%19 = tail call i32 @wmove(i32* %0, i32 4, i32 1)
%20 = tail call i32 (i32*, i8*, ...) @wprintw(i32* %0, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0), i32 %2)
br label %21
21: ; preds = %18, %16
ret void
}