#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 *, ...);
int del_substr(char *str, char const *substr) {
  char *temp;
  if (str != NULL && substr != NULL) {
    for (; *str != '\0'; str++) {
      printf("\nStr este %c\n", *str);
      for (temp = substr; *temp != '\n'; temp++) {
        printf("\tsubstr este %c\n", *temp);
        if (*str == *temp) {
          printf("\nReturned 10\n");
          char *str2 = str;
          char *temp2 = temp;
          if (*(str2 + 1) == *(temp2 + 1))
            ;
          {
            printf("Am gasit ambelele litere!!\n\n");
            return 10;
          }
        }
      }
    }
    printf("\nReturned 21\n");
    return 21;
  }
  return 1;
}


x86 assembly (clang, -O0):
<del_substr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     123e <del_substr+0x12e>
cmpq   $0x0,-0x18(%rbp)
je     123e <del_substr+0x12e>
jmp    113b <del_substr+0x2b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1224 <del_substr+0x114>
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     120e <del_substr+0xfe>
mov    -0x20(%rbp),%rax
movsbl (%rax),%esi
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x20(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    11f8 <del_substr+0xe8>
lea    0xe75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rax
movsbl 0x1(%rax),%eax
mov    -0x30(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
cmp    %ecx,%eax
jne    11de <del_substr+0xce>
jmp    11de <del_substr+0xce>
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0xa,-0x4(%rbp)
jmp    1245 <del_substr+0x135>
jmp    11fd <del_substr+0xed>
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1168 <del_substr+0x58>
jmp    1213 <del_substr+0x103>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113b <del_substr+0x2b>
lea    0xe1f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x15,-0x4(%rbp)
jmp    1245 <del_substr+0x135>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<del_substr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    $0x1,%r15d
test   %rdi,%rdi
je     11e5 <del_substr+0xc5>
mov    %rsi,%r13
test   %rsi,%rsi
je     11e5 <del_substr+0xc5>
mov    %rdi,%rbp
mov    (%rdi),%al
mov    $0x15,%r15d
lea    0xec7(%rip),%rdi
test   %al,%al
je     11e0 <del_substr+0xc0>
lea    0x1(%r13),%r14
lea    0xea3(%rip),%rbx
jmp    117b <del_substr+0x5b>
nopl   (%rax)
mov    0x1(%rbp),%al
add    $0x1,%rbp
test   %al,%al
je     11f7 <del_substr+0xd7>
movsbl %al,%esi
lea    0xe7b(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x0(%r13),%al
mov    %r14,%r12
cmp    $0xa,%al
je     1170 <del_substr+0x50>
nopw   0x0(%rax,%rax,1)
movsbl %al,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
movzbl 0x0(%rbp),%eax
cmp    -0x1(%r12),%al
je     11c7 <del_substr+0xa7>
movzbl (%r12),%eax
add    $0x1,%r12
cmp    $0xa,%al
jne    11a0 <del_substr+0x80>
jmp    1170 <del_substr+0x50>
lea    0xe5e(%rip),%rdi
call   1030 <puts@plt>
mov    $0xa,%r15d
lea    0xe59(%rip),%rdi
call   1030 <puts@plt>
mov    %r15d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe21(%rip),%rdi
jmp    11e0 <del_substr+0xc0>

LLVM IR (-O0):
@.str = [14 x i8] c"\0AStr este %c\0A\00"
@.str.1 = [17 x i8] c"\09substr este %c\0A\00"
@.str.2 = [14 x i8] c"\0AReturned 10\0A\00"
@.str.3 = [29 x i8] c"Am gasit ambelele litere!!\0A\0A\00"
@.str.4 = [14 x i8] c"\0AReturned 21\0A\00"
define i32 @del_substr(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
br i1 %10, label %11, label %69
11: ; preds = %2
%12 = load i8*, i8** %5
%13 = icmp ne i8* %12, null
br i1 %13, label %14, label %69
14: ; preds = %11
br label %15
15: ; preds = %64, %14
%16 = load i8*, i8** %4
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %67
20: ; preds = %15
%21 = load i8*, i8** %4
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i8*, i8** %5
store i8* %25, i8** %6
br label %26
26: ; preds = %60, %20
%27 = load i8*, i8** %6
%28 = load i8, i8* %27
%29 = sext i8 %28 to i32
%30 = icmp ne i32 %29, 10
br i1 %30, label %31, label %63
31: ; preds = %26
%32 = load i8*, i8** %6
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %34)
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = sext i8 %37 to i32
%39 = load i8*, i8** %6
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = icmp eq i32 %38, %41
br i1 %42, label %43, label %59
43: ; preds = %31
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%45 = load i8*, i8** %4
store i8* %45, i8** %7
%46 = load i8*, i8** %6
store i8* %46, i8** %8
%47 = load i8*, i8** %7
%48 = getelementptr inbounds i8, i8* %47, i64 1
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = load i8*, i8** %8
%52 = getelementptr inbounds i8, i8* %51, i64 1
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %50, %54
br i1 %55, label %56, label %57
56: ; preds = %43
br label %57
57: ; preds = %56, %43
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.3, i64 0, i64 0))
store i32 10, i32* %3
br label %70
59: ; preds = %31
br label %60
60: ; preds = %59
%61 = load i8*, i8** %6
%62 = getelementptr inbounds i8, i8* %61, i32 1
store i8* %62, i8** %6
br label %26
63: ; preds = %26
br label %64
64: ; preds = %63
%65 = load i8*, i8** %4
%66 = getelementptr inbounds i8, i8* %65, i32 1
store i8* %66, i8** %4
br label %15
67: ; preds = %15
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0))
store i32 21, i32* %3
br label %70
69: ; preds = %11, %2
store i32 1, i32* %3
br label %70
70: ; preds = %69, %67, %57
%71 = load i32, i32* %3
ret i32 %71
}

