xunge/DecIR huggingface dataset:
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
scalar_t__ S_ISREG(int /*<<< orphan*/);
scalar_t__ stat(char const *, struct stat *);
int file_exists(const char *filename) {
  struct stat sb;
  return (stat(filename, &sb) == 0 && S_ISREG(sb.st_mode));
}


x86 assembly (clang, -O0):
<file_exists>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    $0x0,%rcx
mov    %al,-0x11(%rbp)
jne    115d <file_exists+0x3d>
mov    -0x10(%rbp),%edi
call   1040 <S_ISREG@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_exists>:
push   %rax
mov    %rsp,%rsi
call   1030 <stat@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
je     1135 <file_exists+0x15>
pop    %rcx
ret
mov    (%rsp),%edi
call   1040 <S_ISREG@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @stat(i8* %4, %struct.stat* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%9 = load i32, i32* %8
%10 = call i64 @S_ISREG(i32 %9)
%11 = icmp ne i64 %10, 0
br label %12
12: ; preds = %7, %1
%13 = phi i1 [ false, %1 ], [ %11, %7 ]
%14 = zext i1 %13 to i32
ret i32 %14
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @file_exists(i8* %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i64 @stat(i8* %0, %struct.stat* %2)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %12
6: ; preds = %1
%7 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%8 = load i32, i32* %7
%9 = call i64 @S_ISREG(i32 %8)
%10 = icmp ne i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %6, %1
%13 = phi i32 [ 0, %1 ], [ %11, %6 ]
ret i32 %13
}
/* Type definitions */
struct timespec64 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ ktime_get_ts64(struct timespec64 *);
void get_monotonic_boottime64(struct timespec64 *ts) { ktime_get_ts64(ts); }


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

x86 assembly (clang, -O2):
<get_monotonic_boottime64>:
jmp    1030 <ktime_get_ts64@plt>

LLVM IR (-O0):
%struct.timespec64 = type { i32 }
define void @get_monotonic_boottime64(%struct.timespec64* %0) {
%2 = alloca %struct.timespec64*
store %struct.timespec64* %0, %struct.timespec64** %2
%3 = load %struct.timespec64*, %struct.timespec64** %2
%4 = call i32 @ktime_get_ts64(%struct.timespec64* %3)
ret void
}

LLVM IR (-O2):
%struct.timespec64 = type { i32 }
define void @get_monotonic_boottime64(%struct.timespec64* %0) {
%2 = tail call i32 @ktime_get_ts64(%struct.timespec64* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:  lparstat [ options ]\n\tlparstat <interval> [ count ]\n\n"
         "options:\n"
         "\t-h, --help		Show this message and exit.\n"
         "\t-V, --version	\tDisplay lparstat version information.\n"
         "\t-i			Lists details on the LPAR configuration.\n"
         "\t-x			Print the security mode settings for the "
         "LPAR.\n"
         "\t-E			Print SPURR metrics.\n"
         "\t-l, --legacy		Print the report in legacy format.\n"
         "interval		The interval parameter specifies the amount of "
         "time between each report.\n"
         "count			The count parameter specifies how many reports "
         "will be displayed.\n");
}


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

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

LLVM IR (-O0):
@.str = [500 x i8] c"Usage: lparstat [ options ]\0A\09lparstat <interval> [ count ]\0A\0Aoptions:\0A\09-h, --help\09\09Show this message and exit.\0A\09-V, --version\09\09Display lparstat version information.\0A\09-i\09\09\09Lists details on the LPAR configuration.\0A\09-x\09\09\09Print the security mode settings for the LPAR.\0A\09-E\09\09\09Print SPURR metrics.\0A\09-l, --legacy\09\09Print the report in legacy format.\0Ainterval\09\09The interval parameter specifies the amount of time between each report.\0Acount\09\09\09The count parameter specifies how many reports will be displayed.\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([500 x i8], [500 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [499 x i8] c"Usage: lparstat [ options ]\0A\09lparstat <interval> [ count ]\0A\0Aoptions:\0A\09-h, --help\09\09Show this message and exit.\0A\09-V, --version\09\09Display lparstat version information.\0A\09-i\09\09\09Lists details on the LPAR configuration.\0A\09-x\09\09\09Print the security mode settings for the LPAR.\0A\09-E\09\09\09Print SPURR metrics.\0A\09-l, --legacy\09\09Print the report in legacy format.\0Ainterval\09\09The interval parameter specifies the amount of time between each report.\0Acount\09\09\09The count parameter specifies how many reports will be displayed.\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([499 x i8], [499 x i8]* @str, i64 0, i64 0))
ret void
}
int test_imm_66int64_midword_reg(long long val) {
  return ((val >> 16) & (0x66 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_66int64_midword_reg>:
test   $0x660000,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_66int64_midword_reg(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = ashr i64 %3, 16
%5 = and i64 %4, 102
%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_66int64_midword_reg(i64 %0) {
%2 = and i64 %0, 6684672
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage() {
  fprintf(stderr, "abusage!\n");
  exit(3);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x3,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [10 x i8] c"abusage!\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 3)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [10 x i8] c"abusage!\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 3)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
unsigned int sleep1(int);
int main(void) {
  unsigned int sle_ret;
  printf("before sleep1\n");
  sle_ret = sleep1(1);
  printf("behind sleep1: %d\n", sle_ret);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedb(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1050 <sleep1@plt>
lea    0xeb2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"before sleep1\0A\00"
@.str.1 = [19 x i8] c"behind sleep1: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @sleep1(i32 1)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [19 x i8] c"behind sleep1: %d\0A\00"
@str = [14 x i8] c"before sleep1\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @sleep1(i32 1)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i32 %2)
ret i32 0
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ STDOUT_FILENO;
int /*<<< orphan*/ TCSANOW;
int /*<<< orphan*/ tcsetattr(int /*<<< orphan*/, int /*<<< orphan*/,
                             struct termios const *);
void vt_mode_set(const struct termios *mode_ptr) {
  tcsetattr(STDOUT_FILENO, TCSANOW, mode_ptr);
}


x86 assembly (clang, -O0):
<vt_mode_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
call   1030 <tcsetattr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vt_mode_set>:
mov    %rdi,%rdx
mov    0x2ed6(%rip),%rax
mov    (%rax),%edi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
jmp    1030 <tcsetattr@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
@STDOUT_FILENO = global i32 0
@TCSANOW = global i32 0
define void @vt_mode_set(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load i32, i32* @STDOUT_FILENO
%4 = load i32, i32* @TCSANOW
%5 = load %struct.termios*, %struct.termios** %2
%6 = call i32 @tcsetattr(i32 %3, i32 %4, %struct.termios* %5)
ret void
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@STDOUT_FILENO = global i32 0
@TCSANOW = global i32 0
define void @vt_mode_set(%struct.termios* %0) {
%2 = load i32, i32* @STDOUT_FILENO
%3 = load i32, i32* @TCSANOW
%4 = tail call i32 @tcsetattr(i32 %2, i32 %3, %struct.termios* %0)
ret void
}
/* Type definitions */
struct TreeNode {
  int dummy;
};

/* Variables and functions */
struct TreeNode **do_gen(int, int, int *);
struct TreeNode **generateTrees(int n, int *returnSize) {
  return (do_gen(1, n, returnSize));
}


x86 assembly (clang, -O0):
<generateTrees>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    $0x1,%edi
call   1030 <do_gen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<generateTrees>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x1,%edi
jmp    1030 <do_gen@plt>

LLVM IR (-O0):
%struct.TreeNode = type { i32 }
define %struct.TreeNode** @generateTrees(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 = load i32*, i32** %4
%7 = call %struct.TreeNode** @do_gen(i32 1, i32 %5, i32* %6)
ret %struct.TreeNode** %7
}

LLVM IR (-O2):
%struct.TreeNode = type { i32 }
define %struct.TreeNode** @generateTrees(i32 %0, i32* %1) {
%3 = tail call %struct.TreeNode** @do_gen(i32 1, i32 %0, i32* %1)
ret %struct.TreeNode** %3
}
/* Variables and functions */
char *malloc(size_t);
int /*<<< orphan*/ memcpy(char *, char const *, size_t);
int strlen(char const *);
char *strdup(const char *s) {
  size_t bufsize = strlen(s) + 1;
  char *retval = malloc(bufsize);
  if (retval)
    memcpy(retval, s, bufsize);
  return retval;
}


x86 assembly (clang, -O0):
<strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1177 <strdup+0x47>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1161 <strdup+0x31>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1040 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @malloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %18
13: ; preds = %1
%14 = load i8*, i8** %4
%15 = load i8*, i8** %2
%16 = load i64, i64* %3
%17 = call i32 @memcpy(i8* %14, i8* %15, i64 %16)
br label %18
18: ; preds = %13, %1
%19 = load i8*, i8** %4
ret i8* %19
}

LLVM IR (-O2):
define i8* @strdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @malloc(i64 %4)
%6 = icmp eq i8* %5, null
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
br label %9
9: ; preds = %7, %1
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
int xerbla_(char *srname, int *info) {
  printf("** On entry to %6s, parameter number %2d had an illegal value\n",
         srname, *info);
  return 0;
}


x86 assembly (clang, -O0):
<xerbla_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rax
mov    (%rax),%edx
lea    0xecf(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xerbla_>:
push   %rax
mov    %rdi,%rax
mov    (%rsi),%edx
lea    0xee3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [63 x i8] c"** On entry to %6s, parameter number %2d had an illegal value\0A\00"
define i32 @xerbla_(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
%5 = load i8*, i8** %3
%6 = load i32*, i32** %4
%7 = load i32, i32* %6
%8 = call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %5, i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [63 x i8] c"** On entry to %6s, parameter number %2d had an illegal value\0A\00"
define i32 @xerbla_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([63 x i8], [63 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char const *);
void _FatalError(const char *s) {
  printf("Fatal error in cmaes_boundary_transformation: %s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<_FatalError>:
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):
<_FatalError>:
push   %rax
mov    %rdi,%rsi
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

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

LLVM IR (-O2):
@.str = [50 x i8] c"Fatal error in cmaes_boundary_transformation: %s\0A\00"
define void @_FatalError(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ fib(int);
int main() {
  for (int i = 1; i <= 10; i++) {
    fib(i);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jg     1146 <main+0x36>
mov    -0x8(%rbp),%edi
call   1030 <fib@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <fib@plt>
mov    $0x2,%edi
call   1030 <fib@plt>
mov    $0x3,%edi
call   1030 <fib@plt>
mov    $0x4,%edi
call   1030 <fib@plt>
mov    $0x5,%edi
call   1030 <fib@plt>
mov    $0x6,%edi
call   1030 <fib@plt>
mov    $0x7,%edi
call   1030 <fib@plt>
mov    $0x8,%edi
call   1030 <fib@plt>
mov    $0x9,%edi
call   1030 <fib@plt>
mov    $0xa,%edi
call   1030 <fib@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
br label %3
3: ; preds = %9, %0
%4 = load i32, i32* %2
%5 = icmp sle i32 %4, 10
br i1 %5, label %6, label %12
6: ; preds = %3
%7 = load i32, i32* %2
%8 = call i32 @fib(i32 %7)
br label %9
9: ; preds = %6
%10 = load i32, i32* %2
%11 = add nsw i32 %10, 1
store i32 %11, i32* %2
br label %3
12: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @fib(i32 1)
%2 = tail call i32 @fib(i32 2)
%3 = tail call i32 @fib(i32 3)
%4 = tail call i32 @fib(i32 4)
%5 = tail call i32 @fib(i32 5)
%6 = tail call i32 @fib(i32 6)
%7 = tail call i32 @fib(i32 7)
%8 = tail call i32 @fib(i32 8)
%9 = tail call i32 @fib(i32 9)
%10 = tail call i32 @fib(i32 10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _SC_NPROCESSORS_ONLN;
int sysconf(int /*<<< orphan*/);
int cpu_count() { return sysconf(_SC_NPROCESSORS_ONLN); }


x86 assembly (clang, -O0):
<cpu_count>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <sysconf@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @cpu_count() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = call i32 @sysconf(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@_SC_NPROCESSORS_ONLN = global i32 0
define i32 @cpu_count() {
%1 = load i32, i32* @_SC_NPROCESSORS_ONLN
%2 = tail call i32 @sysconf(i32 %1)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ utmpname(char const *);
extern void _p_utmpname(const char *filename) { utmpname(filename); }


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

x86 assembly (clang, -O2):
<_p_utmpname>:
jmp    1030 <utmpname@plt>

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

LLVM IR (-O2):
define void @_p_utmpname(i8* %0) {
%2 = tail call i32 @utmpname(i8* %0)
ret void
}
unsigned int fuzz(unsigned int bizz[][10]) { return bizz[1][1]; }


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

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

LLVM IR (-O0):
define i32 @fuzz([10 x i32]* %0) {
%2 = alloca [10 x i32]*
store [10 x i32]* %0, [10 x i32]** %2
%3 = load [10 x i32]*, [10 x i32]** %2
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %3, i64 1
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %4, i64 0, i64 1
%6 = load i32, i32* %5
ret i32 %6
}

LLVM IR (-O2):
define i32 @fuzz([10 x i32]* nocapture %0) {
%2 = getelementptr inbounds [10 x i32], [10 x i32]* %0, i64 1, i64 1
%3 = load i32, i32* %2
ret i32 %3
}
int config_IPV6SUPPORT(void) { return 0; }


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

x86 assembly (clang, -O2):
<config_IPV6SUPPORT>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @config_IPV6SUPPORT() {
ret i32 0
}

LLVM IR (-O2):
define i32 @config_IPV6SUPPORT() {
ret i32 0
}
void RTCircBufReset(void) {}


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

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

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

LLVM IR (-O2):
define void @RTCircBufReset() {
ret void
}
/* Variables and functions */
int exact_square(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num1, end;
  scanf("%d", &num1);
  end = exact_square(num1);
  printf("%d\n", end);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1040 <exact_square@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%esi
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xec8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1050 <scanf@plt>
mov    0x4(%rsp),%edi
call   1040 <exact_square@plt>
lea    0xeb1(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @exact_square(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %7)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @exact_square(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
ret i32 0
}
/* Type definitions */
struct glview {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct glview *);
void glview_release(struct glview *m) { free(m); }


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

x86 assembly (clang, -O2):
<glview_release>:
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.glview = type { i32 }
define void @glview_release(%struct.glview* %0) {
%2 = alloca %struct.glview*
store %struct.glview* %0, %struct.glview** %2
%3 = load %struct.glview*, %struct.glview** %2
%4 = call i32 @free(%struct.glview* %3)
ret void
}

LLVM IR (-O2):
%struct.glview = type { i32 }
define void @glview_release(%struct.glview* nocapture %0) {
%2 = tail call i32 @free(%struct.glview* %0)
ret void
}
void ABGRToYRow_C() {}


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

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

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

LLVM IR (-O2):
define void @ABGRToYRow_C() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ initialize_timer();
void reset_timer(void) { initialize_timer(); }


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

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

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

LLVM IR (-O2):
define void @reset_timer() {
%1 = tail call i32 (...) @initialize_timer()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ h264nal_init(int /*<<< orphan*/ *);
int /*<<< orphan*/ h264nal_set_type(int /*<<< orphan*/ *, int);
void h264sei_init(uint8_t *p_h264sei) {
  h264nal_init(p_h264sei);
  h264nal_set_type(p_h264sei, 6);
}


x86 assembly (clang, -O0):
<h264sei_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <h264nal_init@plt>
mov    -0x8(%rbp),%rdi
mov    $0x6,%esi
call   1030 <h264nal_set_type@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<h264sei_init>:
push   %rbx
mov    %rdi,%rbx
call   1040 <h264nal_init@plt>
mov    %rbx,%rdi
mov    $0x6,%esi
pop    %rbx
jmp    1030 <h264nal_set_type@plt>

LLVM IR (-O0):
define void @h264sei_init(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = call i32 @h264nal_init(i32* %3)
%5 = load i32*, i32** %2
%6 = call i32 @h264nal_set_type(i32* %5, i32 6)
ret void
}

LLVM IR (-O2):
define void @h264sei_init(i32* %0) {
%2 = tail call i32 @h264nal_init(i32* %0)
%3 = tail call i32 @h264nal_set_type(i32* %0, i32 6)
ret void
}
/* Variables and functions */
char *my_newString_float(float);
char *value_to_string_FL32(float value) { return my_newString_float(value); }


x86 assembly (clang, -O0):
<value_to_string_FL32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <my_newString_float@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<value_to_string_FL32>:
jmp    1030 <my_newString_float@plt>

LLVM IR (-O0):
define i8* @value_to_string_FL32(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = call i8* @my_newString_float(float %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @value_to_string_FL32(float %0) {
%2 = tail call i8* @my_newString_float(float %0)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ clear_io_bit(int, int);
void TOSH_CLR_RADIO_FIFO_PIN() { clear_io_bit(-1, 6); }


x86 assembly (clang, -O0):
<TOSH_CLR_RADIO_FIFO_PIN>:
push   %rbp
mov    %rsp,%rbp
mov    $0xffffffff,%edi
mov    $0x6,%esi
call   1030 <clear_io_bit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<TOSH_CLR_RADIO_FIFO_PIN>:
mov    $0xffffffff,%edi
mov    $0x6,%esi
jmp    1030 <clear_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_CLR_RADIO_FIFO_PIN() {
%1 = call i32 @clear_io_bit(i32 -1, i32 6)
ret void
}

LLVM IR (-O2):
define void @TOSH_CLR_RADIO_FIFO_PIN() {
%1 = tail call i32 @clear_io_bit(i32 -1, i32 6)
ret void
}
void __sig_ignore(int signum) {}


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

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

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

LLVM IR (-O2):
define void @__sig_ignore(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
char *Getcwd(char *, int);
int strcmp(char const *, char *);
int main(int argc, char *argv[]) {
  char buf[2048];
  const char *cwd = Getcwd(buf, sizeof(buf));
  return strcmp(cwd, argv[1]);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x820,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x810(%rbp),%rdi
mov    $0x800,%esi
call   1030 <Getcwd@plt>
mov    %rax,-0x818(%rbp)
mov    -0x818(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
call   1040 <strcmp@plt>
add    $0x820,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x800,%rsp
mov    %rsi,%rbx
mov    %rsp,%rdi
mov    $0x800,%esi
call   1030 <Getcwd@plt>
mov    0x8(%rbx),%rsi
mov    %rax,%rdi
call   1040 <strcmp@plt>
add    $0x800,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2048 x i8]
%7 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%8 = getelementptr inbounds [2048 x i8], [2048 x i8]* %6, i64 0, i64 0
%9 = call i8* @Getcwd(i8* %8, i32 2048)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strcmp(i8* %10, i8* %13)
ret i32 %14
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2048 x i8]
%4 = getelementptr inbounds [2048 x i8], [2048 x i8]* %3, i64 0, i64 0
%5 = call i8* @Getcwd(i8* %4, i32 2048)
%6 = getelementptr inbounds i8*, i8** %1, i64 1
%7 = load i8*, i8** %6
%8 = call i32 @strcmp(i8* dereferenceable(1) %5, i8* dereferenceable(1) %7)
ret i32 %8
}
void av_tx_uninit() {}


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

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

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

LLVM IR (-O2):
define void @av_tx_uninit() {
ret void
}
int tmult_ok1(char x, char y) {
  char prod = x * y;
  int iprod = (int)x * y;
  return iprod == prod;
}


x86 assembly (clang, -O0):
<tmult_ok1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
mov    %al,-0x3(%rbp)
movsbl -0x1(%rbp),%eax
movsbl -0x2(%rbp),%ecx
imul   %ecx,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl -0x3(%rbp),%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tmult_ok1>:
imul   %esi,%edi
movsbl %dil,%ecx
xor    %eax,%eax
cmp    %edi,%ecx
sete   %al
ret

LLVM IR (-O0):
define i32 @tmult_ok1(i8 signext %0, i8 signext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
%7 = load i8, i8* %3
%8 = sext i8 %7 to i32
%9 = load i8, i8* %4
%10 = sext i8 %9 to i32
%11 = mul nsw i32 %8, %10
%12 = trunc i32 %11 to i8
store i8 %12, i8* %5
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = load i8, i8* %4
%16 = sext i8 %15 to i32
%17 = mul nsw i32 %14, %16
store i32 %17, i32* %6
%18 = load i32, i32* %6
%19 = load i8, i8* %5
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %18, %20
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @tmult_ok1(i8 signext %0, i8 signext %1) {
%3 = sext i8 %0 to i32
%4 = sext i8 %1 to i32
%5 = mul nsw i32 %4, %3
%6 = add nsw i32 %5, 128
%7 = icmp ult i32 %6, 256
%8 = zext i1 %7 to i32
ret i32 %8
}
int recursive_call(char *qname) { return 0; }


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

x86 assembly (clang, -O2):
<recursive_call>:
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @recursive_call(i8* nocapture readnone %0) {
ret i32 0
}
int execute_linkat() { return 0; }


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

x86 assembly (clang, -O2):
<execute_linkat>:
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @execute_linkat() {
ret i32 0
}

LLVM IR (-O2):
define i32 @execute_linkat() {
ret i32 0
}
/* Variables and functions */
size_t strlen(char *const);
size_t pfl_fts_maxarglen(char *const *argv) {
  size_t len, max;
  for (max = 0; *argv; ++argv)
    if ((len = strlen(*argv)) > max)
      max = len;
  return (max + 1);
}


x86 assembly (clang, -O0):
<pfl_fts_maxarglen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,(%rax)
je     116a <pfl_fts_maxarglen+0x5a>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x10(%rbp)
cmp    -0x18(%rbp),%rax
jbe    1154 <pfl_fts_maxarglen+0x44>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1159 <pfl_fts_maxarglen+0x49>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <pfl_fts_maxarglen+0x14>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pfl_fts_maxarglen>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    (%rdi),%rdi
test   %rdi,%rdi
je     114e <pfl_fts_maxarglen+0x3e>
add    $0x8,%rbx
xor    %r14d,%r14d
cs nopw 0x0(%rax,%rax,1)
call   1030 <strlen@plt>
cmp    %r14,%rax
cmova  %rax,%r14
mov    (%rbx),%rdi
add    $0x8,%rbx
test   %rdi,%rdi
jne    1130 <pfl_fts_maxarglen+0x20>
add    $0x1,%r14
jmp    1154 <pfl_fts_maxarglen+0x44>
mov    $0x1,%r14d
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @pfl_fts_maxarglen(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = icmp eq i8* %2, null
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8* [ %12, %4 ], [ %2, %1 ]
%6 = phi i64 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8** [ %11, %4 ], [ %0, %1 ]
%8 = tail call i64 @strlen(i8* %5)
%9 = icmp ugt i64 %8, %6
%10 = select i1 %9, i64 %8, i64 %6
%11 = getelementptr inbounds i8*, i8** %7, i64 1
%12 = load i8*, i8** %11
%13 = icmp eq i8* %12, null
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = add i64 %10, 1
br label %16
16: ; preds = %14, %1
%17 = phi i64 [ 1, %1 ], [ %15, %14 ]
ret i64 %17
}
__attribute__((weak)) void fd_nrf8001_read_dynamic_data_complete(void) {}


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

x86 assembly (clang, -O2):
ret

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

LLVM IR (-O2):
define weak void @fd_nrf8001_read_dynamic_data_complete() {
ret void
}
int compareDoubleDescending(const void *i, const void *j) {
  double a = *(double *)i;
  double b = *(double *)j;
  if (a > b) {
    return -1;
  }
  if (a < b) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<compareDoubleDescending>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jbe    1142 <compareDoubleDescending+0x42>
movl   $0xffffffff,-0x4(%rbp)
jmp    1169 <compareDoubleDescending+0x69>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1162 <compareDoubleDescending+0x62>
movl   $0x1,-0x4(%rbp)
jmp    1169 <compareDoubleDescending+0x69>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @compareDoubleDescending(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 ogt double %4, %6
%8 = fcmp olt double %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void docolnumber(int numbercolumns) {
  static int colnum = 1;
  if (numbercolumns)
    printf("%d_", colnum);
  colnum++;
}


x86 assembly (clang, -O0):
<docolnumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1137 <docolnumber+0x27>
mov    0x2efd(%rip),%esi
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    0x2eeb(%rip),%eax
add    $0x1,%eax
mov    %eax,0x2ee2(%rip)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<docolnumber>:
push   %rax
test   %edi,%edi
je     1127 <docolnumber+0x17>
mov    0x2f0d(%rip),%esi
lea    0xede(%rip),%rdi
call   1030 <printf@plt>
addl   $0x1,0x2efa(%rip)
pop    %rax
ret

LLVM IR (-O0):
@docolnumber.colnum = internal global i32 1
@.str = [4 x i8] c"%d_\00"
define void @docolnumber(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @docolnumber.colnum
%7 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %8
8: ; preds = %5, %1
%9 = load i32, i32* @docolnumber.colnum
%10 = add nsw i32 %9, 1
store i32 %10, i32* @docolnumber.colnum
ret void
}

LLVM IR (-O2):
@docolnumber.colnum = internal unnamed_addr global i32 1
@.str = [4 x i8] c"%d_\00"
define void @docolnumber(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = load i32, i32* @docolnumber.colnum
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
br label %6
6: ; preds = %3, %1
%7 = load i32, i32* @docolnumber.colnum
%8 = add nsw i32 %7, 1
store i32 %8, i32* @docolnumber.colnum
ret void
}
unsigned long align16(unsigned long val) { return ((val + 15) & ~15); }


x86 assembly (clang, -O0):
<align16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<align16>:
lea    0xf(%rdi),%rax
and    $0xfffffffffffffff0,%rax
ret

LLVM IR (-O0):
define i64 @align16(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add i64 %3, 15
%5 = and i64 %4, -16
ret i64 %5
}

LLVM IR (-O2):
define i64 @align16(i64 %0) {
%2 = add i64 %0, 15
%3 = and i64 %2, -16
ret i64 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int);
void lcd_clear_and_home() {
  printf("%s:%d\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/"
         "mock/lcd.c",
         13);
}


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

x86 assembly (clang, -O2):
<lcd_clear_and_home>:
lea    0xee9(%rip),%rdi
lea    0xee9(%rip),%rsi
mov    $0xd,%edx
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_clear_and_home() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"%s:%d\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/beerriot/blockgame/refs/heads/master/test/mock/lcd.c\00"
define void @lcd_clear_and_home() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 13)
ret void
}
/* Type definitions */
struct Cyc_Absyn_Exp {
  int dummy;
};

/* Variables and functions */
struct Cyc_Absyn_Exp *Cyc_Absyn_prim2_exp(unsigned int, struct Cyc_Absyn_Exp *,
                                          struct Cyc_Absyn_Exp *, unsigned int);
struct Cyc_Absyn_Exp *Cyc_Absyn_times_exp(struct Cyc_Absyn_Exp *e1,
                                          struct Cyc_Absyn_Exp *e2,
                                          unsigned loc) {
  struct Cyc_Absyn_Exp *_T0;
  _T0 = Cyc_Absyn_prim2_exp(1U, e1, e2, loc);
  return _T0;
}


x86 assembly (clang, -O0):
<Cyc_Absyn_times_exp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
mov    $0x1,%edi
call   1030 <Cyc_Absyn_prim2_exp@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cyc_Absyn_times_exp>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x1,%edi
jmp    1030 <Cyc_Absyn_prim2_exp@plt>

LLVM IR (-O0):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_times_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = alloca %struct.Cyc_Absyn_Exp*
%5 = alloca %struct.Cyc_Absyn_Exp*
%6 = alloca i32
%7 = alloca %struct.Cyc_Absyn_Exp*
store %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp** %4
store %struct.Cyc_Absyn_Exp* %1, %struct.Cyc_Absyn_Exp** %5
store i32 %2, i32* %6
%8 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %4
%9 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %5
%10 = load i32, i32* %6
%11 = call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 1, %struct.Cyc_Absyn_Exp* %8, %struct.Cyc_Absyn_Exp* %9, i32 %10)
store %struct.Cyc_Absyn_Exp* %11, %struct.Cyc_Absyn_Exp** %7
%12 = load %struct.Cyc_Absyn_Exp*, %struct.Cyc_Absyn_Exp** %7
ret %struct.Cyc_Absyn_Exp* %12
}

LLVM IR (-O2):
%struct.Cyc_Absyn_Exp = type { i32 }
define %struct.Cyc_Absyn_Exp* @Cyc_Absyn_times_exp(%struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2) {
%4 = tail call %struct.Cyc_Absyn_Exp* @Cyc_Absyn_prim2_exp(i32 1, %struct.Cyc_Absyn_Exp* %0, %struct.Cyc_Absyn_Exp* %1, i32 %2)
ret %struct.Cyc_Absyn_Exp* %4
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int creat(char *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int fd = creat(*++argv, O_RDONLY);
  close(fd);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
mov    0x2e98(%rip),%rax
mov    (%rax),%esi
call   1040 <creat@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
mov    0x2e6f(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
call   1040 <creat@plt>
mov    %eax,%edi
call   1030 <close@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDONLY = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = getelementptr inbounds i8*, i8** %7, i32 1
store i8** %8, i8*** %5
%9 = load i8*, i8** %8
%10 = load i32, i32* @O_RDONLY
%11 = call i32 @creat(i8* %9, i32 %10)
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = call i32 @close(i32 %12)
%14 = load i32, i32* @EXIT_SUCCESS
ret i32 %14
}

LLVM IR (-O2):
@O_RDONLY = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = load i32, i32* @O_RDONLY
%6 = tail call i32 @creat(i8* %4, i32 %5)
%7 = tail call i32 @close(i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ blz_log2(unsigned long);
unsigned long blz_gamma_cost(unsigned long n) {
  assert(n >= 2);
  return 2 * (unsigned long)blz_log2(n);
}


x86 assembly (clang, -O0):
<blz_gamma_cost>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x2,-0x8(%rbp)
setae  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1040 <blz_log2@plt>
shl    $0x1,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blz_gamma_cost>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x2,%rbx
setae  %dil
call   1030 <assert@plt>
mov    %rbx,%rdi
call   1040 <blz_log2@plt>
add    %rax,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i64 @blz_gamma_cost(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp uge i64 %3, 2
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load i64, i64* %2
%8 = call i64 @blz_log2(i64 %7)
%9 = mul i64 2, %8
ret i64 %9
}

LLVM IR (-O2):
define i64 @blz_gamma_cost(i64 %0) {
%2 = icmp ugt i64 %0, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i64 @blz_log2(i64 %0)
%6 = shl i64 %5, 1
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("%d\n", ((100 * (100 + 1)) / 2) * ((100 * (100 + 1)) / 2) -
                     (100 * (100 + 1) * (2 * 100 + 1)) / 6);
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
mov    $0x17ff976,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 25164150)
ret i32 0
}
void newstyle0(void) { ; }


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

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

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

LLVM IR (-O2):
define void @newstyle0() {
ret void
}