#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 map_session_data {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ clif_GM_kick(struct map_session_data *,
                                struct map_session_data *, int);
int /*<<< orphan*/ clif_GM_kickack(struct map_session_data *,
                                   int /*<<< orphan*/);
struct map_session_data *map_nick2sd(char *);
int /*<<< orphan*/ memset(char *, char, int);
scalar_t__ pc_isGM(struct map_session_data *);
int sscanf(char const *, char *, char *);
atcommand_kick(const int fd, struct map_session_data *sd, const char *command,
               const char *message) {
  struct map_session_data *pl_sd = NULL;
  char character[100];
  if (!message || !*message)
    return -1;
  memset(character, '\0', sizeof character);
  if (sscanf(message, "%99[^\n]", character) < 1)
    return -1;
  if ((pl_sd = map_nick2sd(character)) == NULL)
    return -1;
  if (pc_isGM(sd) > pc_isGM(pl_sd))
    clif_GM_kick(sd, pl_sd, 1);
  else
    clif_GM_kickack(sd, 0);
  return 0;
}


x86 assembly (clang, -O0):
<atcommand_kick>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     119a <atcommand_kick+0x3a>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    11a6 <atcommand_kick+0x46>
movl   $0xffffffff,-0x4(%rbp)
jmp    1260 <atcommand_kick+0x100>
lea    -0x90(%rbp),%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
mov    -0x20(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    0xe35(%rip),%rsi
call   1080 <sscanf@plt>
cmp    $0x1,%eax
jge    11e5 <atcommand_kick+0x85>
movl   $0xffffffff,-0x4(%rbp)
jmp    1260 <atcommand_kick+0x100>
lea    -0x90(%rbp),%rdi
call   1050 <map_nick2sd@plt>
mov    %rax,-0x28(%rbp)
cmp    $0x0,%rax
jne    120b <atcommand_kick+0xab>
movl   $0xffffffff,-0x4(%rbp)
jmp    1260 <atcommand_kick+0x100>
mov    -0x10(%rbp),%rdi
call   1040 <pc_isGM@plt>
mov    %rax,-0x98(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <pc_isGM@plt>
mov    %rax,%rcx
mov    -0x98(%rbp),%rax
cmp    %rcx,%rax
jle    124e <atcommand_kick+0xee>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
mov    $0x1,%edx
call   1030 <clif_GM_kick@plt>
jmp    1259 <atcommand_kick+0xf9>
mov    -0x10(%rbp),%rdi
xor    %esi,%esi
call   1070 <clif_GM_kickack@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xa0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atcommand_kick>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    $0xffffffff,%ebp
test   %rcx,%rcx
je     11ef <atcommand_kick+0x8f>
mov    %rcx,%rbx
cmpb   $0x0,(%rcx)
je     11ef <atcommand_kick+0x8f>
mov    %rsi,%r15
mov    %rsp,%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x64,%edx
call   1060 <memset@plt>
lea    0xe68(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rdx
call   1080 <sscanf@plt>
test   %eax,%eax
jle    11ef <atcommand_kick+0x8f>
mov    %rsp,%rdi
call   1050 <map_nick2sd@plt>
test   %rax,%rax
je     11ef <atcommand_kick+0x8f>
mov    %rax,%r14
mov    %r15,%rdi
call   1040 <pc_isGM@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <pc_isGM@plt>
cmp    %rax,%rbx
jle    11e3 <atcommand_kick+0x83>
mov    %r15,%rdi
mov    %r14,%rsi
mov    $0x1,%edx
call   1030 <clif_GM_kick@plt>
xor    %ebp,%ebp
jmp    11ef <atcommand_kick+0x8f>
xor    %ebp,%ebp
mov    %r15,%rdi
xor    %esi,%esi
call   1070 <clif_GM_kickack@plt>
mov    %ebp,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.map_session_data = type { i32 }
@.str = [8 x i8] c"%99[^\0A]\00"
define i32 @atcommand_kick(i32 %0, %struct.map_session_data* %1, i8* %2, i8* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.map_session_data*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca %struct.map_session_data*
%11 = alloca [100 x i8]
store i32 %0, i32* %6
store %struct.map_session_data* %1, %struct.map_session_data** %7
store i8* %2, i8** %8
store i8* %3, i8** %9
store %struct.map_session_data* null, %struct.map_session_data** %10
%12 = load i8*, i8** %9
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %18
14: ; preds = %4
%15 = load i8*, i8** %9
%16 = load i8, i8* %15
%17 = icmp ne i8 %16, 0
br i1 %17, label %19, label %18
18: ; preds = %14, %4
store i32 -1, i32* %5
br label %46
19: ; preds = %14
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%21 = call i32 @memset(i8* %20, i8 signext 0, i32 100)
%22 = load i8*, i8** %9
%23 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%24 = call i32 @sscanf(i8* %22, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %23)
%25 = icmp slt i32 %24, 1
br i1 %25, label %26, label %27
26: ; preds = %19
store i32 -1, i32* %5
br label %46
27: ; preds = %19
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %11, i64 0, i64 0
%29 = call %struct.map_session_data* @map_nick2sd(i8* %28)
store %struct.map_session_data* %29, %struct.map_session_data** %10
%30 = icmp eq %struct.map_session_data* %29, null
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 -1, i32* %5
br label %46
32: ; preds = %27
%33 = load %struct.map_session_data*, %struct.map_session_data** %7
%34 = call i64 @pc_isGM(%struct.map_session_data* %33)
%35 = load %struct.map_session_data*, %struct.map_session_data** %10
%36 = call i64 @pc_isGM(%struct.map_session_data* %35)
%37 = icmp sgt i64 %34, %36
br i1 %37, label %38, label %42
38: ; preds = %32
%39 = load %struct.map_session_data*, %struct.map_session_data** %7
%40 = load %struct.map_session_data*, %struct.map_session_data** %10
%41 = call i32 @clif_GM_kick(%struct.map_session_data* %39, %struct.map_session_data* %40, i32 1)
br label %45
42: ; preds = %32
%43 = load %struct.map_session_data*, %struct.map_session_data** %7
%44 = call i32 @clif_GM_kickack(%struct.map_session_data* %43, i32 0)
br label %45
45: ; preds = %42, %38
store i32 0, i32* %5
br label %46
46: ; preds = %45, %31, %26, %18
%47 = load i32, i32* %5
ret i32 %47
}

LLVM IR (-O2):
%struct.map_session_data = type { i32 }
@.str = [8 x i8] c"%99[^\0A]\00"
define i32 @atcommand_kick(i32 %0, %struct.map_session_data* %1, i8* nocapture readnone %2, i8* %3) {
%5 = alloca [100 x i8]
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%7 = icmp eq i8* %3, null
br i1 %7, label %26, label %8
8: ; preds = %4
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %26, label %11
11: ; preds = %8
%12 = call i32 @memset(i8* %6, i8 signext 0, i32 100)
%13 = call i32 @sscanf(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
%14 = icmp slt i32 %13, 1
br i1 %14, label %26, label %15
15: ; preds = %11
%16 = call %struct.map_session_data* @map_nick2sd(i8* %6)
%17 = icmp eq %struct.map_session_data* %16, null
br i1 %17, label %26, label %18
18: ; preds = %15
%19 = call i64 @pc_isGM(%struct.map_session_data* %1)
%20 = call i64 @pc_isGM(%struct.map_session_data* %16)
%21 = icmp sgt i64 %19, %20
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @clif_GM_kick(%struct.map_session_data* %1, %struct.map_session_data* %16, i32 1)
br label %26
24: ; preds = %18
%25 = call i32 @clif_GM_kickack(%struct.map_session_data* %1, i32 0)
br label %26
26: ; preds = %22, %24, %15, %11, %4, %8
%27 = phi i32 [ -1, %8 ], [ -1, %4 ], [ -1, %11 ], [ -1, %15 ], [ 0, %24 ], [ 0, %22 ]
ret i32 %27
}