#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*/ computeRelevanceProbabilities();
int /*<<< orphan*/ med(char *, char *, char *);
int /*<<< orphan*/ setProgramName(char *);
int /*<<< orphan*/ usage();
int main(int argc, char **argv) {
  char *run1, *run2, *qrels = (char *)0;
  setProgramName(argv[0]);
  if (argc == 3 || argc == 4) {
    run1 = argv[1];
    run2 = argv[2];
    if (argc == 4)
      qrels = argv[3];
  } else
    usage();
  computeRelevanceProbabilities();
  med(run1, run2, qrels);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rdi
call   1040 <setProgramName@plt>
cmpl   $0x3,-0x8(%rbp)
je     117e <main+0x3e>
cmpl   $0x4,-0x8(%rbp)
jne    11b1 <main+0x71>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x20(%rbp)
cmpl   $0x4,-0x8(%rbp)
jne    11ac <main+0x6c>
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x28(%rbp)
jmp    11b8 <main+0x78>
mov    $0x0,%al
call   1050 <usage@plt>
mov    $0x0,%al
call   1030 <computeRelevanceProbabilities@plt>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1060 <med@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%r12d
mov    (%rsi),%rdi
call   1040 <setProgramName@plt>
lea    -0x3(%r12),%eax
cmp    $0x1,%eax
ja     1174 <main+0x34>
mov    0x8(%rbx),%r14
mov    0x10(%rbx),%r15
cmp    $0x4,%r12d
jne    117f <main+0x3f>
mov    0x18(%rbx),%rbx
jmp    1181 <main+0x41>
xor    %ebx,%ebx
xor    %eax,%eax
call   1050 <usage@plt>
jmp    1181 <main+0x41>
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <computeRelevanceProbabilities@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1060 <med@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %8
%9 = load i8**, i8*** %5
%10 = getelementptr inbounds i8*, i8** %9, i64 0
%11 = load i8*, i8** %10
%12 = call i32 @setProgramName(i8* %11)
%13 = load i32, i32* %4
%14 = icmp eq i32 %13, 3
br i1 %14, label %18, label %15
15: ; preds = %2
%16 = load i32, i32* %4
%17 = icmp eq i32 %16, 4
br i1 %17, label %18, label %32
18: ; preds = %15, %2
%19 = load i8**, i8*** %5
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
store i8* %21, i8** %6
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
store i8* %24, i8** %7
%25 = load i32, i32* %4
%26 = icmp eq i32 %25, 4
br i1 %26, label %27, label %31
27: ; preds = %18
%28 = load i8**, i8*** %5
%29 = getelementptr inbounds i8*, i8** %28, i64 3
%30 = load i8*, i8** %29
store i8* %30, i8** %8
br label %31
31: ; preds = %27, %18
br label %34
32: ; preds = %15
%33 = call i32 (...) @usage()
br label %34
34: ; preds = %32, %31
%35 = call i32 (...) @computeRelevanceProbabilities()
%36 = load i8*, i8** %6
%37 = load i8*, i8** %7
%38 = load i8*, i8** %8
%39 = call i32 @med(i8* %36, i8* %37, i8* %38)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i32 @setProgramName(i8* %3)
%5 = add i32 %0, -3
%6 = icmp ult i32 %5, 2
br i1 %6, label %7, label %16
7: ; preds = %2
%8 = icmp eq i32 %0, 4
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = getelementptr inbounds i8*, i8** %1, i64 2
%12 = load i8*, i8** %11
br i1 %8, label %13, label %18
13: ; preds = %7
%14 = getelementptr inbounds i8*, i8** %1, i64 3
%15 = load i8*, i8** %14
br label %18
16: ; preds = %2
%17 = tail call i32 (...) @usage()
br label %18
18: ; preds = %7, %13, %16
%19 = phi i8* [ %10, %13 ], [ %10, %7 ], [ undef, %16 ]
%20 = phi i8* [ %12, %13 ], [ %12, %7 ], [ undef, %16 ]
%21 = phi i8* [ %15, %13 ], [ null, %7 ], [ null, %16 ]
%22 = tail call i32 (...) @computeRelevanceProbabilities()
%23 = tail call i32 @med(i8* %19, i8* %20, i8* %21)
ret i32 0
}