xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double, double, double);
double getPie(double insidecircle, double outsidecircle) {
  double ratio = insidecircle / outsidecircle;
  printf("insidecircle = %f, outsidecircle = %f, ratio = %f\n", insidecircle,
         outsidecircle, ratio);
  return (4 * ratio) / (1 + ratio);
}


x86 assembly (clang, -O0):
<getPie>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  -0x18(%rbp),%xmm2
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
movsd  0xeb4(%rip),%xmm0
mulsd  -0x18(%rbp),%xmm0
movsd  0xe9f(%rip),%xmm1
addsd  -0x18(%rbp),%xmm1
divsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPie>:
push   %rax
movapd %xmm0,%xmm2
divsd  %xmm1,%xmm2
movsd  %xmm2,(%rsp)
lea    0xeeb(%rip),%rdi
call   1030 <printf@plt>
movsd  0xece(%rip),%xmm0
movsd  (%rsp),%xmm1
mulsd  %xmm1,%xmm0
addsd  0xec5(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
@.str = [51 x i8] c"insidecircle = %f, outsidecircle = %f, ratio = %f\0A\00"
define double @getPie(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = load double, double* %4
%8 = fdiv double %6, %7
store double %8, double* %5
%9 = load double, double* %3
%10 = load double, double* %4
%11 = load double, double* %5
%12 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %9, double %10, double %11)
%13 = load double, double* %5
%14 = fmul double 4.000000e+00, %13
%15 = load double, double* %5
%16 = fadd double 1.000000e+00, %15
%17 = fdiv double %14, %16
ret double %17
}

LLVM IR (-O2):
@.str = [51 x i8] c"insidecircle = %f, outsidecircle = %f, ratio = %f\0A\00"
define double @getPie(double %0, double %1) {
%3 = fdiv double %0, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str, i64 0, i64 0), double %0, double %1, double %3)
%5 = fmul double %3, 4.000000e+00
%6 = fadd double %3, 1.000000e+00
%7 = fdiv double %5, %6
ret double %7
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int i;
  scanf("%i", &i);
  puts(i > 9 && i < 100 ? "1" : "0");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
xor    %eax,%eax
cmpl   $0x9,-0x8(%rbp)
mov    %al,-0x9(%rbp)
jle    1158 <main+0x38>
cmpl   $0x64,-0x8(%rbp)
setl   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%cl
lea    0xea3(%rip),%rdi
lea    0xe9a(%rip),%rax
test   $0x1,%cl
cmovne %rax,%rdi
call   1030 <puts@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%eax
add    $0xfffffff6,%eax
cmp    $0x5a,%eax
lea    0xec0(%rip),%rax
lea    0xebb(%rip),%rdi
cmovb  %rax,%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%i\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %2)
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 9
br i1 %5, label %6, label %9
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 100
br label %9
9: ; preds = %6, %0
%10 = phi i1 [ false, %0 ], [ %8, %6 ]
%11 = zext i1 %10 to i64
%12 = select i1 %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%13 = call i32 @puts(i8* %12)
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
@.str.1 = [2 x i8] c"1\00"
@.str.2 = [2 x i8] c"0\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = add i32 %4, -10
%6 = icmp ult i32 %5, 90
%7 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%8 = call i32 @puts(i8* dereferenceable(1) %7)
ret i32 0
}
void ilog(const char *msg __attribute__((unused))) {}


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

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

LLVM IR (-O0):
define void @ilog(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
ret void
}

LLVM IR (-O2):
define void @ilog(i8* nocapture %0) {
ret void
}
void goobie() {}


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

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

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

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

/* Variables and functions */
size_t dng_get_header_size(struct frame_headers *);
size_t dng_get_image_size(struct frame_headers *);
size_t dng_get_size(struct frame_headers *frame_headers) {
  return dng_get_header_size(frame_headers) + dng_get_image_size(frame_headers);
}


