xunge/DecIR huggingface dataset:
int fun130() { return 130; }


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

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

LLVM IR (-O0):
define i32 @fun130() {
ret i32 130
}

LLVM IR (-O2):
define i32 @fun130() {
ret i32 130
}
int cmp_pri(double next, double curr) { return (next < curr); }


x86 assembly (clang, -O0):
<cmp_pri>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm0
ucomisd %xmm1,%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cmp_pri>:
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
ret

LLVM IR (-O0):
define i32 @cmp_pri(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fcmp olt double %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @cmp_pri(double %0, double %1) {
%3 = fcmp olt double %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int data_onhex(int, int /*<<< orphan*/);
int /*<<< orphan*/ map_getrobberhex();
int ai_knighton(int player) { return data_onhex(player, map_getrobberhex()); }


x86 assembly (clang, -O0):
<ai_knighton>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <map_getrobberhex@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <data_onhex@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ai_knighton>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <map_getrobberhex@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <data_onhex@plt>

LLVM IR (-O0):
define i32 @ai_knighton(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @map_getrobberhex()
%5 = call i32 @data_onhex(i32 %3, i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @ai_knighton(i32 %0) {
%2 = tail call i32 (...) @map_getrobberhex()
%3 = tail call i32 @data_onhex(i32 %0, i32 %2)
ret i32 %3
}
void rop3_34_0_0(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = ~S;
  stk1 = *D & stk2;
  *D = stk1;
}


x86 assembly (clang, -O0):
<rop3_34_0_0>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0x9(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
and    %ecx,%eax
mov    %al,-0xb(%rbp)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_34_0_0>:
not    %sil
and    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_34_0_0(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %5
%10 = zext i8 %9 to i32
%11 = xor i32 %10, -1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %8
%13 = load i8*, i8** %4
%14 = load i8, i8* %13
%15 = zext i8 %14 to i32
%16 = load i8, i8* %8
%17 = zext i8 %16 to i32
%18 = and i32 %15, %17
%19 = trunc i32 %18 to i8
store i8 %19, i8* %7
%20 = load i8, i8* %7
%21 = load i8*, i8** %4
store i8 %20, i8* %21
ret void
}

LLVM IR (-O2):
define void @rop3_34_0_0(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = xor i8 %1, -1
%5 = load i8, i8* %0
%6 = and i8 %5, %4
store i8 %6, i8* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bsearch_test();
int /*<<< orphan*/ qsort_test();
int search_sort_test() {
  bsearch_test();
  qsort_test();
  return 0;
}


x86 assembly (clang, -O0):
<search_sort_test>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <bsearch_test@plt>
mov    $0x0,%al
call   1030 <qsort_test@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<search_sort_test>:
push   %rax
xor    %eax,%eax
call   1040 <bsearch_test@plt>
xor    %eax,%eax
call   1030 <qsort_test@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @search_sort_test() {
%1 = call i32 (...) @bsearch_test()
%2 = call i32 (...) @qsort_test()
ret i32 0
}

LLVM IR (-O2):
define i32 @search_sort_test() {
%1 = tail call i32 (...) @bsearch_test()
%2 = tail call i32 (...) @qsort_test()
ret i32 0
}
void signed_char_add_signed_char(signed char *LHS, signed char RHS) {
  (*LHS) += RHS;
}


x86 assembly (clang, -O0):
<signed_char_add_signed_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movsbl -0x9(%rbp),%edx
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
add    %edx,%ecx
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<signed_char_add_signed_char>:
add    %sil,(%rdi)
ret

LLVM IR (-O0):
define void @signed_char_add_signed_char(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = load i8*, i8** %3
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, %6
%11 = trunc i32 %10 to i8
store i8 %11, i8* %7
ret void
}

LLVM IR (-O2):
define void @signed_char_add_signed_char(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = add i8 %3, %1
store i8 %4, i8* %0
ret void
}
/* Variables and functions */
scalar_t__ foo1(int);
scalar_t__ foo2(int);
int test(int c) { return (foo1(c) || foo2(c)); }


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <foo1@plt>
mov    %rax,%rcx
mov    $0x1,%al
cmp    $0x0,%rcx
mov    %al,-0x5(%rbp)
jne    1157 <test+0x37>
mov    -0x4(%rbp),%edi
call   1030 <foo2@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test>:
push   %rbx
mov    %edi,%ebx
call   1040 <foo1@plt>
mov    %rax,%rcx
mov    $0x1,%eax
test   %rcx,%rcx
je     1137 <test+0x17>
pop    %rbx
ret
mov    %ebx,%edi
call   1030 <foo2@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
setne  %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @test(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i64 @foo1(i32 %3)
%5 = icmp ne i64 %4, 0
br i1 %5, label %10, label %6
6: ; preds = %1
%7 = load i32, i32* %2
%8 = call i64 @foo2(i32 %7)
%9 = icmp ne i64 %8, 0
br label %10
10: ; preds = %6, %1
%11 = phi i1 [ true, %1 ], [ %9, %6 ]
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
define i32 @test(i32 %0) {
%2 = tail call i64 @foo1(i32 %0)
%3 = icmp eq i64 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i64 @foo2(i32 %0)
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 1, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func_ignore(int a, int b, int c) { printf("%d\n", a + b + c); }


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

x86 assembly (clang, -O2):
<func_ignore>:
add    %edi,%esi
add    %edx,%esi
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define void @func_ignore(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 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %11)
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @func_ignore(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %5)
ret void
}
/* Type definitions */
struct sockaddr {
  int dummy;
};

/* Variables and functions */
int getsockname(int, struct sockaddr *, unsigned int *);
int Xgetsockname(int s, struct sockaddr *a, int *l) {
  unsigned int rl;
  int code;
  rl = *l;
  code = getsockname(s, a, &rl);
  *l = rl;
  return code;
}


x86 assembly (clang, -O0):
<Xgetsockname>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <getsockname@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Xgetsockname>:
push   %rbx
sub    $0x10,%rsp
mov    %rdx,%rbx
mov    (%rdx),%eax
mov    %eax,0xc(%rsp)
lea    0xc(%rsp),%rdx
call   1030 <getsockname@plt>
mov    0xc(%rsp),%ecx
mov    %ecx,(%rbx)
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
%struct.sockaddr = type { i32 }
define i32 @Xgetsockname(i32 %0, %struct.sockaddr* %1, i32* %2) {
%4 = alloca i32
%5 = alloca %struct.sockaddr*
%6 = alloca i32*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %4
store %struct.sockaddr* %1, %struct.sockaddr** %5
store i32* %2, i32** %6
%9 = load i32*, i32** %6
%10 = load i32, i32* %9
store i32 %10, i32* %7
%11 = load i32, i32* %4
%12 = load %struct.sockaddr*, %struct.sockaddr** %5
%13 = call i32 @getsockname(i32 %11, %struct.sockaddr* %12, i32* %7)
store i32 %13, i32* %8
%14 = load i32, i32* %7
%15 = load i32*, i32** %6
store i32 %14, i32* %15
%16 = load i32, i32* %8
ret i32 %16
}

LLVM IR (-O2):
%struct.sockaddr = type { i32 }
define i32 @Xgetsockname(i32 %0, %struct.sockaddr* %1, i32* nocapture %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
%6 = load i32, i32* %2
store i32 %6, i32* %4
%7 = call i32 @getsockname(i32 %0, %struct.sockaddr* %1, i32* %4)
%8 = load i32, i32* %4
store i32 %8, i32* %2
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(void *);
int strcmp(void *, void *);
int bee_tree_compare_key_default(void *a, void *b) {
  assert(a);
  assert(b);
  return strcmp(a, b);
}


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

x86 assembly (clang, -O2):
<bee_tree_compare_key_default>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1040 <assert@plt>
mov    %r14,%rdi
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <strcmp@plt>

LLVM IR (-O0):
define i32 @bee_tree_compare_key_default(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = call i32 @assert(i8* %5)
%7 = load i8*, i8** %4
%8 = call i32 @assert(i8* %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %4
%11 = call i32 @strcmp(i8* %9, i8* %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @bee_tree_compare_key_default(i8* %0, i8* %1) {
%3 = tail call i32 @assert(i8* %0)
%4 = tail call i32 @assert(i8* %1)
%5 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %5
}
/* Variables and functions */
float logit_1(float);
float logit_1_clamped(float a, float min, float max) {
  a = logit_1(a);
  a = min + (max - min) * a;
  return a;
}


x86 assembly (clang, -O0):
<logit_1_clamped>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <logit_1@plt>
movss  %xmm0,-0x4(%rbp)
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<logit_1_clamped>:
push   %rax
movss  %xmm2,0x4(%rsp)
movss  %xmm1,(%rsp)
call   1030 <logit_1@plt>
movss  (%rsp),%xmm1
movss  0x4(%rsp),%xmm2
subss  %xmm1,%xmm2
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @logit_1_clamped(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = call float @logit_1(float %7)
store float %8, float* %4
%9 = load float, float* %5
%10 = load float, float* %6
%11 = load float, float* %5
%12 = fsub float %10, %11
%13 = load float, float* %4
%14 = call float @llvm.fmuladd.f32(float %12, float %13, float %9)
store float %14, float* %4
%15 = load float, float* %4
ret float %15
}

LLVM IR (-O2):
define float @logit_1_clamped(float %0, float %1, float %2) {
%4 = tail call float @logit_1(float %0)
%5 = fsub float %2, %1
%6 = tail call float @llvm.fmuladd.f32(float %5, float %4, float %1)
ret float %6
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
ssize_t stream_read_fd(void *cookie, void *buf, size_t size) {
  ssize_t nbytes;
  int fd;
  fd = *(int *)cookie;
  nbytes = read(fd, buf, size);
  return (nbytes);
}


x86 assembly (clang, -O0):
<stream_read_fd>:
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    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stream_read_fd>:
mov    (%rdi),%edi
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define i32 @stream_read_fd(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = bitcast i8* %0 to i32*
%5 = load i32, i32* %4
%6 = tail call i32 @read(i32 %5, i8* %1, i64 %2)
ret i32 %6
}
struct WorldCoor *wcsinit(hstring) const char *hstring;
{
  char mchar;
  mchar = (char)0;
  return (wcsinitc(hstring, &mchar));
}


x86 assembly (clang, -O0):
<wcsinit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1030 <wcsinitc@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wcsinit>:
push   %rax
movb   $0x0,0x7(%rsp)
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1030 <wcsinitc@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsinit(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
store i8* %0, i8** %2
store i8 0, i8* %3
%4 = load i8*, i8** %2
%5 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitc to i32 (i8*, i8*, ...)*)(i8* %4, i8* %3)
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to %struct.WorldCoor*
ret %struct.WorldCoor* %7
}

LLVM IR (-O2):
%struct.WorldCoor = type opaque
define %struct.WorldCoor* @wcsinit(i8* %0) {
%2 = alloca i8
store i8 0, i8* %2
%3 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wcsinitc to i32 (i8*, i8*, ...)*)(i8* %0, i8* %2)
%4 = sext i32 %3 to i64
%5 = inttoptr i64 %4 to %struct.WorldCoor*
ret %struct.WorldCoor* %5
}
/* Type definitions */
typedef unsigned long uint32_t;

/* Variables and functions */
void set_bit_u32(int nr, uint32_t *addr) {
  addr[nr >> 5] |= (1UL << (nr & 31));
}


x86 assembly (clang, -O0):
<set_bit_u32>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%eax
and    $0x1f,%eax
mov    %eax,%eax
mov    %eax,%ecx
mov    $0x1,%edx
shl    %cl,%rdx
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
sar    $0x5,%ecx
movslq %ecx,%rcx
or     (%rax,%rcx,8),%rdx
mov    %rdx,(%rax,%rcx,8)
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit_u32>:
mov    %edi,%ecx
and    $0x1f,%cl
mov    $0x1,%eax
shl    %cl,%rax
sar    $0x5,%edi
movslq %edi,%rcx
or     %rax,(%rsi,%rcx,8)
ret

LLVM IR (-O0):
define void @set_bit_u32(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
store i32 %0, i32* %3
store i64* %1, i64** %4
%5 = load i32, i32* %3
%6 = and i32 %5, 31
%7 = zext i32 %6 to i64
%8 = shl i64 1, %7
%9 = load i64*, i64** %4
%10 = load i32, i32* %3
%11 = ashr i32 %10, 5
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i64, i64* %9, i64 %12
%14 = load i64, i64* %13
%15 = or i64 %14, %8
store i64 %15, i64* %13
ret void
}

LLVM IR (-O2):
define void @set_bit_u32(i32 %0, i64* nocapture %1) {
%3 = and i32 %0, 31
%4 = zext i32 %3 to i64
%5 = shl nuw nsw i64 1, %4
%6 = ashr i32 %0, 5
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i64, i64* %1, i64 %7
%9 = load i64, i64* %8
%10 = or i64 %9, %5
store i64 %10, i64* %8
ret void
}
/* Variables and functions */
int /*<<< orphan*/ link_failure_remainderf();
scalar_t__ remainderf(float, float);
void test_remainderf(float f1, float f2) {
  if (remainderf(f1, f2) != remainderf(f1, f2))
    link_failure_remainderf();
}


x86 assembly (clang, -O0):
<test_remainderf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <remainderf@plt>
mov    %rax,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
call   1040 <remainderf@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
je     116b <test_remainderf+0x4b>
mov    $0x0,%al
call   1030 <link_failure_remainderf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_remainderf>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm1,0xc(%rsp)
movss  %xmm0,0x8(%rsp)
call   1040 <remainderf@plt>
mov    %rax,%rbx
movss  0x8(%rsp),%xmm0
movss  0xc(%rsp),%xmm1
call   1040 <remainderf@plt>
cmp    %rax,%rbx
jne    1155 <test_remainderf+0x35>
add    $0x10,%rsp
pop    %rbx
ret
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
jmp    1030 <link_failure_remainderf@plt>

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

LLVM IR (-O2):
define void @test_remainderf(float %0, float %1) {
%3 = tail call i64 @remainderf(float %0, float %1)
%4 = tail call i64 @remainderf(float %0, float %1)
%5 = icmp eq i64 %3, %4
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 (...) @link_failure_remainderf()
br label %8
8: ; preds = %6, %2
ret void
}
/* Type definitions */
struct passwd {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ geteuid();
struct passwd *getpwuid(int /*<<< orphan*/);
struct passwd *getuserinfo(void) {
  return getpwuid(geteuid());
}


x86 assembly (clang, -O0):
<getuserinfo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <geteuid@plt>
mov    %eax,%edi
call   1030 <getpwuid@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<getuserinfo>:
push   %rax
xor    %eax,%eax
call   1040 <geteuid@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <getpwuid@plt>

LLVM IR (-O0):
%struct.passwd = type { i32 }
define %struct.passwd* @getuserinfo() {
%1 = call i32 (...) @geteuid()
%2 = call %struct.passwd* @getpwuid(i32 %1)
ret %struct.passwd* %2
}

LLVM IR (-O2):
%struct.passwd = type { i32 }
define %struct.passwd* @getuserinfo() {
%1 = tail call i32 (...) @geteuid()
%2 = tail call %struct.passwd* @getpwuid(i32 %1)
ret %struct.passwd* %2
}
/* Variables and functions */
int /*<<< orphan*/ memcmp(void const *, void const *, size_t);
bool cutils_cdar_DynamicArray_unsigned_long_long_compare(const void *p1,
                                                         const void *p2,
                                                         size_t s) {
  return !memcmp(p1, p2, s);
}


x86 assembly (clang, -O0):
<cutils_cdar_DynamicArray_unsigned_long_long_compare>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <memcmp@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cutils_cdar_DynamicArray_unsigned_long_long_compare>:
push   %rax
call   1030 <bcmp@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cutils_cdar_DynamicArray_unsigned_long_long_compare(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i8*, i8** %4
%8 = load i8*, i8** %5
%9 = load i64, i64* %6
%10 = call i32 @memcmp(i8* %7, i8* %8, i64 %9)
%11 = icmp ne i32 %10, 0
%12 = xor i1 %11, true
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @cutils_cdar_DynamicArray_unsigned_long_long_compare(i8* nocapture %0, i8* nocapture %1, i64 %2) {
%4 = tail call i32 @bcmp(i8* %0, i8* %1, i64 %2)
%5 = icmp eq i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int date_get_year(void) {
  time_t t;
  struct tm *lt;
  t = time(NULL);
  lt = localtime(&t);
  return lt->tm_year + 1900;
}


x86 assembly (clang, -O0):
<date_get_year>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,-0x4(%rbp)
lea    -0x4(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
add    $0x76c,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_year>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <localtime@plt>
mov    $0x76c,%ecx
add    (%rax),%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.tm = type { i32 }
define i32 @date_get_year() {
%1 = alloca i32
%2 = alloca %struct.tm*
%3 = call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
store %struct.tm* %4, %struct.tm** %2
%5 = load %struct.tm*, %struct.tm** %2
%6 = getelementptr inbounds %struct.tm, %struct.tm* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = add nsw i32 %7, 1900
ret i32 %8
}

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @date_get_year() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 @time(i32* null)
store i32 %3, i32* %1
%4 = call %struct.tm* @localtime(i32* %1)
%5 = getelementptr inbounds %struct.tm, %struct.tm* %4, i64 0, i32 0
%6 = load i32, i32* %5
%7 = add nsw i32 %6, 1900
ret i32 %7
}
int efx_init_debugfs_channels(struct efx_nic *efx) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.efx_nic = type opaque
define i32 @efx_init_debugfs_channels(%struct.efx_nic* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ LBA_REG(void *, int);
int mercury_ropes(void *phys_addr) {
  if (!LBA_REG(phys_addr, 0x0610))
    return 2;
  else
    return 1;
}


x86 assembly (clang, -O0):
<mercury_ropes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x610,%esi
call   1030 <LBA_REG@plt>
cmp    $0x0,%eax
jne    113f <mercury_ropes+0x2f>
movl   $0x2,-0x4(%rbp)
jmp    1146 <mercury_ropes+0x36>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mercury_ropes>:
push   %rax
mov    $0x610,%esi
call   1030 <LBA_REG@plt>
cmp    $0x1,%eax
mov    $0x1,%eax
adc    $0x0,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @mercury_ropes(i8* %0) {
%2 = tail call i32 @LBA_REG(i8* %0, i32 1552)
%3 = icmp eq i32 %2, 0
%4 = select i1 %3, i32 2, i32 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ I2C_SLAVE;
int ioctl(int, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int i2c_select(int file, int addr) {
  int res;
  if ((res = ioctl(file, I2C_SLAVE, addr)) < 0) {
    perror("ioctl() I2C_SLAVE failed");
  }
  return res;
}


x86 assembly (clang, -O0):
<i2c_select>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2eb0(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%edx
call   1030 <ioctl@plt>
mov    %eax,-0xc(%rbp)
cmp    $0x0,%eax
jge    115a <i2c_select+0x3a>
lea    0xeab(%rip),%rdi
call   1040 <perror@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<i2c_select>:
push   %rbx
mov    %esi,%edx
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%ebx
test   %eax,%eax
js     113b <i2c_select+0x1b>
mov    %ebx,%eax
pop    %rbx
ret
lea    0xebe(%rip),%rdi
call   1040 <perror@plt>
jmp    1137 <i2c_select+0x17>

LLVM IR (-O0):
@I2C_SLAVE = global i32 0
@.str = [25 x i8] c"ioctl() I2C_SLAVE failed\00"
define i32 @i2c_select(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* %3
%7 = load i32, i32* @I2C_SLAVE
%8 = load i32, i32* %4
%9 = call i32 @ioctl(i32 %6, i32 %7, i32 %8)
store i32 %9, i32* %5
%10 = icmp slt i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %13
13: ; preds = %11, %2
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
@I2C_SLAVE = global i32 0
@.str = [25 x i8] c"ioctl() I2C_SLAVE failed\00"
define i32 @i2c_select(i32 %0, i32 %1) {
%3 = load i32, i32* @I2C_SLAVE
%4 = tail call i32 @ioctl(i32 %0, i32 %3, i32 %1)
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @perror(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
br label %8
8: ; preds = %6, %2
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ _EndPrescreening_dc();
void end_mt_search(void) { _EndPrescreening_dc(); }


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

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

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

LLVM IR (-O2):
define void @end_mt_search() {
%1 = tail call i32 (...) @_EndPrescreening_dc()
ret void
}
/* Variables and functions */
int rename(char const *, char const *);
int hoof_hook_rename(const char *oldpath, const char *newpath) {
  return rename(oldpath, newpath);
}


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

x86 assembly (clang, -O2):
<hoof_hook_rename>:
jmp    1030 <rename@plt>

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

LLVM IR (-O2):
define i32 @hoof_hook_rename(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @rename(i8* %0, i8* %1)
ret i32 %3
}
/* Variables and functions */
int safe_close(int);
int safe_close_above_stdio(int fd) {
  if (fd < 3)
    return -1;
  return safe_close(fd);
}


x86 assembly (clang, -O0):
<safe_close_above_stdio>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x3,-0x8(%rbp)
jge    1131 <safe_close_above_stdio+0x21>
movl   $0xffffffff,-0x4(%rbp)
jmp    113c <safe_close_above_stdio+0x2c>
mov    -0x8(%rbp),%edi
call   1030 <safe_close@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_close_above_stdio>:
cmp    $0x3,%edi
jge    111b <safe_close_above_stdio+0xb>
mov    $0xffffffff,%eax
ret
jmp    1030 <safe_close@plt>

LLVM IR (-O0):
define i32 @safe_close_above_stdio(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp slt i32 %4, 3
br i1 %5, label %6, label %7
6: ; preds = %1
store i32 -1, i32* %2
br label %10
7: ; preds = %1
%8 = load i32, i32* %3
%9 = call i32 @safe_close(i32 %8)
store i32 %9, i32* %2
br label %10
10: ; preds = %7, %6
%11 = load i32, i32* %2
ret i32 %11
}

LLVM IR (-O2):
define i32 @safe_close_above_stdio(i32 %0) {
%2 = icmp slt i32 %0, 3
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @safe_close(i32 %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int charc, char **argv) {
  printf("hello github!!!!");
  return 1;
}


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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [17 x i8] c"hello github!!!!\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 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 1
}

LLVM IR (-O2):
@.str = [17 x i8] c"hello github!!!!\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 1
}
unsigned int test_24(unsigned int a, unsigned int b) {
  return (a >> 31) | (b << 1);
}


x86 assembly (clang, -O0):
<test_24>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x1f,%eax
mov    -0x8(%rbp),%ecx
shl    $0x1,%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_24>:
mov    %edi,%eax
shrd   $0x1f,%esi,%eax
ret

LLVM IR (-O0):
define i32 @test_24(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = lshr i32 %5, 31
%7 = load i32, i32* %4
%8 = shl i32 %7, 1
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_24(i32 %0, i32 %1) {
%3 = tail call i32 @llvm.fshl.i32(i32 %1, i32 %0, i32 1)
ret i32 %3
}
int minhafuncao() {
  int x = 0;
  x++;
  return x;
}


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

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

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

LLVM IR (-O2):
define i32 @minhafuncao() {
ret i32 1
}
void ASN1_GENERALIZEDTIME_new(void) {}


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

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

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

LLVM IR (-O2):
define void @ASN1_GENERALIZEDTIME_new() {
ret void
}
/* Variables and functions */
int cfg_processor_get_addr(char *, char *);
int cfg_basic_timer_get_ie_addr(void) {
  return cfg_processor_get_addr("basictimer", "ie");
}


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

x86 assembly (clang, -O2):
<cfg_basic_timer_get_ie_addr>:
lea    0xee9(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <cfg_processor_get_addr@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [3 x i8] c"ie\00"
define i32 @cfg_basic_timer_get_ie_addr() {
%1 = call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}

LLVM IR (-O2):
@.str = [11 x i8] c"basictimer\00"
@.str.1 = [3 x i8] c"ie\00"
define i32 @cfg_basic_timer_get_ie_addr() {
%1 = tail call i32 @cfg_processor_get_addr(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
ret i32 %1
}
int toLowerCase(int x) {
  if (x >= 'A' && x <= 'Z') {
    x -= 'A';
    x += 'a';
  }
  return x;
}


x86 assembly (clang, -O0):
<toLowerCase>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x41,-0x4(%rbp)
jl     112d <toLowerCase+0x2d>
cmpl   $0x5a,-0x4(%rbp)
jg     112d <toLowerCase+0x2d>
mov    -0x4(%rbp),%eax
sub    $0x41,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x61,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toLowerCase>:
lea    -0x41(%rdi),%ecx
lea    0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @toLowerCase(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 %13
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 90
br i1 %7, label %8, label %13
8: ; preds = %5
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 65
store i32 %10, i32* %2
%11 = load i32, i32* %2
%12 = add nsw i32 %11, 97
store i32 %12, i32* %2
br label %13
13: ; preds = %8, %5, %1
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
define i32 @toLowerCase(i32 %0) {
%2 = add i32 %0, -65
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, 32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
struct eapol_sm {
  int dummy;
};

/* Variables and functions */
int eapol_sm_get_status(struct eapol_sm *sm, char *buf, size_t buflen,
                        int verbose) {
  return 0;
}


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

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

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

LLVM IR (-O2):
%struct.eapol_sm = type { i32 }
define i32 @eapol_sm_get_status(%struct.eapol_sm* nocapture readnone %0, i8* nocapture readnone %1, i64 %2, i32 %3) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fatal(char *);
void xol_rd_init(const char *fname) {
  fatal("xol"
        ": This build excluded \""
        "xol"
        "\" support because expat was not installed.\n");
}


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

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

LLVM IR (-O0):
@.str = [73 x i8] c"xol: This build excluded \22xol\22 support because expat was not installed.\0A\00"
define void @xol_rd_init(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @fatal(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [73 x i8] c"xol: This build excluded \22xol\22 support because expat was not installed.\0A\00"
define void @xol_rd_init(i8* nocapture readnone %0) {
%2 = tail call i32 @fatal(i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0))
ret void
}
__attribute__((always_)) void SCB_InvalidateICache(void) {}


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

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

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

LLVM IR (-O2):
define void @SCB_InvalidateICache() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ testFTree();
int /*<<< orphan*/ testFTreeWrite();
int /*<<< orphan*/ testFileReadWrite();
int /*<<< orphan*/ testFnode();
int /*<<< orphan*/ testGeneratedBitmap();
int /*<<< orphan*/ testMoveFile();
int /*<<< orphan*/ testPathParser();
int /*<<< orphan*/ test_init();
void runFileTests() {
  testFnode();
  test_init();
  testPathParser();
  testFTree();
  testFTreeWrite();
  testMoveFile();
  testGeneratedBitmap();
  testFileReadWrite();
}


x86 assembly (clang, -O0):
<runFileTests>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   10a0 <testFnode@plt>
mov    $0x0,%al
call   1030 <test_init@plt>
mov    $0x0,%al
call   1040 <testPathParser@plt>
mov    $0x0,%al
call   1070 <testFTree@plt>
mov    $0x0,%al
call   1050 <testFTreeWrite@plt>
mov    $0x0,%al
call   1080 <testMoveFile@plt>
mov    $0x0,%al
call   1090 <testGeneratedBitmap@plt>
mov    $0x0,%al
call   1060 <testFileReadWrite@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<runFileTests>:
push   %rax
xor    %eax,%eax
call   10a0 <testFnode@plt>
xor    %eax,%eax
call   1030 <test_init@plt>
xor    %eax,%eax
call   1040 <testPathParser@plt>
xor    %eax,%eax
call   1070 <testFTree@plt>
xor    %eax,%eax
call   1050 <testFTreeWrite@plt>
xor    %eax,%eax
call   1080 <testMoveFile@plt>
xor    %eax,%eax
call   1090 <testGeneratedBitmap@plt>
xor    %eax,%eax
pop    %rcx
jmp    1060 <testFileReadWrite@plt>

LLVM IR (-O0):
define void @runFileTests() {
%1 = call i32 (...) @testFnode()
%2 = call i32 (...) @test_init()
%3 = call i32 (...) @testPathParser()
%4 = call i32 (...) @testFTree()
%5 = call i32 (...) @testFTreeWrite()
%6 = call i32 (...) @testMoveFile()
%7 = call i32 (...) @testGeneratedBitmap()
%8 = call i32 (...) @testFileReadWrite()
ret void
}

LLVM IR (-O2):
define void @runFileTests() {
%1 = tail call i32 (...) @testFnode()
%2 = tail call i32 (...) @test_init()
%3 = tail call i32 (...) @testPathParser()
%4 = tail call i32 (...) @testFTree()
%5 = tail call i32 (...) @testFTreeWrite()
%6 = tail call i32 (...) @testMoveFile()
%7 = tail call i32 (...) @testGeneratedBitmap()
%8 = tail call i32 (...) @testFileReadWrite()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void ares_free_string(char *str) { free(str); }


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

x86 assembly (clang, -O2):
<ares_free_string>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ares_free_string(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int random();
void QCC_genIntAtR(int *i, int *from, int *to) {
  int n = *to - *from;
  *i = (int)(random() % n) + *from;
}


x86 assembly (clang, -O0):
<QCC_genIntAtR>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <random@plt>
cltd
idivl  -0x1c(%rbp)
mov    -0x10(%rbp),%rax
add    (%rax),%edx
mov    -0x8(%rbp),%rax
mov    %edx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<QCC_genIntAtR>:
push   %rbp
push   %r14
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%r14
mov    (%rdx),%ebp
sub    (%rsi),%ebp
xor    %eax,%eax
call   1030 <random@plt>
cltd
idiv   %ebp
add    (%rbx),%edx
mov    %edx,(%r14)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @QCC_genIntAtR(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
%8 = load i32*, i32** %6
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = sub nsw i32 %9, %11
store i32 %12, i32* %7
%13 = call i32 (...) @random()
%14 = load i32, i32* %7
%15 = srem i32 %13, %14
%16 = load i32*, i32** %5
%17 = load i32, i32* %16
%18 = add nsw i32 %15, %17
%19 = load i32*, i32** %4
store i32 %18, i32* %19
ret void
}

LLVM IR (-O2):
define void @QCC_genIntAtR(i32* nocapture writeonly %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %2
%5 = load i32, i32* %1
%6 = sub nsw i32 %4, %5
%7 = tail call i32 (...) @random()
%8 = srem i32 %7, %6
%9 = load i32, i32* %1
%10 = add nsw i32 %9, %8
store i32 %10, i32* %0
ret void
}
/* Type definitions */
struct parsed_config {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ *getSection(char const *, struct parsed_config const *);
int sectionExist(const char *name, const struct parsed_config *c) {
  return NULL != getSection(name, c);
}


x86 assembly (clang, -O0):
<sectionExist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <getSection@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sectionExist>:
push   %rax
call   1030 <getSection@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.parsed_config = type { i32 }
define i32 @sectionExist(i8* %0, %struct.parsed_config* %1) {
%3 = alloca i8*
%4 = alloca %struct.parsed_config*
store i8* %0, i8** %3
store %struct.parsed_config* %1, %struct.parsed_config** %4
%5 = load i8*, i8** %3
%6 = load %struct.parsed_config*, %struct.parsed_config** %4
%7 = call i32* @getSection(i8* %5, %struct.parsed_config* %6)
%8 = icmp ne i32* null, %7
%9 = zext i1 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
%struct.parsed_config = type { i32 }
define i32 @sectionExist(i8* %0, %struct.parsed_config* %1) {
%3 = tail call i32* @getSection(i8* %0, %struct.parsed_config* %1)
%4 = icmp ne i32* %3, null
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ CDROM_DRIVE_STATUS;
int O_NONBLOCK;
int O_RDONLY;
int /*<<< orphan*/ exit(int);
int ioctl(int, int /*<<< orphan*/);
int open(char *, int);
int main() {
  int fdcdrom = -1;
  if ((fdcdrom = open("/dev/cdrom", O_RDONLY | O_NONBLOCK)) == -1)
    exit(-2);
  exit(ioctl(fdcdrom, CDROM_DRIVE_STATUS));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xffffffff,-0x8(%rbp)
mov    0x2e93(%rip),%rax
mov    (%rax),%esi
mov    0x2e92(%rip),%rax
or     (%rax),%esi
lea    0xea1(%rip),%rdi
call   1040 <open@plt>
mov    %eax,-0x8(%rbp)
cmp    $0xffffffff,%eax
jne    117a <main+0x4a>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
mov    -0x8(%rbp),%edi
mov    0x2e4c(%rip),%rax
mov    (%rax),%esi
call   1030 <ioctl@plt>
mov    %eax,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ea8(%rip),%rax
mov    0x2ea9(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
lea    0xeb6(%rip),%rdi
call   1040 <open@plt>
cmp    $0xffffffff,%eax
jne    115e <main+0x2e>
mov    $0xfffffffe,%edi
call   1050 <exit@plt>
mov    0x2e6b(%rip),%rcx
mov    (%rcx),%esi
mov    %eax,%edi
call   1030 <ioctl@plt>
mov    %eax,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"/dev/cdrom\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@CDROM_DRIVE_STATUS = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -1, i32* %2
%3 = load i32, i32* @O_RDONLY
%4 = load i32, i32* @O_NONBLOCK
%5 = or i32 %3, %4
%6 = call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %5)
store i32 %6, i32* %2
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %10
8: ; preds = %0
%9 = call i32 @exit(i32 -2)
unreachable
10: ; preds = %0
%11 = load i32, i32* %2
%12 = load i32, i32* @CDROM_DRIVE_STATUS
%13 = call i32 @ioctl(i32 %11, i32 %12)
%14 = call i32 @exit(i32 %13)
unreachable
}

LLVM IR (-O2):
@.str = [11 x i8] c"/dev/cdrom\00"
@O_RDONLY = global i32 0
@O_NONBLOCK = global i32 0
@CDROM_DRIVE_STATUS = global i32 0
define i32 @main() {
%1 = load i32, i32* @O_RDONLY
%2 = load i32, i32* @O_NONBLOCK
%3 = or i32 %2, %1
%4 = tail call i32 @open(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = icmp eq i32 %4, -1
br i1 %5, label %6, label %8
6: ; preds = %0
%7 = tail call i32 @exit(i32 -2)
unreachable
8: ; preds = %0
%9 = load i32, i32* @CDROM_DRIVE_STATUS
%10 = tail call i32 @ioctl(i32 %4, i32 %9)
%11 = tail call i32 @exit(i32 %10)
unreachable
}
/* Variables and functions */
int sv_play(int);
int vox_play(int slot) { return sv_play(slot); }


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

x86 assembly (clang, -O2):
<vox_play>:
jmp    1030 <sv_play@plt>

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

LLVM IR (-O2):
define i32 @vox_play(i32 %0) {
%2 = tail call i32 @sv_play(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dailyWeather2Write(int, char **, char **, int);
void C_dailyWeather2Write_R(int *nSites, char *siteNames[], char *siteDirs[],
                            int *year) {
  dailyWeather2Write(*nSites, siteNames, siteDirs, *year);
}


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

x86 assembly (clang, -O2):
<C_dailyWeather2Write_R>:
mov    (%rdi),%edi
mov    (%rcx),%ecx
jmp    1030 <dailyWeather2Write@plt>

LLVM IR (-O0):
define void @C_dailyWeather2Write_R(i32* %0, i8** %1, i8** %2, i32* %3) {
%5 = alloca i32*
%6 = alloca i8**
%7 = alloca i8**
%8 = alloca i32*
store i32* %0, i32** %5
store i8** %1, i8*** %6
store i8** %2, i8*** %7
store i32* %3, i32** %8
%9 = load i32*, i32** %5
%10 = load i32, i32* %9
%11 = load i8**, i8*** %6
%12 = load i8**, i8*** %7
%13 = load i32*, i32** %8
%14 = load i32, i32* %13
%15 = call i32 @dailyWeather2Write(i32 %10, i8** %11, i8** %12, i32 %14)
ret void
}

LLVM IR (-O2):
define void @C_dailyWeather2Write_R(i32* nocapture %0, i8** %1, i8** %2, i32* nocapture %3) {
%5 = load i32, i32* %0
%6 = load i32, i32* %3
%7 = tail call i32 @dailyWeather2Write(i32 %5, i8** %1, i8** %2, i32 %6)
ret void
}