xunge/DecIR huggingface dataset:
/* Type definitions */
struct re_registers {
  int dummy;
};
struct re_pattern_buffer {
  int dummy;
};

/* Variables and functions */
int re_search_2(struct re_pattern_buffer *, void *, int /*<<< orphan*/,
                char const *, int, int, int, struct re_registers *, int);
int re_search(struct re_pattern_buffer *bufp, const char *string, int size,
              int startpos, int range, struct re_registers *regs) {
  return re_search_2(bufp, (void *)0, 0, string, size, startpos, range, regs,
                     size);
}


x86 assembly (clang, -O0):
<re_search>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rcx
mov    -0x14(%rbp),%r8d
mov    -0x18(%rbp),%r9d
mov    -0x1c(%rbp),%r11d
mov    -0x28(%rbp),%r10
mov    -0x14(%rbp),%eax
xor    %edx,%edx
mov    %edx,%esi
xor    %edx,%edx
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
call   1030 <re_search_2@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<re_search>:
push   %rax
mov    %r9,%rax
mov    %r8d,%r10d
mov    %ecx,%r9d
mov    %edx,%r8d
mov    %rsi,%rcx
sub    $0x8,%rsp
xor    %esi,%esi
xor    %edx,%edx
push   %r8
push   %rax
push   %r10
call   1030 <re_search_2@plt>
add    $0x20,%rsp
pop    %rcx
ret

LLVM IR (-O0):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = alloca %struct.re_pattern_buffer*
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.re_registers*
store %struct.re_pattern_buffer* %0, %struct.re_pattern_buffer** %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store %struct.re_registers* %5, %struct.re_registers** %12
%13 = load %struct.re_pattern_buffer*, %struct.re_pattern_buffer** %7
%14 = load i8*, i8** %8
%15 = load i32, i32* %9
%16 = load i32, i32* %10
%17 = load i32, i32* %11
%18 = load %struct.re_registers*, %struct.re_registers** %12
%19 = load i32, i32* %9
%20 = call i32 @re_search_2(%struct.re_pattern_buffer* %13, i8* null, i32 0, i8* %14, i32 %15, i32 %16, i32 %17, %struct.re_registers* %18, i32 %19)
ret i32 %20
}

