#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 date_convert_get_delimiter(char *date_string) {
  if (timlib_exists_character(date_string, '/'))
    return '/';
  else if (timlib_exists_character(date_string, '.'))
    return '.';
  else if (timlib_exists_character(date_string, '-'))
    return '-';
  else
    return 0;
}


x86 assembly (clang, -O0):
<date_convert_get_delimiter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     113d <date_convert_get_delimiter+0x2d>
movb   $0x2f,-0x1(%rbp)
jmp    1183 <date_convert_get_delimiter+0x73>
mov    -0x10(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     115e <date_convert_get_delimiter+0x4e>
movb   $0x2e,-0x1(%rbp)
jmp    1183 <date_convert_get_delimiter+0x73>
mov    -0x10(%rbp),%rdi
mov    $0x2d,%esi
call   1030 <timlib_exists_character@plt>
cmp    $0x0,%rax
je     117f <date_convert_get_delimiter+0x6f>
movb   $0x2d,-0x1(%rbp)
jmp    1183 <date_convert_get_delimiter+0x73>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_convert_get_delimiter>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <timlib_exists_character@plt>
mov    %rax,%rcx
mov    $0x2f,%al
test   %rcx,%rcx
jne    115e <date_convert_get_delimiter+0x4e>
mov    %rbx,%rdi
mov    $0x2e,%esi
call   1030 <timlib_exists_character@plt>
mov    %rax,%rcx
mov    $0x2e,%al
test   %rcx,%rcx
jne    115e <date_convert_get_delimiter+0x4e>
mov    $0x2d,%ebp
mov    %rbx,%rdi
mov    $0x2d,%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 @date_convert_get_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 47)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i8 47, i8* %2
br label %19
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = call i64 @timlib_exists_character(i8* %9, i8 signext 46)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %8
store i8 46, i8* %2
br label %19
13: ; preds = %8
%14 = load i8*, i8** %3
%15 = call i64 @timlib_exists_character(i8* %14, i8 signext 45)
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %18
17: ; preds = %13
store i8 45, i8* %2
br label %19
18: ; preds = %13
store i8 0, i8* %2
br label %19
19: ; preds = %18, %17, %12, %7
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define signext i8 @date_convert_get_delimiter(i8* %0) {
%2 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 47)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 46)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = tail call i64 @timlib_exists_character(i8* %0, i8 signext 45)
%9 = icmp eq i64 %8, 0
%10 = select i1 %9, i8 0, i8 45
br label %11
11: ; preds = %7, %4, %1
%12 = phi i8 [ 47, %1 ], [ 46, %4 ], [ %10, %7 ]
ret i8 %12
}