#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 protocol_header {
  int dummy;
};
struct data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ print_datalink_layer(int, struct protocol_header *);
int /*<<< orphan*/ print_network_layer(int, struct protocol_header *);
int /*<<< orphan*/ print_transport_layer(int, struct protocol_header *);
void dsp_pkt_header(int fd, struct protocol_header *datalink_layerph,
                    struct protocol_header *network_layerph,
                    struct protocol_header *transport_layerph,
                    struct data *datagram) {
  print_datalink_layer(fd, datalink_layerph);
  print_network_layer(fd, network_layerph);
  print_transport_layer(fd, transport_layerph);
}


x86 assembly (clang, -O0):
<dsp_pkt_header>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <print_datalink_layer@plt>
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
call   1050 <print_network_layer@plt>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
call   1040 <print_transport_layer@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsp_pkt_header>:
push   %rbp
push   %r14
push   %rbx
mov    %rcx,%r14
mov    %rdx,%rbx
mov    %edi,%ebp
call   1030 <print_datalink_layer@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1050 <print_network_layer@plt>
mov    %ebp,%edi
mov    %r14,%rsi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <print_transport_layer@plt>

LLVM IR (-O0):
%struct.protocol_header = type { i32 }
%struct.data = type { i32 }
define void @dsp_pkt_header(i32 %0, %struct.protocol_header* %1, %struct.protocol_header* %2, %struct.protocol_header* %3, %struct.data* %4) {
%6 = alloca i32
%7 = alloca %struct.protocol_header*
%8 = alloca %struct.protocol_header*
%9 = alloca %struct.protocol_header*
%10 = alloca %struct.data*
store i32 %0, i32* %6
store %struct.protocol_header* %1, %struct.protocol_header** %7
store %struct.protocol_header* %2, %struct.protocol_header** %8
store %struct.protocol_header* %3, %struct.protocol_header** %9
store %struct.data* %4, %struct.data** %10
%11 = load i32, i32* %6
%12 = load %struct.protocol_header*, %struct.protocol_header** %7
%13 = call i32 @print_datalink_layer(i32 %11, %struct.protocol_header* %12)
%14 = load i32, i32* %6
%15 = load %struct.protocol_header*, %struct.protocol_header** %8
%16 = call i32 @print_network_layer(i32 %14, %struct.protocol_header* %15)
%17 = load i32, i32* %6
%18 = load %struct.protocol_header*, %struct.protocol_header** %9
%19 = call i32 @print_transport_layer(i32 %17, %struct.protocol_header* %18)
ret void
}

LLVM IR (-O2):
%struct.protocol_header = type { i32 }
%struct.data = type { i32 }
define void @dsp_pkt_header(i32 %0, %struct.protocol_header* %1, %struct.protocol_header* %2, %struct.protocol_header* %3, %struct.data* nocapture readnone %4) {
%6 = tail call i32 @print_datalink_layer(i32 %0, %struct.protocol_header* %1)
%7 = tail call i32 @print_network_layer(i32 %0, %struct.protocol_header* %2)
%8 = tail call i32 @print_transport_layer(i32 %0, %struct.protocol_header* %3)
ret void
}