#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 */
struct t_gui_buffer {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ command_version_display(struct t_gui_buffer *, int, int,
                                           int);
scalar_t__ string_strcasecmp(char *, char *);
int command_version(void *data, struct t_gui_buffer *buffer, int argc,
                    char **argv, char **argv_eol) {
  int send_to_buffer_as_input, translated_string;
  (void)data;
  (void)argv_eol;
  send_to_buffer_as_input = 0;
  translated_string = 0;
  if (argc >= 2) {
    if (string_strcasecmp(argv[1], "-o") == 0)
      send_to_buffer_as_input = 1;
    else if (string_strcasecmp(argv[1], "-ol") == 0) {
      send_to_buffer_as_input = 1;
      translated_string = 1;
    }
  }
  command_version_display(buffer, send_to_buffer_as_input, translated_string,
                          1);
  return 0;
}


x86 assembly (clang, -O0):
<command_version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0x2,-0x14(%rbp)
jl     11b3 <command_version+0x93>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9e(%rip),%rsi
call   1030 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    117d <command_version+0x5d>
movl   $0x1,-0x2c(%rbp)
jmp    11ae <command_version+0x8e>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe77(%rip),%rsi
call   1030 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    11a9 <command_version+0x89>
movl   $0x1,-0x2c(%rbp)
movl   $0x1,-0x30(%rbp)
jmp    11ae <command_version+0x8e>
jmp    11b3 <command_version+0x93>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
mov    -0x30(%rbp),%edx
mov    $0x1,%ecx
call   1040 <command_version_display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_version>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
xor    %ebp,%ebp
cmp    $0x2,%edx
jl     1163 <command_version+0x43>
mov    %rcx,%rbx
mov    0x8(%rcx),%rdi
lea    0xec4(%rip),%rsi
call   1030 <string_strcasecmp@plt>
test   %rax,%rax
je     1167 <command_version+0x47>
mov    0x8(%rbx),%rdi
lea    0xeb2(%rip),%rsi
call   1030 <string_strcasecmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
mov    %esi,%ebp
jmp    116c <command_version+0x4c>
xor    %esi,%esi
jmp    116c <command_version+0x4c>
mov    $0x1,%esi
mov    %r14,%rdi
mov    %ebp,%edx
mov    $0x1,%ecx
call   1040 <command_version_display@plt>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
@.str = [3 x i8] c"-o\00"
@.str.1 = [4 x i8] c"-ol\00"
define i32 @command_version(i8* nocapture readnone %0, %struct.t_gui_buffer* %1, i32 %2, i8** nocapture %3, i8** nocapture readnone %4) {
%6 = icmp sgt i32 %2, 1
br i1 %6, label %7, label %17
7: ; preds = %5
%8 = getelementptr inbounds i8*, i8** %3, i64 1
%9 = load i8*, i8** %8
%10 = tail call i64 @string_strcasecmp(i8* %9, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i64 %10, 0
br i1 %11, label %17, label %12
12: ; preds = %7
%13 = load i8*, i8** %8
%14 = tail call i64 @string_strcasecmp(i8* %13, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
br label %17
17: ; preds = %12, %7, %5
%18 = phi i32 [ 0, %5 ], [ 1, %7 ], [ %16, %12 ]
%19 = phi i32 [ 0, %5 ], [ 0, %7 ], [ %16, %12 ]
%20 = tail call i32 @command_version_display(%struct.t_gui_buffer* %1, i32 %18, i32 %19, i32 1)
ret i32 0
}