#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*/ puts(char *);
scalar_t__ version_compare(char *, char *);
int print_o_results(void *dummy, int field_count, char **row, char **fields) {
  (void)dummy;
  (void)field_count;
  (void)fields;
  if (row[1] == NULL || row[1][0] == '\0') {
    puts("0");
  } else if (version_compare(row[0], row[1]) >= 0) {
    puts("1");
  } else {
    puts("0");
  }
  return 0;
}


x86 assembly (clang, -O0):
<print_o_results>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x18(%rbp),%rax
cmpq   $0x0,0x8(%rax)
je     115a <print_o_results+0x3a>
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    116b <print_o_results+0x4b>
lea    0xe9f(%rip),%rdi
call   1030 <puts@plt>
jmp    11ab <print_o_results+0x8b>
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <version_compare@plt>
cmp    $0x0,%rax
jl     119a <print_o_results+0x7a>
lea    0xe72(%rip),%rdi
call   1030 <puts@plt>
jmp    11a6 <print_o_results+0x86>
lea    0xe5f(%rip),%rdi
call   1030 <puts@plt>
jmp    11ab <print_o_results+0x8b>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_o_results>:
push   %rax
mov    0x8(%rdx),%rsi
lea    0xed4(%rip),%rdi
test   %rsi,%rsi
je     1153 <print_o_results+0x33>
cmpb   $0x0,(%rsi)
je     1153 <print_o_results+0x33>
mov    (%rdx),%rdi
call   1040 <version_compare@plt>
test   %rax,%rax
lea    0xeba(%rip),%rax
lea    0xeb1(%rip),%rdi
cmovns %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c"0\00"
@.str.1 = [2 x i8] c"1\00"
define i32 @print_o_results(i8* nocapture readnone %0, i32 %1, i8** nocapture %2, i8** nocapture readnone %3) {
%5 = getelementptr inbounds i8*, i8** %2, i64 1
%6 = load i8*, i8** %5
%7 = icmp eq i8* %6, null
br i1 %7, label %16, label %8
8: ; preds = %4
%9 = load i8, i8* %6
%10 = icmp eq i8 %9, 0
br i1 %10, label %16, label %11
11: ; preds = %8
%12 = load i8*, i8** %2
%13 = tail call i64 @version_compare(i8* %12, i8* %6)
%14 = icmp sgt i64 %13, -1
%15 = select i1 %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0)
br label %16
16: ; preds = %11, %4, %8
%17 = phi i8* [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %8 ], [ getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0), %4 ], [ %15, %11 ]
%18 = tail call i32 @puts(i8* dereferenceable(1) %17)
ret i32 0
}