#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 */
typedef int /*<<< orphan*/ array_letters;

/* Variables and functions */
int /*<<< orphan*/ printf(char *);
char *strchr(char *, char);
char input_is_char(char position[3]) {
  char array_letters[24] = "aAbBcCdDeEfFgGhHiIjJkKlL";
  char *ptr = NULL;
  int i, counter = 0;
  char first_character;
  for (i = 0; i < sizeof(array_letters); i++) {
    ptr = strchr(position, array_letters[i]);
    if (ptr != NULL) {
      first_character = *ptr;
      counter++;
      if (counter > 1) {
        printf("[WARNING] There is more that one Letter!\n");
        return '\0';
      }
    }
  }
  return first_character;
}


x86 assembly (clang, -O0):
<input_is_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x20(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x3c(%rbp)
movslq -0x3c(%rbp),%rax
cmp    $0x18,%rax
jae    11db <input_is_char+0xbb>
mov    -0x10(%rbp),%rdi
movslq -0x3c(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%esi
call   1030 <strchr@plt>
mov    %rax,-0x38(%rbp)
cmpq   $0x0,-0x38(%rbp)
je     11c8 <input_is_char+0xa8>
mov    -0x38(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x41(%rbp)
mov    -0x40(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
cmpl   $0x1,-0x40(%rbp)
jle    11c3 <input_is_char+0xa3>
lea    0xe63(%rip),%rdi
call   1040 <printf@plt>
movb   $0x0,-0x1(%rbp)
jmp    11e1 <input_is_char+0xc1>
jmp    11c8 <input_is_char+0xa8>
jmp    11cd <input_is_char+0xad>
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1163 <input_is_char+0x43>
mov    -0x41(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<input_is_char>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %rdi,%r12
xor    %ebp,%ebp
lea    0xecc(%rip),%r15
xor    %ebx,%ebx
jmp    114a <input_is_char+0x2a>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbp
cmp    $0x18,%rbp
je     117b <input_is_char+0x5b>
movsbl 0x0(%rbp,%r15,1),%esi
mov    %r12,%rdi
call   1040 <strchr@plt>
test   %rax,%rax
je     1140 <input_is_char+0x20>
test   %ebx,%ebx
jg     116c <input_is_char+0x4c>
movzbl (%rax),%r14d
mov    $0x1,%ebx
jmp    1140 <input_is_char+0x20>
lea    0xea5(%rip),%rdi
call   1030 <puts@plt>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.input_is_char.array_letters = [24 x i8] c"aAbBcCdDeEfFgGhHiIjJkKlL"
@.str = [42 x i8] c"[WARNING] There is more that one Letter!\0A\00"
define signext i8 @input_is_char(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca [24 x i8]
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8* %0, i8** %3
%9 = bitcast [24 x i8]* %4 to i8*
store i8* null, i8** %5
store i32 0, i32* %7
store i32 0, i32* %6
br label %10
10: ; preds = %34, %1
%11 = load i32, i32* %6
%12 = sext i32 %11 to i64
%13 = icmp ult i64 %12, 24
br i1 %13, label %14, label %37
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i32, i32* %6
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [24 x i8], [24 x i8]* %4, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = call i8* @strchr(i8* %15, i8 signext %19)
store i8* %20, i8** %5
%21 = load i8*, i8** %5
%22 = icmp ne i8* %21, null
br i1 %22, label %23, label %33
23: ; preds = %14
%24 = load i8*, i8** %5
%25 = load i8, i8* %24
store i8 %25, i8* %8
%26 = load i32, i32* %7
%27 = add nsw i32 %26, 1
store i32 %27, i32* %7
%28 = load i32, i32* %7
%29 = icmp sgt i32 %28, 1
br i1 %29, label %30, label %32
30: ; preds = %23
%31 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
store i8 0, i8* %2
br label %39
32: ; preds = %23
br label %33
33: ; preds = %32, %14
br label %34
34: ; preds = %33
%35 = load i32, i32* %6
%36 = add nsw i32 %35, 1
store i32 %36, i32* %6
br label %10
37: ; preds = %10
%38 = load i8, i8* %8
store i8 %38, i8* %2
br label %39
39: ; preds = %37, %30
%40 = load i8, i8* %2
ret i8 %40
}

LLVM IR (-O2):
@__const.input_is_char.array_letters = [24 x i8] c"aAbBcCdDeEfFgGhHiIjJkKlL"
@str = [41 x i8] c"[WARNING] There is more that one Letter!\00"
define signext i8 @input_is_char(i8* %0) {
br label %2
2: ; preds = %1, %15
%3 = phi i64 [ 0, %1 ], [ %18, %15 ]
%4 = phi i8 [ undef, %1 ], [ %17, %15 ]
%5 = phi i32 [ 0, %1 ], [ %16, %15 ]
%6 = getelementptr inbounds [24 x i8], [24 x i8]* @__const.input_is_char.array_letters, i64 0, i64 %3
%7 = load i8, i8* %6
%8 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext %7)
%9 = icmp eq i8* %8, null
br i1 %9, label %15, label %10
10: ; preds = %2
%11 = load i8, i8* %8
%12 = icmp sgt i32 %5, 0
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
br label %20
15: ; preds = %2, %10
%16 = phi i32 [ 1, %10 ], [ %5, %2 ]
%17 = phi i8 [ %11, %10 ], [ %4, %2 ]
%18 = add nuw nsw i64 %3, 1
%19 = icmp eq i64 %18, 24
br i1 %19, label %20, label %2
20: ; preds = %15, %13
%21 = phi i8 [ 0, %13 ], [ %17, %15 ]
ret i8 %21
}