xunge/DecIR huggingface dataset:
/* Type definitions */
struct object {
  int dummy;
};
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char const *, char *);
int /*<<< orphan*/ print_closure(int /*<<< orphan*/ *, struct object *);
void write_closure_to_geo(struct object *obj, char const *filename) {
  FILE *f = fopen(filename, "w");
  print_closure(f, obj);
  fclose(f);
}


x86 assembly (clang, -O0):
<write_closure_to_geo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb5(%rip),%rsi
call   1050 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <print_closure@plt>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_closure_to_geo>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rax
mov    %rdi,%r14
lea    0xebf(%rip),%rsi
mov    %rax,%rdi
call   1050 <fopen@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <print_closure@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <fclose@plt>

LLVM IR (-O0):
%struct.object = type { i32 }
@.str = [2 x i8] c"w\00"
define void @write_closure_to_geo(%struct.object* %0, i8* %1) {
%3 = alloca %struct.object*
%4 = alloca i8*
%5 = alloca i32*
store %struct.object* %0, %struct.object** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %4
%7 = call i32* @fopen(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = load %struct.object*, %struct.object** %3
%10 = call i32 @print_closure(i32* %8, %struct.object* %9)
%11 = load i32*, i32** %5
%12 = call i32 @fclose(i32* %11)
ret void
}

LLVM IR (-O2):
%struct.object = type { i32 }
@.str = [2 x i8] c"w\00"
define void @write_closure_to_geo(%struct.object* %0, i8* nocapture %1) {
%3 = tail call i32* @fopen(i8* %1, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @print_closure(i32* %3, %struct.object* %0)
%5 = tail call i32 @fclose(i32* %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void exitfunc13(void) {
  printf("Executing exitfunc13.\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Executing exitfunc13.\0A\00"
define void @exitfunc13() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [22 x i8] c"Executing exitfunc13.\00"
define void @exitfunc13() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 0)
unreachable
}
void ff_thread_free() {}


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

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

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

LLVM IR (-O2):
define void @ff_thread_free() {
ret void
}
int saft_hash_table_find_closest_shift(long n) {
  int i;
  for (i = 0; n; i++)
    n >>= 1L;
  return i;
}


x86 assembly (clang, -O0):
<saft_hash_table_find_closest_shift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1134 <saft_hash_table_find_closest_shift+0x34>
mov    -0x8(%rbp),%rax
sar    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <saft_hash_table_find_closest_shift+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<saft_hash_table_find_closest_shift>:
xor    %eax,%eax
test   %rdi,%rdi
je     111f <saft_hash_table_find_closest_shift+0x1f>
mov    %rdi,%rcx
nopw   0x0(%rax,%rax,1)
sar    %rcx
add    $0x1,%eax
cmp    $0x1,%rdi
mov    %rcx,%rdi
ja     1110 <saft_hash_table_find_closest_shift+0x10>
ret

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

LLVM IR (-O2):
define i32 @saft_hash_table_find_closest_shift(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = ashr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 2
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
long LONG_MIN;
int /*<<< orphan*/ R_(char const *);
int stoie(char const *, int *);
int /*<<< orphan*/ warnf(char *, int /*<<< orphan*/);
long int stoi(const char *s) {
  int err = 0;
  int i = stoie(s, &err);
  if (err) {
    warnf("Can't convert string to int: %s", R_(s));
    return LONG_MIN;
  }
  return i;
}


x86 assembly (clang, -O0):
<stoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1050 <stoie@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1187 <stoi+0x57>
mov    -0x10(%rbp),%rdi
call   1030 <R_@plt>
mov    %eax,%esi
lea    0xe91(%rip),%rdi
call   1040 <warnf@plt>
mov    0x2e6d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x8(%rbp)
jmp    118f <stoi+0x5f>
movslq -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stoi>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movl   $0x0,0xc(%rsp)
lea    0xc(%rsp),%rsi
call   1050 <stoie@plt>
cmpl   $0x0,0xc(%rsp)
je     1173 <stoi+0x43>
mov    %rbx,%rdi
call   1030 <R_@plt>
lea    0xea0(%rip),%rdi
mov    %eax,%esi
call   1040 <warnf@plt>
mov    0x2e7a(%rip),%rax
mov    (%rax),%rax
jmp    1175 <stoi+0x45>
cltq
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [32 x i8] c"Can't convert string to int: %s\00"
@LONG_MIN = global i64 0
define i64 @stoi(i8* %0) {
%2 = alloca i64
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @stoie(i8* %6, i32* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %4
%9 = icmp ne i32 %8, 0
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @R_(i8* %11)
%13 = call i32 @warnf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %12)
%14 = load i64, i64* @LONG_MIN
store i64 %14, i64* %2
br label %18
15: ; preds = %1
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
store i64 %17, i64* %2
br label %18
18: ; preds = %15, %10
%19 = load i64, i64* %2
ret i64 %19
}

LLVM IR (-O2):
@.str = [32 x i8] c"Can't convert string to int: %s\00"
@LONG_MIN = global i64 0
define i64 @stoi(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @stoie(i8* %0, i32* %2)
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 0
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = call i32 @R_(i8* %0)
%9 = call i32 @warnf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load i64, i64* @LONG_MIN
br label %13
11: ; preds = %1
%12 = sext i32 %4 to i64
br label %13
13: ; preds = %11, %7
%14 = phi i64 [ %10, %7 ], [ %12, %11 ]
ret i64 %14
}
int power3(int val) {
  int temp = val;
  while (temp % 3 == 0)
    temp = temp / 3;
  if (temp == 1)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<power3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1134 <power3+0x34>
mov    -0xc(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
jmp    110d <power3+0xd>
cmpl   $0x1,-0xc(%rbp)
jne    114a <power3+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <power3+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<power3>:
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555554,%eax
ja     1149 <power3+0x49>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movslq %edi,%rax
imul   $0x55555556,%rax,%rdi
mov    %rdi,%rax
shr    $0x3f,%rax
shr    $0x20,%rdi
add    %eax,%edi
imul   $0xaaaaaaab,%edi,%eax
add    $0x2aaaaaaa,%eax
cmp    $0x55555555,%eax
jb     1120 <power3+0x20>
xor    %eax,%eax
cmp    $0x1,%edi
sete   %al
ret

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

LLVM IR (-O2):
define i32 @power3(i32 %0) {
%2 = srem i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %9
4: ; preds = %1, %4
%5 = phi i32 [ %6, %4 ], [ %0, %1 ]
%6 = sdiv i32 %5, 3
%7 = srem i32 %6, 3
%8 = icmp eq i32 %7, 0
br i1 %8, label %4, label %9
9: ; preds = %4, %1
%10 = phi i32 [ %0, %1 ], [ %6, %4 ]
%11 = icmp eq i32 %10, 1
%12 = zext i1 %11 to i32
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Q_strncpyz(char *, int /*<<< orphan*/, int);
void Cmd_ArgvBuffer(int arg, char *buffer, int bufferLength) {
  Q_strncpyz(buffer, Cmd_Argv(arg), bufferLength);
}


x86 assembly (clang, -O0):
<Cmd_ArgvBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <Cmd_Argv@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x14(%rbp),%edx
call   1040 <Q_strncpyz@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_ArgvBuffer>:
push   %rbp
push   %rbx
push   %rax
mov    %edx,%ebp
mov    %rsi,%rbx
call   1030 <Cmd_Argv@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    %ebp,%edx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <Q_strncpyz@plt>

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

LLVM IR (-O2):
define void @Cmd_ArgvBuffer(i32 %0, i8* %1, i32 %2) {
%4 = tail call i32 @Cmd_Argv(i32 %0)
%5 = tail call i32 @Q_strncpyz(i8* %1, i32 %4, i32 %2)
ret void
}
/* Type definitions */
struct pci_dev {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ pci_remove_bus_device(struct pci_dev *);
int /*<<< orphan*/ pci_stop_bus_device(struct pci_dev *);
void pci_stop_and_remove_bus_device(struct pci_dev *dev) {
  pci_stop_bus_device(dev);
  pci_remove_bus_device(dev);
}


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

x86 assembly (clang, -O2):
<pci_stop_and_remove_bus_device>:
push   %rbx
mov    %rdi,%rbx
call   1040 <pci_stop_bus_device@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <pci_remove_bus_device@plt>

LLVM IR (-O0):
%struct.pci_dev = type { i32 }
define void @pci_stop_and_remove_bus_device(%struct.pci_dev* %0) {
%2 = alloca %struct.pci_dev*
store %struct.pci_dev* %0, %struct.pci_dev** %2
%3 = load %struct.pci_dev*, %struct.pci_dev** %2
%4 = call i32 @pci_stop_bus_device(%struct.pci_dev* %3)
%5 = load %struct.pci_dev*, %struct.pci_dev** %2
%6 = call i32 @pci_remove_bus_device(%struct.pci_dev* %5)
ret void
}

LLVM IR (-O2):
%struct.pci_dev = type { i32 }
define void @pci_stop_and_remove_bus_device(%struct.pci_dev* %0) {
%2 = tail call i32 @pci_stop_bus_device(%struct.pci_dev* %0)
%3 = tail call i32 @pci_remove_bus_device(%struct.pci_dev* %0)
ret void
}
/* Variables and functions */
float rcp(float);
float NewVisibility(float ldh, float alpha) {
  float k = alpha * 0.5;
  float k2 = k * k;
  float invK2 = 1.0f - k2;
  return rcp(ldh * ldh * invK2 + k2);
}


x86 assembly (clang, -O0):
<NewVisibility>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xed5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xea9(%rip),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  -0x14(%rbp),%xmm2
movss  -0x10(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
call   1030 <rcp@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<NewVisibility>:
mulss  0xee8(%rip),%xmm1
mulss  %xmm1,%xmm1
movss  0xee0(%rip),%xmm2
subss  %xmm1,%xmm2
mulss  %xmm0,%xmm0
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
jmp    1030 <rcp@plt>

LLVM IR (-O0):
define float @NewVisibility(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca float
%7 = alloca float
store float %0, float* %3
store float %1, float* %4
%8 = load float, float* %4
%9 = fpext float %8 to double
%10 = fmul double %9, 5.000000e-01
%11 = fptrunc double %10 to float
store float %11, float* %5
%12 = load float, float* %5
%13 = load float, float* %5
%14 = fmul float %12, %13
store float %14, float* %6
%15 = load float, float* %6
%16 = fsub float 1.000000e+00, %15
store float %16, float* %7
%17 = load float, float* %3
%18 = load float, float* %3
%19 = fmul float %17, %18
%20 = load float, float* %7
%21 = load float, float* %6
%22 = call float @llvm.fmuladd.f32(float %19, float %20, float %21)
%23 = call float @rcp(float %22)
ret float %23
}

LLVM IR (-O2):
define float @NewVisibility(float %0, float %1) {
%3 = fmul float %1, 5.000000e-01
%4 = fmul float %3, %3
%5 = fsub float 1.000000e+00, %4
%6 = fmul float %0, %0
%7 = tail call float @llvm.fmuladd.f32(float %6, float %5, float %4)
%8 = tail call float @rcp(float %7)
ret float %8
}
signed short signedshort_ignoring_unsignedchar(signed short x,
                                               unsigned char y) {
  return x;
}


x86 assembly (clang, -O0):
<signedshort_ignoring_unsignedchar>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %di,%cx
mov    %cx,-0x2(%rbp)
mov    %al,-0x3(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @signedshort_ignoring_unsignedchar(i16 signext %0, i8 zeroext %1) {
%3 = alloca i16
%4 = alloca i8
store i16 %0, i16* %3
store i8 %1, i8* %4
%5 = load i16, i16* %3
ret i16 %5
}

LLVM IR (-O2):
define signext i16 @signedshort_ignoring_unsignedchar(i16 returned signext %0, i8 zeroext %1) {
ret i16 %0
}
/* Variables and functions */
long GPUtest();
long ZN_GPUtest(void) { return GPUtest(); }


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

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

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

LLVM IR (-O2):
define i64 @ZN_GPUtest() {
%1 = tail call i64 (...) @GPUtest()
ret i64 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
__attribute__((visibility("hidden"))) void foo() { printf("TEST1\n"); }


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

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

LLVM IR (-O0):
@.str = [7 x i8] c"TEST1\0A\00"
define hidden void @foo() {
%1 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [6 x i8] c"TEST1\00"
define hidden void @foo() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @str, i64 0, i64 0))
ret void
}
int mixedints(int *a, unsigned int *b) {
  *a = 2;
  *b = 5;
  return *a;
}


x86 assembly (clang, -O0):
<mixedints>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x2,(%rax)
mov    -0x10(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixedints>:
movl   $0x2,(%rdi)
movl   $0x5,(%rsi)
mov    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @mixedints(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
store i32 2, i32* %5
%6 = load i32*, i32** %4
store i32 5, i32* %6
%7 = load i32*, i32** %3
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @mixedints(i32* nocapture %0, i32* nocapture writeonly %1) {
store i32 2, i32* %0
store i32 5, i32* %1
%3 = load i32, i32* %0
ret i32 %3
}
void Injector2ISR() {}


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

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

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

LLVM IR (-O2):
define void @Injector2ISR() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ dlclose(void *);
void unloadLibrary(void *handle) { dlclose(handle); }


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

x86 assembly (clang, -O2):
<unloadLibrary>:
jmp    1030 <dlclose@plt>

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

LLVM IR (-O2):
define void @unloadLibrary(i8* %0) {
%2 = tail call i32 @dlclose(i8* %0)
ret void
}
/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  unsigned long window;
};
typedef TYPE_1__ XDestroyWindowEvent;

/* Variables and functions */
void set_XDestroyWindowEvent_window(void *_p, unsigned long _v) {
  ((XDestroyWindowEvent *)_p)->window = (unsigned long)_v;
}


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

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

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

LLVM IR (-O2):
define void @set_XDestroyWindowEvent_window(i8* nocapture writeonly %0, i64 %1) {
%3 = bitcast i8* %0 to i64*
store i64 %1, i64* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main(void) {
  float x, y;
  int i, j;
  x = 1.5;
  y = 2.0;
  i = 2;
  j = 4;
  x = x * y + (float)i / j;
  printf("%f", x);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xedd(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
movl   $0x4,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0xc(%rbp),%xmm2
cvtsi2ssl -0x10(%rbp),%xmm1
cvtsi2ssl -0x14(%rbp),%xmm3
divss  %xmm3,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    0xe90(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
store float 1.500000e+00, float* %2
store float 2.000000e+00, float* %3
store i32 2, i32* %4
store i32 4, i32* %5
%6 = load float, float* %2
%7 = load float, float* %3
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to float
%10 = load i32, i32* %5
%11 = sitofp i32 %10 to float
%12 = fdiv float %9, %11
%13 = call float @llvm.fmuladd.f32(float %6, float %7, float %12)
store float %13, float* %2
%14 = load float, float* %2
%15 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float %14)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float 3.500000e+00)
ret i32 0
}
void ff_hevc_put_hevc_bi_epel_hv8_8_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_bi_epel_hv8_8_sse4() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_spin_matrix_Sz();
int /*<<< orphan*/ test_success(int /*<<< orphan*/, char *);
int main(void) { test_success(test_spin_matrix_Sz(), "TEST_SZ"); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <test_spin_matrix_Sz@plt>
mov    %eax,%edi
lea    0xecc(%rip),%rsi
call   1040 <test_success@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_spin_matrix_Sz@plt>
lea    0xed1(%rip),%rsi
mov    %eax,%edi
call   1040 <test_success@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [8 x i8] c"TEST_SZ\00"
define i32 @main() {
%1 = call i32 (...) @test_spin_matrix_Sz()
%2 = call i32 @test_success(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [8 x i8] c"TEST_SZ\00"
define i32 @main() {
%1 = tail call i32 (...) @test_spin_matrix_Sz()
%2 = tail call i32 @test_success(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
int test_imm_D1uint16_reg(unsigned short val) {
  return ((val) & (0xD1 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_D1uint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xd1,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_D1uint16_reg(i16 zeroext %0) {
%2 = and i16 %0, 209
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
char *strrchr(char const *, char);
const char *gnu_basename(const char *filename) {
  char *p = strrchr(filename, '/');
  return p ? p + 1 : (char *)filename;
}


x86 assembly (clang, -O0):
<gnu_basename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     114a <gnu_basename+0x3a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1152 <gnu_basename+0x42>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gnu_basename>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @gnu_basename(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i8* @strrchr(i8* %4, i8 signext 47)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
br label %13
11: ; preds = %1
%12 = load i8*, i8** %2
br label %13
13: ; preds = %11, %8
%14 = phi i8* [ %10, %8 ], [ %12, %11 ]
ret i8* %14
}

LLVM IR (-O2):
define i8* @gnu_basename(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i8 signext 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
opentrace() {
  char s[100];
  char *p;
  char *getenv();
  int flags;
}


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

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

LLVM IR (-O0):
define i32 @opentrace() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i8*
%4 = alloca i32
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
define i32 @opentrace() {
ret i32 undef
}
/* Variables and functions */
scalar_t__ __builtin_y1f(float);
int /*<<< orphan*/ link_failure_builtin_y1f();
void test_builtin_y1f(float f) {
  if (__builtin_y1f(f) != __builtin_y1f(f))
    link_failure_builtin_y1f();
}


x86 assembly (clang, -O0):
<test_builtin_y1f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_y1f@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <__builtin_y1f@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     115c <test_builtin_y1f+0x3c>
mov    $0x0,%al
call   1040 <link_failure_builtin_y1f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_builtin_y1f>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
call   1030 <__builtin_y1f@plt>
mov    %rax,%rbx
movss  0xc(%rsp),%xmm0
call   1030 <__builtin_y1f@plt>
cmp    %rax,%rbx
jne    1149 <test_builtin_y1f+0x29>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1040 <link_failure_builtin_y1f@plt>

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

LLVM IR (-O2):
define void @test_builtin_y1f(float %0) {
%2 = tail call i64 @__builtin_y1f(float %0)
%3 = tail call i64 @__builtin_y1f(float %0)
%4 = icmp eq i64 %2, %3
br i1 %4, label %7, label %5
5: ; preds = %1
%6 = tail call i32 (...) @link_failure_builtin_y1f()
br label %7
7: ; preds = %5, %1
ret void
}
int fits_bits(int x, int n) {
  int bits_of_int = sizeof(int) << 3;
  int shift_size = bits_of_int - n;
  int shift_left_then_right = (x << shift_size) >> shift_size;
  return x == shift_left_then_right;
}


x86 assembly (clang, -O0):
<fits_bits>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x20,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x10(%rbp),%ecx
shl    %cl,%eax
mov    -0x10(%rbp),%ecx
sar    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x14(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fits_bits>:
mov    %esi,%ecx
neg    %cl
mov    %edi,%edx
shl    %cl,%edx
sar    %cl,%edx
xor    %eax,%eax
cmp    %edi,%edx
sete   %al
ret

LLVM IR (-O0):
define i32 @fits_bits(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
store i32 32, i32* %5
%8 = load i32, i32* %5
%9 = load i32, i32* %4
%10 = sub nsw i32 %8, %9
store i32 %10, i32* %6
%11 = load i32, i32* %3
%12 = load i32, i32* %6
%13 = shl i32 %11, %12
%14 = load i32, i32* %6
%15 = ashr i32 %13, %14
store i32 %15, i32* %7
%16 = load i32, i32* %3
%17 = load i32, i32* %7
%18 = icmp eq i32 %16, %17
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
define i32 @fits_bits(i32 %0, i32 %1) {
%3 = sub nsw i32 32, %1
%4 = shl i32 %0, %3
%5 = ashr i32 %4, %3
%6 = icmp eq i32 %5, %0
%7 = zext i1 %6 to i32
ret i32 %7
}
int naMinuty(int h, int m) { return 60 * h + m; }


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

x86 assembly (clang, -O2):
<naMinuty>:
imul   $0x3c,%edi,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @naMinuty(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 = mul nsw i32 60, %5
%7 = load i32, i32* %4
%8 = add nsw i32 %6, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @naMinuty(i32 %0, i32 %1) {
%3 = mul nsw i32 %0, 60
%4 = add nsw i32 %3, %1
ret i32 %4
}
/* Type definitions */
struct fb_cmap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ FBIOPUTCMAP;
scalar_t__ ioctl(int, int /*<<< orphan*/, struct fb_cmap *);
int /*<<< orphan*/ perror(char *);
int fb_cmap_set(int fbfp, struct fb_cmap *cmap) {
  if (ioctl(fbfp, FBIOPUTCMAP, cmap)) {
    perror("ioctl FBIOPUTCMAP error\n");
    return -1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<fb_cmap_set>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2ea7(%rip),%rax
mov    (%rax),%esi
mov    -0x10(%rbp),%rdx
call   1030 <ioctl@plt>
cmp    $0x0,%rax
je     1166 <fb_cmap_set+0x46>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    116d <fb_cmap_set+0x4d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_cmap_set>:
push   %rax
mov    %rsi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    113e <fb_cmap_set+0x1e>
pop    %rcx
ret
lea    0xebb(%rip),%rdi
call   1040 <perror@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
%struct.fb_cmap = type { i32 }
@FBIOPUTCMAP = global i32 0
@.str = [25 x i8] c"ioctl FBIOPUTCMAP error\0A\00"
define i32 @fb_cmap_set(i32 %0, %struct.fb_cmap* %1) {
%3 = load i32, i32* @FBIOPUTCMAP
%4 = tail call i64 @ioctl(i32 %0, i32 %3, %struct.fb_cmap* %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %2, %6
%9 = phi i32 [ -1, %6 ], [ 0, %2 ]
ret i32 %9
}
/* Type definitions */
struct mt19937p {
  int dummy;
};

/* Variables and functions */
double genrand(struct mt19937p *);
double run_trial(struct mt19937p *mt) {
  double X = 0;
  X = genrand(mt);
  return X;
}


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

x86 assembly (clang, -O2):
<run_trial>:
jmp    1030 <genrand@plt>

LLVM IR (-O0):
%struct.mt19937p = type { i32 }
define double @run_trial(%struct.mt19937p* %0) {
%2 = alloca %struct.mt19937p*
%3 = alloca double
store %struct.mt19937p* %0, %struct.mt19937p** %2
store double 0.000000e+00, double* %3
%4 = load %struct.mt19937p*, %struct.mt19937p** %2
%5 = call double @genrand(%struct.mt19937p* %4)
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
%struct.mt19937p = type { i32 }
define double @run_trial(%struct.mt19937p* %0) {
%2 = tail call double @genrand(%struct.mt19937p* %0)
ret double %2
}
int test_comparison() {
  int x[] = {1, 2, 3, 4, 5};
  int *y = x + 1;
  if (!(x != y))
    return -1;
  if (!(x + 1 == y))
    return -1;
  if (!(x < y))
    return -1;
  if (!(x <= y))
    return -1;
  if (!(x + 5 != y))
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<test_comparison>:
push   %rbp
mov    %rsp,%rbp
mov    0xef5(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xef2(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xef0(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
lea    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jne    1149 <test_comparison+0x49>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <test_comparison+0xc0>
lea    -0x20(%rbp),%rax
add    $0x4,%rax
cmp    -0x28(%rbp),%rax
je     1167 <test_comparison+0x67>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <test_comparison+0xc0>
lea    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jb     1181 <test_comparison+0x81>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <test_comparison+0xc0>
lea    -0x20(%rbp),%rax
cmp    -0x28(%rbp),%rax
jbe    119b <test_comparison+0x9b>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <test_comparison+0xc0>
lea    -0x20(%rbp),%rax
add    $0x14,%rax
cmp    -0x28(%rbp),%rax
jne    11b9 <test_comparison+0xb9>
movl   $0xffffffff,-0x4(%rbp)
jmp    11c0 <test_comparison+0xc0>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@__const.test_comparison.x = [5 x i32] [i32 1, i32 2, i32 3, i32 4, i32 5]
define i32 @test_comparison() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32*
%4 = bitcast [5 x i32]* %2 to i8*
%5 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%6 = getelementptr inbounds i32, i32* %5, i64 1
store i32* %6, i32** %3
%7 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%8 = load i32*, i32** %3
%9 = icmp ne i32* %7, %8
br i1 %9, label %11, label %10
10: ; preds = %0
store i32 -1, i32* %1
br label %34
11: ; preds = %0
%12 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%13 = getelementptr inbounds i32, i32* %12, i64 1
%14 = load i32*, i32** %3
%15 = icmp eq i32* %13, %14
br i1 %15, label %17, label %16
16: ; preds = %11
store i32 -1, i32* %1
br label %34
17: ; preds = %11
%18 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%19 = load i32*, i32** %3
%20 = icmp ult i32* %18, %19
br i1 %20, label %22, label %21
21: ; preds = %17
store i32 -1, i32* %1
br label %34
22: ; preds = %17
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%24 = load i32*, i32** %3
%25 = icmp ule i32* %23, %24
br i1 %25, label %27, label %26
26: ; preds = %22
store i32 -1, i32* %1
br label %34
27: ; preds = %22
%28 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%29 = getelementptr inbounds i32, i32* %28, i64 5
%30 = load i32*, i32** %3
%31 = icmp ne i32* %29, %30
br i1 %31, label %33, label %32
32: ; preds = %27
store i32 -1, i32* %1
br label %34
33: ; preds = %27
store i32 0, i32* %1
br label %34
34: ; preds = %33, %32, %26, %21, %16, %10
%35 = load i32, i32* %1
ret i32 %35
}

LLVM IR (-O2):
define i32 @test_comparison() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
scalar_t__ calloc(int, int);
int /*<<< orphan*/ sprintf(char *, char *, int, int, int, int);
char *cast_uint_to_IPv4(uint32_t ip) {
  char *_ip = (char *)calloc(16, sizeof(char));
  sprintf(_ip, "%d.%d.%d.%d", (ip >> 24) & 0xFF, (ip >> 16) & 0xFF,
          (ip >> 8) & 0xFF, ip & 0xFF);
  return _ip;
}


x86 assembly (clang, -O0):
<cast_uint_to_IPv4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x4(%rbp),%edx
sar    $0x18,%edx
and    $0xff,%edx
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x4(%rbp),%r8d
sar    $0x8,%r8d
and    $0xff,%r8d
mov    -0x4(%rbp),%r9d
and    $0xff,%r9d
lea    0xe85(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cast_uint_to_IPv4>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
mov    $0x10,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,%r14
mov    %ebx,%edx
shr    $0x18,%edx
mov    %ebx,%eax
shr    $0x10,%eax
movzbl %al,%ecx
movzbl %bh,%eax
movzbl %bl,%r9d
lea    0xead(%rip),%rsi
mov    %r14,%rdi
mov    %eax,%r8d
call   1040 <sprintf@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @cast_uint_to_IPv4(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i64 @calloc(i32 16, i32 1)
%5 = inttoptr i64 %4 to i8*
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i32, i32* %2
%8 = ashr i32 %7, 24
%9 = and i32 %8, 255
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 255
%13 = load i32, i32* %2
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = load i32, i32* %2
%17 = and i32 %16, 255
%18 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %12, i32 %15, i32 %17)
%19 = load i8*, i8** %3
ret i8* %19
}

LLVM IR (-O2):
@.str = [12 x i8] c"%d.%d.%d.%d\00"
define i8* @cast_uint_to_IPv4(i32 %0) {
%2 = tail call i64 @calloc(i32 16, i32 1)
%3 = inttoptr i64 %2 to i8*
%4 = lshr i32 %0, 24
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
%9 = and i32 %0, 255
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %3, i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %6, i32 %8, i32 %9)
ret i8* %3
}
void BusFaultISR(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<BusFaultISR>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <BusFaultISR+0x9>
jmp    1109 <BusFaultISR+0x9>

x86 assembly (clang, -O2):
<BusFaultISR>:
jmp    1100 <BusFaultISR>

LLVM IR (-O0):
define void @BusFaultISR() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @BusFaultISR() {
br label %1
1: ; preds = %0, %1
br label %1
}
void g_str_equal() {}


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

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

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

LLVM IR (-O2):
define void @g_str_equal() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ find_range(char *);
void find_range_medium_test() {
  find_range("benchmarks"
             ".index.medium");
}


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

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

LLVM IR (-O0):
@.str = [24 x i8] c"benchmarks.index.medium\00"
define void @find_range_medium_test() {
%1 = call i32 @find_range(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"benchmarks.index.medium\00"
define void @find_range_medium_test() {
%1 = tail call i32 @find_range(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
ret void
}
void initialise(void) {}


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

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

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

LLVM IR (-O2):
define void @initialise() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ putdef(char *, char *, char *, int, char *);
void separator_new(char *widget, char *setting) {
  putdef("GtkWidget *", widget, "gtk_separator_new", 1, setting);
}


x86 assembly (clang, -O0):
<separator_new>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%r8
lea    0xed1(%rip),%rdi
lea    0xed6(%rip),%rdx
mov    $0x1,%ecx
call   1030 <putdef@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<separator_new>:
mov    %rsi,%r8
mov    %rdi,%rsi
lea    0xee3(%rip),%rdi
lea    0xee8(%rip),%rdx
mov    $0x1,%ecx
jmp    1030 <putdef@plt>

LLVM IR (-O0):
@.str = [12 x i8] c"GtkWidget *\00"
@.str.1 = [18 x i8] c"gtk_separator_new\00"
define void @separator_new(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 @putdef(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %5, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %6)
ret void
}

LLVM IR (-O2):
@.str = [12 x i8] c"GtkWidget *\00"
@.str.1 = [18 x i8] c"gtk_separator_new\00"
define void @separator_new(i8* %0, i8* %1) {
%3 = tail call i32 @putdef(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* %0, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 1, i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_sw_cvolume_multiply() {
  printf("NOT IMPLEMENTED:"
         "pa_sw_cvolume_multiply"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [39 x i8] c"NOT IMPLEMENTED:pa_sw_cvolume_multiply\00"
define i32 @pa_sw_cvolume_multiply() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Variables and functions */
unsigned long long int exp2(const unsigned long long int n) {
  return (n > 0 ? 2 * exp2(n - 1) : 1);
}


x86 assembly (clang, -O0):
<exp2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1141 <exp2+0x31>
mov    -0x8(%rbp),%rdi
sub    $0x1,%rdi
call   1030 <exp2@plt>
shl    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    114f <exp2+0x3f>
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    114f <exp2+0x3f>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exp2>:
test   %rdi,%rdi
je     1127 <exp2+0x17>
push   %rax
add    $0xffffffffffffffff,%rdi
call   1030 <exp2@plt>
add    %rax,%rax
add    $0x8,%rsp
ret
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i64 @exp2(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp ugt i64 %3, 0
br i1 %4, label %5, label %10
5: ; preds = %1
%6 = load i64, i64* %2
%7 = sub i64 %6, 1
%8 = call i64 @exp2(i64 %7)
%9 = mul i64 2, %8
br label %11
10: ; preds = %1
br label %11
11: ; preds = %10, %5
%12 = phi i64 [ %9, %5 ], [ 1, %10 ]
ret i64 %12
}

LLVM IR (-O2):
define i64 @exp2(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %3, label %5
3: ; preds = %1, %5
%4 = phi i64 [ %8, %5 ], [ 1, %1 ]
ret i64 %4
5: ; preds = %1
%6 = add i64 %0, -1
%7 = tail call i64 @exp2(i64 %6)
%8 = shl i64 %7, 1
br label %3
}
/* Variables and functions */
int AF_INET;
int /*<<< orphan*/ EPFNOSUPPORT;
#define PF_INET 128
int /*<<< orphan*/ errno;
int kcn_sockaddr_pf2af(int domain) {
  switch (domain) {
  case PF_INET:
    return AF_INET;
  default:
    errno = EPFNOSUPPORT;
    return -1;
  }
}


x86 assembly (clang, -O0):
<kcn_sockaddr_pf2af>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x80,%eax
jne    112b <kcn_sockaddr_pf2af+0x2b>
jmp    111a <kcn_sockaddr_pf2af+0x1a>
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    1144 <kcn_sockaddr_pf2af+0x44>
mov    0x2eae(%rip),%rax
mov    (%rax),%ecx
mov    0x2e95(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kcn_sockaddr_pf2af>:
cmp    $0x80,%edi
jne    1112 <kcn_sockaddr_pf2af+0x12>
mov    0x2ed9(%rip),%rax
mov    (%rax),%eax
ret
mov    0x2ec7(%rip),%rax
mov    (%rax),%eax
mov    0x2eae(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@AF_INET = global i32 0
@EPFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @kcn_sockaddr_pf2af(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %7 [
i32 128, label %5
]
5: ; preds = %1
%6 = load i32, i32* @AF_INET
store i32 %6, i32* %2
br label %9
7: ; preds = %1
%8 = load i32, i32* @EPFNOSUPPORT
store i32 %8, i32* @errno
store i32 -1, i32* %2
br label %9
9: ; preds = %7, %5
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
@AF_INET = global i32 0
@EPFNOSUPPORT = global i32 0
@errno = global i32 0
define i32 @kcn_sockaddr_pf2af(i32 %0) {
%2 = icmp eq i32 %0, 128
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = load i32, i32* @AF_INET
br label %7
5: ; preds = %1
%6 = load i32, i32* @EPFNOSUPPORT
store i32 %6, i32* @errno
br label %7
7: ; preds = %5, %3
%8 = phi i32 [ %4, %3 ], [ -1, %5 ]
ret i32 %8
}
__attribute__((target("avx,sse4.2"), used)) void foo_used2(int i, double d) {}


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

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

LLVM IR (-O0):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32, double)* @foo_used2 to i8*)], section "llvm.metadata"
define void @foo_used2(i32 %0, double %1) {
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %3
store double %1, double* %4
ret void
}

LLVM IR (-O2):
@llvm.compiler.used = appending global [1 x i8*] [i8* bitcast (void (i32, double)* @foo_used2 to i8*)], section "llvm.metadata"
define void @foo_used2(i32 %0, double %1) {
ret void
}