#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 mapif_guild_skillupack(int guild_id, int skill_num, int account_id,
                           int flag) {
  unsigned char buf[16];
  (*(unsigned short *)(((unsigned char *)(buf)) + (0))) = 0x383c;
  (*(unsigned int *)(((unsigned char *)(buf)) + (2))) = guild_id;
  (*(unsigned int *)(((unsigned char *)(buf)) + (6))) = skill_num;
  (*(unsigned int *)(((unsigned char *)(buf)) + (10))) = account_id;
  (*(unsigned char *)(((unsigned char *)(buf)) + (14))) = flag;
  mapif_sendall(buf, 15);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_guild_skillupack>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movw   $0x383c,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x1e(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1a(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x16(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x12(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0xf,%esi
call   1030 <mapif_sendall@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_guild_skillupack>:
sub    $0x18,%rsp
movw   $0x383c,(%rsp)
mov    %edi,0x2(%rsp)
mov    %esi,0x6(%rsp)
mov    %edx,0xa(%rsp)
mov    %cl,0xe(%rsp)
mov    %rsp,%rdi
mov    $0xf,%esi
call   1030 <mapif_sendall@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @mapif_guild_skillupack(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca [16 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = bitcast i8* %11 to i16*
store i16 14396, i16* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = bitcast i8* %15 to i32*
store i32 %13, i32* %16
%17 = load i32, i32* %6
%18 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%19 = getelementptr inbounds i8, i8* %18, i64 6
%20 = bitcast i8* %19 to i32*
store i32 %17, i32* %20
%21 = load i32, i32* %7
%22 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%23 = getelementptr inbounds i8, i8* %22, i64 10
%24 = bitcast i8* %23 to i32*
store i32 %21, i32* %24
%25 = load i32, i32* %8
%26 = trunc i32 %25 to i8
%27 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%28 = getelementptr inbounds i8, i8* %27, i64 14
store i8 %26, i8* %28
%29 = getelementptr inbounds [16 x i8], [16 x i8]* %9, i64 0, i64 0
%30 = call i32 @mapif_sendall(i8* %29, i32 15)
ret i32 0
}

LLVM IR (-O2):
define i32 @mapif_guild_skillupack(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca [16 x i8]
%6 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 0
%7 = bitcast [16 x i8]* %5 to i16*
store i16 14396, i16* %7
%8 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 2
%9 = bitcast i8* %8 to i32*
store i32 %0, i32* %9
%10 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 6
%11 = bitcast i8* %10 to i32*
store i32 %1, i32* %11
%12 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 10
%13 = bitcast i8* %12 to i32*
store i32 %2, i32* %13
%14 = trunc i32 %3 to i8
%15 = getelementptr inbounds [16 x i8], [16 x i8]* %5, i64 0, i64 14
store i8 %14, i8* %15
%16 = call i32 @mapif_sendall(i8* %6, i32 15)
ret i32 0
}