xunge/DecIR huggingface dataset:
/* Variables and functions */
int SHA256_HashBuf(unsigned char *, unsigned char const *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char const *);
int SHA256_Hash(unsigned char *dest, const char *src) {
  return SHA256_HashBuf(dest, (const unsigned char *)src, strlen(src));
}


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

x86 assembly (clang, -O2):
<SHA256_Hash>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <SHA256_HashBuf@plt>

LLVM IR (-O0):
define i32 @SHA256_Hash(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = load i8*, i8** %4
%8 = call i32 @strlen(i8* %7)
%9 = call i32 @SHA256_HashBuf(i8* %5, i8* %6, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @SHA256_Hash(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %1)
%4 = tail call i32 @SHA256_HashBuf(i8* %0, i8* %1, i32 %3)
ret i32 %4
}
const char *rndwrite00_get_title(void) {
  return "Randomly write a large test file";
}


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

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

LLVM IR (-O0):
@.str = [33 x i8] c"Randomly write a large test file\00"
define i8* @rndwrite00_get_title() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [33 x i8] c"Randomly write a large test file\00"
define i8* @rndwrite00_get_title() {
ret i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0)
}
int translate_path(struct afp_volume *volume, char *incoming, char *outgoing) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.afp_volume = type opaque
define i32 @translate_path(%struct.afp_volume* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
ret i32 0
}
void gtk_color_selection_set_previous_alpha() {}


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

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

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

LLVM IR (-O2):
define void @gtk_color_selection_set_previous_alpha() {
ret void
}
int atm_header_get_clp(unsigned char *cell) { return (cell[3] & 0x01); }


x86 assembly (clang, -O0):
<atm_header_get_clp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
and    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atm_header_get_clp>:
movzbl 0x3(%rdi),%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @atm_header_get_clp(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 3
%5 = load i8, i8* %4
%6 = zext i8 %5 to i32
%7 = and i32 %6, 1
ret i32 %7
}

LLVM IR (-O2):
define i32 @atm_header_get_clp(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 3
%3 = load i8, i8* %2
%4 = and i8 %3, 1
%5 = zext i8 %4 to i32
ret i32 %5
}
void f26(void) {
  ({
    goto a;
    ({ 0; });
    ({ 0; });
    0;
  });
  ({
    ({ 0; });
    ({ 0; });
    0;
  });
a:
  0;
}


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

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

LLVM IR (-O0):
define void @f26() {
%1 = alloca i32
br label %2
2: ; preds = %0
ret void
}

LLVM IR (-O2):
define void @f26() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int read_until_terminator(int /*<<< orphan*/, char const *, char *, char);
int read_string(const char *name, char *buf) {
  printf("%s> ", name);
  return read_until_terminator(0, name, buf, '\n');
}


