#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);
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;
  (void)data;
  (void)argv_eol;
  send_to_buffer_as_input =
      ((argc >= 2) && (string_strcasecmp(argv[1], "-o") == 0));
  command_version_display(buffer, send_to_buffer_as_input);
  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)
xor    %eax,%eax
cmpl   $0x2,-0x14(%rbp)
mov    %al,-0x2d(%rbp)
jl     1168 <command_version+0x48>
mov    -0x20(%rbp),%rax
mov    0x8(%rax),%rdi
lea    0xea7(%rip),%rsi
call   1030 <string_strcasecmp@plt>
cmp    $0x0,%rax
sete   %al
mov    %al,-0x2d(%rbp)
mov    -0x2d(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%esi
call   1040 <command_version_display@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<command_version>:
push   %rbx
mov    %rsi,%rbx
xor    %esi,%esi
cmp    $0x2,%edx
jl     1144 <command_version+0x24>
mov    0x8(%rcx),%rdi
lea    0xeca(%rip),%rsi
call   1030 <string_strcasecmp@plt>
xor    %esi,%esi
test   %rax,%rax
sete   %sil
mov    %rbx,%rdi
call   1040 <command_version_display@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.t_gui_buffer = type { i32 }
@.str = [3 x i8] c"-o\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
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
%12 = load i8*, i8** %6
%13 = load i8**, i8*** %10
%14 = load i32, i32* %8
%15 = icmp sge i32 %14, 2
br i1 %15, label %16, label %22
16: ; preds = %5
%17 = load i8**, i8*** %9
%18 = getelementptr inbounds i8*, i8** %17, i64 1
%19 = load i8*, i8** %18
%20 = call i64 @string_strcasecmp(i8* %19, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%21 = icmp eq i64 %20, 0
br label %22
22: ; preds = %16, %5
%23 = phi i1 [ false, %5 ], [ %21, %16 ]
%24 = zext i1 %23 to i32
store i32 %24, i32* %11
%25 = load %struct.t_gui_buffer*, %struct.t_gui_buffer** %7
%26 = load i32, i32* %11
%27 = call i32 @command_version_display(%struct.t_gui_buffer* %25, i32 %26)
ret i32 0
}

LLVM IR (-O2):
%struct.t_gui_buffer = type { i32 }
@.str = [3 x i8] c"-o\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 %13
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
%12 = zext i1 %11 to i32
br label %13
13: ; preds = %7, %5
%14 = phi i32 [ 0, %5 ], [ %12, %7 ]
%15 = tail call i32 @command_version_display(%struct.t_gui_buffer* %1, i32 %14)
ret i32 0
}