#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*/ extractLongOptionName(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ testStr(int /*<<< orphan*/, char *);
void test1() {
  printf("\nTesting extractLongOptionName.\n");
  testStr(extractLongOptionName("--hello"), "hello");
  testStr(extractLongOptionName("noLeadingDashes"), NULL);
  testStr(extractLongOptionName("-hello"), NULL);
  testStr(extractLongOptionName("-h"), NULL);
  testStr(extractLongOptionName("--"), NULL);
  testStr(extractLongOptionName(""), NULL);
  testStr(extractLongOptionName(NULL), NULL);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <printf@plt>
lea    0xeda(%rip),%rdi
call   1030 <extractLongOptionName@plt>
mov    %eax,%edi
lea    0xece(%rip),%rsi
call   1050 <testStr@plt>
lea    0xec8(%rip),%rdi
call   1030 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <testStr@plt>
lea    0xeaa(%rip),%rdi
call   1030 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <testStr@plt>
lea    0xeaa(%rip),%rdi
call   1030 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <testStr@plt>
lea    0xe96(%rip),%rdi
call   1030 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <testStr@plt>
lea    0xe63(%rip),%rdi
call   1030 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <testStr@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <testStr@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
push   %rax
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
call   1040 <extractLongOptionName@plt>
lea    0xeb2(%rip),%rsi
mov    %eax,%edi
call   1050 <testStr@plt>
lea    0xeaa(%rip),%rdi
call   1040 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <testStr@plt>
lea    0xe8e(%rip),%rdi
call   1040 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <testStr@plt>
lea    0xe90(%rip),%rdi
call   1040 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <testStr@plt>
lea    0xe7e(%rip),%rdi
call   1040 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <testStr@plt>
lea    0xe6b(%rip),%rdi
call   1040 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
call   1050 <testStr@plt>
xor    %edi,%edi
call   1040 <extractLongOptionName@plt>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1050 <testStr@plt>

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

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