#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 */
long long find_seq_in_hash(char *, char *);
int mystrcmp(char *, char *);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  if (argc != 3) {
    printf("Usage %s fbin_index_file seq_name\n\n", argv[0]);
    return -1;
  }
  int c1 = mystrcmp("SRR314795.1", "SRR314795.1000000");
  int c2 = mystrcmp("SRR314795.1000000", "SRR314795.9");
  printf("RES: %d,%d\n", c1, c2);
  long long chunk = find_seq_in_hash(argv[1], argv[2]);
  printf("Chunk: %lld\n", chunk);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     1171 <main+0x41>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    11dc <main+0xac>
lea    0xeac(%rip),%rdi
lea    0xeb1(%rip),%rsi
call   1030 <mystrcmp@plt>
mov    %eax,-0x14(%rbp)
lea    0xea2(%rip),%rdi
lea    0xead(%rip),%rsi
call   1030 <mystrcmp@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%esi
mov    -0x18(%rbp),%edx
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1050 <find_seq_in_hash@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rsi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
cmp    $0x3,%edi
jne    1199 <main+0x69>
lea    0xee1(%rip),%rdi
lea    0xee6(%rip),%rbp
mov    %rbp,%rsi
call   1030 <mystrcmp@plt>
mov    %eax,%r14d
lea    0xee6(%rip),%rsi
mov    %rbp,%rdi
call   1030 <mystrcmp@plt>
lea    0xee3(%rip),%rdi
xor    %ebp,%ebp
mov    %r14d,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x8(%rbx),%rdi
mov    0x10(%rbx),%rsi
call   1050 <find_seq_in_hash@plt>
lea    0xecd(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11af <main+0x7f>
mov    (%rbx),%rsi
lea    0xe5d(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0xffffffff,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [36 x i8] c"Usage %s fbin_index_file seq_name\0A\0A\00"
@.str.1 = [12 x i8] c"SRR314795.1\00"
@.str.2 = [18 x i8] c"SRR314795.1000000\00"
@.str.3 = [12 x i8] c"SRR314795.9\00"
@.str.4 = [12 x i8] c"RES: %d,%d\0A\00"
@.str.5 = [13 x i8] c"Chunk: %lld\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp ne i32 %9, 3
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i8**, i8*** %5
%13 = getelementptr inbounds i8*, i8** %12, i64 0
%14 = load i8*, i8** %13
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %14)
store i32 -1, i32* %3
br label %31
16: ; preds = %2
%17 = call i32 @mystrcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
store i32 %17, i32* %6
%18 = call i32 @mystrcmp(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
store i32 %18, i32* %7
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %19, i32 %20)
%22 = load i8**, i8*** %5
%23 = getelementptr inbounds i8*, i8** %22, i64 1
%24 = load i8*, i8** %23
%25 = load i8**, i8*** %5
%26 = getelementptr inbounds i8*, i8** %25, i64 2
%27 = load i8*, i8** %26
%28 = call i64 @find_seq_in_hash(i8* %24, i8* %27)
store i64 %28, i64* %8
%29 = load i64, i64* %8
%30 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i64 %29)
br label %31
31: ; preds = %16, %11
%32 = load i32, i32* %3
ret i32 %32
}

LLVM IR (-O2):
@.str = [36 x i8] c"Usage %s fbin_index_file seq_name\0A\0A\00"
@.str.1 = [12 x i8] c"SRR314795.1\00"
@.str.2 = [18 x i8] c"SRR314795.1000000\00"
@.str.3 = [12 x i8] c"SRR314795.9\00"
@.str.4 = [12 x i8] c"RES: %d,%d\0A\00"
@.str.5 = [13 x i8] c"Chunk: %lld\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 3
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %5)
br label %17
7: ; preds = %2
%8 = tail call i32 @mystrcmp(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0))
%9 = tail call i32 @mystrcmp(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0))
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0), i32 %8, i32 %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8*, i8** %1, i64 2
%14 = load i8*, i8** %13
%15 = tail call i64 @find_seq_in_hash(i8* %12, i8* %14)
%16 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0), i64 %15)
br label %17
17: ; preds = %7, %4
%18 = phi i32 [ -1, %4 ], [ 0, %7 ]
ret i32 %18
}