#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*/ IP_MULTICAST_TTL;
int /*<<< orphan*/ test_u_char(int /*<<< orphan*/, char *, int, int, int,
                               char *, int, int);
void test_ttl(int raw_sock, int tcp_sock, int udp_sock) {
  test_u_char(IP_MULTICAST_TTL, "IP_MULTICAST_TTL", 1, 2, 243, "raw_sock",
              raw_sock, 0);
  test_u_char(IP_MULTICAST_TTL, "IP_MULTICAST_TTL", 1, 2, 243, "tcp_sock",
              tcp_sock, 0x00000000);
  test_u_char(IP_MULTICAST_TTL, "IP_MULTICAST_TTL", 1, 2, 243, "udp_sock",
              udp_sock, 0);
}


x86 assembly (clang, -O0):
<test_ttl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%eax
lea    0xecc(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0xf3,%r8d
lea    0xec6(%rip),%r9
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <test_u_char@plt>
mov    0x2e7b(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%eax
lea    0xe8f(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0xf3,%r8d
lea    0xe92(%rip),%r9
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <test_u_char@plt>
mov    0x2e3e(%rip),%rax
mov    (%rax),%edi
mov    -0xc(%rbp),%eax
lea    0xe52(%rip),%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0xf3,%r8d
lea    0xe5e(%rip),%r9
xor    %r10d,%r10d
mov    %eax,(%rsp)
movl   $0x0,0x8(%rsp)
call   1030 <test_u_char@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ttl>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %esi,%ebx
mov    %edi,%eax
mov    0x2eba(%rip),%r12
mov    (%r12),%edi
lea    0xecf(%rip),%r15
lea    0xed9(%rip),%r9
mov    %r15,%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0xf3,%r8d
push   $0x0
push   %rax
call   1030 <test_u_char@plt>
add    $0x10,%rsp
mov    (%r12),%edi
lea    0xeb8(%rip),%r9
mov    %r15,%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0xf3,%r8d
push   $0x0
push   %rbx
call   1030 <test_u_char@plt>
add    $0x10,%rsp
mov    (%r12),%edi
lea    0xe97(%rip),%r9
mov    %r15,%rsi
mov    $0x1,%edx
mov    $0x2,%ecx
mov    $0xf3,%r8d
push   $0x0
push   %r14
call   1030 <test_u_char@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@IP_MULTICAST_TTL = global i32 0
@.str = [17 x i8] c"IP_MULTICAST_TTL\00"
@.str.1 = [9 x i8] c"raw_sock\00"
@.str.2 = [9 x i8] c"tcp_sock\00"
@.str.3 = [9 x i8] c"udp_sock\00"
define void @test_ttl(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* @IP_MULTICAST_TTL
%8 = load i32, i32* %4
%9 = call i32 @test_u_char(i32 %7, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 243, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %8, i32 0)
%10 = load i32, i32* @IP_MULTICAST_TTL
%11 = load i32, i32* %5
%12 = call i32 @test_u_char(i32 %10, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 243, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %11, i32 0)
%13 = load i32, i32* @IP_MULTICAST_TTL
%14 = load i32, i32* %6
%15 = call i32 @test_u_char(i32 %13, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 243, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %14, i32 0)
ret void
}

LLVM IR (-O2):
@IP_MULTICAST_TTL = global i32 0
@.str = [17 x i8] c"IP_MULTICAST_TTL\00"
@.str.1 = [9 x i8] c"raw_sock\00"
@.str.2 = [9 x i8] c"tcp_sock\00"
@.str.3 = [9 x i8] c"udp_sock\00"
define void @test_ttl(i32 %0, i32 %1, i32 %2) {
%4 = load i32, i32* @IP_MULTICAST_TTL
%5 = tail call i32 @test_u_char(i32 %4, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 243, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %0, i32 0)
%6 = load i32, i32* @IP_MULTICAST_TTL
%7 = tail call i32 @test_u_char(i32 %6, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 243, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.2, i64 0, i64 0), i32 %1, i32 0)
%8 = load i32, i32* @IP_MULTICAST_TTL
%9 = tail call i32 @test_u_char(i32 %8, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 1, i32 2, i32 243, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i32 %2, i32 0)
ret void
}