xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void free_ucvector(unsigned char *v, int nl, int nh) { free((void *)(v + nl)); }


x86 assembly (clang, -O0):
<free_ucvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_ucvector>:
movslq %esi,%rax
add    %rax,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_ucvector(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8*, i8** %4
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @free(i8* %10)
ret void
}

LLVM IR (-O2):
define void @free_ucvector(i8* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = tail call i32 @free(i8* %5)
ret void
}
int longitud_string(char *s) {
  int i;
  i = 0;
  while (*s != '\0') {
    i++;
    s = s + 1;
  }
  return i;
}


x86 assembly (clang, -O0):
<longitud_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1139 <longitud_string+0x39>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <longitud_string+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<longitud_string>:
cmpb   $0x0,(%rdi)
je     111c <longitud_string+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <longitud_string+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @longitud_string(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %14
9: ; preds = %4
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
%12 = load i8*, i8** %2
%13 = getelementptr inbounds i8, i8* %12, i64 1
store i8* %13, i8** %2
br label %4
14: ; preds = %4
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @longitud_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int comp(const void *pp1, const void *pp2) {
  int *p1 = *(int **)pp1, *p2 = *(int **)pp2;
  if (p1[0] == p2[0])
    return p1[1] - p2[1];
  return p1[0] - p2[0];
}


x86 assembly (clang, -O0):
<comp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
cmp    (%rcx),%eax
jne    114a <comp+0x4a>
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%eax
mov    -0x28(%rbp),%rcx
sub    0x4(%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1159 <comp+0x59>
mov    -0x20(%rbp),%rax
mov    (%rax),%eax
mov    -0x28(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp>:
mov    (%rdi),%rdx
mov    (%rsi),%rcx
mov    (%rdx),%eax
sub    (%rcx),%eax
jne    1112 <comp+0x12>
mov    0x4(%rdx),%eax
sub    0x4(%rcx),%eax
ret

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

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = bitcast i8* %1 to i32**
%6 = load i32*, i32** %5
%7 = load i32, i32* %4
%8 = load i32, i32* %6
%9 = icmp eq i32 %7, %8
br i1 %9, label %10, label %16
10: ; preds = %2
%11 = getelementptr inbounds i32, i32* %4, i64 1
%12 = load i32, i32* %11
%13 = getelementptr inbounds i32, i32* %6, i64 1
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
br label %18
16: ; preds = %2
%17 = sub nsw i32 %7, %8
br label %18
18: ; preds = %16, %10
%19 = phi i32 [ %15, %10 ], [ %17, %16 ]
ret i32 %19
}
long fact(int n) {
  if (n <= 1)
    return 1;
  else
    return n * fact(n - 1);
}


x86 assembly (clang, -O0):
<fact>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jg     1132 <fact+0x22>
movq   $0x1,-0x8(%rbp)
jmp    1154 <fact+0x44>
movslq -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
sub    $0x1,%edi
call   1030 <fact@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
imul   %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fact>:
mov    $0x1,%eax
cmp    $0x2,%edi
jl     1131 <fact+0x31>
mov    %edi,%ecx
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
imul   %rcx,%rax
lea    -0x1(%rcx),%rdx
cmp    $0x2,%rcx
mov    %rdx,%rcx
ja     1120 <fact+0x20>
ret

LLVM IR (-O0):
define i64 @fact(i32 %0) {
%2 = alloca i64
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 1
br i1 %5, label %6, label %7
6: ; preds = %1
store i64 1, i64* %2
br label %14
7: ; preds = %1
%8 = load i32, i32* %3
%9 = sext i32 %8 to i64
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 1
%12 = call i64 @fact(i32 %11)
%13 = mul nsw i64 %9, %12
store i64 %13, i64* %2
br label %14
14: ; preds = %7, %6
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @fact(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = zext i32 %0 to i64
br label %5
5: ; preds = %3, %5
%6 = phi i64 [ %4, %3 ], [ %8, %5 ]
%7 = phi i64 [ 1, %3 ], [ %9, %5 ]
%8 = add nsw i64 %6, -1
%9 = mul nsw i64 %7, %6
%10 = icmp ult i64 %6, 3
br i1 %10, label %11, label %5
11: ; preds = %5, %1
%12 = phi i64 [ 1, %1 ], [ %9, %5 ]
ret i64 %12
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void handle_unsupported_method(int sock_fd, char *buf) {
  sprintf(buf,
          "HTTP/1.1 405 Method Not Allowed\nServer: "
          "grocery/%d.0\n\nConnection: close\nAllow: GET, HEAD\n\n",
          1);
  write(sock_fd, buf, strlen(buf));
  exit(0);
}


x86 assembly (clang, -O0):
<handle_unsupported_method>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xea6(%rip),%rsi
mov    $0x1,%edx
call   1050 <sprintf@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1c(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1060 <exit@plt>

x86 assembly (clang, -O2):
<handle_unsupported_method>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %edi,%ebp
lea    0xeb1(%rip),%rsi
mov    %rbx,%rdi
mov    $0x1,%edx
call   1050 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
xor    %edi,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [91 x i8] c"HTTP/1.1 405 Method Not Allowed\0AServer: grocery/%d.0\0A\0AConnection: close\0AAllow: GET, HEAD\0A\0A\00"
define void @handle_unsupported_method(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i32 @sprintf(i8* %5, i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 1)
%7 = load i32, i32* %3
%8 = load i8*, i8** %4
%9 = load i8*, i8** %4
%10 = call i32 @strlen(i8* %9)
%11 = call i32 @write(i32 %7, i8* %8, i32 %10)
%12 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [91 x i8] c"HTTP/1.1 405 Method Not Allowed\0AServer: grocery/%d.0\0A\0AConnection: close\0AAllow: GET, HEAD\0A\0A\00"
define void @handle_unsupported_method(i32 %0, i8* %1) {
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %1, i8* dereferenceable(1) getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0), i32 1)
%4 = tail call i32 @strlen(i8* %1)
%5 = tail call i32 @write(i32 %0, i8* %1, i32 %4)
%6 = tail call i32 @exit(i32 0)
unreachable
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ window;
};
typedef TYPE_1__ XKeyEvent;

/* Variables and functions */
unsigned long get_XKeyEvent_window(void *_p) {
  return (unsigned long)((XKeyEvent *)_p)->window;
}


x86 assembly (clang, -O0):
<get_XKeyEvent_window>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_XKeyEvent_window>:
mov    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i64 @get_XKeyEvent_window(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
ret i64 %6
}

LLVM IR (-O2):
define i64 @get_XKeyEvent_window(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
unsigned int cmdline_getLogLevel();
bool log_isLevel(unsigned level) { return cmdline_getLogLevel() >= level; }


x86 assembly (clang, -O0):
<log_isLevel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <cmdline_getLogLevel@plt>
cmp    -0x4(%rbp),%eax
setae  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_isLevel>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <cmdline_getLogLevel@plt>
xor    %ecx,%ecx
cmp    %ebx,%eax
setae  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @log_isLevel(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cmdline_getLogLevel()
%4 = load i32, i32* %2
%5 = icmp uge i32 %3, %4
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @log_isLevel(i32 %0) {
%2 = tail call i32 (...) @cmdline_getLogLevel()
%3 = icmp uge i32 %2, %0
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isPRED(const char *tok) { return strcmp(tok, "pred") == 0; }


x86 assembly (clang, -O0):
<isPRED>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPRED>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [5 x i8] c"pred\00"
define i32 @isPRED(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strcmp(i8* %3, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i64 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
@.str = [5 x i8] c"pred\00"
define i32 @isPRED(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void foo733() {}


x86 assembly (clang, -O0):
<foo733>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo733>:
ret

LLVM IR (-O0):
define void @foo733() {
ret void
}

LLVM IR (-O2):
define void @foo733() {
ret void
}
void papi_result_(double *time) {}


x86 assembly (clang, -O0):
<papi_result_>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<papi_result_>:
ret

LLVM IR (-O0):
define void @papi_result_(double* %0) {
%2 = alloca double*
store double* %0, double** %2
ret void
}

LLVM IR (-O2):
define void @papi_result_(double* nocapture %0) {
ret void
}
void smdiff_destroy(struct smdiff *diff __attribute__((unused))) {}


x86 assembly (clang, -O0):
<smdiff_destroy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<smdiff_destroy>:
ret

LLVM IR (-O0):
%struct.smdiff = type opaque
define void @smdiff_destroy(%struct.smdiff* %0) {
%2 = alloca %struct.smdiff*
store %struct.smdiff* %0, %struct.smdiff** %2
ret void
}

LLVM IR (-O2):
%struct.smdiff = type opaque
define void @smdiff_destroy(%struct.smdiff* nocapture %0) {
ret void
}
void readBegin() {}


x86 assembly (clang, -O0):
<readBegin>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<readBegin>:
ret

LLVM IR (-O0):
define void @readBegin() {
ret void
}

LLVM IR (-O2):
define void @readBegin() {
ret void
}
/* Variables and functions */
int mus_format2bytes(int);
int mus_samples2bytes(int format, int size) {
  return (size * (mus_format2bytes(format)));
}


x86 assembly (clang, -O0):
<mus_samples2bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <mus_format2bytes@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
imul   %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_samples2bytes>:
push   %rbx
mov    %esi,%ebx
call   1030 <mus_format2bytes@plt>
imul   %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @mus_samples2bytes(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = load i32, i32* %3
%7 = call i32 @mus_format2bytes(i32 %6)
%8 = mul nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @mus_samples2bytes(i32 %0, i32 %1) {
%3 = tail call i32 @mus_format2bytes(i32 %0)
%4 = mul nsw i32 %3, %1
ret i32 %4
}
void EC_KEY_get_conv_form(void) {}


x86 assembly (clang, -O0):
<EC_KEY_get_conv_form>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<EC_KEY_get_conv_form>:
ret

LLVM IR (-O0):
define void @EC_KEY_get_conv_form() {
ret void
}

LLVM IR (-O2):
define void @EC_KEY_get_conv_form() {
ret void
}
void req_equalizer_refresh() {
  equalizer_refresh();
  status_msg("Equalizer refreshed");
  internal_logit(
      "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
      "2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/server.c",
      1305, __FUNCTION__, "Equalizer refreshed");
}


x86 assembly (clang, -O0):
<req_equalizer_refresh>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <equalizer_refresh@plt>
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1050 <status_msg@plt>
lea    0xec4(%rip),%rdi
mov    $0x519,%esi
lea    0xf40(%rip),%rdx
lea    0xe9d(%rip),%rcx
mov    $0x0,%al
call   1040 <internal_logit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_equalizer_refresh>:
push   %rbx
xor    %eax,%eax
call   1030 <equalizer_refresh@plt>
lea    0xec1(%rip),%rbx
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <status_msg@plt>
lea    0xec4(%rip),%rdi
lea    0xf45(%rip),%rdx
mov    $0x519,%esi
mov    %rbx,%rcx
xor    %eax,%eax
pop    %rbx
jmp    1040 <internal_logit@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"Equalizer refreshed\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/server.c\00"
@__FUNCTION__.req_equalizer_refresh = [22 x i8] c"req_equalizer_refresh\00"
define void @req_equalizer_refresh() {
%1 = call i32 (...) @equalizer_refresh()
%2 = call i32 (i8*, ...) bitcast (i32 (...)* @status_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 1305, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.req_equalizer_refresh, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"Equalizer refreshed\00"
@.str.1 = [136 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/christophgysin/moc/refs/heads/lyrics/server.c\00"
@__FUNCTION__.req_equalizer_refresh = [22 x i8] c"req_equalizer_refresh\00"
define void @req_equalizer_refresh() {
%1 = tail call i32 (...) @equalizer_refresh()
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @status_msg to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, i32, i8*, i8*, ...) bitcast (i32 (...)* @internal_logit to i32 (i8*, i32, i8*, i8*, ...)*)(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str.1, i64 0, i64 0), i32 1305, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @__FUNCTION__.req_equalizer_refresh, i64 0, i64 0), i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef scalar_t__ uint32_t;
typedef int /*<<< orphan*/ int8_t;

/* Variables and functions */
int8_t
ert_comm_protocol_stream_calculate_sequence_number_distance(uint32_t sn1,
                                                            uint32_t sn2) {
  uint8_t unsigned_distance = (uint8_t)sn1 - (uint8_t)sn2;
  return (int8_t)unsigned_distance;
}


x86 assembly (clang, -O0):
<ert_comm_protocol_stream_calculate_sequence_number_distance>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ert_comm_protocol_stream_calculate_sequence_number_distance>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @ert_comm_protocol_stream_calculate_sequence_number_distance(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %3
%7 = load i64, i64* %4
%8 = sub nsw i64 %6, %7
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = trunc i64 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ert_comm_protocol_stream_calculate_sequence_number_distance(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ bubbles(int *, int);
int main() {
  int n[10] = {7, 20, 1, 18, 9, 15, 24, 10, 3, 12};
  bubbles(n, 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xec6(%rip),%rsi
mov    $0x28,%edx
call   1030 <memcpy@plt>
lea    -0x30(%rbp),%rdi
mov    $0xa,%esi
call   1040 <bubbles@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xf05(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xecd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0xa,%esi
call   1030 <bubbles@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.n = [10 x i32] [i32 7, i32 20, i32 1, i32 18, i32 9, i32 15, i32 24, i32 10, i32 3, i32 12]
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @bubbles(i32* %4, i32 10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.n = [10 x i32] [i32 7, i32 20, i32 1, i32 18, i32 9, i32 15, i32 24, i32 10, i32 3, i32 12]
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @bubbles(i32* %3, i32 10)
ret i32 0
}
/* Variables and functions */
void *os_zalloc(size_t);
void *os_calloc(size_t nmemb, size_t size) {
  if (size && nmemb > (~(size_t)0) / size)
    return NULL;
  return os_zalloc(nmemb * size);
}


x86 assembly (clang, -O0):
<os_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     115f <os_calloc+0x4f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x18(%rbp)
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
cmp    %rcx,%rax
jbe    115f <os_calloc+0x4f>
movq   $0x0,-0x8(%rbp)
jmp    1171 <os_calloc+0x61>
mov    -0x10(%rbp),%rdi
imul   -0x18(%rbp),%rdi
call   1030 <os_zalloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<os_calloc>:
test   %rsi,%rsi
je     1120 <os_calloc+0x10>
mov    %rsi,%rax
mul    %rdi
jno    1120 <os_calloc+0x10>
xor    %eax,%eax
ret
imul   %rdi,%rsi
mov    %rsi,%rdi
jmp    1030 <os_zalloc@plt>

LLVM IR (-O0):
define i8* @os_calloc(i64 %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
%6 = load i64, i64* %5
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = load i64, i64* %4
%10 = load i64, i64* %5
%11 = udiv i64 -1, %10
%12 = icmp ugt i64 %9, %11
br i1 %12, label %13, label %14
13: ; preds = %8
store i8* null, i8** %3
br label %19
14: ; preds = %8, %2
%15 = load i64, i64* %4
%16 = load i64, i64* %5
%17 = mul i64 %15, %16
%18 = call i8* @os_zalloc(i64 %17)
store i8* %18, i8** %3
br label %19
19: ; preds = %14, %13
%20 = load i8*, i8** %3
ret i8* %20
}

LLVM IR (-O2):
define i8* @os_calloc(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %1, i64 %0)
%6 = extractvalue { i64, i1 } %5, 1
br i1 %6, label %10, label %7
7: ; preds = %4, %2
%8 = mul i64 %1, %0
%9 = tail call i8* @os_zalloc(i64 %8)
br label %10
10: ; preds = %4, %7
%11 = phi i8* [ %9, %7 ], [ null, %4 ]
ret i8* %11
}
void MNNNReset(void) {}


x86 assembly (clang, -O0):
<MNNNReset>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<MNNNReset>:
ret

LLVM IR (-O0):
define void @MNNNReset() {
ret void
}

LLVM IR (-O2):
define void @MNNNReset() {
ret void
}
int main(void) { return sizeof(long unsigned int); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%eax
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 8
}

LLVM IR (-O2):
define i32 @main() {
ret i32 8
}
void ac_init(void) {}


x86 assembly (clang, -O0):
<ac_init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ac_init>:
ret

LLVM IR (-O0):
define void @ac_init() {
ret void
}

LLVM IR (-O2):
define void @ac_init() {
ret void
}
void macan_target_init(struct macan_ctx *ctx) { (void)ctx; }


x86 assembly (clang, -O0):
<macan_target_init>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<macan_target_init>:
ret

LLVM IR (-O0):
%struct.macan_ctx = type opaque
define void @macan_target_init(%struct.macan_ctx* %0) {
%2 = alloca %struct.macan_ctx*
store %struct.macan_ctx* %0, %struct.macan_ctx** %2
%3 = load %struct.macan_ctx*, %struct.macan_ctx** %2
ret void
}

LLVM IR (-O2):
%struct.macan_ctx = type opaque
define void @macan_target_init(%struct.macan_ctx* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ arr;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int secondary_max(int *, int);
int main() {
  int arr[] = {21, 120, 23, 53, 89, 93, 134, 66};
  int len = sizeof(arr) / sizeof(*arr);
  printf("secondary max = %d\n", secondary_max(arr, len));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec1(%rip),%rax
mov    %rax,-0x18(%rbp)
movl   $0x8,-0x34(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x34(%rbp),%esi
call   1040 <secondary_max@plt>
mov    %eax,%esi
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x8,%esi
call   1040 <secondary_max@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.arr = [8 x i32] [i32 21, i32 120, i32 23, i32 53, i32 89, i32 93, i32 134, i32 66]
@.str = [20 x i8] c"secondary max = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i32]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [8 x i32]* %2 to i8*
store i32 8, i32* %3
%5 = getelementptr inbounds [8 x i32], [8 x i32]* %2, i64 0, i64 0
%6 = load i32, i32* %3
%7 = call i32 @secondary_max(i32* %5, i32 %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@__const.main.arr = [8 x i32] [i32 21, i32 120, i32 23, i32 53, i32 89, i32 93, i32 134, i32 66]
@.str = [20 x i8] c"secondary max = %d\0A\00"
define i32 @main() {
%1 = alloca [8 x i32]
%2 = bitcast [8 x i32]* %1 to i8*
%3 = getelementptr inbounds [8 x i32], [8 x i32]* %1, i64 0, i64 0
%4 = call i32 @secondary_max(i32* %3, i32 8)
%5 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void init(void) { return; }


x86 assembly (clang, -O0):
<init>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<init>:
ret

LLVM IR (-O0):
define void @init() {
ret void
}

LLVM IR (-O2):
define void @init() {
ret void
}
void test_two(int x, int y) {
#pragma omp target
#pragma omp teams distribute parallel for simd
  for (int i = 0; i < x; i++)
    for (int i = 0; i < y; i++)
      ;
}


x86 assembly (clang, -O0):
<test_two>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1156 <test_two+0x56>
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <test_two+0x43>
jmp    1135 <test_two+0x35>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1124 <test_two+0x24>
jmp    1148 <test_two+0x48>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1111 <test_two+0x11>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_two>:
ret

LLVM IR (-O0):
define void @test_two(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %21, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %3
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %7
store i32 0, i32* %6
br label %12
12: ; preds = %17, %11
%13 = load i32, i32* %6
%14 = load i32, i32* %4
%15 = icmp slt i32 %13, %14
br i1 %15, label %16, label %20
16: ; preds = %12
br label %17
17: ; preds = %16
%18 = load i32, i32* %6
%19 = add nsw i32 %18, 1
store i32 %19, i32* %6
br label %12
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i32, i32* %5
%23 = add nsw i32 %22, 1
store i32 %23, i32* %5
br label %7
24: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @test_two(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gsc_styled_char(int, char);
void gsc_standout_char(char c) { gsc_styled_char((1), c); }


x86 assembly (clang, -O0):
<gsc_standout_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x1,%edi
movsbl -0x1(%rbp),%esi
call   1030 <gsc_styled_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gsc_standout_char>:
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <gsc_styled_char@plt>

LLVM IR (-O0):
define void @gsc_standout_char(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = call i32 @gsc_styled_char(i32 1, i8 signext %3)
ret void
}

LLVM IR (-O2):
define void @gsc_standout_char(i8 signext %0) {
%2 = tail call i32 @gsc_styled_char(i32 1, i8 signext %0)
ret void
}
/* Type definitions */
struct cons {
  int dummy;
};

/* Variables and functions */
struct cons *tail(struct cons *);
int length(struct cons *alist) {
  if (alist == NULL)
    return 0;
  return 1 + length(tail(alist));
}


x86 assembly (clang, -O0):
<length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1143 <length+0x23>
movl   $0x0,-0x4(%rbp)
jmp    115a <length+0x3a>
mov    -0x10(%rbp),%rdi
call   1040 <tail@plt>
mov    %rax,%rdi
call   1030 <length@plt>
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<length>:
push   %rbx
test   %rdi,%rdi
je     1132 <length+0x22>
mov    %rdi,%rax
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    %rax,%rdi
call   1030 <tail@plt>
add    $0x1,%ebx
test   %rax,%rax
jne    1120 <length+0x10>
jmp    1134 <length+0x24>
xor    %ebx,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
%struct.cons = type { i32 }
define i32 @length(%struct.cons* %0) {
%2 = alloca i32
%3 = alloca %struct.cons*
store %struct.cons* %0, %struct.cons** %3
%4 = load %struct.cons*, %struct.cons** %3
%5 = icmp eq %struct.cons* %4, null
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 0, i32* %2
br label %12
7: ; preds = %1
%8 = load %struct.cons*, %struct.cons** %3
%9 = call %struct.cons* @tail(%struct.cons* %8)
%10 = call i32 @length(%struct.cons* %9)
%11 = add nsw i32 1, %10
store i32 %11, i32* %2
br label %12
12: ; preds = %7, %6
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
%struct.cons = type { i32 }
define i32 @length(%struct.cons* %0) {
%2 = icmp eq %struct.cons* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi %struct.cons* [ %6, %3 ], [ %0, %1 ]
%5 = phi i32 [ %7, %3 ], [ 0, %1 ]
%6 = tail call %struct.cons* @tail(%struct.cons* %4)
%7 = add nuw nsw i32 %5, 1
%8 = icmp eq %struct.cons* %6, null
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ do_invalid_stuff();
int /*<<< orphan*/ do_valid_stuff();
scalar_t__ validate_serial();
int main(int argc, char **argv) {
  if (validate_serial()) {
    do_valid_stuff();
  } else {
    do_invalid_stuff();
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <validate_serial@plt>
cmp    $0x0,%rax
je     1163 <main+0x33>
mov    $0x0,%al
call   1030 <do_valid_stuff@plt>
jmp    116a <main+0x3a>
mov    $0x0,%al
call   1040 <do_invalid_stuff@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <validate_serial@plt>
test   %rax,%rax
je     1146 <main+0x16>
xor    %eax,%eax
call   1030 <do_valid_stuff@plt>
jmp    114d <main+0x1d>
xor    %eax,%eax
call   1040 <do_invalid_stuff@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i64 (...) @validate_serial()
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @do_valid_stuff()
br label %12
10: ; preds = %2
%11 = call i32 (...) @do_invalid_stuff()
br label %12
12: ; preds = %10, %8
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i64 (...) @validate_serial()
%4 = icmp eq i64 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 (...) @do_valid_stuff()
br label %9
7: ; preds = %2
%8 = tail call i32 (...) @do_invalid_stuff()
br label %9
9: ; preds = %7, %5
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_version(void) {
  printf("libdeflate compression benchmark program v"
         "1.7"
         "\n"
         "Copyright 2016 Eric Biggers\n"
         "\n"
         "This program is free software which may be modified and/or "
         "redistributed\n"
         "under the terms of the MIT license.  There is NO WARRANTY, to the "
         "extent\n"
         "permitted by law.  See the COPYING file for details.\n");
}


x86 assembly (clang, -O0):
<show_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_version>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [275 x i8] c"libdeflate compression benchmark program v1.7\0ACopyright 2016 Eric Biggers\0A\0AThis program is free software which may be modified and/or redistributed\0Aunder the terms of the MIT license. There is NO WARRANTY, to the extent\0Apermitted by law. See the COPYING file for details.\0A\00"
define void @show_version() {
%1 = call i32 @printf(i8* getelementptr inbounds ([275 x i8], [275 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [274 x i8] c"libdeflate compression benchmark program v1.7\0ACopyright 2016 Eric Biggers\0A\0AThis program is free software which may be modified and/or redistributed\0Aunder the terms of the MIT license. There is NO WARRANTY, to the extent\0Apermitted by law. See the COPYING file for details.\00"
define void @show_version() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([274 x i8], [274 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ PartitionArray(unsigned long *, int, int, int *);
void QuickSort(unsigned long *a, int left, int right) {
  if (left < right) {
    int PivotLoc;
    PartitionArray(a, left, right, &PivotLoc);
    QuickSort(a, left, PivotLoc - 1);
    QuickSort(a, PivotLoc + 1, right);
  }
}


x86 assembly (clang, -O0):
<QuickSort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jge    1175 <QuickSort+0x55>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
lea    -0x14(%rbp),%rcx
call   1040 <PartitionArray@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x14(%rbp),%edx
sub    $0x1,%edx
call   1030 <QuickSort@plt>
mov    -0x8(%rbp),%rdi
mov    -0x14(%rbp),%esi
add    $0x1,%esi
mov    -0x10(%rbp),%edx
call   1030 <QuickSort@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QuickSort>:
cmp    %edx,%esi
jge    1167 <QuickSort+0x47>
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %rdi,%r14
lea    0xc(%rsp),%rcx
call   1040 <PartitionArray@plt>
mov    0xc(%rsp),%edx
add    $0xffffffff,%edx
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <QuickSort@plt>
mov    0xc(%rsp),%esi
add    $0x1,%esi
mov    %r14,%rdi
mov    %ebx,%edx
call   1030 <QuickSort@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @QuickSort(i64* %0, i32 %1, i32 %2) {
%4 = alloca i64*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i64* %0, i64** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %5
%9 = load i32, i32* %6
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %24
11: ; preds = %3
%12 = load i64*, i64** %4
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = call i32 @PartitionArray(i64* %12, i32 %13, i32 %14, i32* %7)
%16 = load i64*, i64** %4
%17 = load i32, i32* %5
%18 = load i32, i32* %7
%19 = sub nsw i32 %18, 1
%20 = load i64*, i64** %4
%21 = load i32, i32* %7
%22 = add nsw i32 %21, 1
%23 = load i32, i32* %6
br label %24
24: ; preds = %11, %3
ret void
}

LLVM IR (-O2):
define void @QuickSort(i64* %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = icmp slt i32 %1, %2
br i1 %5, label %6, label %13
6: ; preds = %3
%7 = bitcast i32* %4 to i8*
%8 = call i32 @PartitionArray(i64* %0, i32 %1, i32 %2, i32* %4)
%9 = load i32, i32* %4
%10 = add nsw i32 %9, -1
%11 = load i32, i32* %4
%12 = add nsw i32 %11, 1
br label %13
13: ; preds = %6, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *);
void cdflib_ftnstop(char *msg) {
  printf("%s\n", msg);
  exit(0);
}


x86 assembly (clang, -O0):
<cdflib_ftnstop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<cdflib_ftnstop>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define void @cdflib_ftnstop(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @cdflib_ftnstop(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 0)
unreachable
}
unsigned header_trie_map(char c) {
  if (c >= 'a' && c <= 'z')
    return c - 'a';
  else if (c == '-')
    return 'z' - 'a' + 1;
  else
    return 'z' - 'a' + 2;
}


x86 assembly (clang, -O0):
<header_trie_map>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <header_trie_map+0x33>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <header_trie_map+0x33>
movsbl -0x5(%rbp),%eax
sub    $0x61,%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <header_trie_map+0x53>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
jne    114c <header_trie_map+0x4c>
movl   $0x1a,-0x4(%rbp)
jmp    1153 <header_trie_map+0x53>
movl   $0x1b,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_trie_map>:
lea    -0x61(%rdi),%ecx
lea    -0x61(%rdi),%edx
xor    %eax,%eax
cmp    $0x2d,%dil
sete   %al
xor    $0x1b,%eax
cmp    $0x1a,%cl
cmovb  %edx,%eax
ret

LLVM IR (-O0):
define i32 @header_trie_map(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %15
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %15
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 97
store i32 %14, i32* %2
br label %21
15: ; preds = %7, %1
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %20
19: ; preds = %15
store i32 26, i32* %2
br label %21
20: ; preds = %15
store i32 27, i32* %2
br label %21
21: ; preds = %20, %19, %11
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @header_trie_map(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = sext i8 %0 to i32
%5 = add nsw i32 %4, -97
%6 = icmp eq i8 %0, 45
%7 = select i1 %6, i32 26, i32 27
%8 = select i1 %3, i32 %5, i32 %7
ret i32 %8
}
unsigned int recupererNbTourPotionActive(const unsigned int typePotion,
                                         const unsigned int niveauPotion) {
  static const unsigned int nbTourPotionActive[3][2] = {
      {3, 8}, {5, 10}, {5, 10}};
  return nbTourPotionActive[typePotion][niveauPotion - 1];
}


x86 assembly (clang, -O0):
<recupererNbTourPotionActive>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,%ecx
lea    0xeea(%rip),%rax
shl    $0x3,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<recupererNbTourPotionActive>:
mov    %edi,%eax
add    $0xffffffff,%esi
lea    0xef4(%rip),%rcx
lea    (%rcx,%rax,8),%rax
mov    (%rax,%rsi,4),%eax
ret

LLVM IR (-O0):
@recupererNbTourPotionActive.nbTourPotionActive = internal constant [3 x [2 x i32]] [[2 x i32] [i32 3, i32 8], [2 x i32] [i32 5, i32 10], [2 x i32] [i32 5, i32 10]]
define i32 @recupererNbTourPotionActive(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @recupererNbTourPotionActive.nbTourPotionActive, i64 0, i64 %6
%8 = load i32, i32* %4
%9 = sub i32 %8, 1
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 %10
%12 = load i32, i32* %11
ret i32 %12
}

LLVM IR (-O2):
@recupererNbTourPotionActive.nbTourPotionActive = internal unnamed_addr constant [3 x [2 x i32]] [[2 x i32] [i32 3, i32 8], [2 x i32] [i32 5, i32 10], [2 x i32] [i32 5, i32 10]]
define i32 @recupererNbTourPotionActive(i32 %0, i32 %1) {
%3 = zext i32 %0 to i64
%4 = add i32 %1, -1
%5 = zext i32 %4 to i64
%6 = getelementptr inbounds [3 x [2 x i32]], [3 x [2 x i32]]* @recupererNbTourPotionActive.nbTourPotionActive, i64 0, i64 %3, i64 %5
%7 = load i32, i32* %6
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sub1();
int main(void) {
  printf("hello main\n");
  sub1();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <sub1@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1040 <sub1@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"hello main\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = call i32 (...) @sub1()
ret i32 0
}

LLVM IR (-O2):
@str = [11 x i8] c"hello main\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @sub1()
ret i32 0
}
/* Type definitions */
typedef int ssize_t;

/* Variables and functions */
int /*<<< orphan*/ basic_test(int);
int /*<<< orphan*/ cleanup_test();
int /*<<< orphan*/ init_test();
int log_write_end(int);
void write_one_page_end(void) {
  ssize_t n;
  init_test();
  n = log_write_end(4096);
  basic_test(n == 4096);
  cleanup_test();
}


x86 assembly (clang, -O0):
<write_one_page_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1030 <log_write_end@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1000,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <basic_test@plt>
mov    $0x0,%al
call   1050 <cleanup_test@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_one_page_end>:
push   %rax
xor    %eax,%eax
call   1060 <init_test@plt>
mov    $0x1000,%edi
call   1030 <log_write_end@plt>
xor    %edi,%edi
cmp    $0x1000,%eax
sete   %dil
call   1040 <basic_test@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <cleanup_test@plt>

LLVM IR (-O0):
define void @write_one_page_end() {
%1 = alloca i32
%2 = call i32 (...) @init_test()
%3 = call i32 @log_write_end(i32 4096)
store i32 %3, i32* %1
%4 = load i32, i32* %1
%5 = icmp eq i32 %4, 4096
%6 = zext i1 %5 to i32
%7 = call i32 @basic_test(i32 %6)
%8 = call i32 (...) @cleanup_test()
ret void
}

LLVM IR (-O2):
define void @write_one_page_end() {
%1 = tail call i32 (...) @init_test()
%2 = tail call i32 @log_write_end(i32 4096)
%3 = icmp eq i32 %2, 4096
%4 = zext i1 %3 to i32
%5 = tail call i32 @basic_test(i32 %4)
%6 = tail call i32 (...) @cleanup_test()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void ctor2() { printf("Create2!\n"); }


x86 assembly (clang, -O0):
<ctor2>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctor2>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"Create2!\0A\00"
define void @ctor2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [9 x i8] c"Create2!\00"
define void @ctor2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @str, i64 0, i64 0))
ret void
}
int compareFn(void *first_arg, void *second_arg) {
  int first = *(int *)first_arg;
  int second = *(int *)second_arg;
  if (first < second)
    return -1;
  else if (first == second)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<compareFn>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    1136 <compareFn+0x36>
movl   $0xffffffff,-0x4(%rbp)
jmp    1155 <compareFn+0x55>
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jne    114e <compareFn+0x4e>
movl   $0x0,-0x4(%rbp)
jmp    1155 <compareFn+0x55>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareFn>:
mov    (%rdi),%eax
xor    %ecx,%ecx
cmp    (%rsi),%eax
setne  %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareFn(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
store i32 %10, i32* %6
%11 = load i8*, i8** %5
%12 = bitcast i8* %11 to i32*
%13 = load i32, i32* %12
store i32 %13, i32* %7
%14 = load i32, i32* %6
%15 = load i32, i32* %7
%16 = icmp slt i32 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %2
store i32 -1, i32* %3
br label %24
18: ; preds = %2
%19 = load i32, i32* %6
%20 = load i32, i32* %7
%21 = icmp eq i32 %19, %20
br i1 %21, label %22, label %23
22: ; preds = %18
store i32 0, i32* %3
br label %24
23: ; preds = %18
store i32 1, i32* %3
br label %24
24: ; preds = %23, %22, %17
%25 = load i32, i32* %3
ret i32 %25
}

LLVM IR (-O2):
define i32 @compareFn(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp slt i32 %4, %6
%8 = icmp ne i32 %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}