#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(const void *pointer, void *data,
                    struct t_gui_buffer *buffer, int argc, char **argv,
                    char **argv_eol) {
  int send_to_buffer_as_input, translated_string;
  (void)pointer;
  (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    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
movl   $0x0,-0x38(%rbp)
cmpl   $0x2,-0x1c(%rbp)
jl     11b7 <command_version+0x97>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe9a(%rip),%rsi
call   1030 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    1181 <command_version+0x61>
movl   $0x1,-0x34(%rbp)
jmp    11b2 <command_version+0x92>
mov    -0x28(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xe73(%rip),%rsi
call   1030 <string_strcasecmp@plt>
cmp    $0x0,%rax
jne    11ad <command_version+0x8d>
movl   $0x1,-0x34(%rbp)
movl   $0x1,-0x38(%rbp)
jmp    11b2 <command_version+0x92>
jmp    11b7 <command_version+0x97>
mov    -0x18(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    -0x38(%rbp),%edx
mov    $0x1,%ecx
call   1040 <command_version_display@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_version>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
xor    %ebp,%ebp
cmp    $0x2,%ecx
jl     1163 <command_version+0x43>
mov    %r8,%rbx
mov    0x8(%r8),%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, i8* %1, %struct.t_gui_buffer* %2, i32 %3, i8** %4, i8** %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.t_gui_buffer*
%10 = alloca i32
%11 = alloca i8**
%12 = alloca i8**
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store %struct.t_gui_buffer* %2, %struct.t_gui_buffer** %9
store i32 %3, i32* %10
store i8** %4, i8*** %11
store i8** %5, i8*** %12
%15 = load i8*, i8** %7
%16 = load i8*, i8** %8
%17 = load i8**, i8*** %12
store i32 0, i32* %13
store i32 0, i32* %14
%18 = load i32, i32* %10
%19 = icmp sge i32 %18, 2
br i1 %19, label %20, label %36
20: ; preds = %6
%21 = load i8**, i8*** %11
%22 = getelementptr inbounds i8*, i8** %21, i64 1
%23 = load i8*, i8** %22
%24 = call i64 @string_strcasecmp(i8* %23, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %20
store i32 1, i32* %13
br label %35
27: ; preds = %20
%28 = load i8**, i8*** %11
%29 = getelementptr inbounds i8*, i8** %28, i64 1
%30 = load i8*, i8** %29
%31 = call i64 @string_strcasecmp(i8* %30, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp eq i64 %31, 0
br i1 %32, label %33, label %34
33: ; preds = %27
store i32 1, i32* %13
store i32 1, i32* %14
br label %34
34: ; preds = %33, %27
br label %35
35: ; preds = %34, %26
br label %36
36: ; preds = %35, %6
%37 = load %struct.t_gui_buffer*, %struct.t_gui_buffer** %9
%38 = load i32, i32* %13
%39 = load i32, i32* %14
%40 = call i32 @command_version_display(%struct.t_gui_buffer* %37, i32 %38, i32 %39, 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, i8* nocapture readnone %1, %struct.t_gui_buffer* %2, i32 %3, i8** nocapture %4, i8** nocapture readnone %5) {
%7 = icmp sgt i32 %3, 1
br i1 %7, label %8, label %18
8: ; preds = %6
%9 = getelementptr inbounds i8*, i8** %4, i64 1
%10 = load i8*, i8** %9
%11 = tail call i64 @string_strcasecmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%12 = icmp eq i64 %11, 0
br i1 %12, label %18, label %13
13: ; preds = %8
%14 = load i8*, i8** %9
%15 = tail call i64 @string_strcasecmp(i8* %14, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%16 = icmp eq i64 %15, 0
%17 = zext i1 %16 to i32
br label %18
18: ; preds = %13, %8, %6
%19 = phi i32 [ 0, %6 ], [ 1, %8 ], [ %17, %13 ]
%20 = phi i32 [ 0, %6 ], [ 0, %8 ], [ %17, %13 ]
%21 = tail call i32 @command_version_display(%struct.t_gui_buffer* %2, i32 %19, i32 %20, i32 1)
ret i32 0
}