#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*/ party_create(struct map_session_data *, char *);
scalar_t__ sscanf(char const *, char *, char *);
atcommand_party(const int fd, struct map_session_data *sd, const char *command,
                const char *message) {
  char party[100];
  if (!message || !*message)
    return -1;
  if (sscanf(message, "%99[^\n]", party))
    party_create(sd, party);
  return 0;
}


x86 assembly (clang, -O0):
<atcommand_party>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1152 <atcommand_party+0x32>
mov    -0x20(%rbp),%rax
cmpb   $0x0,(%rax)
jne    115e <atcommand_party+0x3e>
movl   $0xffffffff,-0x4(%rbp)
jmp    1196 <atcommand_party+0x76>
mov    -0x20(%rbp),%rdi
lea    -0x90(%rbp),%rdx
lea    0xe90(%rip),%rsi
call   1040 <sscanf@plt>
cmp    $0x0,%rax
je     118f <atcommand_party+0x6f>
mov    -0x10(%rbp),%rdi
lea    -0x90(%rbp),%rsi
call   1030 <party_create@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atcommand_party>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    $0xffffffff,%ebx
test   %rcx,%rcx
je     115d <atcommand_party+0x3d>
cmpb   $0x0,(%rcx)
je     115d <atcommand_party+0x3d>
mov    %rsi,%r14
lea    0xec0(%rip),%rsi
mov    %rsp,%rdx
mov    %rcx,%rdi
call   1040 <sscanf@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     115d <atcommand_party+0x3d>
mov    %rsp,%rsi
mov    %r14,%rdi
call   1030 <party_create@plt>
mov    %ebx,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.map_session_data = type { i32 }
@.str = [8 x i8] c"%99[^\0A]\00"
define i32 @atcommand_party(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 [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
%11 = load i8*, i8** %9
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %17
13: ; preds = %4
%14 = load i8*, i8** %9
%15 = load i8, i8* %14
%16 = icmp ne i8 %15, 0
br i1 %16, label %18, label %17
17: ; preds = %13, %4
store i32 -1, i32* %5
br label %28
18: ; preds = %13
%19 = load i8*, i8** %9
%20 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%21 = call i64 @sscanf(i8* %19, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %18
%24 = load %struct.map_session_data*, %struct.map_session_data** %7
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %10, i64 0, i64 0
%26 = call i32 @party_create(%struct.map_session_data* %24, i8* %25)
br label %27
27: ; preds = %23, %18
store i32 0, i32* %5
br label %28
28: ; preds = %27, %17
%29 = load i32, i32* %5
ret i32 %29
}

LLVM IR (-O2):
%struct.map_session_data = type { i32 }
@.str = [8 x i8] c"%99[^\0A]\00"
define i32 @atcommand_party(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 %16, label %8
8: ; preds = %4
%9 = load i8, i8* %3
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = call i64 @sscanf(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %6)
%13 = icmp eq i64 %12, 0
br i1 %13, label %16, label %14
14: ; preds = %11
%15 = call i32 @party_create(%struct.map_session_data* %1, i8* %6)
br label %16
16: ; preds = %11, %14, %4, %8
%17 = phi i32 [ -1, %8 ], [ -1, %4 ], [ 0, %14 ], [ 0, %11 ]
ret i32 %17
}