xunge/DecIR huggingface dataset:
/* Variables and functions */
char *getenv(char *);
char *getinfo() {
  char *p = getenv("DEVRPLAY_INFO");
  return p ? p : 0;
}


x86 assembly (clang, -O0):
<getinfo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1140 <getinfo+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    114b <getinfo+0x3b>
xor    %eax,%eax
mov    %rax,-0x10(%rbp)
jmp    114b <getinfo+0x3b>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@.str = [14 x i8] c"DEVRPLAY_INFO\00"
define i8* @getinfo() {
%1 = tail call i8* @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void html_header() { printf("Content-type: text/html\n\n"); }


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

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

LLVM IR (-O0):
@.str = [26 x i8] c"Content-type: text/html\0A\0A\00"
define void @html_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [25 x i8] c"Content-type: text/html\0A\00"
define void @html_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str, i64 0, i64 0))
ret void
}
void handler(int signo) {
  (void)signo;
  return;
}


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

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

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

LLVM IR (-O2):
define void @handler(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ert_log_uninit();
int ert_test_uninit() { ert_log_uninit(); }


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

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

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

LLVM IR (-O2):
define i32 @ert_test_uninit() {
%1 = tail call i32 (...) @ert_log_uninit()
ret i32 undef
}
/* Type definitions */
struct strref {
  int dummy;
};
struct dstr {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ dstr_copy_strref(struct dstr *, struct strref const *);
int /*<<< orphan*/ dstr_init(struct dstr *);
void dstr_init_copy_strref(struct dstr *dst, const struct strref *src) {
  dstr_init(dst);
  dstr_copy_strref(dst, src);
}


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

x86 assembly (clang, -O2):
<dstr_init_copy_strref>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <dstr_init@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <dstr_copy_strref@plt>

LLVM IR (-O0):
%struct.dstr = type { i32 }
%struct.strref = type { i32 }
define void @dstr_init_copy_strref(%struct.dstr* %0, %struct.strref* %1) {
%3 = alloca %struct.dstr*
%4 = alloca %struct.strref*
store %struct.dstr* %0, %struct.dstr** %3
store %struct.strref* %1, %struct.strref** %4
%5 = load %struct.dstr*, %struct.dstr** %3
%6 = call i32 @dstr_init(%struct.dstr* %5)
%7 = load %struct.dstr*, %struct.dstr** %3
%8 = load %struct.strref*, %struct.strref** %4
%9 = call i32 @dstr_copy_strref(%struct.dstr* %7, %struct.strref* %8)
ret void
}

LLVM IR (-O2):
%struct.dstr = type { i32 }
%struct.strref = type { i32 }
define void @dstr_init_copy_strref(%struct.dstr* %0, %struct.strref* %1) {
%3 = tail call i32 @dstr_init(%struct.dstr* %0)
%4 = tail call i32 @dstr_copy_strref(%struct.dstr* %0, %struct.strref* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rst(int);
void opcode_c7() { rst(0x00); }


x86 assembly (clang, -O0):
<opcode_c7>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <rst@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @opcode_c7() {
%1 = call i32 @rst(i32 0)
ret void
}

LLVM IR (-O2):
define void @opcode_c7() {
%1 = tail call i32 @rst(i32 0)
ret void
}
/* Variables and functions */
scalar_t__ is_digit(int);
float lowercase(int);
bool is_hexdigit(int c) {
  if (is_digit(c)) {
    return true;
  } else if (lowercase(c) >= 'a' && lowercase(c) <= 'f') {
    return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_hexdigit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <is_digit@plt>
cmp    $0x0,%rax
je     1149 <is_hexdigit+0x29>
movl   $0x1,-0x4(%rbp)
jmp    1196 <is_hexdigit+0x76>
mov    -0x8(%rbp),%edi
call   1030 <lowercase@plt>
movss  0xea7(%rip),%xmm1
ucomiss %xmm1,%xmm0
jb     118a <is_hexdigit+0x6a>
mov    -0x8(%rbp),%edi
call   1030 <lowercase@plt>
movaps %xmm0,%xmm1
movss  0xe8f(%rip),%xmm0
ucomiss %xmm1,%xmm0
jb     118a <is_hexdigit+0x6a>
movl   $0x1,-0x4(%rbp)
jmp    1196 <is_hexdigit+0x76>
jmp    118f <is_hexdigit+0x6f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_hexdigit>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
call   1040 <is_digit@plt>
mov    $0x1,%ebx
test   %rax,%rax
jne    115a <is_hexdigit+0x3a>
mov    %ebp,%edi
call   1030 <lowercase@plt>
ucomiss 0xebe(%rip),%xmm0
jb     1158 <is_hexdigit+0x38>
mov    %ebp,%edi
call   1030 <lowercase@plt>
movss  0xeb1(%rip),%xmm1
ucomiss %xmm0,%xmm1
jae    115a <is_hexdigit+0x3a>
xor    %ebx,%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @is_hexdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = call i64 @is_digit(i32 %4)
%6 = icmp ne i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %19
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call float @lowercase(i32 %9)
%11 = fcmp oge float %10, 9.700000e+01
br i1 %11, label %12, label %17
12: ; preds = %8
%13 = load i32, i32* %3
%14 = call float @lowercase(i32 %13)
%15 = fcmp ole float %14, 1.020000e+02
br i1 %15, label %16, label %17
16: ; preds = %12
store i32 1, i32* %2
br label %19
17: ; preds = %12, %8
br label %18
18: ; preds = %17
store i32 0, i32* %2
br label %19
19: ; preds = %18, %16, %7
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
define i32 @is_hexdigit(i32 %0) {
%2 = tail call i64 @is_digit(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = tail call float @lowercase(i32 %0)
%6 = fcmp ult float %5, 9.700000e+01
br i1 %6, label %10, label %7
7: ; preds = %4
%8 = tail call float @lowercase(i32 %0)
%9 = fcmp ugt float %8, 1.020000e+02
br i1 %9, label %10, label %11
10: ; preds = %4, %7
br label %11
11: ; preds = %7, %1, %10
%12 = phi i32 [ 0, %10 ], [ 1, %1 ], [ 1, %7 ]
ret i32 %12
}
int multiple(int i, int j) { return (j % i == 0); }


x86 assembly (clang, -O0):
<multiple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
cmp    $0x0,%edx
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiple>:
mov    %esi,%eax
cltd
idiv   %edi
xor    %eax,%eax
test   %edx,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @multiple(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 = srem i32 %5, %6
%8 = icmp eq i32 %7, 0
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @multiple(i32 %0, i32 %1) {
%3 = srem i32 %1, %0
%4 = icmp eq i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ count_down();
int main() {
  count_down();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @count_down()
ret i32 0
}
const char *fpp_config_get_default_plugin_version(void) { return "13.1.2.3"; }


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

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

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

LLVM IR (-O2):
@.str = [9 x i8] c"13.1.2.3\00"
define i8* @fpp_config_get_default_plugin_version() {
ret i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0)
}
int first() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @first() {
ret i32 0
}
/* Variables and functions */
int cmp_int(void const *, void const *);
int cmp_int_desc(const void *a, const void *b) { return cmp_int(b, a); }


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

x86 assembly (clang, -O2):
<cmp_int_desc>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <cmp_int@plt>

LLVM IR (-O0):
define i32 @cmp_int_desc(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 = load i8*, i8** %3
%7 = call i32 @cmp_int(i8* %5, i8* %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @cmp_int_desc(i8* %0, i8* %1) {
%3 = tail call i32 @cmp_int(i8* %1, i8* %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ sleep(int);
void xsoPart3() {
  sleep(1);
  printf("%s\n", "xsoPart3");
}


x86 assembly (clang, -O0):
<xsoPart3>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xecb(%rip),%rdi
lea    0xec8(%rip),%rsi
call   1030 <printf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<xsoPart3>:
push   %rax
mov    $0x1,%edi
call   1040 <sleep@plt>
lea    0xece(%rip),%rdi
lea    0xecb(%rip),%rsi
pop    %rax
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [9 x i8] c"xsoPart3\00"
define void @xsoPart3() {
%1 = tail call i32 @sleep(i32 1)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int get_clcadc1(int, int, int *);
int /*<<< orphan*/ printf(char *, int, int, int, int, int);
void print_clcadc1(int a, int b, int mask) {
  int f, r;
  f = get_clcadc1(a, b, &r);
  f &= mask;
  printf("clcadc"
         " 1"
         " %08x %08x %08x %08x %08x\n",
         a, b, r, f, mask);
}


x86 assembly (clang, -O0):
<print_clcadc1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
lea    -0x14(%rbp),%rdx
call   1040 <get_clcadc1@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%r8d
mov    -0xc(%rbp),%r9d
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_clcadc1>:
push   %rbp
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
lea    0xc(%rsp),%rdx
call   1040 <get_clcadc1@plt>
and    %r14d,%eax
mov    0xc(%rsp),%ecx
lea    0xeb9(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    %eax,%r8d
mov    %r14d,%r9d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [35 x i8] c"clcadc 1 %08x %08x %08x %08x %08x\0A\00"
define void @print_clcadc1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @get_clcadc1(i32 %9, i32 %10, i32* %8)
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32, i32* %7
%14 = and i32 %13, %12
store i32 %14, i32* %7
%15 = load i32, i32* %4
%16 = load i32, i32* %5
%17 = load i32, i32* %8
%18 = load i32, i32* %7
%19 = load i32, i32* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %15, i32 %16, i32 %17, i32 %18, i32 %19)
ret void
}

LLVM IR (-O2):
@.str = [35 x i8] c"clcadc 1 %08x %08x %08x %08x %08x\0A\00"
define void @print_clcadc1(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = call i32 @get_clcadc1(i32 %0, i32 %1, i32* %4)
%7 = and i32 %6, %2
%8 = load i32, i32* %4
%9 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %8, i32 %7, i32 %2)
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
char *strerror(int /*<<< orphan*/);
int fd_close(int fd) {
  if (fd >= 0 && close(fd) == -1) {
    fprintf(stderr, "%s\n", strerror(errno));
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fd_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jl     118e <fd_close+0x5e>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    118e <fd_close+0x5e>
mov    0x2e83(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    0x2e6f(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rdx
lea    0xe83(%rip),%rsi
call   1040 <fprintf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1195 <fd_close+0x65>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fd_close>:
push   %rbx
xor    %ebx,%ebx
test   %edi,%edi
js     116e <fd_close+0x3e>
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    116e <fd_close+0x3e>
mov    0x2e98(%rip),%rax
mov    (%rax),%ebx
mov    0x2e87(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xea1(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
call   1040 <fprintf@plt>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@errno = global i32 0
define i32 @fd_close(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 0
br i1 %5, label %6, label %15
6: ; preds = %1
%7 = load i32, i32* %3
%8 = call i32 @close(i32 %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %15
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = load i32, i32* @errno
%13 = call i8* @strerror(i32 %12)
%14 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %13)
store i32 -1, i32* %2
br label %16
15: ; preds = %6, %1
store i32 0, i32* %2
br label %16
16: ; preds = %15, %10
%17 = load i32, i32* %2
ret i32 %17
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
@errno = global i32 0
define i32 @fd_close(i32 %0) {
%2 = icmp sgt i32 %0, -1
br i1 %2, label %3, label %11
3: ; preds = %1
%4 = tail call i32 @close(i32 %0)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = load i32, i32* @stderr
%8 = load i32, i32* @errno
%9 = tail call i8* @strerror(i32 %8)
%10 = tail call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %9)
br label %11
11: ; preds = %1, %3, %6
%12 = phi i32 [ -1, %6 ], [ 0, %3 ], [ 0, %1 ]
ret i32 %12
}
int test8(int o, int p) { return o & (p | o); }


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

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

LLVM IR (-O0):
define i32 @test8(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 = load i32, i32* %3
%8 = or i32 %6, %7
%9 = and i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test8(i32 returned %0, i32 %1) {
ret i32 %0
}
unsigned int ts_hash(const char *key, unsigned int prime) {
  unsigned int hidx = 0;
  int c = 0;
  while (0 != (c = *key++)) {
    hidx = c + (hidx << 6) + (hidx << 16) - hidx;
  }
  return (hidx % prime);
}


x86 assembly (clang, -O0):
<ts_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%ecx
mov    %ecx,-0x14(%rbp)
xor    %eax,%eax
cmp    %ecx,%eax
je     1156 <ts_hash+0x56>
mov    -0x14(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    $0x6,%ecx
add    %ecx,%eax
mov    -0x10(%rbp),%ecx
shl    $0x10,%ecx
add    %ecx,%eax
sub    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
jmp    1119 <ts_hash+0x19>
mov    -0x10(%rbp),%eax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <ts_hash+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
imul   $0x1003f,%eax,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ts_hash+0x10>
jmp    112a <ts_hash+0x2a>
xor    %eax,%eax
xor    %edx,%edx
div    %esi
mov    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @ts_hash(i8* nocapture %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i32 [ %12, %5 ], [ 0, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = mul i32 %7, 65599
%12 = add i32 %11, %9
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i32 [ 0, %2 ], [ %12, %5 ]
%17 = urem i32 %16, %1
ret i32 %17
}
int test_20(signed char x, int y, int z) { return ((x << 1) & 0x0F) != 0; }


x86 assembly (clang, -O0):
<test_20>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movsbl -0x1(%rbp),%eax
shl    $0x1,%eax
and    $0xf,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_20>:
xor    %eax,%eax
test   $0x7,%dil
setne  %al
ret

LLVM IR (-O0):
define i32 @test_20(i8 signext %0, i32 %1, i32 %2) {
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
store i8 %0, i8* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i8, i8* %4
%8 = sext i8 %7 to i32
%9 = shl i32 %8, 1
%10 = and i32 %9, 15
%11 = icmp ne i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test_20(i8 signext %0, i32 %1, i32 %2) {
%4 = and i8 %0, 7
%5 = icmp ne i8 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
unsigned long genrand_int32();
unsigned long genrand(void) { return genrand_int32(); }


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

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

LLVM IR (-O0):
define i64 @genrand() {
%1 = call i64 (...) @genrand_int32()
ret i64 %1
}

LLVM IR (-O2):
define i64 @genrand() {
%1 = tail call i64 (...) @genrand_int32()
ret i64 %1
}
void test_40_0(char *mem) { __atomic_xor_fetch(mem, -1, 4); }


x86 assembly (clang, -O0):
<test_40_0>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
movb   $0xff,-0x9(%rbp)
mov    -0x9(%rbp),%cl
mov    %cl,-0xc(%rbp)
mov    (%rax),%al
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%al
mov    -0x18(%rbp),%rcx
mov    -0xc(%rbp),%sil
mov    %al,%dl
xor    %sil,%dl
lock cmpxchg %dl,(%rcx)
sete   %cl
mov    %al,-0x19(%rbp)
test   $0x1,%cl
mov    %al,-0xb(%rbp)
jne    114a <test_40_0+0x4a>
jmp    111f <test_40_0+0x1f>
mov    -0xc(%rbp),%cl
mov    -0x19(%rbp),%al
xor    %cl,%al
mov    %al,-0xa(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_40_0>:
lock xorb $0xff,(%rdi)
ret

LLVM IR (-O0):
define void @test_40_0(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i8
store i8* %0, i8** %2
%5 = load i8*, i8** %2
store i8 -1, i8* %3
%6 = load i8, i8* %3
%7 = atomicrmw xor i8* %5, i8 %6 acq_rel
%8 = xor i8 %7, %6
store i8 %8, i8* %4
%9 = load i8, i8* %4
ret void
}

LLVM IR (-O2):
define void @test_40_0(i8* nocapture %0) {
%2 = atomicrmw xor i8* %0, i8 -1 acq_rel
ret void
}
/* Variables and functions */
int is_prime(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int n;
  printf("Enter an integer.\n");
  scanf("%d", &n);
  if (n < 1)
    return -1;
  printf("%d", is_prime(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xebf(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
cmpl   $0x1,-0x8(%rbp)
jge    1173 <main+0x43>
movl   $0xffffffff,-0x4(%rbp)
jmp    1192 <main+0x62>
mov    -0x8(%rbp),%edi
call   1040 <is_prime@plt>
mov    %eax,%esi
lea    0xe8f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xeb7(%rip),%rdi
call   1030 <puts@plt>
lea    0xea8(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1060 <scanf@plt>
mov    0xc(%rsp),%edi
test   %edi,%edi
jle    1183 <main+0x43>
call   1050 <is_prime@plt>
lea    0xe8a(%rip),%rdi
xor    %ebx,%ebx
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1188 <main+0x48>
mov    $0xffffffff,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"Enter an integer.\0A\00"
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 -1, i32* %1
br label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = call i32 @is_prime(i32 %9)
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %10)
store i32 0, i32* %1
br label %12
12: ; preds = %8, %7
%13 = load i32, i32* %1
ret i32 %13
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@str = [18 x i8] c"Enter an integer.\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = icmp slt i32 %5, 1
br i1 %6, label %10, label %7
7: ; preds = %0
%8 = call i32 @is_prime(i32 %5)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %8)
br label %10
10: ; preds = %0, %7
%11 = phi i32 [ 0, %7 ], [ -1, %0 ]
ret i32 %11
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *sink_realloc(void *, size_t);
int /*<<< orphan*/ stderr;
void *sink_realloc_safe(void *p, size_t s) {
  p = sink_realloc(p, s);
  if (p == NULL) {
    fprintf(stderr, "Out of memory!\n");
    exit(1);
  }
  return p;
}


x86 assembly (clang, -O0):
<sink_realloc_safe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <sink_realloc@plt>
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    117b <sink_realloc_safe+0x4b>
mov    0x2e7d(%rip),%rax
mov    (%rax),%edi
lea    0xe94(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sink_realloc_safe>:
push   %rax
call   1050 <sink_realloc@plt>
test   %rax,%rax
je     113d <sink_realloc_safe+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @sink_realloc_safe(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
%5 = load i8*, i8** %3
%6 = load i64, i64* %4
%7 = call i8* @sink_realloc(i8* %5, i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = icmp eq i8* %8, null
br i1 %9, label %10, label %14
10: ; preds = %2
%11 = load i32, i32* @stderr
%12 = call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%13 = call i32 @exit(i32 1)
unreachable
14: ; preds = %2
%15 = load i8*, i8** %3
ret i8* %15
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"Out of memory!\0A\00"
define i8* @sink_realloc_safe(i8* %0, i64 %1) {
%3 = tail call i8* @sink_realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0))
%8 = tail call i32 @exit(i32 1)
unreachable
9: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int getRandomNumber(void) {
  static int i = 0;
  if (i == 0) {
    srand(time(NULL));
    i = 1;
  }
  return rand();
}


x86 assembly (clang, -O0):
<getRandomNumber>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f01(%rip)
jne    115b <getRandomNumber+0x2b>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movl   $0x1,0x2ee1(%rip)
mov    $0x0,%al
call   1050 <rand@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRandomNumber>:
push   %rax
cmpb   $0x0,0x2f04(%rip)
jne    114f <getRandomNumber+0x1f>
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
movb   $0x1,0x2eed(%rip)
xor    %eax,%eax
pop    %rcx
jmp    1050 <rand@plt>

LLVM IR (-O0):
@getRandomNumber.i = internal global i32 0
define i32 @getRandomNumber() {
%1 = load i32, i32* @getRandomNumber.i
%2 = icmp eq i32 %1, 0
br i1 %2, label %3, label %6
3: ; preds = %0
%4 = call i32 @time(i32* null)
%5 = call i32 @srand(i32 %4)
store i32 1, i32* @getRandomNumber.i
br label %6
6: ; preds = %3, %0
%7 = call i32 (...) @rand()
ret i32 %7
}

LLVM IR (-O2):
@getRandomNumber.i = internal unnamed_addr global i1 false
define i32 @getRandomNumber() {
%1 = load i1, i1* @getRandomNumber.i
br i1 %1, label %5, label %2
2: ; preds = %0
%3 = tail call i32 @time(i32* null)
%4 = tail call i32 @srand(i32 %3)
store i1 true, i1* @getRandomNumber.i
br label %5
5: ; preds = %2, %0
%6 = tail call i32 (...) @rand()
ret i32 %6
}
void instruc_20() {}


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

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

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

LLVM IR (-O2):
define void @instruc_20() {
ret void
}
/* Variables and functions */
void *memcpy(int /*<<< orphan*/, void const *, size_t);
int /*<<< orphan*/ util_malloc(size_t);
void *iof_copy_data(const void *data, size_t size) {
  return memcpy(util_malloc(size), data, size);
}


x86 assembly (clang, -O0):
<iof_copy_data>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <util_malloc@plt>
mov    %eax,%edi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iof_copy_data>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1040 <util_malloc@plt>
mov    %eax,%edi
mov    %r14,%rsi
mov    %rbx,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define i8* @iof_copy_data(i8* %0, i64 %1) {
%3 = tail call i32 @util_malloc(i64 %1)
%4 = tail call i8* @memcpy(i32 %3, i8* %0, i64 %1)
ret i8* %4
}
/* Variables and functions */
int omp_get_thread_num();
int /*<<< orphan*/ printf(char *, int);
void functionB(void) {
  int b = omp_get_thread_num();
  printf("This is function B!  Executed by Core %d\n", b);
}


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

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

LLVM IR (-O0):
@.str = [42 x i8] c"This is function B! Executed by Core %d\0A\00"
define void @functionB() {
%1 = alloca i32
%2 = call i32 (...) @omp_get_thread_num()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"This is function B! Executed by Core %d\0A\00"
define void @functionB() {
%1 = tail call i32 (...) @omp_get_thread_num()
%2 = tail call i32 @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
void TMTimerSetMicro(void) {}


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

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

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

LLVM IR (-O2):
define void @TMTimerSetMicro() {
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
typedef int uint32_t;
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct ip {
  TYPE_1__ ip_dst;
};
typedef int /*<<< orphan*/ addr;

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int *, int /*<<< orphan*/ *, int);
int IsMulticastv4(struct ip *hdr) {
  uint32_t addr;
  assert(hdr != NULL);
  memcpy(&addr, &hdr->ip_dst.s_addr, sizeof(addr));
  if ((addr & 0xE0000000) == 0xE0000000)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<IsMulticastv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rsi
lea    -0x14(%rbp),%rdi
mov    $0x4,%edx
call   1040 <memcpy@plt>
mov    -0x14(%rbp),%eax
and    $0xe0000000,%eax
cmp    $0xe0000000,%eax
jne    116f <IsMulticastv4+0x4f>
movl   $0x1,-0x4(%rbp)
jmp    1176 <IsMulticastv4+0x56>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IsMulticastv4>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
lea    0xc(%rsp),%rdi
mov    %rbx,%rsi
mov    $0x4,%edx
call   1040 <memcpy@plt>
xor    %eax,%eax
cmpl   $0xe0000000,0xc(%rsp)
e0
setae  %al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.ip = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i32 @IsMulticastv4(%struct.ip* %0) {
%2 = alloca i32
%3 = alloca %struct.ip*
%4 = alloca i32
store %struct.ip* %0, %struct.ip** %3
%5 = load %struct.ip*, %struct.ip** %3
%6 = icmp ne %struct.ip* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.ip*, %struct.ip** %3
%10 = getelementptr inbounds %struct.ip, %struct.ip* %9, i32 0, i32 0
%11 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %10, i32 0, i32 0
%12 = call i32 @memcpy(i32* %4, i32* %11, i32 4)
%13 = load i32, i32* %4
%14 = and i32 %13, -536870912
%15 = icmp eq i32 %14, -536870912
br i1 %15, label %16, label %17
16: ; preds = %1
store i32 1, i32* %2
br label %18
17: ; preds = %1
store i32 0, i32* %2
br label %18
18: ; preds = %17, %16
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
%struct.ip = type { %struct.TYPE_2__ }
%struct.TYPE_2__ = type { i32 }
define i32 @IsMulticastv4(%struct.ip* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = icmp ne %struct.ip* %0, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = getelementptr inbounds %struct.ip, %struct.ip* %0, i64 0, i32 0, i32 0
%8 = call i32 @memcpy(i32* %2, i32* %7, i32 4)
%9 = load i32, i32* %2
%10 = icmp ugt i32 %9, -536870913
%11 = zext i1 %10 to i32
ret i32 %11
}
char *XServerVendor() {}


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

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

LLVM IR (-O0):
define i8* @XServerVendor() {
%1 = alloca i8*
%2 = load i8*, i8** %1
ret i8* %2
}

LLVM IR (-O2):
define noalias i8* @XServerVendor() {
ret i8* undef
}
int in16s(unsigned short port, int count, unsigned char *buf) {
  __asm__ volatile("rep insw"
                   : "=c"(count), "=D"(buf)
                   : "d"(port), "0"(count), "1"(buf)
                   : "memory");
  return 1;
}


x86 assembly (clang, -O0):
<in16s>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rdi
rep insw (%dx),%es:(%rdi)
mov    %ecx,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<in16s>:
mov    %rdx,%rax
mov    %esi,%ecx
mov    %edi,%edx
mov    %rax,%rdi
rep insw (%dx),%es:(%rdi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @in16s(i16 zeroext %0, i32 %1, i8* %2) {
%4 = alloca i16
%5 = alloca i32
%6 = alloca i8*
store i16 %0, i16* %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i16, i16* %4
%8 = load i32, i32* %5
%9 = load i8*, i8** %6
%10 = call { i32, i8* } asm sideeffect "rep insw", "={cx},={di},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i16 %7, i32 %8, i8* %9)
%11 = extractvalue { i32, i8* } %10, 0
%12 = extractvalue { i32, i8* } %10, 1
store i32 %11, i32* %5
store i8* %12, i8** %6
ret i32 1
}

LLVM IR (-O2):
define i32 @in16s(i16 zeroext %0, i32 %1, i8* %2) {
%4 = tail call { i32, i8* } asm sideeffect "rep insw", "={cx},={di},{dx},0,1,~{memory},~{dirflag},~{fpsr},~{flags}"(i16 %0, i32 %1, i8* %2)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void *realloc(void *, size_t);
void *l_alloc(void *ud, void *ptr, size_t osize, size_t nsize,
              const char *allocName, unsigned int flags) {
  (void)allocName;
  (void)flags;
  (void)ud;
  (void)osize;
  if (nsize == 0) {
    free(ptr);
    return NULL;
  } else
    return realloc(ptr, nsize);
}


x86 assembly (clang, -O0):
<l_alloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9d,-0x34(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    1161 <l_alloc+0x41>
mov    -0x18(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x8(%rbp)
jmp    1172 <l_alloc+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1040 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<l_alloc>:
mov    %rsi,%rdi
test   %rcx,%rcx
je     1130 <l_alloc+0x10>
mov    %rcx,%rsi
jmp    1040 <realloc@plt>
push   %rax
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define noalias i8* @l_alloc(i8* nocapture readnone %0, i8* nocapture %1, i64 %2, i64 %3, i8* nocapture readnone %4, i32 %5) {
%7 = icmp eq i64 %3, 0
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = tail call i32 @free(i8* %1)
br label %12
10: ; preds = %6
%11 = tail call i8* @realloc(i8* %1, i64 %3)
br label %12
12: ; preds = %10, %8
%13 = phi i8* [ null, %8 ], [ %11, %10 ]
ret i8* %13
}
/* Type definitions */
struct sched_param {
  int sched_priority;
};

/* Variables and functions */
int /*<<< orphan*/ SCHED_FIFO;
int /*<<< orphan*/ assert(int);
int sched_setscheduler(int /*<<< orphan*/, int /*<<< orphan*/,
                       struct sched_param *);
int main() {
  struct sched_param s;
  s.sched_priority = 99;
  int ret = sched_setscheduler(0, SCHED_FIFO, &s);
  assert(ret != -1);
  while (1) {
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x63,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%esi
xor    %edi,%edi
lea    -0x8(%rbp),%rdx
call   1030 <sched_setscheduler@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
jmp    115e <main+0x3e>

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x63,(%rsp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rdx
xor    %edi,%edi
call   1030 <sched_setscheduler@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
setne  %dil
call   1040 <assert@plt>
nopl   0x0(%rax)
jmp    1150 <main+0x30>

LLVM IR (-O0):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sched_param
%3 = alloca i32
store i32 0, i32* %1
%4 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %2, i32 0, i32 0
store i32 99, i32* %4
%5 = load i32, i32* @SCHED_FIFO
%6 = call i32 @sched_setscheduler(i32 0, i32 %5, %struct.sched_param* %2)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = icmp ne i32 %7, -1
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
br label %11
11: ; preds = %0, %11
br label %11
}

LLVM IR (-O2):
%struct.sched_param = type { i32 }
@SCHED_FIFO = global i32 0
define i32 @main() {
%1 = alloca %struct.sched_param
%2 = bitcast %struct.sched_param* %1 to i8*
%3 = getelementptr inbounds %struct.sched_param, %struct.sched_param* %1, i64 0, i32 0
store i32 99, i32* %3
%4 = load i32, i32* @SCHED_FIFO
%5 = call i32 @sched_setscheduler(i32 0, i32 %4, %struct.sched_param* %1)
%6 = icmp ne i32 %5, -1
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
br label %9
9: ; preds = %9, %0
br label %9
}
/* Variables and functions */
int /*<<< orphan*/ turn_led_off_tir(int);
int /*<<< orphan*/ turn_led_on_tir(int);
void switch_red(bool state) {
  if (state) {
    turn_led_on_tir(0x10);
  } else {
    turn_led_off_tir(0x10);
  }
}


x86 assembly (clang, -O0):
<switch_red>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1144 <switch_red+0x24>
mov    $0x10,%edi
call   1030 <turn_led_on_tir@plt>
jmp    114e <switch_red+0x2e>
mov    $0x10,%edi
call   1040 <turn_led_off_tir@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<switch_red>:
test   %edi,%edi
je     112e <switch_red+0xe>
mov    $0x10,%edi
jmp    1030 <turn_led_on_tir@plt>
mov    $0x10,%edi
jmp    1040 <turn_led_off_tir@plt>

LLVM IR (-O0):
define void @switch_red(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @turn_led_on_tir(i32 16)
br label %9
7: ; preds = %1
%8 = call i32 @turn_led_off_tir(i32 16)
br label %9
9: ; preds = %7, %5
ret void
}

LLVM IR (-O2):
define void @switch_red(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @turn_led_on_tir(i32 16)
br label %7
5: ; preds = %1
%6 = tail call i32 @turn_led_off_tir(i32 16)
br label %7
7: ; preds = %5, %3
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ pthread_cond_t;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, int);
int pthread_cond_signal(int /*<<< orphan*/ *);
void d_cond_signal(pthread_cond_t *cond) {
  int rv = pthread_cond_signal(cond);
  if (rv != 0) {
    printf("error: pthread_cond_signal == %d\n", rv);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<d_cond_signal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <pthread_cond_signal@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     116b <d_cond_signal+0x3b>
mov    -0xc(%rbp),%esi
lea    0xea4(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_cond_signal>:
push   %rax
call   1040 <pthread_cond_signal@plt>
test   %eax,%eax
jne    113c <d_cond_signal+0xc>
pop    %rax
ret
lea    0xebd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"error: pthread_cond_signal == %d\0A\00"
define void @d_cond_signal(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = call i32 @pthread_cond_signal(i32* %4)
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"error: pthread_cond_signal == %d\0A\00"
define void @d_cond_signal(i32* %0) {
%2 = tail call i32 @pthread_cond_signal(i32* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %2)
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void usage(char *argv0) {
  fprintf(stderr, "Usage: %s {one or more decimal numbers ...}\n", argv0);
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s {one or more decimal numbers ...}\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [45 x i8] c"Usage: %s {one or more decimal numbers ...}\0A\00"
define void @usage(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}
void nagbar_cleanup(void) {}


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

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

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

LLVM IR (-O2):
define void @nagbar_cleanup() {
ret void
}
void gtk_icon_set_get_type() {}


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

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

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

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