xunge/DecIR huggingface dataset:
int isogcd(int i, int j) {
  if (i == 0)
    return j;
  if (j == 0)
    return i;
  while (i != j) {
    if (i > j)
      i -= j;
    else
      j -= i;
  }
  return i;
}


x86 assembly (clang, -O0):
<isogcd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <isogcd+0x1f>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <isogcd+0x77>
cmpl   $0x0,-0xc(%rbp)
jne    1134 <isogcd+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <isogcd+0x77>
jmp    1139 <isogcd+0x39>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
je     1171 <isogcd+0x71>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1161 <isogcd+0x61>
mov    -0xc(%rbp),%ecx
mov    -0x8(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x8(%rbp)
jmp    116c <isogcd+0x6c>
mov    -0x8(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1139 <isogcd+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isogcd>:
test   %edi,%edi
je     1128 <isogcd+0x28>
mov    %edi,%eax
test   %esi,%esi
je     1127 <isogcd+0x27>
cmp    %esi,%eax
je     1127 <isogcd+0x27>
xor    %ecx,%ecx
cmp    %eax,%esi
mov    $0x0,%edx
cmovl  %esi,%edx
mov    %eax,%edi
cmovl  %ecx,%edi
sub    %edx,%eax
sub    %edi,%esi
cmp    %esi,%eax
jne    1110 <isogcd+0x10>
ret
mov    %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @isogcd(i32 %0, i32 %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %17, label %4
4: ; preds = %2
%5 = icmp eq i32 %1, 0
%6 = icmp eq i32 %0, %1
%7 = or i1 %5, %6
br i1 %7, label %17, label %8
8: ; preds = %4, %8
%9 = phi i32 [ %15, %8 ], [ %1, %4 ]
%10 = phi i32 [ %13, %8 ], [ %0, %4 ]
%11 = icmp slt i32 %9, %10
%12 = select i1 %11, i32 %9, i32 0
%13 = sub nsw i32 %10, %12
%14 = select i1 %11, i32 0, i32 %10
%15 = sub nsw i32 %9, %14
%16 = icmp eq i32 %13, %15
br i1 %16, label %17, label %8
17: ; preds = %8, %4, %2
%18 = phi i32 [ %1, %2 ], [ %0, %4 ], [ %13, %8 ]
ret i32 %18
}
/* Variables and functions */
char *calloc(int, int);
char *callocString(int size) { return calloc(size, sizeof(char)); }


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

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

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

LLVM IR (-O2):
define noalias i8* @callocString(i32 %0) {
%2 = tail call i8* @calloc(i32 %0, i32 1)
ret i8* %2
}
void poly_free(void *vstate) {}


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

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

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

LLVM IR (-O2):
define void @poly_free(i8* nocapture %0) {
ret void
}
void ExttVUTAuxTable(void) {}


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

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

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

LLVM IR (-O2):
define void @ExttVUTAuxTable() {
ret void
}
void main() {
  int y;
  if (y > 1) {
    y = 2;
  ERROR:
    goto ERROR;
  } else {
    y = 3;
    goto ERROR;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x1,-0x4(%rbp)
jle    111a <main+0x1a>
movl   $0x2,-0x4(%rbp)
jmp    1115 <main+0x15>
movl   $0x3,-0x4(%rbp)
jmp    1115 <main+0x15>

x86 assembly (clang, -O2):
<main>:
jmp    1100 <main>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = load i32, i32* %1
%3 = icmp sgt i32 %2, 1
br i1 %3, label %4, label %6
4: ; preds = %0
store i32 2, i32* %1
br label %5
5: ; preds = %6, %5, %4
br label %5
6: ; preds = %0
store i32 3, i32* %1
br label %5
}

LLVM IR (-O2):
define void @main() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Type definitions */
typedef unsigned long uint64_t;
struct timespec {
  unsigned long tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
uint64_t timespec_to_ns(const struct timespec *ts) {
  return (uint64_t)ts->tv_sec * 1000000000UL + ts->tv_nsec;
}


x86 assembly (clang, -O0):
<timespec_to_ns>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
imul   $0x3b9aca00,0x8(%rax),%rax
3b
mov    -0x8(%rbp),%rcx
add    (%rcx),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<timespec_to_ns>:
imul   $0x3b9aca00,0x8(%rdi),%rax
3b
add    (%rdi),%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_ns(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %2
%3 = load %struct.timespec*, %struct.timespec** %2
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000000
%7 = load %struct.timespec*, %struct.timespec** %2
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %7, i32 0, i32 0
%9 = load i64, i64* %8
%10 = add i64 %6, %9
ret i64 %10
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define i64 @timespec_to_ns(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = mul i64 %3, 1000000000
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = add i64 %4, %6
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ mp_msg(int, int /*<<< orphan*/, char *);
void flip_page(void) {
  mp_msg(3, 0, "xover error: didn't used sub vo flip_page!\n");
}


x86 assembly (clang, -O0):
<flip_page>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
xor    %esi,%esi
lea    0xede(%rip),%rdx
call   1030 <mp_msg@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_page>:
lea    0xee9(%rip),%rdx
mov    $0x3,%edi
xor    %esi,%esi
jmp    1030 <mp_msg@plt>

LLVM IR (-O0):
@.str = [44 x i8] c"xover error: didn't used sub vo flip_page!\0A\00"
define void @flip_page() {
%1 = call i32 @mp_msg(i32 3, i32 0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [44 x i8] c"xover error: didn't used sub vo flip_page!\0A\00"
define void @flip_page() {
%1 = tail call i32 @mp_msg(i32 3, i32 0, i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
ret void
}
void SCB_EnableDCache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_EnableDCache() {
ret void
}
/* Variables and functions */
int test_sat_parser_should_fail(char *);
int test16(void) {
  return test_sat_parser_should_fail("(a or -bc) and(-a or c)");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"(a or -bc) and(-a or c)\00"
define i32 @test16() {
%1 = call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [24 x i8] c"(a or -bc) and(-a or c)\00"
define i32 @test16() {
%1 = tail call i32 @test_sat_parser_should_fail(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret i32 %1
}
int pbyte(unsigned int nbloque) {
  int i = nbloque / 8;
  return (i);
}


x86 assembly (clang, -O0):
<pbyte>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x3,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pbyte>:
mov    %edi,%eax
shr    $0x3,%eax
ret

LLVM IR (-O0):
define i32 @pbyte(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = udiv i32 %4, 8
store i32 %5, i32* %3
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
define i32 @pbyte(i32 %0) {
%2 = lshr i32 %0, 3
ret i32 %2
}
short quant1bit(short f0, short f1) {
  short sampout;
  if ((f1 - f0) > 0)
    sampout = 3999;
  else
    sampout = 0;
  return sampout;
}


x86 assembly (clang, -O0):
<quant1bit>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
movswl -0x2(%rbp),%ecx
sub    %ecx,%eax
cmp    $0x0,%eax
jle    1130 <quant1bit+0x30>
movw   $0xf9f,-0x6(%rbp)
jmp    1136 <quant1bit+0x36>
movw   $0x0,-0x6(%rbp)
movswl -0x6(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<quant1bit>:
xor    %ecx,%ecx
cmp    %di,%si
mov    $0xf9f,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define signext i16 @quant1bit(i16 signext %0, i16 signext %1) {
%3 = icmp sgt i16 %1, %0
%4 = select i1 %3, i16 3999, i16 0
ret i16 %4
}
/* Variables and functions */
size_t getDefaultSize() { return 131072; }


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

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

LLVM IR (-O0):
define i64 @getDefaultSize() {
ret i64 131072
}

LLVM IR (-O2):
define i64 @getDefaultSize() {
ret i64 131072
}
/* Type definitions */
typedef scalar_t__ off_t;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
scalar_t__ lseek(int, int /*<<< orphan*/, int /*<<< orphan*/);
off_t tail_seek_end(int fd, off_t *off_p) {
  off_t new_off = lseek(fd, 0, SEEK_END);
  if (new_off != (off_t)-1 && off_p) {
    *off_p = new_off;
  }
  return new_off;
}


x86 assembly (clang, -O0):
<tail_seek_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebf(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0xffffffffffffffff,-0x18(%rbp)
je     1157 <tail_seek_end+0x47>
cmpq   $0x0,-0x10(%rbp)
je     1157 <tail_seek_end+0x47>
mov    -0x18(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tail_seek_end>:
push   %rbx
mov    %rsi,%rbx
mov    0x2ecd(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1030 <lseek@plt>
test   %rbx,%rbx
je     1132 <tail_seek_end+0x22>
cmp    $0xffffffffffffffff,%rax
je     1132 <tail_seek_end+0x22>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @tail_seek_end(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i32, i32* %3
%7 = load i32, i32* @SEEK_END
%8 = call i64 @lseek(i32 %6, i32 0, i32 %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
%10 = icmp ne i64 %9, -1
br i1 %10, label %11, label %17
11: ; preds = %2
%12 = load i64*, i64** %4
%13 = icmp ne i64* %12, null
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = load i64, i64* %5
%16 = load i64*, i64** %4
store i64 %15, i64* %16
br label %17
17: ; preds = %14, %11, %2
%18 = load i64, i64* %5
ret i64 %18
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @tail_seek_end(i32 %0, i64* writeonly %1) {
%3 = load i32, i32* @SEEK_END
%4 = tail call i64 @lseek(i32 %0, i32 0, i32 %3)
%5 = icmp ne i64 %4, -1
%6 = icmp ne i64* %1, null
%7 = and i1 %6, %5
br i1 %7, label %8, label %9
8: ; preds = %2
store i64 %4, i64* %1
br label %9
9: ; preds = %8, %2
ret i64 %4
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *date_time_stamp(void) {
  time_t t;
  static char t_stamp[25];
  t = time(NULL);
  strftime(t_stamp, 22, "%d-%b-%Y, %H:%M:%S", localtime(&t));
  return t_stamp;
}


x86 assembly (clang, -O0):
<date_time_stamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %eax,%ecx
lea    0x2efa(%rip),%rdi
mov    $0x16,%esi
lea    0xe9e(%rip),%rdx
call   1050 <strftime@plt>
lea    0x2ee2(%rip),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_time_stamp>:
push   %rbx
sub    $0x10,%rsp
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdi
call   1030 <localtime@plt>
lea    0x2eff(%rip),%rbx
lea    0xea8(%rip),%rdx
mov    %rbx,%rdi
mov    $0x16,%esi
mov    %eax,%ecx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@date_time_stamp.t_stamp = internal global [25 x i8] zeroinitializer
@.str = [19 x i8] c"%d-%b-%Y, %H:%M:%S\00"
define i8* @date_time_stamp() {
%1 = alloca i32
%2 = call i32 @time(i32* null)
store i32 %2, i32* %1
%3 = call i32 @localtime(i32* %1)
%4 = call i32 @strftime(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @date_time_stamp.t_stamp, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %3)
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @date_time_stamp.t_stamp, i64 0, i64 0)
}

LLVM IR (-O2):
@date_time_stamp.t_stamp = internal global [25 x i8] zeroinitializer
@.str = [19 x i8] c"%d-%b-%Y, %H:%M:%S\00"
define i8* @date_time_stamp() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call i32 @localtime(i32* %1)
%5 = call i32 @strftime(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @date_time_stamp.t_stamp, i64 0, i64 0), i32 22, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i8* getelementptr inbounds ([25 x i8], [25 x i8]* @date_time_stamp.t_stamp, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ sslCloseOsdep();
void matrixPkiClose(void) { sslCloseOsdep(); }


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

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

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

LLVM IR (-O2):
define void @matrixPkiClose() {
%1 = tail call i32 (...) @sslCloseOsdep()
ret void
}
void mt_trace_hrt_start(void *func) {}


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

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

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

LLVM IR (-O2):
define void @mt_trace_hrt_start(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_X509_CRT_WRITE_C and/or MBEDTLS_X509_CRT_PARSE_C and/or "
         "MBEDTLS_FS_IO and/or MBEDTLS_SHA256_C and/or "
         "MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or "
         "MBEDTLS_ERROR_C not defined.\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [190 x i8] c"MBEDTLS_X509_CRT_WRITE_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_SHA256_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_ERROR_C not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([190 x i8], [190 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [189 x i8] c"MBEDTLS_X509_CRT_WRITE_C and/or MBEDTLS_X509_CRT_PARSE_C and/or MBEDTLS_FS_IO and/or MBEDTLS_SHA256_C and/or MBEDTLS_ENTROPY_C and/or MBEDTLS_CTR_DRBG_C and/or MBEDTLS_ERROR_C not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([189 x i8], [189 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void U_WMRSAVEDC_print(const char *contents) { (void)contents; }


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

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

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

LLVM IR (-O2):
define void @U_WMRSAVEDC_print(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int d08(int);
int d09(int a) { return d08(d08(a)); }


x86 assembly (clang, -O0):
<d09>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <d08@plt>
mov    %eax,%edi
call   1030 <d08@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d09>:
push   %rax
call   1030 <d08@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <d08@plt>

LLVM IR (-O0):
define i32 @d09(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @d08(i32 %3)
%5 = call i32 @d08(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @d09(i32 %0) {
%2 = tail call i32 @d08(i32 %0)
%3 = tail call i32 @d08(i32 %2)
ret i32 %3
}
/* Variables and functions */
int ioHasSocketAccess();
int secHasSocketAccess(void) { return ioHasSocketAccess(); }


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

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

LLVM IR (-O0):
define i32 @secHasSocketAccess() {
%1 = call i32 (...) @ioHasSocketAccess()
ret i32 %1
}

LLVM IR (-O2):
define i32 @secHasSocketAccess() {
%1 = tail call i32 (...) @ioHasSocketAccess()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_sinl();
scalar_t__ sinl(long double);
void test_sinl(long double ld) {
  if (sinl(ld) != sinl(ld))
    link_failure_sinl();
}


x86 assembly (clang, -O0):
<test_sinl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <sinl@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_sinl+0x43>
mov    $0x0,%al
call   1040 <link_failure_sinl@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_sinl>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <sinl@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <sinl@plt>
cmp    %rax,%rbx
jne    1151 <test_sinl+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_sinl@plt>

LLVM IR (-O0):
define void @test_sinl(x86_fp80 %0) {
%2 = alloca x86_fp80
store x86_fp80 %0, x86_fp80* %2
%3 = load x86_fp80, x86_fp80* %2
%4 = call i64 @sinl(x86_fp80 %3)
%5 = load x86_fp80, x86_fp80* %2
%6 = call i64 @sinl(x86_fp80 %5)
%7 = icmp ne i64 %4, %6
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 (...) @link_failure_sinl()
br label %10
10: ; preds = %8, %1
ret void
}

LLVM IR (-O2):
define void @test_sinl(x86_fp80 %0) {
%2 = tail call i64 @sinl(x86_fp80 %0)
%3 = tail call i64 @sinl(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_sinl()
br label %7
7: ; preds = %5, %1
ret void
}
int do_287() { return 287; }


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

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

LLVM IR (-O0):
define i32 @do_287() {
ret i32 287
}

LLVM IR (-O2):
define i32 @do_287() {
ret i32 287
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int initialize_multprec_homotopy(int fixed_gamma, int decimals) {
  int fail;
  double *c;
  fail = _ada_use_c2phc4c(512, &fixed_gamma, &decimals, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<initialize_multprec_homotopy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x18(%rbp),%rcx
mov    $0x200,%edi
lea    -0x4(%rbp),%rsi
lea    -0x8(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<initialize_multprec_homotopy>:
push   %rax
mov    %edi,0x4(%rsp)
mov    %esi,(%rsp)
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
mov    $0x200,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @initialize_multprec_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load double*, double** %6
%8 = call i32 @_ada_use_c2phc4c(i32 512, i32* %3, i32* %4, double* %7, i32 0)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @initialize_multprec_homotopy(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 @_ada_use_c2phc4c(i32 512, i32* %3, i32* %4, double* undef, i32 0)
ret i32 %5
}
void ReadFence() { asm volatile("" : : : "memory"); }


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

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

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

LLVM IR (-O2):
define void @ReadFence() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
__attribute__((section(".after_vectors"))) void MemManage_Handler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<MemManage_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <MemManage_Handler+0x9>
jmp    1109 <MemManage_Handler+0x9>

x86 assembly (clang, -O2):
<MemManage_Handler>:
jmp    1100 <MemManage_Handler>

LLVM IR (-O0):
define void @MemManage_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @MemManage_Handler() section ".after_vectors" {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(double *, double *, int);
int main() {
  double *dev_a = (double *)malloc(sizeof(double));
  double a = 1;
  memcpy(dev_a, &a, sizeof(double));
  assert(dev_a[0] == 2);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
movsd  0xeb3(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1040 <memcpy@plt>
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  0xe84(%rip),%xmm1
ucomisd %xmm1,%xmm0
sete   %al
setnp  %cl
and    %cl,%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
mov    $0x8,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
movabs $0x3ff0000000000000,%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
mov    $0x8,%edx
call   1040 <memcpy@plt>
movsd  0xe95(%rip),%xmm0
cmpeqsd (%rbx),%xmm0
movq   %xmm0,%rdi
and    $0x1,%edi
call   1030 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double*
%3 = alloca double
store i32 0, i32* %1
%4 = call i64 @malloc(i32 8)
%5 = inttoptr i64 %4 to double*
store double* %5, double** %2
store double 1.000000e+00, double* %3
%6 = load double*, double** %2
%7 = call i32 @memcpy(double* %6, double* %3, i32 8)
%8 = load double*, double** %2
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fcmp oeq double %10, 2.000000e+00
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca double
%2 = tail call i64 @malloc(i32 8)
%3 = inttoptr i64 %2 to double*
%4 = bitcast double* %1 to i8*
store double 1.000000e+00, double* %1
%5 = call i32 @memcpy(double* %3, double* %1, i32 8)
%6 = load double, double* %3
%7 = fcmp oeq double %6, 2.000000e+00
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ test_passfail();
int main(int argc, char **argv) {
  test_passfail();
  while (--argc)
    puts(*++argv);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_passfail@plt>
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
je     116c <main+0x4c>
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x10(%rbp)
mov    0x8(%rax),%rdi
call   1030 <puts@plt>
jmp    113d <main+0x1d>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <test_passfail@plt>
cmp    $0x1,%ebp
je     1151 <main+0x31>
mov    %ebp,%ebp
mov    $0x1,%ebx
nopl   0x0(%rax)
mov    (%r14,%rbx,8),%rdi
call   1030 <puts@plt>
add    $0x1,%rbx
cmp    %ebx,%ebp
jne    1140 <main+0x20>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = tail call i32 (...) @test_passfail()
%4 = add nsw i32 %0, -1
%5 = icmp eq i32 %4, 0
br i1 %5, label %14, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %12, %6 ], [ %4, %2 ]
%8 = phi i8** [ %9, %6 ], [ %1, %2 ]
%9 = getelementptr inbounds i8*, i8** %8, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @puts(i8* dereferenceable(1) %10)
%12 = add nsw i32 %7, -1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *myname) { printf("%s image.adf image.hfe\n", myname); }


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [24 x i8] c"%s image.adf image.hfe\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int task_led_handler(void *task, int e) { return (-1); }


x86 assembly (clang, -O0):
<task_led_handler>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @task_led_handler(i8* nocapture readnone %0, i32 %1) {
ret i32 -1
}
double match(double p, double q, void *data) {
  (void)data;
  return (1 - p) * (1 - q) + p * q / 3;
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
movsd  0xeee(%rip),%xmm0
subsd  -0x8(%rbp),%xmm0
movsd  0xee1(%rip),%xmm2
subsd  -0x10(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  -0x10(%rbp),%xmm1
movsd  0xec2(%rip),%xmm3
divsd  %xmm3,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
movsd  0xef8(%rip),%xmm2
movapd %xmm2,%xmm3
subsd  %xmm0,%xmm3
subsd  %xmm1,%xmm2
mulsd  %xmm3,%xmm2
mulsd  %xmm1,%xmm0
divsd  0xee4(%rip),%xmm0
addsd  %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @match(double %0, double %1, i8* %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca i8*
store double %0, double* %4
store double %1, double* %5
store i8* %2, i8** %6
%7 = load i8*, i8** %6
%8 = load double, double* %4
%9 = fsub double 1.000000e+00, %8
%10 = load double, double* %5
%11 = fsub double 1.000000e+00, %10
%12 = load double, double* %4
%13 = load double, double* %5
%14 = fmul double %12, %13
%15 = fdiv double %14, 3.000000e+00
%16 = call double @llvm.fmuladd.f64(double %9, double %11, double %15)
ret double %16
}

LLVM IR (-O2):
define double @match(double %0, double %1, i8* nocapture readnone %2) {
%4 = fsub double 1.000000e+00, %0
%5 = fsub double 1.000000e+00, %1
%6 = fmul double %0, %1
%7 = fdiv double %6, 3.000000e+00
%8 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %7)
ret double %8
}
int atoi(const char *nptr) { return *nptr; }


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

x86 assembly (clang, -O2):
<atoi>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @atoi(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int link(const char *path1, const char *path2) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ed5(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebc(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<link>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @link(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i32, i32* @EACCES
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @EACCES
store i32 %3, i32* @errno
ret i32 -1
}
void test_main(void) {}


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

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

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

LLVM IR (-O2):
define void @test_main() {
ret void
}
int ffs(int i) {
  int ret = 0;
  if (i == 0)
    return ret;
  __asm__ __volatile__("bsf %0, %1" : "=r"(ret) : "r"(i));
  return ++ret;
  return ret;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1123 <ffs+0x23>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1138 <ffs+0x38>
mov    -0x8(%rbp),%eax
bsf    %eax,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     110b <ffs+0xb>
bsf    %eax,%edi
add    $0x1,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @ffs(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 0, i32* %4
%5 = load i32, i32* %3
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %4
store i32 %8, i32* %2
br label %14
9: ; preds = %1
%10 = load i32, i32* %3
%11 = call i32 asm sideeffect "bsf $0, $1", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %10)
store i32 %11, i32* %4
%12 = load i32, i32* %4
%13 = add nsw i32 %12, 1
store i32 %13, i32* %4
store i32 %13, i32* %2
br label %14
14: ; preds = %9, %7
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 asm sideeffect "bsf $0, $1", "=r,r,~{dirflag},~{fpsr},~{flags}"(i32 %0)
%5 = add nsw i32 %4, 1
br label %6
6: ; preds = %1, %3
%7 = phi i32 [ %5, %3 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ abort();
void target_crash(void) { abort(); }


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

x86 assembly (clang, -O2):
<target_crash>:
push   %rax
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define void @target_crash() {
%1 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
define void @target_crash() {
%1 = tail call i32 (...) @abort()
unreachable
}
int qsort_cmp(const void *a, const void *b) { return *(int *)a > *(int *)b; }


x86 assembly (clang, -O0):
<qsort_cmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
cmp    (%rcx),%eax
setg   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<qsort_cmp>:
mov    (%rdi),%ecx
xor    %eax,%eax
cmp    (%rsi),%ecx
setg   %al
ret

LLVM IR (-O0):
define i32 @qsort_cmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = icmp sgt i32 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @qsort_cmp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = icmp sgt i32 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
scalar_t__ itostr(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ print(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
char const *str;
int /*<<< orphan*/ strlen(char const *);
void printNum(int n, int base) {
  if (n < 0) {
    printf("-");
    n = -n;
  }
  const char *str = (const char *)itostr(n, str, base);
  print(str, strlen(str));
}


x86 assembly (clang, -O0):
<printNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    116c <printNum+0x2c>
lea    0xea1(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x8(%rbp),%edx
call   1060 <itostr@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1050 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNum>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
test   %edi,%edi
jns    1157 <printNum+0x17>
mov    $0x2d,%edi
call   1030 <putchar@plt>
neg    %ebp
mov    %ebp,%edi
mov    %ebx,%edx
call   1060 <itostr@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1050 <print@plt>

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

LLVM IR (-O2):
@str = global i8* null
define void @printNum(i32 %0, i32 %1) {
%3 = icmp slt i32 %0, 0
br i1 %3, label %4, label %7
4: ; preds = %2
%5 = tail call i32 @putchar(i32 45)
%6 = sub nsw i32 0, %0
br label %7
7: ; preds = %4, %2
%8 = phi i32 [ %6, %4 ], [ %0, %2 ]
%9 = tail call i64 @itostr(i32 %8, i32 undef, i32 %1)
%10 = inttoptr i64 %9 to i8*
%11 = tail call i32 @strlen(i8* %10)
%12 = tail call i32 @print(i8* %10, i32 %11)
ret void
}
/* Variables and functions */
size_t strcspn(char *, char const *);
size_t bm_strip_token(char *string, const char *token, size_t *out_next) {
  size_t len = strcspn(string, token);
  if (out_next)
    *out_next = len + (string[len] != 0);
  string[len] = 0;
  return len;
}


x86 assembly (clang, -O0):
<bm_strip_token>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcspn@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1167 <bm_strip_token+0x57>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rdx
movsbl (%rax,%rdx,1),%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
cltq
add    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bm_strip_token>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rdi,%rbx
call   1030 <strcspn@plt>
test   %r14,%r14
je     1132 <bm_strip_token+0x22>
cmpb   $0x1,(%rbx,%rax,1)
mov    %rax,%rcx
sbb    $0xffffffffffffffff,%rcx
mov    %rcx,(%r14)
movb   $0x0,(%rbx,%rax,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i64 @bm_strip_token(i8* nocapture %0, i8* nocapture %1, i64* writeonly %2) {
%4 = tail call i64 @strcspn(i8* %0, i8* %1)
%5 = icmp eq i64* %2, null
br i1 %5, label %12, label %6
6: ; preds = %3
%7 = getelementptr inbounds i8, i8* %0, i64 %4
%8 = load i8, i8* %7
%9 = icmp ne i8 %8, 0
%10 = zext i1 %9 to i64
%11 = add i64 %4, %10
store i64 %11, i64* %2
br label %12
12: ; preds = %6, %3
%13 = getelementptr inbounds i8, i8* %0, i64 %4
store i8 0, i8* %13
ret i64 %4
}
/* Variables and functions */
void *calloc(unsigned int, unsigned int);
void *zlib_alloc(void *opaque, unsigned int items, unsigned int size) {
  return calloc(items, size);
}


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

x86 assembly (clang, -O2):
<zlib_alloc>:
mov    %esi,%edi
mov    %edx,%esi
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @zlib_alloc(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = call i8* @calloc(i32 %7, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @zlib_alloc(i8* nocapture readnone %0, i32 %1, i32 %2) {
%4 = tail call i8* @calloc(i32 %1, i32 %2)
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ _c_assert(char *, char *, int, int);
int /*<<< orphan*/ free(void *);
void *_c_free(void *ptr, const char *name, int line) {
  do {
    if (!(ptr != NULL))
      _c_assert(
          "ptr != NULL",
          "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
          "2022-01-22/02-19-57/repos/c4pt0r/cutils/refs/heads/master/c_utils.c",
          49, 1);
  } while (0);
  free(ptr);
}


x86 assembly (clang, -O0):
<_c_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115b <_c_free+0x3b>
lea    0xebb(%rip),%rdi
lea    0xec0(%rip),%rsi
mov    $0x31,%edx
mov    $0x1,%ecx
call   1040 <_c_assert@plt>
jmp    1160 <_c_free+0x40>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_c_free>:
push   %rbx
mov    %rdi,%rbx
test   %rdi,%rdi
jne    1146 <_c_free+0x26>
lea    0xed0(%rip),%rdi
lea    0xed5(%rip),%rsi
mov    $0x31,%edx
mov    $0x1,%ecx
call   1040 <_c_assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"ptr != NULL\00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/c4pt0r/cutils/refs/heads/master/c_utils.c\00"
define i8* @_c_free(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
br label %8
8: ; preds = %3
%9 = load i8*, i8** %5
%10 = icmp ne i8* %9, null
br i1 %10, label %13, label %11
11: ; preds = %8
%12 = call i32 @_c_assert(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0), i32 49, i32 1)
br label %13
13: ; preds = %11, %8
br label %14
14: ; preds = %13
%15 = load i8*, i8** %5
%16 = call i32 @free(i8* %15)
%17 = load i8*, i8** %4
ret i8* %17
}

LLVM IR (-O2):
@.str = [12 x i8] c"ptr != NULL\00"
@.str.1 = [132 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/c4pt0r/cutils/refs/heads/master/c_utils.c\00"
define noalias i8* @_c_free(i8* %0, i8* nocapture readnone %1, i32 %2) {
%4 = icmp eq i8* %0, null
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i32 @_c_assert(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([132 x i8], [132 x i8]* @.str.1, i64 0, i64 0), i32 49, i32 1)
br label %7
7: ; preds = %3, %5
%8 = tail call i32 @free(i8* %0)
ret i8* undef
}
/* Variables and functions */
int SV_FindIndex(char *, int, int, int);
int SV_ModelIndex(char *name) { return SV_FindIndex(name, 32, 256, 1); }


x86 assembly (clang, -O0):
<SV_ModelIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x20,%esi
mov    $0x100,%edx
mov    $0x1,%ecx
call   1030 <SV_FindIndex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SV_ModelIndex>:
mov    $0x20,%esi
mov    $0x100,%edx
mov    $0x1,%ecx
jmp    1030 <SV_FindIndex@plt>

LLVM IR (-O0):
define i32 @SV_ModelIndex(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @SV_FindIndex(i8* %3, i32 32, i32 256, i32 1)
ret i32 %4
}

LLVM IR (-O2):
define i32 @SV_ModelIndex(i8* %0) {
%2 = tail call i32 @SV_FindIndex(i8* %0, i32 32, i32 256, i32 1)
ret i32 %2
}
/* Variables and functions */
long _sysconfig(int);
long int __get_child_max(void) { return _sysconfig(3); }


x86 assembly (clang, -O0):
<__get_child_max>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
call   1030 <_sysconfig@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__get_child_max>:
mov    $0x3,%edi
jmp    1030 <_sysconfig@plt>

LLVM IR (-O0):
define i64 @__get_child_max() {
%1 = call i64 @_sysconfig(i32 3)
ret i64 %1
}

LLVM IR (-O2):
define i64 @__get_child_max() {
%1 = tail call i64 @_sysconfig(i32 3)
ret i64 %1
}
/* Type definitions */
struct task_struct {
  int dummy;
};
struct rq {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ update_curr_rtws(struct rq *);
void task_tick_rtws(struct rq *rq, struct task_struct *curr, int queued) {
  update_curr_rtws(rq);
}


x86 assembly (clang, -O0):
<task_tick_rtws>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <update_curr_rtws@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<task_tick_rtws>:
jmp    1030 <update_curr_rtws@plt>

LLVM IR (-O0):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @task_tick_rtws(%struct.rq* %0, %struct.task_struct* %1, i32 %2) {
%4 = alloca %struct.rq*
%5 = alloca %struct.task_struct*
%6 = alloca i32
store %struct.rq* %0, %struct.rq** %4
store %struct.task_struct* %1, %struct.task_struct** %5
store i32 %2, i32* %6
%7 = load %struct.rq*, %struct.rq** %4
%8 = call i32 @update_curr_rtws(%struct.rq* %7)
ret void
}

LLVM IR (-O2):
%struct.rq = type { i32 }
%struct.task_struct = type { i32 }
define void @task_tick_rtws(%struct.rq* %0, %struct.task_struct* nocapture readnone %1, i32 %2) {
%4 = tail call i32 @update_curr_rtws(%struct.rq* %0)
ret void
}
/* Variables and functions */
long inb(long);
long pcfetch(long port) { return inb(port); }


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

x86 assembly (clang, -O2):
<pcfetch>:
jmp    1030 <inb@plt>

LLVM IR (-O0):
define i64 @pcfetch(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i64 @inb(i64 %3)
ret i64 %4
}

LLVM IR (-O2):
define i64 @pcfetch(i64 %0) {
%2 = tail call i64 @inb(i64 %0)
ret i64 %2
}