xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ AT_FDCWD;
int /*<<< orphan*/ readlinkat(int /*<<< orphan*/, char const *, char *, size_t);
ssize_t readlink(const char *restrict path, char *restrict buf, size_t bufsiz) {
  return readlinkat(AT_FDCWD, path, buf, bufsiz);
}


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

x86 assembly (clang, -O2):
<readlink>:
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
jmp    1030 <readlinkat@plt>

LLVM IR (-O0):
@AT_FDCWD = global i32 0
define i32 @readlink(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i64
store i8* %0, i8** %4
store i8* %1, i8** %5
store i64 %2, i64* %6
%7 = load i32, i32* @AT_FDCWD
%8 = load i8*, i8** %4
%9 = load i8*, i8** %5
%10 = load i64, i64* %6
%11 = call i32 @readlinkat(i32 %7, i8* %8, i8* %9, i64 %10)
ret i32 %11
}

LLVM IR (-O2):
@AT_FDCWD = global i32 0
define i32 @readlink(i8* noalias %0, i8* noalias %1, i64 %2) {
%4 = load i32, i32* @AT_FDCWD
%5 = tail call i32 @readlinkat(i32 %4, i8* %0, i8* %1, i64 %2)
ret i32 %5
}
/* Type definitions */
typedef int int64_t;
typedef int int32_t;

/* Variables and functions */
int32_t soft_timer_ms_to_ticks(int32_t ms) {
  return (((int64_t)ms) * 32768) / 1000;
}


x86 assembly (clang, -O0):
<soft_timer_ms_to_ticks>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shl    $0xf,%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<soft_timer_ms_to_ticks>:
shl    $0xf,%edi
movslq %edi,%rax
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @soft_timer_ms_to_ticks(i32 %0) {
%2 = shl nsw i32 %0, 15
%3 = sdiv i32 %2, 1000
ret i32 %3
}
void ff_hevc_put_hevc_qpel_hv12_12_sse4() {}


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

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

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

LLVM IR (-O2):
define void @ff_hevc_put_hevc_qpel_hv12_12_sse4() {
ret void
}
long long int fibonacci() {
  static long long int first = 0;
  static long long int second = 1;
  long long int out = first + second;
  first = second;
  second = out;
  return out;
}


