#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 *, char const *);
int /*<<< orphan*/ strncpy(unsigned char *, char const *, int);
int mapif_guild_leaved(int guild_id, int account_id, int char_id, int flag,
                       const char *name, const char *mes) {
  unsigned char buf[128];
  (*(unsigned short *)(((unsigned char *)(buf)) + (0))) = 0x3834;
  (*(unsigned int *)(((unsigned char *)(buf)) + (2))) = guild_id;
  (*(unsigned int *)(((unsigned char *)(buf)) + (6))) = account_id;
  (*(unsigned int *)(((unsigned char *)(buf)) + (10))) = char_id;
  (*(unsigned char *)(((unsigned char *)(buf)) + (14))) = flag;
  strncpy((((unsigned char *)(buf)) + (15)), mes, 40);
  strncpy((((unsigned char *)(buf)) + (55)), name, 24);
  mapif_sendall(buf, 79);
  printf("int_guild: guild leaved %d %d %s %s\n", guild_id, account_id, name,
         mes);
  return 0;
}


x86 assembly (clang, -O0):
<mapif_guild_leaved>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
movw   $0x3834,-0xa0(%rbp)
34 38
mov    -0x4(%rbp),%eax
mov    %eax,-0x9e(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x9a(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x96(%rbp)
mov    -0x10(%rbp),%eax
mov    %al,-0x92(%rbp)
lea    -0xa0(%rbp),%rdi
add    $0xf,%rdi
mov    -0x20(%rbp),%rsi
mov    $0x28,%edx
call   1040 <strncpy@plt>
lea    -0xa0(%rbp),%rdi
add    $0x37,%rdi
mov    -0x18(%rbp),%rsi
mov    $0x18,%edx
call   1040 <strncpy@plt>
lea    -0xa0(%rbp),%rdi
mov    $0x4f,%esi
call   1030 <mapif_sendall@plt>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%r8
lea    0xe2c(%rip),%rdi
call   1050 <printf@plt>
xor    %eax,%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_guild_leaved>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x88,%rsp
mov    %r9,%r14
mov    %r8,%r15
mov    %esi,%ebp
mov    %edi,%ebx
movw   $0x3834,(%rsp)
mov    %edi,0x2(%rsp)
mov    %esi,0x6(%rsp)
mov    %edx,0xa(%rsp)
mov    %cl,0xe(%rsp)
lea    0xf(%rsp),%rdi
mov    %r9,%rsi
mov    $0x28,%edx
call   1040 <strncpy@plt>
lea    0x37(%rsp),%rdi
mov    %r15,%rsi
mov    $0x18,%edx
call   1040 <strncpy@plt>
mov    %rsp,%rdi
mov    $0x4f,%esi
call   1030 <mapif_sendall@plt>
lea    0xe6b(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %r15,%rcx
mov    %r14,%r8
call   1050 <printf@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"int_guild: guild leaved %d %d %s %s\0A\00"
define i32 @mapif_guild_leaved(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca [128 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 i8* %5, i8** %12
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = bitcast i8* %15 to i16*
store i16 14388, i16* %16
%17 = load i32, i32* %7
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%19 = getelementptr inbounds i8, i8* %18, i64 2
%20 = bitcast i8* %19 to i32*
store i32 %17, i32* %20
%21 = load i32, i32* %8
%22 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%23 = getelementptr inbounds i8, i8* %22, i64 6
%24 = bitcast i8* %23 to i32*
store i32 %21, i32* %24
%25 = load i32, i32* %9
%26 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%27 = getelementptr inbounds i8, i8* %26, i64 10
%28 = bitcast i8* %27 to i32*
store i32 %25, i32* %28
%29 = load i32, i32* %10
%30 = trunc i32 %29 to i8
%31 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%32 = getelementptr inbounds i8, i8* %31, i64 14
store i8 %30, i8* %32
%33 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%34 = getelementptr inbounds i8, i8* %33, i64 15
%35 = load i8*, i8** %12
%36 = call i32 @strncpy(i8* %34, i8* %35, i32 40)
%37 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%38 = getelementptr inbounds i8, i8* %37, i64 55
%39 = load i8*, i8** %11
%40 = call i32 @strncpy(i8* %38, i8* %39, i32 24)
%41 = getelementptr inbounds [128 x i8], [128 x i8]* %13, i64 0, i64 0
%42 = call i32 @mapif_sendall(i8* %41, i32 79)
%43 = load i32, i32* %7
%44 = load i32, i32* %8
%45 = load i8*, i8** %11
%46 = load i8*, i8** %12
%47 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %43, i32 %44, i8* %45, i8* %46)
ret i32 0
}

LLVM IR (-O2):
@.str = [37 x i8] c"int_guild: guild leaved %d %d %s %s\0A\00"
define i32 @mapif_guild_leaved(i32 %0, i32 %1, i32 %2, i32 %3, i8* %4, i8* %5) {
%7 = alloca [128 x i8]
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = bitcast [128 x i8]* %7 to i16*
store i16 14388, i16* %9
%10 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 2
%11 = bitcast i8* %10 to i32*
store i32 %0, i32* %11
%12 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 6
%13 = bitcast i8* %12 to i32*
store i32 %1, i32* %13
%14 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 10
%15 = bitcast i8* %14 to i32*
store i32 %2, i32* %15
%16 = trunc i32 %3 to i8
%17 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 14
store i8 %16, i8* %17
%18 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 15
%19 = call i32 @strncpy(i8* %18, i8* %5, i32 40)
%20 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 55
%21 = call i32 @strncpy(i8* %20, i8* %4, i32 24)
%22 = call i32 @mapif_sendall(i8* %8, i32 79)
%23 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i8* %4, i8* %5)
ret i32 0
}