#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*/ adddel_target(int, char *, int, char **);
int /*<<< orphan*/ del_usage();
scalar_t__ strncmp(char *, char *, int);
void del(int sock, int argc, char **argv) {
  if (argc < 2) {
    del_usage();
    return;
  }
  if (strncmp(argv[1], "tar", 3) == 0) {
    adddel_target(sock, "remove", (argc - 1), argv + 1);
    return;
  }
  if (strncmp(argv[1], "int", 3) == 0) {
    return;
  }
  if ((strncmp(argv[1], "acl", 3) == 0) || (strncmp(argv[1], "acc", 3) == 0)) {
    return;
  }
  del_usage();
  return;
}


x86 assembly (clang, -O0):
<del>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    1158 <del+0x28>
mov    $0x0,%al
call   1040 <del_usage@plt>
jmp    1217 <del+0xe7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe99(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    119d <del+0x6d>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%edx
sub    $0x1,%edx
mov    -0x10(%rbp),%rcx
add    $0x8,%rcx
lea    0xe71(%rip),%rsi
call   1050 <adddel_target@plt>
jmp    1217 <del+0xe7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe5f(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    11c5 <del+0x95>
jmp    1217 <del+0xe7>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe3b(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
je     120b <del+0xdb>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe1c(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1210 <del+0xe0>
jmp    1217 <del+0xe7>
mov    $0x0,%al
call   1040 <del_usage@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x1,%esi
jg     1144 <del+0x14>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <del_usage@plt>
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %edi,%r14d
mov    0x8(%rdx),%rdi
add    $0x8,%rbx
lea    0xea5(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11ba <del+0x8a>
mov    (%rbx),%rdi
lea    0xe97(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11b5 <del+0x85>
mov    (%rbx),%rdi
lea    0xe82(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
je     11b5 <del+0x85>
mov    (%rbx),%rdi
lea    0xe6d(%rip),%rsi
mov    $0x3,%edx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    1139 <del+0x9>
pop    %rbx
pop    %r14
pop    %rbp
ret
add    $0xffffffff,%ebp
lea    0xe40(%rip),%rsi
mov    %r14d,%edi
mov    %ebp,%edx
mov    %rbx,%rcx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <adddel_target@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"tar\00"
@.str.1 = [7 x i8] c"remove\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [4 x i8] c"acl\00"
@.str.4 = [4 x i8] c"acc\00"
define void @del(i32 %0, i32 %1, i8** %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8**
store i32 %0, i32* %4
store i32 %1, i32* %5
store i8** %2, i8*** %6
%7 = load i32, i32* %5
%8 = icmp slt i32 %7, 2
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 (...) @del_usage()
br label %46
11: ; preds = %3
%12 = load i8**, i8*** %6
%13 = getelementptr inbounds i8*, i8** %12, i64 1
%14 = load i8*, i8** %13
%15 = call i64 @strncmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %24
17: ; preds = %11
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = sub nsw i32 %19, 1
%21 = load i8**, i8*** %6
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = call i32 @adddel_target(i32 %18, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %20, i8** %22)
br label %46
24: ; preds = %11
%25 = load i8**, i8*** %6
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = call i64 @strncmp(i8* %27, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%29 = icmp eq i64 %28, 0
br i1 %29, label %30, label %31
30: ; preds = %24
br label %46
31: ; preds = %24
%32 = load i8**, i8*** %6
%33 = getelementptr inbounds i8*, i8** %32, i64 1
%34 = load i8*, i8** %33
%35 = call i64 @strncmp(i8* %34, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%36 = icmp eq i64 %35, 0
br i1 %36, label %43, label %37
37: ; preds = %31
%38 = load i8**, i8*** %6
%39 = getelementptr inbounds i8*, i8** %38, i64 1
%40 = load i8*, i8** %39
%41 = call i64 @strncmp(i8* %40, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%42 = icmp eq i64 %41, 0
br i1 %42, label %43, label %44
43: ; preds = %37, %31
br label %46
44: ; preds = %37
%45 = call i32 (...) @del_usage()
br label %46
46: ; preds = %44, %43, %30, %17, %9
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"tar\00"
@.str.1 = [7 x i8] c"remove\00"
@.str.2 = [4 x i8] c"int\00"
@.str.3 = [4 x i8] c"acl\00"
@.str.4 = [4 x i8] c"acc\00"
define void @del(i32 %0, i32 %1, i8** %2) {
%4 = icmp slt i32 %1, 2
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 (...) @del_usage()
br label %29
7: ; preds = %3
%8 = getelementptr inbounds i8*, i8** %2, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @strncmp(i8* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = add nsw i32 %1, -1
%14 = tail call i32 @adddel_target(i32 %0, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %13, i8** %8)
br label %29
15: ; preds = %7
%16 = load i8*, i8** %8
%17 = tail call i64 @strncmp(i8* %16, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 3)
%18 = icmp eq i64 %17, 0
br i1 %18, label %29, label %19
19: ; preds = %15
%20 = load i8*, i8** %8
%21 = tail call i64 @strncmp(i8* %20, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 3)
%22 = icmp eq i64 %21, 0
br i1 %22, label %29, label %23
23: ; preds = %19
%24 = load i8*, i8** %8
%25 = tail call i64 @strncmp(i8* %24, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 3)
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %23
%28 = tail call i32 (...) @del_usage()
br label %29
29: ; preds = %19, %23, %15, %27, %12, %5
ret void
}