#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 tcphdr {
  int /*<<< orphan*/ dest;
  int /*<<< orphan*/ source;
};

/* Variables and functions */
int ntohs(int /*<<< orphan*/);
int IsMatched(struct tcphdr *tcp) {
  int accept = 0;
  if (ntohs(tcp->source) == 25 || ntohs(tcp->source) == 110 ||
      ntohs(tcp->source) == 21) {
    accept = !0;
  }
  if (ntohs(tcp->dest) == 25 || ntohs(tcp->dest) == 110 ||
      ntohs(tcp->dest) == 21) {
    accept = !0;
  }
  return accept;
}


x86 assembly (clang, -O0):
<IsMatched>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <ntohs@plt>
cmp    $0x19,%eax
je     1162 <IsMatched+0x52>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <ntohs@plt>
cmp    $0x6e,%eax
je     1162 <IsMatched+0x52>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%edi
call   1030 <ntohs@plt>
cmp    $0x15,%eax
jne    1169 <IsMatched+0x59>
movl   $0x1,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
cmp    $0x19,%eax
je     11a5 <IsMatched+0x95>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
cmp    $0x6e,%eax
je     11a5 <IsMatched+0x95>
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <ntohs@plt>
cmp    $0x15,%eax
jne    11ac <IsMatched+0x9c>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsMatched>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x4(%rdi),%edi
call   1030 <ntohs@plt>
cmp    $0x19,%eax
je     113f <IsMatched+0x2f>
mov    0x4(%rbx),%edi
call   1030 <ntohs@plt>
cmp    $0x6e,%eax
je     113f <IsMatched+0x2f>
mov    0x4(%rbx),%edi
call   1030 <ntohs@plt>
xor    %ebp,%ebp
cmp    $0x15,%eax
jne    1144 <IsMatched+0x34>
mov    $0x1,%ebp
mov    (%rbx),%edi
call   1030 <ntohs@plt>
cmp    $0x19,%eax
je     1168 <IsMatched+0x58>
mov    (%rbx),%edi
call   1030 <ntohs@plt>
cmp    $0x6e,%eax
je     1168 <IsMatched+0x58>
mov    (%rbx),%edi
call   1030 <ntohs@plt>
cmp    $0x15,%eax
jne    116d <IsMatched+0x5d>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tcphdr = type { i32, i32 }
define i32 @IsMatched(%struct.tcphdr* %0) {
%2 = alloca %struct.tcphdr*
%3 = alloca i32
store %struct.tcphdr* %0, %struct.tcphdr** %2
store i32 0, i32* %3
%4 = load %struct.tcphdr*, %struct.tcphdr** %2
%5 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %4, i32 0, i32 1
%6 = load i32, i32* %5
%7 = call i32 @ntohs(i32 %6)
%8 = icmp eq i32 %7, 25
br i1 %8, label %21, label %9
9: ; preds = %1
%10 = load %struct.tcphdr*, %struct.tcphdr** %2
%11 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = call i32 @ntohs(i32 %12)
%14 = icmp eq i32 %13, 110
br i1 %14, label %21, label %15
15: ; preds = %9
%16 = load %struct.tcphdr*, %struct.tcphdr** %2
%17 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %16, i32 0, i32 1
%18 = load i32, i32* %17
%19 = call i32 @ntohs(i32 %18)
%20 = icmp eq i32 %19, 21
br i1 %20, label %21, label %22
21: ; preds = %15, %9, %1
store i32 1, i32* %3
br label %22
22: ; preds = %21, %15
%23 = load %struct.tcphdr*, %struct.tcphdr** %2
%24 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %23, i32 0, i32 0
%25 = load i32, i32* %24
%26 = call i32 @ntohs(i32 %25)
%27 = icmp eq i32 %26, 25
br i1 %27, label %40, label %28
28: ; preds = %22
%29 = load %struct.tcphdr*, %struct.tcphdr** %2
%30 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %29, i32 0, i32 0
%31 = load i32, i32* %30
%32 = call i32 @ntohs(i32 %31)
%33 = icmp eq i32 %32, 110
br i1 %33, label %40, label %34
34: ; preds = %28
%35 = load %struct.tcphdr*, %struct.tcphdr** %2
%36 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %35, i32 0, i32 0
%37 = load i32, i32* %36
%38 = call i32 @ntohs(i32 %37)
%39 = icmp eq i32 %38, 21
br i1 %39, label %40, label %41
40: ; preds = %34, %28, %22
store i32 1, i32* %3
br label %41
41: ; preds = %40, %34
%42 = load i32, i32* %3
ret i32 %42
}

LLVM IR (-O2):
%struct.tcphdr = type { i32, i32 }
define i32 @IsMatched(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 1
%3 = load i32, i32* %2
%4 = tail call i32 @ntohs(i32 %3)
%5 = icmp eq i32 %4, 25
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = tail call i32 @ntohs(i32 %7)
%9 = icmp eq i32 %8, 110
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = tail call i32 @ntohs(i32 %11)
%13 = icmp eq i32 %12, 21
br i1 %13, label %14, label %15
14: ; preds = %10, %6, %1
br label %15
15: ; preds = %14, %10
%16 = phi i32 [ 1, %14 ], [ 0, %10 ]
%17 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%18 = load i32, i32* %17
%19 = tail call i32 @ntohs(i32 %18)
%20 = icmp eq i32 %19, 25
br i1 %20, label %29, label %21
21: ; preds = %15
%22 = load i32, i32* %17
%23 = tail call i32 @ntohs(i32 %22)
%24 = icmp eq i32 %23, 110
br i1 %24, label %29, label %25
25: ; preds = %21
%26 = load i32, i32* %17
%27 = tail call i32 @ntohs(i32 %26)
%28 = icmp eq i32 %27, 21
br i1 %28, label %29, label %30
29: ; preds = %25, %21, %15
br label %30
30: ; preds = %29, %25
%31 = phi i32 [ 1, %29 ], [ %16, %25 ]
ret i32 %31
}