xunge/DecIR huggingface dataset:
/* Variables and functions */
int RandomUniform();
int RandomInt(int lower, int upper) {
  return ((int)(RandomUniform() * (upper - lower + 1)) + lower);
}


x86 assembly (clang, -O0):
<RandomInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <RandomUniform@plt>
mov    -0x8(%rbp),%ecx
sub    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomInt>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <RandomUniform@plt>
sub    %ebp,%ebx
add    $0x1,%ebx
imul   %ebx,%eax
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @RandomInt(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = call i32 (...) @RandomUniform()
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = mul nsw i32 %5, %9
%11 = load i32, i32* %3
%12 = add nsw i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @RandomInt(i32 %0, i32 %1) {
%3 = tail call i32 (...) @RandomUniform()
%4 = sub i32 1, %0
%5 = add i32 %4, %1
%6 = mul nsw i32 %3, %5
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
int O_EXCL;
int O_RDWR;
int /*<<< orphan*/ close(int);
int open(char const *, int);
int canOpenExclusively(const char *fn) {
  int fd = open(fn, O_RDWR | O_EXCL);
  if (fd < 0) {
    return 0;
  }
  close(fd);
  return 1;
}


x86 assembly (clang, -O0):
<canOpenExclusively>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    0x2e98(%rip),%rax
or     (%rax),%esi
call   1040 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jge    1160 <canOpenExclusively+0x40>
movl   $0x0,-0x4(%rbp)
jmp    116f <canOpenExclusively+0x4f>
mov    -0x14(%rbp),%edi
call   1030 <close@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<canOpenExclusively>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
call   1040 <open@plt>
test   %eax,%eax
js     114a <canOpenExclusively+0x2a>
mov    %eax,%edi
call   1030 <close@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_RDWR = global i32 0
@O_EXCL = global i32 0
define i32 @canOpenExclusively(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_RDWR
%7 = load i32, i32* @O_EXCL
%8 = or i32 %6, %7
%9 = call i32 @open(i8* %5, i32 %8)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp slt i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %16
13: ; preds = %1
%14 = load i32, i32* %4
%15 = call i32 @close(i32 %14)
store i32 1, i32* %2
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@O_RDWR = global i32 0
@O_EXCL = global i32 0
define i32 @canOpenExclusively(i8* nocapture %0) {
%2 = load i32, i32* @O_RDWR
%3 = load i32, i32* @O_EXCL
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4)
%6 = icmp slt i32 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %1
%8 = tail call i32 @close(i32 %5)
br label %9
9: ; preds = %1, %7
%10 = phi i32 [ 1, %7 ], [ 0, %1 ]
ret i32 %10
}
int fc8150_tuner_deinit(void *hDevice) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fc8150_tuner_deinit(i8* nocapture readnone %0) {
ret i32 0
}
void d_fetchsl(const unsigned char **ptr, signed long *dest) {
  *dest = (((signed long)(*ptr)[0] << 24) | ((unsigned long)(*ptr)[1] << 16) |
           ((unsigned long)(*ptr)[2] << 8) | ((unsigned long)(*ptr)[3] << 0));
  *ptr += 4;
}


x86 assembly (clang, -O0):
<d_fetchsl>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl (%rax),%eax
mov    %eax,%ecx
shl    $0x18,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x1(%rax),%eax
shl    $0x10,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x2(%rax),%eax
shl    $0x8,%rax
or     %rax,%rcx
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movzbl 0x3(%rax),%eax
shl    $0x0,%rax
or     %rax,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x4,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_fetchsl>:
mov    (%rdi),%rax
mov    (%rax),%ecx
shl    $0x20,%rcx
bswap  %rcx
mov    %rcx,(%rsi)
add    $0x4,%rax
mov    %rax,(%rdi)
ret

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

LLVM IR (-O2):
define void @d_fetchsl(i8** nocapture %0, i64* nocapture writeonly %1) {
%3 = load i8*, i8** %0
%4 = load i8, i8* %3
%5 = zext i8 %4 to i64
%6 = shl nuw nsw i64 %5, 24
%7 = getelementptr inbounds i8, i8* %3, i64 1
%8 = load i8, i8* %7
%9 = zext i8 %8 to i64
%10 = shl nuw nsw i64 %9, 16
%11 = or i64 %10, %6
%12 = getelementptr inbounds i8, i8* %3, i64 2
%13 = load i8, i8* %12
%14 = zext i8 %13 to i64
%15 = shl nuw nsw i64 %14, 8
%16 = or i64 %11, %15
%17 = getelementptr inbounds i8, i8* %3, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i64
%20 = or i64 %16, %19
store i64 %20, i64* %1
%21 = getelementptr inbounds i8, i8* %3, i64 4
store i8* %21, i8** %0
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ free(int *);
scalar_t__ malloc(int);
int main(void) {
  int *ptr;
  ptr = (int *)malloc(sizeof(int));
  free(ptr);
  free(NULL);
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1030 <free@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x4,%edi
call   1040 <malloc@plt>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %edi,%edi
call   1030 <free@plt>
mov    0x2e9f(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
store i32 0, i32* %1
%3 = call i64 @malloc(i32 4)
%4 = inttoptr i64 %3 to i32*
store i32* %4, i32** %2
%5 = load i32*, i32** %2
%6 = call i32 @free(i32* %5)
%7 = call i32 @free(i32* null)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 @malloc(i32 4)
%2 = inttoptr i64 %1 to i32*
%3 = tail call i32 @free(i32* %2)
%4 = tail call i32 @free(i32* null)
%5 = load i32, i32* @EXIT_SUCCESS
ret i32 %5
}
long labs(long arg1) { return arg1 > 0 ? arg1 : -arg1; }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jle    1120 <labs+0x20>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<labs>:
mov    %rdi,%rax
neg    %rax
cmovs  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @labs(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp sgt i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load i64, i64* %2
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = sub nsw i64 0, %8
br label %10
10: ; preds = %7, %5
%11 = phi i64 [ %6, %5 ], [ %9, %7 ]
ret i64 %11
}

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
int _com_close(int sock) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @_com_close(i32 %0) {
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ first(int);
int main() {
  int some_int = 1;
  first(some_int);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <first@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
call   1030 <first@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @first(i32 1)
ret i32 0
}
void c_outb(unsigned short port, unsigned char value) {
  asm volatile("outb %1, %0" : : "dN"(port), "a"(value));
}


x86 assembly (clang, -O0):
<c_outb>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x3(%rbp),%al
out    %al,(%dx)
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_outb>:
mov    %esi,%eax
mov    %edi,%edx
out    %al,(%dx)
ret

LLVM IR (-O0):
define void @c_outb(i16 zeroext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
%6 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @c_outb(i16 zeroext %0, i8 zeroext %1) {
tail call void asm sideeffect "outb $1, $0", "{dx}N,{ax},~{dirflag},~{fpsr},~{flags}"(i16 %0, i8 %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("The world is a vampire. \n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"The world is a vampire. \0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [25 x i8] c"The world is a vampire. \00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
int port_deny_multiple(unsigned short port, unsigned short count) { return 0; }


x86 assembly (clang, -O0):
<port_deny_multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %ax,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @port_deny_multiple(i16 zeroext %0, i16 zeroext %1) {
ret i32 0
}
float w_to_hp(float value) { return value * 0.0013410221f; }


x86 assembly (clang, -O0):
<w_to_hp>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
pop    %rbp
ret

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

LLVM IR (-O0):
define float @w_to_hp(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fmul float %3, 0x3F55F8A780000000
ret float %4
}

LLVM IR (-O2):
define float @w_to_hp(float %0) {
%2 = fmul float %0, 0x3F55F8A780000000
ret float %2
}
/* Variables and functions */
int /*<<< orphan*/ spi_wait_idle();
int /*<<< orphan*/ spi_write_reg(int, int);
void send_initial_clock(void) {
  spi_write_reg(0x0, 1);
  spi_write_reg(0x1, 0);
  spi_write_reg(0x2, (1 << 16) | (80 / 10));
  spi_wait_idle();
}


x86 assembly (clang, -O0):
<send_initial_clock>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <spi_write_reg@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <spi_write_reg@plt>
mov    $0x2,%edi
mov    $0x10008,%esi
call   1030 <spi_write_reg@plt>
mov    $0x0,%al
call   1040 <spi_wait_idle@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<send_initial_clock>:
push   %rax
xor    %edi,%edi
mov    $0x1,%esi
call   1030 <spi_write_reg@plt>
mov    $0x1,%edi
xor    %esi,%esi
call   1030 <spi_write_reg@plt>
mov    $0x2,%edi
mov    $0x10008,%esi
call   1030 <spi_write_reg@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <spi_wait_idle@plt>

LLVM IR (-O0):
define void @send_initial_clock() {
%1 = call i32 @spi_write_reg(i32 0, i32 1)
%2 = call i32 @spi_write_reg(i32 1, i32 0)
%3 = call i32 @spi_write_reg(i32 2, i32 65544)
%4 = call i32 (...) @spi_wait_idle()
ret void
}

LLVM IR (-O2):
define void @send_initial_clock() {
%1 = tail call i32 @spi_write_reg(i32 0, i32 1)
%2 = tail call i32 @spi_write_reg(i32 1, i32 0)
%3 = tail call i32 @spi_write_reg(i32 2, i32 65544)
%4 = tail call i32 (...) @spi_wait_idle()
ret void
}
int unregister_chrdev(unsigned int major, char const *name) {
  { return (0); }
}


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

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

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

LLVM IR (-O2):
define i32 @unregister_chrdev(i32 %0, i8* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int ct_ne_u64(int, int);
uint64_t ct_eq_u64(uint64_t x, uint64_t y) { return 1 ^ ct_ne_u64(x, y); }


x86 assembly (clang, -O0):
<ct_eq_u64>:
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 <ct_ne_u64@plt>
xor    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ct_eq_u64>:
push   %rax
call   1030 <ct_ne_u64@plt>
xor    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ct_eq_u64(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 @ct_ne_u64(i32 %5, i32 %6)
%8 = xor i32 1, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @ct_eq_u64(i32 %0, i32 %1) {
%3 = tail call i32 @ct_ne_u64(i32 %0, i32 %1)
%4 = xor i32 %3, 1
ret i32 %4
}
void CopyArcList(Schema, A, B) struct frvStruct *Schema;
struct Vertex *A;
struct Vertex *B;
{
  AssignVertexArcListFirst(B, AccessVertexArcListFirst(A));
}


x86 assembly (clang, -O0):
<CopyArcList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x0,%al
call   1040 <AccessVertexArcListFirst@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    $0x0,%al
call   1030 <AssignVertexArcListFirst@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CopyArcList>:
push   %rbx
mov    %rdx,%rbx
mov    %rsi,%rdi
xor    %eax,%eax
call   1040 <AccessVertexArcListFirst@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rbx
jmp    1030 <AssignVertexArcListFirst@plt>

LLVM IR (-O0):
%struct.frvStruct = type opaque
%struct.Vertex = type opaque
define void @CopyArcList(%struct.frvStruct* %0, %struct.Vertex* %1, %struct.Vertex* %2) {
%4 = alloca %struct.frvStruct*
%5 = alloca %struct.Vertex*
%6 = alloca %struct.Vertex*
store %struct.frvStruct* %0, %struct.frvStruct** %4
store %struct.Vertex* %1, %struct.Vertex** %5
store %struct.Vertex* %2, %struct.Vertex** %6
%7 = load %struct.Vertex*, %struct.Vertex** %6
%8 = load %struct.Vertex*, %struct.Vertex** %5
%9 = call i32 (%struct.Vertex*, ...) bitcast (i32 (...)* @AccessVertexArcListFirst to i32 (%struct.Vertex*, ...)*)(%struct.Vertex* %8)
%10 = call i32 (%struct.Vertex*, i32, ...) bitcast (i32 (...)* @AssignVertexArcListFirst to i32 (%struct.Vertex*, i32, ...)*)(%struct.Vertex* %7, i32 %9)
ret void
}

LLVM IR (-O2):
%struct.frvStruct = type opaque
%struct.Vertex = type opaque
define void @CopyArcList(%struct.frvStruct* nocapture readnone %0, %struct.Vertex* %1, %struct.Vertex* %2) {
%4 = tail call i32 (%struct.Vertex*, ...) bitcast (i32 (...)* @AccessVertexArcListFirst to i32 (%struct.Vertex*, ...)*)(%struct.Vertex* %1)
%5 = tail call i32 (%struct.Vertex*, i32, ...) bitcast (i32 (...)* @AssignVertexArcListFirst to i32 (%struct.Vertex*, i32, ...)*)(%struct.Vertex* %2, i32 %4)
ret void
}
/* Variables and functions */
void stub1(long);
void testClosureLrV(void (*closure)(long), long a1) {
  if (closure != NULL)
    (*closure)(a1);
}


x86 assembly (clang, -O0):
<testClosureLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1125 <testClosureLrV+0x25>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
call   *%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLrV>:
test   %rdi,%rdi
je     110d <testClosureLrV+0xd>
mov    %rdi,%rax
mov    %rsi,%rdi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureLrV(void (i64)* %0, i64 %1) {
%3 = icmp eq void (i64)* %0, null
br i1 %3, label %5, label %4
4: ; preds = %2
tail call void %0(i64 %1)
br label %5
5: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
scalar_t__ malloc(size_t);
int /*<<< orphan*/ memcpy(char *, unsigned char const *, size_t);
int /*<<< orphan*/ printf(char *, char *);
int test_yajl_map_key(void *ctx, const unsigned char *stringVal,
                      size_t stringLen) {
  char *str = (char *)malloc(stringLen + 1);
  str[stringLen] = 0;
  memcpy(str, stringVal, stringLen);
  printf("key: '%s'\n", str);
  free(str);
  return 1;
}


x86 assembly (clang, -O0):
<test_yajl_map_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
add    $0x1,%rdi
call   1060 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x20(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1040 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_yajl_map_key>:
push   %r15
push   %r14
push   %rbx
mov    %rdx,%r15
mov    %rsi,%r14
lea    0x1(%rdx),%rdi
call   1060 <malloc@plt>
mov    %rax,%rbx
movb   $0x0,(%rax,%r15,1)
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
lea    0xe8f(%rip),%rdi
mov    %rbx,%rsi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"key: '%s'\0A\00"
define i32 @test_yajl_map_key(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%8 = load i64, i64* %6
%9 = add i64 %8, 1
%10 = call i64 @malloc(i64 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %7
%12 = load i8*, i8** %7
%13 = load i64, i64* %6
%14 = getelementptr inbounds i8, i8* %12, i64 %13
store i8 0, i8* %14
%15 = load i8*, i8** %7
%16 = load i8*, i8** %5
%17 = load i64, i64* %6
%18 = call i32 @memcpy(i8* %15, i8* %16, i64 %17)
%19 = load i8*, i8** %7
%20 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %19)
%21 = load i8*, i8** %7
%22 = call i32 @free(i8* %21)
ret i32 1
}

LLVM IR (-O2):
@.str = [11 x i8] c"key: '%s'\0A\00"
define i32 @test_yajl_map_key(i8* nocapture readnone %0, i8* %1, i64 %2) {
%4 = add i64 %2, 1
%5 = tail call i64 @malloc(i64 %4)
%6 = inttoptr i64 %5 to i8*
%7 = getelementptr inbounds i8, i8* %6, i64 %2
store i8 0, i8* %7
%8 = tail call i32 @memcpy(i8* %6, i8* %1, i64 %2)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %6)
%10 = tail call i32 @free(i8* %6)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int setbits(unsigned int, int, int, unsigned int);
int main() {
  int ret = 0;
  int n = 3, p = 4;
  unsigned x = 247, y = 82;
  printf("%u", setbits(x, p, n, y));
  return ret;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
movl   $0x4,-0x10(%rbp)
movl   $0xf7,-0x14(%rbp)
movl   $0x52,-0x18(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%ecx
call   1040 <setbits@plt>
mov    %eax,%esi
lea    0xe94(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf7,%edi
mov    $0x4,%esi
mov    $0x3,%edx
mov    $0x52,%ecx
call   1040 <setbits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 3, i32* %3
store i32 4, i32* %4
store i32 247, i32* %5
store i32 82, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %3
%10 = load i32, i32* %6
%11 = call i32 @setbits(i32 %7, i32 %8, i32 %9, i32 %10)
%12 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %11)
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [3 x i8] c"%u\00"
define i32 @main() {
%1 = tail call i32 @setbits(i32 247, i32 4, i32 3, i32 82)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _delay_ms(int);
int /*<<< orphan*/ th_port_config();
void th_init() {
  th_port_config();
  _delay_ms(1000);
}


x86 assembly (clang, -O0):
<th_init>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <th_port_config@plt>
mov    $0x3e8,%edi
call   1030 <_delay_ms@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<th_init>:
push   %rax
xor    %eax,%eax
call   1040 <th_port_config@plt>
mov    $0x3e8,%edi
pop    %rax
jmp    1030 <_delay_ms@plt>

LLVM IR (-O0):
define void @th_init() {
%1 = call i32 (...) @th_port_config()
%2 = call i32 @_delay_ms(i32 1000)
ret void
}

LLVM IR (-O2):
define void @th_init() {
%1 = tail call i32 (...) @th_port_config()
%2 = tail call i32 @_delay_ms(i32 1000)
ret void
}
/* Variables and functions */
int check_prime(int);
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int num;
  scanf("%d", &num);
  int check = check_prime(num);
  if (check == 0)
    printf("%d is a prime number\n", num);
  else
    printf("%d is not a prime number\n", num);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <check_prime@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
jne    1178 <main+0x48>
mov    -0x8(%rbp),%esi
lea    0xe95(%rip),%rdi
call   1040 <printf@plt>
jmp    1187 <main+0x57>
mov    -0x8(%rbp),%esi
lea    0xe97(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"%d is a prime number\0A\00"
@.str.2 = [26 x i8] c"%d is not a prime number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = call i32 @check_prime(i32 %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %0
%10 = load i32, i32* %2
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %15
12: ; preds = %0
%13 = load i32, i32* %2
%14 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0), i32 %13)
br label %15
15: ; preds = %12, %9
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [22 x i8] c"%d is a prime number\0A\00"
@.str.2 = [26 x i8] c"%d is not a prime number\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = call i32 @check_prime(i32 %4)
%6 = icmp eq i32 %5, 0
%7 = load i32, i32* %1
%8 = select i1 %6, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.2, i64 0, i64 0)
%9 = call i32 @printf(i8* %8, i32 %7)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ createConnections();
int /*<<< orphan*/ createRooms();
int /*<<< orphan*/ createTypes();
int /*<<< orphan*/ game();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int i, j;
  srand(time(NULL));
  createRooms();
  createConnections();
  createTypes();
  game();
  cleanup();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
mov    $0x0,%al
call   1090 <createRooms@plt>
mov    $0x0,%al
call   1030 <createConnections@plt>
mov    $0x0,%al
call   1040 <createTypes@plt>
mov    $0x0,%al
call   1070 <game@plt>
mov    $0x0,%al
call   1080 <cleanup@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %edi,%edi
call   1060 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
xor    %eax,%eax
call   1090 <createRooms@plt>
xor    %eax,%eax
call   1030 <createConnections@plt>
xor    %eax,%eax
call   1040 <createTypes@plt>
xor    %eax,%eax
call   1070 <game@plt>
xor    %eax,%eax
call   1080 <cleanup@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
%6 = call i32 (...) @createRooms()
%7 = call i32 (...) @createConnections()
%8 = call i32 (...) @createTypes()
%9 = call i32 (...) @game()
%10 = call i32 (...) @cleanup()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
%3 = tail call i32 (...) @createRooms()
%4 = tail call i32 (...) @createConnections()
%5 = tail call i32 (...) @createTypes()
%6 = tail call i32 (...) @game()
%7 = tail call i32 (...) @cleanup()
ret i32 0
}
int Q_strcmp(char *s1, char *s2) {
  while (*s1 == *s2) {
    if (!*s1)
      return 0;
    s1 += 1;
    s2 += 1;
  }
  return -1;
}


x86 assembly (clang, -O0):
<Q_strcmp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
mov    -0x18(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1158 <Q_strcmp+0x58>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    113b <Q_strcmp+0x3b>
movl   $0x0,-0x4(%rbp)
jmp    115f <Q_strcmp+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    110c <Q_strcmp+0xc>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Q_strcmp>:
mov    (%rdi),%cl
mov    $0xffffffff,%eax
cmp    (%rsi),%cl
jne    1124 <Q_strcmp+0x24>
mov    $0x1,%edx
test   %cl,%cl
je     1125 <Q_strcmp+0x25>
movzbl (%rdi,%rdx,1),%ecx
lea    0x1(%rdx),%r8
cmp    (%rsi,%rdx,1),%cl
mov    %r8,%rdx
je     1110 <Q_strcmp+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @Q_strcmp(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp eq i8 %3, %4
br i1 %5, label %6, label %17
6: ; preds = %2, %11
%7 = phi i8 [ %14, %11 ], [ %3, %2 ]
%8 = phi i8* [ %13, %11 ], [ %1, %2 ]
%9 = phi i8* [ %12, %11 ], [ %0, %2 ]
%10 = icmp eq i8 %7, 0
br i1 %10, label %17, label %11
11: ; preds = %6
%12 = getelementptr inbounds i8, i8* %9, i64 1
%13 = getelementptr inbounds i8, i8* %8, i64 1
%14 = load i8, i8* %12
%15 = load i8, i8* %13
%16 = icmp eq i8 %14, %15
br i1 %16, label %6, label %17
17: ; preds = %6, %11, %2
%18 = phi i32 [ -1, %2 ], [ -1, %11 ], [ 0, %6 ]
ret i32 %18
}
/* Variables and functions */
int /*<<< orphan*/ invert(unsigned int *, int, int);
int /*<<< orphan*/ printf(char *, unsigned int);
int main() {
  unsigned x = 0x5505;
  int p = 7;
  int n = 4;
  invert(&x, p, n);
  printf("%x\n", x);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5505,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x7,%esi
mov    $0x4,%edx
call   1030 <invert@plt>
mov    0x4(%rsp),%esi
lea    0xeb8(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%x\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 21765, i32* %1
%3 = call i32 @invert(i32* %1, i32 7, i32 4)
%4 = load i32, i32* %1
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_condattr_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int pthread_condattr_destroy(pthread_condattr_t *a) { assert(0); }


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

x86 assembly (clang, -O2):
<pthread_condattr_destroy>:
xor    %edi,%edi
jmp    1030 <assert@plt>

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

LLVM IR (-O2):
define i32 @pthread_condattr_destroy(i32* nocapture readnone %0) {
%2 = tail call i32 @assert(i32 0)
ret i32 undef
}
int do_836() { return 836; }


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

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

LLVM IR (-O0):
define i32 @do_836() {
ret i32 836
}

LLVM IR (-O2):
define i32 @do_836() {
ret i32 836
}
int symbolic_index(int a) {
  int x[2] = {1, 2};
  if (a == 2) {
    return x[a];
  }
  return 0;
}


x86 assembly (clang, -O0):
<symbolic_index>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jne    112c <symbolic_index+0x2c>
movslq -0x8(%rbp),%rax
mov    -0x10(%rbp,%rax,4),%eax
mov    %eax,-0x4(%rbp)
jmp    1133 <symbolic_index+0x33>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.symbolic_index.x = [2 x i32] [i32 1, i32 2]
define i32 @symbolic_index(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca [2 x i32]
store i32 %0, i32* %3
%5 = bitcast [2 x i32]* %4 to i8*
%6 = load i32, i32* %3
%7 = icmp eq i32 %6, 2
br i1 %7, label %8, label %13
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [2 x i32], [2 x i32]* %4, i64 0, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %2
br label %14
13: ; preds = %1
store i32 0, i32* %2
br label %14
14: ; preds = %13, %8
%15 = load i32, i32* %2
ret i32 %15
}

LLVM IR (-O2):
define i32 @symbolic_index(i32 %0) {
ret i32 0
}
int is_alpha(char c) {
  if ((c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z'))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_alpha>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x41,%eax
jl     1124 <is_alpha+0x24>
movsbl -0x5(%rbp),%eax
cmp    $0x5a,%eax
jle    113e <is_alpha+0x3e>
movsbl -0x5(%rbp),%eax
cmp    $0x61,%eax
jl     114a <is_alpha+0x4a>
movsbl -0x5(%rbp),%eax
cmp    $0x7a,%eax
jg     114a <is_alpha+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <is_alpha+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_alpha>:
and    $0xdf,%dil
add    $0xbf,%dil
xor    %eax,%eax
cmp    $0x1a,%dil
setb   %al
ret

LLVM IR (-O0):
define i32 @is_alpha(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 65
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 90
br i1 %10, label %19, label %11
11: ; preds = %7, %1
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp sge i32 %13, 97
br i1 %14, label %15, label %20
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp sle i32 %17, 122
br i1 %18, label %19, label %20
19: ; preds = %15, %7
store i32 1, i32* %2
br label %21
20: ; preds = %15, %11
store i32 0, i32* %2
br label %21
21: ; preds = %20, %19
%22 = load i32, i32* %2
ret i32 %22
}

LLVM IR (-O2):
define i32 @is_alpha(i8 signext %0) {
%2 = and i8 %0, -33
%3 = add i8 %2, -65
%4 = icmp ult i8 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int func_2(int, int);
int func_3(int, int);
int /*<<< orphan*/ puts(char *);
int func_1() {
  puts("Inside func_1\n");
  return (func_2(1, 2) + func_3(3, 4));
}


x86 assembly (clang, -O0):
<func_1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <func_2@plt>
mov    %eax,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x4,%esi
call   1050 <func_3@plt>
mov    %eax,%ecx
mov    -0x4(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func_1>:
push   %rbx
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
mov    $0x2,%esi
call   1040 <func_2@plt>
mov    %eax,%ebx
mov    $0x3,%edi
mov    $0x4,%esi
call   1050 <func_3@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"Inside func_1\0A\00"
define i32 @func_1() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @func_2(i32 1, i32 2)
%3 = call i32 @func_3(i32 3, i32 4)
%4 = add nsw i32 %2, %3
ret i32 %4
}

LLVM IR (-O2):
@.str = [15 x i8] c"Inside func_1\0A\00"
define i32 @func_1() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @func_2(i32 1, i32 2)
%3 = tail call i32 @func_3(i32 3, i32 4)
%4 = add nsw i32 %3, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ transfer(int, int);
void f_intfly(void) { transfer(0x98100000, 2); }


x86 assembly (clang, -O0):
<f_intfly>:
push   %rbp
mov    %rsp,%rbp
mov    $0x98100000,%edi
mov    $0x2,%esi
call   1030 <transfer@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_intfly>:
mov    $0x98100000,%edi
mov    $0x2,%esi
jmp    1030 <transfer@plt>

LLVM IR (-O0):
define void @f_intfly() {
%1 = call i32 @transfer(i32 -1743781888, i32 2)
ret void
}

LLVM IR (-O2):
define void @f_intfly() {
%1 = tail call i32 @transfer(i32 -1743781888, i32 2)
ret void
}
void sys_v_shm(int rw_flag) {}


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

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

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

LLVM IR (-O2):
define void @sys_v_shm(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ freeMem(char *);
int /*<<< orphan*/ hPrintNonBreak(char *);
char *htmlEncode(char *);
void hPrintEncodedNonBreak(char *s) {
  char *encoded = htmlEncode(s);
  hPrintNonBreak(encoded);
  freeMem(encoded);
}


x86 assembly (clang, -O0):
<hPrintEncodedNonBreak>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <htmlEncode@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <hPrintNonBreak@plt>
mov    -0x10(%rbp),%rdi
call   1040 <freeMem@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hPrintEncodedNonBreak>:
push   %rbx
call   1050 <htmlEncode@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <hPrintNonBreak@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <freeMem@plt>

LLVM IR (-O0):
define void @hPrintEncodedNonBreak(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @htmlEncode(i8* %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @hPrintNonBreak(i8* %6)
%8 = load i8*, i8** %3
%9 = call i32 @freeMem(i8* %8)
ret void
}

LLVM IR (-O2):
define void @hPrintEncodedNonBreak(i8* %0) {
%2 = tail call i8* @htmlEncode(i8* %0)
%3 = tail call i32 @hPrintNonBreak(i8* %2)
%4 = tail call i32 @freeMem(i8* %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sscanf(char const *, char const *, int *);
int match(const char request[], const char fmt[]) {
  int n = -1;
  sscanf(request, fmt, &n);
  return (n > 0 && request[n] == '\0');
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0xffffffff,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdx
call   1030 <sscanf@plt>
xor    %eax,%eax
cmpl   $0x0,-0x14(%rbp)
mov    %al,-0x15(%rbp)
jle    115c <match+0x4c>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
sete   %al
mov    %al,-0x15(%rbp)
mov    -0x15(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0xffffffff,0xc(%rsp)
ff
lea    0xc(%rsp),%rdx
call   1030 <sscanf@plt>
mov    0xc(%rsp),%ecx
xor    %eax,%eax
test   %ecx,%ecx
jle    113b <match+0x2b>
cmpb   $0x0,(%rbx,%rcx,1)
sete   %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @match(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
store i32 -1, i32* %5
%6 = load i8*, i8** %3
%7 = load i8*, i8** %4
%8 = call i32 @sscanf(i8* %6, i8* %7, i32* %5)
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 0
br i1 %10, label %11, label %19
11: ; preds = %2
%12 = load i8*, i8** %3
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i8, i8* %12, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 0
br label %19
19: ; preds = %11, %2
%20 = phi i1 [ false, %2 ], [ %18, %11 ]
%21 = zext i1 %20 to i32
ret i32 %21
}

LLVM IR (-O2):
define i32 @match(i8* nocapture %0, i8* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 -1, i32* %3
%5 = call i32 @sscanf(i8* %0, i8* %1, i32* %3)
%6 = load i32, i32* %3
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %2
%9 = zext i32 %6 to i64
%10 = getelementptr inbounds i8, i8* %0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
%13 = zext i1 %12 to i32
br label %14
14: ; preds = %8, %2
%15 = phi i32 [ 0, %2 ], [ %13, %8 ]
ret i32 %15
}
void _Z11trie_lookupPtt(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z11trie_lookupPtt() {
ret void
}
/* Variables and functions */
char const *bprintf(char *, int);
int pscanf(char *, char *, int *);
const char *cpu_freq(void) {
  int freq;
  return (pscanf("/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq", "%i",
                 &freq) == 1)
             ? bprintf("%d", (freq + 500) / 1000)
             : NULL;
}


x86 assembly (clang, -O0):
<cpu_freq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rdi
lea    0xf00(%rip),%rsi
lea    -0x4(%rbp),%rdx
call   1040 <pscanf@plt>
cmp    $0x1,%eax
jne    116f <cpu_freq+0x4f>
mov    -0x4(%rbp),%eax
add    $0x1f4,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %eax,%esi
lea    0xed8(%rip),%rdi
call   1030 <bprintf@plt>
mov    %rax,-0x10(%rbp)
jmp    117a <cpu_freq+0x5a>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    117a <cpu_freq+0x5a>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cpu_freq>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xf07(%rip),%rsi
lea    0x4(%rsp),%rdx
call   1040 <pscanf@plt>
cmp    $0x1,%eax
jne    116b <cpu_freq+0x4b>
mov    $0x1f4,%eax
add    0x4(%rsp),%eax
cltq
imul   $0x10624dd3,%rax,%rsi
mov    %rsi,%rax
shr    $0x3f,%rax
sar    $0x26,%rsi
add    %eax,%esi
lea    0xed5(%rip),%rdi
call   1030 <bprintf@plt>
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [3 x i8] c"%d\00"
define i8* @cpu_freq() {
%1 = alloca i32
%2 = call i32 @pscanf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%3 = icmp eq i32 %2, 1
br i1 %3, label %4, label %9
4: ; preds = %0
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 500
%7 = sdiv i32 %6, 1000
%8 = call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %7)
br label %10
9: ; preds = %0
br label %10
10: ; preds = %9, %4
%11 = phi i8* [ %8, %4 ], [ null, %9 ]
ret i8* %11
}

LLVM IR (-O2):
@.str = [54 x i8] c"/sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq\00"
@.str.1 = [3 x i8] c"%i\00"
@.str.2 = [3 x i8] c"%d\00"
define i8* @cpu_freq() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @pscanf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %10
5: ; preds = %0
%6 = load i32, i32* %1
%7 = add nsw i32 %6, 500
%8 = sdiv i32 %7, 1000
%9 = call i8* @bprintf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %0, %5
%11 = phi i8* [ %9, %5 ], [ null, %0 ]
ret i8* %11
}
/* Variables and functions */
int /*<<< orphan*/ TimerLoadSet(int, int, unsigned long);
void wave_cap32_load(unsigned long value) {
  TimerLoadSet(0x40030000, 0x000000ff, value);
}


x86 assembly (clang, -O0):
<wave_cap32_load>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
mov    $0x40030000,%edi
mov    $0xff,%esi
call   1030 <TimerLoadSet@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wave_cap32_load>:
mov    %rdi,%rdx
mov    $0x40030000,%edi
mov    $0xff,%esi
jmp    1030 <TimerLoadSet@plt>

LLVM IR (-O0):
define void @wave_cap32_load(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = call i32 @TimerLoadSet(i32 1073938432, i32 255, i64 %3)
ret void
}

LLVM IR (-O2):
define void @wave_cap32_load(i64 %0) {
%2 = tail call i32 @TimerLoadSet(i32 1073938432, i32 255, i64 %0)
ret void
}
/* Variables and functions */
float fabsf_c(float);
float fabsf_neon_sfp(float x) { return fabsf_c(x); }


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

x86 assembly (clang, -O2):
<fabsf_neon_sfp>:
jmp    1030 <fabsf_c@plt>

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

LLVM IR (-O2):
define float @fabsf_neon_sfp(float %0) {
%2 = tail call float @fabsf_c(float %0)
ret float %2
}