#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 libalias {
  int dummy;
};
struct ip {
  int dummy;
};
struct alias_link {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ProxyEncodeIpHeader(struct ip *, int);
int /*<<< orphan*/ ProxyEncodeTcpStream(struct alias_link *, struct ip *, int);
void ProxyModify(struct libalias *la, struct alias_link *lnk, struct ip *pip,
                 int maxpacketsize, int proxy_type) {
  ;
  (void)la;
  switch (proxy_type) {
  case 3:
    ProxyEncodeIpHeader(pip, maxpacketsize);
    break;
  case 2:
    ProxyEncodeTcpStream(lnk, pip, maxpacketsize);
    break;
  }
}


x86 assembly (clang, -O0):
<ProxyModify>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x20(%rbp),%eax
mov    %eax,-0x24(%rbp)
sub    $0x2,%eax
je     1171 <ProxyModify+0x51>
jmp    114f <ProxyModify+0x2f>
mov    -0x24(%rbp),%eax
sub    $0x3,%eax
jne    1181 <ProxyModify+0x61>
jmp    1160 <ProxyModify+0x40>
mov    -0x18(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <ProxyEncodeIpHeader@plt>
jmp    1181 <ProxyModify+0x61>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1030 <ProxyEncodeTcpStream@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ProxyModify>:
cmp    $0x2,%r8d
je     1136 <ProxyModify+0x16>
cmp    $0x3,%r8d
jne    1143 <ProxyModify+0x23>
mov    %rdx,%rdi
mov    %ecx,%esi
jmp    1040 <ProxyEncodeIpHeader@plt>
mov    %rsi,%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
jmp    1030 <ProxyEncodeTcpStream@plt>
ret

LLVM IR (-O0):
%struct.libalias = type { i32 }
%struct.alias_link = type { i32 }
%struct.ip = type { i32 }
define void @ProxyModify(%struct.libalias* %0, %struct.alias_link* %1, %struct.ip* %2, i32 %3, i32 %4) {
%6 = alloca %struct.libalias*
%7 = alloca %struct.alias_link*
%8 = alloca %struct.ip*
%9 = alloca i32
%10 = alloca i32
store %struct.libalias* %0, %struct.libalias** %6
store %struct.alias_link* %1, %struct.alias_link** %7
store %struct.ip* %2, %struct.ip** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load %struct.libalias*, %struct.libalias** %6
%12 = load i32, i32* %10
switch i32 %12, label %22 [
i32 3, label %13
i32 2, label %17
]
13: ; preds = %5
%14 = load %struct.ip*, %struct.ip** %8
%15 = load i32, i32* %9
%16 = call i32 @ProxyEncodeIpHeader(%struct.ip* %14, i32 %15)
br label %22
17: ; preds = %5
%18 = load %struct.alias_link*, %struct.alias_link** %7
%19 = load %struct.ip*, %struct.ip** %8
%20 = load i32, i32* %9
%21 = call i32 @ProxyEncodeTcpStream(%struct.alias_link* %18, %struct.ip* %19, i32 %20)
br label %22
22: ; preds = %5, %17, %13
ret void
}

LLVM IR (-O2):
%struct.libalias = type { i32 }
%struct.alias_link = type { i32 }
%struct.ip = type { i32 }
define void @ProxyModify(%struct.libalias* nocapture readnone %0, %struct.alias_link* %1, %struct.ip* %2, i32 %3, i32 %4) {
switch i32 %4, label %10 [
i32 3, label %6
i32 2, label %8
]
6: ; preds = %5
%7 = tail call i32 @ProxyEncodeIpHeader(%struct.ip* %2, i32 %3)
br label %10
8: ; preds = %5
%9 = tail call i32 @ProxyEncodeTcpStream(%struct.alias_link* %1, %struct.ip* %2, i32 %3)
br label %10
10: ; preds = %5, %8, %6
ret void
}