#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 *get_exists_cali(const char *right_part) {
  char *cali_pointer;
  char *exists_cali_info;
  int cali_len;
  int in_cali_flag;
  cali_pointer = strdup(right_part);
  exists_cali_info = strdup(right_part);
  cali_len = 0;
  in_cali_flag = 1;
  while (*cali_pointer != '\0') {
    if (in_cali_flag == 0)
      break;
    switch (*cali_pointer) {
    case ',':
    case ')':
    case ';':
      in_cali_flag = 0;
      break;
    default:
      cali_len++;
    }
    cali_pointer++;
  }
  *(exists_cali_info + cali_len) = '\0';
  return exists_cali_info;
}


x86 assembly (clang, -O0):
<get_exists_cali>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strdup@plt>
mov    %rax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x1,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     11c3 <get_exists_cali+0xb3>
cmpl   $0x0,-0x20(%rbp)
jne    1163 <get_exists_cali+0x53>
jmp    11c3 <get_exists_cali+0xb3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x24(%rbp)
sub    $0x29,%eax
je     119d <get_exists_cali+0x8d>
jmp    117b <get_exists_cali+0x6b>
mov    -0x24(%rbp),%eax
sub    $0x2c,%eax
je     119d <get_exists_cali+0x8d>
jmp    118c <get_exists_cali+0x7c>
mov    -0x24(%rbp),%eax
sub    $0x3b,%eax
jne    11a9 <get_exists_cali+0x99>
jmp    119d <get_exists_cali+0x8d>
movl   $0x0,-0x20(%rbp)
jmp    11b2 <get_exists_cali+0xa2>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <get_exists_cali+0x34>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_exists_cali>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <strdup@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1030 <strdup@plt>
mov    (%rbx),%dl
xor    %ecx,%ecx
test   %dl,%dl
je     115b <get_exists_cali+0x4b>
movabs $0x800120000000000,%rsi
jmp    114d <get_exists_cali+0x3d>
nopl   0x0(%rax,%rax,1)
movzbl 0x1(%rbx,%rcx,1),%edx
add    $0x1,%rcx
test   %dl,%dl
je     115b <get_exists_cali+0x4b>
movsbl %dl,%edx
cmp    $0x3b,%edx
ja     1140 <get_exists_cali+0x30>
bt     %rdx,%rsi
jae    1140 <get_exists_cali+0x30>
movslq %ecx,%rcx
movb   $0x0,(%rax,%rcx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @get_exists_cali(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
%7 = load i8*, i8** %2
%8 = call i8* @strdup(i8* %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %2
%10 = call i8* @strdup(i8* %9)
store i8* %10, i8** %4
store i32 0, i32* %5
store i32 1, i32* %6
br label %11
11: ; preds = %28, %1
%12 = load i8*, i8** %3
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %31
16: ; preds = %11
%17 = load i32, i32* %6
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %20
19: ; preds = %16
br label %31
20: ; preds = %16
%21 = load i8*, i8** %3
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
switch i32 %23, label %25 [
i32 44, label %24
i32 41, label %24
i32 59, label %24
]
24: ; preds = %20, %20, %20
store i32 0, i32* %6
br label %28
25: ; preds = %20
%26 = load i32, i32* %5
%27 = add nsw i32 %26, 1
store i32 %27, i32* %5
br label %28
28: ; preds = %25, %24
%29 = load i8*, i8** %3
%30 = getelementptr inbounds i8, i8* %29, i32 1
store i8* %30, i8** %3
br label %11
31: ; preds = %19, %11
%32 = load i8*, i8** %4
%33 = load i32, i32* %5
%34 = sext i32 %33 to i64
%35 = getelementptr inbounds i8, i8* %32, i64 %34
store i8 0, i8* %35
%36 = load i8*, i8** %4
ret i8* %36
}

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