xunge/DecIR huggingface dataset:
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ traverse(struct TreeNode *, int *, int /*<<< orphan*/);
int sumOfLeftLeaves(struct TreeNode *root) {
  int sum = 0;
  traverse(root, &sum, 0);
  return sum;
}


x86 assembly (clang, -O0):
<sumOfLeftLeaves>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
xor    %edx,%edx
call   1030 <traverse@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumOfLeftLeaves>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
xor    %edx,%edx
call   1030 <traverse@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define i32 @sumOfLeftLeaves(%struct.TreeNode* %0) {
%2 = alloca %struct.TreeNode*
%3 = alloca i32
store %struct.TreeNode* %0, %struct.TreeNode** %2
store i32 0, i32* %3
%4 = load %struct.TreeNode*, %struct.TreeNode** %2
%5 = call i32 @traverse(%struct.TreeNode* %4, i32* %3, i32 0)
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define i32 @sumOfLeftLeaves(%struct.TreeNode* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @traverse(%struct.TreeNode* %0, i32* %2, i32 0)
%5 = load i32, i32* %2
ret i32 %5
}
/* Variables and functions */
int unlink(char const *);
int OS_file_delete(const char *p_filename) {
  if (-1 == unlink(p_filename))
    return 0x1004;
  return 0;
}


x86 assembly (clang, -O0):
<OS_file_delete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <unlink@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
jne    1140 <OS_file_delete+0x30>
movl   $0x1004,-0x4(%rbp)
jmp    1147 <OS_file_delete+0x37>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<OS_file_delete>:
push   %rax
call   1030 <unlink@plt>
xor    %ecx,%ecx
cmp    $0xffffffff,%eax
mov    $0x1004,%eax
cmovne %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @OS_file_delete(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = call i32 @unlink(i8* %4)
%6 = icmp eq i32 -1, %5
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 4100, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @OS_file_delete(i8* nocapture %0) {
%2 = tail call i32 @unlink(i8* %0)
%3 = icmp eq i32 %2, -1
%4 = select i1 %3, i32 4100, i32 0
ret i32 %4
}
/* Variables and functions */
int rand();
int time(void *dummy) { return rand(); }


x86 assembly (clang, -O0):
<time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<time>:
xor    %eax,%eax
jmp    1030 <rand@plt>

LLVM IR (-O0):
define i32 @time(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @rand()
ret i32 %3
}

LLVM IR (-O2):
define i32 @time(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @rand()
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_gettid;
int /*<<< orphan*/ syscall(int /*<<< orphan*/);
pid_t get_tid(int i, int boooomm) { return syscall(SYS_gettid); }


x86 assembly (clang, -O0):
<get_tid>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec3(%rip),%rax
mov    (%rax),%edi
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_tid>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
@SYS_gettid = global i32 0
define i32 @get_tid(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @SYS_gettid
%6 = call i32 @syscall(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@SYS_gettid = global i32 0
define i32 @get_tid(i32 %0, i32 %1) {
%3 = load i32, i32* @SYS_gettid
%4 = tail call i32 @syscall(i32 %3)
ret i32 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
scalar_t__ EINTR;
scalar_t__ errno;
int open(char const *, int, int /*<<< orphan*/);
int sf_open(const char *path, int type, mode_t mode) {
  int fd = 0;
  do {
    fd = open(path, type, mode);
  } while (fd < 0 && errno == EINTR);
  return fd;
}


x86 assembly (clang, -O0):
<sf_open>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jge    1164 <sf_open+0x54>
mov    0x2e8f(%rip),%rax
mov    (%rax),%rax
mov    0x2e7d(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
test   $0x1,%al
jne    1129 <sf_open+0x19>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sf_open>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
mov    0x2eb9(%rip),%r15
mov    0x2eaa(%rip),%r12
xchg   %ax,%ax
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <open@plt>
test   %eax,%eax
jns    114a <sf_open+0x3a>
mov    (%r12),%rcx
cmp    %rcx,(%r15)
je     1130 <sf_open+0x20>
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@errno = global i64 0
@EINTR = global i64 0
define i32 @sf_open(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i32 0, i32* %7
br label %8
8: ; preds = %20, %3
%9 = load i8*, i8** %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @open(i8* %9, i32 %10, i32 %11)
store i32 %12, i32* %7
br label %13
13: ; preds = %8
%14 = load i32, i32* %7
%15 = icmp slt i32 %14, 0
br i1 %15, label %16, label %20
16: ; preds = %13
%17 = load i64, i64* @errno
%18 = load i64, i64* @EINTR
%19 = icmp eq i64 %17, %18
br label %20
20: ; preds = %16, %13
%21 = phi i1 [ false, %13 ], [ %19, %16 ]
br i1 %21, label %8, label %22
22: ; preds = %20
%23 = load i32, i32* %7
ret i32 %23
}

LLVM IR (-O2):
@errno = global i64 0
@EINTR = global i64 0
define i32 @sf_open(i8* nocapture %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = tail call i32 @open(i8* %0, i32 %1, i32 %2)
%6 = icmp slt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EINTR
%9 = icmp eq i64 %7, %8
%10 = select i1 %6, i1 %9, i1 false
br i1 %10, label %4, label %11
11: ; preds = %4
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void exit_with_help() {
  printf("Usage: svm-predict [options] test_file model_file output_file\n"
         "options:\n"
         "-b probability_estimates: whether to predict probability estimates, "
         "0 or 1 (default 0); for one-class SVM only 0 is supported\n"
         "-q : quiet mode (no outputs)\n");
  exit(1);
}


x86 assembly (clang, -O0):
<exit_with_help>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<exit_with_help>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [227 x i8] c"Usage: svm-predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); for one-class SVM only 0 is supported\0A-q : quiet mode (no outputs)\0A\00"
define void @exit_with_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([227 x i8], [227 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [226 x i8] c"Usage: svm-predict [options] test_file model_file output_file\0Aoptions:\0A-b probability_estimates: whether to predict probability estimates, 0 or 1 (default 0); for one-class SVM only 0 is supported\0A-q : quiet mode (no outputs)\00"
define void @exit_with_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([226 x i8], [226 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
FUNCTION_DEFINE(debug_off) { PG_RETURN_INT32(DebugSetOff()); }


x86 assembly (clang, -O0):
<FUNCTION_DEFINE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <DebugSetOff@plt>
mov    %eax,%edi
mov    $0x0,%al
call   1040 <PG_RETURN_INT32@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FUNCTION_DEFINE>:
push   %rax
xor    %eax,%eax
call   1030 <DebugSetOff@plt>
mov    %eax,%edi
xor    %eax,%eax
pop    %rcx
jmp    1040 <PG_RETURN_INT32@plt>

LLVM IR (-O0):
define i32 @FUNCTION_DEFINE(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (...) @DebugSetOff()
%5 = call i32 (i32, ...) bitcast (i32 (...)* @PG_RETURN_INT32 to i32 (i32, ...)*)(i32 %4)
%6 = load i32, i32* %2
ret i32 %6
}

LLVM IR (-O2):
define i32 @FUNCTION_DEFINE(i32 %0) {
%2 = tail call i32 (...) @DebugSetOff()
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @PG_RETURN_INT32 to i32 (i32, ...)*)(i32 %2)
ret i32 undef
}
int cmp_double_asc(const void *p1, const void *p2) {
  if (*((const double *)p1) < *((const double *)p2)) {
    return -1;
  } else if (*((const double *)p1) > *((const double *)p2)) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<cmp_double_asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
ucomisd %xmm1,%xmm0
jbe    1132 <cmp_double_asc+0x32>
movl   $0xffffffff,-0x4(%rbp)
jmp    115b <cmp_double_asc+0x5b>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomisd (%rax),%xmm0
jbe    1154 <cmp_double_asc+0x54>
movl   $0x1,-0x4(%rbp)
jmp    115b <cmp_double_asc+0x5b>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_double_asc>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm1,%xmm0
seta   %cl
ucomisd %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @cmp_double_asc(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp olt double %4, %6
%8 = fcmp ogt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int isdigit(char);
int matchdigit(char c) { return isdigit(c); }


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

x86 assembly (clang, -O2):
<matchdigit>:
jmp    1030 <isdigit@plt>

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

LLVM IR (-O2):
define i32 @matchdigit(i8 signext %0) {
%2 = tail call i32 @isdigit(i8 signext %0)
ret i32 %2
}
void foo037(int p) {}


x86 assembly (clang, -O0):
<foo037>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @foo037(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print_arr(int *arr, int num_elem) {
  for (int i = 0; i < num_elem; i++) {
    printf("%d ", arr[i]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print_arr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print_arr+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print_arr+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_arr>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print_arr+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print_arr+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
@.str.1 = [2 x i8] c"\0A\00"
define void @print_arr(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %17, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %20
10: ; preds = %6
%11 = load i32*, i32** %3
%12 = load i32, i32* %5
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i32, i32* %11, i64 %13
%15 = load i32, i32* %14
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
br label %17
17: ; preds = %10
%18 = load i32, i32* %5
%19 = add nsw i32 %18, 1
store i32 %19, i32* %5
br label %6
20: ; preds = %6
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print_arr(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = tail call i32 @putchar(i32 10)
ret void
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %13, %8 ]
%10 = getelementptr inbounds i32, i32* %0, i64 %9
%11 = load i32, i32* %10
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = add nuw nsw i64 %9, 1
%14 = icmp eq i64 %13, %5
br i1 %14, label %6, label %8
}
/* Variables and functions */
long INT_MAX;
long INT_MIN;
long strtol(char const *, int /*<<< orphan*/ *, int);
int stoi(const char *s) {
  long x = strtol(s, NULL, 10);
  return x >= INT_MIN && x <= INT_MAX ? x : 0;
}


x86 assembly (clang, -O0):
<stoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x2ea3(%rip),%rcx
cmp    (%rcx),%rax
jl     1167 <stoi+0x57>
mov    -0x10(%rbp),%rax
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%rax
jg     1167 <stoi+0x57>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1172 <stoi+0x62>
xor    %eax,%eax
mov    %rax,-0x18(%rbp)
jmp    1172 <stoi+0x62>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoi>:
push   %rbx
xor    %ebx,%ebx
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <strtol@plt>
mov    0x2eba(%rip),%rdx
mov    0x2ebb(%rip),%rcx
cmp    (%rcx),%rax
mov    %eax,%ecx
cmovg  %ebx,%ecx
cmp    (%rdx),%rax
cmovl  %ebx,%ecx
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@INT_MIN = global i64 0
@INT_MAX = global i64 0
define i32 @stoi(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strtol(i8* %4, i32* null, i32 10)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* @INT_MIN
%8 = icmp sge i64 %6, %7
br i1 %8, label %9, label %15
9: ; preds = %1
%10 = load i64, i64* %3
%11 = load i64, i64* @INT_MAX
%12 = icmp sle i64 %10, %11
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = load i64, i64* %3
br label %16
15: ; preds = %9, %1
br label %16
16: ; preds = %15, %13
%17 = phi i64 [ %14, %13 ], [ 0, %15 ]
%18 = trunc i64 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
@INT_MIN = global i64 0
@INT_MAX = global i64 0
define i32 @stoi(i8* nocapture %0) {
%2 = tail call i64 @strtol(i8* nocapture %0, i32* null, i32 10)
%3 = load i64, i64* @INT_MIN
%4 = icmp slt i64 %2, %3
%5 = load i64, i64* @INT_MAX
%6 = icmp sgt i64 %2, %5
%7 = trunc i64 %2 to i32
%8 = select i1 %4, i1 true, i1 %6
%9 = select i1 %8, i32 0, i32 %7
ret i32 %9
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ send_event;
};
typedef TYPE_1__ XLeaveWindowEvent;

/* Variables and functions */
int get_XLeaveWindowEvent_send_event(void *_p) {
  return (int)((XLeaveWindowEvent *)_p)->send_event;
}


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

x86 assembly (clang, -O2):
<get_XLeaveWindowEvent_send_event>:
mov    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XLeaveWindowEvent_send_event(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
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XLeaveWindowEvent_send_event(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
int test_imm_C6int64_highword_reg(long long val) {
  return ((val >> 32) & (0xC6 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_C6int64_highword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
sar    $0x20,%rdx
and    $0xc6,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_C6int64_highword_reg>:
movabs $0xc600000000,%rax
test   %rax,%rdi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_C6int64_highword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 32
%5 = and i64 %4, 198
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_C6int64_highword_reg(i64 %0) {
%2 = and i64 %0, 850403524608
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_help() { printf("OpenJXR v1.0, \n"); }


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

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

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

LLVM IR (-O2):
@str = [15 x i8] c"OpenJXR v1.0, \00"
define void @print_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @str, i64 0, i64 0))
ret void
}
int do_957() { return 957; }


x86 assembly (clang, -O0):
<do_957>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3bd,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_957() {
ret i32 957
}

LLVM IR (-O2):
define i32 @do_957() {
ret i32 957
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
char *malloc(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int j;
  char *buf;
  for (j = 0;; j++) {
    if (j % 100 == 0)
      printf("%d ", j);
    buf = malloc((1024 * 1024 * 1024));
  }
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1159 <main+0x39>
mov    -0x8(%rbp),%esi
lea    0xeac(%rip),%rdi
call   1030 <printf@plt>
mov    $0x40000000,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1136 <main+0x16>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
xor    %ebp,%ebp
jmp    1136 <main+0x26>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebp
add    $0xffffffff,%ebx
mov    %ebp,%eax
imul   $0x51eb851f,%rax,%rax
shr    $0x25,%rax
imul   $0x64,%eax,%eax
add    %ebx,%eax
jne    1130 <main+0x20>
mov    %r14,%rdi
mov    %ebp,%esi
call   1030 <printf@plt>
jmp    1130 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8*
store i32 0, i32* %1
store i32 0, i32* %2
br label %4
4: ; preds = %13, %0
%5 = load i32, i32* %2
%6 = srem i32 %5, 100
%7 = icmp eq i32 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %4
%9 = load i32, i32* %2
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
br label %11
11: ; preds = %8, %4
%12 = call i8* @malloc(i32 1073741824)
store i8* %12, i8** %3
br label %13
13: ; preds = %11
%14 = load i32, i32* %2
%15 = add nsw i32 %14, 1
store i32 %15, i32* %2
br label %4
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define i32 @main() {
br label %1
1: ; preds = %7, %0
%2 = phi i32 [ 0, %0 ], [ %8, %7 ]
%3 = urem i32 %2, 100
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
br label %7
7: ; preds = %5, %1
%8 = add nuw nsw i32 %2, 1
br label %1
}
double dabs(double in) {
  double out;
  if (in > 0.0)
    out = in;
  if (in < 0.0)
    out = -in;
  if (in == 0.0)
    out = 0.0;
  return out;
}


x86 assembly (clang, -O0):
<dabs>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1125 <dabs+0x25>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1154 <dabs+0x54>
movsd  -0x8(%rbp),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1174 <dabs+0x74>
jp     1174 <dabs+0x74>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<dabs>:
movapd 0xef8(%rip),%xmm1
xorpd  %xmm0,%xmm1
xorpd  %xmm2,%xmm2
movapd %xmm0,%xmm3
cmpltsd %xmm2,%xmm3
andpd  %xmm3,%xmm1
andnpd %xmm0,%xmm3
orpd   %xmm1,%xmm3
cmpeqsd %xmm2,%xmm0
andnpd %xmm3,%xmm0
ret

LLVM IR (-O0):
define double @dabs(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %8
6: ; preds = %1
%7 = load double, double* %2
store double %7, double* %3
br label %8
8: ; preds = %6, %1
%9 = load double, double* %2
%10 = fcmp olt double %9, 0.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load double, double* %2
%13 = fneg double %12
store double %13, double* %3
br label %14
14: ; preds = %11, %8
%15 = load double, double* %2
%16 = fcmp oeq double %15, 0.000000e+00
br i1 %16, label %17, label %18
17: ; preds = %14
store double 0.000000e+00, double* %3
br label %18
18: ; preds = %17, %14
%19 = load double, double* %3
ret double %19
}

LLVM IR (-O2):
define double @dabs(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fneg double %0
%4 = select i1 %2, double %3, double %0
%5 = fcmp oeq double %0, 0.000000e+00
%6 = select i1 %5, double 0.000000e+00, double %4
ret double %6
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double mysecond() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return tv.tv_sec + tv.tv_usec * 1.e-6;
}


x86 assembly (clang, -O0):
<mysecond>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mysecond>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movsd  0x10(%rsp),%xmm0
mulsd  0xed2(%rip),%xmm0
addsd  0x8(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @mysecond() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load double, double* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load double, double* %5
%7 = call double @llvm.fmuladd.f64(double %6, double 0x3EB0C6F7A0B5ED8D, double %4)
ret double %7
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @mysecond() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load double, double* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load double, double* %6
%8 = tail call double @llvm.fmuladd.f64(double %7, double 0x3EB0C6F7A0B5ED8D, double %5)
ret double %8
}
int do_891() { return 891; }


x86 assembly (clang, -O0):
<do_891>:
push   %rbp
mov    %rsp,%rbp
mov    $0x37b,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @do_891() {
ret i32 891
}

LLVM IR (-O2):
define i32 @do_891() {
ret i32 891
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void panic(const char *m) {
  printf("%s", m);
  exit(1);
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @panic(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
void utils_mktime(time_t time, char *string) {
  struct tm *ltime;
  ltime = localtime(&time);
  strftime(string, 23, "%b %d, %Y %H:%M:%S", ltime);
}


x86 assembly (clang, -O0):
<utils_mktime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rcx
mov    $0x17,%esi
lea    0xeb0(%rip),%rdx
call   1040 <strftime@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<utils_mktime>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
mov    %edi,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0xec3(%rip),%rdx
mov    %rbx,%rdi
mov    $0x17,%esi
mov    %rax,%rcx
call   1040 <strftime@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
@.str = [19 x i8] c"%b %d, %Y %H:%M:%S\00"
define void @utils_mktime(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca %struct.tm*
store i32 %0, i32* %3
store i8* %1, i8** %4
%6 = call %struct.tm* @localtime(i32* %3)
store %struct.tm* %6, %struct.tm** %5
%7 = load i8*, i8** %4
%8 = load %struct.tm*, %struct.tm** %5
%9 = call i32 @strftime(i8* %7, i32 23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %8)
ret void
}

LLVM IR (-O2):
%struct.tm = type { i32 }
@.str = [19 x i8] c"%b %d, %Y %H:%M:%S\00"
define void @utils_mktime(i32 %0, i8* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call %struct.tm* @localtime(i32* %3)
%5 = call i32 @strftime(i8* %1, i32 23, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), %struct.tm* %4)
ret void
}
void __attribute__((weak)) otg_hs_isr() { debug_handler(__FUNCTION__); }


x86 assembly (clang, -O0):
<otg_hs_isr>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <debug_handler@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<otg_hs_isr>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <debug_handler@plt>

LLVM IR (-O0):
@__FUNCTION__.otg_hs_isr = [11 x i8] c"otg_hs_isr\00"
define weak void @otg_hs_isr() {
%1 = call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.otg_hs_isr, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@__FUNCTION__.otg_hs_isr = [11 x i8] c"otg_hs_isr\00"
define weak void @otg_hs_isr() {
%1 = tail call i32 (i8*, ...) bitcast (i32 (...)* @debug_handler to i32 (i8*, ...)*)(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.otg_hs_isr, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned char gf16_mul(unsigned char, unsigned char);
unsigned char gf256_mul_gf16(unsigned char a, unsigned char gf16_b) {
  unsigned char a0 = a & 15;
  unsigned char a1 = (a >> 4);
  unsigned char b0 = gf16_b & 15;
  unsigned char a0b0 = gf16_mul(a0, b0);
  unsigned char a1b0 = gf16_mul(a1, b0);
  return a0b0 ^ (a1b0 << 4);
}


x86 assembly (clang, -O0):
<gf256_mul_gf16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x3(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x4,%eax
mov    %al,-0x4(%rbp)
movzbl -0x2(%rbp),%eax
and    $0xf,%eax
mov    %al,-0x5(%rbp)
mov    -0x3(%rbp),%al
movzbl %al,%edi
movzbl -0x5(%rbp),%esi
call   1030 <gf16_mul@plt>
mov    %al,-0x6(%rbp)
mov    -0x4(%rbp),%al
movzbl %al,%edi
movzbl -0x5(%rbp),%esi
call   1030 <gf16_mul@plt>
mov    %al,-0x7(%rbp)
movzbl -0x6(%rbp),%eax
movzbl -0x7(%rbp),%ecx
shl    $0x4,%ecx
xor    %ecx,%eax
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gf256_mul_gf16>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebx
mov    %edi,%r14d
shr    $0x4,%r14b
and    $0xf,%edi
and    $0xf,%ebx
mov    %ebx,%esi
call   1030 <gf16_mul@plt>
mov    %eax,%ebp
movzbl %r14b,%edi
mov    %ebx,%esi
call   1030 <gf16_mul@plt>
shl    $0x4,%al
xor    %bpl,%al
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define zeroext i8 @gf256_mul_gf16(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8 %0, i8* %3
store i8 %1, i8* %4
%10 = load i8, i8* %3
%11 = zext i8 %10 to i32
%12 = and i32 %11, 15
%13 = trunc i32 %12 to i8
store i8 %13, i8* %5
%14 = load i8, i8* %3
%15 = zext i8 %14 to i32
%16 = ashr i32 %15, 4
%17 = trunc i32 %16 to i8
store i8 %17, i8* %6
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = and i32 %19, 15
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %5
%23 = load i8, i8* %7
%24 = call zeroext i8 @gf16_mul(i8 zeroext %22, i8 zeroext %23)
store i8 %24, i8* %8
%25 = load i8, i8* %6
%26 = load i8, i8* %7
%27 = call zeroext i8 @gf16_mul(i8 zeroext %25, i8 zeroext %26)
store i8 %27, i8* %9
%28 = load i8, i8* %8
%29 = zext i8 %28 to i32
%30 = load i8, i8* %9
%31 = zext i8 %30 to i32
%32 = shl i32 %31, 4
%33 = xor i32 %29, %32
%34 = trunc i32 %33 to i8
ret i8 %34
}

LLVM IR (-O2):
define zeroext i8 @gf256_mul_gf16(i8 zeroext %0, i8 zeroext %1) {
%3 = and i8 %0, 15
%4 = lshr i8 %0, 4
%5 = and i8 %1, 15
%6 = tail call zeroext i8 @gf16_mul(i8 zeroext %3, i8 zeroext %5)
%7 = tail call zeroext i8 @gf16_mul(i8 zeroext %4, i8 zeroext %5)
%8 = shl i8 %7, 4
%9 = xor i8 %8, %6
ret i8 %9
}
/* Variables and functions */
int /*<<< orphan*/ LedsP__Leds__led1Toggle();
void EchoP__Leds__led1Toggle(void) { LedsP__Leds__led1Toggle(); }


x86 assembly (clang, -O0):
<EchoP__Leds__led1Toggle>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <LedsP__Leds__led1Toggle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<EchoP__Leds__led1Toggle>:
xor    %eax,%eax
jmp    1030 <LedsP__Leds__led1Toggle@plt>

LLVM IR (-O0):
define void @EchoP__Leds__led1Toggle() {
%1 = call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}

LLVM IR (-O2):
define void @EchoP__Leds__led1Toggle() {
%1 = tail call i32 (...) @LedsP__Leds__led1Toggle()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void clearconsole() { printf("\x1B[2J\x1B[f"); }


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[2J\1B[f\00"
define void @clearconsole() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[2J\1B[f\00"
define void @clearconsole() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret void
}
void wpas_dbus_signal_wps_cred(struct wpa_supplicant *wpa_s,
                               const struct wps_credential *cred) {}


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

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

LLVM IR (-O0):
%struct.wpa_supplicant = type opaque
%struct.wps_credential = type opaque
define void @wpas_dbus_signal_wps_cred(%struct.wpa_supplicant* %0, %struct.wps_credential* %1) {
%3 = alloca %struct.wpa_supplicant*
%4 = alloca %struct.wps_credential*
store %struct.wpa_supplicant* %0, %struct.wpa_supplicant** %3
store %struct.wps_credential* %1, %struct.wps_credential** %4
ret void
}

LLVM IR (-O2):
%struct.wpa_supplicant = type opaque
%struct.wps_credential = type opaque
define void @wpas_dbus_signal_wps_cred(%struct.wpa_supplicant* nocapture %0, %struct.wps_credential* nocapture %1) {
ret void
}
void _M2_segment_init(__attribute__((unused)) int argc,
                      __attribute__((unused)) char *argv[]) {}


x86 assembly (clang, -O0):
<_M2_segment_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @_M2_segment_init(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
ret void
}

LLVM IR (-O2):
define void @_M2_segment_init(i32 %0, i8** nocapture %1) {
ret void
}
void _swapshort(char *bp, unsigned int n) {
  register char c;
  register char *ep = bp + n;
  while (bp < ep) {
    c = *bp;
    *bp = *(bp + 1);
    bp++;
    *bp++ = c;
  }
}


x86 assembly (clang, -O0):
<_swapshort>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1162 <_swapshort+0x62>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0xd(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xd(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1119 <_swapshort+0x19>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_swapshort>:
test   %esi,%esi
je     111d <_swapshort+0x1d>
mov    %esi,%eax
add    %rdi,%rax
nopl   0x0(%rax)
rolw   $0x8,(%rdi)
add    $0x2,%rdi
cmp    %rax,%rdi
jb     1110 <_swapshort+0x10>
ret

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

LLVM IR (-O2):
define void @_swapshort(i8* %0, i32 %1) {
%3 = zext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp eq i32 %1, 0
br i1 %5, label %13, label %6
6: ; preds = %2, %6
%7 = phi i8* [ %11, %6 ], [ %0, %2 ]
%8 = load i8, i8* %7
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = load i8, i8* %9
store i8 %10, i8* %7
%11 = getelementptr inbounds i8, i8* %7, i64 2
store i8 %8, i8* %9
%12 = icmp ult i8* %11, %4
br i1 %12, label %6, label %13
13: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hash_set_tsize(int);
int /*<<< orphan*/ uci_debug(char *);
void uci_set_hash_size(int value) {
  uci_debug("Setting hash table size..");
  hash_set_tsize(value);
}


x86 assembly (clang, -O0):
<uci_set_hash_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    0xece(%rip),%rdi
call   1040 <uci_debug@plt>
mov    -0x4(%rbp),%edi
call   1030 <hash_set_tsize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<uci_set_hash_size>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
call   1040 <uci_debug@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <hash_set_tsize@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"Setting hash table size..\00"
define void @uci_set_hash_size(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @uci_debug(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %2
%5 = call i32 @hash_set_tsize(i32 %4)
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"Setting hash table size..\00"
define void @uci_set_hash_size(i32 %0) {
%2 = tail call i32 @uci_debug(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @hash_set_tsize(i32 %0)
ret void
}
int ucharGreaterThan(const void *a, const void *b) {
  unsigned char an = *(unsigned char *)a;
  unsigned char bn = *(unsigned char *)b;
  if (an > bn)
    return 1;
  else if (an == bn)
    return 0;
  else
    return -1;
}


x86 assembly (clang, -O0):
<ucharGreaterThan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x1a(%rbp)
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jle    113a <ucharGreaterThan+0x3a>
movl   $0x1,-0x4(%rbp)
jmp    115d <ucharGreaterThan+0x5d>
movzbl -0x19(%rbp),%eax
movzbl -0x1a(%rbp),%ecx
cmp    %ecx,%eax
jne    1156 <ucharGreaterThan+0x56>
movl   $0x0,-0x4(%rbp)
jmp    115d <ucharGreaterThan+0x5d>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ucharGreaterThan>:
mov    (%rdi),%al
mov    (%rsi),%cl
xor    %edx,%edx
cmp    %cl,%al
setne  %dl
neg    %edx
cmp    %cl,%al
mov    $0x1,%eax
cmovbe %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ucharGreaterThan(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp ugt i8 %3, %4
%6 = icmp ne i8 %3, %4
%7 = sext i1 %6 to i32
%8 = select i1 %5, i32 1, i32 %7
ret i32 %8
}
/* Type definitions */
struct ListNode {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ Qsort(struct ListNode *, struct ListNode *);
struct ListNode *sortList(struct ListNode *head) {
  struct ListNode *start = head;
  struct ListNode *end = NULL;
  Qsort(start, end);
  return head;
}


x86 assembly (clang, -O0):
<sortList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <Qsort@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sortList>:
push   %rbx
mov    %rdi,%rbx
xor    %esi,%esi
call   1030 <Qsort@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.ListNode = type { i32 }
define %struct.ListNode* @sortList(%struct.ListNode* %0) {
%2 = alloca %struct.ListNode*
%3 = alloca %struct.ListNode*
%4 = alloca %struct.ListNode*
store %struct.ListNode* %0, %struct.ListNode** %2
%5 = load %struct.ListNode*, %struct.ListNode** %2
store %struct.ListNode* %5, %struct.ListNode** %3
store %struct.ListNode* null, %struct.ListNode** %4
%6 = load %struct.ListNode*, %struct.ListNode** %3
%7 = load %struct.ListNode*, %struct.ListNode** %4
%8 = call i32 @Qsort(%struct.ListNode* %6, %struct.ListNode* %7)
%9 = load %struct.ListNode*, %struct.ListNode** %2
ret %struct.ListNode* %9
}

LLVM IR (-O2):
%struct.ListNode = type { i32 }
define %struct.ListNode* @sortList(%struct.ListNode* returned %0) {
%2 = tail call i32 @Qsort(%struct.ListNode* %0, %struct.ListNode* null)
ret %struct.ListNode* %0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void be_wr(unsigned char *buf, uint32_t val) {
  buf[0] = (val >> 24) & 0xFFU;
  buf[1] = (val >> 16) & 0xFFU;
  buf[2] = (val >> 8) & 0xFFU;
  buf[3] = val & 0xFFU;
}


x86 assembly (clang, -O0):
<be_wr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<be_wr>:
bswap  %esi
mov    %esi,(%rdi)
ret

LLVM IR (-O0):
define void @be_wr(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = ashr i32 %5, 24
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = ashr i32 %11, 16
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = ashr i32 %17, 8
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
%23 = load i32, i32* %4
%24 = and i32 %23, 255
%25 = trunc i32 %24 to i8
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i64 3
store i8 %25, i8* %27
ret void
}

LLVM IR (-O2):
define void @be_wr(i8* nocapture writeonly %0, i32 %1) {
%3 = lshr i32 %1, 24
%4 = trunc i32 %3 to i8
store i8 %4, i8* %0
%5 = lshr i32 %1, 16
%6 = trunc i32 %5 to i8
%7 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %6, i8* %7
%8 = lshr i32 %1, 8
%9 = trunc i32 %8 to i8
%10 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %9, i8* %10
%11 = trunc i32 %1 to i8
%12 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %11, i8* %12
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isodigit(int);
void t_isodigit_0xc4() {
  Assert_real((isodigit(196) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isodigit.c",
              985, ("isodigit should be 0 for 0xc4"));
}


x86 assembly (clang, -O0):
<t_isodigit_0xc4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc4,%edi
call   1040 <isodigit@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x3d9,%edx
lea    0xf5c(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isodigit_0xc4>:
push   %rax
mov    $0xc4,%edi
call   1040 <isodigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf67(%rip),%rcx
mov    $0x3d9,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc4\00"
define void @t_isodigit_0xc4() {
%1 = call i64 @isodigit(i32 196)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 985, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isodigit.c\00"
@.str.1 = [30 x i8] c"isodigit should be 0 for 0xc4\00"
define void @t_isodigit_0xc4() {
%1 = tail call i64 @isodigit(i32 196)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 985, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
ret void
}