LLVM IR (-O2):
@.str = [14 x i8] c"\0AStr este %c\0A\00"
@.str.1 = [17 x i8] c"\09substr este %c\0A\00"
@str = [13 x i8] c"\0AReturned 21\00"
@str.5 = [13 x i8] c"\0AReturned 10\00"
@str.6 = [28 x i8] c"Am gasit ambelele litere!!\0A\00"
define i32 @del_substr(i8* %0, i8* %1) {
%3 = icmp ne i8* %0, null
%4 = icmp ne i8* %1, null
%5 = and i1 %3, %4
br i1 %5, label %6, label %38
6: ; preds = %2
%7 = load i8, i8* %0
%8 = icmp eq i8 %7, 0
br i1 %8, label %34, label %9
9: ; preds = %6, %30
%10 = phi i8 [ %32, %30 ], [ %7, %6 ]
%11 = phi i8* [ %31, %30 ], [ %0, %6 ]
%12 = sext i8 %10 to i32
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i8, i8* %1
%15 = icmp eq i8 %14, 10
br i1 %15, label %30, label %19
16: ; preds = %19
%17 = load i8, i8* %27
%18 = icmp eq i8 %17, 10
br i1 %18, label %30, label %19
19: ; preds = %9, %16
%20 = phi i8 [ %17, %16 ], [ %14, %9 ]
%21 = phi i8* [ %27, %16 ], [ %1, %9 ]
%22 = sext i8 %20 to i32
%23 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %22)
%24 = load i8, i8* %11
%25 = load i8, i8* %21
%26 = icmp eq i8 %24, %25
%27 = getelementptr inbounds i8, i8* %21, i64 1
br i1 %26, label %28, label %16
28: ; preds = %19
%29 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str.5, i64 0, i64 0))
br label %34
30: ; preds = %16, %9
%31 = getelementptr inbounds i8, i8* %11, i64 1
%32 = load i8, i8* %31
%33 = icmp eq i8 %32, 0
br i1 %33, label %34, label %9
34: ; preds = %30, %6, %28
%35 = phi i8* [ getelementptr inbounds ([28 x i8], [28 x i8]* @str.6, i64 0, i64 0), %28 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), %6 ], [ getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0), %30 ]
%36 = phi i32 [ 10, %28 ], [ 21, %6 ], [ 21, %30 ]
%37 = tail call i32 @puts(i8* dereferenceable(1) %35)
br label %38
38: ; preds = %34, %2
%39 = phi i32 [ 1, %2 ], [ %36, %34 ]
ret i32 %39
}