#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*/ sprintf(char *, char *, char *, ...);
scalar_t__ strcmp(char *, char *);
void option_name(char *tempStr, char *shortopt, char *longopt) {
  if (strcmp(shortopt, "-") != 0 && strcmp(longopt, "--") != 0) {
    sprintf(tempStr, "%s/%s", shortopt, longopt);
  } else if (strcmp(shortopt, "-") == 0) {
    sprintf(tempStr, "%s", longopt);
  } else if (strcmp(longopt, "--") == 0) {
    sprintf(tempStr, "%s", shortopt);
  }
}


x86 assembly (clang, -O0):
<option_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xec2(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1187 <option_name+0x67>
mov    -0x18(%rbp),%rdi
lea    0xea7(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1187 <option_name+0x67>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
lea    0xe88(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    11f6 <option_name+0xd6>
mov    -0x10(%rbp),%rdi
lea    0xe6f(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11bc <option_name+0x9c>
mov    -0x8(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xe56(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    11f1 <option_name+0xd1>
mov    -0x18(%rbp),%rdi
lea    0xe39(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    11ec <option_name+0xcc>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe21(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
jmp    11f1 <option_name+0xd1>
jmp    11f6 <option_name+0xd6>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<option_name>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0xebc(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1182 <option_name+0x52>
lea    0xea7(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     1182 <option_name+0x52>
lea    0xe96(%rip),%rsi
mov    %r14,%rdi
mov    %rbx,%rdx
mov    %r15,%rcx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1050 <sprintf@plt>
lea    0xe78(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11b0 <option_name+0x80>
lea    0xe63(%rip),%rsi
mov    %r15,%rdi
call   1040 <strcmp@plt>
test   %rax,%rax
je     11b8 <option_name+0x88>
pop    %rbx
pop    %r14
pop    %r15
ret
mov    %r14,%rdi
mov    %r15,%rsi
jmp    11be <option_name+0x8e>
mov    %r14,%rdi
mov    %rbx,%rsi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <strcpy@plt>

LLVM IR (-O0):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"--\00"
@.str.2 = [6 x i8] c"%s/%s\00"
@.str.3 = [3 x i8] c"%s\00"
define void @option_name(i8* %0, i8* %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %7, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %19
10: ; preds = %3
%11 = load i8*, i8** %6
%12 = call i64 @strcmp(i8* %11, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i64 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %10
%15 = load i8*, i8** %4
%16 = load i8*, i8** %5
%17 = load i8*, i8** %6
%18 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %16, i8* %17)
br label %37
19: ; preds = %10, %3
%20 = load i8*, i8** %5
%21 = call i64 @strcmp(i8* %20, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%22 = icmp eq i64 %21, 0
br i1 %22, label %23, label %27
23: ; preds = %19
%24 = load i8*, i8** %4
%25 = load i8*, i8** %6
%26 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %24, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %25)
br label %36
27: ; preds = %19
%28 = load i8*, i8** %6
%29 = call i64 @strcmp(i8* %28, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %35
31: ; preds = %27
%32 = load i8*, i8** %4
%33 = load i8*, i8** %5
%34 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %32, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %33)
br label %35
35: ; preds = %31, %27
br label %36
36: ; preds = %35, %23
br label %37
37: ; preds = %36, %14
ret void
}

LLVM IR (-O2):
@.str = [2 x i8] c"-\00"
@.str.1 = [3 x i8] c"--\00"
@.str.2 = [6 x i8] c"%s/%s\00"
define void @option_name(i8* %0, i8* %1, i8* %2) {
%4 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %3
%7 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 (i8*, i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* %2)
br label %21
11: ; preds = %6, %3
%12 = tail call i64 @strcmp(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%13 = icmp eq i64 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %2)
br label %21
16: ; preds = %11
%17 = tail call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%18 = icmp eq i64 %17, 0
br i1 %18, label %19, label %21
19: ; preds = %16
%20 = tail call i8* @strcpy(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
br label %21
21: ; preds = %14, %19, %16, %9
ret void
}