#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 */
int /*<<< orphan*/ extractShortOptionName(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ testChar(int /*<<< orphan*/, char);
void test2() {
  printf("\nTesting extractShortOptionName.\n");
  testChar(extractShortOptionName("-h"), 'h');
  testChar(extractShortOptionName("h"), '\0');
  testChar(extractShortOptionName("hello"), '\0');
  testChar(extractShortOptionName("--hello"), '\0');
  testChar(extractShortOptionName("h-"), '\0');
  testChar(extractShortOptionName("-"), '\0');
  testChar(extractShortOptionName("--"), '\0');
  testChar(extractShortOptionName(""), '\0');
  testChar(extractShortOptionName(NULL), '\0');
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xedb(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
mov    $0x68,%esi
call   1030 <testChar@plt>
lea    0xec4(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xeb3(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe9c(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe8f(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe7e(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe68(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe44(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
push   %rax
lea    0xed9(%rip),%rdi
call   1040 <puts@plt>
lea    0xebc(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
mov    $0x68,%esi
call   1030 <testChar@plt>
lea    0xea5(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe94(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe7d(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe70(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe5f(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe49(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
lea    0xe36(%rip),%rdi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1030 <testChar@plt>
xor    %edi,%edi
call   1050 <extractShortOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <testChar@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"\0ATesting extractShortOptionName.\0A\00"
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [2 x i8] c"h\00"
@.str.3 = [6 x i8] c"hello\00"
@.str.4 = [8 x i8] c"--hello\00"
@.str.5 = [3 x i8] c"h-\00"
@.str.6 = [2 x i8] c"-\00"
@.str.7 = [3 x i8] c"--\00"
@.str.8 = [1 x i8] zeroinitializer
define void @test2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @testChar(i32 %2, i8 signext 104)
%4 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @testChar(i32 %4, i8 signext 0)
%6 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%7 = call i32 @testChar(i32 %6, i8 signext 0)
%8 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%9 = call i32 @testChar(i32 %8, i8 signext 0)
%10 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%11 = call i32 @testChar(i32 %10, i8 signext 0)
%12 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%13 = call i32 @testChar(i32 %12, i8 signext 0)
%14 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%15 = call i32 @testChar(i32 %14, i8 signext 0)
%16 = call i32 @extractShortOptionName(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%17 = call i32 @testChar(i32 %16, i8 signext 0)
%18 = call i32 @extractShortOptionName(i8* null)
%19 = call i32 @testChar(i32 %18, i8 signext 0)
ret void
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"-h\00"
@.str.2 = [2 x i8] c"h\00"
@.str.3 = [6 x i8] c"hello\00"
@.str.4 = [8 x i8] c"--hello\00"
@.str.5 = [3 x i8] c"h-\00"
@.str.6 = [2 x i8] c"-\00"
@.str.7 = [3 x i8] c"--\00"
@.str.8 = [1 x i8] zeroinitializer
@str = [33 x i8] c"\0ATesting extractShortOptionName.\00"
define void @test2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @testChar(i32 %2, i8 signext 104)
%4 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @testChar(i32 %4, i8 signext 0)
%6 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%7 = tail call i32 @testChar(i32 %6, i8 signext 0)
%8 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call i32 @testChar(i32 %8, i8 signext 0)
%10 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%11 = tail call i32 @testChar(i32 %10, i8 signext 0)
%12 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%13 = tail call i32 @testChar(i32 %12, i8 signext 0)
%14 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0))
%15 = tail call i32 @testChar(i32 %14, i8 signext 0)
%16 = tail call i32 @extractShortOptionName(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.8, i64 0, i64 0))
%17 = tail call i32 @testChar(i32 %16, i8 signext 0)
%18 = tail call i32 @extractShortOptionName(i8* null)
%19 = tail call i32 @testChar(i32 %18, i8 signext 0)
ret void
}