xunge/DecIR huggingface dataset:
/* Variables and functions */
int f(int);
int g(int *);
int h(double);
int main(void) {
  int x = 0;
  return f(1) + g(&x) + h(3.3);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x1,%edi
call   1040 <f@plt>
mov    %eax,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
call   1050 <g@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
movsd  0xe92(%rip),%xmm0
call   1030 <h@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %rbx
push   %rax
movl   $0x0,0x4(%rsp)
mov    $0x1,%edi
call   1040 <f@plt>
mov    %eax,%ebx
lea    0x4(%rsp),%rdi
call   1050 <g@plt>
mov    %eax,%ebp
add    %ebx,%ebp
movsd  0xea3(%rip),%xmm0
call   1030 <h@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 @f(i32 1)
%4 = call i32 @g(i32* %2)
%5 = add nsw i32 %3, %4
%6 = call i32 @h(double 3.300000e+00)
%7 = add nsw i32 %5, %6
ret i32 %7
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%3 = tail call i32 @f(i32 1)
%4 = call i32 @g(i32* %1)
%5 = add nsw i32 %4, %3
%6 = call i32 @h(double 3.300000e+00)
%7 = add nsw i32 %5, %6
ret i32 %7
}
void get_environment_settings(void) {}


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

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

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

LLVM IR (-O2):
define void @get_environment_settings() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void substract(int a, int b) { printf("Substraction is %d;\n", a - b); }


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

