#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*/ uint32_t;
struct iphdr {
  int protocol;
  int /*<<< orphan*/ ihl;
  int /*<<< orphan*/ daddr;
  int /*<<< orphan*/ saddr;
};

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int ETHER_HDR_LEN;
int INET_ADDRSTRLEN;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int /*<<< orphan*/ *inet_ntop(int /*<<< orphan*/, int /*<<< orphan*/ *, char *,
                              int);
int /*<<< orphan*/ ip4_print_protocol(int);
char *malloc(int);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tcp_synthetic_analysis(unsigned char const *,
                                          int /*<<< orphan*/,
                                          int /*<<< orphan*/ const);
int /*<<< orphan*/ udp_short_analysis(unsigned char const *,
                                      int /*<<< orphan*/);
void ip4_synthetic_analysis(const unsigned char *packet, const uint32_t len) {
  const struct iphdr *ip4_header;
  char *src, *dst;
  ip4_header = (const struct iphdr *)(packet + ETHER_HDR_LEN);
  src = malloc(INET_ADDRSTRLEN * sizeof(char));
  dst = malloc(INET_ADDRSTRLEN * sizeof(char));
  if (src == NULL) {
    fprintf(stderr, "Error: could not allocate memory for source address.");
    fprintf(stderr, " Discarding packet.\n");
    return;
  }
  if (dst == NULL) {
    fprintf(stderr, "Error: could not allocate memory for dest address.");
    fprintf(stderr, " Discarding packet.\n");
    free(src);
    return;
  }
  if ((inet_ntop(AF_INET, &ip4_header->saddr, src, INET_ADDRSTRLEN)) == NULL) {
    fprintf(stderr, "Error retrieving source address. Discarding packet.\n");
    return;
  }
  if ((inet_ntop(AF_INET, &ip4_header->daddr, dst, INET_ADDRSTRLEN)) == NULL) {
    fprintf(stderr, "Error retrieving dest address. Discarding packet.\n");
    return;
  }
  fprintf(stdout, " - %s", src);
  fprintf(stdout, " -> %s", dst);
  fprintf(stdout, " - ");
  ip4_print_protocol(ip4_header->protocol);
  fprintf(stdout, "\n");
  free(src);
  free(dst);
  switch (ip4_header->protocol) {
  case 6:
    tcp_synthetic_analysis(packet, ip4_header->ihl, len);
    fprintf(stdout, "\n");
    break;
  case 17:
    udp_short_analysis(packet, ip4_header->ihl);
    fprintf(stdout, "\n");
    break;
  default:
    fprintf(stdout, "\n");
    break;
  }
}