x86 assembly (clang, -O0):
<read_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xec5(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
xor    %edi,%edi
mov    $0xa,%ecx
call   1040 <read_until_terminator@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_string>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %edi,%edi
mov    %rbx,%rsi
mov    %r14,%rdx
mov    $0xa,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <read_until_terminator@plt>

LLVM IR (-O0):
@.str = [5 x i8] c"%s> \00"
define i32 @read_string(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 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i8*, i8** %3
%8 = load i8*, i8** %4
%9 = call i32 @read_until_terminator(i32 0, i8* %7, i8* %8, i8 signext 10)
ret i32 %9
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s> \00"
define i32 @read_string(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @read_until_terminator(i32 0, i8* %0, i8* %1, i8 signext 10)
ret i32 %4
}
/* Variables and functions */
int getdtablesize();
int get_open_max(void) {
  int retval = getdtablesize();
  return retval;
}


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

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

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

LLVM IR (-O2):
define i32 @get_open_max() {
%1 = tail call i32 (...) @getdtablesize()
ret i32 %1
}
int do_314() { return 314; }


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

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

LLVM IR (-O0):
define i32 @do_314() {
ret i32 314
}

LLVM IR (-O2):
define i32 @do_314() {
ret i32 314
}
int test_imm_23uint64_lowword_reg(unsigned long long val) {
  return ((val) & (0x23 << 0)) ? -20 : -40;
}


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

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

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

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


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @__a1() {
ret void
}
/* Variables and functions */
char *very_ugly_ipv4_code(char *, int, int);
char *index_id(char *ip, int bitmask) {
  return very_ugly_ipv4_code(ip, bitmask, 1);
}


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

x86 assembly (clang, -O2):
<index_id>:
mov    $0x1,%edx
jmp    1030 <very_ugly_ipv4_code@plt>

LLVM IR (-O0):
define i8* @index_id(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 i8* @very_ugly_ipv4_code(i8* %5, i32 %6, i32 1)
ret i8* %7
}

LLVM IR (-O2):
define i8* @index_id(i8* %0, i32 %1) {
%3 = tail call i8* @very_ugly_ipv4_code(i8* %0, i32 %1, i32 1)
ret i8* %3
}
/* Variables and functions */
int factorial(int);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char *argv[]) {
  int y;
  y = factorial(6);
  printf("Hello World\n");
  printf("6! = %d\n", y);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x6,%edi
call   1030 <factorial@plt>
mov    %eax,-0x14(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x6,%edi
call   1040 <factorial@plt>
mov    %eax,%ebx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
lea    0xeb0(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str.1 = [9 x i8] c"6! = %d\0A\00"
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @factorial(i32 6)
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret i32 0
}
/* Variables and functions */
void *realloc(void *, int);
int /*<<< orphan*/ xnomem(void *);
void *xrealloc(void *s, int sz) {
  void *c = realloc(s, sz);
  xnomem(c);
  return c;
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <xnomem@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <xnomem@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = load i8*, i8** %3
%7 = load i32, i32* %4
%8 = call i8* @realloc(i8* %6, i32 %7)
store i8* %8, i8** %5
%9 = load i8*, i8** %5
%10 = call i32 @xnomem(i8* %9)
%11 = load i8*, i8** %5
ret i8* %11
}

LLVM IR (-O2):
define i8* @xrealloc(i8* %0, i32 %1) {
%3 = tail call i8* @realloc(i8* %0, i32 %1)
%4 = tail call i32 @xnomem(i8* %3)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_pow10l();
scalar_t__ pow10l(long double);
void test_pow10l(long double ld) {
  if (pow10l(ld) != pow10l(ld))
    link_failure_pow10l();
}


x86 assembly (clang, -O0):
<test_pow10l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
fldt   0x10(%rbp)
fstpt  -0x10(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <pow10l@plt>
mov    %rax,-0x18(%rbp)
fldt   -0x10(%rbp)
mov    %rsp,%rax
fstpt  (%rax)
call   1030 <pow10l@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmp    %rcx,%rax
je     1163 <test_pow10l+0x43>
mov    $0x0,%al
call   1040 <link_failure_pow10l@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_pow10l>:
push   %rbx
sub    $0x20,%rsp
fldt   0x30(%rsp)
fld    %st(0)
fstpt  0x14(%rsp)
fstpt  (%rsp)
call   1030 <pow10l@plt>
mov    %rax,%rbx
fldt   0x14(%rsp)
fstpt  (%rsp)
call   1030 <pow10l@plt>
cmp    %rax,%rbx
jne    1151 <test_pow10l+0x31>
add    $0x20,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
jmp    1040 <link_failure_pow10l@plt>

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

LLVM IR (-O2):
define void @test_pow10l(x86_fp80 %0) {
%2 = tail call i64 @pow10l(x86_fp80 %0)
%3 = tail call i64 @pow10l(x86_fp80 %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_pow10l()
br label %7
7: ; preds = %5, %1
ret void
}
char *get_machine() { return "x86_64"; }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"x86_64\00"
define i8* @get_machine() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"x86_64\00"
define i8* @get_machine() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int int16_t;

/* Variables and functions */
__attribute__((always_)) void BEUnpackInt16(int16_t *data,
                                            const uint8_t container[2]) {
  *data = (int16_t)container[1] | ((int16_t)container[0] << 8);
}


x86 assembly (clang, -O0):
<BEUnpackInt16>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
shl    $0x8,%eax
or     %eax,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<BEUnpackInt16>:
mov    (%rsi),%eax
shl    $0x8,%eax
or     0x8(%rsi),%eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @BEUnpackInt16(i32* nocapture writeonly %0, i64* nocapture %1) {
%3 = getelementptr inbounds i64, i64* %1, i64 1
%4 = load i64, i64* %3
%5 = trunc i64 %4 to i32
%6 = load i64, i64* %1
%7 = trunc i64 %6 to i32
%8 = shl i32 %7, 8
%9 = or i32 %8, %5
store i32 %9, i32* %0
ret void
}
__attribute__((always_)) void __mwait(unsigned long eax, unsigned long ecx) {
  asm volatile(".byte 0x0f,0x01,0xc9;" : : "a"(eax), "c"(ecx));
}


x86 assembly (clang, -O0):
<__mwait>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mwait  %eax,%ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<__mwait>:
mov    %rsi,%rcx
mov    %rdi,%rax
mwait  %eax,%ecx
ret

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

LLVM IR (-O2):
define void @__mwait(i64 %0, i64 %1) {
tail call void asm sideeffect ".byte 0x0f,0x01,0xc9;", "{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i64 %1)
ret void
}
void foo479(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo479(i32 %0) {
ret void
}
void ff_get_cpu_flags_aarch64() {}


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

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

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

LLVM IR (-O2):
define void @ff_get_cpu_flags_aarch64() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memset(double *, int /*<<< orphan*/, int);
void vec_zero(double *v1, int n) { memset(v1, 0, n * sizeof(double)); }


x86 assembly (clang, -O0):
<vec_zero>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vec_zero>:
lea    0x0(,%rsi,8),%edx
xor    %esi,%esi
jmp    1030 <memset@plt>

LLVM IR (-O0):
define void @vec_zero(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = mul i64 %7, 8
%9 = trunc i64 %8 to i32
%10 = call i32 @memset(double* %5, i32 0, i32 %9)
ret void
}

LLVM IR (-O2):
define void @vec_zero(double* %0, i32 %1) {
%3 = shl i32 %1, 3
%4 = tail call i32 @memset(double* %0, i32 0, i32 %3)
ret void
}
int bar(int *x, int y) {
  int *__restrict p1 = x;
  int *p3 = x + 32;
  int *__restrict p2 = p3;
  p1[y] = 1;
  p2[4] = 2;
  return p1[y];
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x80,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
movl   $0x1,(%rax,%rcx,4)
mov    -0x28(%rbp),%rax
movl   $0x2,0x10(%rax)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
movslq %esi,%rax
movl   $0x1,(%rdi,%rax,4)
movl   $0x2,0x90(%rdi)
mov    (%rdi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @bar(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca i32*
store i32* %0, i32** %3
store i32 %1, i32* %4
%8 = load i32*, i32** %3
store i32* %8, i32** %5
%9 = load i32*, i32** %3
%10 = getelementptr inbounds i32, i32* %9, i64 32
store i32* %10, i32** %6
%11 = load i32*, i32** %6
store i32* %11, i32** %7
%12 = load i32*, i32** %5
%13 = load i32, i32* %4
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds i32, i32* %12, i64 %14
store i32 1, i32* %15
%16 = load i32*, i32** %7
%17 = getelementptr inbounds i32, i32* %16, i64 4
store i32 2, i32* %17
%18 = load i32*, i32** %5
%19 = load i32, i32* %4
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
%22 = load i32, i32* %21
ret i32 %22
}

LLVM IR (-O2):
define i32 @bar(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
store i32 1, i32* %4
%5 = getelementptr inbounds i32, i32* %0, i64 36
store i32 2, i32* %5
%6 = load i32, i32* %4
ret i32 %6
}
unsigned int _three_way_argmin(const double cost0, const double cost1,
                               const double cost2) {
  if ((cost0 <= cost1) && (cost0 <= cost2)) {
    return 0;
  }
  if (cost1 <= cost2) {
    return 1;
  }
  return 2;
}


x86 assembly (clang, -O0):
<_three_way_argmin>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x10(%rbp)
movsd  %xmm1,-0x18(%rbp)
movsd  %xmm2,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1147 <_three_way_argmin+0x47>
movsd  -0x10(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1147 <_three_way_argmin+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <_three_way_argmin+0x6e>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1167 <_three_way_argmin+0x67>
movl   $0x1,-0x4(%rbp)
jmp    116e <_three_way_argmin+0x6e>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_three_way_argmin>:
ucomisd %xmm1,%xmm2
mov    $0x1,%ecx
adc    $0x0,%ecx
xor    %eax,%eax
ucomisd %xmm0,%xmm2
cmovb  %ecx,%eax
ucomisd %xmm0,%xmm1
cmovb  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @_three_way_argmin(double %0, double %1, double %2) {
%4 = alloca i32
%5 = alloca double
%6 = alloca double
%7 = alloca double
store double %0, double* %5
store double %1, double* %6
store double %2, double* %7
%8 = load double, double* %5
%9 = load double, double* %6
%10 = fcmp ole double %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load double, double* %5
%13 = load double, double* %7
%14 = fcmp ole double %12, %13
br i1 %14, label %15, label %16
15: ; preds = %11
store i32 0, i32* %4
br label %22
16: ; preds = %11, %3
%17 = load double, double* %6
%18 = load double, double* %7
%19 = fcmp ole double %17, %18
br i1 %19, label %20, label %21
20: ; preds = %16
store i32 1, i32* %4
br label %22
21: ; preds = %16
store i32 2, i32* %4
br label %22
22: ; preds = %21, %20, %15
%23 = load i32, i32* %4
ret i32 %23
}

LLVM IR (-O2):
define i32 @_three_way_argmin(double %0, double %1, double %2) {
%4 = fcmp ugt double %0, %1
%5 = fcmp ugt double %0, %2
%6 = or i1 %4, %5
%7 = fcmp ugt double %1, %2
%8 = select i1 %7, i32 2, i32 1
%9 = select i1 %6, i32 %8, i32 0
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ recv(int, void *, size_t, int /*<<< orphan*/);
ssize_t myread_swift_store(int fd, void *buf, size_t len) {
  return recv(fd, buf, len, 0);
}


x86 assembly (clang, -O0):
<myread_swift_store>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
xor    %ecx,%ecx
call   1030 <recv@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<myread_swift_store>:
xor    %ecx,%ecx
jmp    1030 <recv@plt>

LLVM IR (-O0):
define i32 @myread_swift_store(i32 %0, i8* %1, i64 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i64
store i32 %0, i32* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @recv(i32 %7, i8* %8, i64 %9, i32 0)
ret i32 %10
}

LLVM IR (-O2):
define i32 @myread_swift_store(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @recv(i32 %0, i8* %1, i64 %2, i32 0)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void do_exit(void) { exit(0); }


x86 assembly (clang, -O0):
<do_exit>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<do_exit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @do_exit() {
%1 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @do_exit() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
struct bitmask {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setpol(int, struct bitmask *);
void numa_set_membind_v2(struct bitmask *bmp) { setpol(2, bmp); }


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

x86 assembly (clang, -O2):
<numa_set_membind_v2>:
mov    %rdi,%rsi
mov    $0x2,%edi
jmp    1030 <setpol@plt>

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

LLVM IR (-O2):
%struct.bitmask = type { i32 }
define void @numa_set_membind_v2(%struct.bitmask* %0) {
%2 = tail call i32 @setpol(i32 2, %struct.bitmask* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
void set_32(uint32_t *p, uint32_t v) { *p = v; }


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

x86 assembly (clang, -O2):
<set_32>:
mov    %esi,(%rdi)
ret

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

LLVM IR (-O2):
define void @set_32(i32* nocapture writeonly %0, i32 %1) {
store i32 %1, i32* %0
ret void
}
int lw_sock_listen(int *sock, char *ip, int port) { return 0; }


x86 assembly (clang, -O0):
<lw_sock_listen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @lw_sock_listen(i32* %0, i8* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @lw_sock_listen(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ puts0(char *);
void puts(char *s) {
  puts0(s);
  puts0("\r\n");
}


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

x86 assembly (clang, -O2):
<puts>:
push   %rax
call   1030 <puts0@plt>
lea    0xee3(%rip),%rdi
pop    %rax
jmp    1030 <puts0@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c"\0D\0A\00"
define void @puts(i8* %0) {
%2 = tail call i32 @puts0(i8* %0)
%3 = tail call i32 @puts0(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
ret void
}
void ls_costN_nm3_decref(void) {}


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

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

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

LLVM IR (-O2):
define void @ls_costN_nm3_decref() {
ret void
}
/* Variables and functions */
int f367(int *);
int f368(int *p) { return f367(p); }


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

x86 assembly (clang, -O2):
<f368>:
jmp    1030 <f367@plt>

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

LLVM IR (-O2):
define i32 @f368(i32* %0) {
%2 = tail call i32 @f367(i32* %0)
ret i32 %2
}
unsigned long long int
unsignedlonglongint_ignoring_signedlonglongint(unsigned long long int x,
                                               signed long long int y) {
  return x;
}


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

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

LLVM IR (-O0):
define i64 @unsignedlonglongint_ignoring_signedlonglongint(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlonglongint_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
void imx_ssi_ac97_write(struct snd_ac97 *ac97, unsigned short reg,
                        unsigned short val) {}


x86 assembly (clang, -O0):
<imx_ssi_ac97_write>:
push   %rbp
mov    %rsp,%rbp
mov    %dx,%ax
mov    %si,%cx
mov    %rdi,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.snd_ac97 = type opaque
define void @imx_ssi_ac97_write(%struct.snd_ac97* %0, i16 zeroext %1, i16 zeroext %2) {
%4 = alloca %struct.snd_ac97*
%5 = alloca i16
%6 = alloca i16
store %struct.snd_ac97* %0, %struct.snd_ac97** %4
store i16 %1, i16* %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
%struct.snd_ac97 = type opaque
define void @imx_ssi_ac97_write(%struct.snd_ac97* nocapture %0, i16 zeroext %1, i16 zeroext %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void show_help() {
  printf("Usage: [-s | -c] -u [username] [ip port]\n");
  printf("    -s as chat server, port are needed\n");
  printf("    -c as chat client, ip and port are needed\n");
  printf("    -u set the username when you chat to others\n");
}


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

x86 assembly (clang, -O2):
<show_help>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xf05(%rip),%rdi
call   1030 <puts@plt>
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xf42(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"Usage: [-s | -c] -u [username] [ip port]\0A\00"
@.str.1 = [40 x i8] c" -s as chat server, port are needed\0A\00"
@.str.2 = [47 x i8] c" -c as chat client, ip and port are needed\0A\00"
@.str.3 = [49 x i8] c" -u set the username when you chat to others\0A\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [41 x i8] c"Usage: [-s | -c] -u [username] [ip port]\00"
@str.4 = [39 x i8] c" -s as chat server, port are needed\00"
@str.5 = [46 x i8] c" -c as chat client, ip and port are needed\00"
@str.6 = [48 x i8] c" -u set the username when you chat to others\00"
define void @show_help() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.4, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.5, i64 0, i64 0))
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str.6, i64 0, i64 0))
ret void
}
int do_199() { return 199; }


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

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

LLVM IR (-O0):
define i32 @do_199() {
ret i32 199
}

LLVM IR (-O2):
define i32 @do_199() {
ret i32 199
}
void XrmParseCommand() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_spin_button_get_snap_to_ticks() {
ret void
}
int test3(int a) { return a + 5 == a; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5,%eax
cmp    -0x4(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test3(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 5
%5 = load i32, i32* %2
%6 = icmp eq i32 %4, %5
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @test3(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ testdlr_deeplib1_func();
void testdlr_lib2_func() {
  printf("testdlr_lib2: testdlr_lib2_func() called\n");
  testdlr_deeplib1_func();
}


x86 assembly (clang, -O0):
<testdlr_lib2_func>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <testdlr_deeplib1_func@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<testdlr_lib2_func>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <testdlr_deeplib1_func@plt>

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

LLVM IR (-O2):
@str = [41 x i8] c"testdlr_lib2: testdlr_lib2_func() called\00"
define void @testdlr_lib2_func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @testdlr_deeplib1_func()
ret void
}
int fb_ConsoleKeyHit(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @fb_ConsoleKeyHit() {
ret i32 0
}
/* Variables and functions */
float __nv_rnorm4df(float, float, float, float);
float rnorm4df(float __a, float __b, float __c, float __d) {
  return __nv_rnorm4df(__a, __b, __c, __d);
}


x86 assembly (clang, -O0):
<rnorm4df>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
call   1030 <__nv_rnorm4df@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnorm4df>:
jmp    1030 <__nv_rnorm4df@plt>

LLVM IR (-O0):
define float @rnorm4df(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %7
%12 = load float, float* %8
%13 = call float @__nv_rnorm4df(float %9, float %10, float %11, float %12)
ret float %13
}

LLVM IR (-O2):
define float @rnorm4df(float %0, float %1, float %2, float %3) {
%5 = tail call float @__nv_rnorm4df(float %0, float %1, float %2, float %3)
ret float %5
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ XIMText;
struct TYPE_3__ {
  int /*<<< orphan*/ *text;
};
struct TYPE_4__ {
  TYPE_1__ data;
};
typedef TYPE_2__ XIMStatusDrawCallbackStruct;

/* Variables and functions */
void set_XIMStatusDrawCallbackStruct_data_text(void *_p, void *_v) {
  ((XIMStatusDrawCallbackStruct *)_p)->data.text = (XIMText *)_v;
}


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

x86 assembly (clang, -O2):
<set_XIMStatusDrawCallbackStruct_data_text>:
mov    %rsi,(%rdi)
ret

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i32* }
define void @set_XIMStatusDrawCallbackStruct_data_text(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = bitcast i8* %5 to i32*
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to %struct.TYPE_4__*
%9 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %8, i32 0, i32 0
%10 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %9, i32 0, i32 0
store i32* %6, i32** %10
ret void
}

LLVM IR (-O2):
define void @set_XIMStatusDrawCallbackStruct_data_text(i8* nocapture writeonly %0, i8* %1) {
%3 = bitcast i8* %0 to i8**
store i8* %1, i8** %3
ret void
}
const char *beaconReceiverDeviceGetName(void) { return "beaconReceiver"; }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"beaconReceiver\00"
define i8* @beaconReceiverDeviceGetName() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [15 x i8] c"beaconReceiver\00"
define i8* @beaconReceiverDeviceGetName() {
ret i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int pow10(int n) {
  if (n == 0)
    return 1;
  if (n == 1)
    return 10;
  if (n == 2)
    return 100;
  if (n == 3)
    return 1000;
  return 0;
}


x86 assembly (clang, -O0):
<pow10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <pow10+0x1d>
movl   $0x1,-0x4(%rbp)
jmp    1166 <pow10+0x66>
cmpl   $0x1,-0x8(%rbp)
jne    1133 <pow10+0x33>
movl   $0xa,-0x4(%rbp)
jmp    1166 <pow10+0x66>
cmpl   $0x2,-0x8(%rbp)
jne    1149 <pow10+0x49>
movl   $0x64,-0x4(%rbp)
jmp    1166 <pow10+0x66>
cmpl   $0x3,-0x8(%rbp)
jne    115f <pow10+0x5f>
movl   $0x3e8,-0x4(%rbp)
jmp    1166 <pow10+0x66>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pow10>:
xor    %eax,%eax
cmp    $0x3,%edi
ja     1114 <pow10+0x14>
movslq %edi,%rax
lea    0xeef(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @pow10(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 1, i32* %2
br label %20
7: ; preds = %1
%8 = load i32, i32* %3
%9 = icmp eq i32 %8, 1
br i1 %9, label %10, label %11
10: ; preds = %7
store i32 10, i32* %2
br label %20
11: ; preds = %7
%12 = load i32, i32* %3
%13 = icmp eq i32 %12, 2
br i1 %13, label %14, label %15
14: ; preds = %11
store i32 100, i32* %2
br label %20
15: ; preds = %11
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %19
18: ; preds = %15
store i32 1000, i32* %2
br label %20
19: ; preds = %15
store i32 0, i32* %2
br label %20
20: ; preds = %19, %18, %14, %10, %6
%21 = load i32, i32* %2
ret i32 %21
}

LLVM IR (-O2):
@switch.table.pow10 = [4 x i32] [i32 1, i32 10, i32 100, i32 1000]
define i32 @pow10(i32 %0) {
%2 = icmp ult i32 %0, 4
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = getelementptr inbounds [4 x i32], [4 x i32]* @switch.table.pow10, i64 0, i64 %4
%6 = load i32, i32* %5
br label %7
7: ; preds = %1, %3
%8 = phi i32 [ %6, %3 ], [ 0, %1 ]
ret i32 %8
}
/* Type definitions */
struct stack {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ stack_empty(struct stack *);
int /*<<< orphan*/ stack_pop(struct stack *);
void stack_clear(struct stack *theStack) {
  while (!stack_empty(theStack))
    stack_pop(theStack);
  return;
}


x86 assembly (clang, -O0):
<stack_clear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <stack_empty@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    114a <stack_clear+0x2a>
jmp    1158 <stack_clear+0x38>
mov    -0x8(%rbp),%rdi
call   1040 <stack_pop@plt>
jmp    112c <stack_clear+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stack_clear>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1030 <stack_empty@plt>
test   %eax,%eax
jne    1146 <stack_clear+0x26>
mov    %rbx,%rdi
call   1040 <stack_pop@plt>
mov    %rbx,%rdi
jmp    1130 <stack_clear+0x10>
pop    %rbx
ret

LLVM IR (-O0):
%struct.stack = type { i32 }
define void @stack_clear(%struct.stack* %0) {
%2 = alloca %struct.stack*
store %struct.stack* %0, %struct.stack** %2
br label %3
3: ; preds = %8, %1
%4 = load %struct.stack*, %struct.stack** %2
%5 = call i32 @stack_empty(%struct.stack* %4)
%6 = icmp ne i32 %5, 0
%7 = xor i1 %6, true
br i1 %7, label %8, label %11
8: ; preds = %3
%9 = load %struct.stack*, %struct.stack** %2
%10 = call i32 @stack_pop(%struct.stack* %9)
br label %3
11: ; preds = %3
ret void
}

LLVM IR (-O2):
%struct.stack = type { i32 }
define void @stack_clear(%struct.stack* %0) {
%2 = tail call i32 @stack_empty(%struct.stack* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @stack_pop(%struct.stack* %0)
%6 = tail call i32 @stack_empty(%struct.stack* %0)
%7 = icmp eq i32 %6, 0
br i1 %7, label %4, label %8
8: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ mvprintw(int, int, char *);
void emptyLine(int line, int col) {
  for (int i = 0; i < col; i++) {
    mvprintw(line, i, " ");
  }
}


x86 assembly (clang, -O0):
<emptyLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1151 <emptyLine+0x41>
mov    -0x4(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    0xec2(%rip),%rdx
call   1030 <mvprintw@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1125 <emptyLine+0x15>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emptyLine>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
test   %esi,%esi
jle    1144 <emptyLine+0x34>
mov    %esi,%ebx
mov    %edi,%r14d
xor    %ebp,%ebp
lea    0xed7(%rip),%r15
nopl   0x0(%rax)
mov    %r14d,%edi
mov    %ebp,%esi
mov    %r15,%rdx
call   1030 <mvprintw@plt>
add    $0x1,%ebp
cmp    %ebp,%ebx
jne    1130 <emptyLine+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [2 x i8] c" \00"
define void @emptyLine(i32 %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %5, label %4
4: ; preds = %5, %2
ret void
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ 0, %2 ]
%7 = tail call i32 @mvprintw(i32 %0, i32 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = add nuw nsw i32 %6, 1
%9 = icmp eq i32 %8, %1
br i1 %9, label %4, label %5
}
/* Variables and functions */
int EXIT_SUCCESS;
int numcolors();
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d\n", numcolors());
  return EXIT_SUCCESS;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i32 (...) @numcolors()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}
void imv_unref_core_init(void) {}


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

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

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

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

/* Variables and functions */
uint64_t geopm_region_id_set_hint(uint64_t hint_type, uint64_t region_id) {
  return (region_id | hint_type);
}


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

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

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

LLVM IR (-O2):
define i32 @geopm_region_id_set_hint(i32 %0, i32 %1) {
%3 = or i32 %1, %0
ret i32 %3
}
/* Variables and functions */
unsigned int sys_call(int, unsigned int, unsigned int, unsigned int,
                      int /*<<< orphan*/);
unsigned int fb_read(unsigned int offset, void *buffer, unsigned int length) {
  return sys_call(0x13, offset, (unsigned int)buffer, length, 0);
}


x86 assembly (clang, -O0):
<fb_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rax
mov    %eax,%edx
mov    -0x14(%rbp),%ecx
mov    $0x13,%edi
xor    %r8d,%r8d
call   1030 <sys_call@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_read>:
mov    %edx,%ecx
mov    %rsi,%rdx
mov    %edi,%esi
mov    $0x13,%edi
xor    %r8d,%r8d
jmp    1030 <sys_call@plt>

LLVM IR (-O0):
define i32 @fb_read(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = load i8*, i8** %5
%9 = ptrtoint i8* %8 to i32
%10 = load i32, i32* %6
%11 = call i32 @sys_call(i32 19, i32 %7, i32 %9, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
define i32 @fb_read(i32 %0, i8* %1, i32 %2) {
%4 = ptrtoint i8* %1 to i64
%5 = trunc i64 %4 to i32
%6 = tail call i32 @sys_call(i32 19, i32 %0, i32 %5, i32 %2, i32 0)
ret i32 %6
}