#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*/ printf(char *);
scalar_t__ remove(char *);
int strlen(char *);
int /*<<< orphan*/ throwError(int);
void drop(char *edSql) {
  char temp[10];
  int len = strlen(edSql);
  int i, j;
  for (i = 11, j = 0; i <= len && edSql[i] != '/'; i++, j++)
    temp[j] = edSql[i];
  temp[j] = '\0';
  if (remove(temp) == 0)
    printf("The table is deleted successfully!\n");
  else
    throwError(4);
}


x86 assembly (clang, -O0):
<drop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
movl   $0xb,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x21(%rbp)
jg     118c <drop+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2f,%eax
setne  %al
mov    %al,-0x21(%rbp)
mov    -0x21(%rbp),%al
test   $0x1,%al
jne    119c <drop+0x5c>
jmp    11c6 <drop+0x86>
mov    -0x8(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%cl
movslq -0x20(%rbp),%rax
mov    %cl,-0x12(%rbp,%rax,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1166 <drop+0x26>
movslq -0x20(%rbp),%rax
movb   $0x0,-0x12(%rbp,%rax,1)
lea    -0x12(%rbp),%rdi
call   1030 <remove@plt>
cmp    $0x0,%rax
jne    11f3 <drop+0xb3>
lea    0xe17(%rip),%rdi
call   1050 <printf@plt>
jmp    11fd <drop+0xbd>
mov    $0x4,%edi
call   1060 <throwError@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<drop>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
call   1050 <strlen@plt>
xor    %ecx,%ecx
cmp    $0xb,%eax
jl     1179 <drop+0x39>
add    $0xfffffff6,%eax
xor    %ecx,%ecx
nopl   0x0(%rax)
movzbl 0xb(%rbx,%rcx,1),%edx
cmp    $0x2f,%dl
je     1179 <drop+0x39>
mov    %dl,0x6(%rsp,%rcx,1)
add    $0x1,%rcx
cmp    %rcx,%rax
jne    1160 <drop+0x20>
mov    %eax,%ecx
mov    %ecx,%eax
movb   $0x0,0x6(%rsp,%rax,1)
lea    0x6(%rsp),%rdi
call   1030 <remove@plt>
test   %rax,%rax
je     119e <drop+0x5e>
mov    $0x4,%edi
add    $0x10,%rsp
pop    %rbx
jmp    1060 <throwError@plt>
lea    0xe5b(%rip),%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <puts@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"The table is deleted successfully!\0A\00"
define void @drop(i8* %0) {
%2 = alloca i8*
%3 = alloca [10 x i8]
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
store i32 %8, i32* %4
store i32 11, i32* %5
store i32 0, i32* %6
br label %9
9: ; preds = %32, %1
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp sle i32 %10, %11
br i1 %12, label %13, label %21
13: ; preds = %9
%14 = load i8*, i8** %2
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp ne i32 %19, 47
br label %21
21: ; preds = %13, %9
%22 = phi i1 [ false, %9 ], [ %20, %13 ]
br i1 %22, label %23, label %37
23: ; preds = %21
%24 = load i8*, i8** %2
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
%28 = load i8, i8* %27
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %30
store i8 %28, i8* %31
br label %32
32: ; preds = %23
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %9
37: ; preds = %21
%38 = load i32, i32* %6
%39 = sext i32 %38 to i64
%40 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %39
store i8 0, i8* %40
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%42 = call i64 @remove(i8* %41)
%43 = icmp eq i64 %42, 0
br i1 %43, label %44, label %46
44: ; preds = %37
%45 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
br label %48
46: ; preds = %37
%47 = call i32 @throwError(i32 4)
br label %48
48: ; preds = %46, %44
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"The table is deleted successfully!\00"
define void @drop(i8* %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strlen(i8* %0)
%5 = icmp slt i32 %4, 11
br i1 %5, label %22, label %6
6: ; preds = %1
%7 = add nsw i32 %4, -10
%8 = zext i32 %7 to i64
br label %9
9: ; preds = %6, %15
%10 = phi i64 [ 11, %6 ], [ %17, %15 ]
%11 = phi i64 [ 0, %6 ], [ %18, %15 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %10
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 47
br i1 %14, label %20, label %15
15: ; preds = %9
%16 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %11
store i8 %13, i8* %16
%17 = add nuw nsw i64 %10, 1
%18 = add nuw nsw i64 %11, 1
%19 = icmp eq i64 %18, %8
br i1 %19, label %22, label %9
20: ; preds = %9
%21 = trunc i64 %11 to i32
br label %22
22: ; preds = %15, %20, %1
%23 = phi i32 [ 0, %1 ], [ %21, %20 ], [ %7, %15 ]
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %24
store i8 0, i8* %25
%26 = call i64 @remove(i8* %3)
%27 = icmp eq i64 %26, 0
br i1 %27, label %28, label %30
28: ; preds = %22
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
br label %32
30: ; preds = %22
%31 = tail call i32 @throwError(i32 4)
br label %32
32: ; preds = %30, %28
ret void
}