x86 assembly (clang, -O0):
<ip4_synthetic_analysis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2e36(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    0x2e35(%rip),%rax
movslq (%rax),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    0x2e1c(%rip),%rax
movslq (%rax),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1070 <malloc@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1204 <ip4_synthetic_analysis+0x94>
mov    0x2e00(%rip),%rax
mov    (%rax),%edi
lea    0xe1f(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2de9(%rip),%rax
mov    (%rax),%edi
lea    0xe90(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13f9 <ip4_synthetic_analysis+0x289>
cmpq   $0x0,-0x28(%rbp)
jne    124b <ip4_synthetic_analysis+0xdb>
mov    0x2dc2(%rip),%rax
mov    (%rax),%edi
lea    0xe16(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    0x2dab(%rip),%rax
mov    (%rax),%edi
lea    0xe52(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <free@plt>
jmp    13f9 <ip4_synthetic_analysis+0x289>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
add    $0xc,%rsi
mov    -0x20(%rbp),%rdx
mov    0x2d69(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    1294 <ip4_synthetic_analysis+0x124>
mov    0x2d59(%rip),%rax
mov    (%rax),%edi
lea    0xde0(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13f9 <ip4_synthetic_analysis+0x289>
mov    0x2d4d(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rsi
add    $0x8,%rsi
mov    -0x28(%rbp),%rdx
mov    0x2d20(%rip),%rax
mov    (%rax),%ecx
call   1030 <inet_ntop@plt>
cmp    $0x0,%rax
jne    12dd <ip4_synthetic_analysis+0x16d>
mov    0x2d10(%rip),%rax
mov    (%rax),%edi
lea    0xdcc(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13f9 <ip4_synthetic_analysis+0x289>
mov    0x2ce4(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    (%rax),%edi
mov    -0x20(%rbp),%rdx
lea    0xddb(%rip),%rsi
xor    %eax,%eax
mov    %al,-0x2d(%rbp)
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rcx
mov    -0x2d(%rbp),%al
mov    (%rcx),%edi
mov    -0x28(%rbp),%rdx
lea    0xdc3(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x38(%rbp),%rcx
mov    -0x2d(%rbp),%al
mov    (%rcx),%edi
lea    0xdb5(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%edi
call   1040 <ip4_print_protocol@plt>
mov    -0x38(%rbp),%rcx
mov    -0x2d(%rbp),%al
mov    (%rcx),%edi
lea    0xd53(%rip),%rsi
call   1060 <fprintf@plt>
mov    -0x20(%rbp),%rdi
call   1050 <free@plt>
mov    -0x28(%rbp),%rdi
call   1050 <free@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x6,%eax
je     1387 <ip4_synthetic_analysis+0x217>
jmp    1376 <ip4_synthetic_analysis+0x206>
mov    -0x2c(%rbp),%eax
sub    $0x11,%eax
je     13b6 <ip4_synthetic_analysis+0x246>
jmp    13e2 <ip4_synthetic_analysis+0x272>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0xc(%rbp),%edx
call   1090 <tcp_synthetic_analysis@plt>
mov    0x2c27(%rip),%rax
mov    (%rax),%edi
lea    0xcf1(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13f9 <ip4_synthetic_analysis+0x289>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%esi
call   1080 <udp_short_analysis@plt>
mov    0x2bfb(%rip),%rax
mov    (%rax),%edi
lea    0xcc5(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
jmp    13f9 <ip4_synthetic_analysis+0x289>
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
lea    0xca9(%rip),%rsi
mov    $0x0,%al
call   1060 <fprintf@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ip4_synthetic_analysis>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %esi,0xc(%rsp)
mov    %rdi,%rbp
mov    0x2e34(%rip),%rax
movslq (%rax),%r13
mov    0x2e3a(%rip),%r14
mov    (%r14),%ebx
mov    %ebx,%edi
call   1070 <malloc@plt>
mov    %rax,%r15
mov    %ebx,%edi
call   1070 <malloc@plt>
test   %r15,%r15
je     1296 <ip4_synthetic_analysis+0x126>
mov    %rax,%r12
test   %rax,%rax
je     12b8 <ip4_synthetic_analysis+0x148>
mov    %rbp,0x10(%rsp)
add    %rbp,%r13
mov    0x2e1a(%rip),%rbp
mov    0x0(%rbp),%edi
lea    0xc(%r13),%rsi
mov    %r15,%rdx
mov    %ebx,%ecx
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     12f5 <ip4_synthetic_analysis+0x185>
mov    0x0(%rbp),%edi
lea    0x8(%r13),%rsi
mov    (%r14),%ecx
mov    %r12,%rdx
call   1030 <inet_ntop@plt>
test   %rax,%rax
je     1307 <ip4_synthetic_analysis+0x197>
mov    0x2dbe(%rip),%rbx
mov    (%rbx),%edi
lea    0xebd(%rip),%rsi
mov    %r15,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeb0(%rip),%rsi
mov    %r12,%rdx
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xea4(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    0x0(%r13),%edi
call   1040 <ip4_print_protocol@plt>
mov    (%rbx),%edi
lea    0xe49(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r15,%rdi
call   1050 <free@plt>
mov    %r12,%rdi
call   1050 <free@plt>
mov    0x0(%r13),%eax
cmp    $0x11,%eax
je     1319 <ip4_synthetic_analysis+0x1a9>
cmp    $0x6,%eax
mov    0x10(%rsp),%rdi
jne    1327 <ip4_synthetic_analysis+0x1b7>
mov    0x4(%r13),%esi
mov    0xc(%rsp),%edx
call   1090 <tcp_synthetic_analysis@plt>
jmp    1327 <ip4_synthetic_analysis+0x1b7>
mov    0x2d3b(%rip),%rbx
mov    (%rbx),%edi
lea    0xd5a(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdd2(%rip),%rsi
jmp    1330 <ip4_synthetic_analysis+0x1c0>
mov    0x2d19(%rip),%rbx
mov    (%rbx),%edi
lea    0xd6d(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    (%rbx),%edi
lea    0xdb0(%rip),%rsi
xor    %eax,%eax
call   1060 <fprintf@plt>
mov    %r15,%rdi
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <free@plt>
mov    0x2cdc(%rip),%rax
mov    (%rax),%edi
lea    0xd63(%rip),%rsi
jmp    1330 <ip4_synthetic_analysis+0x1c0>
mov    0x2cca(%rip),%rax
mov    (%rax),%edi
lea    0xd86(%rip),%rsi
jmp    1330 <ip4_synthetic_analysis+0x1c0>
mov    0x4(%r13),%esi
mov    0x10(%rsp),%rdi
call   1080 <udp_short_analysis@plt>
mov    (%rbx),%edi
lea    0xd6b(%rip),%rsi
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1060 <fprintf@plt>

LLVM IR (-O0):
%struct.iphdr = type { i32, i32, i32, i32 }
@ETHER_HDR_LEN = global i32 0
@INET_ADDRSTRLEN = global i32 0
@stderr = global i32 0
@.str = [53 x i8] c"Error: could not allocate memory for source address.\00"
@.str.1 = [21 x i8] c" Discarding packet.\0A\00"
@.str.2 = [51 x i8] c"Error: could not allocate memory for dest address.\00"
@AF_INET = global i32 0
@.str.3 = [53 x i8] c"Error retrieving source address. Discarding packet.\0A\00"
@.str.4 = [51 x i8] c"Error retrieving dest address. Discarding packet.\0A\00"
@stdout = global i32 0
@.str.5 = [6 x i8] c" - %s\00"
@.str.6 = [7 x i8] c" -> %s\00"
@.str.7 = [4 x i8] c" - \00"
@.str.8 = [2 x i8] c"\0A\00"
define void @ip4_synthetic_analysis(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca %struct.iphdr*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = load i8*, i8** %3
%9 = load i32, i32* @ETHER_HDR_LEN
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = bitcast i8* %11 to %struct.iphdr*
store %struct.iphdr* %12, %struct.iphdr** %5
%13 = load i32, i32* @INET_ADDRSTRLEN
%14 = sext i32 %13 to i64
%15 = mul i64 %14, 1
%16 = trunc i64 %15 to i32
%17 = call i8* @malloc(i32 %16)
store i8* %17, i8** %6
%18 = load i32, i32* @INET_ADDRSTRLEN
%19 = sext i32 %18 to i64
%20 = mul i64 %19, 1
%21 = trunc i64 %20 to i32
%22 = call i8* @malloc(i32 %21)
store i8* %22, i8** %7
%23 = load i8*, i8** %6
%24 = icmp eq i8* %23, null
br i1 %24, label %25, label %30
25: ; preds = %2
%26 = load i32, i32* @stderr
%27 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%28 = load i32, i32* @stderr
%29 = call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %104
30: ; preds = %2
%31 = load i8*, i8** %7
%32 = icmp eq i8* %31, null
br i1 %32, label %33, label %40
33: ; preds = %30
%34 = load i32, i32* @stderr
%35 = call i32 (i32, i8*, ...) @fprintf(i32 %34, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%36 = load i32, i32* @stderr
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %36, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%38 = load i8*, i8** %6
%39 = call i32 @free(i8* %38)
br label %104
40: ; preds = %30
%41 = load i32, i32* @AF_INET
%42 = load %struct.iphdr*, %struct.iphdr** %5
%43 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %42, i32 0, i32 3
%44 = load i8*, i8** %6
%45 = load i32, i32* @INET_ADDRSTRLEN
%46 = call i32* @inet_ntop(i32 %41, i32* %43, i8* %44, i32 %45)
%47 = icmp eq i32* %46, null
br i1 %47, label %48, label %51
48: ; preds = %40
%49 = load i32, i32* @stderr
%50 = call i32 (i32, i8*, ...) @fprintf(i32 %49, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
br label %104
51: ; preds = %40
%52 = load i32, i32* @AF_INET
%53 = load %struct.iphdr*, %struct.iphdr** %5
%54 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %53, i32 0, i32 2
%55 = load i8*, i8** %7
%56 = load i32, i32* @INET_ADDRSTRLEN
%57 = call i32* @inet_ntop(i32 %52, i32* %54, i8* %55, i32 %56)
%58 = icmp eq i32* %57, null
br i1 %58, label %59, label %62
59: ; preds = %51
%60 = load i32, i32* @stderr
%61 = call i32 (i32, i8*, ...) @fprintf(i32 %60, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
br label %104
62: ; preds = %51
%63 = load i32, i32* @stdout
%64 = load i8*, i8** %6
%65 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %64)
%66 = load i32, i32* @stdout
%67 = load i8*, i8** %7
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %66, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %67)
%69 = load i32, i32* @stdout
%70 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%71 = load %struct.iphdr*, %struct.iphdr** %5
%72 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %71, i32 0, i32 0
%73 = load i32, i32* %72
%74 = call i32 @ip4_print_protocol(i32 %73)
%75 = load i32, i32* @stdout
%76 = call i32 (i32, i8*, ...) @fprintf(i32 %75, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%77 = load i8*, i8** %6
%78 = call i32 @free(i8* %77)
%79 = load i8*, i8** %7
%80 = call i32 @free(i8* %79)
%81 = load %struct.iphdr*, %struct.iphdr** %5
%82 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %81, i32 0, i32 0
%83 = load i32, i32* %82
switch i32 %83, label %101 [
i32 6, label %84
i32 17, label %93
]
84: ; preds = %62
%85 = load i8*, i8** %3
%86 = load %struct.iphdr*, %struct.iphdr** %5
%87 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %86, i32 0, i32 1
%88 = load i32, i32* %87
%89 = load i32, i32* %4
%90 = call i32 @tcp_synthetic_analysis(i8* %85, i32 %88, i32 %89)
%91 = load i32, i32* @stdout
%92 = call i32 (i32, i8*, ...) @fprintf(i32 %91, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %104
93: ; preds = %62
%94 = load i8*, i8** %3
%95 = load %struct.iphdr*, %struct.iphdr** %5
%96 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %95, i32 0, i32 1
%97 = load i32, i32* %96
%98 = call i32 @udp_short_analysis(i8* %94, i32 %97)
%99 = load i32, i32* @stdout
%100 = call i32 (i32, i8*, ...) @fprintf(i32 %99, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %104
101: ; preds = %62
%102 = load i32, i32* @stdout
%103 = call i32 (i32, i8*, ...) @fprintf(i32 %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %104
104: ; preds = %25, %33, %48, %59, %101, %93, %84
ret void
}

LLVM IR (-O2):
@ETHER_HDR_LEN = global i32 0
@INET_ADDRSTRLEN = global i32 0
@stderr = global i32 0
@.str = [53 x i8] c"Error: could not allocate memory for source address.\00"
@.str.1 = [21 x i8] c" Discarding packet.\0A\00"
@.str.2 = [51 x i8] c"Error: could not allocate memory for dest address.\00"
@AF_INET = global i32 0
@.str.3 = [53 x i8] c"Error retrieving source address. Discarding packet.\0A\00"
@.str.4 = [51 x i8] c"Error retrieving dest address. Discarding packet.\0A\00"
@stdout = global i32 0
@.str.5 = [6 x i8] c" - %s\00"
@.str.6 = [7 x i8] c" -> %s\00"
@.str.7 = [4 x i8] c" - \00"
@.str.8 = [2 x i8] c"\0A\00"
define void @ip4_synthetic_analysis(i8* %0, i32 %1) {
%3 = load i32, i32* @ETHER_HDR_LEN
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i32, i32* @INET_ADDRSTRLEN
%7 = tail call i8* @malloc(i32 %6)
%8 = tail call i8* @malloc(i32 %6)
%9 = icmp eq i8* %7, null
br i1 %9, label %10, label %15
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = tail call i32 (i32, i8*, ...) @fprintf(i32 %11, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str, i64 0, i64 0))
%13 = load i32, i32* @stderr
%14 = tail call i32 (i32, i8*, ...) @fprintf(i32 %13, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %74
15: ; preds = %2
%16 = icmp eq i8* %8, null
br i1 %16, label %17, label %23
17: ; preds = %15
%18 = load i32, i32* @stderr
%19 = tail call i32 (i32, i8*, ...) @fprintf(i32 %18, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.2, i64 0, i64 0))
%20 = load i32, i32* @stderr
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
%22 = tail call i32 @free(i8* %7)
br label %74
23: ; preds = %15
%24 = load i32, i32* @AF_INET
%25 = getelementptr inbounds i8, i8* %5, i64 12
%26 = bitcast i8* %25 to i32*
%27 = tail call i32* @inet_ntop(i32 %24, i32* %26, i8* %7, i32 %6)
%28 = icmp eq i32* %27, null
br i1 %28, label %29, label %32
29: ; preds = %23
%30 = load i32, i32* @stderr
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %30, i8* getelementptr inbounds ([53 x i8], [53 x i8]* @.str.3, i64 0, i64 0))
br label %74
32: ; preds = %23
%33 = load i32, i32* @AF_INET
%34 = getelementptr inbounds i8, i8* %5, i64 8
%35 = bitcast i8* %34 to i32*
%36 = load i32, i32* @INET_ADDRSTRLEN
%37 = tail call i32* @inet_ntop(i32 %33, i32* %35, i8* %8, i32 %36)
%38 = icmp eq i32* %37, null
br i1 %38, label %39, label %42
39: ; preds = %32
%40 = load i32, i32* @stderr
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %40, i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.4, i64 0, i64 0))
br label %74
42: ; preds = %32
%43 = load i32, i32* @stdout
%44 = tail call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.5, i64 0, i64 0), i8* %7)
%45 = load i32, i32* @stdout
%46 = tail call i32 (i32, i8*, ...) @fprintf(i32 %45, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), i8* %8)
%47 = load i32, i32* @stdout
%48 = tail call i32 (i32, i8*, ...) @fprintf(i32 %47, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.7, i64 0, i64 0))
%49 = bitcast i8* %5 to i32*
%50 = load i32, i32* %49
%51 = tail call i32 @ip4_print_protocol(i32 %50)
%52 = load i32, i32* @stdout
%53 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%54 = tail call i32 @free(i8* %7)
%55 = tail call i32 @free(i8* %8)
%56 = load i32, i32* %49
switch i32 %56, label %71 [
i32 6, label %57
i32 17, label %64
]
57: ; preds = %42
%58 = getelementptr inbounds i8, i8* %5, i64 4
%59 = bitcast i8* %58 to i32*
%60 = load i32, i32* %59
%61 = tail call i32 @tcp_synthetic_analysis(i8* %0, i32 %60, i32 %1)
%62 = load i32, i32* @stdout
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %74
64: ; preds = %42
%65 = getelementptr inbounds i8, i8* %5, i64 4
%66 = bitcast i8* %65 to i32*
%67 = load i32, i32* %66
%68 = tail call i32 @udp_short_analysis(i8* %0, i32 %67)
%69 = load i32, i32* @stdout
%70 = tail call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %74
71: ; preds = %42
%72 = load i32, i32* @stdout
%73 = tail call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %74
74: ; preds = %57, %64, %71, %39, %29, %17, %10
ret void
}