xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ assert(char const *);
scalar_t__ strcmp(char const *, char const *);
int trio_equal_case(const char *first, const char *second) {
  assert(first);
  assert(second);
  if ((first != 0) && (second != 0)) {
    return (0 == strcmp(first, second));
  }
  return (1 == 0);
}


x86 assembly (clang, -O0):
<trio_equal_case>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x18(%rbp),%rdi
call   1040 <assert@plt>
cmpq   $0x0,-0x10(%rbp)
je     117d <trio_equal_case+0x5d>
cmpq   $0x0,-0x18(%rbp)
je     117d <trio_equal_case+0x5d>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1184 <trio_equal_case+0x64>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<trio_equal_case>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %r14,%rdi
call   1040 <assert@plt>
xor    %eax,%eax
test   %rbx,%rbx
je     1159 <trio_equal_case+0x39>
test   %r14,%r14
je     1159 <trio_equal_case+0x39>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <strcmp@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
sete   %al
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @trio_equal_case(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = icmp ne i8* %0, null
%6 = icmp ne i8* %1, null
%7 = and i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %2
%9 = tail call i64 @strcmp(i8* %0, i8* %1)
%10 = icmp eq i64 %9, 0
%11 = zext i1 %10 to i32
br label %12
12: ; preds = %2, %8
%13 = phi i32 [ %11, %8 ], [ 0, %2 ]
ret i32 %13
}
/* Variables and functions */
int sscanf(char *, char *, int *);
int parse_int_option(char *o, int *i) {
  int rc;
  rc = sscanf(o, "%d", i);
  if (rc != 1)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<parse_int_option>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rdx
lea    0xed1(%rip),%rsi
call   1030 <sscanf@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x1,-0x1c(%rbp)
je     114d <parse_int_option+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1154 <parse_int_option+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_int_option>:
push   %rax
mov    %rsi,%rdx
lea    0xee5(%rip),%rsi
call   1030 <sscanf@plt>
xor    %ecx,%ecx
cmp    $0x1,%eax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @parse_int_option(i8* nocapture %0, i32* %1) {
%3 = tail call i32 @sscanf(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = icmp ne i32 %3, 1
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
uint8_t make_color(uint8_t fg, uint8_t bg) { return fg | bg << 4; }


x86 assembly (clang, -O0):
<make_color>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x4,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<make_color>:
mov    %esi,%eax
shl    $0x4,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @make_color(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 = shl i32 %6, 4
%8 = or i32 %5, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @make_color(i32 %0, i32 %1) {
%3 = shl i32 %1, 4
%4 = or i32 %3, %0
ret i32 %4
}
/* Variables and functions */
unsigned long long _blsr_u64(unsigned long long);
unsigned long long test_blsr_u64(unsigned long long __X) {
  return _blsr_u64(__X);
}


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

x86 assembly (clang, -O2):
<test_blsr_u64>:
jmp    1030 <_blsr_u64@plt>

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

LLVM IR (-O2):
define i64 @test_blsr_u64(i64 %0) {
%2 = tail call i64 @_blsr_u64(i64 %0)
ret i64 %2
}
/* Variables and functions */
int _strToUtf8(char *, char const *, int, int, int *, int /*<<< orphan*/);
int strToUtf8(char *dest, const char *src, int destSize, int isWide,
              int *charactersConverted) {
  return _strToUtf8(dest, src, destSize, isWide, charactersConverted, 0);
}


x86 assembly (clang, -O0):
<strToUtf8>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x20(%rbp),%r8
xor    %r9d,%r9d
call   1030 <_strToUtf8@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strToUtf8>:
xor    %r9d,%r9d
jmp    1030 <_strToUtf8@plt>

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

LLVM IR (-O2):
define i32 @strToUtf8(i8* %0, i8* %1, i32 %2, i32 %3, i32* %4) {
%6 = tail call i32 @_strToUtf8(i8* %0, i8* %1, i32 %2, i32 %3, i32* %4, i32 0)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_timeval_store() {
  printf("NOT IMPLEMENTED:"
         "pa_timeval_store"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [33 x i8] c"NOT IMPLEMENTED:pa_timeval_store\00"
define i32 @pa_timeval_store() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
int alu_tlt(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ op_pop();
int op_tlt() { return alu_tlt(op_pop(), op_pop()); }


x86 assembly (clang, -O0):
<op_tlt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <op_pop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <op_pop@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1030 <alu_tlt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<op_tlt>:
push   %rbx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <op_pop@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1030 <alu_tlt@plt>

LLVM IR (-O0):
define i32 @op_tlt() {
%1 = call i32 (...) @op_pop()
%2 = call i32 (...) @op_pop()
%3 = call i32 @alu_tlt(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @op_tlt() {
%1 = tail call i32 (...) @op_pop()
%2 = tail call i32 (...) @op_pop()
%3 = tail call i32 @alu_tlt(i32 %1, i32 %2)
ret i32 %3
}
int isPower2(int x) { return 2; }


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

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

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

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

/* Variables and functions */
scalar_t__ fgetc(int /*<<< orphan*/ *);
int get_2(int /*<<< orphan*/ *);
unsigned int get_3(FILE *fp) {
  unsigned int result;
  result = get_2(fp) << 8;
  result |= (unsigned char)fgetc(fp);
  return result;
}


x86 assembly (clang, -O0):
<get_3>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_2@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <fgetc@plt>
movzbl %al,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_3>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get_2@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
mov    %rbx,%rdi
call   1040 <fgetc@plt>
movzbl %al,%eax
or     %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_3(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @get_2(i32* %4)
%6 = shl i32 %5, 8
store i32 %6, i32* %3
%7 = load i32*, i32** %2
%8 = call i64 @fgetc(i32* %7)
%9 = trunc i64 %8 to i8
%10 = zext i8 %9 to i32
%11 = load i32, i32* %3
%12 = or i32 %11, %10
store i32 %12, i32* %3
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_3(i32* %0) {
%2 = tail call i32 @get_2(i32* %0)
%3 = shl i32 %2, 8
%4 = tail call i64 @fgetc(i32* %0)
%5 = trunc i64 %4 to i32
%6 = and i32 %5, 255
%7 = or i32 %6, %3
ret i32 %7
}
void Hal_hook_wr_sgnebase(void) {}


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

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

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

LLVM IR (-O2):
define void @Hal_hook_wr_sgnebase() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void print_usage_exit() {
  printf("Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<print_usage_exit>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<print_usage_exit>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [64 x i8] c"Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\0A\00"
define void @print_usage_exit() {
%1 = call i32 @printf(i8* getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [63 x i8] c"Usage: hackbench [-pipe] <num groups> [process|thread] [loops]\00"
define void @print_usage_exit() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([63 x i8], [63 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int __uid_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ __set_errno(int /*<<< orphan*/);
__uid_t __geteuid() {
  __set_errno(ENOSYS);
  return -1;
}


x86 assembly (clang, -O0):
<__geteuid>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__geteuid>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
call   1030 <__set_errno@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
define i32 @__geteuid() {
%1 = load i32, i32* @ENOSYS
%2 = call i32 @__set_errno(i32 %1)
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
define i32 @__geteuid() {
%1 = load i32, i32* @ENOSYS
%2 = tail call i32 @__set_errno(i32 %1)
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *proc) { printf("usage: %s [NUMBER]...\n", proc); }


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

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

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

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s [NUMBER]...\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void do_FREQUENCY() { printf("WARNING: Frequency set was ignored\n"); }


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

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

LLVM IR (-O0):
@.str = [36 x i8] c"WARNING: Frequency set was ignored\0A\00"
define void @do_FREQUENCY() {
%1 = call i32 @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [35 x i8] c"WARNING: Frequency set was ignored\00"
define void @do_FREQUENCY() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef void object;
struct cons {
  int dummy;
};
struct atom {
  int dummy;
};

/* Variables and functions */
struct cons *create_cons(void *, void *);
struct object *map_cons(struct atom *key, struct object *value,
                        struct object *map) {
  struct cons *entry = create_cons((void *)key, value);
  struct cons *cons = create_cons((void *)entry, map);
  return (void *)cons;
}


x86 assembly (clang, -O0):
<map_cons>:
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
call   1030 <create_cons@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <create_cons@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<map_cons>:
push   %rbx
mov    %rdx,%rbx
call   1030 <create_cons@plt>
mov    %rax,%rdi
mov    %rbx,%rsi
pop    %rbx
jmp    1030 <create_cons@plt>

LLVM IR (-O0):
%struct.atom = type { i32 }
%struct.object = type opaque
%struct.cons = type { i32 }
define %struct.object* @map_cons(%struct.atom* %0, %struct.object* %1, %struct.object* %2) {
%4 = alloca %struct.atom*
%5 = alloca %struct.object*
%6 = alloca %struct.object*
%7 = alloca %struct.cons*
%8 = alloca %struct.cons*
store %struct.atom* %0, %struct.atom** %4
store %struct.object* %1, %struct.object** %5
store %struct.object* %2, %struct.object** %6
%9 = load %struct.atom*, %struct.atom** %4
%10 = bitcast %struct.atom* %9 to i8*
%11 = load %struct.object*, %struct.object** %5
%12 = bitcast %struct.object* %11 to i8*
%13 = call %struct.cons* @create_cons(i8* %10, i8* %12)
store %struct.cons* %13, %struct.cons** %7
%14 = load %struct.cons*, %struct.cons** %7
%15 = bitcast %struct.cons* %14 to i8*
%16 = load %struct.object*, %struct.object** %6
%17 = bitcast %struct.object* %16 to i8*
%18 = call %struct.cons* @create_cons(i8* %15, i8* %17)
store %struct.cons* %18, %struct.cons** %8
%19 = load %struct.cons*, %struct.cons** %8
%20 = bitcast %struct.cons* %19 to i8*
%21 = bitcast i8* %20 to %struct.object*
ret %struct.object* %21
}

LLVM IR (-O2):
%struct.atom = type { i32 }
%struct.object = type opaque
%struct.cons = type { i32 }
define %struct.object* @map_cons(%struct.atom* %0, %struct.object* %1, %struct.object* %2) {
%4 = bitcast %struct.atom* %0 to i8*
%5 = bitcast %struct.object* %1 to i8*
%6 = tail call %struct.cons* @create_cons(i8* %4, i8* %5)
%7 = bitcast %struct.cons* %6 to i8*
%8 = bitcast %struct.object* %2 to i8*
%9 = tail call %struct.cons* @create_cons(i8* %7, i8* %8)
%10 = bitcast %struct.cons* %9 to %struct.object*
ret %struct.object* %10
}
/* Variables and functions */
int /*<<< orphan*/ STDERR_FILENO;
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ write(int /*<<< orphan*/, char const *, int /*<<< orphan*/);
void do_write(const char *msg) {
  return (void)write(STDERR_FILENO, msg, strlen(msg));
}


x86 assembly (clang, -O0):
<do_write>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x14(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
call   1030 <write@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_write>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
call   1040 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <write@plt>

LLVM IR (-O0):
@STDERR_FILENO = global i32 0
define void @do_write(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @STDERR_FILENO
%4 = load i8*, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = call i32 @write(i32 %3, i8* %4, i32 %6)
ret void
}

LLVM IR (-O2):
@STDERR_FILENO = global i32 0
define void @do_write(i8* %0) {
%2 = load i32, i32* @STDERR_FILENO
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @write(i32 %2, i8* %0, i32 %3)
ret void
}
int mdp4_overlay_writeback_off(struct platform_device *pdev) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.platform_device = type opaque
define i32 @mdp4_overlay_writeback_off(%struct.platform_device* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int wait(int /*<<< orphan*/ *);
extern void parent_code(void) {
  int wait_rv = wait(NULL);
  printf("parent: done waiting for %d\n", wait_rv);
}


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

x86 assembly (clang, -O2):
<parent_code>:
push   %rax
xor    %edi,%edi
call   1040 <wait@plt>
lea    0xed1(%rip),%rdi
mov    %eax,%esi
pop    %rax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"parent: done waiting for %d\0A\00"
define void @parent_code() {
%1 = alloca i32
%2 = call i32 @wait(i32* null)
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"parent: done waiting for %d\0A\00"
define void @parent_code() {
%1 = tail call i32 @wait(i32* null)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
/* Variables and functions */
char *strstr(char const *, char const *);
int strContains(const char *src, const char *substring) {
  char *needle = strstr(src, substring);
  if (needle != NULL) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<strContains>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1148 <strContains+0x38>
movl   $0x1,-0x4(%rbp)
jmp    114f <strContains+0x3f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strContains>:
push   %rax
call   1030 <strstr@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @strContains(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
int test_imm_DCint16_mem(short *val) {
  return ((*val) & (-0xDC << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_DCint16_mem>:
movzwl (%rdi),%eax
test   $0xff24,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_DCint16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -220
%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_DCint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -220
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
adrx0imm1_set(r0, r1, x0, x1, p0, p1) float r0, r1;
float *p0, *p1;
{ (((float *)10000000)[x0]) = 33; }


x86 assembly (clang, -O0):
<adrx0imm1_set>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm1,-0x30(%rbp)
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
cvtsd2ss %xmm1,%xmm1
cvtsd2ss %xmm0,%xmm0
movss  %xmm1,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    %edi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
movslq -0x10(%rbp),%rcx
mov    $0x989680,%eax
movss  0xebe(%rip),%xmm0
movss  %xmm0,(%rax,%rcx,4)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adrx0imm1_set>:
movslq %edi,%rax
movl   $0x42040000,0x989680(,%rax,4)
ret

LLVM IR (-O0):
define i32 @adrx0imm1_set(double %0, double %1, i32 %2, i32 %3, float* %4, float* %5) {
%7 = alloca i32
%8 = alloca float
%9 = alloca float
%10 = alloca i32
%11 = alloca i32
%12 = alloca float*
%13 = alloca float*
%14 = fptrunc double %0 to float
%15 = fptrunc double %1 to float
store float %14, float* %8
store float %15, float* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store float* %4, float** %12
store float* %5, float** %13
%16 = load i32, i32* %10
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %17
store float 3.300000e+01, float* %18
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @adrx0imm1_set(double %0, double %1, i32 %2, i32 %3, float* nocapture readnone %4, float* nocapture readnone %5) {
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds float, float* inttoptr (i64 10000000 to float*), i64 %7
store float 3.300000e+01, float* %8
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int64_t read_int8(const char *buf) { return *(int64_t *)buf; }


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

x86 assembly (clang, -O2):
<read_int8>:
mov    (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @read_int8(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
%3 = load i32, i32* %2
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ print_error(char *, char const *const, char const *const);
scalar_t__ strcmp(char const *const, char const *const);
int string_not_equal_display_error(const char *const left,
                                   const char *const right) {
  if (strcmp(left, right) != 0) {
    return 1;
  }
  print_error("                "
              "\"%s\" == \"%s\"\n",
              left, right);
  return 0;
}


x86 assembly (clang, -O0):
<string_not_equal_display_error>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
je     1153 <string_not_equal_display_error+0x33>
movl   $0x1,-0x4(%rbp)
jmp    116e <string_not_equal_display_error+0x4e>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe9e(%rip),%rdi
call   1030 <print_error@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_not_equal_display_error>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <strcmp@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
jne    1150 <string_not_equal_display_error+0x30>
lea    0xebd(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <print_error@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c" \22%s\22 == \22%s\22\0A\00"
define i32 @string_not_equal_display_error(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i64 @strcmp(i8* %6, i8* %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %11
10: ; preds = %2
store i32 1, i32* %3
br label %15
11: ; preds = %2
%12 = load i8*, i8** %4
%13 = load i8*, i8** %5
%14 = call i32 @print_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %12, i8* %13)
store i32 0, i32* %3
br label %15
15: ; preds = %11, %10
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [30 x i8] c" \22%s\22 == \22%s\22\0A\00"
define i32 @string_not_equal_display_error(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @print_error(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
char *mute_ident() { return "$Id: mute_devel.c 230 2007-10-23 17:42:49Z  $"; }


x86 assembly (clang, -O0):
<mute_ident>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [46 x i8] c"$Id: mute_devel.c 230 2007-10-23 17:42:49Z $\00"
define i8* @mute_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [46 x i8] c"$Id: mute_devel.c 230 2007-10-23 17:42:49Z $\00"
define i8* @mute_ident() {
ret i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0)
}
int insertJump() {
  int res;
  __asm__ volatile("xor   %0,%0;"
                   "mov   $-1,%0"
                   : "=r"(res));
  return res;
}


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

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

LLVM IR (-O0):
define i32 @insertJump() {
%1 = alloca i32
%2 = call i32 asm sideeffect "xor $0,$0;mov $$-1,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @insertJump() {
%1 = tail call i32 asm sideeffect "xor $0,$0;mov $$-1,$0", "=r,~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
unsigned xrop3_57_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = ~D;
  stk2 = T | stk3;
  stk1 = S ^ stk2;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_57_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_57_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
lea    -0x100(%rsi),%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_57_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = or i32 %5, -256
%7 = xor i32 %4, -1
%8 = and i32 %6, %7
%9 = or i32 %8, %3
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ delay(int);
int /*<<< orphan*/ mbus_remote_register_write(int, int, int);
void pmu_reset_solar_short() {
  mbus_remote_register_write(
      0x3, 0x0E, ((1 << 10) | (1 << 9) | (0 << 8) | (1 << 4) | (0)));
  delay(100);
  mbus_remote_register_write(
      0x3, 0x0E, ((1 << 10) | (0 << 9) | (0 << 8) | (1 << 4) | (0)));
  delay(100);
}


x86 assembly (clang, -O0):
<pmu_reset_solar_short>:
push   %rbp
mov    %rsp,%rbp
mov    $0x3,%edi
mov    $0xe,%esi
mov    $0x610,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0xe,%esi
mov    $0x410,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pmu_reset_solar_short>:
push   %rax
mov    $0x3,%edi
mov    $0xe,%esi
mov    $0x610,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
call   1030 <delay@plt>
mov    $0x3,%edi
mov    $0xe,%esi
mov    $0x410,%edx
call   1040 <mbus_remote_register_write@plt>
mov    $0x64,%edi
pop    %rax
jmp    1030 <delay@plt>

LLVM IR (-O0):
define void @pmu_reset_solar_short() {
%1 = call i32 @mbus_remote_register_write(i32 3, i32 14, i32 1552)
%2 = call i32 @delay(i32 100)
%3 = call i32 @mbus_remote_register_write(i32 3, i32 14, i32 1040)
%4 = call i32 @delay(i32 100)
ret void
}

LLVM IR (-O2):
define void @pmu_reset_solar_short() {
%1 = tail call i32 @mbus_remote_register_write(i32 3, i32 14, i32 1552)
%2 = tail call i32 @delay(i32 100)
%3 = tail call i32 @mbus_remote_register_write(i32 3, i32 14, i32 1040)
%4 = tail call i32 @delay(i32 100)
ret void
}
void rop3_13_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  unsigned char stk3;
  stk3 = ~S;
  stk2 = *D & stk3;
  stk1 = T | stk2;
  stk1 = ~stk1;
  *D = stk1;
}


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

x86 assembly (clang, -O2):
<rop3_13_0_0>:
not    %sil
and    (%rdi),%sil
or     %dl,%sil
not    %sil
mov    %sil,(%rdi)
ret

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

LLVM IR (-O2):
define void @rop3_13_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
%7 = or i8 %6, %2
%8 = xor i8 %7, -1
store i8 %8, i8* %0
ret void
}
int test_imm_35int16_mem(short *val) {
  return ((*val) & (-0x35 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_35int16_mem>:
movzwl (%rdi),%eax
test   $0xffcb,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_35int16_mem(i16* %0) {
%2 = alloca i16*
store i16* %0, i16** %2
%3 = load i16*, i16** %2
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = and i32 %5, -53
%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_35int16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, -53
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ MS_BIND;
int /*<<< orphan*/ _exit(int /*<<< orphan*/);
scalar_t__ mount(char *, char *, int /*<<< orphan*/ *, int /*<<< orphan*/,
                 int /*<<< orphan*/ *);
void bindnode(char *src, char *dst) {
  if (mount(src, dst, NULL, MS_BIND, NULL) < 0) {
    _exit(EX_OSERR);
  }
}


x86 assembly (clang, -O0):
<bindnode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ea9(%rip),%rax
mov    (%rax),%ecx
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
call   1040 <mount@plt>
cmp    $0x0,%rax
jge    1166 <bindnode+0x46>
mov    0x2e79(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bindnode>:
push   %rax
mov    0x2ec0(%rip),%rax
mov    (%rax),%ecx
xor    %edx,%edx
xor    %r8d,%r8d
call   1040 <mount@plt>
test   %rax,%rax
js     113b <bindnode+0x1b>
pop    %rax
ret
mov    0x2e96(%rip),%rax
mov    (%rax),%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
@MS_BIND = global i32 0
@EX_OSERR = global i32 0
define void @bindnode(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @MS_BIND
%8 = call i64 @mount(i8* %5, i8* %6, i32* null, i32 %7, i32* null)
%9 = icmp slt i64 %8, 0
br i1 %9, label %10, label %13
10: ; preds = %2
%11 = load i32, i32* @EX_OSERR
%12 = call i32 @_exit(i32 %11)
unreachable
13: ; preds = %2
ret void
}

LLVM IR (-O2):
@MS_BIND = global i32 0
@EX_OSERR = global i32 0
define void @bindnode(i8* %0, i8* %1) {
%3 = load i32, i32* @MS_BIND
%4 = tail call i64 @mount(i8* %0, i8* %1, i32* null, i32 %3, i32* null)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %9
6: ; preds = %2
%7 = load i32, i32* @EX_OSERR
%8 = tail call i32 @_exit(i32 %7)
unreachable
9: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void reportOob() {
  printf("Runtime error: array index out of bounds.\n");
  exit(1);
}


x86 assembly (clang, -O0):
<reportOob>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<reportOob>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"Runtime error: array index out of bounds.\0A\00"
define void @reportOob() {
%1 = call i32 @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [42 x i8] c"Runtime error: array index out of bounds.\00"
define void @reportOob() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ chtype;
typedef int /*<<< orphan*/ WINDOW;

/* Variables and functions */
chtype winch(WINDOW *w) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @winch(i32* nocapture readnone %0) {
ret i32 0
}
int main(void) {
  4 > "a";
  return 1;
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"a\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
ret i32 1
}

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ sla_supgal_(double *, double *, double *, double *);
void slaSupgal(double dsl, double dsb, double *dl, double *db) {
  double DSL;
  double DSB;
  double DL;
  double DB;
  DSL = dsl;
  DSB = dsb;
  sla_supgal_(&DSL, &DSB, &DL, &DB);
  *dl = DL;
  *db = DB;
}


x86 assembly (clang, -O0):
<slaSupgal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
lea    -0x28(%rbp),%rdi
lea    -0x30(%rbp),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   1030 <sla_supgal_@plt>
movsd  -0x38(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x40(%rbp),%xmm0
mov    -0x20(%rbp),%rax
movsd  %xmm0,(%rax)
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<slaSupgal>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
movsd  %xmm0,0x20(%rsp)
movsd  %xmm1,0x18(%rsp)
lea    0x20(%rsp),%rdi
lea    0x18(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
call   1030 <sla_supgal_@plt>
movsd  0x10(%rsp),%xmm0
movsd  %xmm0,(%rbx)
movsd  0x8(%rsp),%xmm0
movsd  %xmm0,(%r14)
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @slaSupgal(double %0, double %1, double* nocapture writeonly %2, double* nocapture writeonly %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = bitcast double* %5 to i8*
%10 = bitcast double* %6 to i8*
%11 = bitcast double* %7 to i8*
%12 = bitcast double* %8 to i8*
store double %0, double* %5
store double %1, double* %6
%13 = call i32 @sla_supgal_(double* %5, double* %6, double* %7, double* %8)
%14 = load double, double* %7
store double %14, double* %2
%15 = load double, double* %8
store double %15, double* %3
ret void
}
float decode_sound_speed(unsigned char ss) {
  return ((float)ss / 2.0 + 1425.0);
}


x86 assembly (clang, -O0):
<decode_sound_speed>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
cvtsi2ss %eax,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeea(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  0xed6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode_sound_speed>:
cvtsi2sd %edi,%xmm0
mulsd  0xef4(%rip),%xmm0
addsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @decode_sound_speed(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = uitofp i8 %3 to float
%5 = fpext float %4 to double
%6 = fdiv double %5, 2.000000e+00
%7 = fadd double %6, 1.425000e+03
%8 = fptrunc double %7 to float
ret float %8
}

LLVM IR (-O2):
define float @decode_sound_speed(i8 zeroext %0) {
%2 = uitofp i8 %0 to double
%3 = fmul double %2, 5.000000e-01
%4 = fadd double %3, 1.425000e+03
%5 = fptrunc double %4 to float
ret float %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("hola mundo");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [11 x i8] c"hola mundo\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"hola mundo\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
char *itohex(int);
int print_str(char *);
int print_hex(int a) {
  char *num_str = itohex(a);
  return print_str(num_str);
}


x86 assembly (clang, -O0):
<print_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <itohex@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <print_str@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_hex>:
push   %rax
call   1040 <itohex@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <print_str@plt>

LLVM IR (-O0):
define i32 @print_hex(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = call i8* @itohex(i32 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @print_str(i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @print_hex(i32 %0) {
%2 = tail call i8* @itohex(i32 %0)
%3 = tail call i32 @print_str(i8* %2)
ret i32 %3
}
void save_arrays_solver_meshfiles_adios_(void) {}


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

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

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

LLVM IR (-O2):
define void @save_arrays_solver_meshfiles_adios_() {
ret void
}
/* Variables and functions */
int f();
int main() {
  int i = f();
  return i;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @f()
ret i32 %1
}
int test_imm_EDuint16_mem(unsigned short *val) {
  return ((*val) & (0xED << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_EDuint16_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, 237
%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_EDuint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 237
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}