x86 assembly (clang, -O0):
<dng_get_size>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dng_get_header_size@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <dng_get_image_size@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
add    %rcx,%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dng_get_size>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <dng_get_header_size@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1040 <dng_get_image_size@plt>
add    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.frame_headers = type { i32 }
define i64 @dng_get_size(%struct.frame_headers* %0) {
%2 = alloca %struct.frame_headers*
store %struct.frame_headers* %0, %struct.frame_headers** %2
%3 = load %struct.frame_headers*, %struct.frame_headers** %2
%4 = call i64 @dng_get_header_size(%struct.frame_headers* %3)
%5 = load %struct.frame_headers*, %struct.frame_headers** %2
%6 = call i64 @dng_get_image_size(%struct.frame_headers* %5)
%7 = add i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
%struct.frame_headers = type { i32 }
define i64 @dng_get_size(%struct.frame_headers* %0) {
%2 = tail call i64 @dng_get_header_size(%struct.frame_headers* %0)
%3 = tail call i64 @dng_get_image_size(%struct.frame_headers* %0)
%4 = add i64 %3, %2
ret i64 %4
}
/* Variables and functions */
char **format_list();
char **xmp_get_format_list() { return format_list(); }


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

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

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

LLVM IR (-O2):
define i8** @xmp_get_format_list() {
%1 = tail call i8** (...) @format_list()
ret i8** %1
}
/* Variables and functions */
int f(int);
int honai(int in) {
  if (in == 1) {
    return 2 * f(in - 1) + 3;
  } else {
    return honai(in - 1) + 2 * f(in - 1) + 3;
  }
}


x86 assembly (clang, -O0):
<honai>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    114e <honai+0x2e>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
shl    $0x1,%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <honai+0x57>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1040 <honai@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
call   1030 <f@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
shl    $0x1,%ecx
add    %ecx,%eax
add    $0x3,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<honai>:
push   %r14
push   %rbx
push   %rax
cmp    $0x1,%edi
jne    1134 <honai+0x14>
xor    %edi,%edi
call   1030 <f@plt>
add    %eax,%eax
jmp    114e <honai+0x2e>
mov    %edi,%ebx
add    $0xffffffff,%ebx
mov    %ebx,%edi
call   1040 <honai@plt>
mov    %eax,%r14d
mov    %ebx,%edi
call   1030 <f@plt>
lea    (%r14,%rax,2),%eax
add    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @honai(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call i32 @f(i32 0)
%5 = shl nsw i32 %4, 1
br label %12
6: ; preds = %1
%7 = add nsw i32 %0, -1
%8 = tail call i32 @honai(i32 %7)
%9 = tail call i32 @f(i32 %7)
%10 = shl nsw i32 %9, 1
%11 = add nsw i32 %10, %8
br label %12
12: ; preds = %6, %3
%13 = phi i32 [ %5, %3 ], [ %11, %6 ]
%14 = add nsw i32 %13, 3
ret i32 %14
}
/* Variables and functions */
int mrand48();
void random_bytes(unsigned char *buf, int len) {
  int i;
  for (i = 0; i < len; ++i)
    buf[i] = mrand48() >> 24;
}


x86 assembly (clang, -O0):
<random_bytes>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1157 <random_bytes+0x47>
mov    $0x0,%al
call   1030 <mrand48@plt>
sar    $0x18,%eax
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <random_bytes+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_bytes>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1147 <random_bytes+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <mrand48@plt>
shr    $0x18,%eax
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <random_bytes+0x20>
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @random_bytes(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
br label %6
6: ; preds = %18, %2
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %21
10: ; preds = %6
%11 = call i32 (...) @mrand48()
%12 = ashr i32 %11, 24
%13 = trunc i32 %12 to i8
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
store i8 %13, i8* %17
br label %18
18: ; preds = %10
%19 = load i32, i32* %5
%20 = add nsw i32 %19, 1
store i32 %20, i32* %5
br label %6
21: ; preds = %6
ret void
}

LLVM IR (-O2):
define void @random_bytes(i8* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = tail call i32 (...) @mrand48()
%9 = lshr i32 %8, 24
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 %7
store i8 %10, i8* %11
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ INT_MAX;
int /*<<< orphan*/ UINT_MAX;
int /*<<< orphan*/ ceil(double);
double log2(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, double);
size_t get_bits_of_int_v4(void) {
  printf("%f\n", log2(INT_MAX));
  printf("%f\n", log2(UINT_MAX));
  return (size_t)ceil(log2(UINT_MAX));
  return (int)log2(INT_MAX) + 2;
  return (int)log2(UINT_MAX) + 1;
}


x86 assembly (clang, -O0):
<get_bits_of_int_v4>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <log2@plt>
lea    0xeb7(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e8b(%rip),%rax
mov    (%rax),%edi
call   1030 <log2@plt>
lea    0xe9d(%rip),%rdi
call   1050 <printf@plt>
mov    0x2e71(%rip),%rax
mov    (%rax),%edi
call   1030 <log2@plt>
call   1040 <ceil@plt>
cltq
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_bits_of_int_v4>:
push   %r14
push   %rbx
push   %rax
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
call   1030 <log2@plt>
lea    0xeb7(%rip),%r14
mov    %r14,%rdi
call   1050 <printf@plt>
mov    0x2e88(%rip),%rbx
mov    (%rbx),%edi
call   1030 <log2@plt>
mov    %r14,%rdi
call   1050 <printf@plt>
mov    (%rbx),%edi
call   1030 <log2@plt>
call   1040 <ceil@plt>
cltq
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
@INT_MAX = global i32 0
@UINT_MAX = global i32 0
define i64 @get_bits_of_int_v4() {
%1 = load i32, i32* @INT_MAX
%2 = call double @log2(i32 %1)
%3 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%4 = load i32, i32* @UINT_MAX
%5 = call double @log2(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load i32, i32* @UINT_MAX
%8 = call double @log2(i32 %7)
%9 = call i32 @ceil(double %8)
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
@INT_MAX = global i32 0
@UINT_MAX = global i32 0
define i64 @get_bits_of_int_v4() {
%1 = load i32, i32* @INT_MAX
%2 = tail call double @log2(i32 %1)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%4 = load i32, i32* @UINT_MAX
%5 = tail call double @log2(i32 %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
%7 = load i32, i32* @UINT_MAX
%8 = tail call double @log2(i32 %7)
%9 = tail call i32 @ceil(double %8)
%10 = sext i32 %9 to i64
ret i64 %10
}
int args0(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @args0() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ advance();
int /*<<< orphan*/ factor();
int /*<<< orphan*/ legal_lookahead(int, int, int /*<<< orphan*/);
scalar_t__ match(int);
void term() {
  if (!legal_lookahead(6, 4, 0))
    return;
  factor();
  while (match(3)) {
    advance();
    factor();
  }
}


x86 assembly (clang, -O0):
<term>:
push   %rbp
mov    %rsp,%rbp
mov    $0x6,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <legal_lookahead@plt>
cmp    $0x0,%eax
jne    1163 <term+0x23>
jmp    1191 <term+0x51>
mov    $0x0,%al
call   1060 <factor@plt>
mov    $0x3,%edi
call   1050 <match@plt>
cmp    $0x0,%rax
je     1191 <term+0x51>
mov    $0x0,%al
call   1040 <advance@plt>
mov    $0x0,%al
call   1060 <factor@plt>
jmp    116a <term+0x2a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<term>:
push   %rax
mov    $0x6,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1030 <legal_lookahead@plt>
test   %eax,%eax
je     117f <term+0x3f>
cs nopw 0x0(%rax,%rax,1)
xor    %eax,%eax
call   1060 <factor@plt>
mov    $0x3,%edi
call   1050 <match@plt>
test   %rax,%rax
je     117f <term+0x3f>
xor    %eax,%eax
call   1040 <advance@plt>
jmp    1160 <term+0x20>
pop    %rax
ret

LLVM IR (-O0):
define void @term() {
%1 = call i32 @legal_lookahead(i32 6, i32 4, i32 0)
%2 = icmp ne i32 %1, 0
br i1 %2, label %4, label %3
3: ; preds = %0
br label %12
4: ; preds = %0
%5 = call i32 (...) @factor()
br label %6
6: ; preds = %9, %4
%7 = call i64 @match(i32 3)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %6
%10 = call i32 (...) @advance()
%11 = call i32 (...) @factor()
br label %6
12: ; preds = %3, %6
ret void
}

LLVM IR (-O2):
define void @term() {
%1 = tail call i32 @legal_lookahead(i32 6, i32 4, i32 0)
%2 = icmp eq i32 %1, 0
br i1 %2, label %12, label %3
3: ; preds = %0
%4 = tail call i32 (...) @factor()
%5 = tail call i64 @match(i32 3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %12, label %7
7: ; preds = %3, %7
%8 = tail call i32 (...) @advance()
%9 = tail call i32 (...) @factor()
%10 = tail call i64 @match(i32 3)
%11 = icmp eq i64 %10, 0
br i1 %11, label %12, label %7
12: ; preds = %7, %3, %0
ret void
}
void foo_2_2_1_2_2_2_2_2_2() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_1_2_2_2_2_2_2() {
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t TimerPrescaleGet(uint32_t ui32Base, uint32_t ui32Timer) {
  ;

  ;
  return ((ui32Timer == 0x000000ff)
              ? (*((volatile uint32_t *)(ui32Base + 0x00000038)))
              : (*((volatile uint32_t *)(ui32Base + 0x0000003C))));
}


x86 assembly (clang, -O0):
<TimerPrescaleGet>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jne    1129 <TimerPrescaleGet+0x29>
mov    -0x4(%rbp),%eax
add    $0x38,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
jmp    1136 <TimerPrescaleGet+0x36>
mov    -0x4(%rbp),%eax
add    $0x3c,%eax
cltq
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TimerPrescaleGet>:
xor    %eax,%eax
cmp    $0xff,%esi
setne  %al
lea    0x38(,%rax,4),%eax
movslq %edi,%rcx
mov    (%rax,%rcx,1),%eax
ret

LLVM IR (-O0):
define i32 @TimerPrescaleGet(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 255
br i1 %6, label %7, label %13
7: ; preds = %2
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 56
%10 = sext i32 %9 to i64
%11 = inttoptr i64 %10 to i32*
%12 = load volatile i32, i32* %11
br label %19
13: ; preds = %2
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 60
%16 = sext i32 %15 to i64
%17 = inttoptr i64 %16 to i32*
%18 = load volatile i32, i32* %17
br label %19
19: ; preds = %13, %7
%20 = phi i32 [ %12, %7 ], [ %18, %13 ]
ret i32 %20
}

LLVM IR (-O2):
define i32 @TimerPrescaleGet(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 255
%4 = select i1 %3, i32 56, i32 60
%5 = add nsw i32 %4, %0
%6 = sext i32 %5 to i64
%7 = inttoptr i64 %6 to i32*
%8 = load volatile i32, i32* %7
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void edit_free(void *in_mem) { free(in_mem); }


x86 assembly (clang, -O0):
<edit_free>:
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):
<edit_free>:
jmp    1030 <free@plt>

LLVM IR (-O0):
define void @edit_free(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 @edit_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
typedef int uint16_t;

/* Variables and functions */
int /*<<< orphan*/ st7735_send_data(int);
void _st7735_pushColor(uint16_t color) {
  st7735_send_data(color >> 8);
  st7735_send_data(color & 0xff);
}


x86 assembly (clang, -O0):
<_st7735_pushColor>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
sar    $0x8,%edi
call   1030 <st7735_send_data@plt>
mov    -0x4(%rbp),%edi
and    $0xff,%edi
call   1030 <st7735_send_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_st7735_pushColor>:
push   %rbx
mov    %edi,%ebx
sar    $0x8,%edi
call   1030 <st7735_send_data@plt>
movzbl %bl,%edi
pop    %rbx
jmp    1030 <st7735_send_data@plt>

LLVM IR (-O0):
define void @_st7735_pushColor(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = call i32 @st7735_send_data(i32 %4)
%6 = load i32, i32* %2
%7 = and i32 %6, 255
%8 = call i32 @st7735_send_data(i32 %7)
ret void
}

LLVM IR (-O2):
define void @_st7735_pushColor(i32 %0) {
%2 = ashr i32 %0, 8
%3 = tail call i32 @st7735_send_data(i32 %2)
%4 = and i32 %0, 255
%5 = tail call i32 @st7735_send_data(i32 %4)
ret void
}
int escaped_strlen(const char *str) {
  int n = 0, i = 0;
  char c;
  while ((c = str[i++]) != 0) {
    if (c != '\\') {
      n++;
    }
  }
  return n;
}


x86 assembly (clang, -O0):
<escaped_strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
movsbl %al,%eax
cmp    $0x0,%eax
je     1155 <escaped_strlen+0x55>
movsbl -0x11(%rbp),%eax
cmp    $0x5c,%eax
je     1150 <escaped_strlen+0x50>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <escaped_strlen+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<escaped_strlen>:
xor    %ecx,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl (%rdi,%rcx,1),%edx
add    $0x1,%rcx
cmp    $0x5c,%dl
je     1110 <escaped_strlen+0x10>
test   %dl,%dl
je     1126 <escaped_strlen+0x26>
add    $0x1,%eax
jmp    1110 <escaped_strlen+0x10>
ret

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

LLVM IR (-O2):
define i32 @escaped_strlen(i8* nocapture %0) {
br label %2
2: ; preds = %10, %1
%3 = phi i64 [ %7, %10 ], [ 0, %1 ]
%4 = phi i32 [ %11, %10 ], [ 0, %1 ]
br label %5
5: ; preds = %2, %5
%6 = phi i64 [ %7, %5 ], [ %3, %2 ]
%7 = add nuw i64 %6, 1
%8 = getelementptr inbounds i8, i8* %0, i64 %6
%9 = load i8, i8* %8
switch i8 %9, label %10 [
i8 0, label %12
i8 92, label %5
]
10: ; preds = %5
%11 = add nuw nsw i32 %4, 1
br label %2
12: ; preds = %5
ret i32 %4
}
int movzbl_2(void) {
  int res;
  __asm__ __volatile__("movl $0x12345678, %%eax\n\t"
                       "movb $0x99, %%al\n\t"
                       "movzbl %%al,%%eax\n\t"
                       "mov %%eax, %0"
                       : "=r"(res)
                       :
                       : "eax");
  return res;
}


x86 assembly (clang, -O0):
<movzbl_2>:
push   %rbp
mov    %rsp,%rbp
mov    $0x12345678,%eax
mov    $0x99,%al
movzbl %al,%eax
mov    %eax,%ecx
mov    %ecx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<movzbl_2>:
mov    $0x12345678,%eax
mov    $0x99,%al
movzbl %al,%eax
mov    %eax,%ecx
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @movzbl_2() {
%1 = alloca i32
%2 = call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x99, %al\0A\09movzbl %al,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @movzbl_2() {
%1 = tail call i32 asm sideeffect "movl $$0x12345678, %eax\0A\09movb $$0x99, %al\0A\09movzbl %al,%eax\0A\09mov %eax, $0", "=r,~{eax},~{dirflag},~{fpsr},~{flags}"()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ xsi_register_didat(char *, char *);
extern void work_a_3290160192_1943982004_init() {
  xsi_register_didat(
      "work_a_3290160192_1943982004",
      "isim/Combined_tb_isim_beh.exe.sim/work/a_3290160192_1943982004.didat");
}


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

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

LLVM IR (-O0):
@.str = [29 x i8] c"work_a_3290160192_1943982004\00"
@.str.1 = [69 x i8] c"isim/Combined_tb_isim_beh.exe.sim/work/a_3290160192_1943982004.didat\00"
define void @work_a_3290160192_1943982004_init() {
%1 = call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"work_a_3290160192_1943982004\00"
@.str.1 = [69 x i8] c"isim/Combined_tb_isim_beh.exe.sim/work/a_3290160192_1943982004.didat\00"
define void @work_a_3290160192_1943982004_init() {
%1 = tail call i32 @xsi_register_didat(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
char *strrchr(register const char *s, int c) {
  const char *p;
  p = NULL;
  do {
    if (*s == (char)c) {
      p = s;
    }
  } while (*s++);
  return (char *)p;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0xc(%rbp),%ecx
movsbl %cl,%ecx
cmp    %ecx,%eax
jne    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1135 <strrchr+0x35>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
cmpb   $0x0,(%rax)
jne    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
movsbl %sil,%ecx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
movsbl (%rdi),%edx
cmp    %edx,%ecx
cmove  %rdi,%rax
add    $0x1,%rdi
test   %edx,%edx
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = shl i32 %1, 24
%4 = ashr exact i32 %3, 24
br label %5
5: ; preds = %5, %2
%6 = phi i8* [ %0, %2 ], [ %12, %5 ]
%7 = phi i8* [ null, %2 ], [ %11, %5 ]
%8 = load i8, i8* %6
%9 = sext i8 %8 to i32
%10 = icmp eq i32 %4, %9
%11 = select i1 %10, i8* %6, i8* %7
%12 = getelementptr inbounds i8, i8* %6, i64 1
%13 = icmp eq i8 %8, 0
br i1 %13, label %14, label %5
14: ; preds = %5
ret i8* %11
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, int /*<<< orphan*/ const *,
                          int);
void ethernet_get_dstaddr(const uint8_t *p_ethernet, uint8_t *p_addr) {
  memcpy(p_addr, p_ethernet, 6);
}


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

x86 assembly (clang, -O2):
<ethernet_get_dstaddr>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x6,%edx
jmp    1030 <memcpy@plt>

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

LLVM IR (-O2):
define void @ethernet_get_dstaddr(i32* %0, i32* %1) {
%3 = tail call i32 @memcpy(i32* %1, i32* %0, i32 6)
ret void
}
/* Variables and functions */
int LOG_NOWAIT;
int LOG_PID;
int /*<<< orphan*/ LOG_SYSLOG;
int /*<<< orphan*/ openlog(char *, int, int /*<<< orphan*/);
int snake_log_init(void) {
  openlog("snake", (LOG_NOWAIT | LOG_PID), LOG_SYSLOG);
  return 0;
}


x86 assembly (clang, -O0):
<snake_log_init>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%esi
mov    0x2ebc(%rip),%rax
or     (%rax),%esi
mov    0x2eab(%rip),%rax
mov    (%rax),%edx
lea    0xeca(%rip),%rdi
call   1030 <openlog@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<snake_log_init>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    0x2ec1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    0x2eae(%rip),%rax
mov    (%rax),%edx
lea    0xecd(%rip),%rdi
call   1030 <openlog@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"snake\00"
@LOG_NOWAIT = global i32 0
@LOG_PID = global i32 0
@LOG_SYSLOG = global i32 0
define i32 @snake_log_init() {
%1 = load i32, i32* @LOG_NOWAIT
%2 = load i32, i32* @LOG_PID
%3 = or i32 %1, %2
%4 = load i32, i32* @LOG_SYSLOG
%5 = call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"snake\00"
@LOG_NOWAIT = global i32 0
@LOG_PID = global i32 0
@LOG_SYSLOG = global i32 0
define i32 @snake_log_init() {
%1 = load i32, i32* @LOG_NOWAIT
%2 = load i32, i32* @LOG_PID
%3 = or i32 %2, %1
%4 = load i32, i32* @LOG_SYSLOG
%5 = tail call i32 @openlog(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %4)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_header(void) {
  printf("#name\tchrom\tpos\tstrand\tsize\tlabels\t"
         "qsize\tqlabels\trstart\trend\tqstart\tqend\tmissing\textra\talignment"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [98 x i8] c"#name\09chrom\09pos\09strand\09size\09labels\09qsize\09qlabels\09rstart\09rend\09qstart\09qend\09missing\09extra\09alignment\0A\00"
define void @print_header() {
%1 = call i32 @printf(i8* getelementptr inbounds ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [97 x i8] c"#name\09chrom\09pos\09strand\09size\09labels\09qsize\09qlabels\09rstart\09rend\09qstart\09qend\09missing\09extra\09alignment\00"
define void @print_header() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
ret void
}
int _link(const char *oldpath, const char *newpath) { return -1; }


x86 assembly (clang, -O0):
<_link>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @_link(i8* nocapture readnone %0, i8* nocapture readnone %1) {
ret i32 -1
}
void ff_hevc_put_hevc_uni_qpel_h16_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h16_12_sse4() {
ret void
}
int hash(char v[]) {
  int i;
  unsigned int h = 5381;
  for (i = 0; v[i] != '\0'; i++)
    h = ((h << 5) + h) + v[i];
  return h;
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1505,-0x10(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1153 <hash+0x53>
mov    -0x10(%rbp),%eax
shl    $0x5,%eax
add    -0x10(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <hash+0x16>
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1138 <hash+0x38>
add    $0x1,%rdi
mov    $0x1505,%edx
mov    %edx,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl %cl,%ecx
shl    $0x5,%eax
add    %edx,%eax
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
mov    %eax,%edx
test   %cl,%cl
jne    1120 <hash+0x20>
ret
mov    $0x1505,%eax
ret

LLVM IR (-O0):
define i32 @hash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i32
store i8* %0, i8** %2
store i32 5381, i32* %4
store i32 0, i32* %3
br label %5
5: ; preds = %25, %1
%6 = load i8*, i8** %2
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %28
13: ; preds = %5
%14 = load i32, i32* %4
%15 = shl i32 %14, 5
%16 = load i32, i32* %4
%17 = add i32 %15, %16
%18 = load i8*, i8** %2
%19 = load i32, i32* %3
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i8, i8* %18, i64 %20
%22 = load i8, i8* %21
%23 = sext i8 %22 to i32
%24 = add i32 %17, %23
store i32 %24, i32* %4
br label %25
25: ; preds = %13
%26 = load i32, i32* %3
%27 = add nsw i32 %26, 1
store i32 %27, i32* %3
br label %5
28: ; preds = %5
%29 = load i32, i32* %4
ret i32 %29
}

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %10, %4 ], [ 5381, %1 ]
%8 = sext i8 %6 to i32
%9 = mul i32 %7, 33
%10 = add i32 %9, %8
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 5381, %1 ], [ %10, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
void memswap(void *__restrict dst, void *__restrict src, void *__restrict tmp,
             size_t n) {
  memcpy(tmp, dst, n);
  memcpy(dst, src, n);
  memcpy(src, tmp, n);
}


x86 assembly (clang, -O0):
<memswap>:
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    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @memswap(i8* noalias %0, i8* noalias %1, i8* noalias %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %7
%10 = load i8*, i8** %5
%11 = load i64, i64* %8
%12 = call i32 @memcpy(i8* %9, i8* %10, i64 %11)
%13 = load i8*, i8** %5
%14 = load i8*, i8** %6
%15 = load i64, i64* %8
%16 = call i32 @memcpy(i8* %13, i8* %14, i64 %15)
%17 = load i8*, i8** %6
%18 = load i8*, i8** %7
%19 = load i64, i64* %8
%20 = call i32 @memcpy(i8* %17, i8* %18, i64 %19)
ret void
}

LLVM IR (-O2):
define void @memswap(i8* noalias %0, i8* noalias %1, i8* noalias %2, i64 %3) {
%5 = tail call i32 @memcpy(i8* %2, i8* %0, i64 %3)
%6 = tail call i32 @memcpy(i8* %0, i8* %1, i64 %3)
%7 = tail call i32 @memcpy(i8* %1, i8* %2, i64 %3)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ random_float_range(double, double);
scalar_t__ tan(int /*<<< orphan*/);
float random_float_cauchy(void) {
  return (float)tan(
      random_float_range(-(3.1415926536 / 2.0), (3.1415926536 / 2.0)));
}


x86 assembly (clang, -O0):
<random_float_cauchy>:
push   %rbp
mov    %rsp,%rbp
movsd  0xed4(%rip),%xmm0
movsd  0xed4(%rip),%xmm1
call   1030 <random_float_range@plt>
mov    %eax,%edi
call   1040 <tan@plt>
cvtsi2ss %rax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_float_cauchy>:
push   %rax
movsd  0xed7(%rip),%xmm0
movsd  0xed7(%rip),%xmm1
call   1030 <random_float_range@plt>
mov    %eax,%edi
call   1040 <tan@plt>
xorps  %xmm0,%xmm0
cvtsi2ss %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @random_float_cauchy() {
%1 = call i32 @random_float_range(double 0xBFF921FB544486E0, double 0x3FF921FB544486E0)
%2 = call i64 @tan(i32 %1)
%3 = sitofp i64 %2 to float
ret float %3
}

LLVM IR (-O2):
define float @random_float_cauchy() {
%1 = tail call i32 @random_float_range(double 0xBFF921FB544486E0, double 0x3FF921FB544486E0)
%2 = tail call i64 @tan(i32 %1)
%3 = sitofp i64 %2 to float
ret float %3
}
int config_csr_data_width_read(void) { return 8; }


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

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

LLVM IR (-O0):
define i32 @config_csr_data_width_read() {
ret i32 8
}

LLVM IR (-O2):
define i32 @config_csr_data_width_read() {
ret i32 8
}
/* Variables and functions */
int LZ4_compressHC2_limitedOutput(char const *, char *, int, int,
                                  int /*<<< orphan*/);
int LZ4_compressHC_limitedOutput(const char *source, char *dest, int inputSize,
                                 int maxOutputSize) {
  return LZ4_compressHC2_limitedOutput(source, dest, inputSize, maxOutputSize,
                                       0);
}


x86 assembly (clang, -O0):
<LZ4_compressHC_limitedOutput>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %r8d,%r8d
call   1030 <LZ4_compressHC2_limitedOutput@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<LZ4_compressHC_limitedOutput>:
xor    %r8d,%r8d
jmp    1030 <LZ4_compressHC2_limitedOutput@plt>

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

LLVM IR (-O2):
define i32 @LZ4_compressHC_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @LZ4_compressHC2_limitedOutput(i8* %0, i8* %1, i32 %2, i32 %3, i32 0)
ret i32 %5
}
int euclidean(int a, int b) {
  int r = a % b;
  while (r != 0) {
    a = b;
    b = r;
    r = a % b;
  }
  return b;
}


x86 assembly (clang, -O0):
<euclidean>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     1139 <euclidean+0x39>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %edx,-0xc(%rbp)
jmp    1114 <euclidean+0x14>
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<euclidean>:
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1120 <euclidean+0x20>
nopl   0x0(%rax)
mov    %edx,%ecx
mov    %esi,%eax
cltd
idiv   %ecx
mov    %ecx,%esi
test   %edx,%edx
jne    1110 <euclidean+0x10>
mov    %ecx,%eax
ret
mov    %esi,%eax
ret

LLVM IR (-O0):
define i32 @euclidean(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* %4
%8 = srem i32 %6, %7
store i32 %8, i32* %5
br label %9
9: ; preds = %12, %2
%10 = load i32, i32* %5
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %9
%13 = load i32, i32* %4
store i32 %13, i32* %3
%14 = load i32, i32* %5
store i32 %14, i32* %4
%15 = load i32, i32* %3
%16 = load i32, i32* %4
%17 = srem i32 %15, %16
store i32 %17, i32* %5
br label %9
18: ; preds = %9
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
define i32 @euclidean(i32 %0, i32 %1) {
%3 = srem i32 %0, %1
%4 = icmp eq i32 %3, 0
br i1 %4, label %10, label %5
5: ; preds = %2, %5
%6 = phi i32 [ %8, %5 ], [ %3, %2 ]
%7 = phi i32 [ %6, %5 ], [ %1, %2 ]
%8 = srem i32 %7, %6
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %5
10: ; preds = %5, %2
%11 = phi i32 [ %1, %2 ], [ %6, %5 ]
ret i32 %11
}
int main() {
  if ('a' != 97)
    return 1;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
uint32_t Endian_byteSwap32_manual(uint32_t input) {
  input = ((input >> 8) & 0x00FF00FF) | ((input & 0x00FF00FF) << 8);
  return ((input >> 16) & 0x0000FFFF) | ((input & 0x0000FFFF) << 16);
}


x86 assembly (clang, -O0):
<Endian_byteSwap32_manual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x8,%eax
and    $0xff00ff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00ff,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sar    $0x10,%eax
and    $0xffff,%eax
mov    -0x4(%rbp),%ecx
and    $0xffff,%ecx
shl    $0x10,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Endian_byteSwap32_manual(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = ashr i32 %3, 8
%5 = and i32 %4, 16711935
%6 = load i32, i32* %2
%7 = and i32 %6, 16711935
%8 = shl i32 %7, 8
%9 = or i32 %5, %8
store i32 %9, i32* %2
%10 = load i32, i32* %2
%11 = ashr i32 %10, 16
%12 = and i32 %11, 65535
%13 = load i32, i32* %2
%14 = and i32 %13, 65535
%15 = shl i32 %14, 16
%16 = or i32 %12, %15
ret i32 %16
}

LLVM IR (-O2):
define i32 @Endian_byteSwap32_manual(i32 %0) {
%2 = tail call i32 @llvm.bswap.i32(i32 %0)
ret i32 %2
}
do_standardize_table(argc, argv) int argc;
char **argv;
{}


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

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

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

LLVM IR (-O2):
define i32 @do_standardize_table(i32 %0, i8** nocapture readnone %1) {
ret i32 undef
}
/* Variables and functions */
int get_status();
int /*<<< orphan*/ set_status(int);
void turn_on_clock_interrupts(void) {
  int t = get_status();
  t |= (0x00000001 | 0x08000);
  set_status(t);
}


x86 assembly (clang, -O0):
<turn_on_clock_interrupts>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <get_status@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0x8001,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <set_status@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<turn_on_clock_interrupts>:
push   %rax
xor    %eax,%eax
call   1040 <get_status@plt>
or     $0x8001,%eax
mov    %eax,%edi
pop    %rax
jmp    1030 <set_status@plt>

LLVM IR (-O0):
define void @turn_on_clock_interrupts() {
%1 = alloca i32
%2 = call i32 (...) @get_status()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = or i32 %3, 32769
store i32 %4, i32* %1
%5 = load i32, i32* %1
%6 = call i32 @set_status(i32 %5)
ret void
}

LLVM IR (-O2):
define void @turn_on_clock_interrupts() {
%1 = tail call i32 (...) @get_status()
%2 = or i32 %1, 32769
%3 = tail call i32 @set_status(i32 %2)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ doReset();
void vfdcReset() { doReset(); }


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

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

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

LLVM IR (-O2):
define void @vfdcReset() {
%1 = tail call i32 (...) @doReset()
ret void
}
unsigned __attribute__((visibility("default")))
obstcp_client_frame_payload_sz(const struct obstcp_client_ctx *ctx) {
  return 65535;
}


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

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

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

LLVM IR (-O2):
%struct.obstcp_client_ctx = type opaque
define i32 @obstcp_client_frame_payload_sz(%struct.obstcp_client_ctx* nocapture readnone %0) {
ret i32 65535
}
void _falwcDefaultDrawImageString() { return; }


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

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

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

LLVM IR (-O2):
define void @_falwcDefaultDrawImageString() {
ret void
}