xunge/DecIR huggingface dataset:
/* Type definitions */
typedef scalar_t__ uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t get32lsb(const uint8_t *src) {
  return (((uint32_t)(src[0])) << 0) | (((uint32_t)(src[1])) << 8) |
         (((uint32_t)(src[2])) << 16) | (((uint32_t)(src[3])) << 24);
}


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

x86 assembly (clang, -O2):
<get32lsb>:
mov    0x8(%rdi),%ecx
mov    0x10(%rdi),%edx
shl    $0x8,%ecx
or     (%rdi),%ecx
shl    $0x10,%edx
mov    0x18(%rdi),%eax
shl    $0x18,%eax
or     %edx,%eax
or     %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @get32lsb(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = trunc i64 %2 to i32
%4 = getelementptr inbounds i64, i64* %0, i64 1
%5 = load i64, i64* %4
%6 = trunc i64 %5 to i32
%7 = shl i32 %6, 8
%8 = or i32 %7, %3
%9 = getelementptr inbounds i64, i64* %0, i64 2
%10 = load i64, i64* %9
%11 = trunc i64 %10 to i32
%12 = shl i32 %11, 16
%13 = or i32 %8, %12
%14 = getelementptr inbounds i64, i64* %0, i64 3
%15 = load i64, i64* %14
%16 = trunc i64 %15 to i32
%17 = shl i32 %16, 24
%18 = or i32 %13, %17
ret i32 %18
}
double depth_std_dev(double depth) {
  static const double depth_cov_z_factor = 1.425e-3;
  return depth_cov_z_factor * depth * depth;
}


x86 assembly (clang, -O0):
<depth_std_dev>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<depth_std_dev>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
@depth_std_dev.depth_cov_z_factor = internal constant double 1.425000e-03
define double @depth_std_dev(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 1.425000e-03, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
ret double %6
}

LLVM IR (-O2):
define double @depth_std_dev(double %0) {
%2 = fmul double %0, 1.425000e-03
%3 = fmul double %2, %0
ret double %3
}
float suma(float x, float y) { return x + y; }


x86 assembly (clang, -O0):
<suma>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<suma>:
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @suma(float %0, float %1) {
%3 = fadd float %0, %1
ret float %3
}
/* Type definitions */
struct tree_node {
  int dummy;
};

/* Variables and functions */
void swap(struct tree_node *array[], size_t i, size_t j) {
  struct tree_node *tmp = array[i];
  array[i] = array[j];
  array[j] = tmp;
}


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

x86 assembly (clang, -O2):
<swap>:
mov    (%rdi,%rsi,8),%rax
mov    (%rdi,%rdx,8),%rcx
mov    %rcx,(%rdi,%rsi,8)
mov    %rax,(%rdi,%rdx,8)
ret

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

LLVM IR (-O2):
%struct.tree_node = type { i32 }
define void @swap(%struct.tree_node** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds %struct.tree_node*, %struct.tree_node** %0, i64 %1
%5 = load %struct.tree_node*, %struct.tree_node** %4
%6 = getelementptr inbounds %struct.tree_node*, %struct.tree_node** %0, i64 %2
%7 = load %struct.tree_node*, %struct.tree_node** %6
store %struct.tree_node* %7, %struct.tree_node** %4
store %struct.tree_node* %5, %struct.tree_node** %6
ret void
}
long labs(long x) { return ((x < 0) ? -x : x); }


x86 assembly (clang, -O0):
<labs>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jge    1122 <labs+0x22>
xor    %eax,%eax
sub    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    112a <labs+0x2a>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i64 @labs(i64 %0) {
%2 = tail call i64 @llvm.abs.i64(i64 %0, i1 true)
ret i64 %2
}
/* Variables and functions */
int /*<<< orphan*/ CommandNext(unsigned int);
void CommandNextLine(unsigned int arg) {
  if (0 == arg)
    arg = 1;
  CommandNext(arg);
}


x86 assembly (clang, -O0):
<CommandNextLine>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmp    -0x4(%rbp),%eax
jne    112d <CommandNextLine+0x1d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <CommandNext@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CommandNextLine>:
test   %edi,%edi
mov    $0x1,%eax
cmove  %eax,%edi
jmp    1030 <CommandNext@plt>

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

