xunge/DecIR huggingface dataset:
unsigned long decode_size(char **str) {
  unsigned char **ustr = (unsigned char **)str;
  unsigned long size = (*((*ustr)++) & 0xff) << 16;
  size |= (*((*ustr)++) & 0xff) << 8;
  size |= (*((*ustr)++) & 0xff);
  return size;
}


x86 assembly (clang, -O0):
<decode_size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movzbl (%rax),%eax
and    $0xff,%eax
shl    $0x10,%eax
cltq
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movzbl (%rax),%eax
and    $0xff,%eax
shl    $0x8,%eax
cltq
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,(%rcx)
movzbl (%rax),%eax
and    $0xff,%eax
cltq
or     -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_size>:
mov    (%rdi),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rdi)
movzbl (%rax),%ecx
shl    $0x10,%rcx
lea    0x2(%rax),%rdx
mov    %rdx,(%rdi)
movzbl 0x1(%rax),%edx
shl    $0x8,%rdx
or     %rcx,%rdx
lea    0x3(%rax),%rcx
mov    %rcx,(%rdi)
movzbl 0x2(%rax),%eax
or     %rdx,%rax
ret

LLVM IR (-O0):
define i64 @decode_size(i8** %0) {
%2 = alloca i8**
%3 = alloca i8**
%4 = alloca i64
store i8** %0, i8*** %2
%5 = load i8**, i8*** %2
store i8** %5, i8*** %3
%6 = load i8**, i8*** %3
%7 = load i8*, i8** %6
%8 = getelementptr inbounds i8, i8* %7, i32 1
store i8* %8, i8** %6
%9 = load i8, i8* %7
%10 = zext i8 %9 to i32
%11 = and i32 %10, 255
%12 = shl i32 %11, 16
%13 = sext i32 %12 to i64
store i64 %13, i64* %4
%14 = load i8**, i8*** %3
%15 = load i8*, i8** %14
%16 = getelementptr inbounds i8, i8* %15, i32 1
store i8* %16, i8** %14
%17 = load i8, i8* %15
%18 = zext i8 %17 to i32
%19 = and i32 %18, 255
%20 = shl i32 %19, 8
%21 = sext i32 %20 to i64
%22 = load i64, i64* %4
%23 = or i64 %22, %21
store i64 %23, i64* %4
%24 = load i8**, i8*** %3
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i32 1
store i8* %26, i8** %24
%27 = load i8, i8* %25
%28 = zext i8 %27 to i32
%29 = and i32 %28, 255
%30 = sext i32 %29 to i64
%31 = load i64, i64* %4
%32 = or i64 %31, %30
store i64 %32, i64* %4
%33 = load i64, i64* %4
ret i64 %33
}

