xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_motor_detail_status() {
  printf("ERROR: program is attacked without detection!\n");
}


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

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

LLVM IR (-O0):
@.str = [47 x i8] c"ERROR: program is attacked without detection!\0A\00"
define void @print_motor_detail_status() {
%1 = call i32 @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [46 x i8] c"ERROR: program is attacked without detection!\00"
define void @print_motor_detail_status() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
float stdlib_base_cbrt(float const);
float stdlib_base_cbrtf(const float x) { return stdlib_base_cbrt(x); }


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

x86 assembly (clang, -O2):
<stdlib_base_cbrtf>:
jmp    1030 <stdlib_base_cbrt@plt>

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

LLVM IR (-O2):
define float @stdlib_base_cbrtf(float %0) {
%2 = tail call float @stdlib_base_cbrt(float %0)
ret float %2
}
/* Variables and functions */
int func7();
int func8() { return func7() + 1; }


x86 assembly (clang, -O0):
<func8>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <func7@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func8>:
push   %rax
xor    %eax,%eax
call   1030 <func7@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @func8() {
%1 = call i32 (...) @func7()
%2 = add nsw i32 %1, 1
ret i32 %2
}

LLVM IR (-O2):
define i32 @func8() {
%1 = tail call i32 (...) @func7()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int getRandomNum(int, int);
int /*<<< orphan*/ printf(char *, int, int, int);
int rollDice(void) {
  int die1, die2, worksum;
  die1 = getRandomNum(1, 6);
  die2 = getRandomNum(1, 6);
  worksum = die1 + die2;
  printf("Player rolled %d + %d = %d\n", die1, die2, worksum);
  return worksum;
}


x86 assembly (clang, -O0):
<rollDice>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <getRandomNum@plt>
mov    %eax,-0x4(%rbp)
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <getRandomNum@plt>
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rollDice>:
push   %rbp
push   %rbx
push   %rax
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <getRandomNum@plt>
mov    %eax,%ebx
mov    $0x1,%edi
mov    $0x6,%esi
call   1030 <getRandomNum@plt>
lea    (%rax,%rbx,1),%ebp
lea    0xeb3(%rip),%rdi
mov    %ebx,%esi
mov    %eax,%edx
mov    %ebp,%ecx
call   1040 <printf@plt>
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
@.str = [28 x i8] c"Player rolled %d + %d = %d\0A\00"
define i32 @rollDice() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = call i32 @getRandomNum(i32 1, i32 6)
store i32 %4, i32* %1
%5 = call i32 @getRandomNum(i32 1, i32 6)
store i32 %5, i32* %2
%6 = load i32, i32* %1
%7 = load i32, i32* %2
%8 = add nsw i32 %6, %7
store i32 %8, i32* %3
%9 = load i32, i32* %1
%10 = load i32, i32* %2
%11 = load i32, i32* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %9, i32 %10, i32 %11)
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
@.str = [28 x i8] c"Player rolled %d + %d = %d\0A\00"
define i32 @rollDice() {
%1 = tail call i32 @getRandomNum(i32 1, i32 6)
%2 = tail call i32 @getRandomNum(i32 1, i32 6)
%3 = add nsw i32 %2, %1
%4 = tail call i32 @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %2, i32 %3)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ SA1Absolute(int);
int /*<<< orphan*/ STY8(int /*<<< orphan*/);
void Op8CX1(void) { STY8(SA1Absolute(2)); }


x86 assembly (clang, -O0):
<Op8CX1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x2,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
call   1040 <STY8@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<Op8CX1>:
push   %rax
mov    $0x2,%edi
call   1030 <SA1Absolute@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <STY8@plt>

LLVM IR (-O0):
define void @Op8CX1() {
%1 = call i32 @SA1Absolute(i32 2)
%2 = call i32 @STY8(i32 %1)
ret void
}

LLVM IR (-O2):
define void @Op8CX1() {
%1 = tail call i32 @SA1Absolute(i32 2)
%2 = tail call i32 @STY8(i32 %1)
ret void
}
void foo171(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo171(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
int iterator(const void *key) {
  printf("%s\n", (const char *)key);
  return 0;
}


x86 assembly (clang, -O0):
<iterator>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<iterator>:
push   %rax
mov    %rdi,%rsi
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @iterator(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 0
}
/* Type definitions */
struct link {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct link *);
void link_detach(struct link *link) {
  if (link) {
    free(link);
  }
}


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

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

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

LLVM IR (-O2):
%struct.link = type { i32 }
define void @link_detach(%struct.link* %0) {
%2 = icmp eq %struct.link* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @free(%struct.link* %0)
br label %5
5: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int /*<<< orphan*/ puts(char *);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tcdrain(int /*<<< orphan*/);
int func(void) {
  puts("hello world\n");
  tcdrain(fileno(stdout));
  return 1;
}


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1040 <tcdrain@plt>
mov    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
push   %rax
lea    0xec8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
call   1050 <fileno@plt>
mov    %eax,%edi
call   1040 <tcdrain@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"hello world\0A\00"
@stdout = global i32 0
define i32 @func() {
%1 = call i32 @puts(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = call i32 @fileno(i32 %2)
%4 = call i32 @tcdrain(i32 %3)
ret i32 1
}

LLVM IR (-O2):
@.str = [13 x i8] c"hello world\0A\00"
@stdout = global i32 0
define i32 @func() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @stdout
%3 = tail call i32 @fileno(i32 %2)
%4 = tail call i32 @tcdrain(i32 %3)
ret i32 1
}
/* Type definitions */
struct timespec {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ CLOCK_MONOTONIC;
scalar_t__ clock_gettime(int /*<<< orphan*/, struct timespec *);
int main(void) {
  struct timespec ts;
  if (clock_gettime(CLOCK_MONOTONIC, &ts) < 0)
    return 111;
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ec2(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
call   1030 <clock_gettime@plt>
cmp    $0x0,%rax
jge    1147 <main+0x37>
movl   $0x6f,-0x4(%rbp)
jmp    114e <main+0x3e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x2ed0(%rip),%rax
mov    (%rax),%edi
mov    %rsp,%rsi
call   1030 <clock_gettime@plt>
sar    $0x3f,%rax
and    $0x6f,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timespec
store i32 0, i32* %1
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %2)
%5 = icmp slt i64 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %0
store i32 111, i32* %1
br label %8
7: ; preds = %0
store i32 0, i32* %1
br label %8
8: ; preds = %7, %6
%9 = load i32, i32* %1
ret i32 %9
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@CLOCK_MONOTONIC = global i32 0
define i32 @main() {
%1 = alloca %struct.timespec
%2 = bitcast %struct.timespec* %1 to i8*
%3 = load i32, i32* @CLOCK_MONOTONIC
%4 = call i64 @clock_gettime(i32 %3, %struct.timespec* %1)
%5 = icmp slt i64 %4, 0
%6 = select i1 %5, i32 111, i32 0
ret i32 %6
}
/* Variables and functions */
int f2u(float);
scalar_t__ isnan(float);
float u2f(unsigned int);
unsigned test_float_neg(unsigned uf) {
  float f = u2f(uf);
  float nf = -f;
  if (isnan(f))
    return uf;
  else
    return f2u(nf);
}


x86 assembly (clang, -O0):
<test_float_neg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <u2f@plt>
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0xc(%rbp),%xmm0
call   1040 <isnan@plt>
cmp    $0x0,%rax
je     117e <test_float_neg+0x4e>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    118b <test_float_neg+0x5b>
movss  -0x10(%rbp),%xmm0
call   1050 <f2u@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_float_neg>:
push   %rbx
sub    $0x10,%rsp
mov    %edi,%ebx
call   1030 <u2f@plt>
movaps %xmm0,(%rsp)
call   1040 <isnan@plt>
test   %rax,%rax
je     1152 <test_float_neg+0x22>
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret
movaps (%rsp),%xmm0
xorps  0xea3(%rip),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1050 <f2u@plt>

LLVM IR (-O0):
define i32 @test_float_neg(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
store i32 %0, i32* %3
%6 = load i32, i32* %3
%7 = call float @u2f(i32 %6)
store float %7, float* %4
%8 = load float, float* %4
%9 = fneg float %8
store float %9, float* %5
%10 = load float, float* %4
%11 = call i64 @isnan(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %18
15: ; preds = %1
%16 = load float, float* %5
%17 = call i32 @f2u(float %16)
store i32 %17, i32* %2
br label %18
18: ; preds = %15, %13
%19 = load i32, i32* %2
ret i32 %19
}

LLVM IR (-O2):
define i32 @test_float_neg(i32 %0) {
%2 = tail call float @u2f(i32 %0)
%3 = tail call i64 @isnan(float %2)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = fneg float %2
%7 = tail call i32 @f2u(float %6)
br label %8
8: ; preds = %1, %5
%9 = phi i32 [ %7, %5 ], [ %0, %1 ]
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int);
main() {
  int ch;
  for (ch = 0; ch <= 255; ch++)
    printf("%d\t%c\t\t", ch, ch);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xff,-0x8(%rbp)
jg     1153 <main+0x43>
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1126 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
xor    %ebx,%ebx
lea    0xee3(%rip),%r14
nopl   (%rax)
mov    %r14,%rdi
mov    %ebx,%esi
mov    %ebx,%edx
call   1030 <printf@plt>
add    $0x1,%ebx
cmp    $0x100,%ebx
jne    1120 <main+0x10>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [8 x i8] c"%d\09%c\09\09\00"
define i32 @main() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i32 %2, i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 256
br i1 %5, label %6, label %1
6: ; preds = %1
ret i32 0
}
/* Type definitions */
struct qcom_smem_state {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
struct qcom_smem_state *ERR_PTR(int /*<<< orphan*/);
struct qcom_smem_state *qcom_smem_state_get(struct device *dev,
                                            const char *con_id, unsigned *bit) {
  return ERR_PTR(-EINVAL);
}


x86 assembly (clang, -O0):
<qcom_smem_state_get>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
xor    %edi,%edi
mov    0x2eb3(%rip),%rax
sub    (%rax),%edi
call   1030 <ERR_PTR@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qcom_smem_state_get>:
mov    0x2ec9(%rip),%rax
xor    %edi,%edi
sub    (%rax),%edi
jmp    1030 <ERR_PTR@plt>

LLVM IR (-O0):
%struct.qcom_smem_state = type { i32 }
%struct.device = type { i32 }
@EINVAL = global i32 0
define %struct.qcom_smem_state* @qcom_smem_state_get(%struct.device* %0, i8* %1, i32* %2) {
%4 = alloca %struct.device*
%5 = alloca i8*
%6 = alloca i32*
store %struct.device* %0, %struct.device** %4
store i8* %1, i8** %5
store i32* %2, i32** %6
%7 = load i32, i32* @EINVAL
%8 = sub nsw i32 0, %7
%9 = call %struct.qcom_smem_state* @ERR_PTR(i32 %8)
ret %struct.qcom_smem_state* %9
}

LLVM IR (-O2):
%struct.qcom_smem_state = type { i32 }
%struct.device = type { i32 }
@EINVAL = global i32 0
define %struct.qcom_smem_state* @qcom_smem_state_get(%struct.device* nocapture readnone %0, i8* nocapture readnone %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @EINVAL
%5 = sub nsw i32 0, %4
%6 = tail call %struct.qcom_smem_state* @ERR_PTR(i32 %5)
ret %struct.qcom_smem_state* %6
}
int is_prime(int num) {
  int i;
  for (i = 2; i < num && num % i != 0; i++)
    ;
  if (i < num)
    return 0;
  else
    return 1;
}


x86 assembly (clang, -O0):
<is_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
cmp    -0x8(%rbp),%ecx
mov    %al,-0xd(%rbp)
jge    112f <is_prime+0x2f>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
setne  %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
test   $0x1,%al
jne    113f <is_prime+0x3f>
jmp    1152 <is_prime+0x52>
jmp    1144 <is_prime+0x44>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110e <is_prime+0xe>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    116a <is_prime+0x6a>
movl   $0x0,-0x4(%rbp)
jmp    1171 <is_prime+0x71>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_prime>:
mov    $0x1,%eax
cmp    $0x3,%edi
jl     1139 <is_prime+0x39>
xor    %eax,%eax
test   $0x1,%dil
je     1139 <is_prime+0x39>
mov    $0x3,%eax
nopw   0x0(%rax,%rax,1)
mov    %eax,%ecx
cmp    %eax,%edi
je     1132 <is_prime+0x32>
mov    %edi,%eax
cltd
idiv   %ecx
lea    0x1(%rcx),%eax
test   %edx,%edx
jne    1120 <is_prime+0x20>
xor    %eax,%eax
cmp    %edi,%ecx
setge  %al
ret

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

LLVM IR (-O2):
define i32 @is_prime(i32 %0) {
%2 = icmp sgt i32 %0, 2
br i1 %2, label %3, label %16
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %16, label %6
6: ; preds = %3, %9
%7 = phi i32 [ %12, %9 ], [ 3, %3 ]
%8 = icmp eq i32 %7, %0
br i1 %8, label %13, label %9
9: ; preds = %6
%10 = srem i32 %0, %7
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %7, 1
br i1 %11, label %13, label %6
13: ; preds = %9, %6
%14 = icmp sge i32 %7, %0
%15 = zext i1 %14 to i32
br label %16
16: ; preds = %13, %3, %1
%17 = phi i32 [ 1, %1 ], [ 0, %3 ], [ %15, %13 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char const *);
void usage(const char *progname) {
  printf("usage: %s [-h] [INPUT] [OUTPUT]\n", progname);
}


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

x86 assembly (clang, -O2):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [33 x i8] c"usage: %s [-h] [INPUT] [OUTPUT]\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
int main() {
  int i, j, x[10][10], n1, n2, n3, n4, n5;
  for (i = 0; i < 10; i++) {
    for (j = 0; j < 10; j++) {
      x[i][j] = x[i - 1][j];
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x140,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    118c <main+0x8c>
movl   $0x0,-0xc(%rbp)
cmpl   $0xa,-0xc(%rbp)
jge    1179 <main+0x79>
mov    -0x8(%rbp),%eax
sub    $0x1,%eax
movslq %eax,%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
movslq -0x8(%rbp),%rcx
lea    -0x1a0(%rbp),%rax
imul   $0x28,%rcx,%rcx
add    %rcx,%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112a <main+0x2a>
jmp    117e <main+0x7e>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1119 <main+0x19>
mov    -0x4(%rbp),%eax
add    $0x140,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @mod_idiot_is_GPL_compatible() {
ret void
}
/* Variables and functions */
void *__memcpy_backward(void *, void const *, size_t);
void *__memcpy_forward(void *, void const *, size_t);
void *memmove(void *s, const void *ct, size_t n) {
  if (s < ct) {
    return __memcpy_forward(s, ct, n);
  } else {
    return __memcpy_backward(s, ct, n);
  }
}


x86 assembly (clang, -O0):
<memmove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    115c <memmove+0x3c>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1040 <__memcpy_forward@plt>
mov    %rax,-0x8(%rbp)
jmp    1171 <memmove+0x51>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <__memcpy_backward@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<memmove>:
cmp    %rsi,%rdi
jae    112a <memmove+0xa>
jmp    1040 <__memcpy_forward@plt>
jmp    1030 <__memcpy_backward@plt>

LLVM IR (-O0):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i64
store i8* %0, i8** %5
store i8* %1, i8** %6
store i64 %2, i64* %7
%8 = load i8*, i8** %5
%9 = load i8*, i8** %6
%10 = icmp ult i8* %8, %9
br i1 %10, label %11, label %16
11: ; preds = %3
%12 = load i8*, i8** %5
%13 = load i8*, i8** %6
%14 = load i64, i64* %7
%15 = call i8* @__memcpy_forward(i8* %12, i8* %13, i64 %14)
store i8* %15, i8** %4
br label %21
16: ; preds = %3
%17 = load i8*, i8** %5
%18 = load i8*, i8** %6
%19 = load i64, i64* %7
%20 = call i8* @__memcpy_backward(i8* %17, i8* %18, i64 %19)
store i8* %20, i8** %4
br label %21
21: ; preds = %16, %11
%22 = load i8*, i8** %4
ret i8* %22
}

LLVM IR (-O2):
define i8* @memmove(i8* %0, i8* %1, i64 %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %7
5: ; preds = %3
%6 = tail call i8* @__memcpy_forward(i8* %0, i8* %1, i64 %2)
br label %9
7: ; preds = %3
%8 = tail call i8* @__memcpy_backward(i8* %0, i8* %1, i64 %2)
br label %9
9: ; preds = %7, %5
%10 = phi i8* [ %6, %5 ], [ %8, %7 ]
ret i8* %10
}
__attribute__((always_)) void sync$fence$Compiler() {
  asm volatile("" ::: "memory");
}


x86 assembly (clang, -O0):
<sync$fence$Compiler>:
push   %rbp
mov    %rsp,%rbp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync$fence$Compiler>:
ret

LLVM IR (-O0):
define void @"sync$fence$Compiler"() {
ret void
}

LLVM IR (-O2):
define void @"sync$fence$Compiler"() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int main(void) {
  printf("%s\n", "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
                 "outputs/2022-01-22/02-19-57/repos/vincent040/lab/refs/heads/"
                 "master/GNU-tools/make/demo/b.c");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vincent040/lab/refs/heads/master/GNU-tools/make/demo/b.c\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
@.str.1 = [147 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/vincent040/lab/refs/heads/master/GNU-tools/make/demo/b.c\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([147 x i8], [147 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
int fun939() { return 939; }


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

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

LLVM IR (-O0):
define i32 @fun939() {
ret i32 939
}

LLVM IR (-O2):
define i32 @fun939() {
ret i32 939
}
void strength_test5(int *data) {
  int i = 0;
  while (1) {
    i = i + 1;
    if (data[1] && 21 * i > data[3])
      break;
    data[data[2]] = 2;
  }
}


x86 assembly (clang, -O0):
<strength_test5>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     113c <strength_test5+0x3c>
imul   $0x15,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
cmp    0xc(%rcx),%eax
jle    113c <strength_test5+0x3c>
jmp    1154 <strength_test5+0x54>
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq 0x8(%rcx),%rcx
movl   $0x2,(%rax,%rcx,4)
jmp    110f <strength_test5+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strength_test5>:
mov    $0x15,%eax
jmp    111e <strength_test5+0x1e>
nopw   0x0(%rax,%rax,1)
movslq 0x8(%rdi),%rcx
movl   $0x2,(%rdi,%rcx,4)
add    $0x15,%eax
cmpl   $0x0,0x4(%rdi)
je     1110 <strength_test5+0x10>
cmp    0xc(%rdi),%eax
jle    1110 <strength_test5+0x10>
ret

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

LLVM IR (-O2):
define void @strength_test5(i32* nocapture %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 1
%3 = getelementptr inbounds i32, i32* %0, i64 3
%4 = getelementptr inbounds i32, i32* %0, i64 2
br label %5
5: ; preds = %14, %1
%6 = phi i32 [ 0, %1 ], [ %7, %14 ]
%7 = add nuw nsw i32 %6, 1
%8 = load i32, i32* %2
%9 = icmp eq i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = mul nsw i32 %7, 21
%12 = load i32, i32* %3
%13 = icmp sgt i32 %11, %12
br i1 %13, label %18, label %14
14: ; preds = %10, %5
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %0, i64 %16
store i32 2, i32* %17
br label %5
18: ; preds = %10
ret void
}
int is_turnover(const char *board, const char *turnover) {
  char target = board[0];
  for (int i = 0; turnover[i] != '\0'; i++) {
    if (turnover[i] == target)
      return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_turnover>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x19(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <is_turnover+0x68>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x19(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <is_turnover+0x55>
movl   $0x1,-0x4(%rbp)
jmp    116f <is_turnover+0x6f>
jmp    115a <is_turnover+0x5a>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    111c <is_turnover+0x1c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_turnover>:
mov    (%rdi),%al
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl (%rsi),%ecx
test   %cl,%cl
je     111f <is_turnover+0x1f>
add    $0x1,%rsi
cmp    %al,%cl
jne    1110 <is_turnover+0x10>
xor    %eax,%eax
test   %cl,%cl
setne  %al
ret

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

LLVM IR (-O2):
define i32 @is_turnover(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
br label %4
4: ; preds = %4, %2
%5 = phi i64 [ %11, %4 ], [ 0, %2 ]
%6 = getelementptr inbounds i8, i8* %1, i64 %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 0
%9 = icmp eq i8 %7, %3
%10 = select i1 %8, i1 true, i1 %9
%11 = add nuw i64 %5, 1
br i1 %10, label %12, label %4
12: ; preds = %4
%13 = xor i1 %8, true
%14 = zext i1 %13 to i32
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ drftb1(int, double *, double *, double *, int *);
void __ogg_fdrfftb(int n, double *r, double *wsave, int *ifac) {
  if (n == 1)
    return;
  drftb1(n, r, wsave, wsave + n, ifac);
}


x86 assembly (clang, -O0):
<__ogg_fdrfftb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x1,-0x4(%rbp)
jne    1136 <__ogg_fdrfftb+0x26>
jmp    1159 <__ogg_fdrfftb+0x49>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x18(%rbp),%rcx
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
add    %rax,%rcx
mov    -0x20(%rbp),%r8
call   1030 <drftb1@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__ogg_fdrfftb>:
cmp    $0x1,%edi
jne    1116 <__ogg_fdrfftb+0x6>
ret
mov    %rcx,%r8
movslq %edi,%rax
lea    (%rdx,%rax,8),%rcx
jmp    1030 <drftb1@plt>

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

LLVM IR (-O2):
define void @__ogg_fdrfftb(i32 %0, double* %1, double* %2, i32* %3) {
%5 = icmp eq i32 %0, 1
br i1 %5, label %10, label %6
6: ; preds = %4
%7 = sext i32 %0 to i64
%8 = getelementptr inbounds double, double* %2, i64 %7
%9 = tail call i32 @drftb1(i32 %0, double* %1, double* %2, double* %8, i32* %3)
br label %10
10: ; preds = %4, %6
ret void
}
extern void tracet(int level, const char *format, ...) {}


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

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

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

LLVM IR (-O2):
define void @tracet(i32 %0, i8* nocapture %1, ...) {
ret void
}
int len_of_tab(char **tab) {
  int i;
  i = 0;
  while (tab[i])
    i++;
  return (i);
}


x86 assembly (clang, -O0):
<len_of_tab>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
cmpq   $0x0,(%rax,%rcx,8)
je     1130 <len_of_tab+0x30>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <len_of_tab+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<len_of_tab>:
mov    $0xffffffff,%eax
cs nopw 0x0(%rax,%rax,1)
nop
add    $0x1,%eax
cmpq   $0x0,(%rdi)
lea    0x8(%rdi),%rdi
jne    1110 <len_of_tab+0x10>
ret

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

LLVM IR (-O2):
define i32 @len_of_tab(i8** nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8*, i8** %0, i64 %3
%5 = load i8*, i8** %4
%6 = icmp eq i8* %5, null
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void CFunction() { printf("Hello from a C function\n"); }


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"Hello from a C function\0A\00"
define void @CFunction() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [24 x i8] c"Hello from a C function\00"
define void @CFunction() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
ret void
}
void increaseWay(int *way, int x, int y) {
  int size = way[0] + 2;
  way[size - 1] = y;
  way[size] = x;
  way[0] = size;
}


x86 assembly (clang, -O0):
<increaseWay>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0x2,%eax
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%edx
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0xc(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<increaseWay>:
movslq (%rdi),%rax
lea    0x2(%rax),%rcx
mov    %edx,0x4(%rdi,%rax,4)
mov    %esi,0x8(%rdi,%rax,4)
mov    %ecx,(%rdi)
ret

LLVM IR (-O0):
define void @increaseWay(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = getelementptr inbounds i32, i32* %8, i64 0
%10 = load i32, i32* %9
%11 = add nsw i32 %10, 2
store i32 %11, i32* %7
%12 = load i32, i32* %6
%13 = load i32*, i32** %4
%14 = load i32, i32* %7
%15 = sub nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i32, i32* %13, i64 %16
store i32 %12, i32* %17
%18 = load i32, i32* %5
%19 = load i32*, i32** %4
%20 = load i32, i32* %7
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i32, i32* %19, i64 %21
store i32 %18, i32* %22
%23 = load i32, i32* %7
%24 = load i32*, i32** %4
%25 = getelementptr inbounds i32, i32* %24, i64 0
store i32 %23, i32* %25
ret void
}

LLVM IR (-O2):
define void @increaseWay(i32* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* %0
%5 = add nsw i32 %4, 2
%6 = add nsw i32 %4, 1
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
store i32 %2, i32* %8
%9 = sext i32 %5 to i64
%10 = getelementptr inbounds i32, i32* %0, i64 %9
store i32 %1, i32* %10
store i32 %5, i32* %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int *, int);
int setreuse(int socket) {
  int ret, on = 1;
  ret = setsockopt(socket, SOL_SOCKET, SO_REUSEADDR, &on, sizeof(int));
  return ret;
}


x86 assembly (clang, -O0):
<setreuse>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    0x2ebc(%rip),%rax
mov    (%rax),%esi
mov    0x2ea3(%rip),%rax
mov    (%rax),%edx
lea    -0xc(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setreuse>:
push   %rax
movl   $0x1,0x4(%rsp)
mov    0x2ec8(%rip),%rax
mov    (%rax),%esi
mov    0x2eaf(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
pop    %rcx
ret

LLVM IR (-O0):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @setreuse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
store i32 1, i32* %4
%5 = load i32, i32* %2
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_REUSEADDR
%8 = call i32 @setsockopt(i32 %5, i32 %6, i32 %7, i32* %4, i32 4)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
define i32 @setreuse(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 1, i32* %2
%4 = load i32, i32* @SOL_SOCKET
%5 = load i32, i32* @SO_REUSEADDR
%6 = call i32 @setsockopt(i32 %0, i32 %4, i32 %5, i32* %2, i32 4)
ret i32 %6
}
void TimerHalActivateTimerInPowerControl(unsigned int timer) {}


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

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

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

LLVM IR (-O2):
define void @TimerHalActivateTimerInPowerControl(i32 %0) {
ret void
}
/* Variables and functions */
char *calloc(int, int);
void call_calloc() {
  char *buf = calloc(100, 1);
  while (*buf)
    buf++;
}


x86 assembly (clang, -O0):
<call_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x64,%edi
mov    $0x1,%esi
call   1030 <calloc@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <call_calloc+0x39>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    112b <call_calloc+0x1b>
add    $0x10,%rsp
pop    %rbp
ret

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

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

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


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

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

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

LLVM IR (-O2):
define void @foo095() {
ret void
}
__attribute__((always_)) void decref_a(struct A **pp) { struct A *p = *pp; }


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

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

LLVM IR (-O0):
%struct.A = type opaque
define void @decref_a(%struct.A** %0) {
%2 = alloca %struct.A**
%3 = alloca %struct.A*
store %struct.A** %0, %struct.A*** %2
%4 = load %struct.A**, %struct.A*** %2
%5 = load %struct.A*, %struct.A** %4
store %struct.A* %5, %struct.A** %3
ret void
}

LLVM IR (-O2):
%struct.A = type opaque
define void @decref_a(%struct.A** nocapture %0) {
ret void
}
/* Variables and functions */
int isxdigit(int);
int ISHEX(int ch) { return isxdigit(ch); }


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

x86 assembly (clang, -O2):
<ISHEX>:
jmp    1030 <isxdigit@plt>

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

LLVM IR (-O2):
define i32 @ISHEX(i32 %0) {
%2 = tail call i32 @isxdigit(i32 %0)
ret i32 %2
}
/* Variables and functions */
void *compare_uint_context(void) { return NULL; }


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

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

LLVM IR (-O0):
define i8* @compare_uint_context() {
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @compare_uint_context() {
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void myFunc2(void) {
  printf("entering myFunc2\n");
  printf("exiting myFunc2\n");
}


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

x86 assembly (clang, -O2):
<myFunc2>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
lea    0xeed(%rip),%rdi
pop    %rax
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"entering myFunc2\0A\00"
@.str.1 = [17 x i8] c"exiting myFunc2\0A\00"
define void @myFunc2() {
%1 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [17 x i8] c"entering myFunc2\00"
@str.2 = [16 x i8] c"exiting myFunc2\00"
define void @myFunc2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str.2, i64 0, i64 0))
ret void
}
int ffs(int x) {
  int bit, mask;
  if (x == 0)
    return 0;
  for (bit = 1, mask = 1; !(x & mask); bit++, mask <<= 1)
    ;
  return bit;
}


x86 assembly (clang, -O0):
<ffs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111d <ffs+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1168 <ffs+0x68>
movl   $0x1,-0xc(%rbp)
movl   $0x1,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    1146 <ffs+0x46>
jmp    1162 <ffs+0x62>
jmp    114b <ffs+0x4b>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112b <ffs+0x2b>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ffs>:
test   %edi,%edi
je     112a <ffs+0x2a>
mov    $0x1,%eax
test   $0x1,%dil
jne    1129 <ffs+0x29>
mov    $0x1,%ecx
mov    $0x1,%eax
nopl   0x0(%rax)
add    $0x1,%eax
add    %ecx,%ecx
test   %edi,%ecx
je     1120 <ffs+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ffs(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = and i32 %0, 1
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %13
6: ; preds = %3, %6
%7 = phi i32 [ %10, %6 ], [ 1, %3 ]
%8 = phi i32 [ %9, %6 ], [ 1, %3 ]
%9 = add nuw nsw i32 %8, 1
%10 = shl i32 %7, 1
%11 = and i32 %10, %0
%12 = icmp eq i32 %11, 0
br i1 %12, label %6, label %13
13: ; preds = %6, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %9, %6 ]
ret i32 %14
}