#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 protoent {
  int /*<<< orphan*/ p_proto;
  int /*<<< orphan*/ p_name;
  int /*<<< orphan*/ p_aliases;
};

/* Variables and functions */
int /*<<< orphan*/ printfmtstrings(int /*<<< orphan*/, char *, char *, char *,
                                   int /*<<< orphan*/, int /*<<< orphan*/);
void protocolsprint(struct protoent *pe) {
  printfmtstrings(pe->p_aliases, "  ", " ", "%-16s  %5d", pe->p_name,
                  pe->p_proto);
}


x86 assembly (clang, -O0):
<protocolsprint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%edi
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x8(%rbp),%rax
mov    (%rax),%r9d
lea    0xec7(%rip),%rsi
lea    0xec1(%rip),%rdx
lea    0xebc(%rip),%rcx
call   1030 <printfmtstrings@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<protocolsprint>:
mov    0x8(%rdi),%eax
mov    (%rdi),%r9d
mov    0x4(%rdi),%r8d
lea    0xedf(%rip),%rsi
lea    0xed9(%rip),%rdx
lea    0xed4(%rip),%rcx
mov    %eax,%edi
jmp    1030 <printfmtstrings@plt>

LLVM IR (-O0):
%struct.protoent = type { i32, i32, i32 }
@.str = [3 x i8] c" \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [11 x i8] c"%-16s %5d\00"
define void @protocolsprint(%struct.protoent* %0) {
%2 = alloca %struct.protoent*
store %struct.protoent* %0, %struct.protoent** %2
%3 = load %struct.protoent*, %struct.protoent** %2
%4 = getelementptr inbounds %struct.protoent, %struct.protoent* %3, i32 0, i32 2
%5 = load i32, i32* %4
%6 = load %struct.protoent*, %struct.protoent** %2
%7 = getelementptr inbounds %struct.protoent, %struct.protoent* %6, i32 0, i32 1
%8 = load i32, i32* %7
%9 = load %struct.protoent*, %struct.protoent** %2
%10 = getelementptr inbounds %struct.protoent, %struct.protoent* %9, i32 0, i32 0
%11 = load i32, i32* %10
%12 = call i32 @printfmtstrings(i32 %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %8, i32 %11)
ret void
}

LLVM IR (-O2):
%struct.protoent = type { i32, i32, i32 }
@.str = [3 x i8] c" \00"
@.str.1 = [2 x i8] c" \00"
@.str.2 = [11 x i8] c"%-16s %5d\00"
define void @protocolsprint(%struct.protoent* nocapture %0) {
%2 = getelementptr inbounds %struct.protoent, %struct.protoent* %0, i64 0, i32 2
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.protoent, %struct.protoent* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.protoent, %struct.protoent* %0, i64 0, i32 0
%7 = load i32, i32* %6
%8 = tail call i32 @printfmtstrings(i32 %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %7)
ret void
}