x86 assembly (clang, -O2):
<substract>:
mov    %edi,%eax
sub    %esi,%eax
lea    0xee5(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"Substraction is %d;\0A\00"
define void @substract(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"Substraction is %d;\0A\00"
define void @substract(i32 %0, i32 %1) {
%3 = sub nsw i32 %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_case1();
int /*<<< orphan*/ test_case2();
int /*<<< orphan*/ test_case3();
int main(void) {
  test_case1();
  test_case2();
  test_case3();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_case1()
%2 = tail call i32 (...) @test_case2()
%3 = tail call i32 (...) @test_case3()
ret i32 0
}
float glmComputeQuaternionNormf(const float q[4]) {
  return q[0] * q[0] + q[1] * q[1] + q[2] * q[2] + q[3] * q[3];
}


x86 assembly (clang, -O0):
<glmComputeQuaternionNormf>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm2
mov    -0x8(%rbp),%rax
movss  0x4(%rax),%xmm1
mov    -0x8(%rbp),%rax
mulss  0x4(%rax),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm1
mov    -0x8(%rbp),%rax
movss  0x8(%rax),%xmm2
mulss  %xmm2,%xmm1
addss  %xmm0,%xmm1
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  0xc(%rax),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmComputeQuaternionNormf>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
mulss  %xmm1,%xmm1
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
movss  0x8(%rdi),%xmm1
mulss  %xmm1,%xmm1
addss  %xmm0,%xmm1
movss  0xc(%rdi),%xmm0
mulss  %xmm0,%xmm0
addss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @glmComputeQuaternionNormf(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
%5 = load float, float* %4
%6 = load float*, float** %2
%7 = getelementptr inbounds float, float* %6, i64 0
%8 = load float, float* %7
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 1
%11 = load float, float* %10
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = fmul float %11, %14
%16 = call float @llvm.fmuladd.f32(float %5, float %8, float %15)
%17 = load float*, float** %2
%18 = getelementptr inbounds float, float* %17, i64 2
%19 = load float, float* %18
%20 = load float*, float** %2
%21 = getelementptr inbounds float, float* %20, i64 2
%22 = load float, float* %21
%23 = call float @llvm.fmuladd.f32(float %19, float %22, float %16)
%24 = load float*, float** %2
%25 = getelementptr inbounds float, float* %24, i64 3
%26 = load float, float* %25
%27 = load float*, float** %2
%28 = getelementptr inbounds float, float* %27, i64 3
%29 = load float, float* %28
%30 = call float @llvm.fmuladd.f32(float %26, float %29, float %23)
ret float %30
}

LLVM IR (-O2):
define float @glmComputeQuaternionNormf(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fmul float %4, %4
%6 = tail call float @llvm.fmuladd.f32(float %2, float %2, float %5)
%7 = getelementptr inbounds float, float* %0, i64 2
%8 = load float, float* %7
%9 = tail call float @llvm.fmuladd.f32(float %8, float %8, float %6)
%10 = getelementptr inbounds float, float* %0, i64 3
%11 = load float, float* %10
%12 = tail call float @llvm.fmuladd.f32(float %11, float %11, float %9)
ret float %12
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int *, int *);
main() {
  struct A {
    int a, b;
  } x, *p;
  int *pa, *pb;
  p = &x;
  pa = &x.a;
  pb = &p->a;
  *pa = 5;
  printf("%p, %p\n", pa, pb);
  return *pb == 5 ? 0 : 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
lea    0xeb0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
mov    (%rax),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x5,%edx
cmove  %ecx,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0x5,(%rsp)
lea    0xee1(%rip),%rdi
mov    %rsp,%rdx
mov    %rdx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
cmpl   $0x5,(%rsp)
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
%struct.A = type { i32, i32 }
@.str = [8 x i8] c"%p, %p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.A
%3 = alloca %struct.A*
%4 = alloca i32*
%5 = alloca i32*
store i32 0, i32* %1
store %struct.A* %2, %struct.A** %3
%6 = getelementptr inbounds %struct.A, %struct.A* %2, i32 0, i32 0
store i32* %6, i32** %4
%7 = load %struct.A*, %struct.A** %3
%8 = getelementptr inbounds %struct.A, %struct.A* %7, i32 0, i32 0
store i32* %8, i32** %5
%9 = load i32*, i32** %4
store i32 5, i32* %9
%10 = load i32*, i32** %4
%11 = load i32*, i32** %5
%12 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %10, i32* %11)
%13 = load i32*, i32** %5
%14 = load i32, i32* %13
%15 = icmp eq i32 %14, 5
%16 = zext i1 %15 to i64
%17 = select i1 %15, i32 0, i32 1
ret i32 %17
}

LLVM IR (-O2):
%struct.A = type { i32, i32 }
@.str = [8 x i8] c"%p, %p\0A\00"
define i32 @main() {
%1 = alloca %struct.A
%2 = bitcast %struct.A* %1 to i8*
%3 = getelementptr inbounds %struct.A, %struct.A* %1, i64 0, i32 0
store i32 5, i32* %3
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32* %3, i32* %3)
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 5
%7 = zext i1 %6 to i32
ret i32 %7
}
double MPStoFPS(double MPS) {
  double FPS = 3.28084 * MPS;
  return FPS;
}


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

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

LLVM IR (-O0):
define double @MPStoFPS(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fmul double 3.280840e+00, %4
store double %5, double* %3
%6 = load double, double* %3
ret double %6
}

LLVM IR (-O2):
define double @MPStoFPS(double %0) {
%2 = fmul double %0, 3.280840e+00
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ teardown_memory();
void finalize_emu() { teardown_memory(); }


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

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

LLVM IR (-O0):
define void @finalize_emu() {
%1 = call i32 (...) @teardown_memory()
ret void
}

LLVM IR (-O2):
define void @finalize_emu() {
%1 = tail call i32 (...) @teardown_memory()
ret void
}
/* Type definitions */
struct item {
  int dummy;
};

/* Variables and functions */
struct item *create_data_item(char *, int);
struct item *create_data_item_from_int(int i) {
  char *temp = (void *)&i;
  return create_data_item(temp, (int)sizeof(int));
}


x86 assembly (clang, -O0):
<create_data_item_from_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x4(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <create_data_item@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<create_data_item_from_int>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <create_data_item@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.item = type { i32 }
define %struct.item* @create_data_item_from_int(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = bitcast i32* %2 to i8*
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = call %struct.item* @create_data_item(i8* %5, i32 4)
ret %struct.item* %6
}

LLVM IR (-O2):
%struct.item = type { i32 }
define %struct.item* @create_data_item_from_int(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = bitcast i32* %2 to i8*
%4 = call %struct.item* @create_data_item(i8* %3, i32 4)
ret %struct.item* %4
}
void mus_set_little_endian_float(unsigned char *j, float x) {
  unsigned char *ox;
  ox = (unsigned char *)&x;
  j[0] = ox[3];
  j[1] = ox[2];
  j[2] = ox[1];
  j[3] = ox[0];
}


x86 assembly (clang, -O0):
<mus_set_little_endian_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
lea    -0xc(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    0x3(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    0x2(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x18(%rbp),%rax
mov    0x1(%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mus_set_little_endian_float>:
movd   %xmm0,%eax
bswap  %eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @mus_set_little_endian_float(i8* nocapture writeonly %0, float %1) {
%3 = bitcast float %1 to i32
%4 = lshr i32 %3, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %0
%6 = lshr i32 %3, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %3, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %3 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %12, i8* %13
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ sigjmp_buf;

/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void siglongjmp(sigjmp_buf env, int val) {
  {
    fprintf(stderr, "ERROR: "
                    "siglongjmp"
                    " is unsupported!\n");
    abort();
  };
}


x86 assembly (clang, -O0):
<siglongjmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x0,%al
call   1030 <abort@plt>

x86 assembly (clang, -O2):
<siglongjmp>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1040 <fprintf@plt>
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [35 x i8] c"ERROR: siglongjmp is unsupported!\0A\00"
define void @siglongjmp(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%7 = call i32 (...) @abort()
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [35 x i8] c"ERROR: siglongjmp is unsupported!\0A\00"
define void @siglongjmp(i32 %0, i32 %1) {
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str, i64 0, i64 0))
%5 = tail call i32 (...) @abort()
unreachable
}
int toascii(c)
register int c;
{ return (int)((c)&0x7F); }


x86 assembly (clang, -O0):
<toascii>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toascii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @toascii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
int emac2_ifinerrors_set(unsigned int dev_id, union emac2_ifinerrors_u *value) {
  return 1;
}


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

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

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

LLVM IR (-O2):
%union.emac2_ifinerrors_u = type opaque
define i32 @emac2_ifinerrors_set(i32 %0, %union.emac2_ifinerrors_u* nocapture readnone %1) {
ret i32 1
}
float inhg2hpa(float inhg) { return inhg * 33.8639; }


x86 assembly (clang, -O0):
<inhg2hpa>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xee6(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inhg2hpa>:
cvtss2sd %xmm0,%xmm0
mulsd  0xef4(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @inhg2hpa(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = fmul double %4, 3.386390e+01
%6 = fptrunc double %5 to float
ret float %6
}

LLVM IR (-O2):
define float @inhg2hpa(float %0) {
%2 = fpext float %0 to double
%3 = fmul double %2, 3.386390e+01
%4 = fptrunc double %3 to float
ret float %4
}
/* Variables and functions */
int foo(int);
int main(void) { return foo(8); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x8,%edi
jmp    1030 <foo@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @foo(i32 8)
ret i32 %1
}
void XShapeCombineRegion() {}


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

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

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

LLVM IR (-O2):
define void @XShapeCombineRegion() {
ret void
}
/* Type definitions */
struct istruct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ inter_save(struct istruct *, char *);
int /*<<< orphan*/ join_path(int, char *, char *, char *);
void inter_save_a(struct istruct *in, char *path, char *name) {
  char wholename[200];
  join_path(2, wholename, path, name);
  inter_save(in, wholename);
}


x86 assembly (clang, -O0):
<inter_save_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0xe0(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    $0x2,%edi
call   1040 <join_path@plt>
mov    -0x8(%rbp),%rdi
lea    -0xe0(%rbp),%rsi
call   1030 <inter_save@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<inter_save_a>:
push   %r14
push   %rbx
sub    $0xc8,%rsp
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rbx
mov    %rsp,%r14
mov    $0x2,%edi
mov    %r14,%rsi
call   1040 <join_path@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <inter_save@plt>
add    $0xc8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.istruct = type { i32 }
define void @inter_save_a(%struct.istruct* %0, i8* %1, i8* %2) {
%4 = alloca %struct.istruct*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca [200 x i8]
store %struct.istruct* %0, %struct.istruct** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = call i32 @join_path(i32 2, i8* %8, i8* %9, i8* %10)
%12 = load %struct.istruct*, %struct.istruct** %4
%13 = getelementptr inbounds [200 x i8], [200 x i8]* %7, i64 0, i64 0
%14 = call i32 @inter_save(%struct.istruct* %12, i8* %13)
ret void
}

LLVM IR (-O2):
%struct.istruct = type { i32 }
define void @inter_save_a(%struct.istruct* %0, i8* %1, i8* %2) {
%4 = alloca [200 x i8]
%5 = getelementptr inbounds [200 x i8], [200 x i8]* %4, i64 0, i64 0
%6 = call i32 @join_path(i32 2, i8* %5, i8* %1, i8* %2)
%7 = call i32 @inter_save(%struct.istruct* %0, i8* %5)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, char *);
void log_message(char *str) { printf("%s: %s\n", "i2c1_set_clkt_tout", str); }


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

x86 assembly (clang, -O2):
<log_message>:
mov    %rdi,%rdx
lea    0xee6(%rip),%rdi
lea    0xee7(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [19 x i8] c"i2c1_set_clkt_tout\00"
define void @log_message(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s: %s\0A\00"
@.str.1 = [19 x i8] c"i2c1_set_clkt_tout\00"
define void @log_message(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret void
}
unsigned int PutDataIntoIvr723Player(void *pIvrPlay, const unsigned char *pData,
                                     unsigned int nCount) {
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @PutDataIntoIvr723Player(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
define i32 @PutDataIntoIvr723Player(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;
typedef int /*<<< orphan*/ __m128;

/* Variables and functions */
int /*<<< orphan*/ _mm_cvtpi32x2_ps(int /*<<< orphan*/, int /*<<< orphan*/);
__m128 test_mm_cvtpi32x2_ps(__m64 a, __m64 b) { return _mm_cvtpi32x2_ps(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_cvtpi32x2_ps>:
jmp    1030 <_mm_cvtpi32x2_ps@plt>

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

LLVM IR (-O2):
define i32 @test_mm_cvtpi32x2_ps(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_cvtpi32x2_ps(i32 %0, i32 %1)
ret i32 %3
}
/* Type definitions */
struct timespec {
  unsigned long long tv_nsec;
  unsigned long long tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ nanosleep(struct timespec *, int /*<<< orphan*/ *);
void udelay(int t) {
  struct timespec tv;
  unsigned long long ns;
  ns = (long long)t * 1000;
  tv.tv_nsec = ns % 1000000000;
  tv.tv_sec = ns / 1000000000;
  nanosleep(&tv, NULL);
}


x86 assembly (clang, -O0):
<udelay>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
imul   $0x3e8,%rax,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %rdx,-0x18(%rbp)
mov    -0x20(%rbp),%rax
mov    $0x3b9aca00,%ecx
xor    %edx,%edx
div    %rcx
mov    %rax,-0x10(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <nanosleep@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udelay>:
sub    $0x18,%rsp
movslq %edi,%rax
imul   $0x3e8,%rax,%rcx
mov    %rcx,%rax
shr    $0x9,%rax
movabs $0x44b82fa09b5a53,%rdx
mul    %rdx
shr    $0xb,%rdx
imul   $0x3b9aca00,%rdx,%rax
sub    %rax,%rcx
mov    %rcx,0x8(%rsp)
mov    %rdx,0x10(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <nanosleep@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define void @udelay(i32 %0) {
%2 = alloca i32
%3 = alloca %struct.timespec
%4 = alloca i64
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = sext i32 %5 to i64
%7 = mul nsw i64 %6, 1000
store i64 %7, i64* %4
%8 = load i64, i64* %4
%9 = urem i64 %8, 1000000000
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 0
store i64 %9, i64* %10
%11 = load i64, i64* %4
%12 = udiv i64 %11, 1000000000
%13 = getelementptr inbounds %struct.timespec, %struct.timespec* %3, i32 0, i32 1
store i64 %12, i64* %13
%14 = call i32 @nanosleep(%struct.timespec* %3, i32* null)
ret void
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define void @udelay(i32 %0) {
%2 = alloca %struct.timespec
%3 = bitcast %struct.timespec* %2 to i8*
%4 = sext i32 %0 to i64
%5 = mul nsw i64 %4, 1000
%6 = urem i64 %5, 1000000000
%7 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 0
store i64 %6, i64* %7
%8 = udiv i64 %5, 1000000000
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %2, i64 0, i32 1
store i64 %8, i64* %9
%10 = call i32 @nanosleep(%struct.timespec* %2, i32* null)
ret void
}
/* Variables and functions */
unsigned long mfspr(int);
int /*<<< orphan*/ mtspr(int, unsigned long);
void cache_flush(void) {
  unsigned long sr = mfspr((17));
  mtspr((17), sr | (1 << 17) | (1 << 18));
}


x86 assembly (clang, -O0):
<cache_flush>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x11,%edi
call   1030 <mfspr@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
or     $0x20000,%rsi
or     $0x40000,%rsi
mov    $0x11,%edi
call   1040 <mtspr@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cache_flush>:
push   %rax
mov    $0x11,%edi
call   1030 <mfspr@plt>
or     $0x60000,%rax
mov    $0x11,%edi
mov    %rax,%rsi
pop    %rax
jmp    1040 <mtspr@plt>

LLVM IR (-O0):
define void @cache_flush() {
%1 = alloca i64
%2 = call i64 @mfspr(i32 17)
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = or i64 %3, 131072
%5 = or i64 %4, 262144
%6 = call i32 @mtspr(i32 17, i64 %5)
ret void
}

LLVM IR (-O2):
define void @cache_flush() {
%1 = tail call i64 @mfspr(i32 17)
%2 = or i64 %1, 393216
%3 = tail call i32 @mtspr(i32 17, i64 %2)
ret void
}
int bound_to_range(int val, int min, int max) {
  if (val < min) {
    return (min);
  }
  if (val > max) {
    return (max);
  }
  return (val);
}


x86 assembly (clang, -O0):
<bound_to_range>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1124 <bound_to_range+0x24>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <bound_to_range+0x41>
mov    -0x8(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    113b <bound_to_range+0x3b>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1141 <bound_to_range+0x41>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound_to_range>:
mov    %edx,%eax
cmp    %edx,%edi
cmovle %edi,%eax
cmp    %esi,%edi
cmovl  %esi,%eax
ret

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

LLVM IR (-O2):
define i32 @bound_to_range(i32 %0, i32 %1, i32 %2) {
%4 = icmp slt i32 %0, %1
%5 = icmp sgt i32 %0, %2
%6 = select i1 %5, i32 %2, i32 %0
%7 = select i1 %4, i32 %1, i32 %6
ret i32 %7
}
double rgbToXyzX(int rin, int gin, int bin) {
  double r = ((double)rin / 255.0);
  double g = ((double)gin / 255.0);
  double b = ((double)bin / 255.0);
  return (r * 0.412453) + (g * 0.357580) + (b * 0.180423);
}


x86 assembly (clang, -O0):
<rgbToXyzX>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  0xefe(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
movsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  0xed2(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x18(%rbp),%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  -0x20(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm2
mulsd  %xmm2,%xmm1
addsd  %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
movsd  0xe82(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgbToXyzX>:
cvtsi2sd %edi,%xmm1
movsd  0xef4(%rip),%xmm2
divsd  %xmm2,%xmm1
cvtsi2sd %esi,%xmm3
divsd  %xmm2,%xmm3
cvtsi2sd %edx,%xmm0
divsd  %xmm2,%xmm0
mulsd  0xee0(%rip),%xmm3
mulsd  0xee0(%rip),%xmm1
addsd  %xmm3,%xmm1
mulsd  0xedc(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @rgbToXyzX(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca double
%8 = alloca double
%9 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%10 = load i32, i32* %4
%11 = sitofp i32 %10 to double
%12 = fdiv double %11, 2.550000e+02
store double %12, double* %7
%13 = load i32, i32* %5
%14 = sitofp i32 %13 to double
%15 = fdiv double %14, 2.550000e+02
store double %15, double* %8
%16 = load i32, i32* %6
%17 = sitofp i32 %16 to double
%18 = fdiv double %17, 2.550000e+02
store double %18, double* %9
%19 = load double, double* %7
%20 = load double, double* %8
%21 = fmul double %20, 3.575800e-01
%22 = call double @llvm.fmuladd.f64(double %19, double 4.124530e-01, double %21)
%23 = load double, double* %9
%24 = call double @llvm.fmuladd.f64(double %23, double 1.804230e-01, double %22)
ret double %24
}

LLVM IR (-O2):
define double @rgbToXyzX(i32 %0, i32 %1, i32 %2) {
%4 = sitofp i32 %0 to double
%5 = fdiv double %4, 2.550000e+02
%6 = sitofp i32 %1 to double
%7 = fdiv double %6, 2.550000e+02
%8 = sitofp i32 %2 to double
%9 = fdiv double %8, 2.550000e+02
%10 = fmul double %7, 3.575800e-01
%11 = tail call double @llvm.fmuladd.f64(double %5, double 4.124530e-01, double %10)
%12 = tail call double @llvm.fmuladd.f64(double %9, double 1.804230e-01, double %11)
ret double %12
}
/* Type definitions */
typedef int /*<<< orphan*/ reqbuf;

/* Variables and functions */
int ph_rpc(char *);
int /*<<< orphan*/ snprintf(char *, int, char *, int);
int phCloseCall(int cid) {
  char reqbuf[64];
  snprintf(reqbuf, sizeof(reqbuf), "CLOSE CID=%d", cid);
  return ph_rpc(reqbuf);
}


x86 assembly (clang, -O0):
<phCloseCall>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
mov    -0x4(%rbp),%ecx
mov    $0x40,%esi
lea    0xec2(%rip),%rdx
call   1030 <snprintf@plt>
lea    -0x50(%rbp),%rdi
call   1040 <ph_rpc@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<phCloseCall>:
push   %rbx
sub    $0x40,%rsp
mov    %edi,%ecx
lea    0xed2(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
mov    $0x40,%esi
call   1030 <snprintf@plt>
mov    %rbx,%rdi
call   1040 <ph_rpc@plt>
add    $0x40,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"CLOSE CID=%d\00"
define i32 @phCloseCall(i32 %0) {
%2 = alloca i32
%3 = alloca [64 x i8]
store i32 %0, i32* %2
%4 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%5 = load i32, i32* %2
%6 = call i32 @snprintf(i8* %4, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %5)
%7 = getelementptr inbounds [64 x i8], [64 x i8]* %3, i64 0, i64 0
%8 = call i32 @ph_rpc(i8* %7)
ret i32 %8
}

LLVM IR (-O2):
@.str = [13 x i8] c"CLOSE CID=%d\00"
define i32 @phCloseCall(i32 %0) {
%2 = alloca [64 x i8]
%3 = getelementptr inbounds [64 x i8], [64 x i8]* %2, i64 0, i64 0
%4 = call i32 @snprintf(i8* %3, i32 64, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %0)
%5 = call i32 @ph_rpc(i8* %3)
ret i32 %5
}
void debugpins_radio_toggle() {}


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

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

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

LLVM IR (-O2):
define void @debugpins_radio_toggle() {
ret void
}
int test_imm_80uint8_mem(unsigned char *val) {
  return ((*val) & (-0x80 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_80uint8_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
and    $0xffffff80,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_80uint8_mem>:
cmpb   $0x0,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_80uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp sgt i8 %2, -1
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ disp_str(char *);
int /*<<< orphan*/ milli_delay(int);
void TestA() {
  int i = 0;
  while (1) {
    disp_str("A.");
    milli_delay(10);
  }
}


x86 assembly (clang, -O0):
<TestA>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
call   1030 <disp_str@plt>
mov    $0xa,%edi
call   1040 <milli_delay@plt>
jmp    112f <TestA+0xf>

x86 assembly (clang, -O2):
<TestA>:
push   %rbx
lea    0xed8(%rip),%rbx
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1030 <disp_str@plt>
mov    $0xa,%edi
call   1040 <milli_delay@plt>
jmp    1130 <TestA+0x10>

LLVM IR (-O0):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @milli_delay(i32 10)
br label %2
}

LLVM IR (-O2):
@.str = [3 x i8] c"A.\00"
define void @TestA() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @disp_str(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @milli_delay(i32 10)
br label %1
}
void earthquake_epicenter(double x1, double y1, double t1, double x2, double y2,
                          double t2, double x3, double y3, double t3, double *x,
                          double *y) {}


x86 assembly (clang, -O0):
<earthquake_epicenter>:
push   %rbp
mov    %rsp,%rbp
movsd  0x10(%rbp),%xmm8
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  %xmm6,-0x38(%rbp)
movsd  %xmm7,-0x40(%rbp)
mov    %rdi,-0x48(%rbp)
mov    %rsi,-0x50(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @earthquake_epicenter(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double* %9, double* %10) {
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double*
%22 = alloca double*
store double %0, double* %12
store double %1, double* %13
store double %2, double* %14
store double %3, double* %15
store double %4, double* %16
store double %5, double* %17
store double %6, double* %18
store double %7, double* %19
store double %8, double* %20
store double* %9, double** %21
store double* %10, double** %22
ret void
}

LLVM IR (-O2):
define void @earthquake_epicenter(double %0, double %1, double %2, double %3, double %4, double %5, double %6, double %7, double %8, double* nocapture %9, double* nocapture %10) {
ret void
}
int qGray(int r, int g, int b) { return (r * 11 + g * 16 + b * 5) / 32; }


x86 assembly (clang, -O0):
<qGray>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0xb,-0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    $0x4,%ecx
add    %ecx,%eax
imul   $0x5,-0xc(%rbp),%ecx
add    %ecx,%eax
mov    $0x20,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<qGray>:
lea    (%rdi,%rdi,4),%eax
lea    (%rdi,%rax,2),%eax
shl    $0x4,%esi
add    %eax,%esi
lea    (%rdx,%rdx,4),%ecx
lea    (%rsi,%rcx,1),%eax
add    $0x1f,%eax
mov    %esi,%edx
add    %ecx,%edx
cmovns %edx,%eax
sar    $0x5,%eax
ret

LLVM IR (-O0):
define i32 @qGray(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 11
%9 = load i32, i32* %5
%10 = mul nsw i32 %9, 16
%11 = add nsw i32 %8, %10
%12 = load i32, i32* %6
%13 = mul nsw i32 %12, 5
%14 = add nsw i32 %11, %13
%15 = sdiv i32 %14, 32
ret i32 %15
}

LLVM IR (-O2):
define i32 @qGray(i32 %0, i32 %1, i32 %2) {
%4 = mul nsw i32 %0, 11
%5 = shl nsw i32 %1, 4
%6 = add nsw i32 %5, %4
%7 = mul nsw i32 %2, 5
%8 = add nsw i32 %6, %7
%9 = sdiv i32 %8, 32
ret i32 %9
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int sigwait(int /*<<< orphan*/ *, int *);
void test(void) {
  sigset_t set;
  int sig;
  int result;
  (void)sigemptyset(&set);
  result = sigwait(&set, &sig);
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x4(%rbp),%rdi
call   1030 <sigemptyset@plt>
lea    -0x4(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <sigwait@plt>
mov    %eax,-0xc(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
sub    $0x10,%rsp
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <sigemptyset@plt>
lea    0x8(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <sigwait@plt>
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @sigemptyset(i32* %1)
%5 = call i32 @sigwait(i32* %1, i32* %2)
store i32 %5, i32* %3
ret void
}

LLVM IR (-O2):
define void @test() {
%1 = alloca i32
%2 = alloca i32
%3 = bitcast i32* %1 to i8*
%4 = bitcast i32* %2 to i8*
%5 = call i32 @sigemptyset(i32* %1)
%6 = call i32 @sigwait(i32* %1, i32* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
void reset_logfile() {
  FILE *file = fopen("log.txt", "w");
  fclose(file);
}


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

x86 assembly (clang, -O2):
<reset_logfile>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xed9(%rip),%rsi
call   1040 <fopen@plt>
mov    %rax,%rdi
pop    %rax
jmp    1030 <fclose@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"log.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @reset_logfile() {
%1 = alloca i32*
%2 = call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %2, i32** %1
%3 = load i32*, i32** %1
%4 = call i32 @fclose(i32* %3)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"log.txt\00"
@.str.1 = [2 x i8] c"w\00"
define void @reset_logfile() {
%1 = tail call i32* @fopen(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%2 = tail call i32 @fclose(i32* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void ForeColor(int col) { printf("\033[3%dm", (col < 0 || col > 7) ? 0 : col); }


x86 assembly (clang, -O0):
<ForeColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112f <ForeColor+0x1f>
cmpl   $0x7,-0x4(%rbp)
jle    1139 <ForeColor+0x29>
xor    %eax,%eax
mov    %eax,-0x8(%rbp)
jmp    113f <ForeColor+0x2f>
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ForeColor>:
xor    %esi,%esi
cmp    $0x8,%edi
cmovb  %edi,%esi
lea    0xee1(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"\1B[3%dm\00"
define void @ForeColor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 0
br i1 %4, label %8, label %5
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sgt i32 %6, 7
br i1 %7, label %8, label %9
8: ; preds = %5, %1
br label %11
9: ; preds = %5
%10 = load i32, i32* %2
br label %11
11: ; preds = %9, %8
%12 = phi i32 [ 0, %8 ], [ %10, %9 ]
%13 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %12)
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"\1B[3%dm\00"
define void @ForeColor(i32 %0) {
%2 = icmp ugt i32 %0, 7
%3 = select i1 %2, i32 0, i32 %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ hal_cc25xx_enter_rxmode();
void hal_cc25xx_enable_receive(void) { hal_cc25xx_enter_rxmode(); }


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

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

LLVM IR (-O0):
define void @hal_cc25xx_enable_receive() {
%1 = call i32 (...) @hal_cc25xx_enter_rxmode()
ret void
}

LLVM IR (-O2):
define void @hal_cc25xx_enable_receive() {
%1 = tail call i32 (...) @hal_cc25xx_enter_rxmode()
ret void
}
/* Variables and functions */
int at91_serial_putc(int);
int putc(int c) { return at91_serial_putc(c); }


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

x86 assembly (clang, -O2):
<putc>:
jmp    1030 <at91_serial_putc@plt>

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

LLVM IR (-O2):
define i32 @putc(i32 %0) {
%2 = tail call i32 @at91_serial_putc(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ runtime_exit();
void abort(void) {
  printf("Abort called!\n");
  runtime_exit();
}


x86 assembly (clang, -O0):
<abort>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <runtime_exit@plt>

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

LLVM IR (-O0):
@.str = [15 x i8] c"Abort called!\0A\00"
define void @abort() {
%1 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @runtime_exit()
unreachable
}

LLVM IR (-O2):
@str = [14 x i8] c"Abort called!\00"
define void @abort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @runtime_exit()
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  (void)fprintf(stderr, "usage:\n");
  (void)fprintf(
      stderr,
      "\thbeatd [ -pv ] [ -d ip ] [ -P port ] [ -i interval ] [ -g group ]\n");
  (void)fprintf(stderr, "\thbeatd [ -sv ] [ -P port ] [ -t tolerance ]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2ea0(%rip),%rax
mov    (%rax),%edi
lea    0xebf(%rip),%rsi
call   1030 <fprintf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
lea    0xeee(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
mov    0x2eb8(%rip),%rbx
mov    (%rbx),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
mov    (%rbx),%edi
lea    0xeff(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [68 x i8] c"\09hbeatd [ -pv ] [ -d ip ] [ -P port ] [ -i interval ] [ -g group ]\0A\00"
@.str.2 = [46 x i8] c"\09hbeatd [ -sv ] [ -P port ] [ -t tolerance ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%7 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [8 x i8] c"usage:\0A\00"
@.str.1 = [68 x i8] c"\09hbeatd [ -pv ] [ -d ip ] [ -P port ] [ -i interval ] [ -g group ]\0A\00"
@.str.2 = [46 x i8] c"\09hbeatd [ -sv ] [ -P port ] [ -t tolerance ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @stderr
%4 = tail call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([68 x i8], [68 x i8]* @.str.1, i64 0, i64 0))
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.2, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
}
void foo026() {}


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

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

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

LLVM IR (-O2):
define void @foo026() {
ret void
}
volatile char *build_pushf(volatile char *tgt_addr) {
  (*(char *)tgt_addr) = 0x9c;
  tgt_addr += 0x1;
  return (tgt_addr);
}


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

x86 assembly (clang, -O2):
<build_pushf>:
movb   $0x9c,(%rdi)
lea    0x1(%rdi),%rax
ret

LLVM IR (-O0):
define i8* @build_pushf(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
store i8 -100, i8* %3
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
store i8* %5, i8** %2
%6 = load i8*, i8** %2
ret i8* %6
}

LLVM IR (-O2):
define i8* @build_pushf(i8* writeonly %0) {
store i8 -100, i8* %0
%2 = getelementptr inbounds i8, i8* %0, i64 1
ret i8* %2
}
/* Variables and functions */
void *ILibLinkedList_Create();
void *ILibQueue_Create() { return (ILibLinkedList_Create()); }


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

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

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

LLVM IR (-O2):
define i8* @ILibQueue_Create() {
%1 = tail call i8* (...) @ILibLinkedList_Create()
ret i8* %1
}