#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*/ printf(char *, int, int, char const *);
int /*<<< orphan*/ strncpy(unsigned char *, char const *, int);
int mapif_party_leaved(int party_id, int account_id, int char_id,
                       const char *name) {
  unsigned char buf[64];
  (*(unsigned short *)(((unsigned char *)(buf)) + (0))) = 0x3824;
  (*(unsigned int *)(((unsigned char *)(buf)) + (2))) = party_id;
  (*(unsigned int *)(((unsigned char *)(buf)) + (6))) = account_id;
  (*(unsigned int *)(((unsigned char *)(buf)) + (10))) = char_id;
  strncpy((((unsigned char *)(buf)) + (14)), name, 24);
  mapif_sendall(buf, 38);
  printf("int_party: party leaved %d %d %s\n", party_id, account_id, name);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_party_leaved>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %rcx,-0x18(%rbp)
movw   $0x3824,-0x60(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x5e(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x5a(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x56(%rbp)
lea    -0x60(%rbp),%rdi
add    $0xe,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x18,%edx
call   1040 <strncpy@plt>
lea    -0x60(%rbp),%rdi
mov    $0x26,%esi
call   1030 <mapif_sendall@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rcx
lea    0xe6e(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_party_leaved>:
push   %rbp
push   %r14
push   %rbx
sub    $0x40,%rsp
mov    %rcx,%r14
mov    %esi,%ebp
mov    %edi,%ebx
movw   $0x3824,(%rsp)
mov    %edi,0x2(%rsp)
mov    %esi,0x6(%rsp)
mov    %edx,0xa(%rsp)
lea    0xe(%rsp),%rdi
mov    %rcx,%rsi
mov    $0x18,%edx
call   1040 <strncpy@plt>
mov    %rsp,%rdi
mov    $0x26,%esi
call   1030 <mapif_sendall@plt>
lea    0xe89(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r14,%rcx
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [34 x i8] c"int_party: party leaved %d %d %s\0A\00"
define i32 @mapif_party_leaved(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8*
%9 = alloca [64 x i8]
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = bitcast i8* %11 to i16*
store i16 14372, i16* %12
%13 = load i32, i32* %5
%14 = getelementptr inbounds [64 x i8], [64 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 [64 x i8], [64 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 [64 x i8], [64 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 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%26 = getelementptr inbounds i8, i8* %25, i64 14
%27 = load i8*, i8** %8
%28 = call i32 @strncpy(i8* %26, i8* %27, i32 24)
%29 = getelementptr inbounds [64 x i8], [64 x i8]* %9, i64 0, i64 0
%30 = call i32 @mapif_sendall(i8* %29, i32 38)
%31 = load i32, i32* %5
%32 = load i32, i32* %6
%33 = load i8*, i8** %8
%34 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %31, i32 %32, i8* %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [34 x i8] c"int_party: party leaved %d %d %s\0A\00"
define i32 @mapif_party_leaved(i32 %0, i32 %1, i32 %2, i8* %3) {
%5 = alloca [64 x i8]
%6 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 0
%7 = bitcast [64 x i8]* %5 to i16*
store i16 14372, i16* %7
%8 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 2
%9 = bitcast i8* %8 to i32*
store i32 %0, i32* %9
%10 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 6
%11 = bitcast i8* %10 to i32*
store i32 %1, i32* %11
%12 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 10
%13 = bitcast i8* %12 to i32*
store i32 %2, i32* %13
%14 = getelementptr inbounds [64 x i8], [64 x i8]* %5, i64 0, i64 14
%15 = call i32 @strncpy(i8* %14, i8* %3, i32 24)
%16 = call i32 @mapif_sendall(i8* %6, i32 38)
%17 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %3)
ret i32 0
}