xunge/DecIR huggingface dataset:
/* Variables and functions */
int abs(int);
int inc(int);
int main() {
  int i = 0 - 10;
  i = inc(i);
  i = abs(i);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xfffffff6,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1040 <inc@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <abs@plt>
mov    %eax,-0x8(%rbp)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xfffffff6,%edi
call   1030 <inc@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 -10, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @inc(i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = call i32 @abs(i32 %5)
store i32 %6, i32* %2
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @inc(i32 -10)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ stderr;
void bpnn_initialize(int seed) {
  fprintf(stderr, "Random number generator seed: %d\n", seed);
  srand(seed);
}


x86 assembly (clang, -O0):
<bpnn_initialize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%edx
lea    0xec2(%rip),%rsi
call   1040 <fprintf@plt>
mov    -0x4(%rbp),%edi
call   1030 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bpnn_initialize>:
push   %rbx
mov    %edi,%ebx
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
mov    %ebx,%edx
call   1040 <fprintf@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <srand@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* @stderr
%4 = load i32, i32* %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = load i32, i32* %2
%7 = call i32 @srand(i32 %6)
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [34 x i8] c"Random number generator seed: %d\0A\00"
define void @bpnn_initialize(i32 %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0)
%4 = tail call i32 @srand(i32 %0)
ret void
}
void swap(double *x, double *y) {
  double aux;
  aux = *x;
  *x = *y;
  *y = aux;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x18(%rbp),%xmm0
mov    -0x10(%rbp),%rax
movsd  %xmm0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
movsd  %xmm1,(%rdi)
movsd  %xmm0,(%rsi)
ret

LLVM IR (-O0):
define void @swap(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca double
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double, double* %6
store double %7, double* %5
%8 = load double*, double** %4
%9 = load double, double* %8
%10 = load double*, double** %3
store double %9, double* %10
%11 = load double, double* %5
%12 = load double*, double** %4
store double %11, double* %12
ret void
}

LLVM IR (-O2):
define void @swap(double* nocapture %0, double* nocapture %1) {
%3 = load double, double* %0
%4 = load double, double* %1
store double %4, double* %0
store double %3, double* %1
ret void
}
/* Variables and functions */
double ldexp(double, int);
double c_ldexp(double arg0, int arg1) { return ldexp(arg0, arg1); }


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

x86 assembly (clang, -O2):
<c_ldexp>:
jmp    1030 <ldexp@plt>

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

LLVM IR (-O2):
define double @c_ldexp(double %0, i32 %1) {
%3 = tail call double @ldexp(double %0, i32 %1)
ret double %3
}
void glmReverseVector2d(double v[2]) {
  v[0] = -v[0];
  v[1] = -v[1];
}


x86 assembly (clang, -O0):
<glmReverseVector2d>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
movsd  0x8(%rax),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mov    -0x8(%rbp),%rax
movsd  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmReverseVector2d>:
movups (%rdi),%xmm0
xorps  0xef6(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @glmReverseVector2d(double* %0) {
%2 = alloca double*
store double* %0, double** %2
%3 = load double*, double** %2
%4 = getelementptr inbounds double, double* %3, i64 0
%5 = load double, double* %4
%6 = fneg double %5
%7 = load double*, double** %2
%8 = getelementptr inbounds double, double* %7, i64 0
store double %6, double* %8
%9 = load double*, double** %2
%10 = getelementptr inbounds double, double* %9, i64 1
%11 = load double, double* %10
%12 = fneg double %11
%13 = load double*, double** %2
%14 = getelementptr inbounds double, double* %13, i64 1
store double %12, double* %14
ret void
}

LLVM IR (-O2):
define void @glmReverseVector2d(double* nocapture %0) {
%2 = bitcast double* %0 to <2 x double>*
%3 = load <2 x double>, <2 x double>* %2
%4 = fneg <2 x double> %3
%5 = bitcast double* %0 to <2 x double>*
store <2 x double> %4, <2 x double>* %5
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ sleep(int);
void *t1(void *v) {
  volatile int *ip = (int *)v;
  if (0)
    printf("ta W\n");
  *ip += 44;
  *ip *= 2;
  sleep(1);
  return 0;
}


x86 assembly (clang, -O0):
<t1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x2c,%ecx
mov    %ecx,(%rax)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
shl    $0x1,%ecx
mov    %ecx,(%rax)
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<t1>:
push   %rax
addl   $0x2c,(%rdi)
shll   (%rdi)
mov    $0x1,%edi
call   1030 <sleep@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i8* @t1(i8* %0) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = load volatile i32, i32* %6
%8 = add nsw i32 %7, 44
store volatile i32 %8, i32* %6
%9 = load i32*, i32** %3
%10 = load volatile i32, i32* %9
%11 = mul nsw i32 %10, 2
store volatile i32 %11, i32* %9
%12 = call i32 @sleep(i32 1)
ret i8* null
}

LLVM IR (-O2):
define noalias i8* @t1(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = load volatile i32, i32* %2
%4 = add nsw i32 %3, 44
store volatile i32 %4, i32* %2
%5 = load volatile i32, i32* %2
%6 = shl nsw i32 %5, 1
store volatile i32 %6, i32* %2
%7 = tail call i32 @sleep(i32 1)
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ f(double);
int main() { f(0.0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xorps  %xmm0,%xmm0
call   1030 <f@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xorps  %xmm0,%xmm0
call   1030 <f@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 @f(double 0.000000e+00)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(double 0.000000e+00)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ strrev(char *);
int main() {
  char buffer[10];
  scanf("%s", buffer);
  strrev(buffer);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed4(%rip),%rdi
lea    0x6(%rsp),%rbx
mov    %rbx,%rsi
call   1030 <scanf@plt>
mov    %rbx,%rdi
call   1040 <strrev@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
store i32 0, i32* %1
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%6 = call i32 @strrev(i8* %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = call i32 @strrev(i8* %2)
ret i32 0
}
int num_base64_padding_chars_for_data_length(int n) {
  return (3 - (n % 3)) % 3;
}


x86 assembly (clang, -O0):
<num_base64_padding_chars_for_data_length>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    $0x3,%eax
sub    %edx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<num_base64_padding_chars_for_data_length>:
movslq %edi,%rax
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %ecx,%eax
mov    $0x3,%cl
sub    %al,%cl
movzbl %cl,%eax
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %cl,%al
movzbl %al,%eax
ret

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

LLVM IR (-O2):
define i32 @num_base64_padding_chars_for_data_length(i32 %0) {
%2 = srem i32 %0, 3
%3 = trunc i32 %2 to i8
%4 = sub nsw i8 3, %3
%5 = urem i8 %4, 3
%6 = zext i8 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main() {
  int answer = 1;
  int i;
  for (i = 10; i >= 1; i--)
    answer = answer * i;
  printf("%d\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jl     114f <main+0x3f>
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    112d <main+0x1d>
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 1, i32* %2
store i32 10, i32* %3
br label %4
4: ; preds = %11, %0
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 1
br i1 %6, label %7, label %14
7: ; preds = %4
%8 = load i32, i32* %2
%9 = load i32, i32* %3
%10 = mul nsw i32 %8, %9
store i32 %10, i32* %2
br label %11
11: ; preds = %7
%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* %2
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 3628800)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
void _mm256_storeu_epi64(void *, int /*<<< orphan*/);
void test_mm256_storeu_epi64(void *__P, __m256i __A) {
  return _mm256_storeu_epi64(__P, __A);
}


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

x86 assembly (clang, -O2):
<test_mm256_storeu_epi64>:
jmp    1030 <_mm256_storeu_epi64@plt>

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

LLVM IR (-O2):
define void @test_mm256_storeu_epi64(i8* %0, i32 %1) {
tail call void @_mm256_storeu_epi64(i8* %0, i32 %1)
ret void
}
int test_imm_7Auint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x7A << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Auint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 122
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ TOSH_MAKE_HUM_SDA_OUTPUT();
void HUMIDITY_MAKE_DATA_OUTPUT() { TOSH_MAKE_HUM_SDA_OUTPUT(); }


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

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

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

LLVM IR (-O2):
define void @HUMIDITY_MAKE_DATA_OUTPUT() {
%1 = tail call i32 (...) @TOSH_MAKE_HUM_SDA_OUTPUT()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ lnm_init();
int real_socket(int, int, int);
int /*<<< orphan*/ startFD(int);
int socket(int domain, int type, int protocol) {
  int returnedFD;
  lnm_init();
  ;
  returnedFD = real_socket(domain, type, protocol);
  if (returnedFD > 0) {
    startFD(returnedFD);
  }
  return returnedFD;
}


x86 assembly (clang, -O0):
<socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    $0x0,%al
call   1040 <lnm_init@plt>
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
call   1030 <real_socket@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jle    116b <socket+0x3b>
mov    -0x10(%rbp),%edi
call   1050 <startFD@plt>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <lnm_init@plt>
mov    %ebx,%edi
mov    %ebp,%esi
mov    %r14d,%edx
call   1030 <real_socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jle    115b <socket+0x2b>
mov    %ebx,%edi
call   1050 <startFD@plt>
mov    %ebx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @socket(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 = call i32 (...) @lnm_init()
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = load i32, i32* %6
%12 = call i32 @real_socket(i32 %9, i32 %10, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = icmp sgt i32 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %3
%16 = load i32, i32* %7
%17 = call i32 @startFD(i32 %16)
br label %18
18: ; preds = %15, %3
%19 = load i32, i32* %7
ret i32 %19
}

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32 (...) @lnm_init()
%5 = tail call i32 @real_socket(i32 %0, i32 %1, i32 %2)
%6 = icmp sgt i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %3
%8 = tail call i32 @startFD(i32 %5)
br label %9
9: ; preds = %7, %3
ret i32 %5
}
int flip_triple(int val, int lc) {
  if (lc)
    return ((val == 1) ? 0 : 1);
  else
    return ((val == 2) ? 0 : 2);
}


x86 assembly (clang, -O0):
<flip_triple>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     112c <flip_triple+0x2c>
mov    -0x8(%rbp),%edx
mov    $0x1,%eax
xor    %ecx,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
jmp    113f <flip_triple+0x3f>
mov    -0x8(%rbp),%edx
mov    $0x2,%eax
xor    %ecx,%ecx
cmp    $0x2,%edx
cmove  %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<flip_triple>:
xor    %ecx,%ecx
cmp    $0x2,%edi
setne  %cl
xor    %eax,%eax
cmp    $0x1,%edi
setne  %al
add    %ecx,%ecx
test   %esi,%esi
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @flip_triple(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
%4 = icmp ne i32 %0, 1
%5 = zext i1 %4 to i32
%6 = icmp eq i32 %0, 2
%7 = select i1 %6, i32 0, i32 2
%8 = select i1 %3, i32 %7, i32 %5
ret i32 %8
}
AR0RX1(r0, r1, x0, x1, p0, p1) unsigned short r0, r1;
unsigned short *p0, *p1;
{
  if ((p0[10000000]) <= (p1[x1]))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<AR0RX1>:
push   %rbp
mov    %rsp,%rbp
mov    %esi,%eax
mov    %di,%si
mov    %si,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
mov    -0x18(%rbp),%rax
movzwl 0x1312d00(%rax),%eax
mov    -0x20(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzwl (%rcx,%rdx,2),%ecx
cmp    %ecx,%eax
jg     114a <AR0RX1+0x4a>
movl   $0x1,-0x4(%rbp)
jmp    1151 <AR0RX1+0x51>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AR0RX1>:
movzwl 0x1312d00(%r8),%edx
01
movslq %ecx,%rcx
xor    %eax,%eax
cmp    (%r9,%rcx,2),%dx
setbe  %al
ret

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

LLVM IR (-O2):
define i32 @AR0RX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture %4, i16* nocapture %5) {
%7 = getelementptr inbounds i16, i16* %4, i64 10000000
%8 = load i16, i16* %7
%9 = sext i32 %3 to i64
%10 = getelementptr inbounds i16, i16* %5, i64 %9
%11 = load i16, i16* %10
%12 = icmp ule i16 %8, %11
%13 = zext i1 %12 to i32
ret i32 %13
}
/* Type definitions */
typedef int pid_t;

/* Variables and functions */
int /*<<< orphan*/ ChildProcess();
int /*<<< orphan*/ ParentProcess();
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ printf(char *);
void main(void) {
  pid_t pid;
  pid = fork();
  if (pid == -1) {
    printf("Can't fork!!\n");
    exit(-1);
  } else if (pid == 0)
    ChildProcess();
  else
    ParentProcess();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1070 <fork@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    1182 <main+0x32>
lea    0xe8d(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>
cmpl   $0x0,-0x4(%rbp)
jne    1198 <main+0x48>
mov    $0x0,%al
call   1050 <ChildProcess@plt>
jmp    119f <main+0x4f>
mov    $0x0,%al
call   1040 <ParentProcess@plt>
jmp    11a4 <main+0x54>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1070 <fork@plt>
test   %eax,%eax
je     1169 <main+0x19>
cmp    $0xffffffff,%eax
je     1171 <main+0x21>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ParentProcess@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <ChildProcess@plt>
lea    0xe88(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"Can't fork!!\0A\00"
define void @main() {
%1 = alloca i32
%2 = call i32 (...) @fork()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %8
5: ; preds = %0
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%7 = call i32 @exit(i32 -1)
unreachable
8: ; preds = %0
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %13
11: ; preds = %8
%12 = call i32 (...) @ChildProcess()
br label %15
13: ; preds = %8
%14 = call i32 (...) @ParentProcess()
br label %15
15: ; preds = %13, %11
br label %16
16: ; preds = %15
ret void
}

LLVM IR (-O2):
@str = [13 x i8] c"Can't fork!!\00"
define void @main() {
%1 = tail call i32 (...) @fork()
switch i32 %1, label %7 [
i32 -1, label %2
i32 0, label %5
]
2: ; preds = %0
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @exit(i32 -1)
unreachable
5: ; preds = %0
%6 = tail call i32 (...) @ChildProcess()
br label %9
7: ; preds = %0
%8 = tail call i32 (...) @ParentProcess()
br label %9
9: ; preds = %5, %7
ret void
}
int hash(int key) { return key * 3; }


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

x86 assembly (clang, -O2):
<hash>:
lea    (%rdi,%rdi,2),%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i32 %0) {
%2 = mul nsw i32 %0, 3
ret i32 %2
}
/* Type definitions */
typedef scalar_t__ pthread_t;

/* Variables and functions */
int pthread_equal(pthread_t thread1, pthread_t thread2) {
  return thread1 == thread2;
}


x86 assembly (clang, -O0):
<pthread_equal>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_equal>:
xor    %eax,%eax
cmp    %rsi,%rdi
sete   %al
ret

LLVM IR (-O0):
define i32 @pthread_equal(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = icmp eq i64 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @pthread_equal(i64 %0, i64 %1) {
%3 = icmp eq i64 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
const char *lglversion(void) {
  return "al6"
         " "
         "080d45d6fb97d421810f76538507c7d08a2ea701";
}


x86 assembly (clang, -O0):
<lglversion>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lglversion>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [45 x i8] c"al6 080d45d6fb97d421810f76538507c7d08a2ea701\00"
define i8* @lglversion() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [45 x i8] c"al6 080d45d6fb97d421810f76538507c7d08a2ea701\00"
define i8* @lglversion() {
ret i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0)
}
int ecdh_hash_function_test_fail(unsigned char *output, const unsigned char *x,
                                 const unsigned char *y, void *data) {
  (void)output;
  (void)x;
  (void)y;
  (void)data;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @ecdh_hash_function_test_fail(i8* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2, i8* nocapture readnone %3) {
ret i32 0
}
void av_parse_color() {}


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

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

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

LLVM IR (-O2):
define void @av_parse_color() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ usleep(unsigned int);
void DelayCurrentThread(unsigned int millisec) { usleep(millisec * 1000); }


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

x86 assembly (clang, -O2):
<DelayCurrentThread>:
imul   $0x3e8,%edi,%edi
jmp    1030 <usleep@plt>

LLVM IR (-O0):
define void @DelayCurrentThread(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = mul i32 %3, 1000
%5 = call i32 @usleep(i32 %4)
ret void
}

LLVM IR (-O2):
define void @DelayCurrentThread(i32 %0) {
%2 = mul i32 %0, 1000
%3 = tail call i32 @usleep(i32 %2)
ret void
}
char getmetric(int i) {
  switch (i) {
  case 1:
    return 'u';
  case 2:
    return 'c';
  case 3:
    return 'x';
  case 4:
    return 'a';
  case 5:
    return 's';
  case 6:
    return 'k';
  case 7:
    return 'e';
  case 8:
    return 'b';
  default:
    return '\0';
  }
  return '\0';
}


x86 assembly (clang, -O0):
<getmetric>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x10(%rbp)
sub    $0x7,%eax
ja     1178 <getmetric+0x78>
mov    -0x10(%rbp),%rax
lea    0xed9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movb   $0x75,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x63,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x78,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x61,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x73,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x6b,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x65,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x62,-0x1(%rbp)
jmp    117c <getmetric+0x7c>
movb   $0x0,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getmetric>:
lea    -0x8(,%rdi,8),%ecx
mov    %edi,%edx
add    $0xffffffff,%edx
movabs $0x62656b7361786375,%rax
6b 65 62
shr    %cl,%rax
xor    %ecx,%ecx
cmp    $0x8,%edx
cmovae %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @getmetric(i32 %0) {
%2 = alloca i8
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %13 [
i32 1, label %5
i32 2, label %6
i32 3, label %7
i32 4, label %8
i32 5, label %9
i32 6, label %10
i32 7, label %11
i32 8, label %12
]
5: ; preds = %1
store i8 117, i8* %2
br label %14
6: ; preds = %1
store i8 99, i8* %2
br label %14
7: ; preds = %1
store i8 120, i8* %2
br label %14
8: ; preds = %1
store i8 97, i8* %2
br label %14
9: ; preds = %1
store i8 115, i8* %2
br label %14
10: ; preds = %1
store i8 107, i8* %2
br label %14
11: ; preds = %1
store i8 101, i8* %2
br label %14
12: ; preds = %1
store i8 98, i8* %2
br label %14
13: ; preds = %1
store i8 0, i8* %2
br label %14
14: ; preds = %13, %12, %11, %10, %9, %8, %7, %6, %5
%15 = load i8, i8* %2
ret i8 %15
}

LLVM IR (-O2):
define signext i8 @getmetric(i32 %0) {
%2 = add i32 %0, -1
%3 = icmp ult i32 %2, 8
%4 = zext i32 %2 to i64
%5 = shl nuw nsw i64 %4, 3
%6 = lshr i64 7090191331665404789, %5
%7 = trunc i64 %6 to i8
%8 = select i1 %3, i8 %7, i8 0
ret i8 %8
}
/* Type definitions */
typedef int /*<<< orphan*/ key_t;

/* Variables and functions */
int semget(int /*<<< orphan*/, int, int /*<<< orphan*/);
int semgrab(key_t key) { return semget(key, 1, 0); }


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

x86 assembly (clang, -O2):
<semgrab>:
mov    $0x1,%esi
xor    %edx,%edx
jmp    1030 <semget@plt>

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

LLVM IR (-O2):
define i32 @semgrab(i32 %0) {
%2 = tail call i32 @semget(i32 %0, i32 1, i32 0)
ret i32 %2
}
void stack_array_push(struct Stack *s, int x) {}


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

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

LLVM IR (-O0):
%struct.Stack = type opaque
define void @stack_array_push(%struct.Stack* %0, i32 %1) {
%3 = alloca %struct.Stack*
%4 = alloca i32
store %struct.Stack* %0, %struct.Stack** %3
store i32 %1, i32* %4
ret void
}

LLVM IR (-O2):
%struct.Stack = type opaque
define void @stack_array_push(%struct.Stack* nocapture %0, i32 %1) {
ret void
}
/* Type definitions */
typedef int uint64_t;
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
uint32_t getBucketCount(uint64_t size, int averageBucketSize) {
  return (uint32_t)((size + averageBucketSize - 1) / averageBucketSize);
}


x86 assembly (clang, -O0):
<getBucketCount>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
sub    $0x1,%eax
cltd
idivl  -0x8(%rbp)
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBucketCount>:
lea    (%rdi,%rsi,1),%eax
add    $0xffffffff,%eax
cltd
idiv   %esi
ret

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

LLVM IR (-O2):
define i32 @getBucketCount(i32 %0, i32 %1) {
%3 = add i32 %0, -1
%4 = add i32 %3, %1
%5 = sdiv i32 %4, %1
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ fileno(int /*<<< orphan*/);
int foo(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
bar() {
  int a;
  a = foo(fileno(stdout));
  return (a);
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2eb1(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
mov    %eax,%edi
call   1040 <foo@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bar>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
call   1030 <fileno@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <foo@plt>

LLVM IR (-O0):
@stdout = global i32 0
define i32 @bar() {
%1 = alloca i32
%2 = load i32, i32* @stdout
%3 = call i32 @fileno(i32 %2)
%4 = call i32 @foo(i32 %3)
store i32 %4, i32* %1
%5 = load i32, i32* %1
ret i32 %5
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @bar() {
%1 = load i32, i32* @stdout
%2 = tail call i32 @fileno(i32 %1)
%3 = tail call i32 @foo(i32 %2)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void AT91F_FetchAbort() {
  puts("IFA");
  while (1)
    ;
}


x86 assembly (clang, -O0):
<AT91F_FetchAbort>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
call   1030 <puts@plt>
jmp    1120 <AT91F_FetchAbort+0x10>

x86 assembly (clang, -O2):
<AT91F_FetchAbort>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
nopl   (%rax)
jmp    1120 <AT91F_FetchAbort+0x10>

LLVM IR (-O0):
@.str = [4 x i8] c"IFA\00"
define void @AT91F_FetchAbort() {
%1 = call i32 @puts(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}

LLVM IR (-O2):
@.str = [4 x i8] c"IFA\00"
define void @AT91F_FetchAbort() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
br label %2
2: ; preds = %0, %2
br label %2
}
void release_session_handler() {}


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

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

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

LLVM IR (-O2):
define void @release_session_handler() {
ret void
}
/* Variables and functions */
void *calloc(size_t, size_t);
void *mem_calloc(size_t nmemb, size_t size, char *block) {
  return calloc(nmemb, size);
}


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

x86 assembly (clang, -O2):
<mem_calloc>:
jmp    1030 <calloc@plt>

LLVM IR (-O0):
define i8* @mem_calloc(i64 %0, i64 %1, i8* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i8*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %4
%8 = load i64, i64* %5
%9 = call i8* @calloc(i64 %7, i64 %8)
ret i8* %9
}

LLVM IR (-O2):
define noalias i8* @mem_calloc(i64 %0, i64 %1, i8* nocapture readnone %2) {
%4 = tail call i8* @calloc(i64 %0, i64 %1)
ret i8* %4
}
int sys_times(void *buf) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @sys_times(i8* nocapture readnone %0) {
ret i32 -1
}
/* Type definitions */
typedef void siginfo_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void handler(int sig, siginfo_t *si, void *uc) {
  if ((si == NULL) || (si != uc)) {
    printf("Caught signal %d\n", sig);
  }
}


x86 assembly (clang, -O0):
<handler>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <handler+0x2c>
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
je     114b <handler+0x3b>
mov    -0x4(%rbp),%esi
lea    0xeba(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<handler>:
mov    %edi,%eax
test   %rsi,%rsi
je     111d <handler+0xd>
cmp    %rdx,%rsi
jne    111d <handler+0xd>
ret
lea    0xedc(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @handler(i32 %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
store i32 %0, i32* %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = icmp eq i8* %7, null
br i1 %8, label %13, label %9
9: ; preds = %3
%10 = load i8*, i8** %5
%11 = load i8*, i8** %6
%12 = icmp ne i8* %10, %11
br i1 %12, label %13, label %16
13: ; preds = %9, %3
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %14)
br label %16
16: ; preds = %13, %9
ret void
}

LLVM IR (-O2):
@.str = [18 x i8] c"Caught signal %d\0A\00"
define void @handler(i32 %0, i8* readnone %1, i8* readnone %2) {
%4 = icmp ne i8* %1, null
%5 = icmp eq i8* %1, %2
%6 = and i1 %4, %5
br i1 %6, label %9, label %7
7: ; preds = %3
%8 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %0)
br label %9
9: ; preds = %3, %7
ret void
}
int d_eq_cr2(double a1) { return !(((100) == (a1))); }


x86 assembly (clang, -O0):
<d_eq_cr2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xeef(%rip),%xmm0
ucomisd -0x8(%rbp),%xmm0
sete   %al
setnp  %cl
and    %cl,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<d_eq_cr2>:
cmpneqsd 0xef7(%rip),%xmm0
movq   %xmm0,%rax
and    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @d_eq_cr2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp oeq double 1.000000e+02, %3
%5 = xor i1 %4, true
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @d_eq_cr2(double %0) {
%2 = fcmp une double %0, 1.000000e+02
%3 = zext i1 %2 to i32
ret i32 %3
}
float av_clipf_sse(float a, float amin, float amax) {
  __asm__("minss %2, %0 \n\t"
          "maxss %1, %0 \n\t"
          : "+&x"(a)
          : "xm"(amin), "xm"(amax));
  return a;
}


x86 assembly (clang, -O0):
<av_clipf_sse>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
movss  %xmm2,-0x10(%rbp)
movss  %xmm1,-0x14(%rbp)
minss  -0x14(%rbp),%xmm0
maxss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<av_clipf_sse>:
movss  %xmm2,-0x8(%rsp)
movss  %xmm1,-0x4(%rsp)
minss  -0x8(%rsp),%xmm0
maxss  -0x4(%rsp),%xmm0
ret

LLVM IR (-O0):
define float @av_clipf_sse(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %4
%8 = load float, float* %5
%9 = load float, float* %6
%10 = call float asm "minss $2, $0 \0A\09maxss $1, $0 \0A\09", "=&x,xm,xm,0,~{dirflag},~{fpsr},~{flags}"(float %8, float %9, float %7)
store float %10, float* %4
%11 = load float, float* %4
ret float %11
}

LLVM IR (-O2):
define float @av_clipf_sse(float %0, float %1, float %2) {
%4 = tail call float asm "minss $2, $0 \0A\09maxss $1, $0 \0A\09", "=&x,xm,xm,0,~{dirflag},~{fpsr},~{flags}"(float %1, float %2, float %0)
ret float %4
}
/* Type definitions */
typedef int int32_t;

/* Variables and functions */
int getBit8x(int32_t *pInt32, int index) {
  return (*pInt32 >> (index * 8)) & (0xff >> 32);
}


x86 assembly (clang, -O0):
<getBit8x>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0xc(%rbp),%ecx
shl    $0x3,%ecx
sar    %cl,%eax
and    %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @getBit8x(i32* %0, i32 %1) {
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
store i32 %1, i32* %4
%5 = load i32*, i32** %3
%6 = load i32, i32* %5
%7 = load i32, i32* %4
%8 = mul nsw i32 %7, 8
%9 = ashr i32 %6, %8
%10 = and i32 %9, poison
ret i32 %10
}

LLVM IR (-O2):
define i32 @getBit8x(i32* nocapture readnone %0, i32 %1) {
ret i32 poison
}
void SPI_ScbEnableIntr(void) {}


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

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

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

LLVM IR (-O2):
define void @SPI_ScbEnableIntr() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int show_args(char *argv[]) {
  printf("\nconvtxt: Convert ASCII file to ATASCII.\n");
  printf("usage: %s FILE1.ASC FILE.ATA\n\n", argv[0]);
  return 1;
}


x86 assembly (clang, -O0):
<show_args>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rsi
lea    0xef2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<show_args>:
push   %rbx
mov    %rdi,%rbx
lea    0xef4(%rip),%rdi
call   1030 <puts@plt>
mov    (%rbx),%rsi
lea    0xec6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [42 x i8] c"\0Aconvtxt: Convert ASCII file to ATASCII.\0A\00"
@.str.1 = [31 x i8] c"usage: %s FILE1.ASC FILE.ATA\0A\0A\00"
define i32 @show_args(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
%4 = load i8**, i8*** %2
%5 = getelementptr inbounds i8*, i8** %4, i64 0
%6 = load i8*, i8** %5
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %6)
ret i32 1
}

LLVM IR (-O2):
@.str.1 = [31 x i8] c"usage: %s FILE1.ASC FILE.ATA\0A\0A\00"
@str = [41 x i8] c"\0Aconvtxt: Convert ASCII file to ATASCII.\00"
define i32 @show_args(i8** nocapture %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str, i64 0, i64 0))
%3 = load i8*, i8** %0
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.1, i64 0, i64 0), i8* %3)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ tpcs_frame();
int main(void) {
  tpcs_frame();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @tpcs_frame()
ret i32 0
}
void av_bsf_list_free() {}


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

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

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

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


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

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

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

LLVM IR (-O2):
define void @local_output_SendOsc_targetInit__I() {
ret void
}
/* Type definitions */
struct timeval {
  int tv_usec;
  int tv_sec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
int /*<<< orphan*/ srand(int);
void random_init(void) {
  struct timeval t1;
  gettimeofday(&t1, NULL);
  srand(t1.tv_usec * t1.tv_sec);
}


x86 assembly (clang, -O0):
<random_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
mov    -0x8(%rbp),%edi
imul   -0x4(%rbp),%edi
call   1040 <srand@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_init>:
push   %rax
mov    %rsp,%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
mov    0x4(%rsp),%edi
imul   (%rsp),%edi
pop    %rax
jmp    1040 <srand@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i32 }
define void @random_init() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%6 = load i32, i32* %5
%7 = mul nsw i32 %4, %6
%8 = call i32 @srand(i32 %7)
ret void
}

LLVM IR (-O2):
%struct.timeval = type { i32, i32 }
define void @random_init() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, %5
%9 = tail call i32 @srand(i32 %8)
ret void
}
int compareCHAR(const void *current, const void *candidate) {
  return ((*(char *)current < *(char *)candidate
               ? -1
               : (*(char *)current > *(char *)candidate ? 1 : 0)));
}


x86 assembly (clang, -O0):
<compareCHAR>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jge    112f <compareCHAR+0x2f>
mov    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <compareCHAR+0x4c>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edx
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
xor    %eax,%eax
mov    $0x1,%ecx
cmp    %esi,%edx
cmovg  %ecx,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compareCHAR>:
mov    (%rdi),%al
xor    %ecx,%ecx
cmp    (%rsi),%al
setg   %cl
mov    $0xffffffff,%eax
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compareCHAR(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 = sext i8 %6 to i32
%8 = load i8*, i8** %4
%9 = load i8, i8* %8
%10 = sext i8 %9 to i32
%11 = icmp slt i32 %7, %10
br i1 %11, label %12, label %13
12: ; preds = %2
br label %23
13: ; preds = %2
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = load i8*, i8** %4
%18 = load i8, i8* %17
%19 = sext i8 %18 to i32
%20 = icmp sgt i32 %16, %19
%21 = zext i1 %20 to i64
%22 = select i1 %20, i32 1, i32 0
br label %23
23: ; preds = %13, %12
%24 = phi i32 [ -1, %12 ], [ %22, %13 ]
ret i32 %24
}

LLVM IR (-O2):
define i32 @compareCHAR(i8* nocapture %0, i8* nocapture %1) {
%3 = load i8, i8* %0
%4 = load i8, i8* %1
%5 = icmp slt i8 %3, %4
%6 = icmp sgt i8 %3, %4
%7 = zext i1 %6 to i32
%8 = select i1 %5, i32 -1, i32 %7
ret i32 %8
}