x86 assembly (clang, -O0):
<fibonacci>:
push   %rbp
mov    %rsp,%rbp
mov    0x2f25(%rip),%rax
add    0x2f0e(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    0x2f03(%rip),%rax
mov    %rax,0x2f0c(%rip)
mov    -0x8(%rbp),%rax
mov    %rax,0x2ef1(%rip)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<fibonacci>:
mov    0x2f19(%rip),%rcx
mov    0x2f22(%rip),%rax
add    %rcx,%rax
mov    %rcx,0x2f18(%rip)
mov    %rax,0x2f01(%rip)
ret

LLVM IR (-O0):
@fibonacci.first = internal global i64 0
@fibonacci.second = internal global i64 1
define i64 @fibonacci() {
%1 = alloca i64
%2 = load i64, i64* @fibonacci.first
%3 = load i64, i64* @fibonacci.second
%4 = add nsw i64 %2, %3
store i64 %4, i64* %1
%5 = load i64, i64* @fibonacci.second
store i64 %5, i64* @fibonacci.first
%6 = load i64, i64* %1
store i64 %6, i64* @fibonacci.second
%7 = load i64, i64* %1
ret i64 %7
}

LLVM IR (-O2):
@fibonacci.first = internal unnamed_addr global i64 0
@fibonacci.second = internal unnamed_addr global i64 1
define i64 @fibonacci() {
%1 = load i64, i64* @fibonacci.first
%2 = load i64, i64* @fibonacci.second
%3 = add nsw i64 %2, %1
store i64 %2, i64* @fibonacci.first
store i64 %3, i64* @fibonacci.second
ret i64 %3
}
/* Variables and functions */
scalar_t__ RAND_MAX;
scalar_t__ rand();
double tools_uniform(double min, double max) {
  return ((double)rand()) / ((double)(RAND_MAX)) * (max - min) + min;
}


x86 assembly (clang, -O0):
<tools_uniform>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
mov    $0x0,%al
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm0
mov    0x2eb3(%rip),%rax
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm0
movsd  -0x10(%rbp),%xmm2
subsd  -0x8(%rbp),%xmm2
movsd  -0x8(%rbp),%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tools_uniform>:
sub    $0x18,%rsp
movsd  %xmm1,0x10(%rsp)
movsd  %xmm0,0x8(%rsp)
xor    %eax,%eax
call   1030 <rand@plt>
cvtsi2sd %rax,%xmm2
mov    0x2eb5(%rip),%rax
xorps  %xmm1,%xmm1
cvtsi2sdq (%rax),%xmm1
divsd  %xmm1,%xmm2
movsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
subsd  %xmm1,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
@RAND_MAX = global i64 0
define double @tools_uniform(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = call i64 (...) @rand()
%6 = sitofp i64 %5 to double
%7 = load i64, i64* @RAND_MAX
%8 = sitofp i64 %7 to double
%9 = fdiv double %6, %8
%10 = load double, double* %4
%11 = load double, double* %3
%12 = fsub double %10, %11
%13 = load double, double* %3
%14 = call double @llvm.fmuladd.f64(double %9, double %12, double %13)
ret double %14
}

LLVM IR (-O2):
@RAND_MAX = global i64 0
define double @tools_uniform(double %0, double %1) {
%3 = tail call i64 (...) @rand()
%4 = sitofp i64 %3 to double
%5 = load i64, i64* @RAND_MAX
%6 = sitofp i64 %5 to double
%7 = fdiv double %4, %6
%8 = fsub double %1, %0
%9 = tail call double @llvm.fmuladd.f64(double %7, double %8, double %0)
ret double %9
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ line_Comment(int /*<<< orphan*/ *);
int octal(int c, FILE *source_file) {
  if (c >= '0' && c <= '7')
    return (c - 48);
  else if (c == '#' || c == ';')
    line_Comment(source_file);
  return -1;
}


x86 assembly (clang, -O0):
<octal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x30,-0x8(%rbp)
jl     1141 <octal+0x31>
cmpl   $0x37,-0x8(%rbp)
jg     1141 <octal+0x31>
mov    -0x8(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x4(%rbp)
jmp    116a <octal+0x5a>
cmpl   $0x23,-0x8(%rbp)
je     1155 <octal+0x45>
cmpl   $0x3b,-0x8(%rbp)
jne    115e <octal+0x4e>
mov    -0x10(%rbp),%rdi
call   1030 <line_Comment@plt>
jmp    1163 <octal+0x53>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<octal>:
push   %rbx
mov    %edi,%eax
and    $0xfffffff8,%eax
cmp    $0x30,%eax
jne    1122 <octal+0x12>
add    $0xffffffd0,%edi
mov    %edi,%ebx
jmp    1139 <octal+0x29>
mov    $0xffffffff,%ebx
cmp    $0x3b,%edi
je     1131 <octal+0x21>
cmp    $0x23,%edi
jne    1139 <octal+0x29>
mov    %rsi,%rdi
call   1030 <line_Comment@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @octal(i32 %0, i32* %1) {
%3 = and i32 %0, -8
%4 = icmp eq i32 %3, 48
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = add nsw i32 %0, -48
br label %10
7: ; preds = %2
switch i32 %0, label %10 [
i32 59, label %8
i32 35, label %8
]
8: ; preds = %7, %7
%9 = tail call i32 @line_Comment(i32* %1)
br label %10
10: ; preds = %8, %7, %5
%11 = phi i32 [ %6, %5 ], [ -1, %7 ], [ -1, %8 ]
ret i32 %11
}
/* Type definitions */
typedef long uint32_t;

/* Variables and functions */
long htonl(long);
void swap_4byte(uint32_t *i) {
  if (sizeof(long) != sizeof(uint32_t)) {
    *i = htonl(*i);
  } else {
    long *cursor = (long *)i;
    *cursor = htonl(*cursor);
  }
}


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

x86 assembly (clang, -O2):
<swap_4byte>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <htonl@plt>
mov    %rax,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @swap_4byte(i64* %0) {
%2 = alloca i64*
%3 = alloca i64*
store i64* %0, i64** %2
%4 = load i64*, i64** %2
store i64* %4, i64** %3
%5 = load i64*, i64** %3
%6 = load i64, i64* %5
%7 = call i64 @htonl(i64 %6)
%8 = load i64*, i64** %3
store i64 %7, i64* %8
ret void
}

LLVM IR (-O2):
define void @swap_4byte(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = tail call i64 @htonl(i64 %2)
store i64 %3, i64* %0
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int /*<<< orphan*/ read(int, void *, size_t);
__attribute__((__weak__, __always___)) ssize_t
softboundcets_read(int fd, void *buf, size_t count) {
  return read(fd, buf, count);
}


x86 assembly (clang, -O0):
<softboundcets_read>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
call   1030 <read@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<softboundcets_read>:
jmp    1030 <read@plt>

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

LLVM IR (-O2):
define weak i32 @softboundcets_read(i32 %0, i8* %1, i64 %2) {
%4 = tail call i32 @read(i32 %0, i8* %1, i64 %2)
ret i32 %4
}
unsigned long swap(unsigned long x, unsigned long y, unsigned long mask) {
  unsigned long d = y - x;
  unsigned long m = (mask & d) >> 4;
  unsigned long max = (x & m) | (y & ~m);
  unsigned long min = (x & ~m) | (y & m);
  unsigned long r = (max << 4) | min;
  return r;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
and    -0x20(%rbp),%rax
shr    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
and    -0x28(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    -0x28(%rbp),%rdx
xor    $0xffffffffffffffff,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x28(%rbp),%rcx
xor    $0xffffffffffffffff,%rcx
and    %rcx,%rax
mov    -0x10(%rbp),%rcx
and    -0x28(%rbp),%rcx
or     %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x30(%rbp),%rax
shl    $0x4,%rax
or     -0x38(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
mov    %rsi,%rcx
sub    %rdi,%rcx
and    %rdx,%rcx
shr    $0x4,%rcx
mov    %rcx,%r8
and    %rdi,%r8
mov    %rcx,%rdx
not    %rdx
mov    %rdx,%rax
and    %rsi,%rax
or     %r8,%rax
and    %rdi,%rdx
and    %rsi,%rcx
or     %rdx,%rcx
shl    $0x4,%rax
or     %rcx,%rax
ret

LLVM IR (-O0):
define i64 @swap(i64 %0, i64 %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
%8 = alloca i64
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%12 = load i64, i64* %5
%13 = load i64, i64* %4
%14 = sub i64 %12, %13
store i64 %14, i64* %7
%15 = load i64, i64* %6
%16 = load i64, i64* %7
%17 = and i64 %15, %16
%18 = lshr i64 %17, 4
store i64 %18, i64* %8
%19 = load i64, i64* %4
%20 = load i64, i64* %8
%21 = and i64 %19, %20
%22 = load i64, i64* %5
%23 = load i64, i64* %8
%24 = xor i64 %23, -1
%25 = and i64 %22, %24
%26 = or i64 %21, %25
store i64 %26, i64* %9
%27 = load i64, i64* %4
%28 = load i64, i64* %8
%29 = xor i64 %28, -1
%30 = and i64 %27, %29
%31 = load i64, i64* %5
%32 = load i64, i64* %8
%33 = and i64 %31, %32
%34 = or i64 %30, %33
store i64 %34, i64* %10
%35 = load i64, i64* %9
%36 = shl i64 %35, 4
%37 = load i64, i64* %10
%38 = or i64 %36, %37
store i64 %38, i64* %11
%39 = load i64, i64* %11
ret i64 %39
}

LLVM IR (-O2):
define i64 @swap(i64 %0, i64 %1, i64 %2) {
%4 = sub i64 %1, %0
%5 = and i64 %4, %2
%6 = lshr i64 %5, 4
%7 = and i64 %6, %0
%8 = xor i64 %6, -1
%9 = and i64 %8, %1
%10 = or i64 %7, %9
%11 = and i64 %8, %0
%12 = and i64 %6, %1
%13 = or i64 %11, %12
%14 = shl i64 %10, 4
%15 = or i64 %13, %14
ret i64 %15
}
int main() {
  int a;
  a = 3;
  if (a)
    return 1;
  return 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x3,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     1128 <main+0x28>
movl   $0x1,-0x4(%rbp)
jmp    112f <main+0x2f>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @main() {
ret i32 1
}
void XtCreateApplicationContext() {}


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

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

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

LLVM IR (-O2):
define void @XtCreateApplicationContext() {
ret void
}
int add1_int_int(int x) { return x + 1; }


x86 assembly (clang, -O0):
<add1_int_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add1_int_int>:
lea    0x1(%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @add1_int_int(i32 %0) {
%2 = add nsw i32 %0, 1
ret i32 %2
}
/* Variables and functions */
int icost(int);
int icosd(int d) {
  int dd = d / 4;
  return icost(dd);
}


x86 assembly (clang, -O0):
<icosd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
call   1030 <icost@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<icosd>:
lea    0x3(%rdi),%eax
test   %edi,%edi
cmovs  %eax,%edi
sar    $0x2,%edi
jmp    1030 <icost@plt>

LLVM IR (-O0):
define i32 @icosd(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 4
store i32 %5, i32* %3
%6 = load i32, i32* %3
%7 = call i32 @icost(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @icosd(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = tail call i32 @icost(i32 %2)
ret i32 %3
}
int kiStartCamera(int cameraID) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @kiStartCamera(i32 %0) {
ret i32 1
}
/* Variables and functions */
int PATH_MAX;
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ free(char *);
char *malloc(int);
int /*<<< orphan*/ *realpath(char const *const, char *);
char *FileSys_GetAbsPath(char const *const inPath) {
  char *retVal = malloc(PATH_MAX * (sizeof *retVal));
  assert(retVal != NULL);
  if (realpath(inPath, retVal) == NULL) {
    free(retVal);
    retVal = NULL;
  }
  return retVal;
}


x86 assembly (clang, -O0):
<FileSys_GetAbsPath>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2e9d(%rip),%rax
movslq (%rax),%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1060 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1050 <realpath@plt>
cmp    $0x0,%rax
jne    119f <FileSys_GetAbsPath+0x5f>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
movq   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<FileSys_GetAbsPath>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    0x2ea2(%rip),%rax
mov    (%rax),%edi
call   1060 <malloc@plt>
mov    %rax,%rbx
xor    %edi,%edi
test   %rax,%rax
setne  %dil
call   1040 <assert@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <realpath@plt>
test   %rax,%rax
jne    1180 <FileSys_GetAbsPath+0x40>
mov    %rbx,%rdi
call   1030 <free@plt>
xor    %ebx,%ebx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@PATH_MAX = global i32 0
define i8* @FileSys_GetAbsPath(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i32, i32* @PATH_MAX
%5 = sext i32 %4 to i64
%6 = mul i64 %5, 1
%7 = trunc i64 %6 to i32
%8 = call i8* @malloc(i32 %7)
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = icmp ne i8* %9, null
%11 = zext i1 %10 to i32
%12 = call i32 @assert(i32 %11)
%13 = load i8*, i8** %2
%14 = load i8*, i8** %3
%15 = call i32* @realpath(i8* %13, i8* %14)
%16 = icmp eq i32* %15, null
br i1 %16, label %17, label %20
17: ; preds = %1
%18 = load i8*, i8** %3
%19 = call i32 @free(i8* %18)
store i8* null, i8** %3
br label %20
20: ; preds = %17, %1
%21 = load i8*, i8** %3
ret i8* %21
}

LLVM IR (-O2):
@PATH_MAX = global i32 0
define i8* @FileSys_GetAbsPath(i8* nocapture %0) {
%2 = load i32, i32* @PATH_MAX
%3 = tail call i8* @malloc(i32 %2)
%4 = icmp ne i8* %3, null
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32* @realpath(i8* %0, i8* %3)
%8 = icmp eq i32* %7, null
br i1 %8, label %9, label %11
9: ; preds = %1
%10 = tail call i32 @free(i8* %3)
br label %11
11: ; preds = %9, %1
%12 = phi i8* [ null, %9 ], [ %3, %1 ]
ret i8* %12
}
void digit(int pos, int val, char sep) {
  printf("%*s%d%*s%c", (9 - 1) / 2, "", val, 9 / 2, "", pos ? sep : '\n');
}


x86 assembly (clang, -O0):
<digit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     113f <digit+0x2f>
movsbl -0x9(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    114c <digit+0x3c>
mov    $0xa,%eax
mov    %eax,-0x14(%rbp)
jmp    114c <digit+0x3c>
mov    -0x10(%rbp),%ecx
mov    -0x14(%rbp),%eax
lea    0xea7(%rip),%rdi
mov    $0x4,%r8d
lea    0xea4(%rip),%r9
mov    %r8d,%esi
mov    %r9,%rdx
mov    %eax,(%rsp)
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<digit>:
push   %rax
mov    %esi,%ecx
test   %edi,%edi
mov    $0xa,%eax
cmovne %edx,%eax
mov    %eax,(%rsp)
lea    0xed9(%rip),%rdi
lea    0xedc(%rip),%rdx
mov    $0x4,%esi
mov    $0x4,%r8d
mov    %rdx,%r9
xor    %eax,%eax
call   1030 <printf@plt>
pop    %rax
ret

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

LLVM IR (-O2):
@.str = [11 x i8] c"%*s%d%*s%c\00"
@.str.1 = [1 x i8] zeroinitializer
define void @digit(i32 %0, i32 %1, i8 signext %2) {
%4 = icmp eq i32 %0, 0
%5 = sext i8 %2 to i32
%6 = select i1 %4, i32 10, i32 %5
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), i32 4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %1, i32 4, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i32 %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ HwSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void HwSettingsUpdated() { UAVObjUpdated(HwSettingsHandle()); }


x86 assembly (clang, -O0):
<HwSettingsUpdated>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <HwSettingsHandle@plt>
mov    %eax,%edi
call   1040 <UAVObjUpdated@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<HwSettingsUpdated>:
push   %rax
xor    %eax,%eax
call   1030 <HwSettingsHandle@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <UAVObjUpdated@plt>

LLVM IR (-O0):
define void @HwSettingsUpdated() {
%1 = call i32 (...) @HwSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @HwSettingsUpdated() {
%1 = tail call i32 (...) @HwSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
long int get_stat_birthtime_ns(struct stat const *st) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.stat = type opaque
define i64 @get_stat_birthtime_ns(%struct.stat* nocapture readnone %0) {
ret i64 0
}
/* Type definitions */
typedef int /*<<< orphan*/ pid_t;

/* Variables and functions */
pid_t getppid(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @getppid() {
ret i32 0
}

LLVM IR (-O2):
define i32 @getppid() {
ret i32 0
}
void spi_spin() {
  int i;
  for (i = 0; i < 200; ++i)
    *(volatile unsigned int *)(0xFFFFFFD0 + 0x04) = (0xff);
}


x86 assembly (clang, -O0):
<spi_spin>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
cmpl   $0xc8,-0x4(%rbp)
jge    1131 <spi_spin+0x31>
mov    $0xffffffd4,%eax
movl   $0xff,(%rax)
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    110b <spi_spin+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<spi_spin>:
mov    $0xc8,%eax
mov    $0xffffffd4,%ecx
nopw   0x0(%rax,%rax,1)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
movl   $0xff,(%rcx)
add    $0xfffffff6,%eax
jne    1110 <spi_spin+0x10>
ret

LLVM IR (-O0):
define void @spi_spin() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %6, %0
%3 = load i32, i32* %1
%4 = icmp slt i32 %3, 200
br i1 %4, label %5, label %9
5: ; preds = %2
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
br label %6
6: ; preds = %5
%7 = load i32, i32* %1
%8 = add nsw i32 %7, 1
store i32 %8, i32* %1
br label %2
9: ; preds = %2
ret void
}

LLVM IR (-O2):
define void @spi_spin() {
br label %1
1: ; preds = %1, %0
%2 = phi i32 [ 0, %0 ], [ %3, %1 ]
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
store volatile i32 255, i32* inttoptr (i64 4294967252 to i32*)
%3 = add nuw nsw i32 %2, 10
%4 = icmp eq i32 %3, 200
br i1 %4, label %5, label %1
5: ; preds = %1
ret void
}
/* Variables and functions */
void _initialize_cli_out(void) {}


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

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

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

LLVM IR (-O2):
define void @_initialize_cli_out() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, long, long);
extern void *Blue4(long one, long two) {
  printf(" Hello from Blue4: one = %d, two = %d!\n ", one, two);
  return (void *)0xdeadbeef00;
}


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

x86 assembly (clang, -O2):
<Blue4>:
push   %rax
mov    %rsi,%rdx
mov    %rdi,%rsi
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
movabs $0xdeadbeef00,%rax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [41 x i8] c" Hello from Blue4: one = %d, two = %d!\0A \00"
define i8* @Blue4(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 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %5, i64 %6)
ret i8* inttoptr (i64 956397711104 to i8*)
}

LLVM IR (-O2):
@.str = [41 x i8] c" Hello from Blue4: one = %d, two = %d!\0A \00"
define i8* @Blue4(i64 %0, i64 %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0), i64 %0, i64 %1)
ret i8* inttoptr (i64 956397711104 to i8*)
}
void foo622() {}


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

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

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

LLVM IR (-O2):
define void @foo622() {
ret void
}
extern int one(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @one() {
ret i32 1
}

LLVM IR (-O2):
define i32 @one() {
ret i32 1
}
double sinh(x)
double x;
{ return sinh_cosh(x, 0); }


x86 assembly (clang, -O0):
<sinh>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xor    %edi,%edi
mov    $0x1,%al
call   1030 <sinh_cosh@plt>
cvtsi2sd %eax,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinh>:
push   %rax
xor    %edi,%edi
mov    $0x1,%al
call   1030 <sinh_cosh@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinh(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 (double, i32, ...) bitcast (i32 (...)* @sinh_cosh to i32 (double, i32, ...)*)(double %3, i32 0)
%5 = sitofp i32 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @sinh(double %0) {
%2 = tail call i32 (double, i32, ...) bitcast (i32 (...)* @sinh_cosh to i32 (double, i32, ...)*)(double %0, i32 0)
%3 = sitofp i32 %2 to double
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ ext_arch_cleanup();
int disassemble_cleanup(void) {
  ext_arch_cleanup();
  return (1);
}


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

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

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

LLVM IR (-O2):
define i32 @disassemble_cleanup() {
%1 = tail call i32 (...) @ext_arch_cleanup()
ret i32 1
}
void zapit(float *s, int n) {
  while (n--) {
    s[0] = 0.0;
    s++;
  }
}


x86 assembly (clang, -O0):
<zapit>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0xc(%rbp)
cmp    $0x0,%eax
je     113b <zapit+0x3b>
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <zapit+0xb>
pop    %rbp
ret

x86 assembly (clang, -O2):
<zapit>:
test   %esi,%esi
je     1126 <zapit+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

LLVM IR (-O0):
define void @zapit(float* %0, i32 %1) {
%3 = alloca float*
%4 = alloca i32
store float* %0, float** %3
store i32 %1, i32* %4
br label %5
5: ; preds = %9, %2
%6 = load i32, i32* %4
%7 = add nsw i32 %6, -1
store i32 %7, i32* %4
%8 = icmp ne i32 %6, 0
br i1 %8, label %9, label %14
9: ; preds = %5
%10 = load float*, float** %3
%11 = getelementptr inbounds float, float* %10, i64 0
store float 0.000000e+00, float* %11
%12 = load float*, float** %3
%13 = getelementptr inbounds float, float* %12, i32 1
store float* %13, float** %3
br label %5
14: ; preds = %5
ret void
}

LLVM IR (-O2):
define void @zapit(float* nocapture writeonly %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = bitcast float* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ serial_in();
scalar_t__ serial_in_ready();
void serial_in_flush() {
  while (serial_in_ready()) {
    serial_in();
  }
}


x86 assembly (clang, -O0):
<serial_in_flush>:
push   %rbp
mov    %rsp,%rbp
jmp    1129 <serial_in_flush+0x9>
mov    $0x0,%al
call   1030 <serial_in_ready@plt>
cmp    $0x0,%rax
je     1146 <serial_in_flush+0x26>
mov    $0x0,%al
call   1040 <serial_in@plt>
jmp    1129 <serial_in_flush+0x9>
pop    %rbp
ret

x86 assembly (clang, -O2):
<serial_in_flush>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1030 <serial_in_ready@plt>
test   %rax,%rax
je     1145 <serial_in_flush+0x25>
xor    %eax,%eax
call   1040 <serial_in@plt>
jmp    1130 <serial_in_flush+0x10>
pop    %rax
ret

LLVM IR (-O0):
define void @serial_in_flush() {
br label %1
1: ; preds = %4, %0
%2 = call i64 (...) @serial_in_ready()
%3 = icmp ne i64 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = call i32 (...) @serial_in()
br label %1
6: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @serial_in_flush() {
%1 = tail call i64 (...) @serial_in_ready()
%2 = icmp eq i64 %1, 0
br i1 %2, label %7, label %3
3: ; preds = %0, %3
%4 = tail call i32 (...) @serial_in()
%5 = tail call i64 (...) @serial_in_ready()
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %3
7: ; preds = %3, %0
ret void
}
int s390_pv_verify(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @s390_pv_verify() {
ret i32 0
}

LLVM IR (-O2):
define i32 @s390_pv_verify() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void g(void) { printf("g\n"); }


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

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

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

LLVM IR (-O2):
@str = [2 x i8] c"g\00"
define void @g() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}
int str2oct(char *str) {
  int oct = 0;
  while (*str != '\0') {
    oct |= (*str) - '0';
    oct <<= 3;
    str++;
  }
  oct >>= 3;
  return oct;
}


x86 assembly (clang, -O0):
<str2oct>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1149 <str2oct+0x49>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
sub    $0x30,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <str2oct+0xf>
mov    -0xc(%rbp),%eax
sar    $0x3,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<str2oct>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <str2oct+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    $0x1fffffd0,%ecx
or     %ecx,%eax
shl    $0x3,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <str2oct+0x10>
sar    $0x3,%eax
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @str2oct(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %9, %1
%5 = load i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 0
br i1 %8, label %9, label %20
9: ; preds = %4
%10 = load i8*, i8** %2
%11 = load i8, i8* %10
%12 = sext i8 %11 to i32
%13 = sub nsw i32 %12, 48
%14 = load i32, i32* %3
%15 = or i32 %14, %13
store i32 %15, i32* %3
%16 = load i32, i32* %3
%17 = shl i32 %16, 3
store i32 %17, i32* %3
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %4
20: ; preds = %4
%21 = load i32, i32* %3
%22 = ashr i32 %21, 3
store i32 %22, i32* %3
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @str2oct(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %17, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %11, %4 ], [ 0, %1 ]
%7 = phi i8* [ %12, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %8, 536870864
%10 = or i32 %9, %6
%11 = shl i32 %10, 3
%12 = getelementptr inbounds i8, i8* %7, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4
%16 = ashr exact i32 %11, 3
br label %17
17: ; preds = %15, %1
%18 = phi i32 [ 0, %1 ], [ %16, %15 ]
ret i32 %18
}
/* Variables and functions */
int simple_print(char const *, int /*<<< orphan*/);
int /*<<< orphan*/ simple_strlen(char const *);
int main(void) {
  const char *message = "Hello without stdlib.\n";
  return simple_print(message, simple_strlen(message));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <simple_strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <simple_print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xed8(%rip),%rbx
mov    %rbx,%rdi
call   1030 <simple_strlen@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <simple_print@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"Hello without stdlib.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
store i32 0, i32* %1
store i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @simple_strlen(i8* %4)
%6 = call i32 @simple_print(i8* %3, i32 %5)
ret i32 %6
}

LLVM IR (-O2):
@.str = [23 x i8] c"Hello without stdlib.\0A\00"
define i32 @main() {
%1 = tail call i32 @simple_strlen(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @simple_print(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 %2
}
/* Variables and functions */
void *memalign(size_t, size_t);
void *mem_align(size_t a, size_t size) { return memalign(a, size); }


x86 assembly (clang, -O0):
<mem_align>:
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 <memalign@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mem_align>:
jmp    1030 <memalign@plt>

LLVM IR (-O0):
define i8* @mem_align(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 i8* @memalign(i64 %5, i64 %6)
ret i8* %7
}

LLVM IR (-O2):
define noalias i8* @mem_align(i64 %0, i64 %1) {
%3 = tail call i8* @memalign(i64 %0, i64 %1)
ret i8* %3
}
void gather_commercial_taxes(struct commercial *c, struct tax_gather *g) {}


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

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

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

LLVM IR (-O2):
%struct.commercial = type opaque
%struct.tax_gather = type opaque
define void @gather_commercial_taxes(%struct.commercial* nocapture %0, %struct.tax_gather* nocapture %1) {
ret void
}
/* Variables and functions */
char **malloc(int);
char **str_array_create(int size) {
  char **ret = malloc(sizeof(char *) * size);
  int i = 0;
  for (i = 0; i < size; i++)
    ret[i] = NULL;
  return ret;
}


x86 assembly (clang, -O0):
<str_array_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movslq -0x4(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1166 <str_array_create+0x56>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movq   $0x0,(%rax,%rcx,8)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113c <str_array_create+0x2c>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_array_create>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x0(,%rbx,8),%edi
call   1040 <malloc@plt>
mov    %rax,%r14
test   %ebx,%ebx
jle    1149 <str_array_create+0x29>
mov    %ebx,%edx
shl    $0x3,%rdx
mov    %r14,%rdi
xor    %esi,%esi
call   1030 <memset@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define noalias i8** @str_array_create(i32 %0) {
%2 = shl i32 %0, 3
%3 = tail call i8** @malloc(i32 %2)
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %9
5: ; preds = %1
%6 = bitcast i8** %3 to i8*
%7 = zext i32 %0 to i64
%8 = shl nuw nsw i64 %7, 3
br label %9
9: ; preds = %5, %1
ret i8** %3
}
int __attribute__((no)) bics_si_test2(int a, int b) {
  if (a & ~(b << 2))
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<bics_si_test2>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     112d <bics_si_test2+0x2d>
movl   $0x1,-0x4(%rbp)
jmp    1134 <bics_si_test2+0x34>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<bics_si_test2>:
shl    $0x2,%esi
not    %esi
xor    %eax,%eax
test   %edi,%esi
setne  %al
ret

LLVM IR (-O0):
define i32 @bics_si_test2(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
%6 = load i32, i32* %4
%7 = load i32, i32* %5
%8 = shl i32 %7, 2
%9 = xor i32 %8, -1
%10 = and i32 %6, %9
%11 = icmp ne i32 %10, 0
br i1 %11, label %12, label %13
12: ; preds = %2
store i32 1, i32* %3
br label %14
13: ; preds = %2
store i32 0, i32* %3
br label %14
14: ; preds = %13, %12
%15 = load i32, i32* %3
ret i32 %15
}

LLVM IR (-O2):
define i32 @bics_si_test2(i32 %0, i32 %1) {
%3 = shl i32 %1, 2
%4 = xor i32 %3, -1
%5 = and i32 %4, %0
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
unsigned short __VERIFIER_nondet_ushort() {
  unsigned short val;
  return val;
}


x86 assembly (clang, -O0):
<__VERIFIER_nondet_ushort>:
push   %rbp
mov    %rsp,%rbp
movzwl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define zeroext i16 @__VERIFIER_nondet_ushort() {
%1 = alloca i16
%2 = load i16, i16* %1
ret i16 %2
}

LLVM IR (-O2):
define zeroext i16 @__VERIFIER_nondet_ushort() {
ret i16 undef
}
void strip_file_extension(char *filename) {
  char *p = filename;
  while (*p != ('\0')) {
    if (*p == '.') {
      *p = ('\0');
      return;
    }
    p++;
  }
  return;
}


x86 assembly (clang, -O0):
<strip_file_extension>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114d <strip_file_extension+0x4d>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
jne    113c <strip_file_extension+0x3c>
mov    -0x10(%rbp),%rax
movb   $0x0,(%rax)
jmp    1152 <strip_file_extension+0x52>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strip_file_extension+0x10>
jmp    1152 <strip_file_extension+0x52>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strip_file_extension>:
movzbl (%rdi),%eax
test   %al,%al
je     1114 <strip_file_extension+0x14>
cmp    $0x2e,%al
je     1111 <strip_file_extension+0x11>
add    $0x1,%rdi
jmp    1100 <strip_file_extension>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @strip_file_extension(i8* nocapture %0) {
br label %2
2: ; preds = %6, %1
%3 = phi i8* [ %0, %1 ], [ %7, %6 ]
%4 = load i8, i8* %3
switch i8 %4, label %6 [
i8 0, label %8
i8 46, label %5
]
5: ; preds = %2
store i8 0, i8* %3
br label %8
6: ; preds = %2
%7 = getelementptr inbounds i8, i8* %3, i64 1
br label %2
8: ; preds = %2, %5
ret void
}
int hashfun(char *aa) { return (aa[0] * 7 + aa[1] * 3 + aa[2] - 748) / 2; }


x86 assembly (clang, -O0):
<hashfun>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
imul   $0x7,%eax,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x1(%rcx),%ecx
imul   $0x3,%ecx,%ecx
add    %ecx,%eax
mov    -0x8(%rbp),%rcx
movsbl 0x2(%rcx),%ecx
add    %ecx,%eax
sub    $0x2ec,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<hashfun>:
movsbl (%rdi),%eax
lea    0x0(,%rax,8),%ecx
sub    %eax,%ecx
movsbl 0x1(%rdi),%eax
lea    (%rax,%rax,2),%eax
add    %ecx,%eax
movsbl 0x2(%rdi),%ecx
add    %ecx,%eax
add    $0xfffffd14,%eax
movzwl %ax,%eax
mov    %eax,%ecx
shr    $0xf,%ecx
add    %eax,%ecx
movswl %cx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @hashfun(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
%7 = mul nsw i32 %6, 7
%8 = load i8*, i8** %2
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = mul nsw i32 %11, 3
%13 = add nsw i32 %7, %12
%14 = load i8*, i8** %2
%15 = getelementptr inbounds i8, i8* %14, i64 2
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = add nsw i32 %13, %17
%19 = sub nsw i32 %18, 748
%20 = sdiv i32 %19, 2
ret i32 %20
}

LLVM IR (-O2):
define i32 @hashfun(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i16
%4 = mul nsw i16 %3, 7
%5 = getelementptr inbounds i8, i8* %0, i64 1
%6 = load i8, i8* %5
%7 = sext i8 %6 to i16
%8 = mul nsw i16 %7, 3
%9 = getelementptr inbounds i8, i8* %0, i64 2
%10 = load i8, i8* %9
%11 = sext i8 %10 to i16
%12 = add nsw i16 %4, -748
%13 = add nsw i16 %12, %8
%14 = add nsw i16 %13, %11
%15 = sdiv i16 %14, 2
%16 = sext i16 %15 to i32
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void error(char *str) { printf("%s\n", str); }


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

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

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

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

/* Variables and functions */
int /*<<< orphan*/ bswap32(int /*<<< orphan*/);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/ *, void const *, int);
uint32_t U32_AT(const void *p) {
  uint32_t x;
  memcpy(&x, p, sizeof(x));
  return bswap32(x);
}


x86 assembly (clang, -O0):
<U32_AT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    -0xc(%rbp),%edi
call   1040 <bswap32@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<U32_AT>:
push   %rax
mov    %rdi,%rsi
lea    0x4(%rsp),%rdi
mov    $0x4,%edx
call   1030 <memcpy@plt>
mov    0x4(%rsp),%edi
call   1040 <bswap32@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @U32_AT(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @memcpy(i32* %3, i8* %4, i32 4)
%6 = load i32, i32* %3
%7 = call i32 @bswap32(i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @U32_AT(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @memcpy(i32* %2, i8* %0, i32 4)
%5 = load i32, i32* %2
%6 = call i32 @bswap32(i32 %5)
ret i32 %6
}