xunge/DecIR huggingface dataset:
long long g2(long long j, unsigned char *b, long long i) { return j + b[i]; }


x86 assembly (clang, -O0):
<g2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g2>:
movzbl (%rsi,%rdx,1),%eax
add    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @g2(i64 %0, i8* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i64 %0, i64* %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = getelementptr inbounds i8, i8* %8, i64 %9
%11 = load i8, i8* %10
%12 = zext i8 %11 to i64
%13 = add nsw i64 %7, %12
ret i64 %13
}

LLVM IR (-O2):
define i64 @g2(i64 %0, i8* nocapture %1, i64 %2) {
%4 = getelementptr inbounds i8, i8* %1, i64 %2
%5 = load i8, i8* %4
%6 = zext i8 %5 to i64
%7 = add nsw i64 %6, %0
ret i64 %7
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ root;
};
struct TYPE_4__ {
  TYPE_1__ xbutton;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
unsigned long get_XEvent_xbutton_root(void *_p) {
  return (unsigned long)((XEvent *)_p)->xbutton.root;
}


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

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

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

LLVM IR (-O2):
define i64 @get_XEvent_xbutton_root(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
ret i64 %3
}
/* Variables and functions */
int v_atomic_fetch_and_add_int(int volatile *, int);
int v_atomic_fetch_and_add_release_int(volatile int *ptr, int value) {
  return v_atomic_fetch_and_add_int(ptr, value);
}


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

x86 assembly (clang, -O2):
<v_atomic_fetch_and_add_release_int>:
jmp    1030 <v_atomic_fetch_and_add_int@plt>

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

LLVM IR (-O2):
define i32 @v_atomic_fetch_and_add_release_int(i32* %0, i32 %1) {
%3 = tail call i32 @v_atomic_fetch_and_add_int(i32* %0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int EXIT_SUCCESS;
int func(int, int *);
int /*<<< orphan*/ printf(char *, int, int, int);
int main(int argc, char **argv) {
  int count = 0;
  int val = 4;
  int fv = func(val, &count);
  printf("f(%d) = %d, count = %d\n", val, fv, count);
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x18(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1040 <func@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%esi
mov    -0x1c(%rbp),%edx
mov    -0x14(%rbp),%ecx
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x4,%edi
call   1040 <func@plt>
mov    0x4(%rsp),%ecx
lea    0xebd(%rip),%rdi
mov    $0x4,%esi
mov    %eax,%edx
call   1030 <printf@plt>
mov    0x2e8a(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"f(%d) = %d, count = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %6
store i32 4, i32* %7
%9 = load i32, i32* %7
%10 = call i32 @func(i32 %9, i32* %6)
store i32 %10, i32* %8
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = load i32, i32* %6
%14 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %13)
%15 = load i32, i32* @EXIT_SUCCESS
ret i32 %15
}

LLVM IR (-O2):
@.str = [24 x i8] c"f(%d) = %d, count = %d\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
store i32 0, i32* %3
%5 = call i32 @func(i32 4, i32* %3)
%6 = load i32, i32* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 4, i32 %5, i32 %6)
%8 = load i32, i32* @EXIT_SUCCESS
ret i32 %8
}
void gensrl() {}


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

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

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

LLVM IR (-O2):
define void @gensrl() {
ret void
}
/* Variables and functions */
int IO_get_le16();
int /*<<< orphan*/ IO_put_byte(char);
int /*<<< orphan*/ IO_put_low_16b_hex(int);
int /*<<< orphan*/ IO_put_string(char *);
void IO_process_load_address(void) {
  int load_address;
  load_address = IO_get_le16();
  IO_put_string("; ToACME: Original source code file had load address $");
  IO_put_low_16b_hex(load_address);
  IO_put_byte('\n');
}


x86 assembly (clang, -O0):
<IO_process_load_address>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <IO_get_le16@plt>
mov    %eax,-0x4(%rbp)
lea    0xea7(%rip),%rdi
call   1030 <IO_put_string@plt>
mov    -0x4(%rbp),%edi
call   1040 <IO_put_low_16b_hex@plt>
mov    $0xa,%edi
call   1050 <IO_put_byte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IO_process_load_address>:
push   %rbx
xor    %eax,%eax
call   1060 <IO_get_le16@plt>
mov    %eax,%ebx
lea    0xeaf(%rip),%rdi
call   1030 <IO_put_string@plt>
mov    %ebx,%edi
call   1040 <IO_put_low_16b_hex@plt>
mov    $0xa,%edi
pop    %rbx
jmp    1050 <IO_put_byte@plt>

LLVM IR (-O0):
@.str = [55 x i8] c"; ToACME: Original source code file had load address $\00"
define void @IO_process_load_address() {
%1 = alloca i32
%2 = call i32 (...) @IO_get_le16()
store i32 %2, i32* %1
%3 = call i32 @IO_put_string(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
%5 = call i32 @IO_put_low_16b_hex(i32 %4)
%6 = call i32 @IO_put_byte(i8 signext 10)
ret void
}

LLVM IR (-O2):
@.str = [55 x i8] c"; ToACME: Original source code file had load address $\00"
define void @IO_process_load_address() {
%1 = tail call i32 (...) @IO_get_le16()
%2 = tail call i32 @IO_put_string(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @IO_put_low_16b_hex(i32 %1)
%4 = tail call i32 @IO_put_byte(i8 signext 10)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __check_printsym_format(char const *, char *);
void print_symbol(const char *fmt, unsigned long addr) {
  __check_printsym_format(fmt, "");
  ;
}


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

x86 assembly (clang, -O2):
<print_symbol>:
lea    0xee9(%rip),%rsi
jmp    1030 <__check_printsym_format@plt>

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @print_symbol(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 = call i32 @__check_printsym_format(i8* %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @print_symbol(i8* %0, i64 %1) {
%3 = tail call i32 @__check_printsym_format(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct iam_leaf {
  int dummy;
};

/* Variables and functions */
int e_keysize(int /*<<< orphan*/);
int /*<<< orphan*/ n_cur(struct iam_leaf const *);
int lvar_key_size(const struct iam_leaf *l) { return e_keysize(n_cur(l)); }


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

x86 assembly (clang, -O2):
<lvar_key_size>:
push   %rax
call   1030 <n_cur@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <e_keysize@plt>

LLVM IR (-O0):
%struct.iam_leaf = type { i32 }
define i32 @lvar_key_size(%struct.iam_leaf* %0) {
%2 = alloca %struct.iam_leaf*
store %struct.iam_leaf* %0, %struct.iam_leaf** %2
%3 = load %struct.iam_leaf*, %struct.iam_leaf** %2
%4 = call i32 @n_cur(%struct.iam_leaf* %3)
%5 = call i32 @e_keysize(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
%struct.iam_leaf = type { i32 }
define i32 @lvar_key_size(%struct.iam_leaf* %0) {
%2 = tail call i32 @n_cur(%struct.iam_leaf* %0)
%3 = tail call i32 @e_keysize(i32 %2)
ret i32 %3
}
OP(ed, f2) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
void local_irq_enable() {}


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

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

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

LLVM IR (-O2):
define void @local_irq_enable() {
ret void
}
int f(int j) { return j + 1; }


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

x86 assembly (clang, -O2):
<f>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @f(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
int binary_decimal(int n) {
  int decimal = 0;
  int i = 0;
  int rem;
  while (n != 0) {
    rem = n % 10;
    n /= 10;
    ++i;
  }
  return decimal;
}


x86 assembly (clang, -O0):
<binary_decimal>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1149 <binary_decimal+0x49>
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <binary_decimal+0x15>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @binary_decimal(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %9, %1
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %16
9: ; preds = %6
%10 = load i32, i32* %2
%11 = srem i32 %10, 10
store i32 %11, i32* %5
%12 = load i32, i32* %2
%13 = sdiv i32 %12, 10
store i32 %13, i32* %2
%14 = load i32, i32* %4
%15 = add nsw i32 %14, 1
store i32 %15, i32* %4
br label %6
16: ; preds = %6
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
define i32 @binary_decimal(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ lookNarray(char *, unsigned int);
void lookreal4array_(char *x, unsigned int *n) { lookNarray(x, (*n * 4)); }


x86 assembly (clang, -O0):
<lookreal4array_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
shl    $0x2,%esi
call   1030 <lookNarray@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lookreal4array_>:
mov    (%rsi),%esi
shl    $0x2,%esi
jmp    1030 <lookNarray@plt>

LLVM IR (-O0):
define void @lookreal4array_(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 = load i32, i32* %6
%8 = mul i32 %7, 4
%9 = call i32 @lookNarray(i8* %5, i32 %8)
ret void
}

LLVM IR (-O2):
define void @lookreal4array_(i8* %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = shl i32 %3, 2
%5 = tail call i32 @lookNarray(i8* %0, i32 %4)
ret void
}
/* Variables and functions */
int compare_version(char *, char *);
int compareVersion(char *version1, char *version2) {
  return compare_version(version1, version2);
}


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

x86 assembly (clang, -O2):
<compareVersion>:
jmp    1030 <compare_version@plt>

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

LLVM IR (-O2):
define i32 @compareVersion(i8* %0, i8* %1) {
%3 = tail call i32 @compare_version(i8* %0, i8* %1)
ret i32 %3
}
int soma(int x, int y) { return x + y; }


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

x86 assembly (clang, -O2):
<soma>:
lea    (%rdi,%rsi,1),%eax
ret

LLVM IR (-O0):
define i32 @soma(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 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @soma(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
ret i32 %3
}
int iwm_debugfs_init(struct iwm_priv *iwm) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.iwm_priv = type opaque
define i32 @iwm_debugfs_init(%struct.iwm_priv* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
double UINT32_MAX;
scalar_t__ ctss_rand();
float ctss_normrandf() {
  return (float)ctss_rand() * (float)(2.0 / UINT32_MAX) - 1.0f;
}


x86 assembly (clang, -O0):
<ctss_normrandf>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <ctss_rand@plt>
cvtsi2ss %rax,%xmm0
movsd  0xee0(%rip),%xmm1
mov    0x2ec9(%rip),%rax
divsd  (%rax),%xmm1
cvtsd2ss %xmm1,%xmm1
mulss  %xmm1,%xmm0
movss  0xebd(%rip),%xmm1
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctss_normrandf>:
push   %rax
xor    %eax,%eax
call   1030 <ctss_rand@plt>
cvtsi2ss %rax,%xmm1
mov    0x2ed4(%rip),%rax
movsd  0xed4(%rip),%xmm0
divsd  (%rax),%xmm0
cvtsd2ss %xmm0,%xmm0
mulss  %xmm1,%xmm0
addss  0xec8(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
@UINT32_MAX = global double 0.000000e+00
define float @ctss_normrandf() {
%1 = call i64 (...) @ctss_rand()
%2 = sitofp i64 %1 to float
%3 = load double, double* @UINT32_MAX
%4 = fdiv double 2.000000e+00, %3
%5 = fptrunc double %4 to float
%6 = call float @llvm.fmuladd.f32(float %2, float %5, float -1.000000e+00)
ret float %6
}

LLVM IR (-O2):
@UINT32_MAX = global double 0.000000e+00
define float @ctss_normrandf() {
%1 = tail call i64 (...) @ctss_rand()
%2 = sitofp i64 %1 to float
%3 = load double, double* @UINT32_MAX
%4 = fdiv double 2.000000e+00, %3
%5 = fptrunc double %4 to float
%6 = tail call float @llvm.fmuladd.f32(float %2, float %5, float -1.000000e+00)
ret float %6
}
void test_no_clause() {
  int i;
#pragma omp distribute parallel for simd
  for (i = 0; i < 16; ++i)
    ;
#pragma omp distribute parallel for simd
  ++i;
}


x86 assembly (clang, -O0):
<test_no_clause>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0x10,-0x4(%rbp)
jge    1128 <test_no_clause+0x28>
jmp    111a <test_no_clause+0x1a>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <test_no_clause+0xb>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @test_no_clause() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 16
br i1 %4, label %5, label %9
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
%10 = load i32, i32* %1
%11 = add nsw i32 %10, 1
store i32 %11, i32* %1
ret void
}

LLVM IR (-O2):
define void @test_no_clause() {
ret void
}
/* Variables and functions */
void foo_alias();
void foo(void) { return foo_alias(); }


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

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

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

LLVM IR (-O2):
define void @foo() {
tail call void (...) @foo_alias()
ret void
}
/* Variables and functions */
int byg_count(char *, char *);
int count_sequences_macsim(char *string) {
  int n = 0;
  n = byg_count("<seq-name>", string);
  if (!n) {
    return -1;
  }
  return n;
}


x86 assembly (clang, -O0):
<count_sequences_macsim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xed2(%rip),%rdi
call   1030 <byg_count@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    114c <count_sequences_macsim+0x3c>
movl   $0xffffffff,-0x4(%rbp)
jmp    1152 <count_sequences_macsim+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<count_sequences_macsim>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <byg_count@plt>
cmp    $0x1,%eax
sbb    %ecx,%ecx
or     %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"<seq-name>\00"
define i32 @count_sequences_macsim(i8* %0) {
%2 = tail call i32 @byg_count(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 -1, i32 %2
ret i32 %4
}
/* Type definitions */
struct mpk_filelist {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ LIST_INIT(struct mpk_filelist *);
int mpk_filelist_init(struct mpk_filelist *list) {
  LIST_INIT(list);
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.mpk_filelist = type { i32 }
define i32 @mpk_filelist_init(%struct.mpk_filelist* %0) {
%2 = tail call i32 @LIST_INIT(%struct.mpk_filelist* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(double *, double *, int);
void matrix3_copy(double ***Y, double ***X, int n, int m, int p) {
  memcpy(Y[0][0], X[0][0], n * m * p * sizeof(double));
}


x86 assembly (clang, -O0):
<matrix3_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%rsi
mov    -0x14(%rbp),%eax
imul   -0x18(%rbp),%eax
imul   -0x1c(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix3_copy>:
mov    (%rdi),%rax
mov    (%rax),%rdi
mov    (%rsi),%rax
mov    (%rax),%rsi
imul   %ecx,%edx
imul   %r8d,%edx
shl    $0x3,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define void @matrix3_copy(double*** %0, double*** %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca double***
%7 = alloca double***
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store double*** %0, double**** %6
store double*** %1, double**** %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load double***, double**** %6
%12 = getelementptr inbounds double**, double*** %11, i64 0
%13 = load double**, double*** %12
%14 = getelementptr inbounds double*, double** %13, i64 0
%15 = load double*, double** %14
%16 = load double***, double**** %7
%17 = getelementptr inbounds double**, double*** %16, i64 0
%18 = load double**, double*** %17
%19 = getelementptr inbounds double*, double** %18, i64 0
%20 = load double*, double** %19
%21 = load i32, i32* %8
%22 = load i32, i32* %9
%23 = mul nsw i32 %21, %22
%24 = load i32, i32* %10
%25 = mul nsw i32 %23, %24
%26 = sext i32 %25 to i64
%27 = mul i64 %26, 8
%28 = trunc i64 %27 to i32
%29 = call i32 @memcpy(double* %15, double* %20, i32 %28)
ret void
}

LLVM IR (-O2):
define void @matrix3_copy(double*** nocapture %0, double*** nocapture %1, i32 %2, i32 %3, i32 %4) {
%6 = load double**, double*** %0
%7 = load double*, double** %6
%8 = load double**, double*** %1
%9 = load double*, double** %8
%10 = shl i32 %2, 3
%11 = mul i32 %10, %3
%12 = mul i32 %11, %4
%13 = tail call i32 @memcpy(double* %7, double* %9, i32 %12)
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ pexit(char *);
void safeClose(int fd) {
  if (close(fd) == -1) {
    pexit("close");
  }
}


x86 assembly (clang, -O0):
<safeClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1148 <safeClose+0x28>
lea    0xebd(%rip),%rdi
call   1040 <pexit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safeClose>:
push   %rax
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     112d <safeClose+0xd>
pop    %rax
ret
lea    0xecc(%rip),%rdi
pop    %rax
jmp    1040 <pexit@plt>

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

LLVM IR (-O2):
@.str = [6 x i8] c"close\00"
define void @safeClose(i32 %0) {
%2 = tail call i32 @close(i32 %0)
%3 = icmp eq i32 %2, -1
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pexit(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __tracing_path_set(char *, char const *);
char *tracefs__mount();
const char *tracing_path_tracefs_mount(void) {
  const char *mnt;
  mnt = tracefs__mount();
  if (!mnt)
    return NULL;
  __tracing_path_set("", mnt);
  return mnt;
}


x86 assembly (clang, -O0):
<tracing_path_tracefs_mount>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <tracefs__mount@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    114b <tracing_path_tracefs_mount+0x2b>
movq   $0x0,-0x8(%rbp)
jmp    1163 <tracing_path_tracefs_mount+0x43>
mov    -0x10(%rbp),%rsi
lea    0xeaa(%rip),%rdi
call   1040 <__tracing_path_set@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tracing_path_tracefs_mount>:
push   %rbx
xor    %eax,%eax
call   1030 <tracefs__mount@plt>
mov    %rax,%rbx
test   %rax,%rax
je     113f <tracing_path_tracefs_mount+0x1f>
lea    0xec9(%rip),%rdi
mov    %rbx,%rsi
call   1040 <__tracing_path_set@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i8* @tracing_path_tracefs_mount() {
%1 = alloca i8*
%2 = alloca i8*
%3 = call i8* (...) @tracefs__mount()
store i8* %3, i8** %2
%4 = load i8*, i8** %2
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %0
store i8* null, i8** %1
br label %11
7: ; preds = %0
%8 = load i8*, i8** %2
%9 = call i32 @__tracing_path_set(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %8)
%10 = load i8*, i8** %2
store i8* %10, i8** %1
br label %11
11: ; preds = %7, %6
%12 = load i8*, i8** %1
ret i8* %12
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i8* @tracing_path_tracefs_mount() {
%1 = tail call i8* (...) @tracefs__mount()
%2 = icmp eq i8* %1, null
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 @__tracing_path_set(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %5
5: ; preds = %0, %3
ret i8* %1
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
bool UARTCharPutNonBlocking(uint32_t ui32Base, unsigned char ucData) {
  ;
  if (!((*((volatile uint32_t *)(ui32Base + 0x00000018))) & 0x00000020)) {
    (*((volatile uint32_t *)(ui32Base + 0x00000000))) = ucData;
    return (true);
  } else {
    return (false);
  }
}


x86 assembly (clang, -O0):
<UARTCharPutNonBlocking>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
add    $0x18,%eax
cltq
mov    (%rax),%eax
and    $0x20,%eax
cmp    $0x0,%eax
jne    113d <UARTCharPutNonBlocking+0x3d>
movzbl -0x9(%rbp),%ecx
mov    -0x8(%rbp),%eax
add    $0x0,%eax
cltq
mov    %ecx,(%rax)
movl   $0x1,-0x4(%rbp)
jmp    1144 <UARTCharPutNonBlocking+0x44>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<UARTCharPutNonBlocking>:
movslq %edi,%rcx
xor    %eax,%eax
testl  $0x20,0x18(%rcx)
jne    1119 <UARTCharPutNonBlocking+0x19>
movzbl %sil,%eax
mov    %eax,(%rcx)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @UARTCharPutNonBlocking(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8
store i32 %0, i32* %4
store i8 %1, i8* %5
%6 = load i32, i32* %4
%7 = add nsw i32 %6, 24
%8 = sext i32 %7 to i64
%9 = inttoptr i64 %8 to i32*
%10 = load volatile i32, i32* %9
%11 = and i32 %10, 32
%12 = icmp ne i32 %11, 0
br i1 %12, label %20, label %13
13: ; preds = %2
%14 = load i8, i8* %5
%15 = zext i8 %14 to i32
%16 = load i32, i32* %4
%17 = add nsw i32 %16, 0
%18 = sext i32 %17 to i64
%19 = inttoptr i64 %18 to i32*
store volatile i32 %15, i32* %19
store i32 1, i32* %3
br label %21
20: ; preds = %2
store i32 0, i32* %3
br label %21
21: ; preds = %20, %13
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @UARTCharPutNonBlocking(i32 %0, i8 zeroext %1) {
%3 = add nsw i32 %0, 24
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to i32*
%6 = load volatile i32, i32* %5
%7 = and i32 %6, 32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = zext i8 %1 to i32
%11 = sext i32 %0 to i64
%12 = inttoptr i64 %11 to i32*
store volatile i32 %10, i32* %12
br label %13
13: ; preds = %2, %9
%14 = phi i32 [ 1, %9 ], [ 0, %2 ]
ret i32 %14
}
void f3() {
  int f3_a = 2;
  float f3_b[2];
#pragma acc data copyin(f3_a) copyout(f3_b)
  {
#pragma acc kernels default(present)
    { f3_b[0] = f3_a; }
#pragma acc parallel default(present)
    { f3_b[0] = f3_a; }
  }
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
movl   $0x2,-0x4(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @f3() {
%1 = alloca i32
%2 = alloca [2 x float]
store i32 2, i32* %1
%3 = load i32, i32* %1
%4 = sitofp i32 %3 to float
%5 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %4, float* %5
%6 = load i32, i32* %1
%7 = sitofp i32 %6 to float
%8 = getelementptr inbounds [2 x float], [2 x float]* %2, i64 0, i64 0
store float %7, float* %8
ret void
}

LLVM IR (-O2):
define void @f3() {
ret void
}
/* Type definitions */
struct termios {
  int c_cflag;
};
typedef int speed_t;

/* Variables and functions */
int CBAUD;
speed_t cfgetispeed(const struct termios *p) { return p->c_cflag & CBAUD; }


x86 assembly (clang, -O0):
<cfgetispeed>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    0x2ec3(%rip),%rcx
and    (%rcx),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cfgetispeed>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
and    (%rdi),%eax
ret

LLVM IR (-O0):
%struct.termios = type { i32 }
@CBAUD = global i32 0
define i32 @cfgetispeed(%struct.termios* %0) {
%2 = alloca %struct.termios*
store %struct.termios* %0, %struct.termios** %2
%3 = load %struct.termios*, %struct.termios** %2
%4 = getelementptr inbounds %struct.termios, %struct.termios* %3, i32 0, i32 0
%5 = load i32, i32* %4
%6 = load i32, i32* @CBAUD
%7 = and i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
%struct.termios = type { i32 }
@CBAUD = global i32 0
define i32 @cfgetispeed(%struct.termios* nocapture %0) {
%2 = getelementptr inbounds %struct.termios, %struct.termios* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = load i32, i32* @CBAUD
%5 = and i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
struct zbuf {
  int dummy;
};

/* Variables and functions */
scalar_t__ __zbuf_push(struct zbuf *, int, int);
int /*<<< orphan*/ htobe32(int /*<<< orphan*/);
void zbuf_put_be32(struct zbuf *zb, uint32_t val) {
  struct unaligned32 {
    uint32_t value;
  } __attribute__((packed));
  struct unaligned32 *v =
      ((struct unaligned32 *)__zbuf_push(zb, sizeof(struct unaligned32), 1));
  if (v)
    v->value = htobe32(val);
}


x86 assembly (clang, -O0):
<zbuf_put_be32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <__zbuf_push@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1161 <zbuf_put_be32+0x41>
mov    -0xc(%rbp),%edi
call   1030 <htobe32@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zbuf_put_be32>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    $0x4,%esi
mov    $0x1,%edx
call   1040 <__zbuf_push@plt>
test   %rax,%rax
je     1145 <zbuf_put_be32+0x25>
mov    %rax,%rbx
mov    %ebp,%edi
call   1030 <htobe32@plt>
mov    %eax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
%struct.zbuf = type { i32 }
%struct.unaligned32 = type { i32 }
define void @zbuf_put_be32(%struct.zbuf* %0, i32 %1) {
%3 = alloca %struct.zbuf*
%4 = alloca i32
%5 = alloca %struct.unaligned32*
store %struct.zbuf* %0, %struct.zbuf** %3
store i32 %1, i32* %4
%6 = load %struct.zbuf*, %struct.zbuf** %3
%7 = call i64 @__zbuf_push(%struct.zbuf* %6, i32 4, i32 1)
%8 = inttoptr i64 %7 to %struct.unaligned32*
store %struct.unaligned32* %8, %struct.unaligned32** %5
%9 = load %struct.unaligned32*, %struct.unaligned32** %5
%10 = icmp ne %struct.unaligned32* %9, null
br i1 %10, label %11, label %16
11: ; preds = %2
%12 = load i32, i32* %4
%13 = call i32 @htobe32(i32 %12)
%14 = load %struct.unaligned32*, %struct.unaligned32** %5
%15 = getelementptr inbounds %struct.unaligned32, %struct.unaligned32* %14, i32 0, i32 0
store i32 %13, i32* %15
br label %16
16: ; preds = %11, %2
ret void
}

LLVM IR (-O2):
%struct.zbuf = type { i32 }
%struct.unaligned32 = type { i32 }
define void @zbuf_put_be32(%struct.zbuf* %0, i32 %1) {
%3 = tail call i64 @__zbuf_push(%struct.zbuf* %0, i32 4, i32 1)
%4 = icmp eq i64 %3, 0
br i1 %4, label %9, label %5
5: ; preds = %2
%6 = inttoptr i64 %3 to %struct.unaligned32*
%7 = tail call i32 @htobe32(i32 %1)
%8 = getelementptr inbounds %struct.unaligned32, %struct.unaligned32* %6, i64 0, i32 0
store i32 %7, i32* %8
br label %9
9: ; preds = %5, %2
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  scalar_t__ x;
};
typedef TYPE_1__ XConfigureRequestEvent;

/* Variables and functions */
int get_XConfigureRequestEvent_x(void *_p) {
  return (int)((XConfigureRequestEvent *)_p)->x;
}


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

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

LLVM IR (-O0):
%struct.TYPE_2__ = type { i64 }
define i32 @get_XConfigureRequestEvent_x(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_2__*
%5 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %4, i32 0, i32 0
%6 = load i64, i64* %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @get_XConfigureRequestEvent_x(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
void(clear_bit)(int nr, unsigned long volatile *addr) {
  {
    ;
    return;
  }
}


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

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

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

LLVM IR (-O2):
define void @clear_bit(i32 %0, i64* nocapture %1) {
ret void
}
void outsw(unsigned short port, const void *addr, unsigned long count) {
  __asm__ __volatile__("cld ; rep ; outs"
                       "w"
                       : "=S"(addr), "=c"(count)
                       : "d"(port), "0"(addr), "1"(count));
}


x86 assembly (clang, -O0):
<outsw>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x2(%rbp),%dx
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rcx
cld
rep outsw %ds:(%rsi),(%dx)
mov    %rsi,-0x10(%rbp)
mov    %rcx,-0x18(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<outsw>:
mov    %rdx,%rcx
mov    %edi,%edx
cld
rep outsw %ds:(%rsi),(%dx)
ret

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

LLVM IR (-O2):
define void @outsw(i16 zeroext %0, i8* %1, i64 %2) {
%4 = tail call { i8*, i64 } asm sideeffect "cld ; rep ; outsw", "={si},={cx},{dx},0,1,~{dirflag},~{fpsr},~{flags}"(i16 %0, i8* %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ latest_prune_join(int *, int);
void call_latest_prune_join_1_Good() {
  int a[5];
  latest_prune_join(a, 3);
}


x86 assembly (clang, -O0):
<call_latest_prune_join_1_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x20(%rbp),%rdi
mov    $0x3,%esi
call   1030 <latest_prune_join@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<call_latest_prune_join_1_Good>:
sub    $0x18,%rsp
mov    %rsp,%rdi
mov    $0x3,%esi
call   1030 <latest_prune_join@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @call_latest_prune_join_1_Good() {
%1 = alloca [5 x i32]
%2 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%3 = call i32 @latest_prune_join(i32* %2, i32 3)
ret void
}

LLVM IR (-O2):
define void @call_latest_prune_join_1_Good() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @latest_prune_join(i32* %3, i32 3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int main() {
  puts("Not changed");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [12 x i8] c"Not changed\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ rpu(unsigned long);
void printu(unsigned long x) {
  if (x == 0)
    putchar('0');
  else
    rpu(x);
  putchar(' ');
}


x86 assembly (clang, -O0):
<printu>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1146 <printu+0x26>
mov    $0x30,%edi
call   1030 <putchar@plt>
jmp    114f <printu+0x2f>
mov    -0x8(%rbp),%rdi
call   1040 <rpu@plt>
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printu>:
push   %rax
test   %rdi,%rdi
je     112d <printu+0xd>
call   1040 <rpu@plt>
jmp    1137 <printu+0x17>
mov    $0x30,%edi
call   1030 <putchar@plt>
mov    $0x20,%edi
pop    %rax
jmp    1030 <putchar@plt>

LLVM IR (-O0):
define void @printu(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @putchar(i8 signext 48)
br label %10
7: ; preds = %1
%8 = load i64, i64* %2
%9 = call i32 @rpu(i64 %8)
br label %10
10: ; preds = %7, %5
%11 = call i32 @putchar(i8 signext 32)
ret void
}

LLVM IR (-O2):
define void @printu(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 @putchar(i8 signext 48)
br label %7
5: ; preds = %1
%6 = tail call i32 @rpu(i64 %0)
br label %7
7: ; preds = %5, %3
%8 = tail call i32 @putchar(i8 signext 32)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *malloc(unsigned int);
int /*<<< orphan*/ strncpy(char *, char *, unsigned int);
void reallocate(char **string, unsigned int newSize) {
  char *tmpString = malloc(newSize * sizeof(char));
  strncpy(tmpString, *string, newSize);
  free(*string);
  *string = tmpString;
}


x86 assembly (clang, -O0):
<reallocate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
mov    -0xc(%rbp),%edx
call   1040 <strncpy@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reallocate>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%ebp
mov    %rdi,%rbx
mov    %esi,%edi
call   1050 <malloc@plt>
mov    %rax,%r14
mov    (%rbx),%rsi
mov    %rax,%rdi
mov    %ebp,%edx
call   1040 <strncpy@plt>
mov    (%rbx),%rdi
call   1030 <free@plt>
mov    %r14,(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @reallocate(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 i32, i32* %4
%7 = zext i32 %6 to i64
%8 = mul i64 %7, 1
%9 = trunc i64 %8 to i32
%10 = call i8* @malloc(i32 %9)
store i8* %10, i8** %5
%11 = load i8*, i8** %5
%12 = load i8**, i8*** %3
%13 = load i8*, i8** %12
%14 = load i32, i32* %4
%15 = call i32 @strncpy(i8* %11, i8* %13, i32 %14)
%16 = load i8**, i8*** %3
%17 = load i8*, i8** %16
%18 = call i32 @free(i8* %17)
%19 = load i8*, i8** %5
%20 = load i8**, i8*** %3
store i8* %19, i8** %20
ret void
}

LLVM IR (-O2):
define void @reallocate(i8** nocapture %0, i32 %1) {
%3 = tail call i8* @malloc(i32 %1)
%4 = load i8*, i8** %0
%5 = tail call i32 @strncpy(i8* %3, i8* %4, i32 %1)
%6 = load i8*, i8** %0
%7 = tail call i32 @free(i8* %6)
store i8* %3, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _Send1(int /*<<< orphan*/);
void LCD_X_WriteM(unsigned char *pData, int NumBytes) {
  for (; NumBytes; NumBytes--) {
    _Send1(*pData++);
  }
}


x86 assembly (clang, -O0):
<LCD_X_WriteM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     114e <LCD_X_WriteM+0x3e>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edi
call   1030 <_Send1@plt>
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111f <LCD_X_WriteM+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LCD_X_WriteM>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1143 <LCD_X_WriteM+0x33>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movzbl (%r14,%rbx,1),%edi
call   1030 <_Send1@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <LCD_X_WriteM+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

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

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


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

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

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

LLVM IR (-O2):
define void @gtk_container_child_get_property() {
ret void
}
/* Type definitions */
typedef int uint32_t;
struct timeval {
  int tv_sec;
  int tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
uint32_t platform_time_ms(void) {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return (tv.tv_sec * 1000) + (tv.tv_usec / 1000);
}


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

x86 assembly (clang, -O2):
<platform_time_ms>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
imul   $0x3e8,(%rsp),%ecx
movslq 0x4(%rsp),%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rax
add    %edx,%eax
add    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define i32 @platform_time_ms() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%8 = load i32, i32* %7
%9 = sdiv i32 %8, 1000
%10 = add nsw i32 %9, %6
ret i32 %10
}
int isUpperCase(char c) { return c >= 'A' && c <= 'Z'; }


x86 assembly (clang, -O0):
<isUpperCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x2(%rbp)
jl     1129 <isUpperCase+0x29>
movsbl -0x1(%rbp),%eax
cmp    $0x5a,%eax
setle  %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @isUpperCase(i8 signext %0) {
%2 = add i8 %0, -65
%3 = icmp ult i8 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
float sinf(float);
float dtMathSinf(float x) { return sinf(x); }


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

x86 assembly (clang, -O2):
<dtMathSinf>:
jmp    1030 <sinf@plt>

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

LLVM IR (-O2):
define float @dtMathSinf(float %0) {
%2 = tail call float @sinf(float %0)
ret float %2
}
long XEventMaskOfScreen() {}


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

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

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

LLVM IR (-O2):
define i64 @XEventMaskOfScreen() {
ret i64 undef
}