xunge/DecIR huggingface dataset:
/* Variables and functions */
int /*<<< orphan*/ quicksortRecur(unsigned char *, int /*<<< orphan*/,
                                  unsigned long long, unsigned long long);
void quicksort(void *buffer, unsigned long long int num,
               unsigned long long int size) {
  quicksortRecur((unsigned char *)buffer, 0, num - 1, size);
}


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

x86 assembly (clang, -O2):
<quicksort>:
mov    %rdx,%rcx
lea    -0x1(%rsi),%rdx
xor    %esi,%esi
jmp    1030 <quicksortRecur@plt>

LLVM IR (-O0):
define void @quicksort(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 = sub i64 %8, 1
%10 = load i64, i64* %6
%11 = call i32 @quicksortRecur(i8* %7, i32 0, i64 %9, i64 %10)
ret void
}

LLVM IR (-O2):
define void @quicksort(i8* %0, i64 %1, i64 %2) {
%4 = add i64 %1, -1
%5 = tail call i32 @quicksortRecur(i8* %0, i32 0, i64 %4, i64 %2)
ret void
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t modadd(uint64_t a, uint64_t b, uint64_t mod) {
  a += b;
  if (a < b)
    a -= mod;
  return a % mod;
}


x86 assembly (clang, -O0):
<modadd>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    112d <modadd+0x2d>
mov    -0xc(%rbp),%ecx
mov    -0x4(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
cltd
idivl  -0xc(%rbp)
mov    %edx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<modadd>:
mov    %edx,%ecx
lea    (%rsi,%rdi,1),%eax
sar    $0x1f,%edi
and    %edx,%edi
sub    %edi,%eax
cltd
idiv   %ecx
mov    %edx,%eax
ret

LLVM IR (-O0):
define i32 @modadd(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* %5
%8 = load i32, i32* %4
%9 = add nsw i32 %8, %7
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = load i32, i32* %5
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %17
13: ; preds = %3
%14 = load i32, i32* %6
%15 = load i32, i32* %4
%16 = sub nsw i32 %15, %14
store i32 %16, i32* %4
br label %17
17: ; preds = %13, %3
%18 = load i32, i32* %4
%19 = load i32, i32* %6
%20 = srem i32 %18, %19
ret i32 %20
}

LLVM IR (-O2):
define i32 @modadd(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = icmp slt i32 %0, 0
%6 = select i1 %5, i32 %2, i32 0
%7 = sub i32 %4, %6
%8 = srem i32 %7, %2
ret i32 %8
}
/* Variables and functions */
int /*<<< orphan*/ EACCES;
int /*<<< orphan*/ errno;
int access(const char *path, int amode) {
  errno = EACCES;
  return -1;
}


x86 assembly (clang, -O0):
<access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0x2ed6(%rip),%rax
mov    (%rax),%ecx
mov    0x2ebd(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
@EACCES = global i32 0
@errno = global i32 0
define i32 @access(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* @EACCES
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EACCES = global i32 0
@errno = global i32 0
define i32 @access(i8* nocapture readnone %0, i32 %1) {
%3 = load i32, i32* @EACCES
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int /*<<< orphan*/ insertionSort(int *, int);
int main() {
  int *a;
  int array_size = __VERIFIER_nondet_int();
  insertionSort(a, array_size);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 @insertionSort(i32* undef, i32 %1)
ret i32 0
}
/* Type definitions */
struct htable {
  int dummy;
};

/* Variables and functions */
char *ht_next(struct htable *, size_t *);
char *ht_first(struct htable *ht, size_t *i) {
  *i = 0;
  return ht_next(ht, i);
}


x86 assembly (clang, -O0):
<ht_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movq   $0x0,(%rax)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <ht_next@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_first>:
movq   $0x0,(%rsi)
jmp    1030 <ht_next@plt>

LLVM IR (-O0):
%struct.htable = type { i32 }
define i8* @ht_first(%struct.htable* %0, i64* %1) {
%3 = alloca %struct.htable*
%4 = alloca i64*
store %struct.htable* %0, %struct.htable** %3
store i64* %1, i64** %4
%5 = load i64*, i64** %4
store i64 0, i64* %5
%6 = load %struct.htable*, %struct.htable** %3
%7 = load i64*, i64** %4
%8 = call i8* @ht_next(%struct.htable* %6, i64* %7)
ret i8* %8
}

LLVM IR (-O2):
%struct.htable = type { i32 }
define i8* @ht_first(%struct.htable* %0, i64* %1) {
store i64 0, i64* %1
%3 = tail call i8* @ht_next(%struct.htable* %0, i64* %1)
ret i8* %3
}
/* Type definitions */
typedef int __le16;

/* Variables and functions */
int cpu_to_le16(int);
int ieee80211_has_order(__le16 fc) { return (fc & cpu_to_le16(0x8000)) != 0; }


x86 assembly (clang, -O0):
<ieee80211_has_order>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x8000,%edi
call   1030 <cpu_to_le16@plt>
mov    %eax,%ecx
mov    -0x8(%rbp),%eax
and    %ecx,%eax
cmp    $0x0,%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ieee80211_has_order>:
push   %rbx
mov    %edi,%ebx
mov    $0x8000,%edi
call   1030 <cpu_to_le16@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ieee80211_has_order(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @cpu_to_le16(i32 32768)
%5 = and i32 %3, %4
%6 = icmp ne i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @ieee80211_has_order(i32 %0) {
%2 = tail call i32 @cpu_to_le16(i32 32768)
%3 = and i32 %2, %0
%4 = icmp ne i32 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void usage(char *file) {
  printf("\nUsage:  %s -d [-s <sync period>]\n\n"
         "-h \t\t show the command line help information.\n"
         "-d	\t\t run the pcie sync in the non-daemon mode.\n"
         "-t	\t\t display current pcie time.\n"
         "-v	\t\t display sync result.\n"
         "-s <sync period> \t\t set sync period (us).(default 10000(means 10ms "
         "as the minimal))\n",
         file);
}


x86 assembly (clang, -O0):
<usage>:
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):
<usage>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [274 x i8] c"\0AUsage: %s -d [-s <sync period>]\0A\0A-h \09\09 show the command line help information.\0A-d\09\09\09 run the pcie sync in the non-daemon mode.\0A-t\09\09\09 display current pcie time.\0A-v\09\09\09 display sync result.\0A-s <sync period> \09\09 set sync period (us).(default 10000(means 10ms as the minimal))\0A\00"
define void @usage(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([274 x i8], [274 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [274 x i8] c"\0AUsage: %s -d [-s <sync period>]\0A\0A-h \09\09 show the command line help information.\0A-d\09\09\09 run the pcie sync in the non-daemon mode.\0A-t\09\09\09 display current pcie time.\0A-v\09\09\09 display sync result.\0A-s <sync period> \09\09 set sync period (us).(default 10000(means 10ms as the minimal))\0A\00"
define void @usage(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([274 x i8], [274 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
void par_shapes__plane(float const *uv, float *xyz, void *userdata) {
  xyz[0] = uv[0];
  xyz[1] = uv[1];
  xyz[2] = 0;
}


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

x86 assembly (clang, -O2):
<par_shapes__plane>:
movss  (%rdi),%xmm0
movss  %xmm0,(%rsi)
movss  0x4(%rdi),%xmm0
movss  %xmm0,0x4(%rsi)
movl   $0x0,0x8(%rsi)
ret

LLVM IR (-O0):
define void @par_shapes__plane(float* %0, float* %1, i8* %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i8*
store float* %0, float** %4
store float* %1, float** %5
store i8* %2, i8** %6
%7 = load float*, float** %4
%8 = getelementptr inbounds float, float* %7, i64 0
%9 = load float, float* %8
%10 = load float*, float** %5
%11 = getelementptr inbounds float, float* %10, i64 0
store float %9, float* %11
%12 = load float*, float** %4
%13 = getelementptr inbounds float, float* %12, i64 1
%14 = load float, float* %13
%15 = load float*, float** %5
%16 = getelementptr inbounds float, float* %15, i64 1
store float %14, float* %16
%17 = load float*, float** %5
%18 = getelementptr inbounds float, float* %17, i64 2
store float 0.000000e+00, float* %18
ret void
}

LLVM IR (-O2):
define void @par_shapes__plane(float* nocapture %0, float* nocapture writeonly %1, i8* nocapture readnone %2) {
%4 = load float, float* %0
store float %4, float* %1
%5 = getelementptr inbounds float, float* %0, i64 1
%6 = load float, float* %5
%7 = getelementptr inbounds float, float* %1, i64 1
store float %6, float* %7
%8 = getelementptr inbounds float, float* %1, i64 2
store float 0.000000e+00, float* %8
ret void
}
int nsvg__div255(int x) { return ((x + 1) * 257) >> 16; }


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

x86 assembly (clang, -O2):
<nsvg__div255>:
mov    %edi,%eax
shl    $0x8,%eax
add    %edi,%eax
add    $0x101,%eax
sar    $0x10,%eax
ret

LLVM IR (-O0):
define i32 @nsvg__div255(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
%5 = mul nsw i32 %4, 257
%6 = ashr i32 %5, 16
ret i32 %6
}

LLVM IR (-O2):
define i32 @nsvg__div255(i32 %0) {
%2 = mul i32 %0, 257
%3 = add i32 %2, 257
%4 = ashr i32 %3, 16
ret i32 %4
}
void *atomic_ptr_cas(void *volatile *ptr, void *oldval, void *newval) {
  return __sync_val_compare_and_swap(ptr, oldval, newval);
}


x86 assembly (clang, -O0):
<atomic_ptr_cas>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%rax
mov    -0x18(%rbp),%rdx
lock cmpxchg %rdx,(%rcx)
sete   %cl
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_ptr_cas>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
ret

LLVM IR (-O0):
define i8* @atomic_ptr_cas(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8**, i8*** %4
%8 = bitcast i8** %7 to i64*
%9 = load i8*, i8** %5
%10 = ptrtoint i8* %9 to i64
%11 = load i8*, i8** %6
%12 = ptrtoint i8* %11 to i64
%13 = cmpxchg i64* %8, i64 %10, i64 %12 seq_cst seq_cst
%14 = extractvalue { i64, i1 } %13, 0
%15 = inttoptr i64 %14 to i8*
ret i8* %15
}

LLVM IR (-O2):
define i8* @atomic_ptr_cas(i8** nocapture %0, i8* %1, i8* %2) {
%4 = bitcast i8** %0 to i64*
%5 = ptrtoint i8* %1 to i64
%6 = ptrtoint i8* %2 to i64
%7 = cmpxchg i64* %4, i64 %5, i64 %6 seq_cst seq_cst
%8 = extractvalue { i64, i1 } %7, 0
%9 = inttoptr i64 %8 to i8*
ret i8* %9
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ time_stamp;

/* Variables and functions */
int /*<<< orphan*/ localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ strftime(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
char *get_time_str(char *format) {
  static char time_stamp[128];
  time_t time_int;
  time(&time_int);
  strftime(time_stamp, sizeof(time_stamp), format, localtime(&time_int));
  return time_stamp;
}


x86 assembly (clang, -O0):
<get_time_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0xc(%rbp),%rdi
call   1040 <time@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0xc(%rbp),%rdi
call   1030 <localtime@plt>
mov    -0x18(%rbp),%rdx
mov    %eax,%ecx
lea    0x2eed(%rip),%rdi
mov    $0x80,%esi
call   1050 <strftime@plt>
lea    0x2edc(%rip),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_time_str>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
lea    0x4(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <time@plt>
mov    %rbx,%rdi
call   1030 <localtime@plt>
lea    0x2efd(%rip),%rbx
mov    %rbx,%rdi
mov    $0x80,%esi
mov    %r14,%rdx
mov    %eax,%ecx
call   1050 <strftime@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@get_time_str.time_stamp = internal global [128 x i8] zeroinitializer
define i8* @get_time_str(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = call i32 @time(i32* %3)
%5 = load i8*, i8** %2
%6 = call i32 @localtime(i32* %3)
%7 = call i32 @strftime(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_time_str.time_stamp, i64 0, i64 0), i32 128, i8* %5, i32 %6)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_time_str.time_stamp, i64 0, i64 0)
}

LLVM IR (-O2):
@get_time_str.time_stamp = internal global [128 x i8] zeroinitializer
define i8* @get_time_str(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @time(i32* %2)
%5 = call i32 @localtime(i32* %2)
%6 = call i32 @strftime(i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_time_str.time_stamp, i64 0, i64 0), i32 128, i8* %0, i32 %5)
ret i8* getelementptr inbounds ([128 x i8], [128 x i8]* @get_time_str.time_stamp, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ TxTimedByte(char, char);
void TxTimedStringLn(const char *str, char txDelay) {
  while (*str) {
    TxTimedByte(*str++, txDelay);
  }
  TxTimedByte('\n', txDelay);
}


x86 assembly (clang, -O0):
<TxTimedStringLn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1151 <TxTimedStringLn+0x41>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
mov    (%rax),%al
movsbl %al,%edi
movsbl -0x9(%rbp),%esi
call   1030 <TxTimedByte@plt>
jmp    1122 <TxTimedStringLn+0x12>
mov    $0xa,%edi
movsbl -0x9(%rbp),%esi
call   1030 <TxTimedByte@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TxTimedStringLn>:
push   %rbp
push   %rbx
push   %rax
mov    (%rdi),%al
movsbl %sil,%ebp
test   %al,%al
je     1145 <TxTimedStringLn+0x35>
mov    %rdi,%rbx
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsbl %al,%edi
mov    %ebp,%esi
call   1030 <TxTimedByte@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <TxTimedStringLn+0x20>
mov    $0xa,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <TxTimedByte@plt>

LLVM IR (-O0):
define void @TxTimedStringLn(i8* %0, i8 signext %1) {
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
store i8 %1, i8* %4
br label %5
5: ; preds = %9, %2
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = icmp ne i8 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i32 1
store i8* %11, i8** %3
%12 = load i8, i8* %10
%13 = load i8, i8* %4
%14 = call i32 @TxTimedByte(i8 signext %12, i8 signext %13)
br label %5
15: ; preds = %5
%16 = load i8, i8* %4
%17 = call i32 @TxTimedByte(i8 signext 10, i8 signext %16)
ret void
}

LLVM IR (-O2):
define void @TxTimedStringLn(i8* nocapture %0, i8 signext %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %12, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %10, %5 ], [ %3, %2 ]
%7 = phi i8* [ %8, %5 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = tail call i32 @TxTimedByte(i8 signext %6, i8 signext %1)
%10 = load i8, i8* %8
%11 = icmp eq i8 %10, 0
br i1 %11, label %12, label %5
12: ; preds = %5, %2
%13 = tail call i32 @TxTimedByte(i8 signext 10, i8 signext %1)
ret void
}
EventTrigDestroy(e) int e;
{}


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

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

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

LLVM IR (-O2):
define i32 @EventTrigDestroy(i32 %0) {
ret i32 undef
}
long val_long(long x) { return x; }


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

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

LLVM IR (-O0):
define i64 @val_long(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
ret i64 %3
}

LLVM IR (-O2):
define i64 @val_long(i64 returned %0) {
ret i64 %0
}
/* Variables and functions */
int _strncmp(char const *, char const *, size_t, void *);
int hfuzz_strncmp(const char *s1, const char *s2, size_t n, void *addr) {
  return _strncmp(s1, s2, n, addr);
}


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

x86 assembly (clang, -O2):
<hfuzz_strncmp>:
jmp    1030 <_strncmp@plt>

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

LLVM IR (-O2):
define i32 @hfuzz_strncmp(i8* %0, i8* %1, i64 %2, i8* %3) {
%5 = tail call i32 @_strncmp(i8* %0, i8* %1, i64 %2, i8* %3)
ret i32 %5
}
/* Variables and functions */
double sqrt(double);
double foo(double x, double y) { return sqrt((3.0 + x) / (9.4 + y)); }


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  0xede(%rip),%xmm0
addsd  -0x8(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
addsd  -0x10(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1030 <sqrt@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
addsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm1
divsd  %xmm1,%xmm0
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jb     1133 <foo+0x23>
sqrtsd %xmm0,%xmm0
ret
jmp    1030 <sqrt@plt>

LLVM IR (-O0):
define double @foo(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = fadd double 3.000000e+00, %5
%7 = load double, double* %4
%8 = fadd double 9.400000e+00, %7
%9 = fdiv double %6, %8
%10 = call double @sqrt(double %9)
ret double %10
}

LLVM IR (-O2):
define double @foo(double %0, double %1) {
%3 = fadd double %0, 3.000000e+00
%4 = fadd double %1, 9.400000e+00
%5 = fdiv double %3, %4
%6 = tail call double @sqrt(double %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ islower(int);
void t_islower_0xc5() {
  Assert_real((islower(197) == 0),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_islower.c",
              990, ("islower should be 0 for 0xc5"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_islower.c\00"
@.str.1 = [29 x i8] c"islower should be 0 for 0xc5\00"
define void @t_islower_0xc5() {
%1 = tail call i64 @islower(i32 197)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 990, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void printHelp(void) {
  printf("Program Ciselne soustavy.\n"
         "Autor: Petr Zemek\n"
         "Program provadi prevody mezi ciselnymi soustavami. Cislo, ktere\n"
         "ma program zpracovat se nacita ze standardniho vstupu.\n"
         "Pouziti: proj1 -h\n"
         "         proj1 Z1 Z2\n"
         "Popis parametru:\n"
         "  -h    Vypise tuto obrazovku s napovedou.\n"
         "  Z1    Zaklad ciselne soustavy vstupniho cisla (2-36).\n"
         "  Z2    Zaklad ciselne soustavy vystupniho cisla (2-36).\n");
}


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

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

LLVM IR (-O0):
@.str = [376 x i8] c"Program Ciselne soustavy.\0AAutor: Petr Zemek\0AProgram provadi prevody mezi ciselnymi soustavami. Cislo, ktere\0Ama program zpracovat se nacita ze standardniho vstupu.\0APouziti: proj1 -h\0A proj1 Z1 Z2\0APopis parametru:\0A -h Vypise tuto obrazovku s napovedou.\0A Z1 Zaklad ciselne soustavy vstupniho cisla (2-36).\0A Z2 Zaklad ciselne soustavy vystupniho cisla (2-36).\0A\00"
define void @printHelp() {
%1 = call i32 @printf(i8* getelementptr inbounds ([376 x i8], [376 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [375 x i8] c"Program Ciselne soustavy.\0AAutor: Petr Zemek\0AProgram provadi prevody mezi ciselnymi soustavami. Cislo, ktere\0Ama program zpracovat se nacita ze standardniho vstupu.\0APouziti: proj1 -h\0A proj1 Z1 Z2\0APopis parametru:\0A -h Vypise tuto obrazovku s napovedou.\0A Z1 Zaklad ciselne soustavy vstupniho cisla (2-36).\0A Z2 Zaklad ciselne soustavy vystupniho cisla (2-36).\00"
define void @printHelp() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([375 x i8], [375 x i8]* @str, i64 0, i64 0))
ret void
}
int do_945() { return 945; }


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

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

LLVM IR (-O0):
define i32 @do_945() {
ret i32 945
}

LLVM IR (-O2):
define i32 @do_945() {
ret i32 945
}
/* Variables and functions */
int /*<<< orphan*/ errno;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: ./a.out server_addr server_port\n");
  exit(errno);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    0x2ea9(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [40 x i8] c"Usage: ./a.out server_addr server_port\0A\00"
@errno = global i32 0
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = call i32 @exit(i32 %2)
unreachable
}

LLVM IR (-O2):
@errno = global i32 0
@str = [39 x i8] c"Usage: ./a.out server_addr server_port\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @errno
%3 = tail call i32 @exit(i32 %2)
unreachable
}
/* Variables and functions */
unsigned int __udivmodsi4(unsigned int, unsigned int, int /*<<< orphan*/);
unsigned int __udivsi3(unsigned int num, unsigned int den) {
  return __udivmodsi4(num, den, 0);
}


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

x86 assembly (clang, -O2):
<__udivsi3>:
xor    %edx,%edx
jmp    1030 <__udivmodsi4@plt>

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

LLVM IR (-O2):
define i32 @__udivsi3(i32 %0, i32 %1) {
%3 = tail call i32 @__udivmodsi4(i32 %0, i32 %1, i32 0)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint16_t;

/* Variables and functions */
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ printConsole(char *, unsigned int);
void tcpClose(int fd, uint16_t port) {
  close(fd);
  printConsole("No longer listening to port %u.\n", (unsigned int)port);
}


x86 assembly (clang, -O0):
<tcpClose>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
mov    -0x10(%rbp),%rax
mov    %eax,%esi
lea    0xebc(%rip),%rdi
call   1040 <printConsole@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcpClose>:
push   %rbx
mov    %rsi,%rbx
call   1030 <close@plt>
lea    0xed0(%rip),%rdi
mov    %ebx,%esi
pop    %rbx
jmp    1040 <printConsole@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"No longer listening to port %u.\0A\00"
define void @tcpClose(i32 %0, i64 %1) {
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 %1, i64* %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
%7 = load i64, i64* %4
%8 = trunc i64 %7 to i32
%9 = call i32 @printConsole(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %8)
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"No longer listening to port %u.\0A\00"
define void @tcpClose(i32 %0, i64 %1) {
%3 = tail call i32 @close(i32 %0)
%4 = trunc i64 %1 to i32
%5 = tail call i32 @printConsole(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i32 %4)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ f(char *);
int main(int ac, char *av[]) {
  f("str");
  return 0;
}


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

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

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

LLVM IR (-O2):
@.str = [4 x i8] c"str\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @f(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
OP(ed, a4) { illegal_2(); }


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

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

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

LLVM IR (-O2):
define i32 @OP(i32 %0, i32 %1) {
%3 = tail call i32 (...) @illegal_2()
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void wpa_cli_show_variables(void) {
  printf("set variables:\n"
         "  EAPOL::heldPeriod (EAPOL state machine held period, "
         "in seconds)\n"
         "  EAPOL::authPeriod (EAPOL state machine authentication "
         "period, in seconds)\n"
         "  EAPOL::startPeriod (EAPOL state machine start period, in "
         "seconds)\n"
         "  EAPOL::maxStart (EAPOL state machine maximum start "
         "attempts)\n");
}


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

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

LLVM IR (-O0):
@.str = [289 x i8] c"set variables:\0A EAPOL::heldPeriod (EAPOL state machine held period, in seconds)\0A EAPOL::authPeriod (EAPOL state machine authentication period, in seconds)\0A EAPOL::startPeriod (EAPOL state machine start period, in seconds)\0A EAPOL::maxStart (EAPOL state machine maximum start attempts)\0A\00"
define void @wpa_cli_show_variables() {
%1 = call i32 @printf(i8* getelementptr inbounds ([289 x i8], [289 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@str = [288 x i8] c"set variables:\0A EAPOL::heldPeriod (EAPOL state machine held period, in seconds)\0A EAPOL::authPeriod (EAPOL state machine authentication period, in seconds)\0A EAPOL::startPeriod (EAPOL state machine start period, in seconds)\0A EAPOL::maxStart (EAPOL state machine maximum start attempts)\00"
define void @wpa_cli_show_variables() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([288 x i8], [288 x i8]* @str, i64 0, i64 0))
ret void
}
long CPSELECT(id, mask)
long *id, *mask;
{ return ((long)cpselect(*id, *mask)); }


x86 assembly (clang, -O0):
<CPSELECT>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
mov    $0x0,%al
call   1030 <cpselect@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CPSELECT>:
push   %rax
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %eax,%eax
call   1030 <cpselect@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @CPSELECT(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* %5
%7 = load i64*, i64** %4
%8 = load i64, i64* %7
%9 = call i32 (i64, i64, ...) bitcast (i32 (...)* @cpselect to i32 (i64, i64, ...)*)(i64 %6, i64 %8)
%10 = sext i32 %9 to i64
ret i64 %10
}

LLVM IR (-O2):
define i64 @CPSELECT(i64* nocapture %0, i64* nocapture %1) {
%3 = load i64, i64* %0
%4 = load i64, i64* %1
%5 = tail call i32 (i64, i64, ...) bitcast (i32 (...)* @cpselect to i32 (i64, i64, ...)*)(i64 %3, i64 %4)
%6 = sext i32 %5 to i64
ret i64 %6
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void firemon_clrscr(void) {
  printf("\033[2J\033[1;1H");
  fflush(0);
}


x86 assembly (clang, -O0):
<firemon_clrscr>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<firemon_clrscr>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
pop    %rax
jmp    1040 <fflush@plt>

LLVM IR (-O0):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @firemon_clrscr() {
%1 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @fflush(i32 0)
ret void
}

LLVM IR (-O2):
@.str = [11 x i8] c"\1B[2J\1B[1;1H\00"
define void @firemon_clrscr() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @fflush(i32 0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr,
          "Usage: uradvd [-h] -i <interface> -a/-p <prefix> [ -a/-p <prefix> "
          "... ] [ --default-lifetime <seconds> ] [ --rdnss <ip> ... ]\n");
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<usage>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [127 x i8] c"Usage: uradvd [-h] -i <interface> -a/-p <prefix> [ -a/-p <prefix> ... ] [ --default-lifetime <seconds> ] [ --rdnss <ip> ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [127 x i8] c"Usage: uradvd [-h] -i <interface> -a/-p <prefix> [ -a/-p <prefix> ... ] [ --default-lifetime <seconds> ] [ --rdnss <ip> ... ]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([127 x i8], [127 x i8]* @.str, i64 0, i64 0))
ret void
}
void UART_SaveConfig(void) {}


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

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

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

LLVM IR (-O2):
define void @UART_SaveConfig() {
ret void
}
int bch_stats_show() {
  return __builtin_types_compatible_p(unsigned, int) ? "" : "";
}


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

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

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define i32 @bch_stats_show() {
ret i32 ptrtoint ([1 x i8]* @.str to i32)
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @bch_stats_show() {
ret i32 ptrtoint ([1 x i8]* @.str to i32)
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ test_futex();
int main(int argc, char **argv) {
  if (!test_futex())
    return 1;
  printf("OK\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <test_futex@plt>
cmp    $0x0,%eax
jne    1152 <main+0x32>
movl   $0x1,-0x4(%rbp)
jmp    1165 <main+0x45>
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %ebx,%ebx
xor    %eax,%eax
call   1040 <test_futex@plt>
test   %eax,%eax
je     113c <main+0x1c>
lea    0xecb(%rip),%rdi
call   1030 <puts@plt>
jmp    1141 <main+0x21>
mov    $0x1,%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [3 x i8] c"OK\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_futex()
%4 = icmp eq i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ 1, %2 ]
ret i32 %8
}
/* Variables and functions */
int car(int, int);
void main(void) {
  int i;
  int j;
  j = car(i, j);
}


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <car@plt>

LLVM IR (-O0):
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = load i32, i32* %1
%4 = load i32, i32* %2
%5 = call i32 @car(i32 %3, i32 %4)
store i32 %5, i32* %2
ret void
}

LLVM IR (-O2):
define void @main() {
%1 = tail call i32 @car(i32 undef, i32 undef)
ret void
}
/* Variables and functions */
int atoi(char *);
int __parse_register(char *reg) {
  int t = atoi(reg + 1);
  return (t & 0x001F);
}


x86 assembly (clang, -O0):
<__parse_register>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x1,%rdi
call   1030 <atoi@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x1f,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__parse_register>:
push   %rax
add    $0x1,%rdi
call   1030 <atoi@plt>
and    $0x1f,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @__parse_register(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = getelementptr inbounds i8, i8* %4, i64 1
%6 = call i32 @atoi(i8* %5)
store i32 %6, i32* %3
%7 = load i32, i32* %3
%8 = and i32 %7, 31
ret i32 %8
}

LLVM IR (-O2):
define i32 @__parse_register(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = tail call i32 @atoi(i8* %2)
%4 = and i32 %3, 31
ret i32 %4
}
int compare_int(const void *p1, const void *p2) {
  int a = *(int *)p1;
  int b = *(int *)p2;
  return a - b;
}


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

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

LLVM IR (-O0):
define i32 @compare_int(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*
%9 = load i32, i32* %8
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = bitcast i8* %10 to i32*
%12 = load i32, i32* %11
store i32 %12, i32* %6
%13 = load i32, i32* %5
%14 = load i32, i32* %6
%15 = sub nsw i32 %13, %14
ret i32 %15
}

LLVM IR (-O2):
define i32 @compare_int(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
/* Variables and functions */
scalar_t__ EEXIST;
int O_CREAT;
int O_EXCL;
scalar_t__ errno;
int open(char const *, int, int);
int gate(const char *lock_name) {
  int fd = open(lock_name, O_CREAT | O_EXCL, 0666);
  if (fd >= 1)
    return 0;
  if (errno == EEXIST)
    return 1;
  return -1;
}


x86 assembly (clang, -O0):
<gate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    0x2ed1(%rip),%rax
mov    (%rax),%esi
mov    0x2ea0(%rip),%rax
or     (%rax),%esi
mov    $0x1b6,%edx
call   1030 <open@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x1,-0x14(%rbp)
jl     1155 <gate+0x45>
movl   $0x0,-0x4(%rbp)
jmp    1182 <gate+0x72>
mov    0x2e6c(%rip),%rax
mov    (%rax),%rax
mov    0x2e72(%rip),%rcx
cmp    (%rcx),%rax
jne    117b <gate+0x6b>
movl   $0x1,-0x4(%rbp)
jmp    1182 <gate+0x72>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gate>:
push   %rax
mov    0x2ee0(%rip),%rax
mov    0x2eb1(%rip),%rcx
mov    (%rcx),%esi
or     (%rax),%esi
mov    $0x1b6,%edx
call   1030 <open@plt>
mov    0x2e94(%rip),%rcx
mov    (%rcx),%rcx
mov    0x2e9a(%rip),%rdx
xor    %esi,%esi
cmp    (%rdx),%rcx
sete   %sil
xor    %ecx,%ecx
test   %eax,%eax
lea    -0x1(%rsi,%rsi,1),%eax
cmovg  %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
@O_CREAT = global i32 0
@O_EXCL = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
define i32 @gate(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i32, i32* @O_CREAT
%7 = load i32, i32* @O_EXCL
%8 = or i32 %6, %7
%9 = call i32 @open(i8* %5, i32 %8, i32 438)
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp sge i32 %10, 1
br i1 %11, label %12, label %13
12: ; preds = %1
store i32 0, i32* %2
br label %19
13: ; preds = %1
%14 = load i64, i64* @errno
%15 = load i64, i64* @EEXIST
%16 = icmp eq i64 %14, %15
br i1 %16, label %17, label %18
17: ; preds = %13
store i32 1, i32* %2
br label %19
18: ; preds = %13
store i32 -1, i32* %2
br label %19
19: ; preds = %18, %17, %12
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@O_CREAT = global i32 0
@O_EXCL = global i32 0
@errno = global i64 0
@EEXIST = global i64 0
define i32 @gate(i8* nocapture %0) {
%2 = load i32, i32* @O_CREAT
%3 = load i32, i32* @O_EXCL
%4 = or i32 %3, %2
%5 = tail call i32 @open(i8* %0, i32 %4, i32 438)
%6 = icmp sgt i32 %5, 0
%7 = load i64, i64* @errno
%8 = load i64, i64* @EEXIST
%9 = icmp eq i64 %7, %8
%10 = select i1 %9, i32 1, i32 -1
%11 = select i1 %6, i32 0, i32 %10
ret i32 %11
}
char *textmode_text(int t) {
  switch (t) {
  case 0:
    return ("center");
  case 1:
    return ("left_justify");
  case 2:
    return ("right_justify");
  }
  return ("none");
}


x86 assembly (clang, -O0):
<textmode_text>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
test   %eax,%eax
je     113c <textmode_text+0x3c>
jmp    111a <textmode_text+0x1a>
mov    -0x10(%rbp),%eax
sub    $0x1,%eax
je     114c <textmode_text+0x4c>
jmp    112b <textmode_text+0x2b>
mov    -0x10(%rbp),%eax
sub    $0x2,%eax
je     115c <textmode_text+0x5c>
jmp    116c <textmode_text+0x6c>
lea    0xebd(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <textmode_text+0x77>
lea    0xeb4(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <textmode_text+0x77>
lea    0xeb1(%rip),%rax
mov    %rax,-0x8(%rbp)
jmp    1177 <textmode_text+0x77>
lea    0xeaf(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<textmode_text>:
cmp    $0x2,%edi
ja     1117 <textmode_text+0x17>
movslq %edi,%rax
lea    0xf19(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
ret
lea    0xf04(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"center\00"
@.str.1 = [13 x i8] c"left_justify\00"
@.str.2 = [14 x i8] c"right_justify\00"
@.str.3 = [5 x i8] c"none\00"
define i8* @textmode_text(i32 %0) {
%2 = alloca i8*
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
switch i32 %4, label %8 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
]
5: ; preds = %1
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %2
br label %9
6: ; preds = %1
store i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.1, i64 0, i64 0), i8** %2
br label %9
7: ; preds = %1
store i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8** %2
br label %9
8: ; preds = %1
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), i8** %2
br label %9
9: ; preds = %8, %7, %6, %5
%10 = load i8*, i8** %2
ret i8* %10
}

LLVM IR (-O2):
@.str = [7 x i8] c"center\00"
@.str.1 = [13 x i8] c"left_justify\00"
@.str.2 = [14 x i8] c"right_justify\00"
@.str.3 = [5 x i8] c"none\00"
@reltable.textmode_text = [3 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @.str to i64), i64 ptrtoint ([3 x i32]* @reltable.textmode_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([13 x i8]* @.str.1 to i64), i64 ptrtoint ([3 x i32]* @reltable.textmode_text to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([14 x i8]* @.str.2 to i64), i64 ptrtoint ([3 x i32]* @reltable.textmode_text to i64)) to i32)]
define i8* @textmode_text(i32 %0) {
%2 = icmp ult i32 %0, 3
br i1 %2, label %3, label %7
3: ; preds = %1
%4 = sext i32 %0 to i64
%5 = shl i64 %4, 2
%6 = call i8* @llvm.load.relative.i64(i8* bitcast ([3 x i32]* @reltable.textmode_text to i8*), i64 %5)
br label %7
7: ; preds = %1, %3
%8 = phi i8* [ %6, %3 ], [ getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0), %1 ]
ret i8* %8
}
void foo(long N, int (*A)[N]) {
#pragma omp task
  {
    int(*myA1)[N];
    myA1 = A;
    myA1[N - 1][N - 1] = 2;
  }
#pragma omp taskwait
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
imul   %rdx,%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    -0x8(%rbp),%rcx
sub    $0x1,%rcx
movl   $0x2,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
lea    -0x1(%rdi),%rax
imul   %rdi,%rax
lea    (%rsi,%rax,4),%rax
movl   $0x2,-0x4(%rax,%rdi,4)
ret

LLVM IR (-O0):
define void @foo(i64 %0, i32* %1) {
%3 = alloca i64
%4 = alloca i32*
%5 = alloca i32*
store i64 %0, i64* %3
store i32* %1, i32** %4
%6 = load i64, i64* %3
%7 = load i64, i64* %3
%8 = load i32*, i32** %4
store i32* %8, i32** %5
%9 = load i32*, i32** %5
%10 = load i64, i64* %3
%11 = sub nsw i64 %10, 1
%12 = mul nsw i64 %11, %7
%13 = getelementptr inbounds i32, i32* %9, i64 %12
%14 = load i64, i64* %3
%15 = sub nsw i64 %14, 1
%16 = getelementptr inbounds i32, i32* %13, i64 %15
store i32 2, i32* %16
ret void
}

LLVM IR (-O2):
define void @foo(i64 %0, i32* nocapture writeonly %1) {
%3 = add nsw i64 %0, -1
%4 = mul nsw i64 %3, %0
%5 = getelementptr inbounds i32, i32* %1, i64 %4
%6 = getelementptr inbounds i32, i32* %5, i64 %3
store i32 2, i32* %6
ret void
}