#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*/ mapif_sendall(unsigned char *, int);
int /*<<< orphan*/ memcpy(unsigned char *, void const *, int);
int mapif_guild_memberinfochanged(int guild_id, int account_id, int char_id,
                                  int type, const void *data, int len) {
  unsigned char buf[2048];
  (*(unsigned short *)(((unsigned char *)(buf)) + (0))) = 0x383a;
  (*(unsigned short *)(((unsigned char *)(buf)) + (2))) = len + 18;
  (*(unsigned int *)(((unsigned char *)(buf)) + (4))) = guild_id;
  (*(unsigned int *)(((unsigned char *)(buf)) + (8))) = account_id;
  (*(unsigned int *)(((unsigned char *)(buf)) + (12))) = char_id;
  (*(unsigned short *)(((unsigned char *)(buf)) + (16))) = type;
  memcpy((((unsigned char *)(buf)) + (18)), data, len);
  mapif_sendall(buf, len + 18);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_guild_memberinfochanged>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movw   $0x383a,-0x820(%rbp)
3a 38
mov    -0x1c(%rbp),%eax
add    $0x12,%eax
mov    %ax,-0x81e(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x81c(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x818(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x814(%rbp)
mov    -0x10(%rbp),%eax
mov    %ax,-0x810(%rbp)
lea    -0x820(%rbp),%rdi
add    $0x12,%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
call   1040 <memcpy@plt>
lea    -0x820(%rbp),%rdi
mov    -0x1c(%rbp),%esi
add    $0x12,%esi
call   1030 <mapif_sendall@plt>
xor    %eax,%eax
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_guild_memberinfochanged>:
push   %rbx
sub    $0x800,%rsp
movw   $0x383a,(%rsp)
lea    0x12(%r9),%ebx
mov    %bx,0x2(%rsp)
mov    %edi,0x4(%rsp)
mov    %esi,0x8(%rsp)
mov    %edx,0xc(%rsp)
mov    %cx,0x10(%rsp)
lea    0x12(%rsp),%rdi
mov    %r8,%rsi
mov    %r9d,%edx
call   1040 <memcpy@plt>
mov    %rsp,%rdi
mov    %ebx,%esi
call   1030 <mapif_sendall@plt>
xor    %eax,%eax
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mapif_guild_memberinfochanged(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i32
%13 = alloca [2048 x i8]
store i32 %0, i32* %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%14 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = bitcast i8* %15 to i16*
store i16 14394, i16* %16
%17 = load i32, i32* %12
%18 = add nsw i32 %17, 18
%19 = trunc i32 %18 to i16
%20 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%21 = getelementptr inbounds i8, i8* %20, i64 2
%22 = bitcast i8* %21 to i16*
store i16 %19, i16* %22
%23 = load i32, i32* %7
%24 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%25 = getelementptr inbounds i8, i8* %24, i64 4
%26 = bitcast i8* %25 to i32*
store i32 %23, i32* %26
%27 = load i32, i32* %8
%28 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%29 = getelementptr inbounds i8, i8* %28, i64 8
%30 = bitcast i8* %29 to i32*
store i32 %27, i32* %30
%31 = load i32, i32* %9
%32 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%33 = getelementptr inbounds i8, i8* %32, i64 12
%34 = bitcast i8* %33 to i32*
store i32 %31, i32* %34
%35 = load i32, i32* %10
%36 = trunc i32 %35 to i16
%37 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%38 = getelementptr inbounds i8, i8* %37, i64 16
%39 = bitcast i8* %38 to i16*
store i16 %36, i16* %39
%40 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%41 = getelementptr inbounds i8, i8* %40, i64 18
%42 = load i8*, i8** %11
%43 = load i32, i32* %12
%44 = call i32 @memcpy(i8* %41, i8* %42, i32 %43)
%45 = getelementptr inbounds [2048 x i8], [2048 x i8]* %13, i64 0, i64 0
%46 = load i32, i32* %12
%47 = add nsw i32 %46, 18
%48 = call i32 @mapif_sendall(i8* %45, i32 %47)
ret i32 0
}

LLVM IR (-O2):
define i32 @mapif_guild_memberinfochanged(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i32 %5) {
%7 = alloca [2048 x i8]
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 0
%9 = bitcast [2048 x i8]* %7 to i16*
store i16 14394, i16* %9
%10 = add nsw i32 %5, 18
%11 = trunc i32 %10 to i16
%12 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 2
%13 = bitcast i8* %12 to i16*
store i16 %11, i16* %13
%14 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 4
%15 = bitcast i8* %14 to i32*
store i32 %0, i32* %15
%16 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 8
%17 = bitcast i8* %16 to i32*
store i32 %1, i32* %17
%18 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 12
%19 = bitcast i8* %18 to i32*
store i32 %2, i32* %19
%20 = trunc i32 %3 to i16
%21 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 16
%22 = bitcast i8* %21 to i16*
store i16 %20, i16* %22
%23 = getelementptr inbounds [2048 x i8], [2048 x i8]* %7, i64 0, i64 18
%24 = call i32 @memcpy(i8* %23, i8* %4, i32 %5)
%25 = call i32 @mapif_sendall(i8* %8, i32 %10)
ret i32 0
}