xunge/DecIR huggingface dataset:
void Led_OFF() {
  (*(volatile unsigned long *)0xE0200280) = 0x00001111;
  (*(volatile unsigned long *)0xE0200284) = 0xf;
}


x86 assembly (clang, -O0):
<Led_OFF>:
push   %rbp
mov    %rsp,%rbp
mov    $0xe0200280,%eax
movq   $0x1111,(%rax)
mov    $0xe0200284,%eax
movq   $0xf,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<Led_OFF>:
mov    $0xe0200280,%eax
movq   $0x1111,(%rax)
movq   $0xf,0x4(%rax)
ret

LLVM IR (-O0):
define void @Led_OFF() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
store volatile i64 15, i64* inttoptr (i64 3760194180 to i64*)
ret void
}

LLVM IR (-O2):
define void @Led_OFF() {
store volatile i64 4369, i64* inttoptr (i64 3760194176 to i64*)
store volatile i64 15, i64* inttoptr (i64 3760194180 to i64*)
ret void
}
char _hex_encode_nib(int v) {
  if (v < 10) {
    return v + '0';
  } else {
    return v - 10 + 'a';
  }
}


x86 assembly (clang, -O0):
<_hex_encode_nib>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    111f <_hex_encode_nib+0x1f>
mov    -0x8(%rbp),%eax
add    $0x30,%eax
mov    %al,-0x1(%rbp)
jmp    112b <_hex_encode_nib+0x2b>
mov    -0x8(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_hex_encode_nib>:
cmp    $0xa,%edi
mov    $0x30,%ecx
mov    $0x57,%eax
cmovl  %ecx,%eax
add    %dil,%al
ret

LLVM IR (-O0):
define signext i8 @_hex_encode_nib(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 10
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = add nsw i32 %7, 48
%9 = trunc i32 %8 to i8
store i8 %9, i8* %2
br label %15
10: ; preds = %1
%11 = load i32, i32* %3
%12 = sub nsw i32 %11, 10
%13 = add nsw i32 %12, 97
%14 = trunc i32 %13 to i8
store i8 %14, i8* %2
br label %15
15: ; preds = %10, %6
%16 = load i8, i8* %2
ret i8 %16
}

LLVM IR (-O2):
define signext i8 @_hex_encode_nib(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = trunc i32 %0 to i8
%4 = select i1 %2, i8 48, i8 87
%5 = add i8 %4, %3
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void miniz_def_free_func(void *opaque, void *address) {
  (void)opaque, (void)address;
  free(address);
}


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

x86 assembly (clang, -O2):
<miniz_def_free_func>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @miniz_def_free_func(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 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @free(i8* %7)
ret void
}

LLVM IR (-O2):
define void @miniz_def_free_func(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
jump(label) int label;
{
  ot("jmp\t");
  printlabel(label);
  nl();
}


x86 assembly (clang, -O0):
<jump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1040 <ot@plt>
mov    -0x8(%rbp),%edi
mov    $0x0,%al
call   1050 <printlabel@plt>
mov    $0x0,%al
call   1030 <nl@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<jump>:
push   %rbx
mov    %edi,%ebx
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <ot@plt>
mov    %ebx,%edi
xor    %eax,%eax
call   1050 <printlabel@plt>
xor    %eax,%eax
pop    %rbx
jmp    1030 <nl@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"jmp\09\00"
define i32 @jump(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%5 = load i32, i32* %3
%6 = call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %5)
%7 = call i32 (...) @nl()
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
@.str = [5 x i8] c"jmp\09\00"
define i32 @jump(i32 %0) {
%2 = tail call i32 (i8*, ...) bitcast (i32 (...)* @ot to i32 (i8*, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i32, ...) bitcast (i32 (...)* @printlabel to i32 (i32, ...)*)(i32 %0)
%4 = tail call i32 (...) @nl()
ret i32 undef
}
double *dvector(nl, nh)
int nl, nh;
{
  double *v;
  v = (double *)malloc((unsigned)(nh - nl + 1) * sizeof(double));
  if (!v)
    problem("Unable to allocate memory in dvector()");
  return v - nl;
}


x86 assembly (clang, -O0):
<dvector>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
mov    %eax,%edi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1161 <dvector+0x41>
lea    0xea6(%rip),%rdi
mov    $0x0,%al
call   1030 <problem@plt>
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rdx
xor    %ecx,%ecx
sub    %rdx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dvector>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
sub    %edi,%esi
lea    0x1(%rsi),%edi
shl    $0x3,%rdi
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1149 <dvector+0x29>
lea    0xebe(%rip),%rdi
xor    %eax,%eax
call   1030 <problem@plt>
movslq %ebp,%rax
shl    $0x3,%rax
sub    %rax,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [39 x i8] c"Unable to allocate memory in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double*
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = zext i32 %9 to i64
%11 = mul i64 %10, 8
%12 = call i8* @malloc(i64 %11)
%13 = bitcast i8* %12 to double*
store double* %13, double** %5
%14 = load double*, double** %5
%15 = icmp ne double* %14, null
br i1 %15, label %18, label %16
16: ; preds = %2
%17 = call i32 (i8*, ...) bitcast (i32 (...)* @problem to i32 (i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %2
%19 = load double*, double** %5
%20 = load i32, i32* %3
%21 = sext i32 %20 to i64
%22 = sub i64 0, %21
%23 = getelementptr inbounds double, double* %19, i64 %22
ret double* %23
}

LLVM IR (-O2):
@.str = [39 x i8] c"Unable to allocate memory in dvector()\00"
define double* @dvector(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = zext i32 %4 to i64
%6 = shl nuw nsw i64 %5, 3
%7 = tail call i8* @malloc(i64 %6)
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = tail call i32 (i8*, ...) bitcast (i32 (...)* @problem to i32 (i8*, ...)*)(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %9, %2
%12 = bitcast i8* %7 to double*
%13 = sext i32 %0 to i64
%14 = sub nsw i64 0, %13
%15 = getelementptr inbounds double, double* %12, i64 %14
ret double* %15
}
/* Type definitions */
struct stat {
  long st_size;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int fileno(int /*<<< orphan*/ *);
int fstat(int, struct stat *);
long int fsize(FILE *file) {
  struct stat s;
  int fd = fileno(file);
  if (fd == -1)
    return -1;
  if (fstat(fd, &s) == -1)
    return -1;
  return s.st_size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <fileno@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    114f <fsize+0x2f>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1179 <fsize+0x59>
mov    -0x1c(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
jne    1171 <fsize+0x51>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
jmp    1179 <fsize+0x59>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %rbx
sub    $0x10,%rsp
call   1030 <fileno@plt>
mov    $0xffffffffffffffff,%rbx
cmp    $0xffffffff,%eax
je     114c <fsize+0x2c>
lea    0x8(%rsp),%rsi
mov    %eax,%edi
call   1040 <fstat@plt>
cmp    $0xffffffff,%eax
je     114c <fsize+0x2c>
mov    0x8(%rsp),%rbx
mov    %rbx,%rax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.stat = type { i64 }
define i64 @fsize(i32* %0) {
%2 = alloca i64
%3 = alloca i32*
%4 = alloca %struct.stat
%5 = alloca i32
store i32* %0, i32** %3
%6 = load i32*, i32** %3
%7 = call i32 @fileno(i32* %6)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %11
10: ; preds = %1
store i64 -1, i64* %2
br label %19
11: ; preds = %1
%12 = load i32, i32* %5
%13 = call i32 @fstat(i32 %12, %struct.stat* %4)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %16
15: ; preds = %11
store i64 -1, i64* %2
br label %19
16: ; preds = %11
%17 = getelementptr inbounds %struct.stat, %struct.stat* %4, i32 0, i32 0
%18 = load i64, i64* %17
store i64 %18, i64* %2
br label %19
19: ; preds = %16, %15, %10
%20 = load i64, i64* %2
ret i64 %20
}

LLVM IR (-O2):
%struct.stat = type { i64 }
define i64 @fsize(i32* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = tail call i32 @fileno(i32* %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %12, label %6
6: ; preds = %1
%7 = call i32 @fstat(i32 %4, %struct.stat* %2)
%8 = icmp eq i32 %7, -1
br i1 %8, label %12, label %9
9: ; preds = %6
%10 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%11 = load i64, i64* %10
br label %12
12: ; preds = %6, %1, %9
%13 = phi i64 [ %11, %9 ], [ -1, %1 ], [ -1, %6 ]
ret i64 %13
}
void av_frame_ref() {}


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

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

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

LLVM IR (-O2):
define void @av_frame_ref() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ speaker(unsigned int, unsigned int);
void play(unsigned int *freq, unsigned int *time) {
  int i;
  for (i = 0; freq[i] != 0; i++) {
    speaker(freq[i], time[i]);
  }
}


x86 assembly (clang, -O0):
<play>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
cmpl   $0x0,(%rax,%rcx,4)
je     1162 <play+0x52>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <speaker@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1127 <play+0x17>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<play>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
mov    (%rdi),%edi
test   %edi,%edi
je     1146 <play+0x36>
mov    %rsi,%r14
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,1),%esi
call   1030 <speaker@plt>
mov    0x4(%r15,%rbx,1),%edi
add    $0x4,%rbx
test   %edi,%edi
jne    1130 <play+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define void @play(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = icmp eq i32 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i64 [ %11, %5 ], [ 0, %2 ]
%7 = phi i32 [ %13, %5 ], [ %3, %2 ]
%8 = getelementptr inbounds i32, i32* %1, i64 %6
%9 = load i32, i32* %8
%10 = tail call i32 @speaker(i32 %7, i32 %9)
%11 = add nuw i64 %6, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  size_t n;
  for (n = 1; n < (size_t)argc; n++) {
    printf("%s ", argv[n]);
  }
  printf("\n");
  return 0;
}


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)
movq   $0x1,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x8(%rbp),%rcx
cmp    %rcx,%rax
jae    116a <main+0x5a>
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rsi
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    112e <main+0x1e>
lea    0xe93(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
cmp    $0x2,%edi
jb     1157 <main+0x37>
mov    %rsi,%r15
movslq %edi,%r12
mov    $0x1,%ebx
lea    0xec1(%rip),%r14
nop
mov    (%r15,%rbx,8),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <main+0x20>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = sext i32 %0 to i64
%4 = icmp ugt i32 %0, 1
br i1 %4, label %5, label %12
5: ; preds = %2, %5
%6 = phi i64 [ %10, %5 ], [ 1, %2 ]
%7 = getelementptr inbounds i8*, i8** %1, i64 %6
%8 = load i8*, i8** %7
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = add nuw i64 %6, 1
%11 = icmp eq i64 %10, %3
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = tail call i32 @putchar(i32 10)
ret i32 0
}
int strcmp(const char *cs, const char *ct) {
  int d0, d1;
  int res;
  asm volatile("1:\tlodsb\n\t"
               "scasb\n\t"
               "jne 2f\n\t"
               "testb %%al,%%al\n\t"
               "jne 1b\n\t"
               "xorl %%eax,%%eax\n\t"
               "jmp 3f\n"
               "2:\tsbbl %%eax,%%eax\n\t"
               "orb $1,%%al\n"
               "3:"
               : "=a"(res), "=&S"(d0), "=&D"(d1)
               : "1"(cs), "2"(ct)
               : "memory");
  return res;
}


x86 assembly (clang, -O0):
<strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    112b <strcmp+0x2b>
test   %al,%al
jne    1114 <strcmp+0x14>
xor    %eax,%eax
jmp    112f <strcmp+0x2f>
sbb    %eax,%eax
or     $0x1,%al
mov    %eax,-0x1c(%rbp)
mov    %esi,%eax
mov    %eax,-0x14(%rbp)
mov    %edi,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcmp>:
mov    %rsi,%rax
mov    %rdi,%rsi
mov    %rax,%rdi
lods   %ds:(%rsi),%al
scas   %es:(%rdi),%al
jne    1115 <strcmp+0x15>
test   %al,%al
jne    1109 <strcmp+0x9>
xor    %eax,%eax
jmp    1119 <strcmp+0x19>
sbb    %eax,%eax
or     $0x1,%al
ret

LLVM IR (-O0):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = load i8*, i8** %4
%10 = call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %8, i8* %9)
%11 = extractvalue { i32, i8*, i8* } %10, 0
%12 = extractvalue { i32, i8*, i8* } %10, 1
%13 = extractvalue { i32, i8*, i8* } %10, 2
store i32 %11, i32* %7
%14 = ptrtoint i8* %12 to i64
%15 = trunc i64 %14 to i32
store i32 %15, i32* %5
%16 = ptrtoint i8* %13 to i64
%17 = trunc i64 %16 to i32
store i32 %17, i32* %6
%18 = load i32, i32* %7
ret i32 %18
}

LLVM IR (-O2):
define i32 @strcmp(i8* %0, i8* %1) {
%3 = tail call { i32, i8*, i8* } asm sideeffect "1:\09lodsb\0A\09scasb\0A\09jne 2f\0A\09testb %al,%al\0A\09jne 1b\0A\09xorl %eax,%eax\0A\09jmp 3f\0A2:\09sbbl %eax,%eax\0A\09orb $$1,%al\0A3:", "={ax},=&{si},=&{di},1,2,~{memory},~{dirflag},~{fpsr},~{flags}"(i8* %0, i8* %1)
%4 = extractvalue { i32, i8*, i8* } %3, 0
ret i32 %4
}
void X509_CRL_delete_ext(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_CRL_delete_ext() {
ret void
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
void cast_Bad_FN() {
  char arr[1];
  *(int32_t *)arr = 123;
}


x86 assembly (clang, -O0):
<cast_Bad_FN>:
push   %rbp
mov    %rsp,%rbp
movl   $0x7b,-0x1(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @cast_Bad_FN() {
%1 = alloca [1 x i8]
%2 = getelementptr inbounds [1 x i8], [1 x i8]* %1, i64 0, i64 0
%3 = bitcast i8* %2 to i32*
store i32 123, i32* %3
ret void
}

LLVM IR (-O2):
define void @cast_Bad_FN() {
ret void
}
/* Variables and functions */
char *strchr(char *, char);
void get_hostname_port_frm_str(char *arg, const char **hostname,
                               const char **port) {
  char *delim = strchr(arg, '@');
  if (delim) {
    *delim = '\0';
    *port = delim + 1;
  }
  *hostname = arg;
}


x86 assembly (clang, -O0):
<get_hostname_port_frm_str>:
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    $0x40,%esi
call   1030 <strchr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1157 <get_hostname_port_frm_str+0x47>
mov    -0x20(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rcx
add    $0x1,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hostname_port_frm_str>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
mov    %rdi,%rbx
mov    $0x40,%esi
call   1030 <strchr@plt>
test   %rax,%rax
je     1137 <get_hostname_port_frm_str+0x27>
movb   $0x0,(%rax)
add    $0x1,%rax
mov    %rax,(%r15)
mov    %rbx,(%r14)
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_hostname_port_frm_str(i8* %0, i8** %1, i8** %2) {
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
store i8** %2, i8*** %6
%8 = load i8*, i8** %4
%9 = call i8* @strchr(i8* %8, i8 signext 64)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %17
12: ; preds = %3
%13 = load i8*, i8** %7
store i8 0, i8* %13
%14 = load i8*, i8** %7
%15 = getelementptr inbounds i8, i8* %14, i64 1
%16 = load i8**, i8*** %6
store i8* %15, i8** %16
br label %17
17: ; preds = %12, %3
%18 = load i8*, i8** %4
%19 = load i8**, i8*** %5
store i8* %18, i8** %19
ret void
}

LLVM IR (-O2):
define void @get_hostname_port_frm_str(i8* %0, i8** nocapture writeonly %1, i8** nocapture writeonly %2) {
%4 = tail call i8* @strchr(i8* dereferenceable(1) %0, i8 signext 64)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %3
store i8 0, i8* %4
%7 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %7, i8** %2
br label %8
8: ; preds = %6, %3
store i8* %0, i8** %1
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ volatile uint64_t;

/* Variables and functions */
void volatile_fetch_xor_u64(uint64_t *dest, uint64_t val) {
  *((volatile uint64_t *)dest) ^= val;
}


x86 assembly (clang, -O0):
<volatile_fetch_xor_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
xor    %edx,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<volatile_fetch_xor_u64>:
mov    %esi,-0x4(%rsp)
mov    -0x4(%rsp),%eax
xor    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @volatile_fetch_xor_u64(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store volatile i32 %1, i32* %4
%5 = load volatile i32, i32* %4
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = xor i32 %7, %5
store volatile i32 %8, i32* %6
ret void
}

LLVM IR (-O2):
define void @volatile_fetch_xor_u64(i32* %0, i32 %1) {
%3 = alloca i32
store volatile i32 %1, i32* %3
%4 = load volatile i32, i32* %3
%5 = load volatile i32, i32* %0
%6 = xor i32 %5, %4
store volatile i32 %6, i32* %0
ret void
}
unsigned copy(unsigned u) { return u; }


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

x86 assembly (clang, -O2):
<copy>:
mov    %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @copy(i32 returned %0) {
ret i32 %0
}
/* Variables and functions */
int fib(int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", fib(38));
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x26,%edi
call   1040 <fib@plt>
lea    0xece(%rip),%rdi
mov    %eax,%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 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fib(i32 38)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @fib(i32 38)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int cdrom_close_write(struct cdrom_device_info *cdi) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.cdrom_device_info = type opaque
define i32 @cdrom_close_write(%struct.cdrom_device_info* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ task_exit(int /*<<< orphan*/);
int task_id();
void BodyTask(void *arg) {
  printf("Estou na tarefa %5d\n", task_id());
  task_exit(0);
}


x86 assembly (clang, -O0):
<BodyTask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1040 <task_id@plt>
mov    %eax,%esi
lea    0xeb4(%rip),%rdi
call   1050 <printf@plt>
xor    %edi,%edi
call   1030 <task_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BodyTask>:
push   %rax
xor    %eax,%eax
call   1040 <task_id@plt>
lea    0xec1(%rip),%rdi
mov    %eax,%esi
call   1050 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1030 <task_exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Estou na tarefa %5d\0A\00"
define void @BodyTask(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @task_id()
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @task_exit(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Estou na tarefa %5d\0A\00"
define void @BodyTask(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @task_id()
%3 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 @task_exit(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookcomplex8array_(char *x, unsigned int *n) { lookNarray(x, (*n * 8)); }


x86 assembly (clang, -O0):
<lookcomplex8array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x3,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookcomplex8array_>:
mov    (%rsi),%esi
shl    $0x3,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookcomplex8array_(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 = mul i32 %7, 8
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookcomplex8array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 3
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isbdigit(int);
void t_isbdigit_0x4f() {
  Assert_real((isbdigit(79) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isbdigit.c",
              400, ("isbdigit should be 0 for O"));
}


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

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

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

LLVM IR (-O2):
@.str = [169 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isbdigit.c\00"
@.str.1 = [27 x i8] c"isbdigit should be 0 for O\00"
define void @t_isbdigit_0x4f() {
%1 = tail call i64 @isbdigit(i32 79)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([169 x i8], [169 x i8]* @.str, i64 0, i64 0), i32 400, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tsm_screen {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ screen_inc_age(struct tsm_screen *);
int /*<<< orphan*/ screen_scroll_up(struct tsm_screen *, unsigned int);
__attribute__((visibility("default"))) void
tsm_screen_scroll_up(struct tsm_screen *con, unsigned int num) {
  if (!con || !num)
    return;
  screen_inc_age(con);
  screen_scroll_up(con, num);
}


x86 assembly (clang, -O0):
<tsm_screen_scroll_up>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1144 <tsm_screen_scroll_up+0x24>
cmpl   $0x0,-0xc(%rbp)
jne    1149 <tsm_screen_scroll_up+0x29>
jmp    115e <tsm_screen_scroll_up+0x3e>
mov    -0x8(%rbp),%rdi
call   1030 <screen_inc_age@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <screen_scroll_up@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsm_screen_scroll_up>:
push   %rbp
push   %rbx
push   %rax
test   %rdi,%rdi
je     1146 <tsm_screen_scroll_up+0x26>
mov    %esi,%ebp
test   %esi,%esi
je     1146 <tsm_screen_scroll_up+0x26>
mov    %rdi,%rbx
call   1030 <screen_inc_age@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <screen_scroll_up@plt>
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_scroll_up(%struct.tsm_screen* %0, i32 %1) {
%3 = alloca %struct.tsm_screen*
%4 = alloca i32
store %struct.tsm_screen* %0, %struct.tsm_screen** %3
store i32 %1, i32* %4
%5 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%6 = icmp ne %struct.tsm_screen* %5, null
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %11, label %10
10: ; preds = %7, %2
br label %17
11: ; preds = %7
%12 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%13 = call i32 @screen_inc_age(%struct.tsm_screen* %12)
%14 = load %struct.tsm_screen*, %struct.tsm_screen** %3
%15 = load i32, i32* %4
%16 = call i32 @screen_scroll_up(%struct.tsm_screen* %14, i32 %15)
br label %17
17: ; preds = %11, %10
ret void
}

LLVM IR (-O2):
%struct.tsm_screen = type { i32 }
define void @tsm_screen_scroll_up(%struct.tsm_screen* %0, i32 %1) {
%3 = icmp ne %struct.tsm_screen* %0, null
%4 = icmp ne i32 %1, 0
%5 = and i1 %3, %4
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = tail call i32 @screen_inc_age(%struct.tsm_screen* %0)
%8 = tail call i32 @screen_scroll_up(%struct.tsm_screen* %0, i32 %1)
br label %9
9: ; preds = %2, %6
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ stderr;
void printError(char *s) {
  perror("weigbor::io");
  fprintf(stderr, "%s\n", s);
  exit(1);
}


x86 assembly (clang, -O0):
<printError>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xeb0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<printError>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1040 <perror@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
lea    0xebc(%rip),%rsi
mov    %rbx,%rdx
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"weigbor::io\00"
@stderr = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define void @printError(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* @stderr
%5 = load i8*, i8** %2
%6 = call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [12 x i8] c"weigbor::io\00"
@stderr = global i32 0
@.str.1 = [4 x i8] c"%s\0A\00"
define void @printError(i8* %0) {
%2 = tail call i32 @perror(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_mutex_t;

/* Variables and functions */
int /*<<< orphan*/ double_init_bad(int /*<<< orphan*/ *);
void double_init_ok() {
  pthread_mutex_t m;
  double_init_bad(&m);
}


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

x86 assembly (clang, -O2):
<double_init_ok>:
push   %rax
lea    0x4(%rsp),%rdi
call   1030 <double_init_bad@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @double_init_ok() {
%1 = alloca i32
%2 = call i32 @double_init_bad(i32* %1)
ret void
}

LLVM IR (-O2):
define void @double_init_ok() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @double_init_bad(i32* %1)
ret void
}
int match_bufferevent(void *arg, void *item) { return arg == item; }


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

x86 assembly (clang, -O2):
<match_bufferevent>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @match_bufferevent(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 = load i8*, i8** %4
%7 = icmp eq i8* %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @match_bufferevent(i8* readnone %0, i8* readnone %1) {
%3 = icmp eq i8* %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int PAPI_get_multiplex(int);
void papif_get_multiplex__(int *EventSet, int *check) {
  *check = PAPI_get_multiplex(*EventSet);
}


x86 assembly (clang, -O0):
<papif_get_multiplex__>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
call   1030 <PAPI_get_multiplex@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<papif_get_multiplex__>:
push   %rbx
mov    %rsi,%rbx
mov    (%rdi),%edi
call   1030 <PAPI_get_multiplex@plt>
mov    %eax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @papif_get_multiplex__(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* %5
%7 = call i32 @PAPI_get_multiplex(i32 %6)
%8 = load i32*, i32** %4
store i32 %7, i32* %8
ret void
}

LLVM IR (-O2):
define void @papif_get_multiplex__(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = tail call i32 @PAPI_get_multiplex(i32 %3)
store i32 %4, i32* %1
ret void
}
int reset_control_reset(struct reset_control *rstc) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.reset_control = type opaque
define i32 @reset_control_reset(%struct.reset_control* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, ...);
void fail(const char *msg, int s, int i) {
  printf("\nTest FAILED: ");
  printf("%s (seq %d, pos %d).\n", msg, s, i);
  exit(1);
}


x86 assembly (clang, -O0):
<fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<fail>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xecd(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xece(%rip),%rdi
mov    %rbx,%rsi
mov    %ebp,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"\0ATest FAILED: \00"
@.str.1 = [22 x i8] c"%s (seq %d, pos %d).\0A\00"
define void @fail(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 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%8 = load i8*, i8** %4
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %8, i32 %9, i32 %10)
%12 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [15 x i8] c"\0ATest FAILED: \00"
@.str.1 = [22 x i8] c"%s (seq %d, pos %d).\0A\00"
define void @fail(i8* %0, i32 %1, i32 %2) {
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1, i32 %2)
%6 = tail call i32 @exit(i32 1)
unreachable
}
float nT(float f) { return f / 20; }


x86 assembly (clang, -O0):
<nT>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<nT>:
divss  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define float @nT(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fdiv float %3, 2.000000e+01
ret float %4
}

LLVM IR (-O2):
define float @nT(float %0) {
%2 = fdiv float %0, 2.000000e+01
ret float %2
}
/* Variables and functions */
void *malloc(size_t);
void *LibZen_Malloc(size_t size) { return malloc(size); }


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

x86 assembly (clang, -O2):
<LibZen_Malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @LibZen_Malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ print_error_global(char *, char *, int /*<<< orphan*/);
FILE *fopen_write(char *file_data) {
  FILE *m_File = fopen(file_data, "w");
  if (!m_File)
    print_error_global("open", file_data, 0);
  return m_File;
}


x86 assembly (clang, -O0):
<fopen_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xec9(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    115d <fopen_write+0x3d>
mov    -0x8(%rbp),%rsi
lea    0xeac(%rip),%rdi
xor    %edx,%edx
call   1040 <print_error_global@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fopen_write>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0xed2(%rip),%rsi
call   1030 <fopen@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    114c <fopen_write+0x2c>
lea    0xec0(%rip),%rdi
mov    %r14,%rsi
xor    %edx,%edx
call   1040 <print_error_global@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c"w\00"
@.str.1 = [5 x i8] c"open\00"
define i32* @fopen_write(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32* @fopen(i8* %4, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = icmp ne i32* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i8*, i8** %2
%10 = call i32 @print_error_global(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %9, i32 0)
br label %11
11: ; preds = %8, %1
%12 = load i32*, i32** %3
ret i32* %12
}

LLVM IR (-O2):
@.str = [2 x i8] c"w\00"
@.str.1 = [5 x i8] c"open\00"
define noalias i32* @fopen_write(i8* %0) {
%2 = tail call i32* @fopen(i8* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @print_error_global(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 0)
br label %6
6: ; preds = %4, %1
ret i32* %2
}
/* Variables and functions */
int /*<<< orphan*/ SOS_Error(char *);
int /*<<< orphan*/ SOS_Locate(char *, char *, int);
void SOS_ChkPtr(char *file, char *func, int line, void *ptr) {
  if (ptr == NULL) {
    SOS_Locate(file, func, line);
    SOS_Error("Null pointer.\n");
  }
}


x86 assembly (clang, -O0):
<SOS_ChkPtr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    115e <SOS_ChkPtr+0x3e>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1040 <SOS_Locate@plt>
lea    0xea7(%rip),%rdi
call   1030 <SOS_Error@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SOS_ChkPtr>:
test   %rcx,%rcx
je     1126 <SOS_ChkPtr+0x6>
ret
push   %rax
call   1040 <SOS_Locate@plt>
lea    0xecd(%rip),%rdi
pop    %rax
jmp    1030 <SOS_Error@plt>

LLVM IR (-O0):
@.str = [15 x i8] c"Null pointer.\0A\00"
define void @SOS_ChkPtr(i8* %0, i8* %1, i32 %2, i8* %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i8* %3, i8** %8
%9 = load i8*, i8** %8
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %17
11: ; preds = %4
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i32, i32* %7
%15 = call i32 @SOS_Locate(i8* %12, i8* %13, i32 %14)
%16 = call i32 @SOS_Error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %17
17: ; preds = %11, %4
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"Null pointer.\0A\00"
define void @SOS_ChkPtr(i8* %0, i8* %1, i32 %2, i8* readnone %3) {
%5 = icmp eq i8* %3, null
br i1 %5, label %6, label %9
6: ; preds = %4
%7 = tail call i32 @SOS_Locate(i8* %0, i8* %1, i32 %2)
%8 = tail call i32 @SOS_Error(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
br label %9
9: ; preds = %6, %4
ret void
}
/* Variables and functions */
scalar_t__ *_sys_siglist;
char *string_signal(int sig) { return (char *)_sys_siglist[sig]; }


x86 assembly (clang, -O0):
<string_signal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    0x2eda(%rip),%rax
mov    (%rax),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_signal>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%rax
movslq %edi,%rcx
mov    (%rax,%rcx,8),%rax
ret

LLVM IR (-O0):
@_sys_siglist = global i64* null
define i8* @string_signal(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i64*, i64** @_sys_siglist
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %3, i64 %5
%7 = load i64, i64* %6
%8 = inttoptr i64 %7 to i8*
ret i8* %8
}

LLVM IR (-O2):
@_sys_siglist = global i64* null
define i8* @string_signal(i32 %0) {
%2 = load i64*, i64** @_sys_siglist
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i64, i64* %2, i64 %3
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
char *class_name__9ExceptionFv(__0this)
struct Exception *__0this;
{
  return (char *)"Exception";
}


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

x86 assembly (clang, -O2):
<class_name__9ExceptionFv>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
%struct.Exception = type opaque
@.str = [10 x i8] c"Exception\00"
define i8* @class_name__9ExceptionFv(%struct.Exception* %0) {
%2 = alloca %struct.Exception*
store %struct.Exception* %0, %struct.Exception** %2
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
%struct.Exception = type opaque
@.str = [10 x i8] c"Exception\00"
define i8* @class_name__9ExceptionFv(%struct.Exception* nocapture readnone %0) {
ret i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ getcns(int);
int cmd_hdr(int argc, char **argv) {
  return !getcns(0x1065) && !getcns(0x1069);
}


x86 assembly (clang, -O0):
<cmd_hdr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x1065,%edi
call   1030 <getcns@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x11(%rbp)
jne    114e <cmd_hdr+0x3e>
mov    $0x1069,%edi
call   1030 <getcns@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%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):
<cmd_hdr>:
push   %rax
mov    $0x1065,%edi
call   1030 <getcns@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1125 <cmd_hdr+0x15>
pop    %rcx
ret
mov    $0x1069,%edi
call   1030 <getcns@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cmd_hdr(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @getcns(i32 4197)
%6 = icmp ne i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %2
%8 = call i32 @getcns(i32 4201)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %7, %2
%12 = phi i1 [ false, %2 ], [ %10, %7 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cmd_hdr(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @getcns(i32 4197)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = tail call i32 @getcns(i32 4201)
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
br label %9
9: ; preds = %5, %2
%10 = phi i32 [ 0, %2 ], [ %8, %5 ]
ret i32 %10
}
/* Variables and functions */
int platform_word_size();
int platform_32bit(void) { return platform_word_size() == 4; }


x86 assembly (clang, -O0):
<platform_32bit>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <platform_word_size@plt>
cmp    $0x4,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<platform_32bit>:
push   %rax
xor    %eax,%eax
call   1030 <platform_word_size@plt>
xor    %ecx,%ecx
cmp    $0x4,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @platform_32bit() {
%1 = call i32 (...) @platform_word_size()
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
ret i32 %3
}

LLVM IR (-O2):
define i32 @platform_32bit() {
%1 = tail call i32 (...) @platform_word_size()
%2 = icmp eq i32 %1, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
void bigrat_init(void) {}


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

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

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

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