xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main() {
  printf("%s", "Hello World");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [12 x i8] c"Hello World\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;

/* Variables and functions */
int /*<<< orphan*/ bswap_64(int /*<<< orphan*/);
uint64_t le64_to_cpu(uint64_t le_val) { return bswap_64(le_val); }


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

x86 assembly (clang, -O2):
<le64_to_cpu>:
jmp    1030 <bswap_64@plt>

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

LLVM IR (-O2):
define i32 @le64_to_cpu(i32 %0) {
%2 = tail call i32 @bswap_64(i32 %0)
ret i32 %2
}
/* Variables and functions */
int callee_flat_u_noabs(unsigned int);
unsigned caller_flat_u_an(unsigned bla) { return callee_flat_u_noabs(bla); }


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

x86 assembly (clang, -O2):
<caller_flat_u_an>:
jmp    1030 <callee_flat_u_noabs@plt>

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

LLVM IR (-O2):
define i32 @caller_flat_u_an(i32 %0) {
%2 = tail call i32 @callee_flat_u_noabs(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ assert(char *);
scalar_t__ rmdir(char *);
bool files_rmdir(char *path) {
  assert(path);
  return rmdir(path) == 0;
}


x86 assembly (clang, -O0):
<files_rmdir>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <rmdir@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<files_rmdir>:
push   %rbx
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %rbx,%rdi
call   1030 <rmdir@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @files_rmdir(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @assert(i8* %3)
%5 = load i8*, i8** %2
%6 = call i64 @rmdir(i8* %5)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @files_rmdir(i8* %0) {
%2 = tail call i32 @assert(i8* %0)
%3 = tail call i64 @rmdir(i8* %0)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
struct rpn_plugin_functions {
  int dummy;
};

/* Variables and functions */
struct rpn_plugin_functions *
rpn_get_set_plugin_functions(struct rpn_plugin_functions *functions) {
  static struct rpn_plugin_functions *p_functions = NULL;
  if (p_functions == NULL)
    p_functions = functions;
  return p_functions;
}


x86 assembly (clang, -O0):
<rpn_get_set_plugin_functions>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,0x2f18(%rip)
jne    1121 <rpn_get_set_plugin_functions+0x21>
mov    -0x8(%rbp),%rax
mov    %rax,0x2f07(%rip)
mov    0x2f00(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpn_get_set_plugin_functions>:
mov    0x2f21(%rip),%rax
test   %rax,%rax
je     110d <rpn_get_set_plugin_functions+0xd>
ret
mov    %rdi,0x2f14(%rip)
mov    %rdi,%rax
ret

LLVM IR (-O0):
%struct.rpn_plugin_functions = type { i32 }
@rpn_get_set_plugin_functions.p_functions = internal global %struct.rpn_plugin_functions* null
define %struct.rpn_plugin_functions* @rpn_get_set_plugin_functions(%struct.rpn_plugin_functions* %0) {
%2 = alloca %struct.rpn_plugin_functions*
store %struct.rpn_plugin_functions* %0, %struct.rpn_plugin_functions** %2
%3 = load %struct.rpn_plugin_functions*, %struct.rpn_plugin_functions** @rpn_get_set_plugin_functions.p_functions
%4 = icmp eq %struct.rpn_plugin_functions* %3, null
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = load %struct.rpn_plugin_functions*, %struct.rpn_plugin_functions** %2
store %struct.rpn_plugin_functions* %6, %struct.rpn_plugin_functions** @rpn_get_set_plugin_functions.p_functions
br label %7
7: ; preds = %5, %1
%8 = load %struct.rpn_plugin_functions*, %struct.rpn_plugin_functions** @rpn_get_set_plugin_functions.p_functions
ret %struct.rpn_plugin_functions* %8
}

LLVM IR (-O2):
%struct.rpn_plugin_functions = type { i32 }
@rpn_get_set_plugin_functions.p_functions = internal unnamed_addr global %struct.rpn_plugin_functions* null
define %struct.rpn_plugin_functions* @rpn_get_set_plugin_functions(%struct.rpn_plugin_functions* %0) {
%2 = load %struct.rpn_plugin_functions*, %struct.rpn_plugin_functions** @rpn_get_set_plugin_functions.p_functions
%3 = icmp eq %struct.rpn_plugin_functions* %2, null
br i1 %3, label %4, label %5
4: ; preds = %1
store %struct.rpn_plugin_functions* %0, %struct.rpn_plugin_functions** @rpn_get_set_plugin_functions.p_functions
br label %5
5: ; preds = %4, %1
%6 = phi %struct.rpn_plugin_functions* [ %0, %4 ], [ %2, %1 ]
ret %struct.rpn_plugin_functions* %6
}
unsigned int fixed_2_30(double x) {
  return (unsigned int)(0.5 + x * 1073741824.0);
}


x86 assembly (clang, -O0):
<fixed_2_30>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xeea(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee6(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fixed_2_30>:
mulsd  0xef8(%rip),%xmm0
addsd  0xef8(%rip),%xmm0
cvttsd2si %xmm0,%rax
ret

LLVM IR (-O0):
define i32 @fixed_2_30(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @llvm.fmuladd.f64(double %3, double 0x41D0000000000000, double 5.000000e-01)
%5 = fptoui double %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @fixed_2_30(double %0) {
%2 = tail call double @llvm.fmuladd.f64(double %0, double 0x41D0000000000000, double 5.000000e-01)
%3 = fptoui double %2 to i32
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ __v4si;
typedef scalar_t__ __m128i;

/* Variables and functions */
__m128i __attribute__((__always___, __nodebug__))
_mm_add_epi32(__m128i a, __m128i b) {
  return (__m128i)((__v4si)a + (__v4si)b);
}


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

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

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

LLVM IR (-O2):
define i64 @_mm_add_epi32(i64 %0, i64 %1) {
%3 = add nsw i64 %1, %0
ret i64 %3
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t murmur_fmix(uint32_t h) {
  h ^= h >> 16;
  h *= 0x85ebca6b;
  h ^= h >> 13;
  h *= 0xc2b2ae35;
  h ^= h >> 16;
  return h;
}


x86 assembly (clang, -O0):
<murmur_fmix>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0x85ebca6b,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0xd,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
imul   $0xc2b2ae35,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
xor    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<murmur_fmix>:
mov    %edi,%eax
sar    $0x10,%eax
xor    %edi,%eax
imul   $0x85ebca6b,%eax,%eax
mov    %eax,%ecx
sar    $0xd,%ecx
xor    %eax,%ecx
imul   $0xc2b2ae35,%ecx,%ecx
mov    %ecx,%eax
sar    $0x10,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @murmur_fmix(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 16
%5 = load i32, i32* %2
%6 = xor i32 %5, %4
store i32 %6, i32* %2
%7 = load i32, i32* %2
%8 = mul i32 %7, -2048144789
store i32 %8, i32* %2
%9 = load i32, i32* %2
%10 = ashr i32 %9, 13
%11 = load i32, i32* %2
%12 = xor i32 %11, %10
store i32 %12, i32* %2
%13 = load i32, i32* %2
%14 = mul i32 %13, -1028477387
store i32 %14, i32* %2
%15 = load i32, i32* %2
%16 = ashr i32 %15, 16
%17 = load i32, i32* %2
%18 = xor i32 %17, %16
store i32 %18, i32* %2
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @murmur_fmix(i32 %0) {
%2 = ashr i32 %0, 16
%3 = xor i32 %2, %0
%4 = mul i32 %3, -2048144789
%5 = ashr i32 %4, 13
%6 = xor i32 %5, %4
%7 = mul i32 %6, -1028477387
%8 = ashr i32 %7, 16
%9 = xor i32 %8, %7
ret i32 %9
}
void left_case_3(struct rbt *tree, struct node *node, struct node *sibling) {}


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

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

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

LLVM IR (-O2):
%struct.rbt = type opaque
%struct.node = type opaque
define void @left_case_3(%struct.rbt* nocapture %0, %struct.node* nocapture %1, %struct.node* nocapture %2) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sys_vgui(char *, void *, int, int, int, int, void *, char,
                            char *);
void line(void *cv, void *o, char c, int x, int y, int w, int h, char *color) {
  sys_vgui(
      ".x%x.c create line                  %d %d %d %d -tags %x%c -fill %s\n",
      cv, x, y, x + w, y + h, o, c, color);
}


x86 assembly (clang, -O0):
<line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %dl,%al
mov    0x18(%rbp),%rdx
mov    0x10(%rbp),%edx
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x18(%rbp),%edx
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%r8d
add    -0x20(%rbp),%r8d
mov    -0x1c(%rbp),%r9d
add    0x10(%rbp),%r9d
mov    -0x10(%rbp),%r11
mov    -0x11(%rbp),%r10b
mov    0x18(%rbp),%rax
lea    0xe9c(%rip),%rdi
mov    %r11,(%rsp)
movsbl %r10b,%r10d
mov    %r10d,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <sys_vgui@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<line>:
push   %rax
mov    %r8d,%eax
mov    %edx,%r11d
mov    %rsi,%r10
mov    %rdi,%rsi
lea    (%r9,%rcx,1),%r8d
mov    0x10(%rsp),%r9d
add    %eax,%r9d
sub    $0x8,%rsp
lea    0xecc(%rip),%rdi
mov    %ecx,%edx
mov    %eax,%ecx
push   0x20(%rsp)
push   %r11
push   %r10
call   1030 <sys_vgui@plt>
add    $0x20,%rsp
pop    %rax
ret

LLVM IR (-O0):
@.str = [69 x i8] c".x%x.c create line %d %d %d %d -tags %x%c -fill %s\0A\00"
define void @line(i8* %0, i8* %1, i8 signext %2, i32 %3, i32 %4, i32 %5, i32 %6, i8* %7) {
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8*
store i8* %0, i8** %9
store i8* %1, i8** %10
store i8 %2, i8* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i32 %6, i32* %15
store i8* %7, i8** %16
%17 = load i8*, i8** %9
%18 = load i32, i32* %12
%19 = load i32, i32* %13
%20 = load i32, i32* %12
%21 = load i32, i32* %14
%22 = add nsw i32 %20, %21
%23 = load i32, i32* %13
%24 = load i32, i32* %15
%25 = add nsw i32 %23, %24
%26 = load i8*, i8** %10
%27 = load i8, i8* %11
%28 = load i8*, i8** %16
%29 = call i32 @sys_vgui(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %17, i32 %18, i32 %19, i32 %22, i32 %25, i8* %26, i8 signext %27, i8* %28)
ret void
}

LLVM IR (-O2):
@.str = [69 x i8] c".x%x.c create line %d %d %d %d -tags %x%c -fill %s\0A\00"
define void @line(i8* %0, i8* %1, i8 signext %2, i32 %3, i32 %4, i32 %5, i32 %6, i8* %7) {
%9 = add nsw i32 %5, %3
%10 = add nsw i32 %6, %4
%11 = tail call i32 @sys_vgui(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %3, i32 %4, i32 %9, i32 %10, i8* %1, i8 signext %2, i8* %7)
ret void
}
/* Variables and functions */
long get_grid_index_from_address(long *, long const *);
int /*<<< orphan*/ grg_get_grid_address(long *, long const *, long const *,
                                        long const *);
long get_double_grid_index(const long address_double[3], const long D_diag[3],
                           const long PS[3]) {
  long address[3];
  grg_get_grid_address(address, address_double, D_diag, PS);
  return get_grid_index_from_address(address, D_diag);
}


x86 assembly (clang, -O0):
<get_double_grid_index>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
call   1030 <grg_get_grid_address@plt>
lea    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <get_grid_index_from_address@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_double_grid_index>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%rcx
mov    %rsi,%rbx
mov    %rdi,%rsi
mov    %rsp,%r14
mov    %r14,%rdi
mov    %rbx,%rdx
call   1030 <grg_get_grid_address@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <get_grid_index_from_address@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @get_double_grid_index(i64* %0, i64* %1, i64* %2) {
%4 = alloca i64*
%5 = alloca i64*
%6 = alloca i64*
%7 = alloca [3 x i64]
store i64* %0, i64** %4
store i64* %1, i64** %5
store i64* %2, i64** %6
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%9 = load i64*, i64** %4
%10 = load i64*, i64** %5
%11 = load i64*, i64** %6
%12 = call i32 @grg_get_grid_address(i64* %8, i64* %9, i64* %10, i64* %11)
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%14 = load i64*, i64** %5
%15 = call i64 @get_grid_index_from_address(i64* %13, i64* %14)
ret i64 %15
}

LLVM IR (-O2):
define i64 @get_double_grid_index(i64* %0, i64* %1, i64* %2) {
%4 = alloca [3 x i64]
%5 = bitcast [3 x i64]* %4 to i8*
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
%7 = call i32 @grg_get_grid_address(i64* %6, i64* %0, i64* %1, i64* %2)
%8 = call i64 @get_grid_index_from_address(i64* %6, i64* %1)
ret i64 %8
}
int mat_get_trace_i3(int a[3][3]) { return a[0][0] + a[1][1] + a[2][2]; }


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

x86 assembly (clang, -O2):
<mat_get_trace_i3>:
mov    0x10(%rdi),%eax
add    (%rdi),%eax
add    0x20(%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mat_get_trace_i3([3 x i32]* %0) {
%2 = alloca [3 x i32]*
store [3 x i32]* %0, [3 x i32]** %2
%3 = load [3 x i32]*, [3 x i32]** %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %3, i64 0
%5 = getelementptr inbounds [3 x i32], [3 x i32]* %4, i64 0, i64 0
%6 = load i32, i32* %5
%7 = load [3 x i32]*, [3 x i32]** %2
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %7, i64 1
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %8, i64 0, i64 1
%10 = load i32, i32* %9
%11 = add nsw i32 %6, %10
%12 = load [3 x i32]*, [3 x i32]** %2
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %12, i64 2
%14 = getelementptr inbounds [3 x i32], [3 x i32]* %13, i64 0, i64 2
%15 = load i32, i32* %14
%16 = add nsw i32 %11, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @mat_get_trace_i3([3 x i32]* nocapture %0) {
%2 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 0, i64 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 1, i64 1
%5 = load i32, i32* %4
%6 = add nsw i32 %5, %3
%7 = getelementptr inbounds [3 x i32], [3 x i32]* %0, i64 2, i64 2
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}
int f5(int x) { return (int)((unsigned int)x >> 27) | (x << 5); }


x86 assembly (clang, -O0):
<f5>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1b,%eax
mov    -0x4(%rbp),%ecx
shl    $0x5,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f5>:
mov    %edi,%eax
rol    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @f5(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = lshr i32 %3, 27
%5 = load i32, i32* %2
%6 = shl i32 %5, 5
%7 = or i32 %4, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @f5(i32 %0) {
%2 = tail call i32 @llvm.fshl.i32(i32 %0, i32 %0, i32 5)
ret i32 %2
}
void ex1(int x[]) {}


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

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

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

LLVM IR (-O2):
define void @ex1(i32* nocapture %0) {
ret void
}
/* Variables and functions */
int log_open(int);
int log_open_client(void) { return log_open(2); }


x86 assembly (clang, -O0):
<log_open_client>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <log_open@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<log_open_client>:
mov    $0x2,%edi
jmp    1030 <log_open@plt>

LLVM IR (-O0):
define i32 @log_open_client() {
%1 = call i32 @log_open(i32 2)
ret i32 %1
}

LLVM IR (-O2):
define i32 @log_open_client() {
%1 = tail call i32 @log_open(i32 2)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ g_load(int);
void iload(int n) { g_load(n); }


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

x86 assembly (clang, -O2):
<iload>:
jmp    1030 <g_load@plt>

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

LLVM IR (-O2):
define void @iload(i32 %0) {
%2 = tail call i32 @g_load(i32 %0)
ret void
}
int sayac(char *arr) {
  int i = 0;
  while (*(arr + i) != '\0') {
    i++;
  }
  return i;
}


x86 assembly (clang, -O0):
<sayac>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1132 <sayac+0x32>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <sayac+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sayac>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpb   $0x0,(%rdi)
lea    0x1(%rdi),%rdi
jne    1110 <sayac+0x10>
ret

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

LLVM IR (-O2):
define i32 @sayac(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
scalar_t__ atof(char const *);
int string_to_int(const char *str) { return (int)atof(str); }


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

x86 assembly (clang, -O2):
<string_to_int>:
jmp    1030 <atof@plt>

LLVM IR (-O0):
define i32 @string_to_int(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @atof(i8* %3)
%5 = trunc i64 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @string_to_int(i8* nocapture %0) {
%2 = tail call i64 @atof(i8* %0)
%3 = trunc i64 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ jet_sleep(int);
int write_block(int, int, int, int, int, int);
int dynamixelSetRegister(int servo, int reg, int length, int value) {
  int val0 = value & 255;
  int val1 = value >> 8;
  int ret = write_block(100, servo, reg, length, val0, val1);
  jet_sleep(50);
  return ret;
}


x86 assembly (clang, -O0):
<dynamixelSetRegister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
mov    %eax,-0x18(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    $0x64,%edi
call   1030 <write_block@plt>
mov    %eax,-0x1c(%rbp)
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamixelSetRegister>:
push   %rbx
mov    %ecx,%r9d
mov    %edx,%ecx
mov    %esi,%edx
mov    %edi,%esi
movzbl %r9b,%r8d
sar    $0x8,%r9d
mov    $0x64,%edi
call   1030 <write_block@plt>
mov    %eax,%ebx
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @dynamixelSetRegister(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%12 = load i32, i32* %8
%13 = and i32 %12, 255
store i32 %13, i32* %9
%14 = load i32, i32* %8
%15 = ashr i32 %14, 8
store i32 %15, i32* %10
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = load i32, i32* %7
%19 = load i32, i32* %9
%20 = load i32, i32* %10
%21 = call i32 @write_block(i32 100, i32 %16, i32 %17, i32 %18, i32 %19, i32 %20)
store i32 %21, i32* %11
%22 = call i32 @jet_sleep(i32 50)
%23 = load i32, i32* %11
ret i32 %23
}

LLVM IR (-O2):
define i32 @dynamixelSetRegister(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = and i32 %3, 255
%6 = ashr i32 %3, 8
%7 = tail call i32 @write_block(i32 100, i32 %0, i32 %1, i32 %2, i32 %5, i32 %6)
%8 = tail call i32 @jet_sleep(i32 50)
ret i32 %7
}
void refactoringIndex() {}


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

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

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

LLVM IR (-O2):
define void @refactoringIndex() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ socket(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
void test_ipv4tcp() { socket(AF_INET, SOCK_STREAM, 0); }


x86 assembly (clang, -O0):
<test_ipv4tcp>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
mov    0x2eb4(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1030 <socket@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_ipv4tcp>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
jmp    1030 <socket@plt>

LLVM IR (-O0):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define void @test_ipv4tcp() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = call i32 @socket(i32 %1, i32 %2, i32 0)
ret void
}

LLVM IR (-O2):
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
define void @test_ipv4tcp() {
%1 = load i32, i32* @AF_INET
%2 = load i32, i32* @SOCK_STREAM
%3 = tail call i32 @socket(i32 %1, i32 %2, i32 0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;
typedef int /*<<< orphan*/ XDR;

/* Variables and functions */
int /*<<< orphan*/ FALSE;
int /*<<< orphan*/ TRUE;
int /*<<< orphan*/ xdr_int(int /*<<< orphan*/ *, int *);
bool_t xdr_char(XDR *xdrs, char *cp) {
  int i;
  i = (*cp);
  if (!xdr_int(xdrs, &i)) {
    return FALSE;
  }
  *cp = i;
  return TRUE;
}


x86 assembly (clang, -O0):
<xdr_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
call   1030 <xdr_int@plt>
cmp    $0x0,%eax
jne    1151 <xdr_char+0x41>
mov    0x2e91(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1168 <xdr_char+0x58>
mov    -0x1c(%rbp),%eax
mov    %al,%cl
mov    -0x18(%rbp),%rax
mov    %cl,(%rax)
mov    0x2e85(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xdr_char>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movsbl (%rsi),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1030 <xdr_int@plt>
test   %eax,%eax
je     113c <xdr_char+0x2c>
mov    0xc(%rsp),%al
mov    %al,(%rbx)
mov    0x2eae(%rip),%rax
jmp    1143 <xdr_char+0x33>
mov    0x2e95(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_char(i32* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i8*
%6 = alloca i32
store i32* %0, i32** %4
store i8* %1, i8** %5
%7 = load i8*, i8** %5
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
store i32 %9, i32* %6
%10 = load i32*, i32** %4
%11 = call i32 @xdr_int(i32* %10, i32* %6)
%12 = icmp ne i32 %11, 0
br i1 %12, label %15, label %13
13: ; preds = %2
%14 = load i32, i32* @FALSE
store i32 %14, i32* %3
br label %20
15: ; preds = %2
%16 = load i32, i32* %6
%17 = trunc i32 %16 to i8
%18 = load i8*, i8** %5
store i8 %17, i8* %18
%19 = load i32, i32* @TRUE
store i32 %19, i32* %3
br label %20
20: ; preds = %15, %13
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
@FALSE = global i32 0
@TRUE = global i32 0
define i32 @xdr_char(i32* %0, i8* nocapture %1) {
%3 = alloca i32
%4 = bitcast i32* %3 to i8*
%5 = load i8, i8* %1
%6 = sext i8 %5 to i32
store i32 %6, i32* %3
%7 = call i32 @xdr_int(i32* %0, i32* %3)
%8 = icmp eq i32 %7, 0
br i1 %8, label %12, label %9
9: ; preds = %2
%10 = load i32, i32* %3
%11 = trunc i32 %10 to i8
store i8 %11, i8* %1
br label %12
12: ; preds = %2, %9
%13 = phi i32* [ @TRUE, %9 ], [ @FALSE, %2 ]
%14 = load i32, i32* %13
ret i32 %14
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_negative(float *, float *);
__attribute__((always_)) struct vec3 *psvec3_negative(struct vec3 *result,
                                                      struct vec3 *a) {
  vec3_negative((float *)result, (float *)a);
  return result;
}


x86 assembly (clang, -O0):
<psvec3_negative>:
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 <vec3_negative@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psvec3_negative>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_negative@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_negative(%struct.vec3* %0, %struct.vec3* %1) {
%3 = alloca %struct.vec3*
%4 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %3
store %struct.vec3* %1, %struct.vec3** %4
%5 = load %struct.vec3*, %struct.vec3** %3
%6 = bitcast %struct.vec3* %5 to float*
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = call i32 @vec3_negative(float* %6, float* %8)
%10 = load %struct.vec3*, %struct.vec3** %3
ret %struct.vec3* %10
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_negative(%struct.vec3* returned %0, %struct.vec3* %1) {
%3 = bitcast %struct.vec3* %0 to float*
%4 = bitcast %struct.vec3* %1 to float*
%5 = tail call i32 @vec3_negative(float* %3, float* %4)
ret %struct.vec3* %0
}
int lockd_free_vg_before(struct cmd_context *cmd, struct volume_group *vg,
                         int changing) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%struct.cmd_context = type opaque
%struct.volume_group = type opaque
define i32 @lockd_free_vg_before(%struct.cmd_context* nocapture readnone %0, %struct.volume_group* nocapture readnone %1, i32 %2) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ ENOMEM;
int /*<<< orphan*/ errno;
int sys_fstat(int file, void *buf) {
  errno = ENOMEM;
  return -1;
}


x86 assembly (clang, -O0):
<sys_fstat>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2ece(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sys_fstat>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @sys_fstat(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* @ENOMEM
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOMEM = global i32 0
@errno = global i32 0
define i32 @sys_fstat(i32 %0, i8* nocapture readnone %1) {
%3 = load i32, i32* @ENOMEM
store i32 %3, i32* @errno
ret i32 -1
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void ts_set_transporterror(uint8_t *p_ts) { p_ts[1] |= 0x80; }


x86 assembly (clang, -O0):
<ts_set_transporterror>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
or     $0x80,%ecx
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<ts_set_transporterror>:
orb    $0x80,0x4(%rdi)
ret

LLVM IR (-O0):
define void @ts_set_transporterror(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 1
%5 = load i32, i32* %4
%6 = or i32 %5, 128
store i32 %6, i32* %4
ret void
}

LLVM IR (-O2):
define void @ts_set_transporterror(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = load i32, i32* %2
%4 = or i32 %3, 128
store i32 %4, i32* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void assert(int value) {
  if (value)
    return;
  printf("List assert fail, quick exit\n");
  exit(1);
}


x86 assembly (clang, -O0):
<assert>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113b <assert+0x1b>
add    $0x10,%rsp
pop    %rbp
ret
lea    0xebe(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<assert>:
test   %edi,%edi
je     1125 <assert+0x5>
ret
push   %rax
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [30 x i8] c"List assert fail, quick exit\0A\00"
define void @assert(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 %6
5: ; preds = %1
ret void
6: ; preds = %1
%7 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [29 x i8] c"List assert fail, quick exit\00"
define void @assert(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %4, label %3
3: ; preds = %1
ret void
4: ; preds = %1
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
char *malloc(int);
int rand();
char *realloc(char *, int);
int /*<<< orphan*/ strcpy(char *, char *);
char *fn1() {
  char *result;
  result = malloc(20 + rand() % 20);
  result = realloc(result, 30 + rand() % 20);
  strcpy((char *)result, "fn1");
  return result;
}


x86 assembly (clang, -O0):
<fn1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1060 <rand@plt>
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1060 <rand@plt>
mov    -0x10(%rbp),%rdi
mov    $0x14,%ecx
cltd
idiv   %ecx
mov    %edx,%esi
add    $0x1e,%esi
call   1050 <realloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe67(%rip),%rsi
call   1030 <strcpy@plt>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn1>:
push   %rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%edi
add    $0x14,%edi
call   1040 <malloc@plt>
mov    %rax,%rbx
xor    %eax,%eax
call   1060 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x23,%rcx
add    %edx,%ecx
shl    $0x2,%ecx
lea    (%rcx,%rcx,4),%ecx
neg    %ecx
lea    (%rax,%rcx,1),%esi
add    $0x1e,%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
lea    0xe4f(%rip),%rsi
mov    %rax,%rdi
call   1030 <strcpy@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"fn1\00"
define i8* @fn1() {
%1 = alloca i8*
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 20
%4 = add nsw i32 20, %3
%5 = call i8* @malloc(i32 %4)
store i8* %5, i8** %1
%6 = load i8*, i8** %1
%7 = call i32 (...) @rand()
%8 = srem i32 %7, 20
%9 = add nsw i32 30, %8
%10 = call i8* @realloc(i8* %6, i32 %9)
store i8* %10, i8** %1
%11 = load i8*, i8** %1
%12 = call i32 @strcpy(i8* %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%13 = load i8*, i8** %1
ret i8* %13
}

LLVM IR (-O2):
@.str = [4 x i8] c"fn1\00"
define i8* @fn1() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 20
%3 = add nsw i32 %2, 20
%4 = tail call i8* @malloc(i32 %3)
%5 = tail call i32 (...) @rand()
%6 = srem i32 %5, 20
%7 = add nsw i32 %6, 30
%8 = tail call i8* @realloc(i8* %4, i32 %7)
%9 = tail call i32 @strcpy(i8* %8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i8* %8
}
int Kit_CubeHasLit(unsigned uCube, int i) {
  return (uCube & (unsigned)(1 << i)) > 0;
}


x86 assembly (clang, -O0):
<Kit_CubeHasLit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
mov    $0x1,%edx
shl    %cl,%edx
mov    %edx,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Kit_CubeHasLit>:
mov    %esi,%ecx
mov    %edi,%eax
shr    %cl,%eax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @Kit_CubeHasLit(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = shl i32 1, %6
%8 = and i32 %5, %7
%9 = icmp ugt i32 %8, 0
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @Kit_CubeHasLit(i32 %0, i32 %1) {
%3 = lshr i32 %0, %1
%4 = and i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ pch();
int /*<<< orphan*/ pdbl();
int /*<<< orphan*/ pflt();
int /*<<< orphan*/ pint();
int /*<<< orphan*/ plong();
int /*<<< orphan*/ pstruct();
main() {
  pint();
  pch();
  pflt();
  pdbl();
  plong();
  pstruct();
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pint@plt>
mov    $0x0,%al
call   1080 <pch@plt>
mov    $0x0,%al
call   1060 <pflt@plt>
mov    $0x0,%al
call   1050 <pdbl@plt>
mov    $0x0,%al
call   1070 <plong@plt>
mov    $0x0,%al
call   1040 <pstruct@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <pint@plt>
xor    %eax,%eax
call   1080 <pch@plt>
xor    %eax,%eax
call   1060 <pflt@plt>
xor    %eax,%eax
call   1050 <pdbl@plt>
xor    %eax,%eax
call   1070 <plong@plt>
xor    %eax,%eax
call   1040 <pstruct@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @pint()
%3 = call i32 (...) @pch()
%4 = call i32 (...) @pflt()
%5 = call i32 (...) @pdbl()
%6 = call i32 (...) @plong()
%7 = call i32 (...) @pstruct()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @pint()
%2 = tail call i32 (...) @pch()
%3 = tail call i32 (...) @pflt()
%4 = tail call i32 (...) @pdbl()
%5 = tail call i32 (...) @plong()
%6 = tail call i32 (...) @pstruct()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ print_dependencies(char *);
void print_bin() { print_dependencies(".bin"); }


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

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

LLVM IR (-O0):
@.str = [5 x i8] c".bin\00"
define void @print_bin() {
%1 = call i32 @print_dependencies(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c".bin\00"
define void @print_bin() {
%1 = tail call i32 @print_dependencies(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
double *malloc(int);
int main(void) {
  int *ip = (int *)malloc(50 * sizeof(int));
  double *dp = malloc(1000 * sizeof(double));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1f40,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xc8,%edi
call   1030 <malloc@plt>
mov    $0x1f40,%edi
call   1030 <malloc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32*
%2 = alloca double*
%3 = call double* @malloc(i32 200)
%4 = bitcast double* %3 to i32*
store i32* %4, i32** %1
%5 = call double* @malloc(i32 8000)
store double* %5, double** %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double* @malloc(i32 200)
%2 = tail call double* @malloc(i32 8000)
ret i32 0
}
/* Variables and functions */
double sin(double);
double Func_Sin(double *oplist, unsigned int numops) { return sin(oplist[0]); }


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

x86 assembly (clang, -O2):
<Func_Sin>:
movsd  (%rdi),%xmm0
jmp    1030 <sin@plt>

LLVM IR (-O0):
define double @Func_Sin(double* %0, i32 %1) {
%3 = alloca double*
%4 = alloca i32
store double* %0, double** %3
store i32 %1, i32* %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = call double @sin(double %7)
ret double %8
}

LLVM IR (-O2):
define double @Func_Sin(double* nocapture %0, i32 %1) {
%3 = load double, double* %0
%4 = tail call double @sin(double %3)
ret double %4
}
int bar(struct sty *u) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.sty = type opaque
define i32 @bar(%struct.sty* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint8_t;

/* Variables and functions */
void WidgetMutexPut(uint8_t *pi8Mutex) { *pi8Mutex = 0; }


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

x86 assembly (clang, -O2):
<WidgetMutexPut>:
movq   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @WidgetMutexPut(i64* nocapture writeonly %0) {
store i64 0, i64* %0
ret void
}
unsigned int setbits(unsigned int x, int p, int n, unsigned int y) {
  int t1, t2, t3;
  int bits;
  bits = sizeof(int) * 8;
  t1 = x >> (bits - p);
  t2 = x << (bits - p - n) >> (bits - p - n);
  t3 = y << (bits - n) >> p;
  x = t1 | t2 | t3;
  return x;
}


x86 assembly (clang, -O0):
<setbits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x20,-0x20(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x20(%rbp),%ecx
sub    -0x8(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    -0x8(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x14(%rbp),%eax
or     -0x18(%rbp),%eax
or     -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<setbits>:
mov    %ecx,%eax
mov    %esi,%r8d
mov    $0x20,%esi
sub    %r8d,%esi
mov    %r8d,%ecx
neg    %ecx
mov    %edi,%r9d
shr    %cl,%r9d
sub    %edx,%esi
mov    %esi,%ecx
shl    %cl,%edi
shr    %cl,%edi
neg    %dl
mov    %edx,%ecx
shl    %cl,%eax
mov    %r8d,%ecx
shr    %cl,%eax
or     %r9d,%eax
or     %edi,%eax
ret

LLVM IR (-O0):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 32, i32* %12
%13 = load i32, i32* %5
%14 = load i32, i32* %12
%15 = load i32, i32* %6
%16 = sub nsw i32 %14, %15
%17 = lshr i32 %13, %16
store i32 %17, i32* %9
%18 = load i32, i32* %5
%19 = load i32, i32* %12
%20 = load i32, i32* %6
%21 = sub nsw i32 %19, %20
%22 = load i32, i32* %7
%23 = sub nsw i32 %21, %22
%24 = shl i32 %18, %23
%25 = load i32, i32* %12
%26 = load i32, i32* %6
%27 = sub nsw i32 %25, %26
%28 = load i32, i32* %7
%29 = sub nsw i32 %27, %28
%30 = lshr i32 %24, %29
store i32 %30, i32* %10
%31 = load i32, i32* %8
%32 = load i32, i32* %12
%33 = load i32, i32* %7
%34 = sub nsw i32 %32, %33
%35 = shl i32 %31, %34
%36 = load i32, i32* %6
%37 = lshr i32 %35, %36
store i32 %37, i32* %11
%38 = load i32, i32* %9
%39 = load i32, i32* %10
%40 = or i32 %38, %39
%41 = load i32, i32* %11
%42 = or i32 %40, %41
store i32 %42, i32* %5
%43 = load i32, i32* %5
ret i32 %43
}

LLVM IR (-O2):
define i32 @setbits(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 32, %1
%6 = lshr i32 %0, %5
%7 = sub nsw i32 %5, %2
%8 = lshr i32 -1, %7
%9 = and i32 %8, %0
%10 = sub nsw i32 32, %2
%11 = shl i32 %3, %10
%12 = lshr i32 %11, %1
%13 = or i32 %9, %6
%14 = or i32 %13, %12
ret i32 %14
}
/* Variables and functions */
char *ae_api_name();
char *ae_get_api_name(void) { return ae_api_name(); }


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

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

LLVM IR (-O0):
define i8* @ae_get_api_name() {
%1 = call i8* (...) @ae_api_name()
ret i8* %1
}

LLVM IR (-O2):
define i8* @ae_get_api_name() {
%1 = tail call i8* (...) @ae_api_name()
ret i8* %1
}
float _ds_round(float n) {
  int r = (n * 100);
  while (r % 5)
    r++;
  return (r / 100.0);
}


x86 assembly (clang, -O0):
<_ds_round>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xeef(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
cvttss2si %xmm0,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    $0x5,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     113f <_ds_round+0x3f>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111d <_ds_round+0x1d>
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xebc(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ds_round>:
mulss  0xef8(%rip),%xmm0
cvttss2si %xmm0,%eax
nopl   0x0(%rax)
imul   $0xcccccccd,%eax,%ecx
add    $0x19999999,%ecx
add    $0x1,%eax
cmp    $0x33333332,%ecx
ja     1110 <_ds_round+0x10>
add    $0xffffffff,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xecf(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @_ds_round(float %0) {
%2 = alloca float
%3 = alloca i32
store float %0, float* %2
%4 = load float, float* %2
%5 = fmul float %4, 1.000000e+02
%6 = fptosi float %5 to i32
store i32 %6, i32* %3
br label %7
7: ; preds = %11, %1
%8 = load i32, i32* %3
%9 = srem i32 %8, 5
%10 = icmp ne i32 %9, 0
br i1 %10, label %11, label %14
11: ; preds = %7
%12 = load i32, i32* %3
%13 = add nsw i32 %12, 1
store i32 %13, i32* %3
br label %7
14: ; preds = %7
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = fdiv double %16, 1.000000e+02
%18 = fptrunc double %17 to float
ret float %18
}

LLVM IR (-O2):
define float @_ds_round(float %0) {
%2 = fmul float %0, 1.000000e+02
%3 = fptosi float %2 to i32
br label %4
4: ; preds = %4, %1
%5 = phi i32 [ %3, %1 ], [ %8, %4 ]
%6 = srem i32 %5, 5
%7 = icmp eq i32 %6, 0
%8 = add nsw i32 %5, 1
br i1 %7, label %9, label %4
9: ; preds = %4
%10 = sitofp i32 %5 to double
%11 = fdiv double %10, 1.000000e+02
%12 = fptrunc double %11 to float
ret float %12
}