#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 send_bss_info(int);
int send_ids_info(int);
int /*<<< orphan*/ strcasecmp(char *, char *);
int issue_get_cmd(int fd, char *option) {
  if (!strcasecmp(option, "DATA")) {
    return send_bss_info(fd);
  }
  if (!strcasecmp(option, "IDS")) {
    return send_ids_info(fd);
  }
  return (-1);
}


x86 assembly (clang, -O0):
<issue_get_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb6(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1168 <issue_get_cmd+0x38>
mov    -0x8(%rbp),%edi
call   1050 <send_bss_info@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <issue_get_cmd+0x68>
mov    -0x10(%rbp),%rdi
lea    0xe92(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1191 <issue_get_cmd+0x61>
mov    -0x8(%rbp),%edi
call   1040 <send_ids_info@plt>
mov    %eax,-0x4(%rbp)
jmp    1198 <issue_get_cmd+0x68>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<issue_get_cmd>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xec1(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     116a <issue_get_cmd+0x3a>
lea    0xeb3(%rip),%rsi
mov    %rbx,%rdi
call   1030 <strcasecmp@plt>
test   %eax,%eax
je     1177 <issue_get_cmd+0x47>
mov    $0xffffffff,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <send_bss_info@plt>
mov    %ebp,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <send_ids_info@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"DATA\00"
@.str.1 = [4 x i8] c"IDS\00"
define i32 @issue_get_cmd(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
%6 = load i8*, i8** %5
%7 = call i32 @strcasecmp(i8* %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %4
%11 = call i32 @send_bss_info(i32 %10)
store i32 %11, i32* %3
br label %20
12: ; preds = %2
%13 = load i8*, i8** %5
%14 = call i32 @strcasecmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp ne i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %12
%17 = load i32, i32* %4
%18 = call i32 @send_ids_info(i32 %17)
store i32 %18, i32* %3
br label %20
19: ; preds = %12
store i32 -1, i32* %3
br label %20
20: ; preds = %19, %16, %9
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@.str = [5 x i8] c"DATA\00"
@.str.1 = [4 x i8] c"IDS\00"
define i32 @issue_get_cmd(i32 %0, i8* nocapture %1) {
%3 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @send_bss_info(i32 %0)
br label %12
7: ; preds = %2
%8 = tail call i32 @strcasecmp(i8* %1, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @send_ids_info(i32 %0)
br label %12
12: ; preds = %7, %10, %5
%13 = phi i32 [ %11, %10 ], [ %6, %5 ], [ -1, %7 ]
ret i32 %13
}