LLVM IR (-O2):
define i64 @decode_size(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = getelementptr inbounds i8, i8* %2, i64 1
store i8* %3, i8** %0
%4 = load i8, i8* %2
%5 = zext i8 %4 to i64
%6 = shl nuw nsw i64 %5, 16
%7 = getelementptr inbounds i8, i8* %2, i64 2
store i8* %7, i8** %0
%8 = load i8, i8* %3
%9 = zext i8 %8 to i64
%10 = shl nuw nsw i64 %9, 8
%11 = or i64 %10, %6
%12 = getelementptr inbounds i8, i8* %2, i64 3
store i8* %12, i8** %0
%13 = load i8, i8* %7
%14 = zext i8 %13 to i64
%15 = or i64 %11, %14
ret i64 %15
}
unsigned int registerIRQ(unsigned int irq_number) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @registerIRQ(i32 %0) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isdigit(int);
void t_isdigit_0x94() {
  Assert_real((isdigit(148) == 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_isdigit.c",
              745, ("isdigit should be 0 for 0x94"));
}


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

x86 assembly (clang, -O2):
<t_isdigit_0x94>:
push   %rax
mov    $0x94,%edi
call   1030 <isdigit@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2e9,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x94\00"
define void @t_isdigit_0x94() {
%1 = call i64 @isdigit(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 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_isdigit.c\00"
@.str.1 = [29 x i8] c"isdigit should be 0 for 0x94\00"
define void @t_isdigit_0x94() {
%1 = tail call i64 @isdigit(i32 148)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 745, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
struct timeval {
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, int /*<<< orphan*/);
int main() {
  struct timeval tp;
  gettimeofday(&tp, NULL);
  printf("%ld\n", tp.tv_sec);
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.timeval = type { i32 }
@.str = [5 x i8] c"%ld\0A\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 1
}
int test_imm_05uint32_reg(unsigned int val) {
  return ((val) & (0x05 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_05uint32_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
and    $0x5,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_05uint32_reg>:
test   $0x5,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_05uint32_reg(i32 %0) {
%2 = and i32 %0, 5
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ eprintf(char *, size_t);
void *malloc(size_t);
void *emalloc(size_t size) {
  void *ptr;
  if (!(ptr = malloc(size)))
    eprintf("Can not allocate %zu bytes.\n", size);
  return ptr;
}


x86 assembly (clang, -O0):
<emalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    1153 <emalloc+0x33>
mov    -0x8(%rbp),%rsi
lea    0xeb2(%rip),%rdi
call   1040 <eprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <emalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1040 <eprintf@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [29 x i8] c"Can not allocate %zu bytes.\0A\00"
define i8* @emalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = icmp ne i8* %5, null
br i1 %6, label %10, label %7
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @eprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %8)
br label %10
10: ; preds = %7, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [29 x i8] c"Can not allocate %zu bytes.\0A\00"
define noalias i8* @emalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @eprintf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
int CountBits8(int);
int LowestBitSet8(uint8_t val) {
  if (val == 0)
    return -1;
  return CountBits8(val ^ val - 1) - 1;
}


x86 assembly (clang, -O0):
<LowestBitSet8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1131 <LowestBitSet8+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    1147 <LowestBitSet8+0x37>
mov    -0x8(%rbp),%edi
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
xor    %eax,%edi
call   1030 <CountBits8@plt>
sub    $0x1,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LowestBitSet8>:
test   %edi,%edi
je     1129 <LowestBitSet8+0x19>
push   %rax
lea    -0x1(%rdi),%eax
xor    %edi,%eax
mov    %eax,%edi
call   1030 <CountBits8@plt>
add    $0xffffffff,%eax
add    $0x8,%rsp
ret
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @LowestBitSet8(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = add nsw i32 %0, -1
%5 = xor i32 %4, %0
%6 = tail call i32 @CountBits8(i32 %5)
%7 = add nsw i32 %6, -1
br label %8
8: ; preds = %1, %3
%9 = phi i32 [ %7, %3 ], [ -1, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ system(char *);
void bakeup() { system("cp ./output.txt ./output.txt.bak"); }


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"cp ./output.txt ./output.txt.bak\00"
define void @bakeup() {
%1 = call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"cp ./output.txt ./output.txt.bak\00"
define void @bakeup() {
%1 = tail call i32 @system(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
ret void
}
void getDatagramSectionHeader(unsigned int *slen, unsigned int *len,
                              unsigned int offset, unsigned char *buf) {
  *slen = ((buf[offset + 1] & 0xF) << 8) | (buf[offset + 2]);
  *len = 12;
  return;
}


x86 assembly (clang, -O0):
<getDatagramSectionHeader>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    $0x1,%ecx
mov    %ecx,%ecx
movzbl (%rax,%rcx,1),%ecx
and    $0xf,%ecx
shl    $0x8,%ecx
mov    -0x20(%rbp),%rax
mov    -0x14(%rbp),%edx
add    $0x2,%edx
mov    %edx,%edx
movzbl (%rax,%rdx,1),%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
movl   $0xc,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDatagramSectionHeader>:
lea    0x1(%rdx),%eax
movzbl (%rcx,%rax,1),%eax
and    $0xf,%eax
shl    $0x8,%eax
add    $0x2,%edx
movzbl (%rcx,%rdx,1),%ecx
or     %eax,%ecx
mov    %ecx,(%rdi)
movl   $0xc,(%rsi)
ret

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

LLVM IR (-O2):
define void @getDatagramSectionHeader(i32* nocapture writeonly %0, i32* nocapture writeonly %1, i32 %2, i8* nocapture %3) {
%5 = add i32 %2, 1
%6 = zext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %3, i64 %6
%8 = load i8, i8* %7
%9 = and i8 %8, 15
%10 = zext i8 %9 to i32
%11 = shl nuw nsw i32 %10, 8
%12 = add i32 %2, 2
%13 = zext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %3, i64 %13
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = or i32 %11, %16
store i32 %17, i32* %0
store i32 12, i32* %1
ret void
}
void gtk_text_iter_get_line_index() {}


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

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

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

LLVM IR (-O2):
define void @gtk_text_iter_get_line_index() {
ret void
}
/* Type definitions */
struct sty {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ foo(struct sty *);
int see(struct sty *x) {
  foo(x);
  return 0;
}


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

x86 assembly (clang, -O2):
<see>:
push   %rax
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.sty = type { i32 }
define i32 @see(%struct.sty* %0) {
%2 = tail call i32 @foo(%struct.sty* %0)
ret i32 0
}
void ff_hevc_put_hevc_uni_w_epel_h32_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_w_epel_h32_10_sse4() {
ret void
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
bool cmp4(const void *a, const void *b) {
  return *(uint32_t *)a == *(uint32_t *)b;
}


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

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

LLVM IR (-O0):
define i32 @cmp4(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 i64*
%7 = load i64, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %9
%11 = icmp eq i64 %7, %10
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @cmp4(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i64*
%4 = load i64, i64* %3
%5 = bitcast i8* %1 to i64*
%6 = load i64, i64* %5
%7 = icmp eq i64 %4, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
void func2(a, b) int *a, b[];
{}


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

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

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

LLVM IR (-O2):
define void @func2(i32* nocapture %0, i32* nocapture %1) {
ret void
}
int get_group_row_index(int row, int group_size) { return (row / group_size); }


x86 assembly (clang, -O0):
<get_group_row_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_group_row_index>:
mov    %edi,%eax
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @get_group_row_index(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sdiv i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_group_row_index(i32 %0, i32 %1) {
%3 = sdiv i32 %0, %1
ret i32 %3
}
/* Variables and functions */
int abs(int);
int BLSCheck(int *dBuf, int dbPtr, int *maxder) {
  int max, min, maxt, mint, t, x;
  max = min = 0;
  return (0);
  for (t = 0; t < ((int)(220 / 5 + 0.5)); ++t) {
    x = dBuf[dbPtr];
    if (x > max) {
      maxt = t;
      max = x;
    } else if (x < min) {
      mint = t;
      min = x;
    }
    if (++dbPtr == 253)
      dbPtr = 0;
  }
  *maxder = max;
  min = -min;
  if ((max > (min >> 3)) && (min > (max >> 3)) &&
      (abs(maxt - mint) < ((int)(150 / 5 + 0.5))))
    return (0);
  else
    return (1);
}


x86 assembly (clang, -O0):
<BLSCheck>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @BLSCheck(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
store i32 0, i32* %8
store i32 0, i32* %7
ret i32 0
}

LLVM IR (-O2):
define i32 @BLSCheck(i32* nocapture readnone %0, i32 %1, i32* nocapture readnone %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lasvm_error(char *);
void *malloc(int);
void *xmalloc(int n) {
  void *p = malloc(n);
  if (!p)
    lasvm_error("Function malloc() has returned zero\n");
  return p;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114e <xmalloc+0x2e>
lea    0xeb7(%rip),%rdi
call   1040 <lasvm_error@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
call   1030 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    113a <xmalloc+0x1a>
lea    0xecb(%rip),%rdi
call   1040 <lasvm_error@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Function malloc() has returned zero\0A\00"
define i8* @xmalloc(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %10, label %8
8: ; preds = %1
%9 = call i32 @lasvm_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
@.str = [37 x i8] c"Function malloc() has returned zero\0A\00"
define noalias i8* @xmalloc(i32 %0) {
%2 = tail call i8* @malloc(i32 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @lasvm_error(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int tcp_set_option_internal(int, int);
int tcp_set_option(int fd, int opt) { return tcp_set_option_internal(fd, opt); }


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

x86 assembly (clang, -O2):
<tcp_set_option>:
jmp    1030 <tcp_set_option_internal@plt>

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

LLVM IR (-O2):
define i32 @tcp_set_option(i32 %0, i32 %1) {
%3 = tail call i32 @tcp_set_option_internal(i32 %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ test_cart2d_heat();
int /*<<< orphan*/ test_cart2d_split_merge();
int /*<<< orphan*/ test_decomp2d();
int /*<<< orphan*/ test_make_cart2d();
int main(int argc, char **argv) {
  test_decomp2d();
  test_make_cart2d();
  test_cart2d_split_merge();
  test_cart2d_heat();
  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_decomp2d@plt>
mov    $0x0,%al
call   1030 <test_make_cart2d@plt>
mov    $0x0,%al
call   1050 <test_cart2d_split_merge@plt>
mov    $0x0,%al
call   1060 <test_cart2d_heat@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_decomp2d@plt>
xor    %eax,%eax
call   1030 <test_make_cart2d@plt>
xor    %eax,%eax
call   1050 <test_cart2d_split_merge@plt>
xor    %eax,%eax
call   1060 <test_cart2d_heat@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @test_decomp2d()
%7 = call i32 (...) @test_make_cart2d()
%8 = call i32 (...) @test_cart2d_split_merge()
%9 = call i32 (...) @test_cart2d_heat()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_decomp2d()
%4 = tail call i32 (...) @test_make_cart2d()
%5 = tail call i32 (...) @test_cart2d_split_merge()
%6 = tail call i32 (...) @test_cart2d_heat()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
void GLUT_reshape(int w, int h) { glViewport(0, 0, w, h); }


x86 assembly (clang, -O0):
<GLUT_reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glViewport@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GLUT_reshape>:
mov    %esi,%ecx
mov    %edi,%edx
xor    %edi,%edi
xor    %esi,%esi
jmp    1030 <glViewport@plt>

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

LLVM IR (-O2):
define void @GLUT_reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
ret void
}
U(y, x) char *y;
char **x;
{
  char *r = M(strlen(*x) + strlen(y) + 1);
  sprintf(r, "%s%s", *x, y);
  *x = r;
}


x86 assembly (clang, -O0):
<U>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <strlen@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x28(%rbp),%rdi
add    %rax,%rdi
add    $0x1,%rdi
mov    $0x0,%al
call   1040 <M@plt>
cltq
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe79(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r12
mov    %rdi,%r14
mov    (%rsi),%rdi
call   1030 <strlen@plt>
mov    %rax,%r15
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r15,%rax,1),%rdi
add    $0x1,%rdi
xor    %eax,%eax
call   1040 <M@plt>
movslq %eax,%rbx
mov    (%r12),%rdx
lea    0xe92(%rip),%rsi
mov    %rbx,%rdi
mov    %r14,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rbx,(%r12)
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
define i32 @U(i8* %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8*
store i8* %0, i8** %4
store i8** %1, i8*** %5
%7 = load i8**, i8*** %5
%8 = load i8*, i8** %7
%9 = call i64 @strlen(i8* %8)
%10 = load i8*, i8** %4
%11 = call i64 @strlen(i8* %10)
%12 = add i64 %9, %11
%13 = add i64 %12, 1
%14 = call i32 (i64, ...) bitcast (i32 (...)* @M to i32 (i64, ...)*)(i64 %13)
%15 = sext i32 %14 to i64
%16 = inttoptr i64 %15 to i8*
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = load i8**, i8*** %5
%19 = load i8*, i8** %18
%20 = load i8*, i8** %4
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %19, i8* %20)
%22 = load i8*, i8** %6
%23 = load i8**, i8*** %5
store i8* %22, i8** %23
%24 = load i32, i32* %3
ret i32 %24
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
define i32 @U(i8* %0, i8** nocapture %1) {
%3 = load i8*, i8** %1
%4 = tail call i64 @strlen(i8* dereferenceable(1) %3)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%6 = add i64 %4, 1
%7 = add i64 %6, %5
%8 = tail call i32 (i64, ...) bitcast (i32 (...)* @M to i32 (i64, ...)*)(i64 %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
%11 = load i8*, i8** %1
%12 = tail call i32 (i8*, i8*, ...) @sprintf(i8* dereferenceable(1) %10, i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %11, i8* %0)
store i8* %10, i8** %1
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ des_pcbc_encrypt(void *, void *, long, void *, void *, int);
void kcglue_des_pcbc_encrypt(void *asrc, void *adest, long length, void *asched,
                             void *akey, int direction) {
  des_pcbc_encrypt(asrc, adest, length, asched, akey, direction);
}


x86 assembly (clang, -O0):
<kcglue_des_pcbc_encrypt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x2c(%rbp),%r9d
call   1030 <des_pcbc_encrypt@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcglue_des_pcbc_encrypt>:
jmp    1030 <des_pcbc_encrypt@plt>

LLVM IR (-O0):
define void @kcglue_des_pcbc_encrypt(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
store i8* %0, i8** %7
store i8* %1, i8** %8
store i64 %2, i64* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%13 = load i8*, i8** %7
%14 = load i8*, i8** %8
%15 = load i64, i64* %9
%16 = load i8*, i8** %10
%17 = load i8*, i8** %11
%18 = load i32, i32* %12
%19 = call i32 @des_pcbc_encrypt(i8* %13, i8* %14, i64 %15, i8* %16, i8* %17, i32 %18)
ret void
}

LLVM IR (-O2):
define void @kcglue_des_pcbc_encrypt(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4, i32 %5) {
%7 = tail call i32 @des_pcbc_encrypt(i8* %0, i8* %1, i64 %2, i8* %3, i8* %4, i32 %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _I8080_RLC();
void do0x07() { _I8080_RLC(); }


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

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

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

LLVM IR (-O2):
define void @do0x07() {
%1 = tail call i32 (...) @_I8080_RLC()
ret void
}
void Sys_ConfigureFPU() {}


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

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

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

LLVM IR (-O2):
define void @Sys_ConfigureFPU() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fwrite(char *, int, int, int /*<<< orphan*/ *);
int main() {
  FILE *p = NULL;
  p = fopen("testNtimes.txt", "w+");
  fwrite("a", 1, 3, p);
  fclose(p);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movq   $0x0,-0x10(%rbp)
lea    0xeb2(%rip),%rdi
lea    0xeba(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
lea    0xea9(%rip),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
call   1050 <fwrite@plt>
mov    -0x10(%rbp),%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xec8(%rip),%rdi
lea    0xed0(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rbx
lea    0xec4(%rip),%rdi
mov    $0x1,%esi
mov    $0x3,%edx
mov    %rax,%rcx
call   1050 <fwrite@plt>
mov    %rbx,%rdi
call   1030 <fclose@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"testNtimes.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
store i32* null, i32** %2
%3 = call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %3, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 3, i32* %4)
%6 = load i32*, i32** %2
%7 = call i32 @fclose(i32* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [15 x i8] c"testNtimes.txt\00"
@.str.1 = [3 x i8] c"w+\00"
@.str.2 = [2 x i8] c"a\00"
define i32 @main() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fwrite(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i32 1, i32 3, i32* %1)
%3 = tail call i32 @fclose(i32* %1)
ret i32 0
}
void INT_Excep_PERIB_INTB202(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB202() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ dmc_unrar_get_uint16le(int /*<<< orphan*/ const *);
uint16_t dmc_unrar_unicode_read_uint16le_from_uint8(const void *opaque) {
  return dmc_unrar_get_uint16le((const uint8_t *)opaque);
}


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

x86 assembly (clang, -O2):
<dmc_unrar_unicode_read_uint16le_from_uint8>:
jmp    1030 <dmc_unrar_get_uint16le@plt>

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

LLVM IR (-O2):
define i32 @dmc_unrar_unicode_read_uint16le_from_uint8(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = tail call i32 @dmc_unrar_get_uint16le(i32* %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ check(double *, double *);
int /*<<< orphan*/ init(double *, double *, int);
int /*<<< orphan*/ work(double *, int, int);
int main() {
  double b[128], b_ref[128];
  init(b, b_ref, 128);
  work(b, 128, 16);
  work(b_ref, 128, 16);
  check(b, b_ref);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x810,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
mov    $0x80,%edx
call   1040 <init@plt>
lea    -0x410(%rbp),%rdi
mov    $0x80,%esi
mov    $0x10,%edx
call   1030 <work@plt>
lea    -0x810(%rbp),%rdi
mov    $0x80,%esi
mov    $0x10,%edx
call   1030 <work@plt>
lea    -0x410(%rbp),%rdi
lea    -0x810(%rbp),%rsi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x810,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x808,%rsp
lea    0x400(%rsp),%rbx
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
mov    $0x80,%edx
call   1040 <init@plt>
mov    %rbx,%rdi
mov    $0x80,%esi
mov    $0x10,%edx
call   1030 <work@plt>
mov    %r14,%rdi
mov    $0x80,%esi
mov    $0x10,%edx
call   1030 <work@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <check@plt>
xor    %eax,%eax
add    $0x808,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [128 x double]
%3 = alloca [128 x double]
store i32 0, i32* %1
%4 = getelementptr inbounds [128 x double], [128 x double]* %2, i64 0, i64 0
%5 = getelementptr inbounds [128 x double], [128 x double]* %3, i64 0, i64 0
%6 = call i32 @init(double* %4, double* %5, i32 128)
%7 = getelementptr inbounds [128 x double], [128 x double]* %2, i64 0, i64 0
%8 = call i32 @work(double* %7, i32 128, i32 16)
%9 = getelementptr inbounds [128 x double], [128 x double]* %3, i64 0, i64 0
%10 = call i32 @work(double* %9, i32 128, i32 16)
%11 = getelementptr inbounds [128 x double], [128 x double]* %2, i64 0, i64 0
%12 = getelementptr inbounds [128 x double], [128 x double]* %3, i64 0, i64 0
%13 = call i32 @check(double* %11, double* %12)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca [128 x double]
%2 = alloca [128 x double]
%3 = bitcast [128 x double]* %1 to i8*
%4 = bitcast [128 x double]* %2 to i8*
%5 = getelementptr inbounds [128 x double], [128 x double]* %1, i64 0, i64 0
%6 = getelementptr inbounds [128 x double], [128 x double]* %2, i64 0, i64 0
%7 = call i32 @init(double* %5, double* %6, i32 128)
%8 = call i32 @work(double* %5, i32 128, i32 16)
%9 = call i32 @work(double* %6, i32 128, i32 16)
%10 = call i32 @check(double* %5, double* %6)
ret i32 0
}
/* Variables and functions */
int get_episode(char const *);
int compare_links(const void *a, const void *b) {
  const char **ia = (const char **)a;
  const char **ib = (const char **)b;
  int ep1 = get_episode(*ia);
  int ep2 = get_episode(*ib);
  return ep1 - ep2;
}


x86 assembly (clang, -O0):
<compare_links>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rdi
call   1030 <get_episode@plt>
mov    %eax,-0x24(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rdi
call   1030 <get_episode@plt>
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
sub    -0x28(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_links>:
push   %rbp
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    (%rdi),%rdi
call   1030 <get_episode@plt>
mov    %eax,%ebp
mov    (%rbx),%rdi
call   1030 <get_episode@plt>
sub    %eax,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @compare_links(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%9 = load i8*, i8** %3
%10 = bitcast i8* %9 to i8**
store i8** %10, i8*** %5
%11 = load i8*, i8** %4
%12 = bitcast i8* %11 to i8**
store i8** %12, i8*** %6
%13 = load i8**, i8*** %5
%14 = load i8*, i8** %13
%15 = call i32 @get_episode(i8* %14)
store i32 %15, i32* %7
%16 = load i8**, i8*** %6
%17 = load i8*, i8** %16
%18 = call i32 @get_episode(i8* %17)
store i32 %18, i32* %8
%19 = load i32, i32* %7
%20 = load i32, i32* %8
%21 = sub nsw i32 %19, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @compare_links(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i8**
%4 = bitcast i8* %1 to i8**
%5 = load i8*, i8** %3
%6 = tail call i32 @get_episode(i8* %5)
%7 = load i8*, i8** %4
%8 = tail call i32 @get_episode(i8* %7)
%9 = sub nsw i32 %6, %8
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ uid_t;
struct _info {
  int dummy;
};

/* Variables and functions */
int scan_infos(struct _info const *, int /*<<< orphan*/, int);
int keepshell(const struct _info *lst, uid_t id) {
  return scan_infos(lst, id, 0x0002);
}


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

x86 assembly (clang, -O2):
<keepshell>:
mov    $0x2,%edx
jmp    1030 <scan_infos@plt>

LLVM IR (-O0):
%struct._info = type { i32 }
define i32 @keepshell(%struct._info* %0, i32 %1) {
%3 = alloca %struct._info*
%4 = alloca i32
store %struct._info* %0, %struct._info** %3
store i32 %1, i32* %4
%5 = load %struct._info*, %struct._info** %3
%6 = load i32, i32* %4
%7 = call i32 @scan_infos(%struct._info* %5, i32 %6, i32 2)
ret i32 %7
}

LLVM IR (-O2):
%struct._info = type { i32 }
define i32 @keepshell(%struct._info* %0, i32 %1) {
%3 = tail call i32 @scan_infos(%struct._info* %0, i32 %1, i32 2)
ret i32 %3
}
void rop3_196_0_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~*D;
  stk2 = T | stk3;
  stk1 = S & stk2;
  *D = (stk1 & S) | (stk1 & (~T)) | (T & (~S) & *D);
}


x86 assembly (clang, -O0):
<rop3_196_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
xor    $0xffffffff,%eax
mov    %al,-0xd(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0xd(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
movzbl -0x9(%rbp),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
and    %ecx,%eax
movzbl -0xb(%rbp),%ecx
movzbl -0xa(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
movzbl -0xa(%rbp),%ecx
movzbl -0x9(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
mov    -0x8(%rbp),%rdx
movzbl (%rdx),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_196_0_1>:
mov    (%rdi),%al
mov    %eax,%ecx
not    %cl
or     %dl,%cl
and    %sil,%cl
not    %sil
and    %dl,%sil
and    %al,%sil
or     %cl,%sil
mov    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_196_0_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
%9 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%10 = load i8*, i8** %4
%11 = load i8, i8* %10
%12 = zext i8 %11 to i32
%13 = xor i32 %12, -1
%14 = trunc i32 %13 to i8
store i8 %14, i8* %9
%15 = load i8, i8* %6
%16 = zext i8 %15 to i32
%17 = load i8, i8* %9
%18 = zext i8 %17 to i32
%19 = or i32 %16, %18
%20 = trunc i32 %19 to i8
store i8 %20, i8* %8
%21 = load i8, i8* %5
%22 = zext i8 %21 to i32
%23 = load i8, i8* %8
%24 = zext i8 %23 to i32
%25 = and i32 %22, %24
%26 = trunc i32 %25 to i8
store i8 %26, i8* %7
%27 = load i8, i8* %7
%28 = zext i8 %27 to i32
%29 = load i8, i8* %5
%30 = zext i8 %29 to i32
%31 = and i32 %28, %30
%32 = load i8, i8* %7
%33 = zext i8 %32 to i32
%34 = load i8, i8* %6
%35 = zext i8 %34 to i32
%36 = xor i32 %35, -1
%37 = and i32 %33, %36
%38 = or i32 %31, %37
%39 = load i8, i8* %6
%40 = zext i8 %39 to i32
%41 = load i8, i8* %5
%42 = zext i8 %41 to i32
%43 = xor i32 %42, -1
%44 = and i32 %40, %43
%45 = load i8*, i8** %4
%46 = load i8, i8* %45
%47 = zext i8 %46 to i32
%48 = and i32 %44, %47
%49 = or i32 %38, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_196_0_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = load i8, i8* %0
%5 = xor i8 %4, -1
%6 = or i8 %5, %2
%7 = and i8 %6, %1
%8 = xor i8 %1, -1
%9 = and i8 %8, %2
%10 = and i8 %9, %4
%11 = or i8 %7, %10
store i8 %11, i8* %0
ret void
}
/* Type definitions */
struct dirent {
  int dummy;
};
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
scalar_t__ errno;
struct dirent *readdir(int /*<<< orphan*/ *);
struct dirent *xreaddir(DIR *dirp) {
  errno = 0;
  struct dirent *e = readdir(dirp);
  if (errno && e == NULL) {
    ;
  }
  return e;
}


x86 assembly (clang, -O0):
<xreaddir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ebd(%rip),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
call   1030 <readdir@plt>
mov    %rax,-0x10(%rbp)
mov    0x2ea2(%rip),%rax
cmpq   $0x0,(%rax)
je     1158 <xreaddir+0x48>
cmpq   $0x0,-0x10(%rbp)
jne    1158 <xreaddir+0x48>
jmp    1158 <xreaddir+0x48>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xreaddir>:
mov    0x2ec9(%rip),%rax
movq   $0x0,(%rax)
jmp    1030 <readdir@plt>

LLVM IR (-O0):
%struct.dirent = type { i32 }
@errno = global i64 0
define %struct.dirent* @xreaddir(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.dirent*
store i32* %0, i32** %2
store i64 0, i64* @errno
%4 = load i32*, i32** %2
%5 = call %struct.dirent* @readdir(i32* %4)
store %struct.dirent* %5, %struct.dirent** %3
%6 = load i64, i64* @errno
%7 = icmp ne i64 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load %struct.dirent*, %struct.dirent** %3
%10 = icmp eq %struct.dirent* %9, null
br i1 %10, label %11, label %12
11: ; preds = %8
br label %12
12: ; preds = %11, %8, %1
%13 = load %struct.dirent*, %struct.dirent** %3
ret %struct.dirent* %13
}

LLVM IR (-O2):
%struct.dirent = type { i32 }
@errno = global i64 0
define %struct.dirent* @xreaddir(i32* %0) {
store i64 0, i64* @errno
%2 = tail call %struct.dirent* @readdir(i32* %0)
ret %struct.dirent* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void say_hello() { printf("hello\n"); }


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

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

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

LLVM IR (-O2):
@str = [6 x i8] c"hello\00"
define void @say_hello() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct tcp_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tcp_buf *);
void tcp_buffer_free(struct tcp_buf **buf) {
  free(*buf);
  *buf = NULL;
}


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

x86 assembly (clang, -O2):
<tcp_buffer_free>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <free@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tcp_buf = type { i32 }
define void @tcp_buffer_free(%struct.tcp_buf** nocapture %0) {
%2 = load %struct.tcp_buf*, %struct.tcp_buf** %0
%3 = tail call i32 @free(%struct.tcp_buf* %2)
store %struct.tcp_buf* null, %struct.tcp_buf** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ test_read_dial_missing_data();
int /*<<< orphan*/ test_write_dial_data();
int /*<<< orphan*/ test_write_kv_larger_than_max_len();
void test_dial_data_suite() {
  printf("== %s ==\n",
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Netflix/dial-reference/refs/heads/master/"
         "server/tests/test_dial_data.c");
  test_read_dial_missing_data();
  test_write_dial_data();
  test_write_kv_larger_than_max_len();
}


x86 assembly (clang, -O0):
<test_dial_data_suite>:
push   %rbp
mov    %rsp,%rbp
lea    0xeb5(%rip),%rdi
lea    0xeb8(%rip),%rsi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <test_read_dial_missing_data@plt>
mov    $0x0,%al
call   1060 <test_write_dial_data@plt>
mov    $0x0,%al
call   1040 <test_write_kv_larger_than_max_len@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_dial_data_suite>:
push   %rax
lea    0xeb8(%rip),%rdi
lea    0xebb(%rip),%rsi
call   1030 <printf@plt>
xor    %eax,%eax
call   1050 <test_read_dial_missing_data@plt>
xor    %eax,%eax
call   1060 <test_write_dial_data@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <test_write_kv_larger_than_max_len@plt>

LLVM IR (-O0):
@.str = [10 x i8] c"== %s ==\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Netflix/dial-reference/refs/heads/master/server/tests/test_dial_data.c\00"
define void @test_dial_data_suite() {
%1 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0))
%2 = call i32 (...) @test_read_dial_missing_data()
%3 = call i32 (...) @test_write_dial_data()
%4 = call i32 (...) @test_write_kv_larger_than_max_len()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"== %s ==\0A\00"
@.str.1 = [161 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Netflix/dial-reference/refs/heads/master/server/tests/test_dial_data.c\00"
define void @test_dial_data_suite() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 (...) @test_read_dial_missing_data()
%3 = tail call i32 (...) @test_write_dial_data()
%4 = tail call i32 (...) @test_write_kv_larger_than_max_len()
ret void
}