#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*/ fillDPtable(unsigned long *, char const *, unsigned long,
                               char const *, unsigned long);
int /*<<< orphan*/ gt_free_mem(unsigned long *, char *, int);
unsigned long *gt_malloc_mem(int, char *, int);
unsigned long gt_calc_linearedist(const char *u, unsigned long n, const char *v,
                                  unsigned long m) {
  unsigned long *dptable, edist;
  dptable = gt_malloc_mem(
      sizeof(unsigned long) * ((((n) < (m)) ? (n) : (m)) + 1),
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/bioh4x/NeatFreq/refs/heads/master/lib/"
      "genometools-1.4.1/src/extended/linearedist.c",
      48);
  fillDPtable(dptable, n <= m ? u : v, (((n) < (m)) ? (n) : (m)),
              n <= m ? v : u, (((n) > (m)) ? (n) : (m)));
  edist = dptable[(((n) < (m)) ? (n) : (m))];
  gt_free_mem(dptable,
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bioh4x/NeatFreq/refs/heads/master/lib/"
              "genometools-1.4.1/src/extended/linearedist.c",
              51);
  return edist;
}


x86 assembly (clang, -O0):
<gt_calc_linearedist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    1166 <gt_calc_linearedist+0x36>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
jmp    116e <gt_calc_linearedist+0x3e>
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
add    $0x1,%rax
shl    $0x3,%rax
mov    %eax,%edi
lea    0xe7d(%rip),%rsi
mov    $0x30,%edx
call   1030 <gt_malloc_mem@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     11b4 <gt_calc_linearedist+0x84>
mov    -0x8(%rbp),%rax
mov    %rax,-0x48(%rbp)
jmp    11bc <gt_calc_linearedist+0x8c>
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    11df <gt_calc_linearedist+0xaf>
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
jmp    11e7 <gt_calc_linearedist+0xb7>
mov    -0x20(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
ja     120a <gt_calc_linearedist+0xda>
mov    -0x18(%rbp),%rax
mov    %rax,-0x68(%rbp)
jmp    1212 <gt_calc_linearedist+0xe2>
mov    -0x8(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x68(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jbe    1235 <gt_calc_linearedist+0x105>
mov    -0x10(%rbp),%rax
mov    %rax,-0x78(%rbp)
jmp    123d <gt_calc_linearedist+0x10d>
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x70(%rbp),%rcx
mov    -0x60(%rbp),%rdx
mov    -0x50(%rbp),%rsi
mov    -0x40(%rbp),%rdi
mov    -0x78(%rbp),%r8
call   1050 <fillDPtable@plt>
mov    -0x28(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x20(%rbp),%rax
jae    127c <gt_calc_linearedist+0x14c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x88(%rbp)
jmp    1287 <gt_calc_linearedist+0x157>
mov    -0x20(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x80(%rbp),%rax
mov    -0x88(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xd5b(%rip),%rsi
mov    $0x33,%edx
call   1040 <gt_free_mem@plt>
mov    -0x30(%rbp),%rax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gt_calc_linearedist>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
cmp    %rcx,%rsi
mov    %rcx,%rbx
cmovb  %rsi,%rbx
lea    0x8(,%rbx,8),%eax
mov    %rdi,%r12
cmova  %rdx,%r12
lea    0xea0(%rip),%r13
cmova  %rdi,%r14
cmova  %rsi,%r15
mov    %eax,%edi
mov    %r13,%rsi
mov    $0x30,%edx
call   1030 <gt_malloc_mem@plt>
mov    %rax,%rbp
mov    %rax,%rdi
mov    %r12,%rsi
mov    %rbx,%rdx
mov    %r14,%rcx
mov    %r15,%r8
call   1050 <fillDPtable@plt>
mov    0x0(%rbp,%rbx,8),%rbx
mov    %rbp,%rdi
mov    %r13,%rsi
mov    $0x33,%edx
call   1040 <gt_free_mem@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bioh4x/NeatFreq/refs/heads/master/lib/genometools-1.4.1/src/extended/linearedist.c\00"
define i64 @gt_calc_linearedist(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64*
%10 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%11 = load i64, i64* %6
%12 = load i64, i64* %8
%13 = icmp ult i64 %11, %12
br i1 %13, label %14, label %16
14: ; preds = %4
%15 = load i64, i64* %6
br label %18
16: ; preds = %4
%17 = load i64, i64* %8
br label %18
18: ; preds = %16, %14
%19 = phi i64 [ %15, %14 ], [ %17, %16 ]
%20 = add i64 %19, 1
%21 = mul i64 8, %20
%22 = trunc i64 %21 to i32
%23 = call i64* @gt_malloc_mem(i32 %22, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 48)
store i64* %23, i64** %9
%24 = load i64*, i64** %9
%25 = load i64, i64* %6
%26 = load i64, i64* %8
%27 = icmp ule i64 %25, %26
br i1 %27, label %28, label %30
28: ; preds = %18
%29 = load i8*, i8** %5
br label %32
30: ; preds = %18
%31 = load i8*, i8** %7
br label %32
32: ; preds = %30, %28
%33 = phi i8* [ %29, %28 ], [ %31, %30 ]
%34 = load i64, i64* %6
%35 = load i64, i64* %8
%36 = icmp ult i64 %34, %35
br i1 %36, label %37, label %39
37: ; preds = %32
%38 = load i64, i64* %6
br label %41
39: ; preds = %32
%40 = load i64, i64* %8
br label %41
41: ; preds = %39, %37
%42 = phi i64 [ %38, %37 ], [ %40, %39 ]
%43 = load i64, i64* %6
%44 = load i64, i64* %8
%45 = icmp ule i64 %43, %44
br i1 %45, label %46, label %48
46: ; preds = %41
%47 = load i8*, i8** %7
br label %50
48: ; preds = %41
%49 = load i8*, i8** %5
br label %50
50: ; preds = %48, %46
%51 = phi i8* [ %47, %46 ], [ %49, %48 ]
%52 = load i64, i64* %6
%53 = load i64, i64* %8
%54 = icmp ugt i64 %52, %53
br i1 %54, label %55, label %57
55: ; preds = %50
%56 = load i64, i64* %6
br label %59
57: ; preds = %50
%58 = load i64, i64* %8
br label %59
59: ; preds = %57, %55
%60 = phi i64 [ %56, %55 ], [ %58, %57 ]
%61 = call i32 @fillDPtable(i64* %24, i8* %33, i64 %42, i8* %51, i64 %60)
%62 = load i64*, i64** %9
%63 = load i64, i64* %6
%64 = load i64, i64* %8
%65 = icmp ult i64 %63, %64
br i1 %65, label %66, label %68
66: ; preds = %59
%67 = load i64, i64* %6
br label %70
68: ; preds = %59
%69 = load i64, i64* %8
br label %70
70: ; preds = %68, %66
%71 = phi i64 [ %67, %66 ], [ %69, %68 ]
%72 = getelementptr inbounds i64, i64* %62, i64 %71
%73 = load i64, i64* %72
store i64 %73, i64* %10
%74 = load i64*, i64** %9
%75 = call i32 @gt_free_mem(i64* %74, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 51)
%76 = load i64, i64* %10
ret i64 %76
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bioh4x/NeatFreq/refs/heads/master/lib/genometools-1.4.1/src/extended/linearedist.c\00"
define i64 @gt_calc_linearedist(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = icmp ult i64 %1, %3
%6 = select i1 %5, i64 %1, i64 %3
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 3
%9 = add i32 %8, 8
%10 = tail call i64* @gt_malloc_mem(i32 %9, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 48)
%11 = icmp ugt i64 %1, %3
%12 = select i1 %11, i8* %2, i8* %0
%13 = select i1 %11, i8* %0, i8* %2
%14 = select i1 %11, i64 %1, i64 %3
%15 = tail call i32 @fillDPtable(i64* %10, i8* %12, i64 %6, i8* %13, i64 %14)
%16 = getelementptr inbounds i64, i64* %10, i64 %6
%17 = load i64, i64* %16
%18 = tail call i32 @gt_free_mem(i64* %10, i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 51)
ret i64 %17
}