#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 */
scalar_t__ timlib_exists_character(char *, char);
char timlib_delimiter(char *string) {
  if (timlib_exists_character(string, '|'))
    return '|';
  else if (timlib_exists_character(string, '^'))
    return '^';
  else if (timlib_exists_character(string, ','))
    return ',';
  else if (timlib_exists_character(string, ';'))
    return ';';
  else if (timlib_exists_character(string, ':'))
    return ':';
  else
    return 0;
}


x86 assembly (clang, -O0):
<timlib_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x7c,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     113d <timlib_delimiter+0x2d>
movb   $0x7c,-0x1(%rbp)
jmp    11c5 <timlib_delimiter+0xb5>
mov    -0x10(%rbp),%rdi
mov    $0x5e,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     115e <timlib_delimiter+0x4e>
movb   $0x5e,-0x1(%rbp)
jmp    11c5 <timlib_delimiter+0xb5>
mov    -0x10(%rbp),%rdi
mov    $0x2c,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     117f <timlib_delimiter+0x6f>
movb   $0x2c,-0x1(%rbp)
jmp    11c5 <timlib_delimiter+0xb5>
mov    -0x10(%rbp),%rdi
mov    $0x3b,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     11a0 <timlib_delimiter+0x90>
movb   $0x3b,-0x1(%rbp)
jmp    11c5 <timlib_delimiter+0xb5>
mov    -0x10(%rbp),%rdi
mov    $0x3a,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     11c1 <timlib_delimiter+0xb1>
movb   $0x3a,-0x1(%rbp)
jmp    11c5 <timlib_delimiter+0xb5>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<timlib_delimiter>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x7c,%esi
call   1030 <timlib_exists_character@plt>
mov    %rax,%rcx
mov    $0x7c,%al
test   %rcx,%rcx
jne    118c <timlib_delimiter+0x7c>
mov    %rbx,%rdi
mov    $0x5e,%esi
call   1030 <timlib_exists_character@plt>
mov    %rax,%rcx
mov    $0x5e,%al
test   %rcx,%rcx
jne    118c <timlib_delimiter+0x7c>
mov    %rbx,%rdi
mov    $0x2c,%esi
call   1030 <timlib_exists_character@plt>
mov    %rax,%rcx
mov    $0x2c,%al
test   %rcx,%rcx
jne    118c <timlib_delimiter+0x7c>
mov    %rbx,%rdi
mov    $0x3b,%esi
call   1030 <timlib_exists_character@plt>
mov    %rax,%rcx
mov    $0x3b,%al
test   %rcx,%rcx
jne    118c <timlib_delimiter+0x7c>
mov    $0x3a,%ebp
mov    %rbx,%rdi
mov    $0x3a,%esi
call   1030 <timlib_exists_character@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
cmovne %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @timlib_delimiter(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i64 @timlib_exists_character(i8* %4, i8 signext 124)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 124, i8* %2
br label %29
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @timlib_exists_character(i8* %9, i8 signext 94)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 94, i8* %2
br label %29
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @timlib_exists_character(i8* %14, i8 signext 44)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 44, i8* %2
br label %29
18: ; preds = %13
%19 = load i8*, i8** %3
%20 = call i64 @timlib_exists_character(i8* %19, i8 signext 59)
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %18
store i8 59, i8* %2
br label %29
23: ; preds = %18
%24 = load i8*, i8** %3
%25 = call i64 @timlib_exists_character(i8* %24, i8 signext 58)
%26 = icmp ne i64 %25, 0
br i1 %26, label %27, label %28
27: ; preds = %23
store i8 58, i8* %2
br label %29
28: ; preds = %23
store i8 0, i8* %2
br label %29
29: ; preds = %28, %27, %22, %17, %12, %7
%30 = load i8, i8* %2
ret i8 %30
}

LLVM IR (-O2):
define signext i8 @timlib_delimiter(i8* %0) {
%2 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 124)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %17
4: ; preds = %1
%5 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 94)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 44)
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %17
10: ; preds = %7
%11 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 59)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %17
13: ; preds = %10
%14 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 58)
%15 = icmp eq i64 %14, 0
%16 = select i1 %15, i8 0, i8 58
br label %17
17: ; preds = %13, %10, %7, %4, %1
%18 = phi i8 [ 124, %1 ], [ 94, %4 ], [ 44, %7 ], [ 59, %10 ], [ %16, %13 ]
ret i8 %18
}