xunge/DecIR huggingface dataset:
/* Variables and functions */
void free(void *);
void mm_free(void *p) { return free(p); }


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

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

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

LLVM IR (-O2):
define void @mm_free(i8* nocapture %0) {
tail call void @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ foobar(int, int, int);
main() { foobar(1, 2, 3); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
call   1030 <foobar@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @foobar(i32 1, i32 2, i32 3)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foobar(i32 1, i32 2, i32 3)
ret i32 0
}
void _exit(int status) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<_exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <_exit+0x7>

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

LLVM IR (-O0):
define void @_exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @_exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
int do_997() { return 997; }


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

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

LLVM IR (-O0):
define i32 @do_997() {
ret i32 997
}

LLVM IR (-O2):
define i32 @do_997() {
ret i32 997
}
/* Variables and functions */
int abs(unsigned int);
unsigned hash_sym(char *s, int arity) {
  unsigned x = arity;
  while (*s != '\0') {
    unsigned c = *s;
    x = (x << 4) | c;
    s++;
  }
  return abs(x) % 50000;
}


x86 assembly (clang, -O0):
<hash_sym>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     115c <hash_sym+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x4,%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1125 <hash_sym+0x15>
mov    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    $0xc350,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_sym>:
mov    (%rdi),%al
test   %al,%al
je     1123 <hash_sym+0x23>
add    $0x1,%rdi
nopw   0x0(%rax,%rax,1)
movsbl %al,%eax
shl    $0x4,%esi
or     %eax,%esi
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
jne    1110 <hash_sym+0x10>
mov    %esi,%eax
neg    %eax
cmovs  %esi,%eax
mov    %eax,%ecx
shr    $0x4,%ecx
imul   $0xa7c5ac5,%rcx,%rcx
shr    $0x27,%rcx
imul   $0xc350,%ecx,%ecx
sub    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_sym(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ %0, %2 ]
%8 = phi i32 [ %11, %5 ], [ %1, %2 ]
%9 = sext i8 %6 to i32
%10 = shl i32 %8, 4
%11 = or i32 %10, %9
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ %1, %2 ], [ %11, %5 ]
%17 = tail call i32 @llvm.abs.i32(i32 %16, i1 true)
%18 = urem i32 %17, 50000
ret i32 %18
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int32_t direct_compare(const void *a, const void *b) {
  assert(a != NULL);
  assert(b != NULL);
  return (a > b) - (a < b);
}