LLVM IR (-O2):
%struct.re_pattern_buffer = type { i32 }
%struct.re_registers = type { i32 }
define i32 @re_search(%struct.re_pattern_buffer* %0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5) {
%7 = tail call i32 @re_search_2(%struct.re_pattern_buffer* %0, i8* null, i32 0, i8* %1, i32 %2, i32 %3, i32 %4, %struct.re_registers* %5, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ mergesort_aux(int *, int /*<<< orphan*/, size_t, int *);
void mergesort(int arr[], size_t arr_sz) {
  assert(arr_sz > 0);
  int aux[arr_sz];
  mergesort_aux(arr, 0, arr_sz - 1, aux);
}


x86 assembly (clang, -O0):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
test   %rax,%rax
setne  %al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x10(%rbp),%rax
mov    %rsp,%rcx
mov    %rcx,-0x18(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,%rsp
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
sub    $0x1,%rdx
xor    %esi,%esi
call   1030 <mergesort_aux@plt>
mov    -0x18(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mergesort>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r15
mov    %rdi,%r14
xor    %edi,%edi
mov    %rsi,%rbx
add    $0xffffffffffffffff,%rbx
setb   %dil
call   1040 <assert@plt>
mov    %rsp,%rcx
lea    0xf(,%r15,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rcx
mov    %rcx,%rsp
mov    %r14,%rdi
xor    %esi,%esi
mov    %rbx,%rdx
call   1030 <mergesort_aux@plt>
lea    -0x18(%rbp),%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @mergesort(i32* %0, i64 %1) {
%3 = alloca i32*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i64
store i32* %0, i32** %3
store i64 %1, i64* %4
%7 = load i64, i64* %4
%8 = icmp ugt i64 %7, 0
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load i64, i64* %4
%12 = call i8* @llvm.stacksave()
store i8* %12, i8** %5
%13 = alloca i32, i64 %11
store i64 %11, i64* %6
%14 = load i32*, i32** %3
%15 = load i64, i64* %4
%16 = sub i64 %15, 1
%17 = call i32 @mergesort_aux(i32* %14, i32 0, i64 %16, i32* %13)
%18 = load i8*, i8** %5
ret void
}

LLVM IR (-O2):
define void @mergesort(i32* %0, i64 %1) {
%3 = icmp ne i64 %1, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = alloca i32, i64 %1
%7 = add i64 %1, -1
%8 = call i32 @mergesort_aux(i32* %0, i32 0, i64 %7, i32* %6)
ret void
}
int test_imm_CAuint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xCA << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_CAuint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 202
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
__attribute__((patchable_function_entry(4, 4))) void f44() {}


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

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

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

LLVM IR (-O2):
define void @f44() {
ret void
}
/* Variables and functions */
scalar_t__ final_overflow();
int /*<<< orphan*/ ov_reset();
void global_ov(void) {
  if (final_overflow())
    ov_reset();
}


x86 assembly (clang, -O0):
<global_ov>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <final_overflow@plt>
cmp    $0x0,%rax
je     113c <global_ov+0x1c>
mov    $0x0,%al
call   1040 <ov_reset@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<global_ov>:
push   %rax
xor    %eax,%eax
call   1030 <final_overflow@plt>
test   %rax,%rax
je     1135 <global_ov+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ov_reset@plt>
pop    %rax
ret

LLVM IR (-O0):
define void @global_ov() {
%1 = call i64 (...) @final_overflow()
%2 = icmp ne i64 %1, 0
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = call i32 (...) @ov_reset()
br label %5
5: ; preds = %3, %0
ret void
}

LLVM IR (-O2):
define void @global_ov() {
%1 = tail call i64 (...) @final_overflow()
%2 = icmp eq i64 %1, 0
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (...) @ov_reset()
br label %5
5: ; preds = %3, %0
ret void
}
/* Type definitions */
struct t_hdata {
  int dummy;
};
struct t_hashtable {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ hashtable_remove(struct t_hashtable *, void const *);
int /*<<< orphan*/ hdata_free(struct t_hdata *);
void hdata_free_all_map_cb(void *data, struct t_hashtable *hashtable,
                           const void *key, const void *value) {
  struct t_hdata *ptr_hdata;
  (void)data;
  ptr_hdata = (struct t_hdata *)value;
  hdata_free(ptr_hdata);
  hashtable_remove(hashtable, key);
}


x86 assembly (clang, -O0):
<hdata_free_all_map_cb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
call   1040 <hdata_free@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <hashtable_remove@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hdata_free_all_map_cb>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rcx,%rdi
call   1040 <hdata_free@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <hashtable_remove@plt>

LLVM IR (-O0):
%struct.t_hashtable = type { i32 }
%struct.t_hdata = type { i32 }
define void @hdata_free_all_map_cb(i8* %0, %struct.t_hashtable* %1, i8* %2, i8* %3) {
%5 = alloca i8*
%6 = alloca %struct.t_hashtable*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca %struct.t_hdata*
store i8* %0, i8** %5
store %struct.t_hashtable* %1, %struct.t_hashtable** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i8*, i8** %5
%11 = load i8*, i8** %8
%12 = bitcast i8* %11 to %struct.t_hdata*
store %struct.t_hdata* %12, %struct.t_hdata** %9
%13 = load %struct.t_hdata*, %struct.t_hdata** %9
%14 = call i32 @hdata_free(%struct.t_hdata* %13)
%15 = load %struct.t_hashtable*, %struct.t_hashtable** %6
%16 = load i8*, i8** %7
%17 = call i32 @hashtable_remove(%struct.t_hashtable* %15, i8* %16)
ret void
}

LLVM IR (-O2):
%struct.t_hashtable = type { i32 }
%struct.t_hdata = type { i32 }
define void @hdata_free_all_map_cb(i8* nocapture readnone %0, %struct.t_hashtable* %1, i8* %2, i8* %3) {
%5 = bitcast i8* %3 to %struct.t_hdata*
%6 = tail call i32 @hdata_free(%struct.t_hdata* %5)
%7 = tail call i32 @hashtable_remove(%struct.t_hashtable* %1, i8* %2)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ mbstate_t;

/* Variables and functions */
size_t mbrtowc(int /*<<< orphan*/ *, char const *, size_t,
               int /*<<< orphan*/ *);
size_t mbrlen(char const *restrict s, size_t n, mbstate_t *restrict ps) {
  return mbrtowc(NULL, s, n, ps);
}


x86 assembly (clang, -O0):
<mbrlen>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%edi
call   1030 <mbrtowc@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mbrlen>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
xor    %edi,%edi
jmp    1030 <mbrtowc@plt>

LLVM IR (-O0):
define i64 @mbrlen(i8* noalias %0, i64 %1, i32* noalias %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i32*
store i8* %0, i8** %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i8*, i8** %4
%8 = load i64, i64* %5
%9 = load i32*, i32** %6
%10 = call i64 @mbrtowc(i32* null, i8* %7, i64 %8, i32* %9)
ret i64 %10
}

LLVM IR (-O2):
define i64 @mbrlen(i8* noalias %0, i64 %1, i32* noalias %2) {
%4 = tail call i64 @mbrtowc(i32* null, i8* %0, i64 %1, i32* %2)
ret i64 %4
}
/* Variables and functions */
double __nv_lgamma(double);
double lgamma(double __a) { return __nv_lgamma(__a); }


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

x86 assembly (clang, -O2):
<lgamma>:
jmp    1030 <__nv_lgamma@plt>

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

LLVM IR (-O2):
define double @lgamma(double %0) {
%2 = tail call double @__nv_lgamma(double %0)
ret double %2
}
void X509_REQ_extension_nid(void) {}


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

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

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

LLVM IR (-O2):
define void @X509_REQ_extension_nid() {
ret void
}
void free_int_matrix(int **m, long nrl, long ncl) {
  free((m[nrl] + ncl - 1));
  free((m + nrl - 1));
}


x86 assembly (clang, -O0):
<free_int_matrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
mov    -0x18(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rdi
add    $0xfffffffffffffff8,%rdi
call   1030 <free@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<free_int_matrix>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
mov    (%rdi,%rsi,8),%rax
lea    (%rax,%rdx,4),%rdi
add    $0xfffffffffffffffc,%rdi
call   1030 <free@plt>
lea    (%rbx,%r14,8),%rdi
add    $0xfffffffffffffff8,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @free_int_matrix(i32** %0, i64 %1, i64 %2) {
%4 = alloca i32**
%5 = alloca i64
%6 = alloca i64
store i32** %0, i32*** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%7 = load i32**, i32*** %4
%8 = load i64, i64* %5
%9 = getelementptr inbounds i32*, i32** %7, i64 %8
%10 = load i32*, i32** %9
%11 = load i64, i64* %6
%12 = getelementptr inbounds i32, i32* %10, i64 %11
%13 = getelementptr inbounds i32, i32* %12, i64 -1
%14 = bitcast i32* %13 to i8*
%15 = load i32**, i32*** %4
%16 = load i64, i64* %5
%17 = getelementptr inbounds i32*, i32** %15, i64 %16
%18 = getelementptr inbounds i32*, i32** %17, i64 -1
%19 = bitcast i32** %18 to i8*
ret void
}

LLVM IR (-O2):
define void @free_int_matrix(i32** nocapture %0, i64 %1, i64 %2) {
%4 = getelementptr inbounds i32*, i32** %0, i64 %1
%5 = load i32*, i32** %4
%6 = getelementptr inbounds i32, i32* %5, i64 %2
%7 = getelementptr inbounds i32, i32* %6, i64 -1
%8 = bitcast i32* %7 to i8*
tail call void @free(i8* %8)
%9 = getelementptr inbounds i32*, i32** %4, i64 -1
%10 = bitcast i32** %9 to i8*
tail call void @free(i8* %10)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
unsigned long long highest_one(int);
__attribute__((always_)) uint64_t round_down_to_power_of_2(uint64_t x) {
  return 1ULL << highest_one(x | 1);
}


x86 assembly (clang, -O0):
<round_down_to_power_of_2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
or     $0x1,%edi
call   1030 <highest_one@plt>
mov    %rax,%rcx
mov    $0x1,%eax
shl    %cl,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<round_down_to_power_of_2>:
push   %rax
or     $0x1,%edi
call   1030 <highest_one@plt>
mov    $0x1,%edx
mov    %eax,%ecx
shl    %cl,%rdx
mov    %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @round_down_to_power_of_2(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, 1
%5 = call i64 @highest_one(i32 %4)
%6 = shl i64 1, %5
%7 = trunc i64 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @round_down_to_power_of_2(i32 %0) {
%2 = or i32 %0, 1
%3 = tail call i64 @highest_one(i32 %2)
%4 = shl nuw i64 1, %3
%5 = trunc i64 %4 to i32
ret i32 %5
}
int bit_count_u64(unsigned long long int arg) {
  arg = (arg & 0x5555555555555555ULL) + ((arg >> 1) & 0x5555555555555555ULL);
  arg = (arg & 0x3333333333333333ULL) + ((arg >> 2) & 0x3333333333333333ULL);
  arg = (arg & 0x0f0f0f0f0f0f0f0fULL) + ((arg >> 4) & 0x0f0f0f0f0f0f0f0fULL);
  return (arg * 0x0101010101010101ULL) >> 56;
}


x86 assembly (clang, -O0):
<bit_count_u64>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movabs $0x5555555555555555,%rax
55 55 55
and    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x1,%rcx
movabs $0x5555555555555555,%rdx
55 55 55
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
movabs $0x3333333333333333,%rax
33 33 33
and    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x2,%rcx
movabs $0x3333333333333333,%rdx
33 33 33
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
movabs $0xf0f0f0f0f0f0f0f,%rax
0f 0f 0f
and    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
shr    $0x4,%rcx
movabs $0xf0f0f0f0f0f0f0f,%rdx
0f 0f 0f
and    %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
movabs $0x101010101010101,%rax
01 01 01
imul   -0x8(%rbp),%rax
shr    $0x38,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bit_count_u64>:
movabs $0x5555555555555555,%rcx
55 55 55
mov    %rdi,%rax
and    %rcx,%rax
shr    %rdi
and    %rdi,%rcx
add    %rax,%rcx
movabs $0x3333333333333333,%rax
33 33 33
mov    %rcx,%rdx
and    %rax,%rdx
shr    $0x2,%rcx
and    %rax,%rcx
add    %rdx,%rcx
movabs $0x707070707070707,%rax
07 07 07
mov    %rcx,%rdx
and    %rax,%rdx
shr    $0x4,%rcx
and    %rax,%rcx
add    %rdx,%rcx
movabs $0x101010101010101,%rax
01 01 01
imul   %rcx,%rax
shr    $0x38,%rax
ret

LLVM IR (-O0):
define i32 @bit_count_u64(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = and i64 %3, 6148914691236517205
%5 = load i64, i64* %2
%6 = lshr i64 %5, 1
%7 = and i64 %6, 6148914691236517205
%8 = add i64 %4, %7
store i64 %8, i64* %2
%9 = load i64, i64* %2
%10 = and i64 %9, 3689348814741910323
%11 = load i64, i64* %2
%12 = lshr i64 %11, 2
%13 = and i64 %12, 3689348814741910323
%14 = add i64 %10, %13
store i64 %14, i64* %2
%15 = load i64, i64* %2
%16 = and i64 %15, 1085102592571150095
%17 = load i64, i64* %2
%18 = lshr i64 %17, 4
%19 = and i64 %18, 1085102592571150095
%20 = add i64 %16, %19
store i64 %20, i64* %2
%21 = load i64, i64* %2
%22 = mul i64 %21, 72340172838076673
%23 = lshr i64 %22, 56
%24 = trunc i64 %23 to i32
ret i32 %24
}

LLVM IR (-O2):
define i32 @bit_count_u64(i64 %0) {
%2 = and i64 %0, 6148914691236517205
%3 = lshr i64 %0, 1
%4 = and i64 %3, 6148914691236517205
%5 = add nuw i64 %4, %2
%6 = and i64 %5, 3689348814741910323
%7 = lshr i64 %5, 2
%8 = and i64 %7, 3689348814741910323
%9 = add nuw nsw i64 %8, %6
%10 = and i64 %9, 506381209866536711
%11 = lshr i64 %9, 4
%12 = and i64 %11, 506381209866536711
%13 = add nuw nsw i64 %12, %10
%14 = mul i64 %13, 72340172838076673
%15 = lshr i64 %14, 56
%16 = trunc i64 %15 to i32
ret i32 %16
}
/* Variables and functions */
int htoi(char *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  char *n = "0x7ff0";
  printf("RESULT is %d\n", htoi(n));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <htoi@plt>
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
lea    0xed8(%rip),%rdi
call   1040 <htoi@plt>
lea    0xed3(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [7 x i8] c"0x7ff0\00"
@.str.1 = [14 x i8] c"RESULT is %d\0A\00"
define i32 @main() {
%1 = tail call i32 @htoi(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %1)
ret i32 0
}
void gtk_window_add_mnemonic() {}


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

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

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

LLVM IR (-O2):
define void @gtk_window_add_mnemonic() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int getProgramBits();
int /*<<< orphan*/ printf(char *, int);
int main(int argc, char *argv[]) {
  printf("bits:\t%d\n", getProgramBits());
  assert(argc > 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1050 <getProgramBits@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x8(%rbp)
setg   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1050 <getProgramBits@plt>
lea    0xebf(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %edi,%edi
cmp    $0x2,%ebx
setge  %dil
call   1040 <assert@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"bits:\09%d\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @getProgramBits()
%7 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %6)
%8 = load i32, i32* %4
%9 = icmp sgt i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
ret i32 0
}

LLVM IR (-O2):
@.str = [10 x i8] c"bits:\09%d\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @getProgramBits()
%4 = tail call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp sgt i32 %0, 1
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ quicksort(int /*<<< orphan*/, int);
void sort(int length) { quicksort(0, length - 1); }


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

x86 assembly (clang, -O2):
<sort>:
lea    -0x1(%rdi),%esi
xor    %edi,%edi
jmp    1030 <quicksort@plt>

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

LLVM IR (-O2):
define void @sort(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = tail call i32 @quicksort(i32 0, i32 %2)
ret void
}
void Rename_MBR_SET_OBJ(bb, ss, vv) int *bb, ss, vv;
{
  int r, b;
  Rename_SRC_HIH_EQL_SET_OBJ(&b, &r, ss, vv);
  *bb = b;
}


x86 assembly (clang, -O0):
<Rename_MBR_SET_OBJ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x18(%rbp),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1030 <Rename_SRC_HIH_EQL_SET_OBJ@plt>
mov    -0x18(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Rename_MBR_SET_OBJ>:
push   %rbx
sub    $0x10,%rsp
mov    %edx,%ecx
mov    %esi,%edx
mov    %rdi,%rbx
lea    0x8(%rsp),%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   1030 <Rename_SRC_HIH_EQL_SET_OBJ@plt>
mov    0x8(%rsp),%eax
mov    %eax,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define void @Rename_MBR_SET_OBJ(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Rename_SRC_HIH_EQL_SET_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %8, i32* %7, i32 %9, i32 %10)
%12 = load i32, i32* %8
%13 = load i32*, i32** %4
store i32 %12, i32* %13
ret void
}

LLVM IR (-O2):
define void @Rename_MBR_SET_OBJ(i32* nocapture writeonly %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = bitcast i32* %4 to i8*
%7 = bitcast i32* %5 to i8*
%8 = call i32 (i32*, i32*, i32, i32, ...) bitcast (i32 (...)* @Rename_SRC_HIH_EQL_SET_OBJ to i32 (i32*, i32*, i32, i32, ...)*)(i32* %5, i32* %4, i32 %1, i32 %2)
%9 = load i32, i32* %5
store i32 %9, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ configureIeeePatch();
int /*<<< orphan*/ enterIeeeCpePatch();
int /*<<< orphan*/ enterIeeeSysPatch();
void applyIeeePatch(void) {
  enterIeeeSysPatch();
  enterIeeeCpePatch();
  configureIeeePatch();
}


x86 assembly (clang, -O0):
<applyIeeePatch>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <enterIeeeSysPatch@plt>
mov    $0x0,%al
call   1050 <enterIeeeCpePatch@plt>
mov    $0x0,%al
call   1030 <configureIeeePatch@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<applyIeeePatch>:
push   %rax
xor    %eax,%eax
call   1040 <enterIeeeSysPatch@plt>
xor    %eax,%eax
call   1050 <enterIeeeCpePatch@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <configureIeeePatch@plt>

LLVM IR (-O0):
define void @applyIeeePatch() {
%1 = call i32 (...) @enterIeeeSysPatch()
%2 = call i32 (...) @enterIeeeCpePatch()
%3 = call i32 (...) @configureIeeePatch()
ret void
}

LLVM IR (-O2):
define void @applyIeeePatch() {
%1 = tail call i32 (...) @enterIeeeSysPatch()
%2 = tail call i32 (...) @enterIeeeCpePatch()
%3 = tail call i32 (...) @configureIeeePatch()
ret void
}
void unsigned_prune_ge2_Good(unsigned int x, unsigned int y) {
  if (y > 0) {
    if (x >= y) {
      unsigned int z = x - 1;
    }
  }
}


x86 assembly (clang, -O0):
<unsigned_prune_ge2_Good>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jbe    112e <unsigned_prune_ge2_Good+0x2e>
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jb     1129 <unsigned_prune_ge2_Good+0x29>
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112e <unsigned_prune_ge2_Good+0x2e>
pop    %rbp
ret

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

LLVM IR (-O0):
define void @unsigned_prune_ge2_Good(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 = icmp ugt i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %2
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = icmp uge i32 %9, %10
br i1 %11, label %12, label %15
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sub i32 %13, 1
store i32 %14, i32* %5
br label %15
15: ; preds = %12, %8
br label %16
16: ; preds = %15, %2
ret void
}

LLVM IR (-O2):
define void @unsigned_prune_ge2_Good(i32 %0, i32 %1) {
ret void
}
int quadint(int input) { return input * input; }


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

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

LLVM IR (-O0):
define i32 @quadint(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = mul nsw i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @quadint(i32 %0) {
%2 = mul nsw i32 %0, %0
ret i32 %2
}
void test___atomic_nand_fetch_2(int *mem) { __atomic_nand_fetch(mem, 1, 4); }


x86 assembly (clang, -O0):
<test___atomic_nand_fetch_2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
mov    %ecx,-0x18(%rbp)
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0x20(%rbp),%rcx
mov    -0x18(%rbp),%esi
mov    %eax,%edx
and    %esi,%edx
mov    %edx,-0x28(%rbp)
not    %edx
lock cmpxchg %edx,(%rcx)
sete   %cl
mov    %eax,-0x24(%rbp)
test   $0x1,%cl
mov    %eax,-0x14(%rbp)
jne    1150 <test___atomic_nand_fetch_2+0x50>
jmp    1122 <test___atomic_nand_fetch_2+0x22>
mov    -0x18(%rbp),%ecx
mov    -0x24(%rbp),%eax
and    %ecx,%eax
xor    $0xffffffff,%eax
mov    %eax,-0x10(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<test___atomic_nand_fetch_2>:
mov    (%rdi),%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %eax,%ecx
not    %ecx
or     $0xfffffffe,%ecx
lock cmpxchg %ecx,(%rdi)
jne    1110 <test___atomic_nand_fetch_2+0x10>
ret

LLVM IR (-O0):
define void @test___atomic_nand_fetch_2(i32* %0) {
%2 = alloca i32*
%3 = alloca i32
%4 = alloca i32
store i32* %0, i32** %2
%5 = load i32*, i32** %2
store i32 1, i32* %3
%6 = load i32, i32* %3
%7 = atomicrmw nand i32* %5, i32 %6 acq_rel
%8 = and i32 %7, %6
%9 = xor i32 %8, -1
store i32 %9, i32* %4
%10 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
define void @test___atomic_nand_fetch_2(i32* nocapture %0) {
%2 = atomicrmw nand i32* %0, i32 1 acq_rel
ret void
}
/* Type definitions */
struct emuState {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ TerminalEmulator_bell(struct emuState *);
void do_BEL(struct emuState *S) { TerminalEmulator_bell(S); }


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

x86 assembly (clang, -O2):
<do_BEL>:
jmp    1030 <TerminalEmulator_bell@plt>

LLVM IR (-O0):
%struct.emuState = type { i32 }
define void @do_BEL(%struct.emuState* %0) {
%2 = alloca %struct.emuState*
store %struct.emuState* %0, %struct.emuState** %2
%3 = load %struct.emuState*, %struct.emuState** %2
%4 = call i32 @TerminalEmulator_bell(%struct.emuState* %3)
ret void
}

LLVM IR (-O2):
%struct.emuState = type { i32 }
define void @do_BEL(%struct.emuState* %0) {
%2 = tail call i32 @TerminalEmulator_bell(%struct.emuState* %0)
ret void
}
/* Variables and functions */
int main(int, char **);
int abc2midiC() {
  char *params[] = {"", "in.abc", "-o", "out.mid"};
  return main(4, params);
}


x86 assembly (clang, -O0):
<abc2midiC>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    0x2ce1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2cde(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0x2cdb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0x2cd8(%rip),%rax
mov    %rax,-0x8(%rbp)
lea    -0x20(%rbp),%rsi
mov    $0x4,%edi
call   1030 <main@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abc2midiC>:
sub    $0x28,%rsp
movaps 0x2cf5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0x2cd9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
call   1030 <main@plt>
add    $0x28,%rsp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"in.abc\00"
@.str.2 = [3 x i8] c"-o\00"
@.str.3 = [8 x i8] c"out.mid\00"
@__const.abc2midiC.params = [4 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0)]
define i32 @abc2midiC() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @main(i32 4, i8** %3)
ret i32 %4
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
@.str.1 = [7 x i8] c"in.abc\00"
@.str.2 = [3 x i8] c"-o\00"
@.str.3 = [8 x i8] c"out.mid\00"
@__const.abc2midiC.params = [4 x i8*] [i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i32 0, i32 0)]
define i32 @abc2midiC() {
%1 = alloca [4 x i8*]
%2 = bitcast [4 x i8*]* %1 to i8*
%3 = getelementptr inbounds [4 x i8*], [4 x i8*]* %1, i64 0, i64 0
%4 = call i32 @main(i32 4, i8** %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
void Quit(int argc, char *argv[]) { exit(0); }


x86 assembly (clang, -O0):
<Quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %edi,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<Quit>:
push   %rax
xor    %edi,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @Quit(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
store i32 %0, i32* %3
store i8** %1, i8*** %4
%5 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define void @Quit(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @exit(i32 0)
unreachable
}
int isalpha(int c) {
  return ((c >= 0x41 && c <= 0x5A) || (c >= 0x61 && c <= 0x7A));
}


x86 assembly (clang, -O0):
<isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     1120 <isalpha+0x20>
mov    $0x1,%al
cmpl   $0x5a,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jle    113f <isalpha+0x3f>
xor    %eax,%eax
cmpl   $0x61,-0x4(%rbp)
mov    %al,-0x6(%rbp)
jl     1139 <isalpha+0x39>
cmpl   $0x7a,-0x4(%rbp)
setle  %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @isalpha(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 65
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %16, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 97
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = load i32, i32* %2
%13 = icmp sle i32 %12, 122
br label %14
14: ; preds = %11, %8
%15 = phi i1 [ false, %8 ], [ %13, %11 ]
br label %16
16: ; preds = %14, %5
%17 = phi i1 [ true, %5 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ _fwalk(int (*)());
_cleanup() {
  extern int fclose();
  _fwalk(fclose);
}


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

x86 assembly (clang, -O2):
<_cleanup>:
mov    0x2ec9(%rip),%rdi
jmp    1030 <_fwalk@plt>

LLVM IR (-O0):
define i32 @_cleanup() {
%1 = alloca i32
%2 = call i32 @_fwalk(i32 (...)* @fclose)
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @_cleanup() {
%1 = tail call i32 @_fwalk(i32 (...)* @fclose)
ret i32 undef
}
void gtk_button_set_label() {}


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

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

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

LLVM IR (-O2):
define void @gtk_button_set_label() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ rtv_print_device_list();
int ciDeviceList(int argc, char **argv) {
  argc = argc;
  argv = argv;
  rtv_print_device_list();
  return (0);
}


x86 assembly (clang, -O0):
<ciDeviceList>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rtv_print_device_list@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ciDeviceList>:
push   %rax
xor    %eax,%eax
call   1030 <rtv_print_device_list@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @ciDeviceList(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
store i32 %5, i32* %3
%6 = load i8**, i8*** %4
store i8** %6, i8*** %4
%7 = call i32 (...) @rtv_print_device_list()
ret i32 0
}

LLVM IR (-O2):
define i32 @ciDeviceList(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @rtv_print_device_list()
ret i32 0
}
long rewind_to_sunday(long serial) {
  serial += 4;
  return (serial - (serial % 7)) - 4;
}


x86 assembly (clang, -O0):
<rewind_to_sunday>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x7,%ecx
cqto
idiv   %rcx
mov    -0x10(%rbp),%rax
sub    %rdx,%rax
sub    $0x4,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rewind_to_sunday>:
lea    0x4(%rdi),%rax
movabs $0x4924924924924925,%rcx
92 24 49
imul   %rcx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    %rdx
add    %rax,%rdx
lea    0x0(,%rdx,8),%rax
sub    %rdx,%rax
add    $0xfffffffffffffffc,%rax
ret

LLVM IR (-O0):
define i64 @rewind_to_sunday(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 4
store i64 %4, i64* %2
%5 = load i64, i64* %2
%6 = load i64, i64* %2
%7 = srem i64 %6, 7
%8 = sub nsw i64 %5, %7
%9 = sub nsw i64 %8, 4
ret i64 %9
}

LLVM IR (-O2):
define i64 @rewind_to_sunday(i64 %0) {
%2 = add nsw i64 %0, 4
%3 = srem i64 %2, 7
%4 = sub i64 %0, %3
ret i64 %4
}
int isoperator(char c) {
  if (c == '*' || c == '+' || c == '-' || c == '/' || c == '^')
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<isoperator>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x2a,%eax
je     114b <isoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2b,%eax
je     114b <isoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2d,%eax
je     114b <isoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x2f,%eax
je     114b <isoperator+0x4b>
movsbl -0x5(%rbp),%eax
cmp    $0x5e,%eax
jne    1157 <isoperator+0x57>
movl   $0x1,-0x4(%rbp)
jmp    115e <isoperator+0x5e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isoperator>:
add    $0xd6,%dil
cmp    $0x34,%dil
ja     1124 <isoperator+0x24>
mov    $0x1,%eax
movzbl %dil,%ecx
movabs $0x1000000000002b,%rdx
bt     %rcx,%rdx
jae    1124 <isoperator+0x24>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @isoperator(i8 signext %0) {
%2 = alloca i32
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp eq i32 %5, 42
br i1 %6, label %23, label %7
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %9, 43
br i1 %10, label %23, label %11
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = icmp eq i32 %13, 45
br i1 %14, label %23, label %15
15: ; preds = %11
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 47
br i1 %18, label %23, label %19
19: ; preds = %15
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = icmp eq i32 %21, 94
br i1 %22, label %23, label %24
23: ; preds = %19, %15, %11, %7, %1
store i32 1, i32* %2
br label %25
24: ; preds = %19
store i32 0, i32* %2
br label %25
25: ; preds = %24, %23
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
define i32 @isoperator(i8 signext %0) {
switch i8 %0, label %2 [
i8 94, label %3
i8 47, label %3
i8 45, label %3
i8 43, label %3
i8 42, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ usb_info_device(int, int, int, int, int, char const *, int);
int usb_host_info_device(void *opaque, int bus_num, int addr, int class_id,
                         int vendor_id, int product_id,
                         const char *product_name, int speed) {
  usb_info_device(bus_num, addr, class_id, vendor_id, product_id, product_name,
                  speed);
  return 0;
}


x86 assembly (clang, -O0):
<usb_host_info_device>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x18(%rbp),%eax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
mov    -0xc(%rbp),%edi
mov    -0x10(%rbp),%esi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
mov    0x10(%rbp),%r9
mov    0x18(%rbp),%eax
mov    %eax,(%rsp)
call   1030 <usb_info_device@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<usb_host_info_device>:
push   %rax
mov    %r9d,%eax
mov    %esi,%edi
mov    0x10(%rsp),%r9
mov    0x18(%rsp),%esi
mov    %esi,(%rsp)
mov    %edx,%esi
mov    %ecx,%edx
mov    %r8d,%ecx
mov    %eax,%r8d
call   1030 <usb_info_device@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @usb_host_info_device(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7) {
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i32
store i8* %0, i8** %9
store i32 %1, i32* %10
store i32 %2, i32* %11
store i32 %3, i32* %12
store i32 %4, i32* %13
store i32 %5, i32* %14
store i8* %6, i8** %15
store i32 %7, i32* %16
%17 = load i32, i32* %10
%18 = load i32, i32* %11
%19 = load i32, i32* %12
%20 = load i32, i32* %13
%21 = load i32, i32* %14
%22 = load i8*, i8** %15
%23 = load i32, i32* %16
%24 = call i32 @usb_info_device(i32 %17, i32 %18, i32 %19, i32 %20, i32 %21, i8* %22, i32 %23)
ret i32 0
}

LLVM IR (-O2):
define i32 @usb_host_info_device(i8* nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7) {
%9 = tail call i32 @usb_info_device(i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i8* %6, i32 %7)
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void _llshift(uint32_t value[]) {
  if (value[0] & 0x80000000)
    value[1] = (value[1] << 1) | 1;
  else
    value[1] <<= 1;
  value[0] <<= 1;
}


x86 assembly (clang, -O0):
<_llshift>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
and    $0x80000000,%eax
cmp    $0x0,%eax
je     1135 <_llshift+0x35>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x1,%ecx
or     $0x1,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,0x4(%rax)
jmp    1142 <_llshift+0x42>
mov    -0x8(%rbp),%rax
mov    0x4(%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,0x4(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_llshift>:
mov    (%rdi),%eax
shld   $0x1,%eax,0x4(%rdi)
add    %eax,%eax
mov    %eax,(%rdi)
ret

LLVM IR (-O0):
define void @_llshift(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 0
%5 = load i32, i32* %4
%6 = and i32 %5, -2147483648
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %16
8: ; preds = %1
%9 = load i32*, i32** %2
%10 = getelementptr inbounds i32, i32* %9, i64 1
%11 = load i32, i32* %10
%12 = shl i32 %11, 1
%13 = or i32 %12, 1
%14 = load i32*, i32** %2
%15 = getelementptr inbounds i32, i32* %14, i64 1
store i32 %13, i32* %15
br label %21
16: ; preds = %1
%17 = load i32*, i32** %2
%18 = getelementptr inbounds i32, i32* %17, i64 1
%19 = load i32, i32* %18
%20 = shl i32 %19, 1
store i32 %20, i32* %18
br label %21
21: ; preds = %16, %8
%22 = load i32*, i32** %2
%23 = getelementptr inbounds i32, i32* %22, i64 0
%24 = load i32, i32* %23
%25 = shl i32 %24, 1
store i32 %25, i32* %23
ret void
}

LLVM IR (-O2):
define void @_llshift(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = getelementptr inbounds i32, i32* %0, i64 1
%4 = load i32, i32* %3
%5 = call i32 @llvm.fshl.i32(i32 %4, i32 %2, i32 1)
store i32 %5, i32* %3
%6 = shl i32 %2, 1
store i32 %6, i32* %0
ret void
}
int base64_needed_encoded_length(int length_of_data) {
  int nb_base64_chars;
  nb_base64_chars = (length_of_data + 2) / 3 * 4;
  return nb_base64_chars + (nb_base64_chars - 1) / 76 + 1;
}


x86 assembly (clang, -O0):
<base64_needed_encoded_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
shl    $0x2,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
mov    $0x4c,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<base64_needed_encoded_length>:
add    $0x2,%edi
movslq %edi,%rax
imul   $0x55555556,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    -0x1(,%rax,4),%ecx
movslq %ecx,%rcx
imul   $0x6bca1af3,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
lea    (%rcx,%rax,4),%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @base64_needed_encoded_length(i32 %0) {
%2 = add nsw i32 %0, 2
%3 = sdiv i32 %2, 3
%4 = shl nsw i32 %3, 2
%5 = add nsw i32 %4, -1
%6 = sdiv i32 %5, 76
%7 = or i32 %4, 1
%8 = add i32 %7, %6
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EX_OSERR;
int /*<<< orphan*/ SIG_DFL;
int /*<<< orphan*/ cleanup();
int /*<<< orphan*/ err(int /*<<< orphan*/, char *);
int /*<<< orphan*/ getpid();
int kill(int /*<<< orphan*/, int);
int /*<<< orphan*/ signal(int, int /*<<< orphan*/);
void killed(int sig) {
  cleanup();
  signal(sig, SIG_DFL);
  if (kill(getpid(), sig) == -1)
    err(EX_OSERR, "kill failed");
}


x86 assembly (clang, -O0):
<killed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1070 <cleanup@plt>
mov    -0x4(%rbp),%edi
mov    0x2e74(%rip),%rax
mov    (%rax),%esi
call   1040 <signal@plt>
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x4(%rbp),%esi
call   1050 <kill@plt>
cmp    $0xffffffff,%eax
jne    11a2 <killed+0x52>
mov    0x2e44(%rip),%rax
mov    (%rax),%edi
lea    0xe63(%rip),%rsi
call   1060 <err@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<killed>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1070 <cleanup@plt>
mov    0x2e7f(%rip),%rax
mov    (%rax),%esi
mov    %ebx,%edi
call   1040 <signal@plt>
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <kill@plt>
cmp    $0xffffffff,%eax
je     1181 <killed+0x31>
pop    %rbx
ret
mov    0x2e50(%rip),%rax
mov    (%rax),%edi
lea    0xe6f(%rip),%rsi
pop    %rbx
jmp    1060 <err@plt>

LLVM IR (-O0):
@SIG_DFL = global i32 0
@EX_OSERR = global i32 0
@.str = [12 x i8] c"kill failed\00"
define void @killed(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @cleanup()
%4 = load i32, i32* %2
%5 = load i32, i32* @SIG_DFL
%6 = call i32 @signal(i32 %4, i32 %5)
%7 = call i32 (...) @getpid()
%8 = load i32, i32* %2
%9 = call i32 @kill(i32 %7, i32 %8)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %1
%12 = load i32, i32* @EX_OSERR
%13 = call i32 @err(i32 %12, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %11, %1
ret void
}

LLVM IR (-O2):
@SIG_DFL = global i32 0
@EX_OSERR = global i32 0
@.str = [12 x i8] c"kill failed\00"
define void @killed(i32 %0) {
%2 = tail call i32 (...) @cleanup()
%3 = load i32, i32* @SIG_DFL
%4 = tail call i32 @signal(i32 %0, i32 %3)
%5 = tail call i32 (...) @getpid()
%6 = tail call i32 @kill(i32 %5, i32 %0)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %11
8: ; preds = %1
%9 = load i32, i32* @EX_OSERR
%10 = tail call i32 @err(i32 %9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0))
br label %11
11: ; preds = %8, %1
ret void
}
void gdk_byte_order_get_type() {}


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

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

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

LLVM IR (-O2):
define void @gdk_byte_order_get_type() {
ret void
}
int machine_is_little_endian() {
  int test_byte_order = 1;
  return ((char *)&test_byte_order)[0];
}


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

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

LLVM IR (-O0):
define i32 @machine_is_little_endian() {
%1 = alloca i32
store i32 1, i32* %1
%2 = bitcast i32* %1 to i8*
%3 = getelementptr inbounds i8, i8* %2, i64 0
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @machine_is_little_endian() {
ret i32 1
}