xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ memset(unsigned char *, int /*<<< orphan*/, int);
void ClearBuffer(void *buf, int nBytes) {
  int i;
  unsigned char *cbuf = (unsigned char *)buf;
  memset(cbuf, 0, nBytes);
  return;
}


x86 assembly (clang, -O0):
<ClearBuffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @ClearBuffer(i8* %0, i32 %1) {
%3 = tail call i32 @memset(i8* %0, i32 0, i32 %1)
ret void
}
void XStoreBytes() {}


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

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

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

LLVM IR (-O2):
define void @XStoreBytes() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f9_t();
void f9(void) { f9_t(); }


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

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

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

LLVM IR (-O2):
define void @f9() {
%1 = tail call i32 (...) @f9_t()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ writeAsNucleotides(int /*<<< orphan*/, unsigned long long);
void printAsNucleotides(unsigned long long int sequence) {
  writeAsNucleotides(stdout, sequence);
}


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

x86 assembly (clang, -O2):
<printAsNucleotides>:
mov    %rdi,%rsi
mov    0x2ec6(%rip),%rax
mov    (%rax),%edi
jmp    1030 <writeAsNucleotides@plt>

LLVM IR (-O0):
@stdout = global i32 0
define void @printAsNucleotides(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i32, i32* @stdout
%4 = load i64, i64* %2
%5 = call i32 @writeAsNucleotides(i32 %3, i64 %4)
ret void
}

LLVM IR (-O2):
@stdout = global i32 0
define void @printAsNucleotides(i64 %0) {
%2 = load i32, i32* @stdout
%3 = tail call i32 @writeAsNucleotides(i32 %2, i64 %0)
ret void
}
/* Type definitions */
struct wire_packet {
  int dummy;
};

/* Variables and functions */
struct wire_packet *mpool_packet_malloc();
struct wire_packet *wire_packet_malloc(void) {
  return (mpool_packet_malloc());
}


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

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

LLVM IR (-O0):
%struct.wire_packet = type { i32 }
define %struct.wire_packet* @wire_packet_malloc() {
%1 = call %struct.wire_packet* (...) @mpool_packet_malloc()
ret %struct.wire_packet* %1
}

LLVM IR (-O2):
%struct.wire_packet = type { i32 }
define %struct.wire_packet* @wire_packet_malloc() {
%1 = tail call %struct.wire_packet* (...) @mpool_packet_malloc()
ret %struct.wire_packet* %1
}
/* Variables and functions */
int /*<<< orphan*/ outer_lib_func();
int main(void) {
  outer_lib_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @outer_lib_func()
ret i32 0
}
void PutIntNum(numb, h, v) int numb, h, v;
{
  char temp[255];
  sprintf((char *)temp, "%d", numb);
  moveTo(h, v);
  drawString(h, v, temp);
}


x86 assembly (clang, -O0):
<PutIntNum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x4(%rbp),%edx
lea    0xeab(%rip),%rsi
mov    $0x0,%al
call   1040 <sprintf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1050 <moveTo@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
lea    -0x110(%rbp),%rdx
mov    $0x0,%al
call   1030 <drawString@plt>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PutIntNum>:
push   %rbp
push   %r14
push   %rbx
sub    $0x100,%rsp
mov    %edx,%ebx
mov    %esi,%ebp
mov    %edi,%edx
lea    0xeb8(%rip),%rsi
mov    %rsp,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <sprintf@plt>
mov    %ebp,%edi
mov    %ebx,%esi
xor    %eax,%eax
call   1050 <moveTo@plt>
mov    %ebp,%edi
mov    %ebx,%esi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <drawString@plt>
add    $0x100,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define void @PutIntNum(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca [255 x i8]
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%9 = load i32, i32* %4
%10 = call i32 (i8*, i8*, ...) @sprintf(i8* %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = load i32, i32* %5
%12 = load i32, i32* %6
%13 = call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %11, i32 %12)
%14 = load i32, i32* %5
%15 = load i32, i32* %6
%16 = getelementptr inbounds [255 x i8], [255 x i8]* %7, i64 0, i64 0
%17 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @drawString to i32 (i32, i32, i8*, ...)*)(i32 %14, i32 %15, i8* %16)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define void @PutIntNum(i32 %0, i32 %1, i32 %2) {
%4 = alloca [255 x i8]
%5 = getelementptr inbounds [255 x i8], [255 x i8]* %4, i64 0, i64 0
%6 = call i32 (i8*, i8*, ...) @sprintf(i8* %5, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %0)
%7 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @moveTo to i32 (i32, i32, ...)*)(i32 %1, i32 %2)
%8 = call i32 (i32, i32, i8*, ...) bitcast (i32 (...)* @drawString to i32 (i32, i32, i8*, ...)*)(i32 %1, i32 %2, i8* %5)
ret void
}
int test_imm_7Dint16_mem(short *val) {
  return ((*val) & (0x7D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_7Dint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 125
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ VirtualizeTimerC__0__Timer__stop(unsigned int);
void VirtualizeTimerC__1__TimerFrom__stop(void) {
  VirtualizeTimerC__0__Timer__stop(1U);
}


x86 assembly (clang, -O0):
<VirtualizeTimerC__1__TimerFrom__stop>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <VirtualizeTimerC__0__Timer__stop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<VirtualizeTimerC__1__TimerFrom__stop>:
mov    $0x1,%edi
jmp    1030 <VirtualizeTimerC__0__Timer__stop@plt>

LLVM IR (-O0):
define void @VirtualizeTimerC__1__TimerFrom__stop() {
%1 = call i32 @VirtualizeTimerC__0__Timer__stop(i32 1)
ret void
}

LLVM IR (-O2):
define void @VirtualizeTimerC__1__TimerFrom__stop() {
%1 = tail call i32 @VirtualizeTimerC__0__Timer__stop(i32 1)
ret void
}
int isPrime(int number) {
  if (number < 2)
    return 0;
  int temp = 2;
  while (number / temp >= temp) {
    if (number % temp == 0)
      return 0;
    temp++;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isPrime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    111d <isPrime+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1165 <isPrime+0x65>
movl   $0x2,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    -0xc(%rbp),%eax
jl     115e <isPrime+0x5e>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1150 <isPrime+0x50>
movl   $0x0,-0x4(%rbp)
jmp    1165 <isPrime+0x65>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1124 <isPrime+0x24>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isPrime>:
xor    %r8d,%r8d
cmp    $0x2,%edi
jge    110c <isPrime+0xc>
mov    %r8d,%eax
ret
cmp    $0x4,%edi
jae    1117 <isPrime+0x17>
mov    $0x1,%eax
ret
mov    $0x2,%esi
nopl   0x0(%rax)
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1108 <isPrime+0x8>
lea    0x1(%rsi),%ecx
mov    %edi,%eax
cltd
idiv   %ecx
cmp    %esi,%eax
mov    %ecx,%esi
jg     1120 <isPrime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @isPrime(i32 %0) {
%2 = icmp slt i32 %0, 2
br i1 %2, label %13, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4
br i1 %4, label %13, label %8
5: ; preds = %8
%6 = sdiv i32 %0, %12
%7 = icmp sgt i32 %6, %9
br i1 %7, label %8, label %13
8: ; preds = %3, %5
%9 = phi i32 [ %12, %5 ], [ 2, %3 ]
%10 = srem i32 %0, %9
%11 = icmp eq i32 %10, 0
%12 = add nuw nsw i32 %9, 1
br i1 %11, label %13, label %5
13: ; preds = %5, %8, %3, %1
%14 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 1, %5 ], [ 0, %8 ]
ret i32 %14
}
/* Variables and functions */
void *array_elem(void *elems, size_t i, size_t elem_size) {
  return (void *)(((void *)elems) + (i * elem_size));
}


x86 assembly (clang, -O0):
<array_elem>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
imul   -0x18(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_elem>:
imul   %rdx,%rsi
lea    (%rsi,%rdi,1),%rax
ret

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

LLVM IR (-O2):
define i8* @array_elem(i8* readnone %0, i64 %1, i64 %2) {
%4 = mul i64 %2, %1
%5 = getelementptr i8, i8* %0, i64 %4
ret i8* %5
}
/* Type definitions */
typedef scalar_t__ gid_t;

/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int getgroups(int gidsetlen, gid_t *gidset) {
  if (gidsetlen < 1) {
    errno = EINVAL;
    return -1;
  }
  gidset[0] = 0;
  return 1;
}


x86 assembly (clang, -O0):
<getgroups>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    1133 <getgroups+0x33>
mov    0x2ebc(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebb(%rip),%rax
mov    %ecx,(%rax)
movl   $0xffffffff,-0x4(%rbp)
jmp    1145 <getgroups+0x45>
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getgroups>:
test   %edi,%edi
jle    1111 <getgroups+0x11>
movq   $0x0,(%rsi)
mov    $0x1,%eax
ret
mov    0x2ec0(%rip),%rax
mov    (%rax),%eax
mov    0x2ebf(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @getgroups(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i64*
store i32 %0, i32* %4
store i64* %1, i64** %5
%6 = load i32, i32* %4
%7 = icmp slt i32 %6, 1
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i32, i32* @EINVAL
store i32 %9, i32* @errno
store i32 -1, i32* %3
br label %13
10: ; preds = %2
%11 = load i64*, i64** %5
%12 = getelementptr inbounds i64, i64* %11, i64 0
store i64 0, i64* %12
store i32 1, i32* %3
br label %13
13: ; preds = %10, %8
%14 = load i32, i32* %3
ret i32 %14
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @getgroups(i32 %0, i64* nocapture writeonly %1) {
%3 = icmp slt i32 %0, 1
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
br label %7
6: ; preds = %2
store i64 0, i64* %1
br label %7
7: ; preds = %6, %4
%8 = phi i32 [ -1, %4 ], [ 1, %6 ]
ret i32 %8
}
/* Variables and functions */
int syscall_cp(int);
int pause(void) { return syscall_cp(29); }


x86 assembly (clang, -O0):
<pause>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1d,%edi
call   1030 <syscall_cp@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<pause>:
mov    $0x1d,%edi
jmp    1030 <syscall_cp@plt>

LLVM IR (-O0):
define i32 @pause() {
%1 = call i32 @syscall_cp(i32 29)
ret i32 %1
}

LLVM IR (-O2):
define i32 @pause() {
%1 = tail call i32 @syscall_cp(i32 29)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ getpid();
int /*<<< orphan*/ kill(int /*<<< orphan*/, int);
int strtoull(char *, int /*<<< orphan*/ *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  int sig;
  if (argc <= 1) {
    sig = 1;
  } else {
    sig = strtoull(argv[1], NULL, 0);
  }
  kill(getpid(), sig);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x8(%rbp)
jg     115c <main+0x2c>
movl   $0x1,-0x14(%rbp)
jmp    1172 <main+0x42>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
xor    %edx,%edx
call   1040 <strtoull@plt>
mov    %eax,-0x14(%rbp)
mov    $0x0,%al
call   1030 <getpid@plt>
mov    %eax,%edi
mov    -0x14(%rbp),%esi
call   1050 <kill@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x1,%ebx
cmp    $0x2,%edi
jl     114a <main+0x1a>
mov    0x8(%rsi),%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <strtoull@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <getpid@plt>
mov    %eax,%edi
mov    %ebx,%esi
call   1050 <kill@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%7 = load i32, i32* %4
%8 = icmp sle i32 %7, 1
br i1 %8, label %9, label %10
9: ; preds = %2
store i32 1, i32* %6
br label %15
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = call i32 @strtoull(i8* %13, i32* null, i32 0)
store i32 %14, i32* %6
br label %15
15: ; preds = %10, %9
%16 = call i32 (...) @getpid()
%17 = load i32, i32* %6
%18 = call i32 @kill(i32 %16, i32 %17)
%19 = load i32, i32* %3
ret i32 %19
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = tail call i32 @strtoull(i8* nocapture %6, i32* null, i32 0)
br label %8
8: ; preds = %2, %4
%9 = phi i32 [ %7, %4 ], [ 1, %2 ]
%10 = tail call i32 (...) @getpid()
%11 = tail call i32 @kill(i32 %10, i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ glutInit(int *, char **);
int /*<<< orphan*/ glutInitWindowPosition(int /*<<< orphan*/,
                                          int /*<<< orphan*/);
void s2winInit(int *argc, char **argv) {
  glutInit(argc, argv);
  glutInitWindowPosition(0, 0);
}


x86 assembly (clang, -O0):
<s2winInit>:
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   1040 <glutInit@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1030 <glutInitWindowPosition@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<s2winInit>:
push   %rax
call   1040 <glutInit@plt>
xor    %edi,%edi
xor    %esi,%esi
pop    %rax
jmp    1030 <glutInitWindowPosition@plt>

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

LLVM IR (-O2):
define void @s2winInit(i32* %0, i8** %1) {
%3 = tail call i32 @glutInit(i32* %0, i8** %1)
%4 = tail call i32 @glutInitWindowPosition(i32 0, i32 0)
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int dobldobl_Newton_Laurent_step(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(327, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_Newton_Laurent_step>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x147,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_Newton_Laurent_step>:
mov    $0x147,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @dobldobl_Newton_Laurent_step() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 327, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @dobldobl_Newton_Laurent_step() {
%1 = tail call i32 @_ada_use_c2phc(i32 327, i32* undef, i32* undef, double* undef)
ret i32 %1
}
void free_ldouble(long double *ret) {}


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

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

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

LLVM IR (-O2):
define void @free_ldouble(x86_fp80* nocapture %0) {
ret void
}
/* Variables and functions */
int g(int, int);
int f(int xx, int yy) {
  int i = xx * yy;
  i = g(xx, yy) + i;
  return i;
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <g@plt>
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %esi,%ebx
imul   %edi,%ebx
call   1030 <g@plt>
add    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @f(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = mul nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %3
%10 = load i32, i32* %4
%11 = call i32 @g(i32 %9, i32 %10)
%12 = load i32, i32* %5
%13 = add nsw i32 %11, %12
store i32 %13, i32* %5
%14 = load i32, i32* %5
ret i32 %14
}

LLVM IR (-O2):
define i32 @f(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @g(i32 %0, i32 %1)
%5 = add nsw i32 %4, %3
ret i32 %5
}
void ff_hevc_put_hevc_uni_qpel_h16_10_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_uni_qpel_h16_10_sse4() {
ret void
}
int gtst(int inv, int t) { return 0; }


x86 assembly (clang, -O0):
<gtst>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @gtst(i32 %0, i32 %1) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
extern void printHelloC() {
  printf("Hello from C in "
         "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
         "2022-01-22/02-19-57/repos/Distrotech/qbs/refs/heads/master/tests/"
         "auto/api/testdata/same-base-name/lib.c"
         "\n");
}


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

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

LLVM IR (-O0):
@.str = [185 x i8] c"Hello from C in /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Distrotech/qbs/refs/heads/master/tests/auto/api/testdata/same-base-name/lib.c\0A\00"
define void @printHelloC() {
%1 = call i32 @printf(i8* getelementptr inbounds ([185 x i8], [185 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [184 x i8] c"Hello from C in /scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/Distrotech/qbs/refs/heads/master/tests/auto/api/testdata/same-base-name/lib.c\00"
define void @printHelloC() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([184 x i8], [184 x i8]* @str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ maint_clean_range(unsigned long, unsigned long);
int /*<<< orphan*/ outer_clean_range(unsigned long, unsigned long);
void clean_dcache_range(unsigned long start, unsigned long end) {
  maint_clean_range(start, end);
  outer_clean_range(start, end);
}


x86 assembly (clang, -O0):
<clean_dcache_range>:
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 <maint_clean_range@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <outer_clean_range@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_dcache_range>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
call   1030 <maint_clean_range@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <outer_clean_range@plt>

LLVM IR (-O0):
define void @clean_dcache_range(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 = call i32 @maint_clean_range(i64 %5, i64 %6)
%8 = load i64, i64* %3
%9 = load i64, i64* %4
%10 = call i32 @outer_clean_range(i64 %8, i64 %9)
ret void
}

LLVM IR (-O2):
define void @clean_dcache_range(i64 %0, i64 %1) {
%3 = tail call i32 @maint_clean_range(i64 %0, i64 %1)
%4 = tail call i32 @outer_clean_range(i64 %0, i64 %1)
ret void
}
void INT_Excep_PERIB_INTB142(void) {}


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

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

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

LLVM IR (-O2):
define void @INT_Excep_PERIB_INTB142() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ g(int);
int /*<<< orphan*/ printf(char *, int);
void f(int x) {
  printf("f(%d)\n", x);
  if (x > 1)
    g(x - 1);
}


x86 assembly (clang, -O0):
<f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%esi
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
cmpl   $0x1,-0x4(%rbp)
jle    114f <f+0x2f>
mov    -0x4(%rbp),%edi
sub    $0x1,%edi
call   1040 <g@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f>:
push   %rbx
mov    %edi,%ebx
lea    0xed6(%rip),%rdi
mov    %ebx,%esi
call   1030 <printf@plt>
cmp    $0x2,%ebx
jl     1141 <f+0x21>
add    $0xffffffff,%ebx
mov    %ebx,%edi
pop    %rbx
jmp    1040 <g@plt>
pop    %rbx
ret

LLVM IR (-O0):
@.str = [7 x i8] c"f(%d)\0A\00"
define void @f(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = load i32, i32* %2
%6 = icmp sgt i32 %5, 1
br i1 %6, label %7, label %11
7: ; preds = %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %8, 1
%10 = call i32 @g(i32 %9)
br label %11
11: ; preds = %7, %1
ret void
}

LLVM IR (-O2):
@.str = [7 x i8] c"f(%d)\0A\00"
define void @f(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i32 %0)
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nsw i32 %0, -1
%6 = tail call i32 @g(i32 %5)
br label %7
7: ; preds = %4, %1
ret void
}
void pthread_cleanup_push(void (*routine)(void *), void *arg) {
  (void)routine;
  (void)arg;
}


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

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

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

LLVM IR (-O2):
define void @pthread_cleanup_push(void (i8*)* nocapture %0, i8* nocapture %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DEBUG_ASSERT(int);
void I2STxRxEnable(unsigned long ulBase) {
  DEBUG_ASSERT(ulBase == 0x40054000);
  (*((volatile unsigned long *)(ulBase + 0x00000010))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000810))) = 0x00000001;
  (*((volatile unsigned long *)(ulBase + 0x00000C00))) |=
      0x00000001 | 0x00000002;
}


x86 assembly (clang, -O0):
<I2STxRxEnable>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x40054000,-0x8(%rbp)
40
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <DEBUG_ASSERT@plt>
mov    -0x8(%rbp),%rax
movq   $0x1,0x10(%rax)
mov    -0x8(%rbp),%rax
movq   $0x1,0x810(%rax)
mov    -0x8(%rbp),%rax
mov    0xc00(%rax),%rcx
or     $0x3,%rcx
mov    %rcx,0xc00(%rax)
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2STxRxEnable>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x40054000,%rbx
sete   %dil
call   1030 <DEBUG_ASSERT@plt>
movq   $0x1,0x10(%rbx)
movq   $0x1,0x810(%rbx)
orq    $0x3,0xc00(%rbx)
03
pop    %rbx
ret

LLVM IR (-O0):
define void @I2STxRxEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 %3, 1074085888
%5 = zext i1 %4 to i32
%6 = call i32 @DEBUG_ASSERT(i32 %5)
%7 = load i64, i64* %2
%8 = add i64 %7, 16
%9 = inttoptr i64 %8 to i64*
store volatile i64 1, i64* %9
%10 = load i64, i64* %2
%11 = add i64 %10, 2064
%12 = inttoptr i64 %11 to i64*
store volatile i64 1, i64* %12
%13 = load i64, i64* %2
%14 = add i64 %13, 3072
%15 = inttoptr i64 %14 to i64*
%16 = load volatile i64, i64* %15
%17 = or i64 %16, 3
store volatile i64 %17, i64* %15
ret void
}

LLVM IR (-O2):
define void @I2STxRxEnable(i64 %0) {
%2 = icmp eq i64 %0, 1074085888
%3 = zext i1 %2 to i32
%4 = tail call i32 @DEBUG_ASSERT(i32 %3)
%5 = add i64 %0, 16
%6 = inttoptr i64 %5 to i64*
store volatile i64 1, i64* %6
%7 = add i64 %0, 2064
%8 = inttoptr i64 %7 to i64*
store volatile i64 1, i64* %8
%9 = add i64 %0, 3072
%10 = inttoptr i64 %9 to i64*
%11 = load volatile i64, i64* %10
%12 = or i64 %11, 3
store volatile i64 %12, i64* %10
ret void
}
void _sys_exit(void) { return; }


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

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

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

LLVM IR (-O2):
define void @_sys_exit() {
ret void
}
int foo(const char *str) {
  if (str) {
    return 42;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     111f <foo+0x1f>
movl   $0x2a,-0x4(%rbp)
jmp    1126 <foo+0x26>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
xor    %ecx,%ecx
test   %rdi,%rdi
mov    $0x2a,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @foo(i8* readnone %0) {
%2 = icmp eq i8* %0, null
%3 = select i1 %2, i32 0, i32 42
ret i32 %3
}
/* Variables and functions */
int crypto1(char *, char *);
int /*<<< orphan*/ help();
int main(int argc, char *argv[]) {
  if (argc < 3)
    help();
  else
    return crypto1(argv[1], argv[2]);
  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)
cmpl   $0x3,-0x8(%rbp)
jge    114c <main+0x2c>
mov    $0x0,%al
call   1040 <help@plt>
jmp    1169 <main+0x49>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
call   1030 <crypto1@plt>
mov    %eax,-0x4(%rbp)
jmp    1170 <main+0x50>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x2,%edi
jg     1131 <main+0x11>
xor    %eax,%eax
call   1040 <help@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    0x8(%rsi),%rdi
mov    0x10(%rsi),%rsi
pop    %rax
jmp    1030 <crypto1@plt>

LLVM IR (-O0):
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 = load i32, i32* %4
%7 = icmp slt i32 %6, 3
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = call i32 (...) @help()
br label %18
10: ; preds = %2
%11 = load i8**, i8*** %5
%12 = getelementptr inbounds i8*, i8** %11, i64 1
%13 = load i8*, i8** %12
%14 = load i8**, i8*** %5
%15 = getelementptr inbounds i8*, i8** %14, i64 2
%16 = load i8*, i8** %15
%17 = call i32 @crypto1(i8* %13, i8* %16)
store i32 %17, i32* %3
br label %19
18: ; preds = %8
store i32 0, i32* %3
br label %19
19: ; preds = %18, %10
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 3
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (...) @help()
br label %12
6: ; preds = %2
%7 = getelementptr inbounds i8*, i8** %1, i64 1
%8 = load i8*, i8** %7
%9 = getelementptr inbounds i8*, i8** %1, i64 2
%10 = load i8*, i8** %9
%11 = tail call i32 @crypto1(i8* %8, i8* %10)
br label %12
12: ; preds = %4, %6
%13 = phi i32 [ 0, %4 ], [ %11, %6 ]
ret i32 %13
}
/* Variables and functions */
int sqrt(double);
short adjustedLightValue(short x) {
  if (x <= 150) {
    return x;
  } else {
    return (short)(sqrt(((double)x) / 150) * 150 + 0.00001);
  }
}


x86 assembly (clang, -O0):
<adjustedLightValue>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x4(%rbp)
movswl -0x4(%rbp),%eax
cmp    $0x96,%eax
jg     113b <adjustedLightValue+0x2b>
mov    -0x4(%rbp),%ax
mov    %ax,-0x2(%rbp)
jmp    1172 <adjustedLightValue+0x62>
movswl -0x4(%rbp),%eax
cvtsi2sd %eax,%xmm0
movsd  0xeb5(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
imul   $0x96,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  0xea2(%rip),%xmm1
addsd  %xmm1,%xmm0
cvttsd2si %xmm0,%eax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<adjustedLightValue>:
mov    %edi,%eax
cmp    $0x97,%edi
jl     114a <adjustedLightValue+0x3a>
push   %rax
cwtl
cvtsi2sd %eax,%xmm0
divsd  0xed8(%rip),%xmm0
call   1030 <sqrt@plt>
imul   $0x96,%eax,%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
addsd  0xec6(%rip),%xmm0
cvttsd2si %xmm0,%eax
add    $0x8,%rsp
ret

LLVM IR (-O0):
define signext i16 @adjustedLightValue(i16 signext %0) {
%2 = alloca i16
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = sext i16 %4 to i32
%6 = icmp sle i32 %5, 150
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i16, i16* %3
store i16 %8, i16* %2
br label %18
9: ; preds = %1
%10 = load i16, i16* %3
%11 = sitofp i16 %10 to double
%12 = fdiv double %11, 1.500000e+02
%13 = call i32 @sqrt(double %12)
%14 = mul nsw i32 %13, 150
%15 = sitofp i32 %14 to double
%16 = fadd double %15, 1.000000e-05
%17 = fptosi double %16 to i16
store i16 %17, i16* %2
br label %18
18: ; preds = %9, %7
%19 = load i16, i16* %2
ret i16 %19
}

LLVM IR (-O2):
define signext i16 @adjustedLightValue(i16 signext %0) {
%2 = icmp slt i16 %0, 151
br i1 %2, label %11, label %3
3: ; preds = %1
%4 = sitofp i16 %0 to double
%5 = fdiv double %4, 1.500000e+02
%6 = tail call i32 @sqrt(double %5)
%7 = mul nsw i32 %6, 150
%8 = sitofp i32 %7 to double
%9 = fadd double %8, 1.000000e-05
%10 = fptosi double %9 to i16
br label %11
11: ; preds = %1, %3
%12 = phi i16 [ %10, %3 ], [ %0, %1 ]
ret i16 %12
}
/* Variables and functions */
int hex_init();
int module_hex_init(void) { return hex_init(); }


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

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

LLVM IR (-O0):
define i32 @module_hex_init() {
%1 = call i32 (...) @hex_init()
ret i32 %1
}

LLVM IR (-O2):
define i32 @module_hex_init() {
%1 = tail call i32 (...) @hex_init()
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ m_free(int);
void s_free(int m) { m_free(m); }


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

x86 assembly (clang, -O2):
<s_free>:
jmp    1030 <m_free@plt>

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

LLVM IR (-O2):
define void @s_free(i32 %0) {
%2 = tail call i32 @m_free(i32 %0)
ret void
}
void _marshall_putfloat(void *pBuf, float fVal) {
  ((char *)(pBuf))[0] = ((char *)(&fVal))[3],
         ((char *)(pBuf))[1] = ((char *)(&fVal))[2],
         ((char *)(pBuf))[2] = ((char *)(&fVal))[1],
         ((char *)(pBuf))[3] = ((char *)(&fVal))[0];
}


x86 assembly (clang, -O0):
<_marshall_putfloat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    -0x9(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xa(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xb(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0xc(%rbp),%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x3(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<_marshall_putfloat>:
movd   %xmm0,%eax
bswap  %eax
mov    %eax,(%rdi)
ret

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

LLVM IR (-O2):
define void @_marshall_putfloat(i8* nocapture writeonly %0, float %1) {
%3 = bitcast float %1 to i32
%4 = lshr i32 %3, 24
%5 = trunc i32 %4 to i8
store i8 %5, i8* %0
%6 = lshr i32 %3, 16
%7 = trunc i32 %6 to i8
%8 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %7, i8* %8
%9 = lshr i32 %3, 8
%10 = trunc i32 %9 to i8
%11 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %10, i8* %11
%12 = trunc i32 %3 to i8
%13 = getelementptr inbounds i8, i8* %0, i64 3
store i8 %12, i8* %13
ret void
}
int get_absolute_num(int i, int j, int k) {
  return 1 + k * (201) * (201) + j * (201) + i;
}


x86 assembly (clang, -O0):
<get_absolute_num>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
imul   $0xc9,-0xc(%rbp),%eax
imul   $0xc9,%eax,%eax
add    $0x1,%eax
imul   $0xc9,-0x8(%rbp),%ecx
add    %ecx,%eax
add    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_absolute_num>:
imul   $0x9dd1,%edx,%eax
imul   $0xc9,%esi,%ecx
add    %edi,%ecx
add    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @get_absolute_num(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = mul nsw i32 %7, 201
%9 = mul nsw i32 %8, 201
%10 = add nsw i32 1, %9
%11 = load i32, i32* %5
%12 = mul nsw i32 %11, 201
%13 = add nsw i32 %10, %12
%14 = load i32, i32* %4
%15 = add nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @get_absolute_num(i32 %0, i32 %1, i32 %2) {
%4 = mul i32 %2, 40401
%5 = mul nsw i32 %1, 201
%6 = add i32 %0, 1
%7 = add i32 %6, %5
%8 = add i32 %7, %4
ret i32 %8
}
/* Variables and functions */
scalar_t__ malloc(int);
char **clibf_create_table(int len) {
  char **result = (char **)malloc(len * sizeof(char));
  return result;
}


x86 assembly (clang, -O0):
<clibf_create_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clibf_create_table>:
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8** @clibf_create_table(i32 %0) {
%2 = alloca i32
%3 = alloca i8**
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i64 @malloc(i32 %7)
%9 = inttoptr i64 %8 to i8**
store i8** %9, i8*** %3
%10 = load i8**, i8*** %3
ret i8** %10
}

LLVM IR (-O2):
define i8** @clibf_create_table(i32 %0) {
%2 = tail call i64 @malloc(i32 %0)
%3 = inttoptr i64 %2 to i8**
ret i8** %3
}
signed char fnxxx(unsigned char c) {
  return ((((c)&0x01) << 7) | (((c)&0x02) << 5) | (((c)&0x04) << 3) |
          (((c)&0x08) << 1) | (((c)&0x10) >> 1) | (((c)&0x20) >> 3) |
          (((c)&0x40) >> 5) | (((c)&0x80) >> 7));
}


x86 assembly (clang, -O0):
<fnxxx>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0x1,%eax
shl    $0x7,%eax
movzbl -0x1(%rbp),%ecx
and    $0x2,%ecx
shl    $0x5,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x4,%ecx
shl    $0x3,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x8,%ecx
shl    $0x1,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x10,%ecx
sar    $0x1,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x20,%ecx
sar    $0x3,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x40,%ecx
sar    $0x5,%ecx
or     %ecx,%eax
movzbl -0x1(%rbp),%ecx
and    $0x80,%ecx
sar    $0x7,%ecx
or     %ecx,%eax
movsbl %al,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @fnxxx(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 1
%6 = shl i32 %5, 7
%7 = load i8, i8* %2
%8 = zext i8 %7 to i32
%9 = and i32 %8, 2
%10 = shl i32 %9, 5
%11 = or i32 %6, %10
%12 = load i8, i8* %2
%13 = zext i8 %12 to i32
%14 = and i32 %13, 4
%15 = shl i32 %14, 3
%16 = or i32 %11, %15
%17 = load i8, i8* %2
%18 = zext i8 %17 to i32
%19 = and i32 %18, 8
%20 = shl i32 %19, 1
%21 = or i32 %16, %20
%22 = load i8, i8* %2
%23 = zext i8 %22 to i32
%24 = and i32 %23, 16
%25 = ashr i32 %24, 1
%26 = or i32 %21, %25
%27 = load i8, i8* %2
%28 = zext i8 %27 to i32
%29 = and i32 %28, 32
%30 = ashr i32 %29, 3
%31 = or i32 %26, %30
%32 = load i8, i8* %2
%33 = zext i8 %32 to i32
%34 = and i32 %33, 64
%35 = ashr i32 %34, 5
%36 = or i32 %31, %35
%37 = load i8, i8* %2
%38 = zext i8 %37 to i32
%39 = and i32 %38, 128
%40 = ashr i32 %39, 7
%41 = or i32 %36, %40
%42 = trunc i32 %41 to i8
ret i8 %42
}

LLVM IR (-O2):
define signext i8 @fnxxx(i8 zeroext %0) {
%2 = tail call i8 @llvm.bitreverse.i8(i8 %0)
ret i8 %2
}
_Bool Int_safe_MINUS_sub(int x, int y, int *res) {
  return __builtin_ssub_overflow(x, y, res);
}


x86 assembly (clang, -O0):
<Int_safe_MINUS_sub>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%rcx
sub    %eax,%edx
seto   %al
mov    %edx,(%rcx)
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Int_safe_MINUS_sub>:
sub    %esi,%edi
seto   %al
mov    %edi,(%rdx)
ret

LLVM IR (-O0):
define zeroext i1 @Int_safe_MINUS_sub(i32 %0, i32 %1, i32* %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32*
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32, i32* %4
%8 = load i32, i32* %5
%9 = load i32*, i32** %6
%10 = call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %7, i32 %8)
%11 = extractvalue { i32, i1 } %10, 1
%12 = extractvalue { i32, i1 } %10, 0
store i32 %12, i32* %9
ret i1 %11
}

LLVM IR (-O2):
define zeroext i1 @Int_safe_MINUS_sub(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = tail call { i32, i1 } @llvm.ssub.with.overflow.i32(i32 %0, i32 %1)
%5 = extractvalue { i32, i1 } %4, 1
%6 = extractvalue { i32, i1 } %4, 0
store i32 %6, i32* %2
ret i1 %5
}
unsigned int pair_second(unsigned int x) { return x & 0xffff; }


x86 assembly (clang, -O0):
<pair_second>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pair_second>:
movzwl %di,%eax
ret

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

LLVM IR (-O2):
define i32 @pair_second(i32 %0) {
%2 = and i32 %0, 65535
ret i32 %2
}
/* Variables and functions */
scalar_t__ is_transmit_empty_serial(int);
int /*<<< orphan*/ outb(int, char);
void write_serial(int port, char a) {
  while (is_transmit_empty_serial(port) == 0)
    ;
  outb(port, a);
}


x86 assembly (clang, -O0):
<write_serial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
mov    -0x4(%rbp),%edi
call   1040 <is_transmit_empty_serial@plt>
cmp    $0x0,%rax
jne    1148 <write_serial+0x28>
jmp    1131 <write_serial+0x11>
mov    -0x4(%rbp),%edi
movsbl -0x5(%rbp),%esi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_serial>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    %ebx,%edi
call   1040 <is_transmit_empty_serial@plt>
test   %rax,%rax
je     1130 <write_serial+0x10>
movsbl %bpl,%esi
mov    %ebx,%edi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @write_serial(i32 %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8
store i32 %0, i32* %3
store i8 %1, i8* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %3
%7 = call i64 @is_transmit_empty_serial(i32 %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %5
br label %5
10: ; preds = %5
%11 = load i32, i32* %3
%12 = load i8, i8* %4
%13 = call i32 @outb(i32 %11, i8 signext %12)
ret void
}

LLVM IR (-O2):
define void @write_serial(i32 %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = tail call i64 @is_transmit_empty_serial(i32 %0)
%5 = icmp eq i64 %4, 0
br i1 %5, label %3, label %6
6: ; preds = %3
%7 = tail call i32 @outb(i32 %0, i8 signext %1)
ret void
}
int comp(const void *a, const void *b) {
  int *a1 = (int *)a;
  int *a2 = (int *)b;
  return *a1 - *a2;
}


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

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

LLVM IR (-O0):
define i32 @comp(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%7 = load i8*, i8** %3
%8 = bitcast i8* %7 to i32*
store i32* %8, i32** %5
%9 = load i8*, i8** %4
%10 = bitcast i8* %9 to i32*
store i32* %10, i32** %6
%11 = load i32*, i32** %5
%12 = load i32, i32* %11
%13 = load i32*, i32** %6
%14 = load i32, i32* %13
%15 = sub nsw i32 %12, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @comp(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = bitcast i8* %1 to i32*
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = sub nsw i32 %5, %6
ret i32 %7
}
unsigned long xorshift32(unsigned long x) {
  x ^= x << 13;
  x ^= x >> 17;
  x ^= x << 5;
  return x;
}


x86 assembly (clang, -O0):
<xorshift32>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0xd,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x11,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x5,%rax
xor    -0x8(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xorshift32>:
mov    %rdi,%rax
shl    $0xd,%rax
xor    %rdi,%rax
mov    %rax,%rcx
shr    $0x11,%rcx
xor    %rax,%rcx
mov    %rcx,%rax
shl    $0x5,%rax
xor    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @xorshift32(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 13
%5 = load i64, i64* %2
%6 = xor i64 %5, %4
store i64 %6, i64* %2
%7 = load i64, i64* %2
%8 = lshr i64 %7, 17
%9 = load i64, i64* %2
%10 = xor i64 %9, %8
store i64 %10, i64* %2
%11 = load i64, i64* %2
%12 = shl i64 %11, 5
%13 = load i64, i64* %2
%14 = xor i64 %13, %12
store i64 %14, i64* %2
%15 = load i64, i64* %2
ret i64 %15
}

LLVM IR (-O2):
define i64 @xorshift32(i64 %0) {
%2 = shl i64 %0, 13
%3 = xor i64 %2, %0
%4 = lshr i64 %3, 17
%5 = xor i64 %4, %3
%6 = shl i64 %5, 5
%7 = xor i64 %6, %5
ret i64 %7
}