x86 assembly (clang, -O0):
<direct_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
seta   %al
and    $0x1,%al
movzbl %al,%eax
mov    -0x8(%rbp),%rcx
cmp    -0x10(%rbp),%rcx
setb   %cl
and    $0x1,%cl
movzbl %cl,%ecx
sub    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<direct_compare>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
xor    %edi,%edi
test   %r14,%r14
setne  %dil
call   1030 <assert@plt>
xor    %eax,%eax
cmp    %r14,%rbx
seta   %al
sbb    $0x0,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @direct_compare(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 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %4
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %3
%14 = load i8*, i8** %4
%15 = icmp ugt i8* %13, %14
%16 = zext i1 %15 to i32
%17 = load i8*, i8** %3
%18 = load i8*, i8** %4
%19 = icmp ult i8* %17, %18
%20 = zext i1 %19 to i32
%21 = sub nsw i32 %16, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @direct_compare(i8* readnone %0, i8* readnone %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = icmp ne i8* %1, null
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = icmp ugt i8* %0, %1
%10 = zext i1 %9 to i32
%11 = icmp ult i8* %0, %1
%12 = sext i1 %11 to i32
%13 = add nsw i32 %12, %10
ret i32 %13
}
int gen_module_release(struct inode *inode, struct file *file) {}


x86 assembly (clang, -O0):
<gen_module_release>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @gen_module_release(%struct.inode* %0, %struct.file* %1) {
%3 = alloca i32
%4 = alloca %struct.inode*
%5 = alloca %struct.file*
store %struct.inode* %0, %struct.inode** %4
store %struct.file* %1, %struct.file** %5
%6 = load i32, i32* %3
ret i32 %6
}

LLVM IR (-O2):
%struct.inode = type opaque
%struct.file = type opaque
define i32 @gen_module_release(%struct.inode* nocapture readnone %0, %struct.file* nocapture readnone %1) {
ret i32 undef
}
void parse_any(void *arg, struct Source *src, struct Result *res) {}


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

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

LLVM IR (-O0):
%struct.Source = type opaque
%struct.Result = type opaque
define void @parse_any(i8* %0, %struct.Source* %1, %struct.Result* %2) {
%4 = alloca i8*
%5 = alloca %struct.Source*
%6 = alloca %struct.Result*
store i8* %0, i8** %4
store %struct.Source* %1, %struct.Source** %5
store %struct.Result* %2, %struct.Result** %6
ret void
}

LLVM IR (-O2):
%struct.Source = type opaque
%struct.Result = type opaque
define void @parse_any(i8* nocapture %0, %struct.Source* nocapture %1, %struct.Result* nocapture %2) {
ret void
}
void CFGMR3GetRoot(void) {}


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

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

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

LLVM IR (-O2):
define void @CFGMR3GetRoot() {
ret void
}
/* Variables and functions */
unsigned long BIT_MASK(int);
int BIT_WORD(int);
void __set_bit(int nr, volatile unsigned long *addr) {
  unsigned long mask = BIT_MASK(nr);
  unsigned long *p = ((unsigned long *)addr) + BIT_WORD(nr);
  *p |= mask;
}


x86 assembly (clang, -O0):
<__set_bit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <BIT_MASK@plt>
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <BIT_WORD@plt>
mov    %eax,%ecx
mov    -0x28(%rbp),%rax
movslq %ecx,%rcx
shl    $0x3,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rcx
mov    -0x20(%rbp),%rax
or     (%rax),%rcx
mov    %rcx,(%rax)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__set_bit>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%r14
mov    %edi,%ebp
call   1030 <BIT_MASK@plt>
mov    %rax,%rbx
mov    %ebp,%edi
call   1040 <BIT_WORD@plt>
cltq
or     %rbx,(%r14,%rax,8)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @__set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i64
%6 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%7 = load i32, i32* %3
%8 = call i64 @BIT_MASK(i32 %7)
store i64 %8, i64* %5
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = call i32 @BIT_WORD(i32 %10)
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
store i64* %13, i64** %6
%14 = load i64, i64* %5
%15 = load i64*, i64** %6
%16 = load i64, i64* %15
%17 = or i64 %16, %14
store i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
define void @__set_bit(i32 %0, i64* nocapture %1) {
%3 = tail call i64 @BIT_MASK(i32 %0)
%4 = tail call i32 @BIT_WORD(i32 %0)
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i64, i64* %1, i64 %5
%7 = load i64, i64* %6
%8 = or i64 %7, %3
store i64 %8, i64* %6
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ usage;
struct rusage {
  int ru_minflt;
};

/* Variables and functions */
int /*<<< orphan*/ memset(struct rusage *, int /*<<< orphan*/, int);
int main(void) {
  struct rusage usage;
  (void)memset(&usage, 0, sizeof(usage));
  return usage.ru_minflt;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
mov    $0x4,%edx
call   1030 <memset@plt>
mov    (%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.rusage = type { i32 }
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.rusage
store i32 0, i32* %1
%3 = call i32 @memset(%struct.rusage* %2, i32 0, i32 4)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %2, i32 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}

LLVM IR (-O2):
%struct.rusage = type { i32 }
define i32 @main() {
%1 = alloca %struct.rusage
%2 = bitcast %struct.rusage* %1 to i8*
%3 = call i32 @memset(%struct.rusage* %1, i32 0, i32 4)
%4 = getelementptr inbounds %struct.rusage, %struct.rusage* %1, i64 0, i32 0
%5 = load i32, i32* %4
ret i32 %5
}
int test_imm_1Buint16_mem(unsigned short *val) {
  return ((*val) & (0x1B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_1Buint16_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzwl (%rax),%edx
and    $0x1b,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_1Buint16_mem>:
testb  $0x1b,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_1Buint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 27
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
bool nrf52_errata_250(void) { return false; }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ fputc(int /*<<< orphan*/, int /*<<< orphan*/ *);
int fputs(const char *s, FILE *stream) {
  while (*s) {
    fputc(*s++, stream);
  }
  fflush(stream);
  return 0;
}


x86 assembly (clang, -O0):
<fputs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <fputs+0x3d>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
mov    -0x10(%rbp),%rsi
call   1030 <fputc@plt>
jmp    1130 <fputs+0x10>
mov    -0x10(%rbp),%rdi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fputs>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    (%rdi),%al
test   %al,%al
je     1156 <fputs+0x36>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %r14,%rsi
call   1030 <fputc@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1140 <fputs+0x20>
mov    %r14,%rdi
call   1040 <fflush@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @fputs(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
store i8* %0, i8** %3
store i32* %1, i32** %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = sext i8 %12 to i32
%14 = load i32*, i32** %4
%15 = call i32 @fputc(i32 %13, i32* %14)
br label %5
16: ; preds = %5
%17 = load i32*, i32** %4
%18 = call i32 @fflush(i32* %17)
ret i32 0
}

LLVM IR (-O2):
define i32 @fputs(i8* nocapture %0, i32* nocapture %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = sext i8 %6 to i32
%10 = tail call i32 @fputc(i32 %9, i32* %1)
%11 = load i8, i8* %8
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = tail call i32 @fflush(i32* %1)
ret i32 0
}
void RTSha512Update(void) {}


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

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

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

LLVM IR (-O2):
define void @RTSha512Update() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ IPC_RMID;
int /*<<< orphan*/ shmctl(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ shmdt(int);
void ShbIpcReleasePrivateMem(int iBufferId) {
  shmdt(iBufferId);
  shmctl(iBufferId, IPC_RMID, 0);
  return;
}


x86 assembly (clang, -O0):
<ShbIpcReleasePrivateMem>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <shmdt@plt>
mov    -0x4(%rbp),%edi
mov    0x2ea3(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1040 <shmctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ShbIpcReleasePrivateMem>:
push   %rbx
mov    %edi,%ebx
call   1030 <shmdt@plt>
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
xor    %edx,%edx
pop    %rbx
jmp    1040 <shmctl@plt>

LLVM IR (-O0):
@IPC_RMID = global i32 0
define void @ShbIpcReleasePrivateMem(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @shmdt(i32 %3)
%5 = load i32, i32* %2
%6 = load i32, i32* @IPC_RMID
%7 = call i32 @shmctl(i32 %5, i32 %6, i32 0)
ret void
}

LLVM IR (-O2):
@IPC_RMID = global i32 0
define void @ShbIpcReleasePrivateMem(i32 %0) {
%2 = tail call i32 @shmdt(i32 %0)
%3 = load i32, i32* @IPC_RMID
%4 = tail call i32 @shmctl(i32 %0, i32 %3, i32 0)
ret void
}
void XtDisownSelection() {}


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

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

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

LLVM IR (-O2):
define void @XtDisownSelection() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ write(int, char *, int);
void usage(void) {
  write(2, "Usage: chmod [-R] mode file...\n", 31);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
lea    0xed0(%rip),%rsi
mov    $0x1f,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rsi
mov    $0x2,%edi
mov    $0x1f,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"Usage: chmod [-R] mode file...\0A\00"
define void @usage() {
%1 = call i32 @write(i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 31)
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [32 x i8] c"Usage: chmod [-R] mode file...\0A\00"
define void @usage() {
%1 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 31)
%2 = tail call i32 @exit(i32 1)
unreachable
}
void pmvs_(x, y, z) short *x, *y, *z;
{ pmv((float)*x, (float)*y, (float)*z); }


x86 assembly (clang, -O0):
<pmvs_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x18(%rbp),%rax
movswl (%rax),%eax
cvtsi2ss %eax,%xmm2
cvtss2sd %xmm2,%xmm2
mov    $0x3,%al
call   1030 <pmv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmvs_>:
movswl (%rdi),%eax
cvtsi2sd %eax,%xmm0
movswl (%rsi),%eax
cvtsi2sd %eax,%xmm1
movswl (%rdx),%eax
cvtsi2sd %eax,%xmm2
mov    $0x3,%al
jmp    1030 <pmv@plt>

LLVM IR (-O0):
define void @pmvs_(i16* %0, i16* %1, i16* %2) {
%4 = alloca i16*
%5 = alloca i16*
%6 = alloca i16*
store i16* %0, i16** %4
store i16* %1, i16** %5
store i16* %2, i16** %6
%7 = load i16*, i16** %4
%8 = load i16, i16* %7
%9 = sitofp i16 %8 to float
%10 = fpext float %9 to double
%11 = load i16*, i16** %5
%12 = load i16, i16* %11
%13 = sitofp i16 %12 to float
%14 = fpext float %13 to double
%15 = load i16*, i16** %6
%16 = load i16, i16* %15
%17 = sitofp i16 %16 to float
%18 = fpext float %17 to double
%19 = call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %10, double %14, double %18)
ret void
}

LLVM IR (-O2):
define void @pmvs_(i16* nocapture %0, i16* nocapture %1, i16* nocapture %2) {
%4 = load i16, i16* %0
%5 = sitofp i16 %4 to double
%6 = load i16, i16* %1
%7 = sitofp i16 %6 to double
%8 = load i16, i16* %2
%9 = sitofp i16 %8 to double
%10 = tail call i32 (double, double, double, ...) bitcast (i32 (...)* @pmv to i32 (double, double, double, ...)*)(double %5, double %7, double %9)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ strcasecmp(char *, char *);
int isSupported(char *type) {
  if (!strcasecmp(type, "TFM"))
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<isSupported>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xed9(%rip),%rsi
call   1030 <strcasecmp@plt>
cmp    $0x0,%eax
jne    1141 <isSupported+0x31>
movl   $0x1,-0x4(%rbp)
jmp    1148 <isSupported+0x38>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isSupported>:
push   %rax
lea    0xee8(%rip),%rsi
call   1030 <strcasecmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"TFM\00"
define i32 @isSupported(i8* nocapture %0) {
%2 = tail call i32 @strcasecmp(i8* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
%4 = zext i1 %3 to i32
ret i32 %4
}
void put_pmem_file(struct file *file) { return; }


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

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

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

LLVM IR (-O2):
%struct.file = type opaque
define void @put_pmem_file(%struct.file* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ F_OK;
scalar_t__ access(char *, int /*<<< orphan*/);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, char const *);
int is_loopback_device(const char *path, const char *node) {
  char file[0x200];
  snprintf(file, 0x200, "%s%s/iteration_count", path, node);
  if (access(file, F_OK) == 0)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<is_loopback_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x220,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
lea    -0x220(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%r8
mov    $0x200,%esi
lea    0xeb2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x220(%rbp),%rdi
mov    0x2e77(%rip),%rax
mov    (%rax),%esi
call   1040 <access@plt>
cmp    $0x0,%rax
jne    117e <is_loopback_device+0x5e>
movl   $0x1,-0x4(%rbp)
jmp    1185 <is_loopback_device+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x220,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_loopback_device>:
push   %rbx
sub    $0x200,%rsp
mov    %rsi,%r8
mov    %rdi,%rcx
lea    0xecb(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x200,%esi
call   1030 <snprintf@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%esi
mov    %rbx,%rdi
call   1040 <access@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
add    $0x200,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [21 x i8] c"%s%s/iteration_count\00"
@F_OK = global i32 0
define i32 @is_loopback_device(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca [512 x i8]
store i8* %0, i8** %4
store i8* %1, i8** %5
%7 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = call i32 @snprintf(i8* %7, i32 512, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %8, i8* %9)
%11 = getelementptr inbounds [512 x i8], [512 x i8]* %6, i64 0, i64 0
%12 = load i32, i32* @F_OK
%13 = call i64 @access(i8* %11, i32 %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %16
15: ; preds = %2
store i32 1, i32* %3
br label %17
16: ; preds = %2
store i32 0, i32* %3
br label %17
17: ; preds = %16, %15
%18 = load i32, i32* %3
ret i32 %18
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s%s/iteration_count\00"
@F_OK = global i32 0
define i32 @is_loopback_device(i8* %0, i8* %1) {
%3 = alloca [512 x i8]
%4 = getelementptr inbounds [512 x i8], [512 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 512, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%6 = load i32, i32* @F_OK
%7 = call i64 @access(i8* %4, i32 %6)
%8 = icmp eq i64 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}
int perfctr_cstatus_has_tsc(unsigned int cstatus) { return ((int)cstatus < 0); }


x86 assembly (clang, -O0):
<perfctr_cstatus_has_tsc>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @perfctr_cstatus_has_tsc(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @perfctr_cstatus_has_tsc(i32 %0) {
%2 = lshr i32 %0, 31
ret i32 %2
}
/* Variables and functions */
int RSA2048_execute(int, char *);
int /*<<< orphan*/ printf(char *);
int RSA2048_generate_key_CRT(int fd) {
  int ret;
  ret = RSA2048_execute(fd, "BF10C08000");
  if (ret != 0) {
    printf("ERR:RSA2048_generate_key_CRT failed!\n");
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<RSA2048_generate_key_CRT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    0xecb(%rip),%rsi
call   1040 <RSA2048_execute@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     115f <RSA2048_generate_key_CRT+0x3f>
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1166 <RSA2048_generate_key_CRT+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<RSA2048_generate_key_CRT>:
push   %rax
lea    0xed8(%rip),%rsi
call   1040 <RSA2048_execute@plt>
test   %eax,%eax
je     1144 <RSA2048_generate_key_CRT+0x24>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"BF10C08000\00"
@.str.1 = [38 x i8] c"ERR:RSA2048_generate_key_CRT failed!\0A\00"
define i32 @RSA2048_generate_key_CRT(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
%6 = call i32 @RSA2048_execute(i32 %5, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
store i32 %6, i32* %4
%7 = load i32, i32* %4
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.1, i64 0, i64 0))
store i32 1, i32* %2
br label %12
11: ; preds = %1
store i32 0, i32* %2
br label %12
12: ; preds = %11, %9
%13 = load i32, i32* %2
ret i32 %13
}

LLVM IR (-O2):
@.str = [11 x i8] c"BF10C08000\00"
@str = [37 x i8] c"ERR:RSA2048_generate_key_CRT failed!\00"
define i32 @RSA2048_generate_key_CRT(i32 %0) {
%2 = tail call i32 @RSA2048_execute(i32 %0, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32 %2, 0
br i1 %3, label %6, label %4
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @str, i64 0, i64 0))
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fdprintf(int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
int /*<<< orphan*/ vfdprintf(int, char const *, int /*<<< orphan*/);
void vwarn(const char *f, va_list a) {
  vfdprintf(2, f, a);
  fdprintf(2, ": %s\n", strerror(errno));
}


x86 assembly (clang, -O0):
<vwarn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
mov    $0x2,%edi
call   1040 <vfdprintf@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xe94(%rip),%rsi
call   1030 <fdprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vwarn>:
push   %rax
mov    %esi,%edx
mov    %rdi,%rsi
mov    $0x2,%edi
call   1040 <vfdprintf@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rsi
mov    $0x2,%edi
mov    %eax,%edx
pop    %rax
jmp    1030 <fdprintf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c": %s\0A\00"
@errno = global i32 0
define void @vwarn(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = load i32, i32* %4
%7 = call i32 @vfdprintf(i32 2, i8* %5, i32 %6)
%8 = load i32, i32* @errno
%9 = call i32 @strerror(i32 %8)
%10 = call i32 @fdprintf(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %9)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c": %s\0A\00"
@errno = global i32 0
define void @vwarn(i8* %0, i32 %1) {
%3 = tail call i32 @vfdprintf(i32 2, i8* %0, i32 %1)
%4 = load i32, i32* @errno
%5 = tail call i32 @strerror(i32 %4)
%6 = tail call i32 @fdprintf(i32 2, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
void gdk_device_get_history() {}


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

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

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

LLVM IR (-O2):
define void @gdk_device_get_history() {
ret void
}
/* Variables and functions */
void *s_realloc(void *, size_t);
void *sds_realloc(void *ptr, size_t size) { return s_realloc(ptr, size); }


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

x86 assembly (clang, -O2):
<sds_realloc>:
jmp    1030 <s_realloc@plt>

LLVM IR (-O0):
define i8* @sds_realloc(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 i64, i64* %4
%7 = call i8* @s_realloc(i8* %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define i8* @sds_realloc(i8* %0, i64 %1) {
%3 = tail call i8* @s_realloc(i8* %0, i64 %1)
ret i8* %3
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_shuffle_pi16(int /*<<< orphan*/, int);
__m64 __mm_shuffle_pi16(__m64 A, int const I) { return _mm_shuffle_pi16(A, 1); }


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

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

LLVM IR (-O0):
define i32 @__mm_shuffle_pi16(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 = call i32 @_mm_shuffle_pi16(i32 %5, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @__mm_shuffle_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_shuffle_pi16(i32 %0, i32 1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int c_read_int() {
  int n;
  scanf("%d", &n);
  return n;
}


x86 assembly (clang, -O0):
<c_read_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
lea    -0x4(%rbp),%rsi
call   1030 <scanf@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_read_int>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @c_read_int() {
%1 = alloca i32
%2 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @c_read_int() {
%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
ret i32 %4
}
/* Type definitions */
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/);
unsigned getusec() {
  struct timeval tv;
  gettimeofday(&tv, 0);
  return tv.tv_sec * 1000000 + tv.tv_usec;
}


x86 assembly (clang, -O0):
<getusec>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getusec>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define i32 @getusec() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 %4, 1000000
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%7 = load i32, i32* %6
%8 = add nsw i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @getusec() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32 0)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
void caller_2_1_2_2_2_1_2() {}


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

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

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

LLVM IR (-O2):
define void @caller_2_1_2_2_2_1_2() {
ret void
}
int isUDP(unsigned char b) {
  if (b == 0x11) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isUDP>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
cmp    $0x11,%eax
jne    1123 <isUDP+0x23>
movl   $0x1,-0x4(%rbp)
jmp    112a <isUDP+0x2a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isUDP>:
xor    %eax,%eax
cmp    $0x11,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @isUDP(i8 zeroext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = icmp eq i32 %5, 17
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @isUDP(i8 zeroext %0) {
%2 = icmp eq i8 %0, 17
%3 = zext i1 %2 to i32
ret i32 %3
}
unsigned long int wcstombs(char *restrict __dst,
                           const signed int *restrict __src,
                           unsigned long int __len) {
  unsigned long int return_value___wcstombs_chk$1;
  unsigned long int return_value___wcstombs_chk_warn$2;
  unsigned long int return_value___wcstombs_alias$3;
  return_value___wcstombs_alias$3 = __wcstombs_alias(__dst, __src, __len);
  return return_value___wcstombs_alias$3;
}


x86 assembly (clang, -O0):
<wcstombs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    $0x0,%al
call   1030 <__wcstombs_alias@plt>
cltq
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @wcstombs(i8* noalias %0, i32* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
store i8* %0, i8** %4
store i32* %1, i32** %5
store i64 %2, i64* %6
%10 = load i8*, i8** %4
%11 = load i32*, i32** %5
%12 = load i64, i64* %6
%13 = call i32 (i8*, i32*, i64, ...) bitcast (i32 (...)* @__wcstombs_alias to i32 (i8*, i32*, i64, ...)*)(i8* %10, i32* %11, i64 %12)
%14 = sext i32 %13 to i64
store i64 %14, i64* %9
%15 = load i64, i64* %9
ret i64 %15
}

LLVM IR (-O2):
define i64 @wcstombs(i8* noalias %0, i32* noalias %1, i64 %2) {
%4 = tail call i32 (i8*, i32*, i64, ...) bitcast (i32 (...)* @__wcstombs_alias to i32 (i8*, i32*, i64, ...)*)(i8* %0, i32* %1, i64 %2)
%5 = sext i32 %4 to i64
ret i64 %5
}
int ft_islower(int c) { return ((c >= 'a') && (c <= 'z')); }


x86 assembly (clang, -O0):
<ft_islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <ft_islower+0x20>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @ft_islower(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 97
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 122
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @ft_islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void __attribute__((no)) ottawa(void) {
  printf("no arg\n");
  return;
}


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

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

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

LLVM IR (-O2):
@str = [7 x i8] c"no arg\00"
define void @ottawa() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int *twoSum(int *, int, int);
int main() {
  int a[] = {3, 2, 4};
  int *b = twoSum(a, 3, 6);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <twoSum@plt>
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xeee(%rip),%eax
mov    %eax,0x10(%rsp)
mov    0xedb(%rip),%rax
mov    %rax,0x8(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x3,%esi
mov    $0x6,%edx
call   1030 <twoSum@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.a = [3 x i32] [i32 3, i32 2, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [3 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [3 x i32]* %2 to i8*
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %2, i64 0, i64 0
%6 = call i32* @twoSum(i32* %5, i32 3, i32 6)
store i32* %6, i32** %3
ret i32 0
}

LLVM IR (-O2):
@__const.main.a = [3 x i32] [i32 3, i32 2, i32 4]
define i32 @main() {
%1 = alloca [3 x i32]
%2 = bitcast [3 x i32]* %1 to i8*
%3 = getelementptr inbounds [3 x i32], [3 x i32]* %1, i64 0, i64 0
%4 = call i32* @twoSum(i32* %3, i32 3, i32 6)
ret i32 0
}
int pnfs_fh_is_ds(struct knfsd_fh *fh) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.knfsd_fh = type opaque
define i32 @pnfs_fh_is_ds(%struct.knfsd_fh* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ ChebKernel_M2M(int, void *, int, void *, void *);
void cheb_m2m(int level, void *parentCell, int childPosition, void *childCell,
              void *userData) {
  ChebKernel_M2M(level, parentCell, childPosition, childCell, userData);
}


x86 assembly (clang, -O0):
<cheb_m2m>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <ChebKernel_M2M@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cheb_m2m>:
jmp    1030 <ChebKernel_M2M@plt>

LLVM IR (-O0):
define void @cheb_m2m(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
store i32 %0, i32* %6
store i8* %1, i8** %7
store i32 %2, i32* %8
store i8* %3, i8** %9
store i8* %4, i8** %10
%11 = load i32, i32* %6
%12 = load i8*, i8** %7
%13 = load i32, i32* %8
%14 = load i8*, i8** %9
%15 = load i8*, i8** %10
%16 = call i32 @ChebKernel_M2M(i32 %11, i8* %12, i32 %13, i8* %14, i8* %15)
ret void
}

LLVM IR (-O2):
define void @cheb_m2m(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4) {
%6 = tail call i32 @ChebKernel_M2M(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4)
ret void
}
/* Variables and functions */
int drand48();
void get_bin_randoms(int *numbers2, int upper) {
  int i, where;
  for (i = 0; i < upper; i++) {
    where = drand48() * 100;
    ;
    numbers2[i] = where % 2;
  }
}


x86 assembly (clang, -O0):
<get_bin_randoms>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1163 <get_bin_randoms+0x53>
mov    $0x0,%al
call   1030 <drand48@plt>
imul   $0x64,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <get_bin_randoms+0x16>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bin_randoms>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1148 <get_bin_randoms+0x38>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <drand48@plt>
movl   $0x0,(%r14,%rbx,4)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <get_bin_randoms+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @get_bin_randoms(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %7
7: ; preds = %20, %2
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %8, %9
br i1 %10, label %11, label %23
11: ; preds = %7
%12 = call i32 (...) @drand48()
%13 = mul nsw i32 %12, 100
store i32 %13, i32* %6
%14 = load i32, i32* %6
%15 = srem i32 %14, 2
%16 = load i32*, i32** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i32, i32* %16, i64 %18
store i32 %15, i32* %19
br label %20
20: ; preds = %11
%21 = load i32, i32* %5
%22 = add nsw i32 %21, 1
store i32 %22, i32* %5
br label %7
23: ; preds = %7
ret void
}

LLVM IR (-O2):
define void @get_bin_randoms(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %10, %6 ]
%8 = tail call i32 (...) @drand48()
%9 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 0, i32* %9
%10 = add nuw nsw i64 %7, 1
%11 = icmp eq i64 %10, %5
br i1 %11, label %12, label %6
12: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello world!\n");
  while (1)
    ;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
jmp    112b <main+0x1b>

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <main+0x10>

LLVM IR (-O0):
@.str = [14 x i8] c"Hello world!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
br label %3
3: ; preds = %0, %3
br label %3
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello world!\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
/* Variables and functions */
int /*<<< orphan*/ write_break();
int /*<<< orphan*/ write_line(char *);
void latex_indent(void) {
  write_break();
  write_line("\\begin{quote}");
}


x86 assembly (clang, -O0):
<latex_indent>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <write_break@plt>
lea    0xece(%rip),%rdi
call   1040 <write_line@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<latex_indent>:
push   %rax
xor    %eax,%eax
call   1030 <write_break@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <write_line@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"\\begin{quote}\00"
define void @latex_indent() {
%1 = call i32 (...) @write_break()
%2 = call i32 @write_line(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"\\begin{quote}\00"
define void @latex_indent() {
%1 = tail call i32 (...) @write_break()
%2 = tail call i32 @write_line(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
void x() {
  int y = 10;
  int k = 5;
  k++;
}


x86 assembly (clang, -O0):
<x>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @x() {
%1 = alloca i32
%2 = alloca i32
store i32 10, i32* %1
store i32 5, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret void
}

LLVM IR (-O2):
define void @x() {
ret void
}
int test_imm_E4int64_midword_reg(long long val) {
  return ((val >> 16) & (0xE4 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_E4int64_midword_reg(i64 %0) {
%2 = and i64 %0, 14942208
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}