xunge/DecIR huggingface dataset:
void transfer_YUV_PLANAR_to_YUV888(unsigned char *(*output),
                                   unsigned char *input_y,
                                   unsigned char *input_u,
                                   unsigned char *input_v) {
  (*output)[0] = *input_y;
  (*output)[1] = *input_u;
  (*output)[2] = *input_v;
  (*output) += 3;
}


x86 assembly (clang, -O0):
<transfer_YUV_PLANAR_to_YUV888>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,(%rax)
mov    -0x18(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x1(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    %cl,0x2(%rax)
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x3,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<transfer_YUV_PLANAR_to_YUV888>:
mov    (%rsi),%al
mov    (%rdi),%rsi
mov    %al,(%rsi)
mov    (%rdx),%al
mov    (%rdi),%rdx
mov    %al,0x1(%rdx)
mov    (%rcx),%al
mov    (%rdi),%rcx
mov    %al,0x2(%rcx)
addq   $0x3,(%rdi)
ret

LLVM IR (-O0):
define void @transfer_YUV_PLANAR_to_YUV888(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** %6
%10 = load i8, i8* %9
%11 = load i8**, i8*** %5
%12 = load i8*, i8** %11
%13 = getelementptr inbounds i8, i8* %12, i64 0
store i8 %10, i8* %13
%14 = load i8*, i8** %7
%15 = load i8, i8* %14
%16 = load i8**, i8*** %5
%17 = load i8*, i8** %16
%18 = getelementptr inbounds i8, i8* %17, i64 1
store i8 %15, i8* %18
%19 = load i8*, i8** %8
%20 = load i8, i8* %19
%21 = load i8**, i8*** %5
%22 = load i8*, i8** %21
%23 = getelementptr inbounds i8, i8* %22, i64 2
store i8 %20, i8* %23
%24 = load i8**, i8*** %5
%25 = load i8*, i8** %24
%26 = getelementptr inbounds i8, i8* %25, i64 3
store i8* %26, i8** %24
ret void
}

LLVM IR (-O2):
define void @transfer_YUV_PLANAR_to_YUV888(i8** nocapture %0, i8* nocapture %1, i8* nocapture %2, i8* nocapture %3) {
%5 = load i8, i8* %1
%6 = load i8*, i8** %0
store i8 %5, i8* %6
%7 = load i8, i8* %2
%8 = load i8*, i8** %0
%9 = getelementptr inbounds i8, i8* %8, i64 1
store i8 %7, i8* %9
%10 = load i8, i8* %3
%11 = load i8*, i8** %0
%12 = getelementptr inbounds i8, i8* %11, i64 2
store i8 %10, i8* %12
%13 = load i8*, i8** %0
%14 = getelementptr inbounds i8, i8* %13, i64 3
store i8* %14, i8** %0
ret void
}
/* Type definitions */
struct iw_csdescr {
  int dummy;
};

/* Variables and functions */
scalar_t__ linear_to_x_sample(double, struct iw_csdescr const *);
double iw_convert_sample_from_linear(double v,
                                     const struct iw_csdescr *csdescr) {
  return (double)linear_to_x_sample(v, csdescr);
}


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

x86 assembly (clang, -O2):
<iw_convert_sample_from_linear>:
push   %rax
call   1030 <linear_to_x_sample@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
%struct.iw_csdescr = type { i32 }
define double @iw_convert_sample_from_linear(double %0, %struct.iw_csdescr* %1) {
%3 = alloca double
%4 = alloca %struct.iw_csdescr*
store double %0, double* %3
store %struct.iw_csdescr* %1, %struct.iw_csdescr** %4
%5 = load double, double* %3
%6 = load %struct.iw_csdescr*, %struct.iw_csdescr** %4
%7 = call i64 @linear_to_x_sample(double %5, %struct.iw_csdescr* %6)
%8 = sitofp i64 %7 to double
ret double %8
}

LLVM IR (-O2):
%struct.iw_csdescr = type { i32 }
define double @iw_convert_sample_from_linear(double %0, %struct.iw_csdescr* %1) {
%3 = tail call i64 @linear_to_x_sample(double %0, %struct.iw_csdescr* %1)
%4 = sitofp i64 %3 to double
ret double %4
}
busca_sequencial(int v[], int n, int chave) {
  for (int i = 0; i < n; i++)
    if (v[i] == chave)
      return i;
  return -1;
}


x86 assembly (clang, -O0):
<busca_sequencial>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %edx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1153 <busca_sequencial+0x53>
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x18(%rbp),%eax
jne    1140 <busca_sequencial+0x40>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115a <busca_sequencial+0x5a>
jmp    1145 <busca_sequencial+0x45>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1115 <busca_sequencial+0x15>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<busca_sequencial>:
mov    $0xffffffff,%eax
test   %esi,%esi
jle    111e <busca_sequencial+0x1e>
mov    %esi,%esi
xor    %ecx,%ecx
nopl   (%rax)
cmp    %edx,(%rdi,%rcx,4)
je     111f <busca_sequencial+0x1f>
add    $0x1,%rcx
cmp    %rcx,%rsi
jne    1110 <busca_sequencial+0x10>
ret
mov    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @busca_sequencial(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %17
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %12
%8 = phi i64 [ 0, %5 ], [ %13, %12 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %15, label %12
12: ; preds = %7
%13 = add nuw nsw i64 %8, 1
%14 = icmp eq i64 %13, %6
br i1 %14, label %17, label %7
15: ; preds = %7
%16 = trunc i64 %8 to i32
br label %17
17: ; preds = %12, %15, %3
%18 = phi i32 [ -1, %3 ], [ %16, %15 ], [ -1, %12 ]
ret i32 %18
}
void outer_disable(void) {}


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

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

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

LLVM IR (-O2):
define void @outer_disable() {
ret void
}
/* Variables and functions */
int convert_roman_to_decimal(char *, int);
int /*<<< orphan*/ printf(char *, char *, int);
int main() {
  char *roman = "MDCLXXIV";
  int decimal = convert_roman_to_decimal(roman, 7);
  printf("%s = %d\n", roman, decimal);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x7,%esi
call   1040 <convert_roman_to_decimal@plt>
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x7,%esi
call   1040 <convert_roman_to_decimal@plt>
lea    0xecd(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [9 x i8] c"MDCLXXIV\00"
@.str.1 = [9 x i8] c"%s = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @convert_roman_to_decimal(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 7)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
void main_start(char counter) {
  unsigned long *__mspsim_main_mem = (unsigned long *)0x81000;
  *__mspsim_main_mem = counter;
}


x86 assembly (clang, -O0):
<main_start>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    $0x81000,%eax
mov    %rax,-0x10(%rbp)
movsbq -0x1(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<main_start>:
movslq %edi,%rax
mov    %rax,0x81000
ret

LLVM IR (-O0):
define void @main_start(i8 signext %0) {
%2 = alloca i8
%3 = alloca i64*
store i8 %0, i8* %2
store i64* inttoptr (i64 528384 to i64*), i64** %3
%4 = load i8, i8* %2
%5 = sext i8 %4 to i64
%6 = load i64*, i64** %3
store i64 %5, i64* %6
ret void
}

LLVM IR (-O2):
define void @main_start(i8 signext %0) {
%2 = sext i8 %0 to i64
store i64 %2, i64* inttoptr (i64 528384 to i64*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GPIO_LedInit();
int /*<<< orphan*/ LedTest();
char getchar();
int /*<<< orphan*/ init_uart();
int /*<<< orphan*/ putchar(char);
int main() {
  char c;
  GPIO_LedInit();
  init_uart();
  while (1) {
    LedTest();
    c = getchar();
    putchar(c + 1);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <GPIO_LedInit@plt>
mov    $0x0,%al
call   1070 <init_uart@plt>
mov    $0x0,%al
call   1060 <LedTest@plt>
mov    $0x0,%al
call   1050 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
movsbl %al,%edi
call   1040 <putchar@plt>
jmp    116d <main+0x1d>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <GPIO_LedInit@plt>
xor    %eax,%eax
call   1070 <init_uart@plt>
nop
xor    %eax,%eax
call   1060 <LedTest@plt>
xor    %eax,%eax
call   1050 <getchar@plt>
add    $0x1,%al
movsbl %al,%edi
call   1040 <putchar@plt>
jmp    1160 <main+0x10>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (...) @GPIO_LedInit()
%4 = call i32 (...) @init_uart()
br label %5
5: ; preds = %0, %5
%6 = call i32 (...) @LedTest()
%7 = call signext i8 (...) @getchar()
store i8 %7, i8* %2
%8 = load i8, i8* %2
%9 = sext i8 %8 to i32
%10 = add nsw i32 %9, 1
%11 = trunc i32 %10 to i8
%12 = call i32 @putchar(i8 signext %11)
br label %5
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @GPIO_LedInit()
%2 = tail call i32 (...) @init_uart()
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @LedTest()
%5 = tail call signext i8 (...) @getchar()
%6 = add i8 %5, 1
%7 = tail call i32 @putchar(i8 signext %6)
br label %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void f2(void) { printf("in f2()\n"); }


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

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

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

LLVM IR (-O2):
@str = [8 x i8] c"in f2()\00"
define void @f2() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str, i64 0, i64 0))
ret void
}
/* Type definitions */
struct evp_test {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ EVP_PKEY_verify_recover;
int /*<<< orphan*/ EVP_PKEY_verify_recover_init;
int pkey_test_init(struct evp_test *, char const *, int, int /*<<< orphan*/,
                   int /*<<< orphan*/);
int verify_recover_test_init(struct evp_test *t, const char *name) {
  return pkey_test_init(t, name, 1, EVP_PKEY_verify_recover_init,
                        EVP_PKEY_verify_recover);
}


x86 assembly (clang, -O0):
<verify_recover_test_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    0x2ec1(%rip),%rax
mov    (%rax),%ecx
mov    0x2ea0(%rip),%rax
mov    (%rax),%r8d
mov    $0x1,%edx
call   1030 <pkey_test_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_recover_test_init>:
mov    0x2ed9(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb8(%rip),%rax
mov    (%rax),%r8d
mov    $0x1,%edx
jmp    1030 <pkey_test_init@plt>

LLVM IR (-O0):
%struct.evp_test = type { i32 }
@EVP_PKEY_verify_recover_init = global i32 0
@EVP_PKEY_verify_recover = global i32 0
define i32 @verify_recover_test_init(%struct.evp_test* %0, i8* %1) {
%3 = alloca %struct.evp_test*
%4 = alloca i8*
store %struct.evp_test* %0, %struct.evp_test** %3
store i8* %1, i8** %4
%5 = load %struct.evp_test*, %struct.evp_test** %3
%6 = load i8*, i8** %4
%7 = load i32, i32* @EVP_PKEY_verify_recover_init
%8 = load i32, i32* @EVP_PKEY_verify_recover
%9 = call i32 @pkey_test_init(%struct.evp_test* %5, i8* %6, i32 1, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.evp_test = type { i32 }
@EVP_PKEY_verify_recover_init = global i32 0
@EVP_PKEY_verify_recover = global i32 0
define i32 @verify_recover_test_init(%struct.evp_test* %0, i8* %1) {
%3 = load i32, i32* @EVP_PKEY_verify_recover_init
%4 = load i32, i32* @EVP_PKEY_verify_recover
%5 = tail call i32 @pkey_test_init(%struct.evp_test* %0, i8* %1, i32 1, i32 %3, i32 %4)
ret i32 %5
}
double pathcon_nm5_sign(double x) { return x < 0 ? -1 : x > 0 ? 1 : x; }


x86 assembly (clang, -O0):
<pathcon_nm5_sign>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    1129 <pathcon_nm5_sign+0x29>
movsd  0xee9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    1161 <pathcon_nm5_sign+0x61>
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    114d <pathcon_nm5_sign+0x4d>
movsd  0xebd(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    1157 <pathcon_nm5_sign+0x57>
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<pathcon_nm5_sign>:
xorpd  %xmm1,%xmm1
xorpd  %xmm2,%xmm2
cmpltsd %xmm0,%xmm2
movsd  0xeeb(%rip),%xmm3
andpd  %xmm2,%xmm3
andnpd %xmm0,%xmm2
orpd   %xmm3,%xmm2
cmpltsd %xmm1,%xmm0
movapd %xmm0,%xmm1
andnpd %xmm2,%xmm1
movsd  0xed2(%rip),%xmm2
andpd  %xmm2,%xmm0
orpd   %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @pathcon_nm5_sign(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fcmp olt double %3, 0.000000e+00
br i1 %4, label %5, label %6
5: ; preds = %1
br label %14
6: ; preds = %1
%7 = load double, double* %2
%8 = fcmp ogt double %7, 0.000000e+00
br i1 %8, label %9, label %10
9: ; preds = %6
br label %12
10: ; preds = %6
%11 = load double, double* %2
br label %12
12: ; preds = %10, %9
%13 = phi double [ 1.000000e+00, %9 ], [ %11, %10 ]
br label %14
14: ; preds = %12, %5
%15 = phi double [ -1.000000e+00, %5 ], [ %13, %12 ]
ret double %15
}

LLVM IR (-O2):
define double @pathcon_nm5_sign(double %0) {
%2 = fcmp olt double %0, 0.000000e+00
%3 = fcmp ogt double %0, 0.000000e+00
%4 = select i1 %3, double 1.000000e+00, double %0
%5 = select i1 %2, double -1.000000e+00, double %4
ret double %5
}
/* Variables and functions */
int scsi_request(char *, int /*<<< orphan*/, int /*<<< orphan*/, int,
                 int /*<<< orphan*/, int, int, int /*<<< orphan*/,
                 int /*<<< orphan*/, int /*<<< orphan*/, int,
                 int /*<<< orphan*/);
int start_stop(int start) {
  return scsi_request((start ? "start_unit" : "stop_unit"), 0, 0, 6, 0, 0x02,
                      0x1B, 0, 0, 0, (start ? 1 : 0), 0);
}


x86 assembly (clang, -O0):
<start_stop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
lea    0xee6(%rip),%rdi
lea    0xed4(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdi
mov    -0x4(%rbp),%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
xor    %r8d,%r8d
mov    $0x6,%ecx
mov    $0x2,%r9d
mov    %r8d,%esi
mov    %r8d,%edx
movl   $0x1b,(%rsp)
movl   $0x0,0x8(%rsp)
movl   $0x0,0x10(%rsp)
movl   $0x0,0x18(%rsp)
mov    %eax,0x20(%rsp)
movl   $0x0,0x28(%rsp)
call   1030 <scsi_request@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<start_stop>:
push   %rax
xor    %eax,%eax
test   %edi,%edi
setne  %al
lea    0xeec(%rip),%rcx
lea    0xeda(%rip),%rdi
cmove  %rcx,%rdi
xor    %esi,%esi
xor    %edx,%edx
mov    $0x6,%ecx
xor    %r8d,%r8d
mov    $0x2,%r9d
push   $0x0
push   %rax
push   $0x0
push   $0x0
push   $0x0
push   $0x1b
call   1030 <scsi_request@plt>
add    $0x30,%rsp
pop    %rcx
ret

LLVM IR (-O0):
@.str = [11 x i8] c"start_unit\00"
@.str.1 = [10 x i8] c"stop_unit\00"
define i32 @start_stop(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i64
%6 = select i1 %4, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0)
%7 = load i32, i32* %2
%8 = icmp ne i32 %7, 0
%9 = zext i1 %8 to i64
%10 = select i1 %8, i32 1, i32 0
%11 = call i32 @scsi_request(i8* %6, i32 0, i32 0, i32 6, i32 0, i32 2, i32 27, i32 0, i32 0, i32 0, i32 %10, i32 0)
ret i32 %11
}

LLVM IR (-O2):
@.str = [11 x i8] c"start_unit\00"
@.str.1 = [10 x i8] c"stop_unit\00"
define i32 @start_stop(i32 %0) {
%2 = icmp eq i32 %0, 0
%3 = select i1 %2, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0)
%4 = xor i1 %2, true
%5 = zext i1 %4 to i32
%6 = tail call i32 @scsi_request(i8* %3, i32 0, i32 0, i32 6, i32 0, i32 2, i32 27, i32 0, i32 0, i32 0, i32 %5, i32 0)
ret i32 %6
}
int f1(int si1, int si2) { return si2 == 0 ? si1 : si1 / si2; }


x86 assembly (clang, -O0):
<f1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    111f <f1+0x1f>
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    1129 <f1+0x29>
mov    -0x4(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f1>:
mov    %edi,%eax
test   %esi,%esi
je     1109 <f1+0x9>
cltd
idiv   %esi
ret

LLVM IR (-O0):
define i32 @f1(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %2
%8 = load i32, i32* %3
br label %13
9: ; preds = %2
%10 = load i32, i32* %3
%11 = load i32, i32* %4
%12 = sdiv i32 %10, %11
br label %13
13: ; preds = %9, %7
%14 = phi i32 [ %8, %7 ], [ %12, %9 ]
ret i32 %14
}

LLVM IR (-O2):
define i32 @f1(i32 %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %6, label %4
4: ; preds = %2
%5 = sdiv i32 %0, %1
br label %6
6: ; preds = %2, %4
%7 = phi i32 [ %5, %4 ], [ %0, %2 ]
ret i32 %7
}
void vrcvi_dummy(void) {}


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

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

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

LLVM IR (-O2):
define void @vrcvi_dummy() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _eval(int /*<<< orphan*/);
int /*<<< orphan*/ getc;
void interpreter() { _eval(getc); }


x86 assembly (clang, -O0):
<interpreter>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <_eval@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<interpreter>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <_eval@plt>

LLVM IR (-O0):
@getc = global i32 0
define void @interpreter() {
%1 = load i32, i32* @getc
%2 = call i32 @_eval(i32 %1)
ret void
}

LLVM IR (-O2):
@getc = global i32 0
define void @interpreter() {
%1 = load i32, i32* @getc
%2 = tail call i32 @_eval(i32 %1)
ret void
}
/* Variables and functions */
int test_simple_sampler(char *, int /*<<< orphan*/);
int test_never_sampler() { return test_simple_sampler("never", 0); }


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

x86 assembly (clang, -O2):
<test_never_sampler>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
jmp    1030 <test_simple_sampler@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"never\00"
define i32 @test_never_sampler() {
%1 = call i32 @test_simple_sampler(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %1
}

LLVM IR (-O2):
@.str = [6 x i8] c"never\00"
define i32 @test_never_sampler() {
%1 = tail call i32 @test_simple_sampler(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 0)
ret i32 %1
}
void fpstack_test(const char *test_name) {}


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

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

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

LLVM IR (-O2):
define void @fpstack_test(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ pd_init_systems();
void pd_init(void) {
  static int initted = 0;
  if (initted)
    return;
  initted = 1;
  pd_init_systems();
}


x86 assembly (clang, -O0):
<pd_init>:
push   %rbp
mov    %rsp,%rbp
cmpl   $0x0,0x2f11(%rip)
je     1126 <pd_init+0x16>
jmp    1137 <pd_init+0x27>
movl   $0x1,0x2efc(%rip)
mov    $0x0,%al
call   1030 <pd_init_systems@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_init>:
cmpb   $0x0,0x2f15(%rip)
je     111a <pd_init+0xa>
ret
movb   $0x1,0x2f0b(%rip)
xor    %eax,%eax
jmp    1030 <pd_init_systems@plt>

LLVM IR (-O0):
@pd_init.initted = internal global i32 0
define void @pd_init() {
%1 = load i32, i32* @pd_init.initted
%2 = icmp ne i32 %1, 0
br i1 %2, label %3, label %4
3: ; preds = %0
br label %6
4: ; preds = %0
store i32 1, i32* @pd_init.initted
%5 = call i32 (...) @pd_init_systems()
br label %6
6: ; preds = %4, %3
ret void
}

LLVM IR (-O2):
@pd_init.initted = internal unnamed_addr global i1 false
define void @pd_init() {
%1 = load i1, i1* @pd_init.initted
br i1 %1, label %4, label %2
2: ; preds = %0
store i1 true, i1* @pd_init.initted
%3 = tail call i32 (...) @pd_init_systems()
br label %4
4: ; preds = %0, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isgraph(int);
void t_isgraph_0x89() {
  Assert_real((isgraph(137) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isgraph.c",
              690, ("isgraph should be 0 for 0x89"));
}


x86 assembly (clang, -O0):
<t_isgraph_0x89>:
push   %rbp
mov    %rsp,%rbp
mov    $0x89,%edi
call   1040 <isgraph@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x2b2,%edx
lea    0xf5b(%rip),%rcx
call   1030 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isgraph_0x89>:
push   %rax
mov    $0x89,%edi
call   1040 <isgraph@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x2b2,%edx
pop    %rax
jmp    1030 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x89\00"
define void @t_isgraph_0x89() {
%1 = call i64 @isgraph(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isgraph.c\00"
@.str.1 = [29 x i8] c"isgraph should be 0 for 0x89\00"
define void @t_isgraph_0x89() {
%1 = tail call i64 @isgraph(i32 137)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 690, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("Hello World\r\n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World\0D\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [13 x i8] c"Hello World\0D\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_and_set_bit(long nr, volatile unsigned long *addr) {
  int oldbit;
  asm("bts %2,%1\n\t"
      "sbb %0,%0"
      : "=r"(oldbit), "+m"(*(volatile long *)(addr))
      : "Ir"(nr));
  return oldbit;
}


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

x86 assembly (clang, -O2):
<test_and_set_bit>:
bts    %rdi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @test_and_set_bit(i64 %0, i64* %1) {
%3 = alloca i64
%4 = alloca i64*
%5 = alloca i32
store i64 %0, i64* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i64, i64* %3
%8 = call i32 asm "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i64 %7, i64* elementtype(i64) %6)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @test_and_set_bit(i64 %0, i64* %1) {
%3 = tail call i32 asm "bts $2,$1\0A\09sbb $0,$0", "=r,=*m,Ir,*m,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i64 %0, i64* elementtype(i64) %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;

/* Variables and functions */
time_t time(time_t *t) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @time(i32* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int sr_sem_timedwait(int, int /*<<< orphan*/, int);
int sr_sem_timedwait_zero(int semid, int timeout) {
  return sr_sem_timedwait(semid, 0, timeout);
}


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

x86 assembly (clang, -O2):
<sr_sem_timedwait_zero>:
mov    %esi,%edx
xor    %esi,%esi
jmp    1030 <sr_sem_timedwait@plt>

LLVM IR (-O0):
define i32 @sr_sem_timedwait_zero(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 = call i32 @sr_sem_timedwait(i32 %5, i32 0, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @sr_sem_timedwait_zero(i32 %0, i32 %1) {
%3 = tail call i32 @sr_sem_timedwait(i32 %0, i32 0, i32 %1)
ret i32 %3
}
/* Variables and functions */
int f(int, int);
main() { return f(3, 2); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3,%edi
mov    $0x2,%esi
call   1030 <f@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
mov    $0x3,%edi
mov    $0x2,%esi
jmp    1030 <f@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @f(i32 3, i32 2)
ret i32 %1
}
void *uDMAControlAlternateBaseGet(void) {
  return ((void *)(*((volatile unsigned long *)(0x400FF00C))));
}


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

x86 assembly (clang, -O2):
<uDMAControlAlternateBaseGet>:
mov    0x400ff00c,%rax
40
ret

LLVM IR (-O0):
define i8* @uDMAControlAlternateBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786316 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}

LLVM IR (-O2):
define i8* @uDMAControlAlternateBaseGet() {
%1 = load volatile i64, i64* inttoptr (i64 1074786316 to i64*)
%2 = inttoptr i64 %1 to i8*
ret i8* %2
}
/* Variables and functions */
scalar_t__ isgreater(double, double);
double fdim(double x, double y) { return (isgreater(x, y) ? (x - y) : 0.0); }


x86 assembly (clang, -O0):
<fdim>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
call   1030 <isgreater@plt>
cmp    $0x0,%rax
je     114f <fdim+0x3f>
movsd  -0x8(%rbp),%xmm0
subsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    115c <fdim+0x4c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
jmp    115c <fdim+0x4c>
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fdim>:
sub    $0x18,%rsp
movsd  %xmm0,0x8(%rsp)
movsd  %xmm1,0x10(%rsp)
call   1030 <isgreater@plt>
xorpd  %xmm0,%xmm0
test   %rax,%rax
je     113a <fdim+0x2a>
movsd  0x8(%rsp),%xmm0
subsd  0x10(%rsp),%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
define double @fdim(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = call i64 @isgreater(double %5, double %6)
%8 = icmp ne i64 %7, 0
br i1 %8, label %9, label %13
9: ; preds = %2
%10 = load double, double* %3
%11 = load double, double* %4
%12 = fsub double %10, %11
br label %14
13: ; preds = %2
br label %14
14: ; preds = %13, %9
%15 = phi double [ %12, %9 ], [ 0.000000e+00, %13 ]
ret double %15
}

LLVM IR (-O2):
define double @fdim(double %0, double %1) {
%3 = tail call i64 @isgreater(double %0, double %1)
%4 = icmp eq i64 %3, 0
%5 = fsub double %0, %1
%6 = select i1 %4, double 0.000000e+00, double %5
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ _IO(unsigned char, int);
long ioctl(int, int /*<<< orphan*/);
long reset_replay_ndx(int fd_spec) { return ioctl(fd_spec, _IO('u', 14)); }


x86 assembly (clang, -O0):
<reset_replay_ndx>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x75,%edi
mov    $0xe,%esi
call   1030 <_IO@plt>
mov    -0x8(%rbp),%edi
mov    %eax,%esi
call   1040 <ioctl@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<reset_replay_ndx>:
push   %rbx
mov    %edi,%ebx
mov    $0x75,%edi
mov    $0xe,%esi
call   1030 <_IO@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1040 <ioctl@plt>

LLVM IR (-O0):
define i64 @reset_replay_ndx(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @_IO(i8 zeroext 117, i32 14)
%5 = call i64 @ioctl(i32 %3, i32 %4)
ret i64 %5
}

LLVM IR (-O2):
define i64 @reset_replay_ndx(i32 %0) {
%2 = tail call i32 @_IO(i8 zeroext 117, i32 14)
%3 = tail call i64 @ioctl(i32 %0, i32 %2)
ret i64 %3
}
/* Variables and functions */
double fabs(double);
double Section1(double x1, double y1, double z1, double x2, double y2,
                double z2) {
  return fabs(x2 - x1) + fabs(y2 - y1) + fabs(z2 - z1);
}


x86 assembly (clang, -O0):
<Section1>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  %xmm3,-0x20(%rbp)
movsd  %xmm4,-0x28(%rbp)
movsd  %xmm5,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
movaps 0xecd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x28(%rbp),%xmm1
subsd  -0x10(%rbp),%xmm1
movaps 0xeb8(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  -0x30(%rbp),%xmm1
subsd  -0x18(%rbp),%xmm1
movaps 0xe9f(%rip),%xmm2
pand   %xmm2,%xmm1
addsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<Section1>:
unpcklpd %xmm4,%xmm3
unpcklpd %xmm1,%xmm0
subpd  %xmm0,%xmm3
movapd 0xeec(%rip),%xmm0
andpd  %xmm0,%xmm3
pshufd $0xee,%xmm3,%xmm1
addsd  %xmm3,%xmm1
subsd  %xmm2,%xmm5
andpd  %xmm5,%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @Section1(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
store double %0, double* %7
store double %1, double* %8
store double %2, double* %9
store double %3, double* %10
store double %4, double* %11
store double %5, double* %12
%13 = load double, double* %10
%14 = load double, double* %7
%15 = fsub double %13, %14
%16 = call double @llvm.fabs.f64(double %15)
%17 = load double, double* %11
%18 = load double, double* %8
%19 = fsub double %17, %18
%20 = call double @llvm.fabs.f64(double %19)
%21 = fadd double %16, %20
%22 = load double, double* %12
%23 = load double, double* %9
%24 = fsub double %22, %23
%25 = call double @llvm.fabs.f64(double %24)
%26 = fadd double %21, %25
ret double %26
}

LLVM IR (-O2):
define double @Section1(double %0, double %1, double %2, double %3, double %4, double %5) {
%7 = insertelement <2 x double> poison, double %3, i64 0
%8 = insertelement <2 x double> %7, double %4, i64 1
%9 = insertelement <2 x double> poison, double %0, i64 0
%10 = insertelement <2 x double> %9, double %1, i64 1
%11 = fsub <2 x double> %8, %10
%12 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %11)
%13 = shufflevector <2 x double> %12, <2 x double> poison, <2 x i32> <i32 1, i32 undef>
%14 = fadd <2 x double> %12, %13
%15 = extractelement <2 x double> %14, i64 0
%16 = fsub double %5, %2
%17 = tail call double @llvm.fabs.f64(double %16)
%18 = fadd double %15, %17
ret double %18
}
/* Variables and functions */
int const rand();
int getRndNum(const int nmbOfTurnouts) {
  int rand_nbr = (rand() % nmbOfTurnouts + 1);
  return rand_nbr;
}


x86 assembly (clang, -O0):
<getRndNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cltd
idivl  -0x4(%rbp)
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getRndNum>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @getRndNum(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 (...) @rand()
%5 = load i32, i32* %2
%6 = srem i32 %4, %5
%7 = add nsw i32 %6, 1
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @getRndNum(i32 %0) {
%2 = tail call i32 (...) @rand()
%3 = srem i32 %2, %0
%4 = add nsw i32 %3, 1
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ init_phi_sieve(int **, int **);
int /*<<< orphan*/ printf(char *, long);
int /*<<< orphan*/ search_chains(int *, int *, long *);
int main() {
  int *phi_sieve, *primes;
  long answer;
  init_phi_sieve(&phi_sieve, &primes);
  search_chains(phi_sieve, primes, &answer);
  printf("Problem 214: %ld\n", answer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1050 <init_phi_sieve@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
lea    -0x20(%rbp),%rdx
call   1030 <search_chains@plt>
mov    -0x20(%rbp),%rsi
lea    0xe98(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1050 <init_phi_sieve@plt>
mov    0x10(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %rsp,%rdx
call   1030 <search_chains@plt>
mov    (%rsp),%rsi
lea    0xea0(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [18 x i8] c"Problem 214: %ld\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32*
%3 = alloca i32*
%4 = alloca i64
store i32 0, i32* %1
%5 = call i32 @init_phi_sieve(i32** %2, i32** %3)
%6 = load i32*, i32** %2
%7 = load i32*, i32** %3
%8 = call i32 @search_chains(i32* %6, i32* %7, i64* %4)
%9 = load i64, i64* %4
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"Problem 214: %ld\0A\00"
define i32 @main() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i64
%4 = bitcast i32** %1 to i8*
%5 = bitcast i32** %2 to i8*
%6 = bitcast i64* %3 to i8*
%7 = call i32 @init_phi_sieve(i32** %1, i32** %2)
%8 = load i32*, i32** %1
%9 = load i32*, i32** %2
%10 = call i32 @search_chains(i32* %8, i32* %9, i64* %3)
%11 = load i64, i64* %3
%12 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i64 %11)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ freeHotKeyPool();
int /*<<< orphan*/ newHotKeyPool();
int /*<<< orphan*/ random_test_hotkeypool();
int /*<<< orphan*/ test_replaceKeyInPool();
int main() {
  test_replaceKeyInPool();
  newHotKeyPool();
  freeHotKeyPool();
  newHotKeyPool();
  random_test_hotkeypool();
  freeHotKeyPool();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1050 <test_replaceKeyInPool@plt>
mov    $0x0,%al
call   1060 <newHotKeyPool@plt>
mov    $0x0,%al
call   1040 <freeHotKeyPool@plt>
mov    $0x0,%al
call   1060 <newHotKeyPool@plt>
mov    $0x0,%al
call   1030 <random_test_hotkeypool@plt>
mov    $0x0,%al
call   1040 <freeHotKeyPool@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1050 <test_replaceKeyInPool@plt>
xor    %eax,%eax
call   1060 <newHotKeyPool@plt>
xor    %eax,%eax
call   1040 <freeHotKeyPool@plt>
xor    %eax,%eax
call   1060 <newHotKeyPool@plt>
xor    %eax,%eax
call   1030 <random_test_hotkeypool@plt>
xor    %eax,%eax
call   1040 <freeHotKeyPool@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_replaceKeyInPool()
%2 = call i32 (...) @newHotKeyPool()
%3 = call i32 (...) @freeHotKeyPool()
%4 = call i32 (...) @newHotKeyPool()
%5 = call i32 (...) @random_test_hotkeypool()
%6 = call i32 (...) @freeHotKeyPool()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_replaceKeyInPool()
%2 = tail call i32 (...) @newHotKeyPool()
%3 = tail call i32 (...) @freeHotKeyPool()
%4 = tail call i32 (...) @newHotKeyPool()
%5 = tail call i32 (...) @random_test_hotkeypool()
%6 = tail call i32 (...) @freeHotKeyPool()
ret i32 0
}
/* Variables and functions */
char *chop(char *s) {
  char *t = s;
  while (*t) {
    if (*t == '\n' || *t == '\r') {
      *t = '\0';
      return s;
    }
    t++;
  }
  return s;
}


x86 assembly (clang, -O0):
<chop>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
cmpb   $0x0,(%rax)
je     1162 <chop+0x62>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xa,%eax
je     113d <chop+0x3d>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0xd,%eax
jne    1151 <chop+0x51>
mov    -0x18(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    116a <chop+0x6a>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1110 <chop+0x10>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<chop>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
movzbl (%rcx),%edx
test   %dl,%dl
je     112a <chop+0x2a>
cmp    $0xd,%dl
je     1127 <chop+0x27>
cmp    $0xa,%dl
je     1127 <chop+0x27>
add    $0x1,%rcx
jmp    1110 <chop+0x10>
movb   $0x0,(%rcx)
ret

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

LLVM IR (-O2):
define i8* @chop(i8* returned %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 10, label %5
i8 13, label %5
]
5: ; preds = %2, %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret i8* %0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;
typedef int /*<<< orphan*/ cpu_set_t;

/* Variables and functions */
int /*<<< orphan*/ ENOSYS;
int /*<<< orphan*/ errno;
int sched_getaffinity(pid_t pid, size_t cpusetsize, cpu_set_t *mask) {
  errno = ENOSYS;
  return -1;
}


x86 assembly (clang, -O0):
<sched_getaffinity>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    0x2ed2(%rip),%rax
mov    (%rax),%ecx
mov    0x2eb9(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sched_getaffinity>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
mov    0x2ec8(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sched_getaffinity(i32 %0, i64 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i64
%6 = alloca i32*
store i32 %0, i32* %4
store i64 %1, i64* %5
store i32* %2, i32** %6
%7 = load i32, i32* @ENOSYS
store i32 %7, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@ENOSYS = global i32 0
@errno = global i32 0
define i32 @sched_getaffinity(i32 %0, i64 %1, i32* nocapture readnone %2) {
%4 = load i32, i32* @ENOSYS
store i32 %4, i32* @errno
ret i32 -1
}
int Ranf(int ilow, int ihigh) {
  float low = (float)ilow;
  float high = (float)ihigh + 0.9999f;
  return (int)(Ranf(low, high));
}


x86 assembly (clang, -O0):
<Ranf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
movss  0xecb(%rip),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
cvttss2si -0xc(%rbp),%edi
cvttss2si -0x10(%rbp),%esi
call   1030 <Ranf@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @Ranf(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca float
%6 = alloca float
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %3
%8 = sitofp i32 %7 to float
store float %8, float* %5
%9 = load i32, i32* %4
%10 = sitofp i32 %9 to float
%11 = fadd float %10, 0x3FEFFF2E40000000
store float %11, float* %6
%12 = load float, float* %5
%13 = fptosi float %12 to i32
%14 = load float, float* %6
%15 = fptosi float %14 to i32
%16 = call i32 @Ranf(i32 %13, i32 %15)
ret i32 %16
}

LLVM IR (-O2):
define i32 @Ranf(i32 %0, i32 %1) {
br label %3
3: ; preds = %3, %2
br label %3
}
void foo111() {}


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

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

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

LLVM IR (-O2):
define void @foo111() {
ret void
}
IR0AX1(r0, r1, x0, x1, p0, p1) short r0, r1;
short *p0, *p1;
{ (*p0) = (((short *)11111111)[x1]); }


x86 assembly (clang, -O0):
<IR0AX1>:
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)
movslq -0x10(%rbp),%rcx
mov    $0xa98ac7,%eax
mov    (%rax,%rcx,2),%cx
mov    -0x18(%rbp),%rax
mov    %cx,(%rax)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<IR0AX1>:
movslq %ecx,%rax
movzwl 0xa98ac7(%rax,%rax,1),%eax
mov    %ax,(%r8)
ret

LLVM IR (-O0):
define i32 @IR0AX1(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 i32, i32* %11
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %17
%19 = load i16, i16* %18
%20 = load i16*, i16** %12
store i16 %19, i16* %20
%21 = load i32, i32* %7
ret i32 %21
}

LLVM IR (-O2):
define i32 @IR0AX1(i32 %0, i32 %1, i32 %2, i32 %3, i16* nocapture writeonly %4, i16* nocapture readnone %5) {
%7 = sext i32 %3 to i64
%8 = getelementptr inbounds i16, i16* inttoptr (i64 11111111 to i16*), i64 %7
%9 = load i16, i16* %8
store i16 %9, i16* %4
ret i32 undef
}
int GetFirstDot(jres, dotp)
int jres;
int *dotp;
{ return dotp[jres]; }


x86 assembly (clang, -O0):
<GetFirstDot>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x4(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetFirstDot>:
movslq %edi,%rax
mov    (%rsi,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @GetFirstDot(i32 %0, i32* %1) {
%3 = alloca i32
%4 = alloca i32*
store i32 %0, i32* %3
store i32* %1, i32** %4
%5 = load i32*, i32** %4
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i32, i32* %5, i64 %7
%9 = load i32, i32* %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @GetFirstDot(i32 %0, i32* nocapture %1) {
%3 = sext i32 %0 to i64
%4 = getelementptr inbounds i32, i32* %1, i64 %3
%5 = load i32, i32* %4
ret i32 %5
}
void X509_trust_clear(void) {}


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

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

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

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