xunge/DecIR huggingface dataset:
void b_system_misc(unsigned long function, void *var1, void *var2) {
  asm volatile("call *0x001000B8" : : "d"(function), "a"(var1), "c"(var2));
}


x86 assembly (clang, -O0):
<b_system_misc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rcx
call   *0x1000b8
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_system_misc>:
mov    %rdx,%rcx
mov    %rsi,%rax
mov    %rdi,%rdx
call   *0x1000b8
ret

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

LLVM IR (-O2):
define void @b_system_misc(i64 %0, i8* %1, i8* %2) {
tail call void asm sideeffect "call *0x001000B8", "{dx},{ax},{cx},~{dirflag},~{fpsr},~{flags}"(i64 %0, i8* %1, i8* %2)
ret void
}
signed long int signedlongint_ignoring_signedlongint(signed long int x,
                                                     signed long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<signedlongint_ignoring_signedlongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @signedlongint_ignoring_signedlongint(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @signedlongint_ignoring_signedlongint(i64 returned %0, i64 %1) {
ret i64 %0
}
int test_imm_70int8_reg(signed char val) {
  return ((val) & (-0x70 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_70int8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edx
and    $0xffffff90,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_70int8_reg>:
test   $0x90,%dil
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_70int8_reg(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = and i32 %4, -112
%6 = icmp ne i32 %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_70int8_reg(i8 signext %0) {
%2 = and i8 %0, -112
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
int bound(int a, int x, int b) {
  if (b < a)
    return bound(b, x, a);
  if (x < a)
    return a;
  if (x > b)
    return b;
  return x;
}


x86 assembly (clang, -O0):
<bound>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1143 <bound+0x33>
mov    -0x10(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%edx
call   1030 <bound@plt>
mov    %eax,-0x4(%rbp)
jmp    1177 <bound+0x67>
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    115a <bound+0x4a>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <bound+0x67>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    1171 <bound+0x61>
mov    -0x10(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1177 <bound+0x67>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bound>:
mov    %edx,%eax
mov    %edi,%edx
mov    %eax,%edi
cmp    %edx,%eax
jl     1100 <bound>
cmp    %esi,%eax
cmovge %esi,%eax
cmp    %esi,%edx
cmovg  %edx,%eax
ret

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

LLVM IR (-O2):
define i32 @bound(i32 %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %4, %3
%5 = phi i32 [ %0, %3 ], [ %6, %4 ]
%6 = phi i32 [ %2, %3 ], [ %5, %4 ]
%7 = icmp slt i32 %6, %5
br i1 %7, label %4, label %8
8: ; preds = %4
%9 = icmp sgt i32 %5, %1
%10 = icmp slt i32 %6, %1
%11 = select i1 %10, i32 %6, i32 %1
%12 = select i1 %9, i32 %5, i32 %11
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
int mcfioC_OpenReadSequential(char *device, char *label, int filenumber) {
  fprintf(stderr,
          "mcfioC_OpenReadSequential: Not available in this library. \n");
  return -1;
}


x86 assembly (clang, -O0):
<mcfioC_OpenReadSequential>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    0x2eb6(%rip),%rax
mov    (%rax),%edi
lea    0xecd(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mcfioC_OpenReadSequential>:
push   %rax
mov    0x2ec8(%rip),%rax
mov    (%rax),%edi
lea    0xedf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [60 x i8] c"mcfioC_OpenReadSequential: Not available in this library. \0A\00"
define i32 @mcfioC_OpenReadSequential(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load i32, i32* @stderr
%8 = call i32 @fprintf(i32 %7, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [60 x i8] c"mcfioC_OpenReadSequential: Not available in this library. \0A\00"
define i32 @mcfioC_OpenReadSequential(i8* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = load i32, i32* @stderr
%5 = tail call i32 @fprintf(i32 %4, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str, i64 0, i64 0))
ret i32 -1
}
void AssetDestroy(struct _Asset *asset) {}


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

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

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

LLVM IR (-O2):
%struct._Asset = type opaque
define void @AssetDestroy(%struct._Asset* nocapture %0) {
ret void
}
/* Variables and functions */
double modf(double, double *);
int /*<<< orphan*/ printf(char *, double);
int main() {
  double x, fractpart, intpart;
  x = 8.123456;
  fractpart = modf(x, &intpart);
  printf("Integral part = %lf\n", intpart);
  printf("Fraction Part = %lf\n", fractpart);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movsd  0xec9(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
lea    -0x20(%rbp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x20(%rbp),%xmm0
lea    0xead(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xeb1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movsd  0xed4(%rip),%xmm0
lea    0x10(%rsp),%rdi
call   1040 <modf@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0x10(%rsp),%xmm0
lea    0xebf(%rip),%rdi
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@.str = [21 x i8] c"Integral part = %lf\0A\00"
@.str.1 = [21 x i8] c"Fraction Part = %lf\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
%3 = alloca double
%4 = alloca double
store i32 0, i32* %1
store double 0x40203F359FF4FD6D, double* %2
%5 = load double, double* %2
%6 = call double @modf(double %5, double* %4)
store double %6, double* %3
%7 = load double, double* %4
%8 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %7)
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"Integral part = %lf\0A\00"
@.str.1 = [21 x i8] c"Fraction Part = %lf\0A\00"
define i32 @main() {
%1 = alloca double
%2 = bitcast double* %1 to i8*
%3 = call double @modf(double 0x40203F359FF4FD6D, double* %1)
%4 = load double, double* %1
%5 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %4)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %3)
ret i32 0
}
/* Variables and functions */
int *f() { return NULL; }


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

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

LLVM IR (-O0):
define i32* @f() {
ret i32* null
}

LLVM IR (-O2):
define noalias i32* @f() {
ret i32* null
}
/* Type definitions */
struct nlmsg {
  int dummy;
};
typedef int /*<<< orphan*/ int32_t;
typedef int /*<<< orphan*/ data;

/* Variables and functions */
int nla_put(struct nlmsg *, int, int /*<<< orphan*/ *, int);
int nla_put_s32(struct nlmsg *msg, int type, int32_t data) {
  return nla_put(msg, type, &data, sizeof(data));
}


x86 assembly (clang, -O0):
<nla_put_s32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
lea    -0x10(%rbp),%rdx
mov    $0x4,%ecx
call   1030 <nla_put@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<nla_put_s32>:
push   %rax
mov    %edx,0x4(%rsp)
lea    0x4(%rsp),%rdx
mov    $0x4,%ecx
call   1030 <nla_put@plt>
pop    %rcx
ret

LLVM IR (-O0):
%struct.nlmsg = type { i32 }
define i32 @nla_put_s32(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca %struct.nlmsg*
%5 = alloca i32
%6 = alloca i32
store %struct.nlmsg* %0, %struct.nlmsg** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load %struct.nlmsg*, %struct.nlmsg** %4
%8 = load i32, i32* %5
%9 = call i32 @nla_put(%struct.nlmsg* %7, i32 %8, i32* %6, i32 4)
ret i32 %9
}

LLVM IR (-O2):
%struct.nlmsg = type { i32 }
define i32 @nla_put_s32(%struct.nlmsg* %0, i32 %1, i32 %2) {
%4 = alloca i32
store i32 %2, i32* %4
%5 = call i32 @nla_put(%struct.nlmsg* %0, i32 %1, i32* %4, i32 4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ SIGKILL;
int /*<<< orphan*/ kill(int, int /*<<< orphan*/);
void kill_all(int *pid, int n) {
  int i;
  for (i = 0; i < n; i++)
    kill(pid[i], SIGKILL);
}


x86 assembly (clang, -O0):
<kill_all>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <kill_all+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
mov    0x2e9c(%rip),%rax
mov    (%rax),%esi
call   1030 <kill@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <kill_all+0x16>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill_all>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1146 <kill_all+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
mov    0x2eb5(%rip),%r12
nopl   0x0(%rax,%rax,1)
mov    (%r14,%rbx,4),%edi
mov    (%r12),%esi
call   1030 <kill@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <kill_all+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@SIGKILL = global i32 0
define void @kill_all(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %14
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %12, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = load i32, i32* @SIGKILL
%11 = tail call i32 @kill(i32 %9, i32 %10)
%12 = add nuw nsw i64 %7, 1
%13 = icmp eq i64 %12, %5
br i1 %13, label %14, label %6
14: ; preds = %6, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ do_bzero(void *, size_t);
void *malloc(size_t);
void *do_malloc(size_t size) {
  void *ptr = malloc(size);
  do_bzero(ptr, size);
  ;
  return ptr;
}


x86 assembly (clang, -O0):
<do_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <do_bzero@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @do_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = load i64, i64* %2
%8 = call i32 @do_bzero(i8* %6, i64 %7)
%9 = load i8*, i8** %3
ret i8* %9
}

LLVM IR (-O2):
define i8* @do_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = tail call i32 @do_bzero(i8* %2, i64 %0)
ret i8* %2
}
unsigned int adpcmReadStatus() {
  extern unsigned int nadpcmStatus;
  return nadpcmStatus;
}


x86 assembly (clang, -O0):
<adpcmReadStatus>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<adpcmReadStatus>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@nadpcmStatus = external global i32
define i32 @adpcmReadStatus() {
%1 = load i32, i32* @nadpcmStatus
ret i32 %1
}

LLVM IR (-O2):
@nadpcmStatus = external global i32
define i32 @adpcmReadStatus() {
%1 = load i32, i32* @nadpcmStatus
ret i32 %1
}
void SensorGetET_Test(unsigned char *RegBuf) {}


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

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

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

LLVM IR (-O2):
define void @SensorGetET_Test(i8* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ sprintf(char *, char *, char *, char *);
char *strdup(char *);
char *foreign_attribute_sys_string(char *where) {
  char sys_string[1024];
  sprintf(sys_string, "select.sh '*' %s \"%s\" folder,foreign_key_index",
          "foreign_attribute", where);
  return strdup(sys_string);
}


x86 assembly (clang, -O0):
<foreign_attribute_sys_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x410,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x410(%rbp),%rdi
mov    -0x8(%rbp),%rcx
lea    0xebf(%rip),%rsi
lea    0xee7(%rip),%rdx
call   1030 <sprintf@plt>
lea    -0x410(%rbp),%rdi
call   1040 <strdup@plt>
add    $0x410,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foreign_attribute_sys_string>:
push   %rbx
sub    $0x400,%rsp
mov    %rdi,%rcx
lea    0xece(%rip),%rsi
lea    0xef6(%rip),%rdx
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1030 <sprintf@plt>
mov    %rbx,%rdi
call   1040 <strdup@plt>
add    $0x400,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [47 x i8] c"select.sh '*' %s \22%s\22 folder,foreign_key_index\00"
@.str.1 = [18 x i8] c"foreign_attribute\00"
define i8* @foreign_attribute_sys_string(i8* %0) {
%2 = alloca i8*
%3 = alloca [1024 x i8]
store i8* %0, i8** %2
%4 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%5 = load i8*, i8** %2
%6 = call i32 @sprintf(i8* %4, i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%7 = getelementptr inbounds [1024 x i8], [1024 x i8]* %3, i64 0, i64 0
%8 = call i8* @strdup(i8* %7)
ret i8* %8
}

LLVM IR (-O2):
@.str = [47 x i8] c"select.sh '*' %s \22%s\22 folder,foreign_key_index\00"
@.str.1 = [18 x i8] c"foreign_attribute\00"
define noalias i8* @foreign_attribute_sys_string(i8* %0) {
%2 = alloca [1024 x i8]
%3 = getelementptr inbounds [1024 x i8], [1024 x i8]* %2, i64 0, i64 0
%4 = call i32 @sprintf(i8* %3, i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i8* %0)
%5 = call i8* @strdup(i8* %3)
ret i8* %5
}
void VecSubtract3fv(float v[3], const float a[3], const float b[3]) {
  v[0] = a[0] - b[0];
  v[1] = a[1] - b[1];
  v[2] = a[2] - b[2];
}


x86 assembly (clang, -O0):
<VecSubtract3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movss  0x4(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x4(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
mov    -0x10(%rbp),%rax
movss  0x8(%rax),%xmm0
mov    -0x18(%rbp),%rax
subss  0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x8(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<VecSubtract3fv>:
movss  (%rsi),%xmm0
subss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
subss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
subss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

LLVM IR (-O0):
define void @VecSubtract3fv(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** %5
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %6
%11 = getelementptr inbounds float, float* %10, i64 0
%12 = load float, float* %11
%13 = fsub float %9, %12
%14 = load float*, float** %4
%15 = getelementptr inbounds float, float* %14, i64 0
store float %13, float* %15
%16 = load float*, float** %5
%17 = getelementptr inbounds float, float* %16, i64 1
%18 = load float, float* %17
%19 = load float*, float** %6
%20 = getelementptr inbounds float, float* %19, i64 1
%21 = load float, float* %20
%22 = fsub float %18, %21
%23 = load float*, float** %4
%24 = getelementptr inbounds float, float* %23, i64 1
store float %22, float* %24
%25 = load float*, float** %5
%26 = getelementptr inbounds float, float* %25, i64 2
%27 = load float, float* %26
%28 = load float*, float** %6
%29 = getelementptr inbounds float, float* %28, i64 2
%30 = load float, float* %29
%31 = fsub float %27, %30
%32 = load float*, float** %4
%33 = getelementptr inbounds float, float* %32, i64 2
store float %31, float* %33
ret void
}

LLVM IR (-O2):
define void @VecSubtract3fv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fsub float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fsub float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fsub float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ atol(char const *);
int /*<<< orphan*/ fetch_parameter(int /*<<< orphan*/);
uint32_t read_gcode_integer(const char *line) {
  if (line[0] == '#')
    return (uint32_t)fetch_parameter(read_gcode_integer(&line[1]));
  else
    return atol(line);
}


x86 assembly (clang, -O0):
<read_gcode_integer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x23,%eax
jne    1168 <read_gcode_integer+0x38>
mov    -0x10(%rbp),%rdi
add    $0x1,%rdi
call   1040 <read_gcode_integer@plt>
mov    %eax,%edi
call   1030 <fetch_parameter@plt>
mov    %eax,-0x4(%rbp)
jmp    1174 <read_gcode_integer+0x44>
mov    -0x10(%rbp),%rdi
call   1050 <atol@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_gcode_integer>:
push   %rax
cmpb   $0x23,(%rdi)
jne    1147 <read_gcode_integer+0x17>
add    $0x1,%rdi
call   1040 <read_gcode_integer@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <fetch_parameter@plt>
pop    %rax
jmp    1050 <atol@plt>

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

LLVM IR (-O2):
define i32 @read_gcode_integer(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 35
br i1 %3, label %6, label %10
4: ; preds = %10, %6
%5 = phi i32 [ %9, %6 ], [ %11, %10 ]
ret i32 %5
6: ; preds = %1
%7 = getelementptr inbounds i8, i8* %0, i64 1
%8 = tail call i32 @read_gcode_integer(i8* %7)
%9 = tail call i32 @fetch_parameter(i32 %8)
br label %4
10: ; preds = %1
%11 = tail call i32 @atol(i8* %0)
br label %4
}
/* Variables and functions */
int vdb_printf(char *, float, float, float, float, float, float);
__attribute__((weak)) int vdb_line(float x0, float y0, float z0, float x1,
                                   float y1, float z1) {
  return vdb_printf("l %f %f %f %f %f %f\n", x0, y0, z0, x1, y1, z1);
}


x86 assembly (clang, -O0):
<vdb_line>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  %xmm5,-0x18(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
movss  -0xc(%rbp),%xmm2
movss  -0x10(%rbp),%xmm3
movss  -0x14(%rbp),%xmm4
movss  -0x18(%rbp),%xmm5
lea    0xea5(%rip),%rdi
call   1030 <vdb_printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [21 x i8] c"l %f %f %f %f %f %f\0A\00"
define weak i32 @vdb_line(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca float
store float %0, float* %7
store float %1, float* %8
store float %2, float* %9
store float %3, float* %10
store float %4, float* %11
store float %5, float* %12
%13 = load float, float* %7
%14 = load float, float* %8
%15 = load float, float* %9
%16 = load float, float* %10
%17 = load float, float* %11
%18 = load float, float* %12
%19 = call i32 @vdb_printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %13, float %14, float %15, float %16, float %17, float %18)
ret i32 %19
}

LLVM IR (-O2):
@.str = [21 x i8] c"l %f %f %f %f %f %f\0A\00"
define weak i32 @vdb_line(float %0, float %1, float %2, float %3, float %4, float %5) {
%7 = tail call i32 @vdb_printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), float %0, float %1, float %2, float %3, float %4, float %5)
ret i32 %7
}
/* Variables and functions */
long random_int_exclusive(long, long);
long int random_int_inclusive(long int lower, long int upper) {
  return random_int_exclusive(lower, upper + 1);
}


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

x86 assembly (clang, -O2):
<random_int_inclusive>:
add    $0x1,%rsi
jmp    1030 <random_int_exclusive@plt>

LLVM IR (-O0):
define i64 @random_int_inclusive(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 = add nsw i64 %6, 1
%8 = call i64 @random_int_exclusive(i64 %5, i64 %7)
ret i64 %8
}

LLVM IR (-O2):
define i64 @random_int_inclusive(i64 %0, i64 %1) {
%3 = add nsw i64 %1, 1
%4 = tail call i64 @random_int_exclusive(i64 %0, i64 %3)
ret i64 %4
}
/* Type definitions */
struct list_ip {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ list_ip_append(struct list_ip *, int, void *);
scalar_t__ list_ip_contains(struct list_ip *, int);
bool list_ip_add(struct list_ip *target, int key, void *data) {
  if (list_ip_contains(target, key))
    return false;
  list_ip_append(target, key, data);
  return true;
}


x86 assembly (clang, -O0):
<list_ip_add>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1030 <list_ip_contains@plt>
cmp    $0x0,%rax
je     1155 <list_ip_add+0x35>
movl   $0x0,-0x4(%rbp)
jmp    116c <list_ip_add+0x4c>
mov    -0x10(%rbp),%rdi
mov    -0x14(%rbp),%esi
mov    -0x20(%rbp),%rdx
call   1040 <list_ip_append@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<list_ip_add>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %esi,%ebp
mov    %rdi,%rbx
call   1030 <list_ip_contains@plt>
mov    %rax,%rcx
xor    %eax,%eax
test   %rcx,%rcx
jne    114d <list_ip_add+0x2d>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14,%rdx
call   1040 <list_ip_append@plt>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
%struct.list_ip = type { i32 }
define i32 @list_ip_add(%struct.list_ip* %0, i32 %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct.list_ip*
%6 = alloca i32
%7 = alloca i8*
store %struct.list_ip* %0, %struct.list_ip** %5
store i32 %1, i32* %6
store i8* %2, i8** %7
%8 = load %struct.list_ip*, %struct.list_ip** %5
%9 = load i32, i32* %6
%10 = call i64 @list_ip_contains(%struct.list_ip* %8, i32 %9)
%11 = icmp ne i64 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %3
store i32 0, i32* %4
br label %18
13: ; preds = %3
%14 = load %struct.list_ip*, %struct.list_ip** %5
%15 = load i32, i32* %6
%16 = load i8*, i8** %7
%17 = call i32 @list_ip_append(%struct.list_ip* %14, i32 %15, i8* %16)
store i32 1, i32* %4
br label %18
18: ; preds = %13, %12
%19 = load i32, i32* %4
ret i32 %19
}

LLVM IR (-O2):
%struct.list_ip = type { i32 }
define i32 @list_ip_add(%struct.list_ip* %0, i32 %1, i8* %2) {
%4 = tail call i64 @list_ip_contains(%struct.list_ip* %0, i32 %1)
%5 = icmp eq i64 %4, 0
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @list_ip_append(%struct.list_ip* %0, i32 %1, i8* %2)
br label %8
8: ; preds = %3, %6
%9 = phi i32 [ 1, %6 ], [ 0, %3 ]
ret i32 %9
}
/* Variables and functions */
int tsl2561_write_byte_data(void *, int, int);
int tsl2561_enable(void *_tsl) {
  return tsl2561_write_byte_data(_tsl, (0x80) | 0x00, 0x03);
}


x86 assembly (clang, -O0):
<tsl2561_enable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x80,%esi
mov    $0x3,%edx
call   1030 <tsl2561_write_byte_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tsl2561_enable>:
mov    $0x80,%esi
mov    $0x3,%edx
jmp    1030 <tsl2561_write_byte_data@plt>

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

LLVM IR (-O2):
define i32 @tsl2561_enable(i8* %0) {
%2 = tail call i32 @tsl2561_write_byte_data(i8* %0, i32 128, i32 3)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int __infer_nondet_int();
int vprintf(const char *format, va_list arg) {
  int res;
  res = __infer_nondet_int();
  if (res < 0)
    while (1)
      ;
  return res;
}


x86 assembly (clang, -O0):
<vprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jge    113d <vprintf+0x2d>
jmp    1138 <vprintf+0x28>
jmp    1138 <vprintf+0x28>
mov    -0x10(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vprintf>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
js     1120 <vprintf+0x10>
pop    %rcx
ret
xchg   %ax,%ax
jmp    1120 <vprintf+0x10>

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

LLVM IR (-O2):
define i32 @vprintf(i8* nocapture readnone %0, i32 %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = icmp slt i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %2, %5
br label %5
6: ; preds = %2
ret i32 %3
}
/* Variables and functions */
int IPC_CREAT;
int semget(int, int, int);
int crearSemaforo(int key) { return (semget(key, 1, IPC_CREAT | 0666)); }


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

x86 assembly (clang, -O2):
<crearSemaforo>:
mov    0x2ec9(%rip),%rax
mov    $0x1b6,%edx
or     (%rax),%edx
mov    $0x1,%esi
jmp    1030 <semget@plt>

LLVM IR (-O0):
@IPC_CREAT = global i32 0
define i32 @crearSemaforo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* @IPC_CREAT
%5 = or i32 %4, 438
%6 = call i32 @semget(i32 %3, i32 1, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@IPC_CREAT = global i32 0
define i32 @crearSemaforo(i32 %0) {
%2 = load i32, i32* @IPC_CREAT
%3 = or i32 %2, 438
%4 = tail call i32 @semget(i32 %0, i32 1, i32 %3)
ret i32 %4
}
int g(int x) { return (x - 10) < 0; }


x86 assembly (clang, -O0):
<g>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
cmp    $0x0,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<g>:
xor    %eax,%eax
cmp    $0xa,%edi
setl   %al
ret

LLVM IR (-O0):
define i32 @g(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = sub nsw i32 %3, 10
%5 = icmp slt i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @g(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = zext i1 %2 to i32
ret i32 %3
}
void ngsrch_init() { ; }


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

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

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

LLVM IR (-O2):
define void @ngsrch_init() {
ret void
}
/* Variables and functions */
int toascii(int);
int toAscii(int c) { return toascii(c); }


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

x86 assembly (clang, -O2):
<toAscii>:
mov    %edi,%eax
and    $0x7f,%eax
ret

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

LLVM IR (-O2):
define i32 @toAscii(i32 %0) {
%2 = and i32 %0, 127
ret i32 %2
}
/* Variables and functions */
scalar_t__ ReadMakefile(void const *, void const *);
int ReadAllMakefiles(const void *p, const void *q) {
  return (ReadMakefile(p, q) == 0);
}


x86 assembly (clang, -O0):
<ReadAllMakefiles>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ReadMakefile@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ReadAllMakefiles>:
push   %rax
call   1030 <ReadMakefile@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @ReadAllMakefiles(i8* %0, i8* %1) {
%3 = tail call i64 @ReadMakefile(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ GLfloat;

/* Variables and functions */
int /*<<< orphan*/ glTexCoord4fv(int /*<<< orphan*/ *);
void TexCoord4fv(GLfloat v[4]) { glTexCoord4fv(v); }


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

x86 assembly (clang, -O2):
<TexCoord4fv>:
jmp    1030 <glTexCoord4fv@plt>

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

LLVM IR (-O2):
define void @TexCoord4fv(i32* %0) {
%2 = tail call i32 @glTexCoord4fv(i32* %0)
ret void
}
int search(int a[], int size, int elt) {
  int i, flag = -1;
  for (i = 0; i < size; i++)
    if (a[i] == elt) {
      flag = i + 1;
      break;
    }
  return flag;
}


x86 assembly (clang, -O0):
<search>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movl   $0xffffffff,-0x18(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <search+0x5d>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
cmp    -0x10(%rbp),%eax
jne    114a <search+0x4a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    115d <search+0x5d>
jmp    114f <search+0x4f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <search+0x1c>
mov    -0x18(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @search(i32* nocapture %0, i32 %1, i32 %2) {
%4 = icmp sgt i32 %1, 0
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = zext i32 %1 to i64
br label %7
7: ; preds = %5, %15
%8 = phi i64 [ 0, %5 ], [ %16, %15 ]
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = icmp eq i32 %10, %2
br i1 %11, label %12, label %15
12: ; preds = %7
%13 = trunc i64 %8 to i32
%14 = add nuw nsw i32 %13, 1
br label %18
15: ; preds = %7
%16 = add nuw nsw i64 %8, 1
%17 = icmp eq i64 %16, %6
br i1 %17, label %18, label %7
18: ; preds = %15, %3, %12
%19 = phi i32 [ %14, %12 ], [ -1, %3 ], [ -1, %15 ]
ret i32 %19
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ spreadDensityX(int, float);
void globalFixDensity(int numBins, float maxMovement) {
  printf("QCLN-10 : \tbin-based density correction\n");
  spreadDensityX(numBins, maxMovement);
}


x86 assembly (clang, -O0):
<globalFixDensity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
lea    0xec9(%rip),%rdi
call   1030 <printf@plt>
mov    -0x4(%rbp),%edi
movss  -0x8(%rbp),%xmm0
call   1040 <spreadDensityX@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<globalFixDensity>:
push   %rbx
sub    $0x10,%rsp
movss  %xmm0,0xc(%rsp)
mov    %edi,%ebx
lea    0xecc(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
movss  0xc(%rsp),%xmm0
add    $0x10,%rsp
pop    %rbx
jmp    1040 <spreadDensityX@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"QCLN-10 : \09bin-based density correction\0A\00"
define void @globalFixDensity(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%6 = load i32, i32* %3
%7 = load float, float* %4
%8 = call i32 @spreadDensityX(i32 %6, float %7)
ret void
}

LLVM IR (-O2):
@str = [40 x i8] c"QCLN-10 : \09bin-based density correction\00"
define void @globalFixDensity(i32 %0, float %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%4 = tail call i32 @spreadDensityX(i32 %0, float %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void CheckBounds(unsigned char *data, size_t data_size, void *ptr,
                 size_t inside_size) {
  assert(data <= (unsigned char *)ptr);
  assert((unsigned char *)ptr + inside_size <= data + data_size);
}


x86 assembly (clang, -O0):
<CheckBounds>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x18(%rbp),%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    -0x8(%rbp),%rcx
add    -0x10(%rbp),%rcx
cmp    %rcx,%rax
setbe  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CheckBounds>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rcx,%r15
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r12
xor    %edi,%edi
cmp    %rdx,%r12
setbe  %dil
call   1030 <assert@plt>
add    %r14,%r15
add    %r12,%rbx
xor    %edi,%edi
cmp    %rbx,%r15
setbe  %dil
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <assert@plt>

LLVM IR (-O0):
define void @CheckBounds(i8* %0, i64 %1, i8* %2, i64 %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i8*
%8 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i8* %2, i8** %7
store i64 %3, i64* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %7
%11 = icmp ule i8* %9, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i8*, i8** %7
%15 = load i64, i64* %8
%16 = getelementptr inbounds i8, i8* %14, i64 %15
%17 = load i8*, i8** %5
%18 = load i64, i64* %6
%19 = getelementptr inbounds i8, i8* %17, i64 %18
%20 = icmp ule i8* %16, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
ret void
}

LLVM IR (-O2):
define void @CheckBounds(i8* readnone %0, i64 %1, i8* readnone %2, i64 %3) {
%5 = icmp ule i8* %0, %2
%6 = zext i1 %5 to i32
%7 = tail call i32 @assert(i32 %6)
%8 = getelementptr inbounds i8, i8* %2, i64 %3
%9 = getelementptr inbounds i8, i8* %0, i64 %1
%10 = icmp ule i8* %8, %9
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
ret void
}
void fromColMajor(int flat, int *i, int *j, int rows) {
  *j = flat / rows;
  *i = flat % rows;
}


x86 assembly (clang, -O0):
<fromColMajor>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%eax
cltd
idivl  -0x1c(%rbp)
mov    -0x10(%rbp),%rax
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<fromColMajor>:
mov    %rdx,%r8
mov    %edi,%eax
cltd
idiv   %ecx
mov    %eax,(%r8)
mov    %edx,(%rsi)
ret

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

LLVM IR (-O2):
define void @fromColMajor(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32 %3) {
%5 = sdiv i32 %0, %3
store i32 %5, i32* %2
%6 = srem i32 %0, %3
store i32 %6, i32* %1
ret void
}
long GPUtest(void) { return 0; }


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

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

LLVM IR (-O0):
define i64 @GPUtest() {
ret i64 0
}

LLVM IR (-O2):
define i64 @GPUtest() {
ret i64 0
}
float h1(float x) { return (x < 0.f ? 1.f : -1.f); }


x86 assembly (clang, -O0):
<h1>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  0xeea(%rip),%xmm3
movss  0xee6(%rip),%xmm2
xorps  %xmm1,%xmm1
cmpltss %xmm1,%xmm0
movaps %xmm0,%xmm1
andps  %xmm3,%xmm1
andnps %xmm2,%xmm0
orps   %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<h1>:
xorps  %xmm1,%xmm1
xor    %eax,%eax
ucomiss %xmm0,%xmm1
seta   %al
lea    0xeee(%rip),%rcx
movss  (%rcx,%rax,4),%xmm0
ret

LLVM IR (-O0):
define float @h1(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fcmp olt float %3, 0.000000e+00
%5 = zext i1 %4 to i64
%6 = select i1 %4, float 1.000000e+00, float -1.000000e+00
ret float %6
}

LLVM IR (-O2):
define float @h1(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = select i1 %2, float 1.000000e+00, float -1.000000e+00
ret float %3
}
void PAN_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @PAN_SaveConfig() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ft_strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void ft_putstr(char *str) {
  if (str)
    write(1, str, ft_strlen(str));
}


x86 assembly (clang, -O0):
<ft_putstr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1158 <ft_putstr+0x38>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <ft_strlen@plt>
mov    -0x10(%rbp),%rsi
mov    %eax,%edx
mov    $0x1,%edi
call   1030 <write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_putstr>:
test   %rdi,%rdi
je     113e <ft_putstr+0x1e>
push   %rbx
mov    %rdi,%rbx
call   1040 <ft_strlen@plt>
mov    $0x1,%edi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1030 <write@plt>
ret

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

LLVM IR (-O2):
define void @ft_putstr(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i32 @ft_strlen(i8* %0)
%5 = tail call i32 @write(i32 1, i8* %0, i32 %4)
br label %6
6: ; preds = %3, %1
ret void
}
unsigned long int
unsignedlongint_ignoring_signedlonglongint(unsigned long int x,
                                           signed long long int y) {
  return x;
}


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

x86 assembly (clang, -O2):
<unsignedlongint_ignoring_signedlonglongint>:
mov    %rdi,%rax
ret

LLVM IR (-O0):
define i64 @unsignedlongint_ignoring_signedlonglongint(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
ret i64 %5
}

LLVM IR (-O2):
define i64 @unsignedlongint_ignoring_signedlonglongint(i64 returned %0, i64 %1) {
ret i64 %0
}
/* Variables and functions */
long long doubleToRawLongBits(double);
double const longBitsToDouble(long long);
__attribute__((always_)) const double copysignk(double x, double y) {
  return longBitsToDouble((doubleToRawLongBits(x) & ~(1LL << 63)) ^
                          (doubleToRawLongBits(y) & (1LL << 63)));
}


x86 assembly (clang, -O0):
<copysignk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1040 <doubleToRawLongBits@plt>
movabs $0x7fffffffffffffff,%rcx
ff ff 7f
and    %rcx,%rax
mov    %rax,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1040 <doubleToRawLongBits@plt>
mov    -0x18(%rbp),%rdi
movabs $0x8000000000000000,%rcx
and    %rcx,%rax
xor    %rax,%rdi
call   1030 <longBitsToDouble@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copysignk>:
push   %r14
push   %rbx
push   %rax
movsd  %xmm1,(%rsp)
call   1040 <doubleToRawLongBits@plt>
mov    %rax,%r14
movabs $0x7fffffffffffffff,%rbx
ff ff 7f
and    %rbx,%r14
movsd  (%rsp),%xmm0
call   1040 <doubleToRawLongBits@plt>
add    $0x1,%rbx
and    %rax,%rbx
or     %r14,%rbx
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <longBitsToDouble@plt>

LLVM IR (-O0):
define double @copysignk(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 = call i64 @doubleToRawLongBits(double %5)
%7 = and i64 %6, 9223372036854775807
%8 = load double, double* %4
%9 = call i64 @doubleToRawLongBits(double %8)
%10 = and i64 %9, -9223372036854775808
%11 = xor i64 %7, %10
%12 = call double @longBitsToDouble(i64 %11)
ret double %12
}

LLVM IR (-O2):
define double @copysignk(double %0, double %1) {
%3 = tail call i64 @doubleToRawLongBits(double %0)
%4 = and i64 %3, 9223372036854775807
%5 = tail call i64 @doubleToRawLongBits(double %1)
%6 = and i64 %5, -9223372036854775808
%7 = or i64 %6, %4
%8 = tail call double @longBitsToDouble(i64 %7)
ret double %8
}