#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 mib_chain_delete(int, int);
unsigned int mib_chain_total(int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ restart_acl();
int delAclEntry(int index) {
  unsigned int totalEntry;
  totalEntry = mib_chain_total(350 + 6);
  if (totalEntry == 0) {
    printf("Empty table!\n");
    return -1;
  }
  if (mib_chain_delete(350 + 6, index - 1) != 1) {
    printf("Delete chain record error!");
    return -1;
  }
  restart_acl();
  return 0;
}


x86 assembly (clang, -O0):
<delAclEntry>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x164,%edi
call   1050 <mib_chain_total@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    117a <delAclEntry+0x3a>
lea    0xe97(%rip),%rdi
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b9 <delAclEntry+0x79>
mov    -0x8(%rbp),%esi
sub    $0x1,%esi
mov    $0x164,%edi
call   1040 <mib_chain_delete@plt>
cmp    $0x1,%eax
je     11ab <delAclEntry+0x6b>
lea    0xe74(%rip),%rdi
call   1060 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11b9 <delAclEntry+0x79>
mov    $0x0,%al
call   1030 <restart_acl@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<delAclEntry>:
push   %rbx
mov    %edi,%ebx
mov    $0x164,%edi
call   1060 <mib_chain_total@plt>
test   %eax,%eax
je     1180 <delAclEntry+0x30>
add    $0xffffffff,%ebx
mov    $0x164,%edi
mov    %ebx,%esi
call   1050 <mib_chain_delete@plt>
cmp    $0x1,%eax
jne    118e <delAclEntry+0x3e>
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <restart_acl@plt>
jmp    119f <delAclEntry+0x4f>
lea    0xe94(%rip),%rdi
call   1030 <puts@plt>
jmp    119a <delAclEntry+0x4a>
lea    0xe6b(%rip),%rdi
call   1070 <printf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Empty table!\0A\00"
@.str.1 = [27 x i8] c"Delete chain record error!\00"
define i32 @delAclEntry(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = call i32 @mib_chain_total(i32 356)
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
store i32 -1, i32* %2
br label %19
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 1
%13 = call i32 @mib_chain_delete(i32 356, i32 %12)
%14 = icmp ne i32 %13, 1
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
store i32 -1, i32* %2
br label %19
17: ; preds = %10
%18 = call i32 (...) @restart_acl()
store i32 0, i32* %2
br label %19
19: ; preds = %17, %15, %8
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str.1 = [27 x i8] c"Delete chain record error!\00"
@str = [13 x i8] c"Empty table!\00"
define i32 @delAclEntry(i32 %0) {
%2 = tail call i32 @mib_chain_total(i32 356)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %14
6: ; preds = %1
%7 = add nsw i32 %0, -1
%8 = tail call i32 @mib_chain_delete(i32 356, i32 %7)
%9 = icmp eq i32 %8, 1
br i1 %9, label %12, label %10
10: ; preds = %6
%11 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
br label %14
12: ; preds = %6
%13 = tail call i32 (...) @restart_acl()
br label %14
14: ; preds = %12, %10, %4
%15 = phi i32 [ -1, %4 ], [ -1, %10 ], [ 0, %12 ]
ret i32 %15
}