xunge/DecIR huggingface dataset:
/* Variables and functions */
bool floattest() { return true; }


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

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

LLVM IR (-O0):
define i32 @floattest() {
ret i32 1
}

LLVM IR (-O2):
define i32 @floattest() {
ret i32 1
}
/* Variables and functions */
int this_function_is_not_defined();
int function() { return this_function_is_not_defined(); }


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

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

LLVM IR (-O0):
define i32 @function() {
%1 = call i32 (...) @this_function_is_not_defined()
ret i32 %1
}

LLVM IR (-O2):
define i32 @function() {
%1 = tail call i32 (...) @this_function_is_not_defined()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ max_heapify(int *, int, int);
void build_max_heap(int *a, int len) {
  int i;
  for (i = len / 2 - 1; i >= 0; i--) {
    max_heapify(a, i, len - 1);
  }
}


x86 assembly (clang, -O0):
<build_max_heap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
sub    $0x1,%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jl     115a <build_max_heap+0x4a>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0xc(%rbp),%edx
sub    $0x1,%edx
call   1030 <max_heapify@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
jmp    1130 <build_max_heap+0x20>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_max_heap>:
push   %rbp
push   %r14
push   %rbx
cmp    $0x2,%esi
jl     1145 <build_max_heap+0x35>
mov    %esi,%ebp
mov    %rdi,%r14
mov    %esi,%ebx
shr    %ebx
add    $0xffffffff,%ebp
add    $0x1,%ebx
nopl   0x0(%rax,%rax,1)
lea    -0x2(%rbx),%esi
mov    %r14,%rdi
mov    %ebp,%edx
call   1030 <max_heapify@plt>
add    $0xffffffff,%ebx
cmp    $0x1,%ebx
ja     1130 <build_max_heap+0x20>
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
%5 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = sdiv i32 %6, 2
%8 = sub nsw i32 %7, 1
store i32 %8, i32* %5
br label %9
9: ; preds = %18, %2
%10 = load i32, i32* %5
%11 = icmp sge i32 %10, 0
br i1 %11, label %12, label %21
12: ; preds = %9
%13 = load i32*, i32** %3
%14 = load i32, i32* %5
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, 1
%17 = call i32 @max_heapify(i32* %13, i32 %14, i32 %16)
br label %18
18: ; preds = %12
%19 = load i32, i32* %5
%20 = add nsw i32 %19, -1
store i32 %20, i32* %5
br label %9
21: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @build_max_heap(i32* %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %12
4: ; preds = %2
%5 = lshr i32 %1, 1
%6 = add nsw i32 %1, -1
br label %7
7: ; preds = %4, %7
%8 = phi i32 [ %5, %4 ], [ %9, %7 ]
%9 = add nsw i32 %8, -1
%10 = tail call i32 @max_heapify(i32* %0, i32 %9, i32 %6)
%11 = icmp ugt i32 %8, 1
br i1 %11, label %7, label %12
12: ; preds = %7, %2
ret void
}
int test_imm_4Duint64_highword_mem(unsigned long long *val) {
  return ((*val >> 32) & (0x4D << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_4Duint64_highword_mem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdx
shr    $0x20,%rdx
and    $0x4d,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_4Duint64_highword_mem>:
testb  $0x4d,0x4(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_4Duint64_highword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 32
%6 = and i64 %5, 77
%7 = icmp ne i64 %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_4Duint64_highword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 330712481792
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ StopThread21(unsigned long);
void stopthread(unsigned long thi) { StopThread21(thi); }


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

x86 assembly (clang, -O2):
<stopthread>:
jmp    1030 <StopThread21@plt>

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

LLVM IR (-O2):
define void @stopthread(i64 %0) {
%2 = tail call i32 @StopThread21(i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ memmove(unsigned char *, unsigned char const *, int);
void rs_poly_mul_x(unsigned char *_p, const unsigned char *_q, int _dp1) {
  memmove(_p + 1, _q, (_dp1 - 1) * sizeof(*_p));
  _p[0] = 0;
}


x86 assembly (clang, -O0):
<rs_poly_mul_x>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%eax
sub    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edx
call   1030 <memmove@plt>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rs_poly_mul_x>:
push   %rbx
mov    %rdi,%rbx
add    $0x1,%rdi
add    $0xffffffff,%edx
call   1030 <memmove@plt>
movb   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @rs_poly_mul_x(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
%7 = load i8*, i8** %4
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = sub nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = mul i64 %12, 1
%14 = trunc i64 %13 to i32
%15 = call i32 @memmove(i8* %8, i8* %9, i32 %14)
%16 = load i8*, i8** %4
%17 = getelementptr inbounds i8, i8* %16, i64 0
store i8 0, i8* %17
ret void
}

LLVM IR (-O2):
define void @rs_poly_mul_x(i8* %0, i8* %1, i32 %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 1
%5 = add nsw i32 %2, -1
%6 = tail call i32 @memmove(i8* %4, i8* %1, i32 %5)
store i8 0, i8* %0
ret void
}
/* Variables and functions */
unsigned int _MM_GET_ROUNDING_MODE();
unsigned int test_MM_GET_ROUNDING_MODE() { return _MM_GET_ROUNDING_MODE(); }


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

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

LLVM IR (-O0):
define i32 @test_MM_GET_ROUNDING_MODE() {
%1 = call i32 (...) @_MM_GET_ROUNDING_MODE()
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_MM_GET_ROUNDING_MODE() {
%1 = tail call i32 (...) @_MM_GET_ROUNDING_MODE()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int i = -1;
  i = -i * (-1 - 2);
  printf("%d", i);
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 -3)
ret i32 0
}
int alock_cursor_none_deinit(struct aXInfo *xinfo) { return 1; }


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

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

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

LLVM IR (-O2):
%struct.aXInfo = type opaque
define i32 @alock_cursor_none_deinit(%struct.aXInfo* nocapture readnone %0) {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int ffsl(int /*<<< orphan*/);
int ilog2(uint32_t i) { return ffsl(i) - 1; }


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

x86 assembly (clang, -O2):
<ilog2>:
bsf    %edi,%ecx
mov    $0xffffffff,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @ilog2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ffsl(i32 %3)
%5 = sub nsw i32 %4, 1
ret i32 %5
}

LLVM IR (-O2):
define i32 @ilog2(i32 %0) {
%2 = tail call i32 @llvm.cttz.i32(i32 %0, i1 true)
%3 = icmp eq i32 %0, 0
%4 = select i1 %3, i32 -1, i32 %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ string_free(void *);
void stringstruct_free(void *o) {
  if (o)
    string_free(o);
}


x86 assembly (clang, -O0):
<stringstruct_free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1130 <stringstruct_free+0x20>
mov    -0x8(%rbp),%rdi
call   1030 <string_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringstruct_free>:
test   %rdi,%rdi
je     111a <stringstruct_free+0xa>
jmp    1030 <string_free@plt>
ret

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

LLVM IR (-O2):
define void @stringstruct_free(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @string_free(i8* %0)
br label %5
5: ; preds = %3, %1
ret void
}
void pmd_cmd_null_0(struct fmdriver_work *work, struct driver_pmd *pmd,
                    struct pmd_part *part) {
  (void)work;
  (void)pmd;
  (void)part;
}


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

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

LLVM IR (-O0):
%struct.fmdriver_work = type opaque
%struct.driver_pmd = type opaque
%struct.pmd_part = type opaque
define void @pmd_cmd_null_0(%struct.fmdriver_work* %0, %struct.driver_pmd* %1, %struct.pmd_part* %2) {
%4 = alloca %struct.fmdriver_work*
%5 = alloca %struct.driver_pmd*
%6 = alloca %struct.pmd_part*
store %struct.fmdriver_work* %0, %struct.fmdriver_work** %4
store %struct.driver_pmd* %1, %struct.driver_pmd** %5
store %struct.pmd_part* %2, %struct.pmd_part** %6
%7 = load %struct.fmdriver_work*, %struct.fmdriver_work** %4
%8 = load %struct.driver_pmd*, %struct.driver_pmd** %5
%9 = load %struct.pmd_part*, %struct.pmd_part** %6
ret void
}

LLVM IR (-O2):
%struct.fmdriver_work = type opaque
%struct.driver_pmd = type opaque
%struct.pmd_part = type opaque
define void @pmd_cmd_null_0(%struct.fmdriver_work* nocapture %0, %struct.driver_pmd* nocapture %1, %struct.pmd_part* nocapture %2) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint64_t;
typedef int /*<<< orphan*/ uint32_t;
struct inode_type {
  int dummy;
};
typedef int int32_t;

/* Variables and functions */
int32_t romfs_write_file(struct inode_type *inode, const char *buf,
                         uint32_t count, uint64_t *offset) {
  return -30;
}


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

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

LLVM IR (-O0):
%struct.inode_type = type { i32 }
define i32 @romfs_write_file(%struct.inode_type* %0, i8* %1, i32 %2, i32* %3) {
%5 = alloca %struct.inode_type*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32*
store %struct.inode_type* %0, %struct.inode_type** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32* %3, i32** %8
ret i32 -30
}

LLVM IR (-O2):
%struct.inode_type = type { i32 }
define i32 @romfs_write_file(%struct.inode_type* nocapture readnone %0, i8* nocapture readnone %1, i32 %2, i32* nocapture readnone %3) {
ret i32 -30
}
float limitf32(float val, float upper, float lower) {
  if (val > upper) {
    return upper;
  }
  if (val < lower) {
    return lower;
  }
  return val;
}


x86 assembly (clang, -O0):
<limitf32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  %xmm2,-0x10(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    1131 <limitf32+0x31>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <limitf32+0x5d>
movss  -0x8(%rbp),%xmm1
movss  -0x10(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1153 <limitf32+0x53>
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    115d <limitf32+0x5d>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<limitf32>:
maxss  %xmm0,%xmm2
movaps %xmm1,%xmm3
cmpltss %xmm0,%xmm3
movaps %xmm3,%xmm0
andnps %xmm2,%xmm0
andps  %xmm1,%xmm3
orps   %xmm0,%xmm3
movaps %xmm3,%xmm0
ret

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

LLVM IR (-O2):
define float @limitf32(float %0, float %1, float %2) {
%4 = fcmp ogt float %0, %1
%5 = fcmp olt float %0, %2
%6 = select i1 %5, float %2, float %0
%7 = select i1 %4, float %1, float %6
ret float %7
}
/* Variables and functions */
float exp10f(float);
float test1f(float x) { return exp10f(x); }


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

x86 assembly (clang, -O2):
<test1f>:
jmp    1030 <exp10f@plt>

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

LLVM IR (-O2):
define float @test1f(float %0) {
%2 = tail call float @exp10f(float %0)
ret float %2
}
/* Type definitions */
typedef int uint32_t;
typedef int /*<<< orphan*/ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ i2c_setClockDivider(int /*<<< orphan*/);
void i2c_set_baudrate(uint32_t baudrate) {
  uint32_t divider;
  divider = (250000000 / baudrate) & 0xFFFE;
  i2c_setClockDivider((uint16_t)divider);
}


x86 assembly (clang, -O0):
<i2c_set_baudrate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0xee6b280,%eax
cltd
idivl  -0x4(%rbp)
and    $0xfffe,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <i2c_setClockDivider@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_set_baudrate>:
mov    $0xee6b280,%eax
xor    %edx,%edx
idiv   %edi
and    $0xfffe,%eax
mov    %eax,%edi
jmp    1030 <i2c_setClockDivider@plt>

LLVM IR (-O0):
define void @i2c_set_baudrate(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 250000000, %4
%6 = and i32 %5, 65534
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = call i32 @i2c_setClockDivider(i32 %7)
ret void
}

LLVM IR (-O2):
define void @i2c_set_baudrate(i32 %0) {
%2 = sdiv i32 250000000, %0
%3 = and i32 %2, 65534
%4 = tail call i32 @i2c_setClockDivider(i32 %3)
ret void
}
int rgb_to_int(int r, int g, int b) {
  int value = 0;
  value += r << 16;
  value += g << 8;
  value += b;
  return value;
}


x86 assembly (clang, -O0):
<rgb_to_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x4(%rbp),%eax
shl    $0x10,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
shl    $0x8,%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rgb_to_int>:
shl    $0x10,%edi
shl    $0x8,%esi
lea    (%rsi,%rdi,1),%eax
add    %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @rgb_to_int(i32 %0, i32 %1, i32 %2) {
%4 = shl i32 %0, 16
%5 = shl i32 %1, 8
%6 = add nsw i32 %5, %4
%7 = add nsw i32 %6, %2
ret i32 %7
}
void write_jpeg(const unsigned char buff[], const unsigned size) {}


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

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

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

LLVM IR (-O2):
define void @write_jpeg(i8* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ divideline(char *, int, int);
int getlinelength(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getlinelength(line, 1000)) > 0) {
    divideline(line, len, 50);
    printf("%s\n", line);
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1050 <getlinelength@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    118b <main+0x5b>
lea    -0x3f0(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    $0x32,%edx
call   1040 <divideline@plt>
lea    -0x3f0(%rbp),%rsi
lea    0xe7f(%rip),%rdi
call   1030 <printf@plt>
jmp    1142 <main+0x12>
mov    -0x4(%rbp),%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1050 <getlinelength@plt>
test   %eax,%eax
jle    118b <main+0x5b>
mov    %rsp,%rbx
lea    0xeab(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x32,%edx
call   1040 <divideline@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1050 <getlinelength@plt>
test   %eax,%eax
jg     1160 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %8, %0
%5 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%6 = call i32 @getlinelength(i8* %5, i32 1000)
store i32 %6, i32* %2
%7 = icmp sgt i32 %6, 0
br i1 %7, label %8, label %14
8: ; preds = %4
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = load i32, i32* %2
%11 = call i32 @divideline(i8* %9, i32 %10, i32 50)
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%13 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %12)
br label %4
14: ; preds = %4
%15 = load i32, i32* %1
ret i32 %15
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getlinelength(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %11
5: ; preds = %0, %5
%6 = phi i32 [ %9, %5 ], [ %3, %0 ]
%7 = call i32 @divideline(i8* %2, i32 %6, i32 50)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
%9 = call i32 @getlinelength(i8* %2, i32 1000)
%10 = icmp sgt i32 %9, 0
br i1 %10, label %5, label %11
11: ; preds = %5, %0
ret i32 0
}
void funcion_v_v() {
  int x;
  x = 10;
}


x86 assembly (clang, -O0):
<funcion_v_v>:
push   %rbp
mov    %rsp,%rbp
movl   $0xa,-0x4(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @funcion_v_v() {
%1 = alloca i32
store i32 10, i32* %1
ret void
}

LLVM IR (-O2):
define void @funcion_v_v() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
scalar_t__ isatty(int);
int /*<<< orphan*/ stderr;
void warning(char *msg) {
  fprintf(stderr, "%sWARNING: %s.\n", isatty(2) ? "\a" : "", msg);
}


x86 assembly (clang, -O0):
<warning>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    $0x2,%edi
call   1030 <isatty@plt>
mov    -0xc(%rbp),%edi
mov    %rax,%rcx
lea    0xec2(%rip),%rdx
lea    0xeba(%rip),%rax
cmp    $0x0,%rcx
cmovne %rax,%rdx
mov    -0x8(%rbp),%rcx
lea    0xe97(%rip),%rsi
call   1040 <fprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<warning>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eb3(%rip),%rax
mov    (%rax),%ebp
mov    $0x2,%edi
call   1030 <isatty@plt>
test   %rax,%rax
lea    0xece(%rip),%rax
lea    0xec6(%rip),%rdx
cmove  %rax,%rdx
lea    0xeab(%rip),%rsi
mov    %ebp,%edi
mov    %rbx,%rcx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"%sWARNING: %s.\0A\00"
@.str.1 = [2 x i8] c"\07\00"
@.str.2 = [1 x i8] zeroinitializer
define void @warning(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = call i64 @isatty(i32 2)
%5 = icmp ne i64 %4, 0
%6 = zext i1 %5 to i64
%7 = select i1 %5, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%8 = load i8*, i8** %2
%9 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %7, i8* %8)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"%sWARNING: %s.\0A\00"
@.str.1 = [2 x i8] c"\07\00"
@.str.2 = [1 x i8] zeroinitializer
define void @warning(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i64 @isatty(i32 2)
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0)
%6 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int darm_my_lsl(int value, int shift) {
  assert(shift >= 0);
  if (shift == 0) {
    return value;
  } else {
    return (value << shift);
  }
}


x86 assembly (clang, -O0):
<darm_my_lsl>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
setge  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
cmpl   $0x0,-0xc(%rbp)
jne    1144 <darm_my_lsl+0x34>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    114f <darm_my_lsl+0x3f>
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<darm_my_lsl>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
mov    %esi,%edi
not    %edi
shr    $0x1f,%edi
call   1030 <assert@plt>
mov    %ebx,%ecx
shl    %cl,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @darm_my_lsl(i32 %0, i32 %1) {
%3 = xor i32 %1, -1
%4 = lshr i32 %3, 31
%5 = tail call i32 @assert(i32 %4)
%6 = shl i32 %0, %1
ret i32 %6
}
void parse_cfg(int argc, char *argv[]) {
  (void)argc;
  (void)argv;
}


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

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

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

LLVM IR (-O2):
define void @parse_cfg(i32 %0, i8** nocapture %1) {
ret void
}
void fd22(int n) {
P0A:
  goto P0A;
  {
    typedef int(*b)[n];
  p01A:
    goto p01A;
    goto a;
  P01A:
    goto P01A;
    {
      typedef int(*c)[n];
    P012A:
      goto P012A;
      0;
    }
  P01B:
    goto P01B;
    {
      typedef int(*d)[n];
    P013A:
      goto P013A;
      0;
    }
  a:;
    typedef int(*e)[n];
  P014A:
    goto P014A;
    0;
  };
P0B:
  goto P0B;
  {
    typedef int(*f)[n];
  P02A:
    goto P02A;
    {
      typedef int(*g)[n];
    P024A:
      goto P024A;
      0;
    };
  P02B:
    goto P02B;
    {
      typedef int(*h)[n];
    P025A:
      goto P025A;
      0;
    };
  P02C:
    goto P02C;
    ;
    typedef int(*i)[n];
  P026A:
    goto P026A;
    0;
  };
P0C:
  goto P0C;
  ;
  typedef int(*j)[n];
P03A:
  goto P03A;
  0;
P03B:
  goto P03B;
}


x86 assembly (clang, -O0):
<fd22>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <fd22+0x7>

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

LLVM IR (-O0):
define void @fd22(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %3, %1
br label %3
4: ; No predecessors!
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
br label %7
7: ; preds = %7, %4
br label %7
8: ; preds = %8
br label %8
9: ; No predecessors!
%10 = load i32, i32* %2
%11 = zext i32 %10 to i64
br label %12
12: ; preds = %12, %9
br label %12
13: ; preds = %13
br label %13
14: ; No predecessors!
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
br label %17
17: ; preds = %17, %14
br label %17
18: ; No predecessors!
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
br label %21
21: ; preds = %21, %18
br label %21
22: ; preds = %22
br label %22
23: ; No predecessors!
%24 = load i32, i32* %2
%25 = zext i32 %24 to i64
br label %26
26: ; preds = %26, %23
br label %26
27: ; No predecessors!
%28 = load i32, i32* %2
%29 = zext i32 %28 to i64
br label %30
30: ; preds = %30, %27
br label %30
31: ; preds = %31
br label %31
32: ; No predecessors!
%33 = load i32, i32* %2
%34 = zext i32 %33 to i64
br label %35
35: ; preds = %35, %32
br label %35
36: ; preds = %36
br label %36
37: ; No predecessors!
%38 = load i32, i32* %2
%39 = zext i32 %38 to i64
br label %40
40: ; preds = %40, %37
br label %40
41: ; preds = %41
br label %41
42: ; No predecessors!
%43 = load i32, i32* %2
%44 = zext i32 %43 to i64
br label %45
45: ; preds = %45, %42
br label %45
46: ; preds = %46
br label %46
}

LLVM IR (-O2):
define void @fd22(i32 %0) {
br label %2
2: ; preds = %2, %1
br label %2
}
void bug(int size, int tries) {
  int i;
  int num = 0;
  while (num < size) {
    for (i = 1; i < tries; i++)
      num++;
  }
}


x86 assembly (clang, -O0):
<bug>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    114c <bug+0x4c>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1147 <bug+0x47>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <bug+0x24>
jmp    1111 <bug+0x11>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @bug(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int EXIT_FAILURE;
int EXIT_SUCCESS;
scalar_t__ test_bt();
int main(void) {
  if (test_bt() != 0)
    return EXIT_FAILURE;
  return EXIT_SUCCESS;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <test_bt@plt>
cmp    $0x0,%rax
je     1141 <main+0x31>
mov    0x2ea9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    114d <main+0x3d>
mov    0x2e90(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_bt@plt>
test   %rax,%rax
jne    1126 <main+0x16>
mov    0x2eb4(%rip),%rax
jmp    112d <main+0x1d>
mov    0x2eb3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 (...) @test_bt()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = load i32, i32* @EXIT_FAILURE
store i32 %5, i32* %1
br label %8
6: ; preds = %0
%7 = load i32, i32* @EXIT_SUCCESS
store i32 %7, i32* %1
br label %8
8: ; preds = %6, %4
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = tail call i64 (...) @test_bt()
%2 = icmp eq i64 %1, 0
%3 = load i32, i32* @EXIT_SUCCESS
%4 = load i32, i32* @EXIT_FAILURE
%5 = select i1 %2, i32 %3, i32 %4
ret i32 %5
}
unsigned int hash(char *p) {
  unsigned int h = 0;
  for (; *p; p++)
    h = 31 * h + *p;
  return h % 29989;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <hash+0x3d>
imul   $0x1f,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
mov    $0x7525,%ecx
xor    %edx,%edx
div    %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     113d <hash+0x3d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
sub    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
mov    %eax,%ecx
imul   $0x22f7217,%rcx,%rcx
shr    $0x28,%rcx
imul   $0x7525,%ecx,%ecx
sub    %ecx,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 31
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = urem i32 %10, 29989
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Type definitions */
typedef int uint_fast8_t;
typedef int uint64_t;
typedef int uint32_t;

/* Variables and functions */
void softfloat_shortShiftLeft64To96M(uint64_t a, uint_fast8_t count,
                                     uint32_t *zPtr) {
  zPtr[(0)] = (uint32_t)a << count;
  a >>= 32 - count;
  zPtr[(2)] = a >> 32;
  zPtr[(1)] = a;
}


x86 assembly (clang, -O0):
<softfloat_shortShiftLeft64To96M>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x8(%rbp),%ecx
shl    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x20,%ecx
sub    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%eax
sar    %cl,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x20,%ecx
sar    %cl,%eax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x8(%rax)
mov    -0x4(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<softfloat_shortShiftLeft64To96M>:
mov    %esi,%ecx
mov    %edi,%eax
shl    %cl,%eax
mov    %eax,(%rdx)
neg    %cl
sar    %cl,%edi
mov    %edi,0x4(%rdx)
ret

LLVM IR (-O0):
define void @softfloat_shortShiftLeft64To96M(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 = load i32, i32* %5
%9 = shl i32 %7, %8
%10 = load i32*, i32** %6
%11 = getelementptr inbounds i32, i32* %10, i64 0
store i32 %9, i32* %11
%12 = load i32, i32* %5
%13 = sub nsw i32 32, %12
%14 = load i32, i32* %4
%15 = ashr i32 %14, %13
store i32 %15, i32* %4
%16 = load i32, i32* %4
%17 = ashr i32 %16, 32
%18 = load i32*, i32** %6
%19 = getelementptr inbounds i32, i32* %18, i64 2
store i32 %17, i32* %19
%20 = load i32, i32* %4
%21 = load i32*, i32** %6
%22 = getelementptr inbounds i32, i32* %21, i64 1
store i32 %20, i32* %22
ret void
}

LLVM IR (-O2):
define void @softfloat_shortShiftLeft64To96M(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = shl i32 %0, %1
store i32 %4, i32* %2
%5 = sub nsw i32 32, %1
%6 = ashr i32 %0, %5
%7 = getelementptr inbounds i32, i32* %2, i64 1
store i32 %6, i32* %7
ret void
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, int *);
int readInt() {
  int i;
  scanf("%d\n", &i);
  return i;
}


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

x86 assembly (clang, -O2):
<readInt>:
push   %rax
lea    0xee8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1030 <scanf@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @readInt() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
size_t utf8size(const void *str) {
  const char *s = (const char *)str;
  size_t size = 0;
  while ('\0' != s[size]) {
    size++;
  }
  size++;
  return size;
}


x86 assembly (clang, -O0):
<utf8size>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     113f <utf8size+0x3f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1118 <utf8size+0x18>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<utf8size>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <utf8size+0x10>
ret

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

LLVM IR (-O2):
define i64 @utf8size(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %7
}
/* Variables and functions */
int /*<<< orphan*/ target();
void path1() { target(); }


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

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

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

LLVM IR (-O2):
define void @path1() {
%1 = tail call i32 (...) @target()
ret void
}
int main() {
  int a;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
void stub(void) { return; }


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

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

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

LLVM IR (-O2):
define void @stub() {
ret void
}
int get_green(unsigned int p) { return (p & 0x00FF00) >> 8; }


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

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

LLVM IR (-O0):
define i32 @get_green(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 65280
%5 = lshr i32 %4, 8
ret i32 %5
}

LLVM IR (-O2):
define i32 @get_green(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ msg();
int /*<<< orphan*/ printf(char *);
int main(void) {
  msg();
  msg();
  msg();
  printf("\n");
  msg();
  msg();
  printf("\n");
  msg();
  printf("\n");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @msg()
%3 = call i32 (...) @msg()
%4 = call i32 (...) @msg()
%5 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%6 = call i32 (...) @msg()
%7 = call i32 (...) @msg()
%8 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%9 = call i32 (...) @msg()
%10 = call i32 @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @msg()
%2 = tail call i32 (...) @msg()
%3 = tail call i32 (...) @msg()
%4 = tail call i32 @putchar(i32 10)
%5 = tail call i32 (...) @msg()
%6 = tail call i32 (...) @msg()
%7 = tail call i32 @putchar(i32 10)
%8 = tail call i32 (...) @msg()
%9 = tail call i32 @putchar(i32 10)
ret i32 0
}
int open_audio_input(int dev, int srate, int chans, int format, int size) {
  return (-1);
}


x86 assembly (clang, -O0):
<open_audio_input>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @open_audio_input(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %6
store i32 %1, i32* %7
store i32 %2, i32* %8
store i32 %3, i32* %9
store i32 %4, i32* %10
ret i32 -1
}

LLVM IR (-O2):
define i32 @open_audio_input(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4) {
ret i32 -1
}
/* Variables and functions */
int getoffset();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char **argv) {
  printf("%llu\n", getoffset() / sizeof(void *));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getoffset@plt>
cltq
shr    $0x3,%rax
mov    %eax,%esi
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <getoffset@plt>
sar    $0x3,%eax
lea    0xece(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 (...) @getoffset()
%6 = sext i32 %5 to i64
%7 = udiv i64 %6, 8
%8 = trunc i64 %7 to i32
%9 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getoffset()
%4 = ashr i32 %3, 3
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
void XtParseAcceleratorTable() {}


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

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

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

LLVM IR (-O2):
define void @XtParseAcceleratorTable() {
ret void
}
double radToDeg(double x) { return x * 57.295779513; }


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

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

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

LLVM IR (-O2):
define double @radToDeg(double %0) {
%2 = fmul double %0, 0x404CA5DC1A6394B6
ret double %2
}
/* Variables and functions */
int pow(float, int);
float outCubic(float t, float b, float c, float d) {
  return c * (pow(t / d - 1, 3) + 1) + b;
}


x86 assembly (clang, -O0):
<outCubic>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x4(%rbp),%xmm0
divss  -0x10(%rbp),%xmm0
movss  0xeb8(%rip),%xmm1
subss  %xmm1,%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
movss  -0x14(%rbp),%xmm0
add    $0x1,%eax
cvtsi2ss %eax,%xmm2
movss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<outCubic>:
push   %rax
movss  %xmm2,(%rsp)
movss  %xmm1,0x4(%rsp)
divss  %xmm3,%xmm0
addss  0xed8(%rip),%xmm0
mov    $0x3,%edi
call   1030 <pow@plt>
add    $0x1,%eax
xorps  %xmm0,%xmm0
cvtsi2ss %eax,%xmm0
mulss  (%rsp),%xmm0
addss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @outCubic(float %0, float %1, float %2, float %3) {
%5 = alloca float
%6 = alloca float
%7 = alloca float
%8 = alloca float
store float %0, float* %5
store float %1, float* %6
store float %2, float* %7
store float %3, float* %8
%9 = load float, float* %7
%10 = load float, float* %5
%11 = load float, float* %8
%12 = fdiv float %10, %11
%13 = fsub float %12, 1.000000e+00
%14 = call i32 @pow(float %13, i32 3)
%15 = add nsw i32 %14, 1
%16 = sitofp i32 %15 to float
%17 = load float, float* %6
%18 = call float @llvm.fmuladd.f32(float %9, float %16, float %17)
ret float %18
}

LLVM IR (-O2):
define float @outCubic(float %0, float %1, float %2, float %3) {
%5 = fdiv float %0, %3
%6 = fadd float %5, -1.000000e+00
%7 = tail call i32 @pow(float %6, i32 3)
%8 = add nsw i32 %7, 1
%9 = sitofp i32 %8 to float
%10 = tail call float @llvm.fmuladd.f32(float %2, float %9, float %1)
ret float %10
}