#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 sockaddr_in {
  int dummy;
};
struct packetheader {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/
ILibAddRequest_DirectEx(void *, char *, int, int /*<<< orphan*/ *,
                        int /*<<< orphan*/, struct sockaddr_in *,
                        void (*)(void *, struct packetheader *, char *, int *,
                                 int, int, void *, void *),
                        void (*)(void *, void *, void *), void *, void *);
int /*<<< orphan*/ ILibDestructPacket(struct packetheader *);
int ILibGetRawPacket(struct packetheader *, char **);
void ILibAddRequest(
    void *ClientModule, struct packetheader *packet,
    struct sockaddr_in *Destination,
    void (*CallbackPtr)(void *reader, struct packetheader *header, char *buffer,
                        int *p_BeginPointer, int EndPointer, int done,
                        void *user, void *user2),
    void (*InterruptPtr)(void *sender, void *user1, void *user2), void *user,
    void *user2) {
  int BufferLength;
  char *Buffer;
  BufferLength = ILibGetRawPacket(packet, &Buffer);
  ILibDestructPacket(packet);
  ILibAddRequest_DirectEx(ClientModule, Buffer, BufferLength, NULL, 0,
                          Destination, CallbackPtr, InterruptPtr, user, user2);
}


x86 assembly (clang, -O0):
<ILibAddRequest>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x68,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x18(%rbp),%rdi
lea    -0x48(%rbp),%rsi
call   1030 <ILibGetRawPacket@plt>
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <ILibDestructPacket@plt>
mov    -0x10(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    -0x3c(%rbp),%edx
mov    -0x20(%rbp),%r9
mov    -0x28(%rbp),%rbx
mov    -0x30(%rbp),%r11
mov    -0x38(%rbp),%r10
mov    0x10(%rbp),%rax
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %rax,0x18(%rsp)
call   1050 <ILibAddRequest_DirectEx@plt>
add    $0x68,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<ILibAddRequest>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r12
mov    %r8,%r15
mov    %rcx,0x8(%rsp)
mov    %rdx,%r13
mov    %rsi,%rbx
mov    %rdi,%rbp
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1030 <ILibGetRawPacket@plt>
mov    %eax,%r14d
mov    %rbx,%rdi
call   1040 <ILibDestructPacket@plt>
mov    0x10(%rsp),%rsi
mov    %rbp,%rdi
mov    %r14d,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
mov    %r13,%r9
push   0x50(%rsp)
push   %r12
push   %r15
push   0x20(%rsp)
call   1050 <ILibAddRequest_DirectEx@plt>
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.packetheader = type { i32 }
%struct.sockaddr_in = type { i32 }
define void @ILibAddRequest(i8* %0, %struct.packetheader* %1, %struct.sockaddr_in* %2, void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)* %3, void (i8*, i8*, i8*)* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = alloca %struct.packetheader*
%10 = alloca %struct.sockaddr_in*
%11 = alloca void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)*
%12 = alloca void (i8*, i8*, i8*)*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i8*
store i8* %0, i8** %8
store %struct.packetheader* %1, %struct.packetheader** %9
store %struct.sockaddr_in* %2, %struct.sockaddr_in** %10
store void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)* %3, void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)** %11
store void (i8*, i8*, i8*)* %4, void (i8*, i8*, i8*)** %12
store i8* %5, i8** %13
store i8* %6, i8** %14
%17 = load %struct.packetheader*, %struct.packetheader** %9
%18 = call i32 @ILibGetRawPacket(%struct.packetheader* %17, i8** %16)
store i32 %18, i32* %15
%19 = load %struct.packetheader*, %struct.packetheader** %9
%20 = call i32 @ILibDestructPacket(%struct.packetheader* %19)
%21 = load i8*, i8** %8
%22 = load i8*, i8** %16
%23 = load i32, i32* %15
%24 = load %struct.sockaddr_in*, %struct.sockaddr_in** %10
%25 = load void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)*, void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)** %11
%26 = load void (i8*, i8*, i8*)*, void (i8*, i8*, i8*)** %12
%27 = load i8*, i8** %13
%28 = load i8*, i8** %14
%29 = call i32 @ILibAddRequest_DirectEx(i8* %21, i8* %22, i32 %23, i32* null, i32 0, %struct.sockaddr_in* %24, void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)* %25, void (i8*, i8*, i8*)* %26, i8* %27, i8* %28)
ret void
}

LLVM IR (-O2):
%struct.packetheader = type { i32 }
%struct.sockaddr_in = type { i32 }
define void @ILibAddRequest(i8* %0, %struct.packetheader* %1, %struct.sockaddr_in* %2, void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)* %3, void (i8*, i8*, i8*)* %4, i8* %5, i8* %6) {
%8 = alloca i8*
%9 = bitcast i8** %8 to i8*
%10 = call i32 @ILibGetRawPacket(%struct.packetheader* %1, i8** %8)
%11 = call i32 @ILibDestructPacket(%struct.packetheader* %1)
%12 = load i8*, i8** %8
%13 = call i32 @ILibAddRequest_DirectEx(i8* %0, i8* %12, i32 %10, i32* null, i32 0, %struct.sockaddr_in* %2, void (i8*, %struct.packetheader*, i8*, i32*, i32, i32, i8*, i8*)* %3, void (i8*, i8*, i8*)* %4, i8* %5, i8* %6)
ret void
}