#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 *strdup(char const *);
char *find_non_cali_pointer(const char *right_part) {
  char *non_cali_pointer;
  non_cali_pointer = strdup(right_part);
  while (*non_cali_pointer != '\0') {
    switch (*non_cali_pointer) {
    case ',':
    case ')':
    case ';':
      return non_cali_pointer;
    default:
      non_cali_pointer++;
      break;
    }
  }
  return NULL;
}


x86 assembly (clang, -O0):
<find_non_cali_pointer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1191 <find_non_cali_pointer+0x81>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
sub    $0x29,%eax
je     1173 <find_non_cali_pointer+0x63>
jmp    1151 <find_non_cali_pointer+0x41>
mov    -0x1c(%rbp),%eax
sub    $0x2c,%eax
je     1173 <find_non_cali_pointer+0x63>
jmp    1162 <find_non_cali_pointer+0x52>
mov    -0x1c(%rbp),%eax
sub    $0x3b,%eax
jne    1180 <find_non_cali_pointer+0x70>
jmp    1173 <find_non_cali_pointer+0x63>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1199 <find_non_cali_pointer+0x89>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1129 <find_non_cali_pointer+0x19>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_non_cali_pointer>:
push   %rax
call   1030 <strdup@plt>
mov    (%rax),%dl
test   %dl,%dl
je     114c <find_non_cali_pointer+0x3c>
movabs $0x800120000000000,%rcx
jmp    113c <find_non_cali_pointer+0x2c>
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rax),%edx
add    $0x1,%rax
test   %dl,%dl
je     114c <find_non_cali_pointer+0x3c>
movsbl %dl,%edx
cmp    $0x3b,%edx
ja     1130 <find_non_cali_pointer+0x20>
bt     %rdx,%rcx
jae    1130 <find_non_cali_pointer+0x20>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @find_non_cali_pointer(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i8* @strdup(i8* %5)
store i8* %6, i8** %4
br label %7
7: ; preds = %21, %1
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %22
12: ; preds = %7
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
switch i32 %15, label %18 [
i32 44, label %16
i32 41, label %16
i32 59, label %16
]
16: ; preds = %12, %12, %12
%17 = load i8*, i8** %4
store i8* %17, i8** %2
br label %23
18: ; preds = %12
%19 = load i8*, i8** %4
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %4
br label %21
21: ; preds = %18
br label %7
22: ; preds = %7
store i8* null, i8** %2
br label %23
23: ; preds = %22, %16
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define noalias i8* @find_non_cali_pointer(i8* nocapture %0) {
%2 = tail call i8* @strdup(i8* %0)
%3 = load i8, i8* %2
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %1, %9
%6 = phi i8 [ %11, %9 ], [ %3, %1 ]
%7 = phi i8* [ %10, %9 ], [ %2, %1 ]
%8 = sext i8 %6 to i32
switch i32 %8, label %9 [
i32 44, label %13
i32 41, label %13
i32 59, label %13
]
9: ; preds = %5
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %5, %5, %9, %1
%14 = phi i8* [ null, %1 ], [ null, %9 ], [ %7, %5 ], [ %7, %5 ], [ %7, %5 ]
ret i8* %14
}