xunge/DecIR huggingface dataset:
int do_975() { return 975; }


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

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

LLVM IR (-O0):
define i32 @do_975() {
ret i32 975
}

LLVM IR (-O2):
define i32 @do_975() {
ret i32 975
}
/* Variables and functions */
int rand();
unsigned char random_char() {
  unsigned int i = 0;
  unsigned char v = 0;
  unsigned char buffer[1];
  for (i = 0; i < 1; i++) {
    buffer[i] = rand() & 0xFF;
  }
  v = *(unsigned char *)buffer;
  return v;
}


x86 assembly (clang, -O0):
<random_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x5(%rbp)
movl   $0x0,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
jae    1157 <random_char+0x47>
mov    $0x0,%al
call   1030 <rand@plt>
and    $0xff,%eax
mov    %al,%cl
mov    -0x4(%rbp),%eax
mov    %cl,-0x6(%rbp,%rax,1)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    112a <random_char+0x1a>
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i8 @random_char() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca [1 x i8]
store i32 0, i32* %1
store i8 0, i8* %2
store i32 0, i32* %1
br label %4
4: ; preds = %14, %0
%5 = load i32, i32* %1
%6 = icmp ult i32 %5, 1
br i1 %6, label %7, label %17
7: ; preds = %4
%8 = call i32 (...) @rand()
%9 = and i32 %8, 255
%10 = trunc i32 %9 to i8
%11 = load i32, i32* %1
%12 = zext i32 %11 to i64
%13 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 %12
store i8 %10, i8* %13
br label %14
14: ; preds = %7
%15 = load i32, i32* %1
%16 = add i32 %15, 1
store i32 %16, i32* %1
br label %4
17: ; preds = %4
%18 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
%19 = load i8, i8* %18
store i8 %19, i8* %2
%20 = load i8, i8* %2
ret i8 %20
}

