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

/* Variables and functions */
int elemdb_sql_new(struct mmo_elemstatus *);
int /*<<< orphan*/ mapif_elem_info(int, int, int, struct mmo_elemstatus *, int);
int mapif_create_elem(int fd, int account_id, int char_id,
                      struct mmo_elemstatus *e) {
  if (!e || account_id <= 0 || char_id <= 0)
    return 0;
  if (elemdb_sql_new(e) == (1 == 1)) {
    mapif_elem_info(fd, account_id, char_id, e, 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<mapif_create_elem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1154 <mapif_create_elem+0x34>
cmpl   $0x0,-0xc(%rbp)
jle    1154 <mapif_create_elem+0x34>
cmpl   $0x0,-0x10(%rbp)
jg     1160 <mapif_create_elem+0x40>
movl   $0x0,-0x4(%rbp)
jmp    1191 <mapif_create_elem+0x71>
mov    -0x18(%rbp),%rdi
call   1030 <elemdb_sql_new@plt>
cmp    $0x1,%eax
jne    118a <mapif_create_elem+0x6a>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    $0x1,%r8d
call   1040 <mapif_elem_info@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mapif_create_elem>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %edx,%edx
jle    1162 <mapif_create_elem+0x42>
mov    %esi,%r14d
test   %esi,%esi
jle    1162 <mapif_create_elem+0x42>
mov    %rcx,%rbx
test   %rcx,%rcx
je     1162 <mapif_create_elem+0x42>
mov    %edx,%ebp
mov    %edi,%r15d
mov    %rbx,%rdi
call   1030 <elemdb_sql_new@plt>
cmp    $0x1,%eax
jne    1162 <mapif_create_elem+0x42>
mov    %r15d,%edi
mov    %r14d,%esi
mov    %ebp,%edx
mov    %rbx,%rcx
mov    $0x1,%r8d
call   1040 <mapif_elem_info@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.mmo_elemstatus = type { i32 }
define i32 @mapif_create_elem(i32 %0, i32 %1, i32 %2, %struct.mmo_elemstatus* %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca %struct.mmo_elemstatus*
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store %struct.mmo_elemstatus* %3, %struct.mmo_elemstatus** %9
%10 = load %struct.mmo_elemstatus*, %struct.mmo_elemstatus** %9
%11 = icmp ne %struct.mmo_elemstatus* %10, null
br i1 %11, label %12, label %18
12: ; preds = %4
%13 = load i32, i32* %7
%14 = icmp sle i32 %13, 0
br i1 %14, label %18, label %15
15: ; preds = %12
%16 = load i32, i32* %8
%17 = icmp sle i32 %16, 0
br i1 %17, label %18, label %19
18: ; preds = %15, %12, %4
store i32 0, i32* %5
br label %30
19: ; preds = %15
%20 = load %struct.mmo_elemstatus*, %struct.mmo_elemstatus** %9
%21 = call i32 @elemdb_sql_new(%struct.mmo_elemstatus* %20)
%22 = icmp eq i32 %21, 1
br i1 %22, label %23, label %29
23: ; preds = %19
%24 = load i32, i32* %6
%25 = load i32, i32* %7
%26 = load i32, i32* %8
%27 = load %struct.mmo_elemstatus*, %struct.mmo_elemstatus** %9
%28 = call i32 @mapif_elem_info(i32 %24, i32 %25, i32 %26, %struct.mmo_elemstatus* %27, i32 1)
br label %29
29: ; preds = %23, %19
store i32 0, i32* %5
br label %30
30: ; preds = %29, %18
%31 = load i32, i32* %5
ret i32 %31
}

LLVM IR (-O2):
%struct.mmo_elemstatus = type { i32 }
define i32 @mapif_create_elem(i32 %0, i32 %1, i32 %2, %struct.mmo_elemstatus* %3) {
%5 = icmp eq %struct.mmo_elemstatus* %3, null
%6 = icmp slt i32 %1, 1
%7 = or i1 %6, %5
%8 = icmp slt i32 %2, 1
%9 = or i1 %8, %7
br i1 %9, label %15, label %10
10: ; preds = %4
%11 = tail call i32 @elemdb_sql_new(%struct.mmo_elemstatus* %3)
%12 = icmp eq i32 %11, 1
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @mapif_elem_info(i32 %0, i32 %1, i32 %2, %struct.mmo_elemstatus* %3, i32 1)
br label %15
15: ; preds = %10, %13, %4
ret i32 0
}