LLVM IR (-O2):
define void @CommandNextLine(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i32 1, i32 %0
%4 = tail call i32 @CommandNext(i32 %3)
ret void
}
int PyDTrace_FUNCTION_ENTRY_ENABLED(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @PyDTrace_FUNCTION_ENTRY_ENABLED() {
ret i32 0
}
/* Type definitions */
struct btf_var_secinfo {
  int dummy;
};
struct btf_type {
  int dummy;
};

/* Variables and functions */
struct btf_var_secinfo *btf_var_secinfos(const struct btf_type *t) {
  return (struct btf_var_secinfo *)(t + 1);
}


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

x86 assembly (clang, -O2):
<btf_var_secinfos>:
lea    0x4(%rdi),%rax
ret

LLVM IR (-O0):
%struct.btf_var_secinfo = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_var_secinfo* @btf_var_secinfos(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
store %struct.btf_type* %0, %struct.btf_type** %2
%3 = load %struct.btf_type*, %struct.btf_type** %2
%4 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %3, i64 1
%5 = bitcast %struct.btf_type* %4 to %struct.btf_var_secinfo*
ret %struct.btf_var_secinfo* %5
}

LLVM IR (-O2):
%struct.btf_var_secinfo = type { i32 }
%struct.btf_type = type { i32 }
define %struct.btf_var_secinfo* @btf_var_secinfos(%struct.btf_type* readnone %0) {
%2 = getelementptr inbounds %struct.btf_type, %struct.btf_type* %0, i64 1
%3 = bitcast %struct.btf_type* %2 to %struct.btf_var_secinfo*
ret %struct.btf_var_secinfo* %3
}
void testClosureBLLrV(void (*closure)(char, long long), char a1, long long a2) {
  (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureBLLrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x9(%rbp),%cl
mov    -0x18(%rbp),%rsi
movsbl %cl,%edi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureBLLrV>:
mov    %rdi,%rax
mov    %esi,%edi
mov    %rdx,%rsi
jmp    *%rax

LLVM IR (-O0):
define void @testClosureBLLrV(void (i8, i64)* %0, i8 signext %1, i64 %2) {
%4 = alloca void (i8, i64)*
%5 = alloca i8
%6 = alloca i64
store void (i8, i64)* %0, void (i8, i64)** %4
store i8 %1, i8* %5
store i64 %2, i64* %6
%7 = load void (i8, i64)*, void (i8, i64)** %4
%8 = load i8, i8* %5
%9 = load i64, i64* %6
ret void
}

LLVM IR (-O2):
define void @testClosureBLLrV(void (i8, i64)* nocapture %0, i8 signext %1, i64 %2) {
tail call void %0(i8 signext %1, i64 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ msgErro(char *);
void erroEnd() { msgErro("END esperado!"); }


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"END esperado!\00"
define void @erroEnd() {
%1 = call i32 @msgErro(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"END esperado!\00"
define void @erroEnd() {
%1 = tail call i32 @msgErro(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
unsigned int ntohl(unsigned int);
unsigned int network_int_to_host(unsigned int x) { return ntohl(x); }


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

x86 assembly (clang, -O2):
<network_int_to_host>:
jmp    1030 <ntohl@plt>

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

LLVM IR (-O2):
define i32 @network_int_to_host(i32 %0) {
%2 = tail call i32 @ntohl(i32 %0)
ret i32 %2
}
/* Variables and functions */
int INT_MIN;
int mul5div8(int x) {
  int sign = (x & INT_MIN) == INT_MIN;
  int bias = (7 + !sign) & 7;
  int t = (x << 2) + x;
  return (t + bias) >> 3;
}


x86 assembly (clang, -O0):
<mul5div8>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    0x2ed7(%rip),%rcx
and    (%rcx),%eax
mov    0x2ece(%rip),%rcx
cmp    (%rcx),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x7,%eax
and    $0x7,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x2,%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
add    -0xc(%rbp),%eax
sar    $0x3,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mul5div8>:
mov    0x2ee1(%rip),%rax
lea    (%rdi,%rdi,4),%ecx
mov    %edi,%edx
not    %edx
test   %edx,(%rax)
lea    0x7(%rdi,%rdi,4),%eax
cmovne %ecx,%eax
sar    $0x3,%eax
ret

LLVM IR (-O0):
@INT_MIN = global i32 0
define i32 @mul5div8(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* @INT_MIN
%8 = and i32 %6, %7
%9 = load i32, i32* @INT_MIN
%10 = icmp eq i32 %8, %9
%11 = zext i1 %10 to i32
store i32 %11, i32* %3
%12 = load i32, i32* %3
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = zext i1 %14 to i32
%16 = add nsw i32 7, %15
%17 = and i32 %16, 7
store i32 %17, i32* %4
%18 = load i32, i32* %2
%19 = shl i32 %18, 2
%20 = load i32, i32* %2
%21 = add nsw i32 %19, %20
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = load i32, i32* %4
%24 = add nsw i32 %22, %23
%25 = ashr i32 %24, 3
ret i32 %25
}

LLVM IR (-O2):
@INT_MIN = global i32 0
define i32 @mul5div8(i32 %0) {
%2 = load i32, i32* @INT_MIN
%3 = and i32 %2, %0
%4 = icmp eq i32 %3, %2
%5 = select i1 %4, i32 7, i32 0
%6 = mul i32 %0, 5
%7 = add nsw i32 %5, %6
%8 = ashr i32 %7, 3
ret i32 %8
}
/* Variables and functions */
double popNumber();
int /*<<< orphan*/ pushNumber(double);
void basMin() {
  double a, b;
  a = popNumber();
  b = popNumber();
  if (b < a)
    a = b;
  pushNumber(a);
}


x86 assembly (clang, -O0):
<basMin>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <popNumber@plt>
movsd  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <popNumber@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm1
movsd  -0x8(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    115e <basMin+0x3e>
movsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <pushNumber@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<basMin>:
push   %rax
xor    %eax,%eax
call   1040 <popNumber@plt>
movsd  %xmm0,(%rsp)
xor    %eax,%eax
call   1040 <popNumber@plt>
minsd  (%rsp),%xmm0
pop    %rax
jmp    1030 <pushNumber@plt>

LLVM IR (-O0):
define void @basMin() {
%1 = alloca double
%2 = alloca double
%3 = call double (...) @popNumber()
store double %3, double* %1
%4 = call double (...) @popNumber()
store double %4, double* %2
%5 = load double, double* %2
%6 = load double, double* %1
%7 = fcmp olt double %5, %6
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = load double, double* %2
store double %9, double* %1
br label %10
10: ; preds = %8, %0
%11 = load double, double* %1
%12 = call i32 @pushNumber(double %11)
ret void
}

LLVM IR (-O2):
define void @basMin() {
%1 = tail call double (...) @popNumber()
%2 = tail call double (...) @popNumber()
%3 = fcmp olt double %2, %1
%4 = select i1 %3, double %2, double %1
%5 = tail call i32 @pushNumber(double %4)
ret void
}
/* Type definitions */
struct termios {
  int dummy;
};

/* Variables and functions */
int tcgetattr(int, struct termios *);
int gp_save_term(int fd, struct termios *tios) { return tcgetattr(fd, tios); }


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

x86 assembly (clang, -O2):
<gp_save_term>:
jmp    1030 <tcgetattr@plt>

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

LLVM IR (-O2):
%struct.termios = type { i32 }
define i32 @gp_save_term(i32 %0, %struct.termios* %1) {
%3 = tail call i32 @tcgetattr(i32 %0, %struct.termios* %1)
ret i32 %3
}
unsigned int foo(unsigned long long x) {
  unsigned int u;
  if (x == 0)
    return 0;
  u = (unsigned int)(x >> 32);
  return u;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    111f <foo+0x1f>
movl   $0x0,-0x4(%rbp)
jmp    1130 <foo+0x30>
mov    -0x10(%rbp),%rax
shr    $0x20,%rax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    %rdi,%rax
shr    $0x20,%rax
xor    %ecx,%ecx
test   %rdi,%rdi
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @foo(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
%5 = load i64, i64* %3
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 0, i32* %2
br label %13
8: ; preds = %1
%9 = load i64, i64* %3
%10 = lshr i64 %9, 32
%11 = trunc i64 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %4
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %7
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @foo(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = lshr i64 %0, 32
%4 = trunc i64 %3 to i32
%5 = select i1 %2, i32 0, i32 %4
ret i32 %5
}
/* Type definitions */
struct sCC1101PhyInfo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CC1101Write(struct sCC1101PhyInfo *, unsigned char, void *,
                               int /*<<< orphan*/);
void CC1101Strobe(struct sCC1101PhyInfo *phyInfo, unsigned char command) {
  CC1101Write(phyInfo, (command & 0xBF), (void *)0, 0);
}


x86 assembly (clang, -O0):
<CC1101Strobe>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
movzbl -0x9(%rbp),%eax
and    $0xbf,%eax
xor    %ecx,%ecx
mov    %ecx,%edx
xor    %ecx,%ecx
movzbl %al,%esi
call   1030 <CC1101Write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CC1101Strobe>:
and    $0xffffffbf,%esi
xor    %edx,%edx
xor    %ecx,%ecx
jmp    1030 <CC1101Write@plt>

LLVM IR (-O0):
%struct.sCC1101PhyInfo = type { i32 }
define void @CC1101Strobe(%struct.sCC1101PhyInfo* %0, i8 zeroext %1) {
%3 = alloca %struct.sCC1101PhyInfo*
%4 = alloca i8
store %struct.sCC1101PhyInfo* %0, %struct.sCC1101PhyInfo** %3
store i8 %1, i8* %4
%5 = load %struct.sCC1101PhyInfo*, %struct.sCC1101PhyInfo** %3
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = and i32 %7, 191
%9 = trunc i32 %8 to i8
%10 = call i32 @CC1101Write(%struct.sCC1101PhyInfo* %5, i8 zeroext %9, i8* null, i32 0)
ret void
}

LLVM IR (-O2):
%struct.sCC1101PhyInfo = type { i32 }
define void @CC1101Strobe(%struct.sCC1101PhyInfo* %0, i8 zeroext %1) {
%3 = and i8 %1, -65
%4 = tail call i32 @CC1101Write(%struct.sCC1101PhyInfo* %0, i8 zeroext %3, i8* null, i32 0)
ret void
}
/* Variables and functions */
size_t comm_printer_write(char *, int /*<<< orphan*/);
int /*<<< orphan*/ strlen(char *);
size_t comm_printer_writestring(char *buffer) {
  return (comm_printer_write(buffer, strlen(buffer)));
}


x86 assembly (clang, -O0):
<comm_printer_writestring>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x10(%rbp),%rdi
mov    %eax,%esi
call   1040 <comm_printer_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<comm_printer_writestring>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <comm_printer_write@plt>

LLVM IR (-O0):
define i64 @comm_printer_writestring(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @strlen(i8* %4)
%6 = call i64 @comm_printer_write(i8* %3, i32 %5)
ret i64 %6
}

LLVM IR (-O2):
define i64 @comm_printer_writestring(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = tail call i64 @comm_printer_write(i8* %0, i32 %2)
ret i64 %3
}
/* Variables and functions */
int iguistep_(float *, int *);
int iguistep(float pparcs[], int kdatim[]) { return iguistep_(pparcs, kdatim); }


x86 assembly (clang, -O0):
<iguistep>:
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 <iguistep_@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iguistep>:
jmp    1030 <iguistep_@plt>

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

LLVM IR (-O2):
define i32 @iguistep(float* %0, i32* %1) {
%3 = tail call i32 @iguistep_(float* %0, i32* %1)
ret i32 %3
}
int emac1_ifouterrors_set(unsigned int dev_id,
                          union emac1_ifouterrors_u *value) {
  return 1;
}


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

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

LLVM IR (-O0):
%union.emac1_ifouterrors_u = type opaque
define i32 @emac1_ifouterrors_set(i32 %0, %union.emac1_ifouterrors_u* %1) {
%3 = alloca i32
%4 = alloca %union.emac1_ifouterrors_u*
store i32 %0, i32* %3
store %union.emac1_ifouterrors_u* %1, %union.emac1_ifouterrors_u** %4
ret i32 1
}

LLVM IR (-O2):
%union.emac1_ifouterrors_u = type opaque
define i32 @emac1_ifouterrors_set(i32 %0, %union.emac1_ifouterrors_u* nocapture readnone %1) {
ret i32 1
}
char serializer_read_char(char *src, int *pointer) {
  char value = src[*pointer];
  (*pointer) += 1;
  return value;
}


x86 assembly (clang, -O0):
<serializer_read_char>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movslq (%rcx),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
movsbl -0x11(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<serializer_read_char>:
movslq (%rsi),%rcx
mov    (%rdi,%rcx,1),%al
add    $0x1,%ecx
mov    %ecx,(%rsi)
ret

LLVM IR (-O0):
define signext i8 @serializer_read_char(i8* %0, i32* %1) {
%3 = alloca i8*
%4 = alloca i32*
%5 = alloca i8
store i8* %0, i8** %3
store i32* %1, i32** %4
%6 = load i8*, i8** %3
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds i8, i8* %6, i64 %9
%11 = load i8, i8* %10
store i8 %11, i8* %5
%12 = load i32*, i32** %4
%13 = load i32, i32* %12
%14 = add nsw i32 %13, 1
store i32 %14, i32* %12
%15 = load i8, i8* %5
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @serializer_read_char(i8* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = sext i32 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = add nsw i32 %3, 1
store i32 %7, i32* %1
ret i8 %6
}
/* Variables and functions */
int /*<<< orphan*/ jet_sleep(int);
int write_block(int, int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/,
                int /*<<< orphan*/, int /*<<< orphan*/);
int dynamixelStartSynchMove() {
  int ret = write_block(106, 0, 0, 0, 0, 0);
  jet_sleep(50);
  return ret;
}


x86 assembly (clang, -O0):
<dynamixelStartSynchMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x6a,%edi
xor    %r9d,%r9d
mov    %r9d,%esi
mov    %r9d,%edx
mov    %r9d,%ecx
mov    %r9d,%r8d
call   1030 <write_block@plt>
mov    %eax,-0x4(%rbp)
mov    $0x32,%edi
call   1040 <jet_sleep@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dynamixelStartSynchMove>:
push   %rbx
mov    $0x6a,%edi
xor    %esi,%esi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
xor    %r9d,%r9d
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 @dynamixelStartSynchMove() {
%1 = alloca i32
%2 = call i32 @write_block(i32 106, i32 0, i32 0, i32 0, i32 0, i32 0)
store i32 %2, i32* %1
%3 = call i32 @jet_sleep(i32 50)
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @dynamixelStartSynchMove() {
%1 = tail call i32 @write_block(i32 106, i32 0, i32 0, i32 0, i32 0, i32 0)
%2 = tail call i32 @jet_sleep(i32 50)
ret i32 %1
}
/* Type definitions */
typedef int /*<<< orphan*/ X509_NAME;

/* Variables and functions */
int /*<<< orphan*/ NID_localityName;
char const *req_GetNameNid(int /*<<< orphan*/ *, int /*<<< orphan*/);
const char *req_GetName_L(X509_NAME *name) {
  return req_GetNameNid(name, NID_localityName);
}


x86 assembly (clang, -O0):
<req_GetName_L>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2eb1(%rip),%rax
mov    (%rax),%esi
call   1030 <req_GetNameNid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<req_GetName_L>:
mov    0x2ec1(%rip),%rax
mov    (%rax),%esi
jmp    1030 <req_GetNameNid@plt>

LLVM IR (-O0):
@NID_localityName = global i32 0
define i8* @req_GetName_L(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* @NID_localityName
%5 = call i8* @req_GetNameNid(i32* %3, i32 %4)
ret i8* %5
}

LLVM IR (-O2):
@NID_localityName = global i32 0
define i8* @req_GetName_L(i32* %0) {
%2 = load i32, i32* @NID_localityName
%3 = tail call i8* @req_GetNameNid(i32* %0, i32 %2)
ret i8* %3
}
/* Type definitions */
struct byte_buf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ write_str(struct byte_buf *, char *);
void write_int(struct byte_buf *buf, int i) {
  char foo[30];
  foo[0] = '\0';
  sprintf(foo, "%d", i);
  write_str(buf, foo);
}


x86 assembly (clang, -O0):
<write_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movb   $0x0,-0x30(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%edx
lea    0xebf(%rip),%rsi
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1030 <write_str@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_int>:
push   %r14
push   %rbx
sub    $0x28,%rsp
mov    %esi,%edx
mov    %rdi,%rbx
movb   $0x0,(%rsp)
lea    0xec9(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <write_str@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.byte_buf = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @write_int(%struct.byte_buf* %0, i32 %1) {
%3 = alloca %struct.byte_buf*
%4 = alloca i32
%5 = alloca [30 x i8]
store %struct.byte_buf* %0, %struct.byte_buf** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
store i8 0, i8* %6
%7 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %7, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %8)
%10 = load %struct.byte_buf*, %struct.byte_buf** %3
%11 = getelementptr inbounds [30 x i8], [30 x i8]* %5, i64 0, i64 0
%12 = call i32 @write_str(%struct.byte_buf* %10, i8* %11)
ret void
}

LLVM IR (-O2):
%struct.byte_buf = type { i32 }
@.str = [3 x i8] c"%d\00"
define void @write_int(%struct.byte_buf* %0, i32 %1) {
%3 = alloca [30 x i8]
%4 = getelementptr inbounds [30 x i8], [30 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @write_str(%struct.byte_buf* %0, i8* %4)
ret void
}
unsigned int rand_num(unsigned int max, unsigned int *state) {
  *state *= 1103515245 + 12345;
  return ((*state / 65536) % max);
}


x86 assembly (clang, -O0):
<rand_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
imul   $0x41c67ea6,(%rax),%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
shr    $0x10,%eax
xor    %edx,%edx
divl   -0x4(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_num>:
imul   $0x41c67ea6,(%rsi),%eax
mov    %eax,(%rsi)
shr    $0x10,%eax
xor    %edx,%edx
div    %edi
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @rand_num(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %5
%7 = mul i32 %6, 1103527590
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = udiv i32 %9, 65536
%11 = load i32, i32* %3
%12 = urem i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @rand_num(i32 %0, i32* nocapture %1) {
%3 = load i32, i32* %1
%4 = mul i32 %3, 1103527590
store i32 %4, i32* %1
%5 = lshr i32 %4, 16
%6 = urem i32 %5, %0
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ empty;

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_DETACH_FILTER;
int /*<<< orphan*/ panic(char *);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
void bpf_detach_from_sock(int sock) {
  int ret, empty = 0;
  ret = setsockopt(sock, SOL_SOCKET, SO_DETACH_FILTER, &empty, sizeof(empty));
  if (ret < 0)
    panic("Cannot detach filter from socket!\n");
}


x86 assembly (clang, -O0):
<bpf_detach_from_sock>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
mov    0x2e9b(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    116f <bpf_detach_from_sock+0x4f>
lea    0xe96(%rip),%rdi
call   1040 <panic@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpf_detach_from_sock>:
push   %rax
movl   $0x0,0x4(%rsp)
mov    0x2eb8(%rip),%rax
mov    (%rax),%esi
mov    0x2ea7(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
test   %eax,%eax
js     1151 <bpf_detach_from_sock+0x31>
pop    %rax
ret
lea    0xea8(%rip),%rdi
call   1040 <panic@plt>
pop    %rax
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_DETACH_FILTER = global i32 0
@.str = [35 x i8] c"Cannot detach filter from socket!\0A\00"
define void @bpf_detach_from_sock(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_DETACH_FILTER
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %4, i32 4)
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %1
%12 = call i32 @panic(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_DETACH_FILTER = global i32 0
@.str = [35 x i8] c"Cannot detach filter from socket!\0A\00"
define void @bpf_detach_from_sock(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_DETACH_FILTER
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
%7 = icmp slt i32 %6, 0
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = call i32 @panic(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8, %1
ret void
}
void inst_mc68851_psave() {
  slog("%s: Error, not implemented!\n", __func__);
  assert(!"blowup");
}


x86 assembly (clang, -O0):
<inst_mc68851_psave>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xeeb(%rip),%rsi
mov    $0x0,%al
call   1040 <slog@plt>
xor    %edi,%edi
mov    $0x0,%al
call   1030 <assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<inst_mc68851_psave>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xeee(%rip),%rsi
xor    %eax,%eax
call   1040 <slog@plt>
xor    %edi,%edi
xor    %eax,%eax
pop    %rcx
jmp    1030 <assert@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%s: Error, not implemented!\0A\00"
@__func__.inst_mc68851_psave = [19 x i8] c"inst_mc68851_psave\00"
@.str.1 = [7 x i8] c"blowup\00"
define void @inst_mc68851_psave() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @slog to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.inst_mc68851_psave, i64 0, i64 0))
%2 = call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%s: Error, not implemented!\0A\00"
@__func__.inst_mc68851_psave = [19 x i8] c"inst_mc68851_psave\00"
define void @inst_mc68851_psave() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @slog to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @__func__.inst_mc68851_psave, i64 0, i64 0))
%2 = tail call i32 (i32, ...) bitcast (i32 (...)* @assert to i32 (i32, ...)*)(i32 0)
ret void
}
/* Variables and functions */
double __ocml_exp_f64(double);
double exp(double x) { return __ocml_exp_f64(x); }


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

x86 assembly (clang, -O2):
<exp>:
jmp    1030 <__ocml_exp_f64@plt>

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

LLVM IR (-O2):
define double @exp(double %0) {
%2 = tail call double @__ocml_exp_f64(double %0)
ret double %2
}
/* Variables and functions */
scalar_t__ strcmp(char const *, char const *);
char *synctex_ignore_leading_dot_slash(char const *);
int _synctex_is_equivalent_file_name(const char *lhs, const char *rhs) {
  lhs = synctex_ignore_leading_dot_slash(lhs);
  rhs = synctex_ignore_leading_dot_slash(rhs);
  return 0 == strcmp(lhs, rhs) ? -1 : 0;
}


x86 assembly (clang, -O0):
<_synctex_is_equivalent_file_name>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <synctex_ignore_leading_dot_slash@plt>
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <synctex_ignore_leading_dot_slash@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
mov    %rax,%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %eax,%eax
mov    $0xffffffff,%ecx
cmp    %rsi,%rdx
cmove  %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_synctex_is_equivalent_file_name>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
call   1040 <synctex_ignore_leading_dot_slash@plt>
mov    %rax,%rbx
mov    %r14,%rdi
call   1040 <synctex_ignore_leading_dot_slash@plt>
mov    %rbx,%rdi
mov    %rax,%rsi
call   1030 <strcmp@plt>
cmp    $0x1,%rax
sbb    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @_synctex_is_equivalent_file_name(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i8* @synctex_ignore_leading_dot_slash(i8* %5)
store i8* %6, i8** %3
%7 = load i8*, i8** %4
%8 = call i8* @synctex_ignore_leading_dot_slash(i8* %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i64 @strcmp(i8* %9, i8* %10)
%12 = icmp eq i64 0, %11
%13 = zext i1 %12 to i64
%14 = select i1 %12, i32 -1, i32 0
ret i32 %14
}

LLVM IR (-O2):
define i32 @_synctex_is_equivalent_file_name(i8* %0, i8* %1) {
%3 = tail call i8* @synctex_ignore_leading_dot_slash(i8* %0)
%4 = tail call i8* @synctex_ignore_leading_dot_slash(i8* %1)
%5 = tail call i64 @strcmp(i8* %3, i8* %4)
%6 = icmp eq i64 %5, 0
%7 = sext i1 %6 to i32
ret i32 %7
}
const char *REGISTER_NAME(int regno) { return "??"; }


x86 assembly (clang, -O0):
<REGISTER_NAME>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
lea    0xef2(%rip),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [3 x i8] c"??\00"
define i8* @REGISTER_NAME(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [3 x i8] c"??\00"
define i8* @REGISTER_NAME(i32 %0) {
ret i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printsignals(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ warnx(char *, char const *);
void nosig(const char *name) {
  warnx("unknown signal %s; valid signals:", name);
  printsignals(stderr);
  exit(2);
}


x86 assembly (clang, -O0):
<nosig>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xeb9(%rip),%rdi
call   1030 <warnx@plt>
mov    0x2e8d(%rip),%rax
mov    (%rax),%edi
call   1050 <printsignals@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<nosig>:
push   %rax
mov    %rdi,%rsi
lea    0xec5(%rip),%rdi
call   1030 <warnx@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <printsignals@plt>
mov    $0x2,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"unknown signal %s; valid signals:\00"
@stderr = global i32 0
define void @nosig(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @warnx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = load i32, i32* @stderr
%6 = call i32 @printsignals(i32 %5)
%7 = call i32 @exit(i32 2)
unreachable
}

LLVM IR (-O2):
@.str = [34 x i8] c"unknown signal %s; valid signals:\00"
@stderr = global i32 0
define void @nosig(i8* %0) {
%2 = tail call i32 @warnx(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i8* %0)
%3 = load i32, i32* @stderr
%4 = tail call i32 @printsignals(i32 %3)
%5 = tail call i32 @exit(i32 2)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ rowInHigh();
int /*<<< orphan*/ rowInLow();
int /*<<< orphan*/ rowclk();
void resetRows(void) {
  int row;
  rowInLow();
  for (row = 8 - 1; row > 0; row--) {
    rowclk();
  }
  rowInHigh();
  rowclk();
  rowInLow();
  return;
}


x86 assembly (clang, -O0):
<resetRows>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rowInLow@plt>
movl   $0x7,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1165 <resetRows+0x35>
mov    $0x0,%al
call   1040 <rowclk@plt>
mov    -0x4(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x4(%rbp)
jmp    1146 <resetRows+0x16>
mov    $0x0,%al
call   1050 <rowInHigh@plt>
mov    $0x0,%al
call   1040 <rowclk@plt>
mov    $0x0,%al
call   1030 <rowInLow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<resetRows>:
push   %rax
xor    %eax,%eax
call   1030 <rowInLow@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
call   1050 <rowInHigh@plt>
xor    %eax,%eax
call   1040 <rowclk@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <rowInLow@plt>

LLVM IR (-O0):
define void @resetRows() {
%1 = alloca i32
%2 = call i32 (...) @rowInLow()
store i32 7, i32* %1
br label %3
3: ; preds = %8, %0
%4 = load i32, i32* %1
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = call i32 (...) @rowclk()
br label %8
8: ; preds = %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, -1
store i32 %10, i32* %1
br label %3
11: ; preds = %3
%12 = call i32 (...) @rowInHigh()
%13 = call i32 (...) @rowclk()
%14 = call i32 (...) @rowInLow()
ret void
}

LLVM IR (-O2):
define void @resetRows() {
%1 = tail call i32 (...) @rowInLow()
%2 = tail call i32 (...) @rowclk()
%3 = tail call i32 (...) @rowclk()
%4 = tail call i32 (...) @rowclk()
%5 = tail call i32 (...) @rowclk()
%6 = tail call i32 (...) @rowclk()
%7 = tail call i32 (...) @rowclk()
%8 = tail call i32 (...) @rowclk()
%9 = tail call i32 (...) @rowInHigh()
%10 = tail call i32 (...) @rowclk()
%11 = tail call i32 (...) @rowInLow()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
float mtgp32_temper_float(const uint32_t flt_tmp_tbl[16], uint32_t r,
                          uint32_t t) {
  union {
    uint32_t u;
    float f;
  } x;
  t ^= t >> 16;
  t ^= t >> 8;
  r = r >> 9;
  x.u = r ^ flt_tmp_tbl[t & 0x0f];
  return x.f;
}


x86 assembly (clang, -O0):
<mtgp32_temper_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x10,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sar    $0x8,%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x9,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%edx
and    $0xf,%edx
movslq %edx,%rdx
xor    (%rcx,%rdx,4),%eax
mov    %eax,-0x18(%rbp)
movss  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mtgp32_temper_float>:
mov    %edx,%eax
sar    $0x10,%eax
xor    %edx,%eax
mov    %eax,%ecx
shr    $0x8,%ecx
xor    %eax,%ecx
sar    $0x9,%esi
and    $0xf,%ecx
xor    (%rdi,%rcx,4),%esi
movd   %esi,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { i32 }
define float @mtgp32_temper_float(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %union.anon
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %6
%9 = ashr i32 %8, 16
%10 = load i32, i32* %6
%11 = xor i32 %10, %9
store i32 %11, i32* %6
%12 = load i32, i32* %6
%13 = ashr i32 %12, 8
%14 = load i32, i32* %6
%15 = xor i32 %14, %13
store i32 %15, i32* %6
%16 = load i32, i32* %5
%17 = ashr i32 %16, 9
store i32 %17, i32* %5
%18 = load i32, i32* %5
%19 = load i32*, i32** %4
%20 = load i32, i32* %6
%21 = and i32 %20, 15
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds i32, i32* %19, i64 %22
%24 = load i32, i32* %23
%25 = xor i32 %18, %24
%26 = bitcast %union.anon* %7 to i32*
store i32 %25, i32* %26
%27 = bitcast %union.anon* %7 to float*
%28 = load float, float* %27
ret float %28
}

LLVM IR (-O2):
define float @mtgp32_temper_float(i32* nocapture %0, i32 %1, i32 %2) {
%4 = ashr i32 %2, 16
%5 = xor i32 %4, %2
%6 = lshr i32 %5, 8
%7 = xor i32 %6, %5
%8 = ashr i32 %1, 9
%9 = and i32 %7, 15
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %0, i64 %10
%12 = load i32, i32* %11
%13 = xor i32 %12, %8
%14 = bitcast i32 %13 to float
ret float %14
}
/* Type definitions */
typedef int uint64_t;
struct timespec {
  int tv_sec;
  int tv_nsec;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
int /*<<< orphan*/ clock_gettime(int /*<<< orphan*/, struct timespec *);
uint64_t clock_get_ns(void) {
  struct timespec ts;
  clock_gettime(CLOCK_MONOTONIC, &ts);
  return ts.tv_sec * (uint64_t)1000000000 + ts.tv_nsec;
}


x86 assembly (clang, -O0):
<clock_get_ns>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,-0x8(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_get_ns>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
imul   $0x3b9aca00,(%rsp),%eax
add    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @clock_get_ns() {
%1 = alloca %struct.timespec
%2 = load i32, i32* @CLOCK_MONOTONIC
%3 = call i32 @clock_gettime(i32 %2, %struct.timespec* %1)
%4 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i32 0, i32 1
%8 = load i32, i32* %7
%9 = add nsw i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32, i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @clock_get_ns() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i32 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = mul nsw i32 %6, 1000000000
%8 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void print_one(void) { puts("One"); }


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"One\00"
define void @print_one() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
void lis3l02dq_remove_trigger(struct iio_dev *indio_dev) {}


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

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

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

LLVM IR (-O2):
%struct.iio_dev = type opaque
define void @lis3l02dq_remove_trigger(%struct.iio_dev* nocapture %0) {
ret void
}
int fun(char x) {
  long y = x + 1;
  ;
  {
    int x = 10;
    ;
    y = y + x;
    ;
    {
      long x = 30;
      ;
      y = y + x;
      ;
    };
    y = y + x;
  };
  y = y + x;
  ;
  return y;
}


x86 assembly (clang, -O0):
<fun>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
movl   $0xa,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
movq   $0x1e,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbq -0x1(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fun>:
lea    (%rdi,%rdi,1),%eax
add    $0x33,%eax
ret

LLVM IR (-O0):
define i32 @fun(i8 signext %0) {
%2 = alloca i8
%3 = alloca i64
%4 = alloca i32
%5 = alloca i64
store i8 %0, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
%8 = add nsw i32 %7, 1
%9 = sext i32 %8 to i64
store i64 %9, i64* %3
store i32 10, i32* %4
%10 = load i64, i64* %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = add nsw i64 %10, %12
store i64 %13, i64* %3
store i64 30, i64* %5
%14 = load i64, i64* %3
%15 = load i64, i64* %5
%16 = add nsw i64 %14, %15
store i64 %16, i64* %3
%17 = load i64, i64* %3
%18 = load i32, i32* %4
%19 = sext i32 %18 to i64
%20 = add nsw i64 %17, %19
store i64 %20, i64* %3
%21 = load i64, i64* %3
%22 = load i8, i8* %2
%23 = sext i8 %22 to i64
%24 = add nsw i64 %21, %23
store i64 %24, i64* %3
%25 = load i64, i64* %3
%26 = trunc i64 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
define i32 @fun(i8 signext %0) {
%2 = sext i8 %0 to i32
%3 = shl nsw i32 %2, 1
%4 = add nsw i32 %3, 51
ret i32 %4
}