LLVM IR (-O2):
define zeroext i8 @random_char() {
%1 = tail call i32 (...) @rand()
%2 = trunc i32 %1 to i8
ret i8 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;
typedef scalar_t__ mqd_t;

/* Variables and functions */
int /*<<< orphan*/ mq_receive(scalar_t__, char *, size_t, unsigned int *);
void test_mq_receive_prototype(void) {
  mqd_t mqdes;
  ssize_t msg_size;
  size_t msg_len;
  char *msgp;
  unsigned msg_prio;
  mqdes = 0;
  msg_len = 0;
  msgp = NULL;
  msg_size = mq_receive(mqdes, msgp, msg_len, &msg_prio);
  (void)msg_size;
}


x86 assembly (clang, -O0):
<test_mq_receive_prototype>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movq   $0x0,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    -0x24(%rbp),%rcx
call   1030 <mq_receive@plt>
mov    %eax,-0xc(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mq_receive_prototype>:
push   %rax
lea    0x4(%rsp),%rcx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1030 <mq_receive@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @test_mq_receive_prototype() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @mq_receive(i64 0, i8* null, i64 0, i32* %1)
ret void
}
void dpm_sysfs_remove(struct device *dev) {}


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

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

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

LLVM IR (-O2):
%struct.device = type opaque
define void @dpm_sysfs_remove(%struct.device* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ emit_andimm(int, int, int);
int /*<<< orphan*/ emit_orreq_imm(int, int, int);
int /*<<< orphan*/ emit_test(int, int);
void emit_sh2tst(int s1, int s2, int sr, int temp) {
  emit_andimm(sr, ~1, sr);
  emit_test(s1, s2);
  emit_orreq_imm(sr, 1, sr);
}


x86 assembly (clang, -O0):
<emit_sh2tst>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0xfffffffe,%esi
call   1040 <emit_andimm@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1050 <emit_test@plt>
mov    -0xc(%rbp),%edi
mov    -0xc(%rbp),%edx
mov    $0x1,%esi
call   1030 <emit_orreq_imm@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<emit_sh2tst>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%ebx
mov    %esi,%r14d
mov    %edi,%ebp
mov    %edx,%edi
mov    $0xfffffffe,%esi
call   1040 <emit_andimm@plt>
mov    %ebp,%edi
mov    %r14d,%esi
call   1050 <emit_test@plt>
mov    %ebx,%edi
mov    $0x1,%esi
mov    %ebx,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <emit_orreq_imm@plt>

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

LLVM IR (-O2):
define void @emit_sh2tst(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = tail call i32 @emit_andimm(i32 %2, i32 -2, i32 %2)
%6 = tail call i32 @emit_test(i32 %0, i32 %1)
%7 = tail call i32 @emit_orreq_imm(i32 %2, i32 1, i32 %2)
ret void
}
/* Variables and functions */
double remainder(double, int);
double normalize_lng(double lng) { return remainder(lng, 360.); }


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

x86 assembly (clang, -O2):
<normalize_lng>:
mov    $0x168,%edi
jmp    1030 <remainder@plt>

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

LLVM IR (-O2):
define double @normalize_lng(double %0) {
%2 = tail call double @remainder(double %0, i32 360)
ret double %2
}
/* Variables and functions */
int intcmp(int const, int const);
int heap_qsort_cmp_(const void *a, const void *b) {
  return intcmp(*(const int *)a, *(const int *)b);
}


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

x86 assembly (clang, -O2):
<heap_qsort_cmp_>:
mov    (%rdi),%edi
mov    (%rsi),%esi
jmp    1030 <intcmp@plt>

LLVM IR (-O0):
define i32 @heap_qsort_cmp_(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 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = call i32 @intcmp(i32 %7, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @heap_qsort_cmp_(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = tail call i32 @intcmp(i32 %4, i32 %6)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int);
void debug_int(unsigned int wert) { printf("%i", wert); }


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

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

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

LLVM IR (-O2):
@.str = [3 x i8] c"%i\00"
define void @debug_int(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ crremove(char const *);
int /*<<< orphan*/ pdperror(char const *);
int doremove(const char *name) {
  if (!crremove(name)) {
    pdperror(name);
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<doremove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <crremove@plt>
cmp    $0x0,%eax
jne    1153 <doremove+0x33>
mov    -0x10(%rbp),%rdi
call   1040 <pdperror@plt>
movl   $0x1,-0x4(%rbp)
jmp    115a <doremove+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<doremove>:
push   %rbx
mov    %rdi,%rbx
call   1030 <crremove@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1133 <doremove+0x13>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <pdperror@plt>
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @doremove(i8* %0) {
%2 = tail call i32 @crremove(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @pdperror(i8* %0)
br label %6
6: ; preds = %1, %4
%7 = phi i32 [ 1, %4 ], [ 0, %1 ]
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, float, int);
int /*<<< orphan*/ scanf(char *, int *, float *);
int main() {
  int a;
  float b;
  scanf("%d %f", &a, &b);
  printf("%d + %.2f = %.2f\n", a, b, a + b);
  return 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
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
cvttss2si %xmm1,%edx
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
cvtsi2ss %esi,%xmm1
movss  (%rsp),%xmm0
addss  %xmm0,%xmm1
cvttss2si %xmm1,%edx
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%d %f\00"
@.str.1 = [18 x i8] c"%d + %.2f = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
store i32 0, i32* %1
%4 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %2, float* %3)
%5 = load i32, i32* %2
%6 = load float, float* %3
%7 = load i32, i32* %2
%8 = sitofp i32 %7 to float
%9 = load float, float* %3
%10 = fadd float %8, %9
%11 = fptosi float %10 to i32
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %5, float %6, i32 %11)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %f\00"
@.str.1 = [18 x i8] c"%d + %.2f = %.2f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = bitcast i32* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %1, float* %2)
%6 = load i32, i32* %1
%7 = load float, float* %2
%8 = sitofp i32 %6 to float
%9 = fadd float %7, %8
%10 = fptosi float %9 to i32
%11 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %6, float %7, i32 %10)
ret i32 0
}
int plus2(int *a, int *b) {
  int c = (*a + *b);
  return c;
}


x86 assembly (clang, -O0):
<plus2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
add    (%rcx),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<plus2>:
mov    (%rsi),%eax
add    (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @plus2(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* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = add nsw i32 %7, %9
store i32 %10, i32* %5
%11 = load i32, i32* %5
ret i32 %11
}

LLVM IR (-O2):
define i32 @plus2(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ x;

/* Variables and functions */
unsigned int foo();
int entrypoint() {
  char x[2] = {6, 7};
  unsigned idx = foo();
  if (idx < sizeof(x))
    x[idx] = 5;
  return x[1];
}


x86 assembly (clang, -O0):
<entrypoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0xee1(%rip),%ax
mov    %ax,-0x2(%rbp)
mov    $0x0,%al
call   1030 <foo@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    $0x2,%rax
jae    1142 <entrypoint+0x32>
mov    -0x8(%rbp),%eax
movb   $0x5,-0x2(%rbp,%rax,1)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<entrypoint>:
push   %rax
movw   $0x706,0x6(%rsp)
xor    %eax,%eax
call   1030 <foo@plt>
mov    %eax,%ecx
mov    $0x7,%eax
cmp    $0x1,%ecx
ja     1137 <entrypoint+0x27>
mov    %ecx,%eax
movb   $0x5,0x6(%rsp,%rax,1)
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@__const.entrypoint.x = [2 x i8] c"\06\07"
define i32 @entrypoint() {
%1 = alloca [2 x i8]
%2 = alloca i32
%3 = bitcast [2 x i8]* %1 to i8*
%4 = call i32 (...) @foo()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = zext i32 %5 to i64
%7 = icmp ult i64 %6, 2
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = zext i32 %9 to i64
%11 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 %10
store i8 5, i8* %11
br label %12
12: ; preds = %8, %0
%13 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 1
%14 = load i8, i8* %13
%15 = sext i8 %14 to i32
ret i32 %15
}

LLVM IR (-O2):
define i32 @entrypoint() {
%1 = alloca i16
%2 = bitcast i16* %1 to [2 x i8]*
%3 = bitcast i16* %1 to i8*
store i16 1798, i16* %1
%4 = tail call i32 (...) @foo()
%5 = icmp ult i32 %4, 2
br i1 %5, label %6, label %12
6: ; preds = %0
%7 = zext i32 %4 to i64
%8 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 %7
store i8 5, i8* %8
%9 = getelementptr inbounds [2 x i8], [2 x i8]* %2, i64 0, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
br label %12
12: ; preds = %6, %0
%13 = phi i32 [ %11, %6 ], [ 7, %0 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ print1(int *, int);
int main() {
  int one[] = {0, 1, 2, 3, 4};
  print1(one, 5);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xed5(%rip),%eax
mov    %eax,-0x10(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x5,%esi
call   1030 <print1@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
mov    0xef6(%rip),%eax
mov    %eax,0x10(%rsp)
movaps 0xedb(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
mov    $0x5,%esi
call   1030 <print1@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.one = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
store i32 0, i32* %1
%3 = bitcast [5 x i32]* %2 to i8*
%4 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 0
%5 = call i32 @print1(i32* %4, i32 5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.one = [5 x i32] [i32 0, i32 1, i32 2, i32 3, i32 4]
define i32 @main() {
%1 = alloca [5 x i32]
%2 = bitcast [5 x i32]* %1 to i8*
%3 = getelementptr inbounds [5 x i32], [5 x i32]* %1, i64 0, i64 0
%4 = call i32 @print1(i32* %3, i32 5)
ret i32 0
}
/* Variables and functions */
char *getenv(char const *);
void env(char **p, const char *name, char *fallback) {
  char *ev = getenv(name);
  if (ev) {
    *p = ev;
    return;
  }
  *p = fallback;
}


x86 assembly (clang, -O0):
<env>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <getenv@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     114c <env+0x3c>
mov    -0x20(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
jmp    1157 <env+0x47>
mov    -0x18(%rbp),%rcx
mov    -0x8(%rbp),%rax
mov    %rcx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<env>:
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    %rsi,%rdi
call   1030 <getenv@plt>
test   %rax,%rax
cmovne %rax,%rbx
mov    %rbx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @env(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%8 = load i8*, i8** %5
%9 = call i8* @getenv(i8* %8)
store i8* %9, i8** %7
%10 = load i8*, i8** %7
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %15
12: ; preds = %3
%13 = load i8*, i8** %7
%14 = load i8**, i8*** %4
store i8* %13, i8** %14
br label %18
15: ; preds = %3
%16 = load i8*, i8** %6
%17 = load i8**, i8*** %4
store i8* %16, i8** %17
br label %18
18: ; preds = %15, %12
ret void
}

LLVM IR (-O2):
define void @env(i8** nocapture writeonly %0, i8* nocapture %1, i8* %2) {
%4 = tail call i8* @getenv(i8* %1)
%5 = icmp eq i8* %4, null
%6 = select i1 %5, i8* %2, i8* %4
store i8* %6, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *, char *);
int /*<<< orphan*/ stderr;
void version() {
  fprintf(stderr, "%s, version %s\n", "stm32w-wireshark", "0.1, 11 April 2012");
}


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
lea    0xee5(%rip),%rdx
lea    0xeef(%rip),%rcx
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
lea    0xee9(%rip),%rdx
lea    0xef3(%rip),%rcx
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [16 x i8] c"%s, version %s\0A\00"
@.str.1 = [17 x i8] c"stm32w-wireshark\00"
@.str.2 = [19 x i8] c"0.1, 11 April 2012\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [16 x i8] c"%s, version %s\0A\00"
@.str.1 = [17 x i8] c"stm32w-wireshark\00"
@.str.2 = [19 x i8] c"0.1, 11 April 2012\00"
define void @version() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
ret void
}
/* Variables and functions */
double SIN(double);
int /*<<< orphan*/ __VERIFIER_assume(int);
double __VERIFIER_nondet_double();
int main() {
  double a, r;
  a = __VERIFIER_nondet_double();
  __VERIFIER_assume(a >= -1e10 && a <= 1e10);
  r = SIN(a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_double@plt>
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xor    %eax,%eax
movsd  0xea6(%rip),%xmm1
ucomisd %xmm1,%xmm0
mov    %al,-0x19(%rbp)
jb     117a <main+0x4a>
movsd  0xe99(%rip),%xmm0
ucomisd -0x10(%rbp),%xmm0
setae  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1050 <__VERIFIER_assume@plt>
movsd  -0x10(%rbp),%xmm0
call   1030 <SIN@plt>
movsd  %xmm0,-0x18(%rbp)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_double@plt>
movsd  %xmm0,(%rsp)
ucomisd 0xebb(%rip),%xmm0
setae  %al
movsd  0xeb8(%rip),%xmm1
ucomisd %xmm0,%xmm1
setae  %cl
and    %al,%cl
movzbl %cl,%edi
call   1050 <__VERIFIER_assume@plt>
movsd  (%rsp),%xmm0
call   1030 <SIN@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
store i32 0, i32* %1
%4 = call double (...) @__VERIFIER_nondet_double()
store double %4, double* %2
%5 = load double, double* %2
%6 = fcmp oge double %5, -1.000000e+10
br i1 %6, label %7, label %10
7: ; preds = %0
%8 = load double, double* %2
%9 = fcmp ole double %8, 1.000000e+10
br label %10
10: ; preds = %7, %0
%11 = phi i1 [ false, %0 ], [ %9, %7 ]
%12 = zext i1 %11 to i32
%13 = call i32 @__VERIFIER_assume(i32 %12)
%14 = load double, double* %2
%15 = call double @SIN(double %14)
store double %15, double* %3
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call double (...) @__VERIFIER_nondet_double()
%2 = fcmp oge double %1, -1.000000e+10
%3 = fcmp ole double %1, 1.000000e+10
%4 = and i1 %2, %3
%5 = zext i1 %4 to i32
%6 = tail call i32 @__VERIFIER_assume(i32 %5)
%7 = tail call double @SIN(double %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ divtest();
int /*<<< orphan*/ fail(int);
int /*<<< orphan*/ fputest();
int /*<<< orphan*/ mmu_test();
int /*<<< orphan*/ multest();
scalar_t__ regtest();
int /*<<< orphan*/ report_device(int);
int /*<<< orphan*/ report_subtest(int);
leon2_test(volatile int *irqmp, int mtest) {
  int tmp, i;
  report_device(0x04002000);
  report_subtest(3);
  if (regtest())
    fail(1);
  multest();
  divtest();
  fputest();
  mmu_test();
}


x86 assembly (clang, -O0):
<leon2_test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    $0x4002000,%edi
call   1030 <report_device@plt>
mov    $0x3,%edi
call   1040 <report_subtest@plt>
mov    $0x0,%al
call   10a0 <regtest@plt>
cmp    $0x0,%rax
je     11be <leon2_test+0x3e>
mov    $0x1,%edi
call   1050 <fail@plt>
mov    $0x0,%al
call   1060 <multest@plt>
mov    $0x0,%al
call   1090 <divtest@plt>
mov    $0x0,%al
call   1070 <fputest@plt>
mov    $0x0,%al
call   1080 <mmu_test@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<leon2_test>:
push   %rax
mov    $0x4002000,%edi
call   1030 <report_device@plt>
mov    $0x3,%edi
call   1040 <report_subtest@plt>
xor    %eax,%eax
call   10a0 <regtest@plt>
test   %rax,%rax
je     11ab <leon2_test+0x2b>
mov    $0x1,%edi
call   1050 <fail@plt>
xor    %eax,%eax
call   1060 <multest@plt>
xor    %eax,%eax
call   1090 <divtest@plt>
xor    %eax,%eax
call   1070 <fputest@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <mmu_test@plt>

LLVM IR (-O0):
define i32 @leon2_test(i32* %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
%8 = call i32 @report_device(i32 67117056)
%9 = call i32 @report_subtest(i32 3)
%10 = call i64 (...) @regtest()
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = call i32 @fail(i32 1)
br label %14
14: ; preds = %12, %2
%15 = call i32 (...) @multest()
%16 = call i32 (...) @divtest()
%17 = call i32 (...) @fputest()
%18 = call i32 (...) @mmu_test()
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @leon2_test(i32* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @report_device(i32 67117056)
%4 = tail call i32 @report_subtest(i32 3)
%5 = tail call i64 (...) @regtest()
%6 = icmp eq i64 %5, 0
br i1 %6, label %9, label %7
7: ; preds = %2
%8 = tail call i32 @fail(i32 1)
br label %9
9: ; preds = %7, %2
%10 = tail call i32 (...) @multest()
%11 = tail call i32 (...) @divtest()
%12 = tail call i32 (...) @fputest()
%13 = tail call i32 (...) @mmu_test()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ get_scan_array_mask(int);
int /*<<< orphan*/ memcpy(int *, int /*<<< orphan*/, int);
void copy_scan_array_mask(int id, int *mask) {
  memcpy(mask, get_scan_array_mask(id), sizeof(int) * 13);
}


x86 assembly (clang, -O0):
<copy_scan_array_mask>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <get_scan_array_mask@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
mov    $0x34,%edx
call   1040 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copy_scan_array_mask>:
push   %rbx
mov    %rsi,%rbx
call   1030 <get_scan_array_mask@plt>
mov    %rbx,%rdi
mov    %eax,%esi
mov    $0x34,%edx
pop    %rbx
jmp    1040 <memcpy@plt>

LLVM IR (-O0):
define void @copy_scan_array_mask(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 @get_scan_array_mask(i32 %6)
%8 = call i32 @memcpy(i32* %5, i32 %7, i32 52)
ret void
}

LLVM IR (-O2):
define void @copy_scan_array_mask(i32 %0, i32* %1) {
%3 = tail call i32 @get_scan_array_mask(i32 %0)
%4 = tail call i32 @memcpy(i32* %1, i32 %3, i32 52)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, double);
void printDouble(double *fracao) { printf("%.2lf", *(fracao)); }


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

x86 assembly (clang, -O2):
<printDouble>:
movsd  (%rdi),%xmm0
lea    0xee5(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"%.2lf\00"
define void @printDouble(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = load double, double* %3
%5 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %4)
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"%.2lf\00"
define void @printDouble(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), double %2)
ret void
}
int check_data_inv(unsigned int *data, unsigned int size) {
  int i;
  for (i = 0; i < size - 1; i++) {
    if (data[i] < data[i + 1]) {
      return -1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<check_data_inv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    1163 <check_data_inv+0x63>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    $0x1,%edx
movslq %edx,%rdx
cmp    (%rcx,%rdx,4),%eax
jae    1150 <check_data_inv+0x50>
movl   $0xffffffff,-0x4(%rbp)
jmp    116a <check_data_inv+0x6a>
jmp    1155 <check_data_inv+0x55>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1112 <check_data_inv+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_data_inv>:
add    $0xffffffff,%esi
xor    %eax,%eax
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
cmp    %rcx,%rsi
je     112c <check_data_inv+0x2c>
mov    (%rdi,%rcx,4),%r8d
lea    0x1(%rcx),%rdx
cmp    0x4(%rdi,%rcx,4),%r8d
mov    %rdx,%rcx
jae    1110 <check_data_inv+0x10>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @check_data_inv(i32* nocapture %0, i32 %1) {
%3 = add i32 %1, -1
%4 = zext i32 %3 to i64
br label %5
5: ; preds = %8, %2
%6 = phi i64 [ %11, %8 ], [ 0, %2 ]
%7 = icmp eq i64 %6, %4
br i1 %7, label %15, label %8
8: ; preds = %5
%9 = getelementptr inbounds i32, i32* %0, i64 %6
%10 = load i32, i32* %9
%11 = add nuw nsw i64 %6, 1
%12 = getelementptr inbounds i32, i32* %0, i64 %11
%13 = load i32, i32* %12
%14 = icmp ult i32 %10, %13
br i1 %14, label %15, label %5
15: ; preds = %5, %8
%16 = phi i32 [ -1, %8 ], [ 0, %5 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ gcd_test();
int /*<<< orphan*/ pollard_rho_test();
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ trial_division_test();
int main() {
  gcd_test();
  trial_division_test();
  pollard_rho_test();
  printf("All tests passed!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1050 <gcd_test@plt>
mov    $0x0,%al
call   1060 <trial_division_test@plt>
mov    $0x0,%al
call   1040 <pollard_rho_test@plt>
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <gcd_test@plt>
xor    %eax,%eax
call   1060 <trial_division_test@plt>
xor    %eax,%eax
call   1040 <pollard_rho_test@plt>
lea    0xea3(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [19 x i8] c"All tests passed!\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @gcd_test()
%3 = call i32 (...) @trial_division_test()
%4 = call i32 (...) @pollard_rho_test()
%5 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [18 x i8] c"All tests passed!\00"
define i32 @main() {
%1 = tail call i32 (...) @gcd_test()
%2 = tail call i32 (...) @trial_division_test()
%3 = tail call i32 (...) @pollard_rho_test()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void swap_int(int *v1, int *v2) {
  int tmp = *v1;
  *v1 = *v2;
  *v2 = tmp;
}


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

x86 assembly (clang, -O2):
<swap_int>:
mov    (%rdi),%eax
mov    (%rsi),%ecx
mov    %ecx,(%rdi)
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @swap_int(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* %6
store i32 %7, i32* %5
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %3
store i32 %9, i32* %10
%11 = load i32, i32* %5
%12 = load i32*, i32** %4
store i32 %11, i32* %12
ret void
}

LLVM IR (-O2):
define void @swap_int(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
store i32 %4, i32* %0
store i32 %3, i32* %1
ret void
}
unsigned char encode(unsigned char base) {
  unsigned char result = 0;
  int i;
  for (i = 0; i < 8; i++) {
    result <<= 1;
    result |= base & 0x01;
    base >>= 1;
  }
  return ~result;
}


x86 assembly (clang, -O0):
<encode>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movb   $0x0,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jge    1151 <encode+0x51>
movzbl -0x2(%rbp),%eax
shl    $0x1,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%ecx
and    $0x1,%ecx
movzbl -0x2(%rbp),%eax
or     %ecx,%eax
mov    %al,-0x2(%rbp)
movzbl -0x1(%rbp),%eax
sar    $0x1,%eax
mov    %al,-0x1(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <encode+0x15>
movzbl -0x2(%rbp),%eax
xor    $0xffffffff,%eax
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<encode>:
rol    $0x4,%dil
mov    %edi,%eax
and    $0x33,%al
shl    $0x2,%al
shr    $0x2,%dil
and    $0x33,%dil
or     %dil,%al
mov    %eax,%ecx
and    $0x55,%cl
add    %cl,%cl
shr    %al
and    $0x55,%al
or     %cl,%al
not    %al
ret

LLVM IR (-O0):
define zeroext i8 @encode(i8 zeroext %0) {
%2 = alloca i8
%3 = alloca i8
%4 = alloca i32
store i8 %0, i8* %2
store i8 0, i8* %3
store i32 0, i32* %4
br label %5
5: ; preds = %24, %1
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %27
8: ; preds = %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 1
%12 = trunc i32 %11 to i8
store i8 %12, i8* %3
%13 = load i8, i8* %2
%14 = zext i8 %13 to i32
%15 = and i32 %14, 1
%16 = load i8, i8* %3
%17 = zext i8 %16 to i32
%18 = or i32 %17, %15
%19 = trunc i32 %18 to i8
store i8 %19, i8* %3
%20 = load i8, i8* %2
%21 = zext i8 %20 to i32
%22 = ashr i32 %21, 1
%23 = trunc i32 %22 to i8
store i8 %23, i8* %2
br label %24
24: ; preds = %8
%25 = load i32, i32* %4
%26 = add nsw i32 %25, 1
store i32 %26, i32* %4
br label %5
27: ; preds = %5
%28 = load i8, i8* %3
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = trunc i32 %30 to i8
ret i8 %31
}

LLVM IR (-O2):
define zeroext i8 @encode(i8 zeroext %0) {
%2 = call i8 @llvm.bitreverse.i8(i8 %0)
%3 = xor i8 %2, -1
ret i8 %3
}
void av_hwframe_ctx_alloc() {}


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

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

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

LLVM IR (-O2):
define void @av_hwframe_ctx_alloc() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int no;
  printf("请输入一个整数：");
  scanf("%d", &no);
  printf("该整数加上10的结果是：%d\n", no + 10);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed5(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0x8(%rbp),%esi
add    $0xa,%esi
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee3(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <scanf@plt>
mov    0x4(%rsp),%esi
add    $0xa,%esi
lea    0xece(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\8A\A0\E4\B8\8A10\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%5 = load i32, i32* %2
%6 = add nsw i32 %5, 10
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"\E8\AF\B7\E8\BE\93\E5\85\A5\E4\B8\80\E4\B8\AA\E6\95\B4\E6\95\B0\EF\BC\9A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [36 x i8] c"\E8\AF\A5\E6\95\B4\E6\95\B0\E5\8A\A0\E4\B8\8A10\E7\9A\84\E7\BB\93\E6\9E\9C\E6\98\AF\EF\BC\9A%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%5 = load i32, i32* %1
%6 = add nsw i32 %5, 10
%7 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.2, i64 0, i64 0), i32 %6)
ret i32 0
}
int multipleUp(int **grid, int x, int xMoveDirection, int y, int yMoveDirection,
               int moveRange) {
  int result = 0;
  return result;
}


x86 assembly (clang, -O0):
<multipleUp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9d,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @multipleUp(i32** nocapture readnone %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5) {
ret i32 0
}
int read_byte(const char *ptr, unsigned char *value) {
  *value = *ptr;
  return sizeof(char);
}


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

x86 assembly (clang, -O2):
<read_byte>:
mov    (%rdi),%al
mov    %al,(%rsi)
mov    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @read_byte(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* %5
%7 = load i8*, i8** %4
store i8 %6, i8* %7
ret i32 1
}

LLVM IR (-O2):
define i32 @read_byte(i8* nocapture %0, i8* nocapture writeonly %1) {
%3 = load i8, i8* %0
store i8 %3, i8* %1
ret i32 1
}
/* Variables and functions */
double linsched_rand(unsigned int *);
double linsched_rand_range(double low, double high, unsigned int *rand_state) {
  double rval = linsched_rand(rand_state);
  return low + rval * (high - low);
}


x86 assembly (clang, -O0):
<linsched_rand_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    %rdi,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <linsched_rand@plt>
movsd  %xmm0,-0x20(%rbp)
movsd  -0x8(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<linsched_rand_range>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
call   1030 <linsched_rand@plt>
movsd  0x8(%rsp),%xmm1
movsd  0x10(%rsp),%xmm2
subsd  %xmm1,%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

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

LLVM IR (-O2):
define double @linsched_rand_range(double %0, double %1, i32* %2) {
%4 = tail call double @linsched_rand(i32* %2)
%5 = fsub double %1, %0
%6 = tail call double @llvm.fmuladd.f64(double %4, double %5, double %0)
ret double %6
}
__attribute__((weak)) void DebugMon_Handler(void) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<DebugMon_Handler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <DebugMon_Handler+0x9>
jmp    1109 <DebugMon_Handler+0x9>

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

LLVM IR (-O0):
define weak void @DebugMon_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define weak void @DebugMon_Handler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *umalloc(scalar_t__);
char *ustrdup(const char *s) {
  char *r = umalloc(strlen(s) + 1);
  strcpy(r, s);
  return r;
}


x86 assembly (clang, -O0):
<ustrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <umalloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ustrdup>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <umalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @ustrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i8* @umalloc(i64 %6)
store i8* %7, i8** %3
%8 = load i8*, i8** %3
%9 = load i8*, i8** %2
%10 = call i32 @strcpy(i8* %8, i8* %9)
%11 = load i8*, i8** %3
ret i8* %11
}

LLVM IR (-O2):
define i8* @ustrdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @umalloc(i64 %3)
%5 = tail call i32 @strcpy(i8* %4, i8* %0)
ret i8* %4
}
/* Type definitions */
struct list_head {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ __list_splice(struct list_head *, struct list_head *);
int /*<<< orphan*/ list_empty(struct list_head *);
int /*<<< orphan*/ list_head_init(struct list_head *);
void list_splice_init(struct list_head *list, struct list_head *head) {
  if (!list_empty(list)) {
    __list_splice(list, head);
    list_head_init(list);
  }
}


x86 assembly (clang, -O0):
<list_splice_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <list_empty@plt>
cmp    $0x0,%eax
jne    1168 <list_splice_init+0x38>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <__list_splice@plt>
mov    -0x8(%rbp),%rdi
call   1040 <list_head_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_splice_init>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1050 <list_empty@plt>
test   %eax,%eax
je     114b <list_splice_init+0x1b>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <__list_splice@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <list_head_init@plt>

LLVM IR (-O0):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = alloca %struct.list_head*
%4 = alloca %struct.list_head*
store %struct.list_head* %0, %struct.list_head** %3
store %struct.list_head* %1, %struct.list_head** %4
%5 = load %struct.list_head*, %struct.list_head** %3
%6 = call i32 @list_empty(%struct.list_head* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %2
%9 = load %struct.list_head*, %struct.list_head** %3
%10 = load %struct.list_head*, %struct.list_head** %4
%11 = call i32 @__list_splice(%struct.list_head* %9, %struct.list_head* %10)
%12 = load %struct.list_head*, %struct.list_head** %3
%13 = call i32 @list_head_init(%struct.list_head* %12)
br label %14
14: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
%struct.list_head = type { i32 }
define void @list_splice_init(%struct.list_head* %0, %struct.list_head* %1) {
%3 = tail call i32 @list_empty(%struct.list_head* %0)
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %2
%6 = tail call i32 @__list_splice(%struct.list_head* %0, %struct.list_head* %1)
%7 = tail call i32 @list_head_init(%struct.list_head* %0)
br label %8
8: ; preds = %5, %2
ret void
}
/* Variables and functions */
void auth_encrypt_connect(int cnt) {}


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

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

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

LLVM IR (-O2):
define void @auth_encrypt_connect(i32 %0) {
ret void
}
int interpolate(int level, int value_00, int value_32) {
  return value_00 + level * (value_32 - value_00) / 32;
}


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

x86 assembly (clang, -O2):
<interpolate>:
sub    %esi,%edx
imul   %edi,%edx
lea    0x1f(%rdx),%eax
test   %edx,%edx
cmovns %edx,%eax
sar    $0x5,%eax
add    %esi,%eax
ret

LLVM IR (-O0):
define i32 @interpolate(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* %5
%8 = load i32, i32* %4
%9 = load i32, i32* %6
%10 = load i32, i32* %5
%11 = sub nsw i32 %9, %10
%12 = mul nsw i32 %8, %11
%13 = sdiv i32 %12, 32
%14 = add nsw i32 %7, %13
ret i32 %14
}

LLVM IR (-O2):
define i32 @interpolate(i32 %0, i32 %1, i32 %2) {
%4 = sub nsw i32 %2, %1
%5 = mul nsw i32 %4, %0
%6 = sdiv i32 %5, 32
%7 = add nsw i32 %6, %1
ret i32 %7
}
/* Variables and functions */
int match_aux(char const *, int /*<<< orphan*/, char const *,
              int /*<<< orphan*/);
int match(const char *str, const char *pattern) {
  return match_aux(str, 0, pattern, 0);
}


x86 assembly (clang, -O0):
<match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rdx
xor    %ecx,%ecx
mov    %ecx,%esi
call   1030 <match_aux@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match>:
mov    %rsi,%rdx
xor    %esi,%esi
xor    %ecx,%ecx
jmp    1030 <match_aux@plt>

LLVM IR (-O0):
define i32 @match(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 @match_aux(i8* %5, i32 0, i8* %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @match(i8* %0, i8* %1) {
%3 = tail call i32 @match_aux(i8* %0, i32 0, i8* %1, i32 0)
ret i32 %3
}