#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 */
char *strchr(char *, char);
char *strtok(char *, char *);
char *BetweenTwoChar(char *content, char *start, char *end) {
  char *ptr;
  char *ptr_ret;
  char *findEnd;
  if (NULL == content) {
    return NULL;
  }
  content = strchr(content, *start);
  if (NULL == content) {
    return NULL;
  }
  ptr = strtok(content, start);
  findEnd = strchr(ptr, *end);
  if (NULL == findEnd) {
    return NULL;
  }
  ptr_ret = strtok(ptr, end);
  ptr = strtok(NULL, end);
  if (NULL == ptr) {
    return NULL;
  }
  return ptr_ret;
}


x86 assembly (clang, -O0):
<BetweenTwoChar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    114d <BetweenTwoChar+0x2d>
movq   $0x0,-0x8(%rbp)
jmp    11fb <BetweenTwoChar+0xdb>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
cmp    -0x10(%rbp),%rax
jne    117a <BetweenTwoChar+0x5a>
movq   $0x0,-0x8(%rbp)
jmp    11fb <BetweenTwoChar+0xdb>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
mov    %rax,-0x38(%rbp)
xor    %eax,%eax
cmp    -0x38(%rbp),%rax
jne    11b8 <BetweenTwoChar+0x98>
movq   $0x0,-0x8(%rbp)
jmp    11fb <BetweenTwoChar+0xdb>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1040 <strtok@plt>
mov    %rax,-0x30(%rbp)
mov    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edi
call   1040 <strtok@plt>
mov    %rax,-0x28(%rbp)
xor    %eax,%eax
cmp    -0x28(%rbp),%rax
jne    11f3 <BetweenTwoChar+0xd3>
movq   $0x0,-0x8(%rbp)
jmp    11fb <BetweenTwoChar+0xdb>
mov    -0x30(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BetweenTwoChar>:
push   %r14
push   %rbx
push   %rax
test   %rdi,%rdi
je     117c <BetweenTwoChar+0x5c>
mov    %rdx,%r14
mov    %rsi,%rbx
movsbl (%rsi),%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     117c <BetweenTwoChar+0x5c>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1040 <strtok@plt>
mov    %rax,%rbx
movsbl (%r14),%esi
mov    %rax,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     117c <BetweenTwoChar+0x5c>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strtok@plt>
mov    %rax,%rbx
xor    %edi,%edi
mov    %r14,%rsi
call   1040 <strtok@plt>
test   %rax,%rax
cmove  %rax,%rbx
jmp    117e <BetweenTwoChar+0x5e>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @BetweenTwoChar(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%11 = load i8*, i8** %5
%12 = icmp eq i8* null, %11
br i1 %12, label %13, label %14
13: ; preds = %3
store i8* null, i8** %4
br label %44
14: ; preds = %3
%15 = load i8*, i8** %5
%16 = load i8*, i8** %6
%17 = load i8, i8* %16
%18 = call i8* @strchr(i8* %15, i8 signext %17)
store i8* %18, i8** %5
%19 = load i8*, i8** %5
%20 = icmp eq i8* null, %19
br i1 %20, label %21, label %22
21: ; preds = %14
store i8* null, i8** %4
br label %44
22: ; preds = %14
%23 = load i8*, i8** %5
%24 = load i8*, i8** %6
%25 = call i8* @strtok(i8* %23, i8* %24)
store i8* %25, i8** %8
%26 = load i8*, i8** %8
%27 = load i8*, i8** %7
%28 = load i8, i8* %27
%29 = call i8* @strchr(i8* %26, i8 signext %28)
store i8* %29, i8** %10
%30 = load i8*, i8** %10
%31 = icmp eq i8* null, %30
br i1 %31, label %32, label %33
32: ; preds = %22
store i8* null, i8** %4
br label %44
33: ; preds = %22
%34 = load i8*, i8** %8
%35 = load i8*, i8** %7
%36 = call i8* @strtok(i8* %34, i8* %35)
store i8* %36, i8** %9
%37 = load i8*, i8** %7
%38 = call i8* @strtok(i8* null, i8* %37)
store i8* %38, i8** %8
%39 = load i8*, i8** %8
%40 = icmp eq i8* null, %39
br i1 %40, label %41, label %42
41: ; preds = %33
store i8* null, i8** %4
br label %44
42: ; preds = %33
%43 = load i8*, i8** %9
store i8* %43, i8** %4
br label %44
44: ; preds = %42, %41, %32, %21, %13
%45 = load i8*, i8** %4
ret i8* %45
}

LLVM IR (-O2):
define i8* @BetweenTwoChar(i8* %0, i8* nocapture %1, i8* nocapture %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %19, label %5
5: ; preds = %3
%6 = load i8, i8* %1
%7 = tail call i8* @strchr(i8* %0, i8 signext %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %19, label %9
9: ; preds = %5
%10 = tail call i8* @strtok(i8* %7, i8* %1)
%11 = load i8, i8* %2
%12 = tail call i8* @strchr(i8* dereferenceable(1) %10, i8 signext %11)
%13 = icmp eq i8* %12, null
br i1 %13, label %19, label %14
14: ; preds = %9
%15 = tail call i8* @strtok(i8* %10, i8* %2)
%16 = tail call i8* @strtok(i8* null, i8* %2)
%17 = icmp eq i8* %16, null
%18 = select i1 %17, i8* null, i8* %15
br label %19
19: ; preds = %14, %9, %5, %3
%20 = phi i8* [ null, %3 ], [ null, %5 ], [ null, %9 ], [ %18, %14 ]
ret i8* %20
}