xunge/DecIR huggingface dataset:
int compare_and_swap(void *addr, unsigned long olddata, unsigned long newdata) {
  unsigned long before;
  asm volatile("lock; cmpxchgq %2,%1"
               : "=a"(before), "+m"(*(unsigned long *)addr)
               : "q"(newdata), "0"(olddata)
               : "cc");
  return before == olddata;
}


x86 assembly (clang, -O0):
<compare_and_swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
mov    -0x18(%rbp),%rdx
mov    -0x10(%rbp),%rax
lock cmpxchg %rdx,(%rcx)
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_and_swap>:
mov    %rsi,%rax
lock cmpxchg %rdx,(%rdi)
xor    %ecx,%ecx
cmp    %rsi,%rax
sete   %cl
mov    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @compare_and_swap(i8* %0, i64 %1, i64 %2) {
%4 = alloca i8*
%5 = alloca i64
%6 = alloca i64
%7 = alloca i64
store i8* %0, i8** %4
store i64 %1, i64* %5
store i64 %2, i64* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i64*
%10 = load i64, i64* %6
%11 = load i64, i64* %5
%12 = call i64 asm sideeffect "lock; cmpxchgq $2,$1", "={ax},=*m,q,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %9, i64 %10, i64 %11, i64* elementtype(i64) %9)
store i64 %12, i64* %7
%13 = load i64, i64* %7
%14 = load i64, i64* %5
%15 = icmp eq i64 %13, %14
%16 = zext i1 %15 to i32
ret i32 %16
}

LLVM IR (-O2):
define i32 @compare_and_swap(i8* %0, i64 %1, i64 %2) {
%4 = bitcast i8* %0 to i64*
%5 = tail call i64 asm sideeffect "lock; cmpxchgq $2,$1", "={ax},=*m,q,0,*m,~{cc},~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %4, i64 %2, i64 %1, i64* elementtype(i64) %4)
%6 = icmp eq i64 %5, %1
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x44() {
  Assert_real((isprint(68)),
              "/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_isprint.c",
              345, ("isprint should be 1 for D"));
}


x86 assembly (clang, -O0):
<t_isprint_0x44>:
push   %rbp
mov    %rsp,%rbp
mov    $0x44,%edi
call   1030 <isprint@plt>
mov    %eax,%edi
lea    0xec9(%rip),%rsi
mov    $0x159,%edx
lea    0xf65(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isprint_0x44>:
push   %rax
mov    $0x44,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x159,%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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for D\00"
define void @t_isprint_0x44() {
%1 = call i32 @isprint(i32 68)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 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_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for D\00"
define void @t_isprint_0x44() {
%1 = tail call i32 @isprint(i32 68)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 345, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int64_t lte_int64_t(int64_t a, int64_t b) { return a <= b; }


x86 assembly (clang, -O0):
<lte_int64_t>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setle  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lte_int64_t>:
xor    %eax,%eax
cmp    %esi,%edi
setle  %al
ret

LLVM IR (-O0):
define i32 @lte_int64_t(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 = icmp sle i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @lte_int64_t(i32 %0, i32 %1) {
%3 = icmp sle i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ ledloop();
int /*<<< orphan*/ printf(char *);
void cacheExcept(void) {
  printf("cache exception\n");
  ledloop();
}


x86 assembly (clang, -O0):
<cacheExcept>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <ledloop@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cacheExcept>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <ledloop@plt>

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

LLVM IR (-O2):
@str = [16 x i8] c"cache exception\00"
define void @cacheExcept() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @ledloop()
ret void
}
/* Variables and functions */
char *malloc(int);
void malloc_zero_Bad() {
  char *x;
  x = malloc(0);
  x = malloc(1);
}


x86 assembly (clang, -O0):
<malloc_zero_Bad>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
mov    $0x1,%edi
call   1030 <malloc@plt>
mov    %rax,-0x8(%rbp)
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @malloc_zero_Bad() {
ret void
}
int do_260() { return 260; }


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

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

LLVM IR (-O0):
define i32 @do_260() {
ret i32 260
}

LLVM IR (-O2):
define i32 @do_260() {
ret i32 260
}
void unit2element() {}


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

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

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

LLVM IR (-O2):
define void @unit2element() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ print_pun();
int main(void) {
  print_pun();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @print_pun()
ret i32 0
}
char xor_int(int i) {
  char c;
  c = (i & 0xff) ^ ((i & 0xff00) >> 8) ^ ((i & 0xff0000) >> 16) ^
      ((i & 0xff000000) >> 24);
  return c;
}


x86 assembly (clang, -O0):
<xor_int>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
mov    -0x4(%rbp),%ecx
and    $0xff00,%ecx
sar    $0x8,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff0000,%ecx
sar    $0x10,%ecx
xor    %ecx,%eax
mov    -0x4(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
xor    %ecx,%eax
mov    %al,-0x5(%rbp)
movsbl -0x5(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xor_int>:
mov    %edi,%ecx
shr    $0x8,%ecx
xor    %edi,%ecx
mov    %edi,%eax
shr    $0x10,%eax
shr    $0x18,%edi
xor    %edi,%eax
xor    %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @xor_int(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = and i32 %4, 255
%6 = load i32, i32* %2
%7 = and i32 %6, 65280
%8 = ashr i32 %7, 8
%9 = xor i32 %5, %8
%10 = load i32, i32* %2
%11 = and i32 %10, 16711680
%12 = ashr i32 %11, 16
%13 = xor i32 %9, %12
%14 = load i32, i32* %2
%15 = and i32 %14, -16777216
%16 = lshr i32 %15, 24
%17 = xor i32 %13, %16
%18 = trunc i32 %17 to i8
store i8 %18, i8* %3
%19 = load i8, i8* %3
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @xor_int(i32 %0) {
%2 = lshr i32 %0, 8
%3 = xor i32 %2, %0
%4 = lshr i32 %0, 16
%5 = xor i32 %3, %4
%6 = lshr i32 %0, 24
%7 = xor i32 %5, %6
%8 = trunc i32 %7 to i8
ret i8 %8
}
/* Variables and functions */
scalar_t__ sqrt(int const);
int ti_hma_start(double const *options) {
  const int period = (int)options[0];
  const int periodsqrt = (int)(sqrt(period));
  return period + periodsqrt - 2;
}


x86 assembly (clang, -O0):
<ti_hma_start>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%edi
call   1030 <sqrt@plt>
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
sub    $0x2,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_hma_start>:
push   %rbx
cvttsd2si (%rdi),%ebx
mov    %ebx,%edi
call   1030 <sqrt@plt>
add    %ebx,%eax
add    $0xfffffffe,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @ti_hma_start(double* %0) {
%2 = alloca double*
%3 = alloca i32
%4 = alloca i32
store double* %0, double** %2
%5 = load double*, double** %2
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = fptosi double %7 to i32
store i32 %8, i32* %3
%9 = load i32, i32* %3
%10 = call i64 @sqrt(i32 %9)
%11 = trunc i64 %10 to i32
store i32 %11, i32* %4
%12 = load i32, i32* %3
%13 = load i32, i32* %4
%14 = add nsw i32 %12, %13
%15 = sub nsw i32 %14, 2
ret i32 %15
}

LLVM IR (-O2):
define i32 @ti_hma_start(double* nocapture %0) {
%2 = load double, double* %0
%3 = fptosi double %2 to i32
%4 = tail call i64 @sqrt(i32 %3)
%5 = trunc i64 %4 to i32
%6 = add i32 %3, -2
%7 = add i32 %6, %5
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
void buf_commit(size_t buf_max, size_t *buf_cur, size_t count) {
  assert((*buf_cur) + count <= buf_max);
  (*buf_cur) += count;
}


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

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

LLVM IR (-O0):
define void @buf_commit(i64 %0, i64* %1, i64 %2) {
%4 = alloca i64
%5 = alloca i64*
%6 = alloca i64
store i64 %0, i64* %4
store i64* %1, i64** %5
store i64 %2, i64* %6
%7 = load i64*, i64** %5
%8 = load i64, i64* %7
%9 = load i64, i64* %6
%10 = add i64 %8, %9
%11 = load i64, i64* %4
%12 = icmp ule i64 %10, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = load i64, i64* %6
%16 = load i64*, i64** %5
%17 = load i64, i64* %16
%18 = add i64 %17, %15
store i64 %18, i64* %16
ret void
}

LLVM IR (-O2):
define void @buf_commit(i64 %0, i64* nocapture %1, i64 %2) {
%4 = load i64, i64* %1
%5 = add i64 %4, %2
%6 = icmp ule i64 %5, %0
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = load i64, i64* %1
%10 = add i64 %9, %2
store i64 %10, i64* %1
ret void
}
int set_bit(int n, unsigned char pos) {
  int mask = 1 << (pos - 1);
  return n | mask;
}


x86 assembly (clang, -O0):
<set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %edi,-0x4(%rbp)
mov    %al,-0x5(%rbp)
movzbl -0x5(%rbp),%ecx
sub    $0x1,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
or     -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<set_bit>:
mov    %edi,%eax
add    $0xff,%sil
bts    %esi,%eax
ret

LLVM IR (-O0):
define i32 @set_bit(i32 %0, i8 zeroext %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i32
store i32 %0, i32* %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = zext i8 %6 to i32
%8 = sub nsw i32 %7, 1
%9 = shl i32 1, %8
store i32 %9, i32* %5
%10 = load i32, i32* %3
%11 = load i32, i32* %5
%12 = or i32 %10, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @set_bit(i32 %0, i8 zeroext %1) {
%3 = zext i8 %1 to i32
%4 = add nsw i32 %3, -1
%5 = shl nuw i32 1, %4
%6 = or i32 %5, %0
ret i32 %6
}
movecur_hex(a, b) char a, b;
{
  char row, col;
  to_xy(a, b, &row, &col);
  movecur(row, col * 2 + 1);
}


x86 assembly (clang, -O0):
<movecur_hex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%cl
mov    %sil,%al
mov    %cl,-0x5(%rbp)
mov    %al,-0x6(%rbp)
movsbl -0x5(%rbp),%edi
movsbl -0x6(%rbp),%esi
lea    -0x7(%rbp),%rdx
lea    -0x8(%rbp),%rcx
mov    $0x0,%al
call   1040 <to_xy@plt>
movsbl -0x7(%rbp),%edi
movsbl -0x8(%rbp),%esi
shl    $0x1,%esi
add    $0x1,%esi
mov    $0x0,%al
call   1030 <movecur@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<movecur_hex>:
push   %rax
movsbl %dil,%edi
movsbl %sil,%esi
lea    0x7(%rsp),%rdx
lea    0x6(%rsp),%rcx
xor    %eax,%eax
call   1040 <to_xy@plt>
movsbl 0x7(%rsp),%edi
movsbl 0x6(%rsp),%eax
lea    (%rax,%rax,1),%esi
add    $0x1,%esi
xor    %eax,%eax
call   1030 <movecur@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @movecur_hex(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = trunc i32 %0 to i8
%9 = trunc i32 %1 to i8
store i8 %8, i8* %4
store i8 %9, i8* %5
%10 = load i8, i8* %4
%11 = sext i8 %10 to i32
%12 = load i8, i8* %5
%13 = sext i8 %12 to i32
%14 = call i32 (i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @to_xy to i32 (i32, i32, i8*, i8*, ...)*)(i32 %11, i32 %13, i8* %6, i8* %7)
%15 = load i8, i8* %6
%16 = sext i8 %15 to i32
%17 = load i8, i8* %7
%18 = sext i8 %17 to i32
%19 = mul nsw i32 %18, 2
%20 = add nsw i32 %19, 1
%21 = call i32 (i32, i32, ...) bitcast (i32 (...)* @movecur to i32 (i32, i32, ...)*)(i32 %16, i32 %20)
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @movecur_hex(i32 %0, i32 %1) {
%3 = alloca i8
%4 = alloca i8
%5 = shl i32 %0, 24
%6 = ashr exact i32 %5, 24
%7 = shl i32 %1, 24
%8 = ashr exact i32 %7, 24
%9 = call i32 (i32, i32, i8*, i8*, ...) bitcast (i32 (...)* @to_xy to i32 (i32, i32, i8*, i8*, ...)*)(i32 %6, i32 %8, i8* %3, i8* %4)
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = load i8, i8* %4
%13 = sext i8 %12 to i32
%14 = shl nsw i32 %13, 1
%15 = or i32 %14, 1
%16 = call i32 (i32, i32, ...) bitcast (i32 (...)* @movecur to i32 (i32, i32, ...)*)(i32 %11, i32 %15)
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ led_off();
void led_init(void) {
  unsigned int *gpfsel1_ptr = ((unsigned int *)0x20200004);
  *gpfsel1_ptr = *gpfsel1_ptr | 0x40000U;
  led_off();
}


x86 assembly (clang, -O0):
<led_init>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x20200004,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
or     $0x40000,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <led_off@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<led_init>:
orb    $0x4,0x20200006
04
xor    %eax,%eax
jmp    1030 <led_off@plt>

LLVM IR (-O0):
define void @led_init() {
%1 = alloca i32*
store i32* inttoptr (i64 538968068 to i32*), i32** %1
%2 = load i32*, i32** %1
%3 = load i32, i32* %2
%4 = or i32 %3, 262144
%5 = load i32*, i32** %1
store i32 %4, i32* %5
%6 = call i32 (...) @led_off()
ret void
}

LLVM IR (-O2):
define void @led_init() {
%1 = load i32, i32* inttoptr (i64 538968068 to i32*)
%2 = or i32 %1, 262144
store i32 %2, i32* inttoptr (i64 538968068 to i32*)
%3 = tail call i32 (...) @led_off()
ret void
}
/* Variables and functions */
int blink1_enumerateByVidPid(int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ blink1_pid();
int /*<<< orphan*/ blink1_vid();
int blink1_enumerate(void) {
  return blink1_enumerateByVidPid(blink1_vid(), blink1_pid());
}


x86 assembly (clang, -O0):
<blink1_enumerate>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <blink1_vid@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1040 <blink1_pid@plt>
mov    -0x4(%rbp),%edi
mov    %eax,%esi
call   1050 <blink1_enumerateByVidPid@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<blink1_enumerate>:
push   %rbx
xor    %eax,%eax
call   1030 <blink1_vid@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <blink1_pid@plt>
mov    %ebx,%edi
mov    %eax,%esi
pop    %rbx
jmp    1050 <blink1_enumerateByVidPid@plt>

LLVM IR (-O0):
define i32 @blink1_enumerate() {
%1 = call i32 (...) @blink1_vid()
%2 = call i32 (...) @blink1_pid()
%3 = call i32 @blink1_enumerateByVidPid(i32 %1, i32 %2)
ret i32 %3
}

LLVM IR (-O2):
define i32 @blink1_enumerate() {
%1 = tail call i32 (...) @blink1_vid()
%2 = tail call i32 (...) @blink1_pid()
%3 = tail call i32 @blink1_enumerateByVidPid(i32 %1, i32 %2)
ret i32 %3
}
int main() {
  int a[1442];
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1610,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
add    $0x1610,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [1442 x i32]
store i32 0, i32* %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
ret i32 0
}
/* Variables and functions */
char *getenv(char *);
int /*<<< orphan*/ sprintf(char *, char *, char *);
void database_directory(char directory[]) {
  sprintf(directory, "%s/.fin", getenv("HOME"));
}


x86 assembly (clang, -O0):
<database_directory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0xecd(%rip),%rdi
call   1030 <getenv@plt>
mov    -0x10(%rbp),%rdi
mov    %rax,%rdx
lea    0xeb2(%rip),%rsi
call   1040 <sprintf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<database_directory>:
push   %rbx
mov    %rdi,%rbx
lea    0xedd(%rip),%rdi
call   1030 <getenv@plt>
lea    0xec9(%rip),%rsi
mov    %rbx,%rdi
mov    %rax,%rdx
pop    %rbx
jmp    1040 <sprintf@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"%s/.fin\00"
@.str.1 = [5 x i8] c"HOME\00"
define void @database_directory(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%5 = call i32 @sprintf(i8* %3, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %4)
ret void
}

LLVM IR (-O2):
@.str = [8 x i8] c"%s/.fin\00"
@.str.1 = [5 x i8] c"HOME\00"
define void @database_directory(i8* nocapture writeonly %0) {
%2 = tail call i8* @getenv(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @sprintf(i8* dereferenceable(1) %0, i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* %2)
ret void
}
XResetScreenSaver() {}


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

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

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

LLVM IR (-O2):
define i32 @XResetScreenSaver() {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ DeinitFields();
void SwitchFrom_6809(void) { DeinitFields(); }


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

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

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

LLVM IR (-O2):
define void @SwitchFrom_6809() {
%1 = tail call i32 (...) @DeinitFields()
ret void
}
void RandomFunc(unsigned int input[1], unsigned int output[1]) {
  unsigned int state[1];
  unsigned int local1;
  {
    state[0UL] = input[0UL] + 4284877637U;
    local1 = 0UL;
    while (local1 < 0U) {
      if (!(state[0UL] > local1)) {
        state[local1] += state[0UL];
      }
      local1 += 2UL;
    }
    output[0UL] = state[0UL] + 255873917UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
add    $0xff660b45,%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jae    1154 <RandomFunc+0x54>
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
ja     1145 <RandomFunc+0x45>
mov    -0x14(%rbp),%ecx
mov    -0x18(%rbp),%eax
add    -0x14(%rbp,%rax,4),%ecx
mov    %ecx,-0x14(%rbp,%rax,4)
mov    -0x18(%rbp),%eax
add    $0x2,%rax
mov    %eax,-0x18(%rbp)
jmp    1121 <RandomFunc+0x21>
mov    -0x14(%rbp),%eax
add    $0xf40537d,%rax
mov    %eax,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    $0xea65ec2,%eax
add    (%rdi),%eax
mov    %eax,(%rsi)
ret

LLVM IR (-O0):
define void @RandomFunc(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
%5 = alloca [1 x i32]
%6 = alloca i32
store i32* %0, i32** %3
store i32* %1, i32** %4
%7 = load i32*, i32** %3
%8 = getelementptr inbounds i32, i32* %7, i64 0
%9 = load i32, i32* %8
%10 = add i32 %9, -10089659
%11 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
store i32 %10, i32* %11
store i32 0, i32* %6
br label %12
12: ; preds = %28, %2
%13 = load i32, i32* %6
%14 = icmp ult i32 %13, 0
br i1 %14, label %15, label %33
15: ; preds = %12
%16 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%17 = load i32, i32* %16
%18 = load i32, i32* %6
%19 = icmp ugt i32 %17, %18
br i1 %19, label %28, label %20
20: ; preds = %15
%21 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%22 = load i32, i32* %21
%23 = load i32, i32* %6
%24 = zext i32 %23 to i64
%25 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 %24
%26 = load i32, i32* %25
%27 = add i32 %26, %22
store i32 %27, i32* %25
br label %28
28: ; preds = %20, %15
%29 = load i32, i32* %6
%30 = zext i32 %29 to i64
%31 = add i64 %30, 2
%32 = trunc i64 %31 to i32
store i32 %32, i32* %6
br label %12
33: ; preds = %12
%34 = getelementptr inbounds [1 x i32], [1 x i32]* %5, i64 0, i64 0
%35 = load i32, i32* %34
%36 = zext i32 %35 to i64
%37 = add i64 %36, 255873917
%38 = trunc i64 %37 to i32
%39 = load i32*, i32** %4
%40 = getelementptr inbounds i32, i32* %39, i64 0
store i32 %38, i32* %40
ret void
}

LLVM IR (-O2):
define void @RandomFunc(i32* nocapture %0, i32* nocapture writeonly %1) {
%3 = load i32, i32* %0
%4 = add i32 %3, 245784258
store i32 %4, i32* %1
ret void
}
char *my_strcat(char *dst, char *src) {
  char *dest = dst;
  while (*dst)
    dst++;
  while (*src) {
    *dst = *src;
    dst++;
    src++;
  }
  *dst = '\0';
  return dest;
}


x86 assembly (clang, -O0):
<my_strcat>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1132 <my_strcat+0x32>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <my_strcat+0x14>
jmp    1137 <my_strcat+0x37>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     116d <my_strcat+0x6d>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1137 <my_strcat+0x37>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_strcat>:
mov    %rdi,%rax
mov    %rdi,%rcx
cs nopw 0x0(%rax,%rax,1)
mov    %rcx,%rdi
add    $0x1,%rcx
cmpb   $0x0,(%rdi)
jne    1110 <my_strcat+0x10>
mov    (%rsi),%dl
test   %dl,%dl
je     1146 <my_strcat+0x46>
mov    $0xffffffffffffffff,%rdi
nopl   0x0(%rax)
mov    %dl,(%rcx,%rdi,1)
movzbl 0x2(%rsi,%rdi,1),%edx
add    $0x1,%rdi
test   %dl,%dl
jne    1130 <my_strcat+0x30>
add    %rdi,%rcx
mov    %rcx,%rdi
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define i8* @my_strcat(i8* returned %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %0, %2 ], [ %7, %3 ]
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = getelementptr inbounds i8, i8* %4, i64 1
br i1 %6, label %8, label %3
8: ; preds = %3
%9 = load i8, i8* %1
%10 = icmp eq i8 %9, 0
br i1 %10, label %19, label %11
11: ; preds = %8, %11
%12 = phi i8 [ %17, %11 ], [ %9, %8 ]
%13 = phi i8* [ %15, %11 ], [ %4, %8 ]
%14 = phi i8* [ %16, %11 ], [ %1, %8 ]
store i8 %12, i8* %13
%15 = getelementptr inbounds i8, i8* %13, i64 1
%16 = getelementptr inbounds i8, i8* %14, i64 1
%17 = load i8, i8* %16
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %11
19: ; preds = %11, %8
%20 = phi i8* [ %4, %8 ], [ %15, %11 ]
store i8 0, i8* %20
ret i8* %0
}
unsigned long gcd(unsigned long num1, unsigned long num2) {
  unsigned long tmp;
  while (num2) {
    tmp = num2;
    num2 = num1 % num2;
    num1 = tmp;
  }
  return num1;
}


x86 assembly (clang, -O0):
<gcd>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     113c <gcd+0x3c>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edx
divq   -0x10(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    110c <gcd+0xc>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<gcd>:
mov    %rdi,%rax
test   %rsi,%rsi
je     1135 <gcd+0x35>
mov    %rsi,%rdx
jmp    111d <gcd+0x1d>
nopl   (%rax)
xor    %edx,%edx
div    %rcx
mov    %rcx,%rax
test   %rdx,%rdx
je     1132 <gcd+0x32>
mov    %rdx,%rcx
mov    %rax,%rdx
or     %rcx,%rdx
shr    $0x20,%rdx
jne    1110 <gcd+0x10>
xor    %edx,%edx
div    %ecx
jmp    1115 <gcd+0x15>
mov    %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @gcd(i64 %0, i64 %1) {
%3 = icmp eq i64 %1, 0
br i1 %3, label %9, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %6, %4 ], [ %0, %2 ]
%6 = phi i64 [ %7, %4 ], [ %1, %2 ]
%7 = urem i64 %5, %6
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %4
9: ; preds = %4, %2
%10 = phi i64 [ %0, %2 ], [ %6, %4 ]
ret i64 %10
}
extern unsigned short le16dec(const void *buf) {
  const unsigned char *p = (const unsigned char *)buf;
  return ((p[1] << 8) | p[0]);
}


x86 assembly (clang, -O0):
<le16dec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x1(%rax),%eax
shl    $0x8,%eax
mov    -0x10(%rbp),%rcx
movzbl (%rcx),%ecx
or     %ecx,%eax
movzwl %ax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<le16dec>:
movzwl (%rdi),%eax
ret

LLVM IR (-O0):
define zeroext i16 @le16dec(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
store i8* %4, i8** %3
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 1
%7 = load i8, i8* %6
%8 = zext i8 %7 to i32
%9 = shl i32 %8, 8
%10 = load i8*, i8** %3
%11 = getelementptr inbounds i8, i8* %10, i64 0
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %9, %13
%15 = trunc i32 %14 to i16
ret i16 %15
}

LLVM IR (-O2):
define zeroext i16 @le16dec(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = zext i8 %3 to i16
%5 = shl nuw i16 %4, 8
%6 = load i8, i8* %0
%7 = zext i8 %6 to i16
%8 = or i16 %5, %7
ret i16 %8
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hey!");
  printf("this is OSD group!");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [5 x i8] c"Hey!\00"
@.str.1 = [19 x i8] c"this is OSD group!\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"Hey!\00"
@.str.1 = [19 x i8] c"this is OSD group!\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.1, i64 0, i64 0))
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int xstr_vsnprintf(char *destination, size_t destination_max_size,
                   const char *format, va_list arg) {
  return vsnprintf(destination, destination_max_size, format, arg);
}


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

x86 assembly (clang, -O2):
<xstr_vsnprintf>:
jmp    1030 <vsnprintf@plt>

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

LLVM IR (-O2):
define i32 @xstr_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
int x509_unpack_tag(unsigned char *bp, int l) { return l < 2 ? 0 : bp[0]; }


x86 assembly (clang, -O0):
<x509_unpack_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x2,-0xc(%rbp)
jge    111f <x509_unpack_tag+0x1f>
xor    %eax,%eax
mov    %eax,-0x10(%rbp)
jmp    1129 <x509_unpack_tag+0x29>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<x509_unpack_tag>:
xor    %eax,%eax
cmp    $0x2,%esi
jl     110a <x509_unpack_tag+0xa>
movzbl (%rdi),%eax
ret

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

LLVM IR (-O2):
define i32 @x509_unpack_tag(i8* nocapture %0, i32 %1) {
%3 = icmp slt i32 %1, 2
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = load i8, i8* %0
%6 = zext i8 %5 to i32
br label %7
7: ; preds = %2, %4
%8 = phi i32 [ %6, %4 ], [ 0, %2 ]
ret i32 %8
}
void gemini_led_off(int led) {
  if (led >= 0 && led < 8)
    *(unsigned char *)((0xffeffe80) + (led << 3)) = 0;
}


x86 assembly (clang, -O0):
<gemini_led_off>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jl     112b <gemini_led_off+0x2b>
cmpl   $0x8,-0x4(%rbp)
jge    112b <gemini_led_off+0x2b>
mov    -0x4(%rbp),%eax
shl    $0x3,%eax
add    $0xffeffe80,%eax
mov    %eax,%eax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<gemini_led_off>:
cmp    $0x7,%edi
ja     1110 <gemini_led_off+0x10>
mov    %edi,%eax
mov    $0xffeffe80,%ecx
movb   $0x0,(%rcx,%rax,8)
ret

LLVM IR (-O0):
define void @gemini_led_off(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sge i32 %3, 0
br i1 %4, label %5, label %14
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp slt i32 %6, 8
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = load i32, i32* %2
%10 = shl i32 %9, 3
%11 = add i32 -1048960, %10
%12 = zext i32 %11 to i64
%13 = inttoptr i64 %12 to i8*
store i8 0, i8* %13
br label %14
14: ; preds = %8, %5, %1
ret void
}

LLVM IR (-O2):
define void @gemini_led_off(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %8
3: ; preds = %1
%4 = shl nuw nsw i32 %0, 3
%5 = add nuw nsw i32 %4, -1048960
%6 = zext i32 %5 to i64
%7 = inttoptr i64 %6 to i8*
store i8 0, i8* %7
br label %8
8: ; preds = %3, %1
ret void
}
void ircUpdateTimers(int n) {}


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

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

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

LLVM IR (-O2):
define void @ircUpdateTimers(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int rdrand() {
  printf("RDRAND is not supported.");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [25 x i8] c"RDRAND is not supported.\00"
define i32 @rdrand() {
%1 = call i32 @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [25 x i8] c"RDRAND is not supported.\00"
define i32 @rdrand() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int dobldobl_Newton_power_series(int idx, int maxdeg, int nbr, int verbose) {
  int fail = 0;
  int idxnbr[3];
  double *c;
  idxnbr[0] = idx;
  idxnbr[1] = maxdeg;
  idxnbr[2] = nbr;
  fail = _ada_use_c2phc4c(695, idxnbr, &verbose, c, 0);
  return fail;
}


x86 assembly (clang, -O0):
<dobldobl_Newton_power_series>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x1c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rcx
mov    $0x2b7,%edi
lea    -0x10(%rbp),%rdx
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dobldobl_Newton_power_series>:
sub    $0x18,%rsp
mov    %ecx,0x8(%rsp)
mov    %edi,0xc(%rsp)
mov    %esi,0x10(%rsp)
mov    %edx,0x14(%rsp)
lea    0xc(%rsp),%rsi
lea    0x8(%rsp),%rdx
mov    $0x2b7,%edi
xor    %r8d,%r8d
call   1030 <_ada_use_c2phc4c@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @dobldobl_Newton_power_series(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca [3 x i32]
%11 = alloca double*
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store i32 0, i32* %9
%12 = load i32, i32* %5
%13 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
store i32 %12, i32* %13
%14 = load i32, i32* %6
%15 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 1
store i32 %14, i32* %15
%16 = load i32, i32* %7
%17 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 2
store i32 %16, i32* %17
%18 = getelementptr inbounds [3 x i32], [3 x i32]* %10, i64 0, i64 0
%19 = load double*, double** %11
%20 = call i32 @_ada_use_c2phc4c(i32 695, i32* %18, i32* %8, double* %19, i32 0)
store i32 %20, i32* %9
%21 = load i32, i32* %9
ret i32 %21
}

LLVM IR (-O2):
define i32 @dobldobl_Newton_power_series(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca [3 x i32]
store i32 %3, i32* %5
%7 = bitcast [3 x i32]* %6 to i8*
%8 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 0
store i32 %0, i32* %8
%9 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 1
store i32 %1, i32* %9
%10 = getelementptr inbounds [3 x i32], [3 x i32]* %6, i64 0, i64 2
store i32 %2, i32* %10
%11 = call i32 @_ada_use_c2phc4c(i32 695, i32* %8, i32* %5, double* undef, i32 0)
ret i32 %11
}
double ceil(double d) {
  int c = (int)d;
  if (d > 0)
    d = (double)(c + 1);
  else if (d < 0)
    d = (double)c;
  return (d);
}


x86 assembly (clang, -O0):
<ceil>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
cvttsd2si -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1137 <ceil+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1154 <ceil+0x54>
xorps  %xmm0,%xmm0
ucomisd -0x8(%rbp),%xmm0
jbe    114f <ceil+0x4f>
cvtsi2sdl -0xc(%rbp),%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1154 <ceil+0x54>
movsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil>:
cvttsd2si %xmm0,%eax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    1113 <ceil+0x13>
add    $0x1,%eax
jmp    1119 <ceil+0x19>
ucomisd %xmm0,%xmm1
jbe    1120 <ceil+0x20>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @ceil(double %0) {
%2 = alloca double
%3 = alloca i32
store double %0, double* %2
%4 = load double, double* %2
%5 = fptosi double %4 to i32
store i32 %5, i32* %3
%6 = load double, double* %2
%7 = fcmp ogt double %6, 0.000000e+00
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* %3
%10 = add nsw i32 %9, 1
%11 = sitofp i32 %10 to double
store double %11, double* %2
br label %19
12: ; preds = %1
%13 = load double, double* %2
%14 = fcmp olt double %13, 0.000000e+00
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i32, i32* %3
%17 = sitofp i32 %16 to double
store double %17, double* %2
br label %18
18: ; preds = %15, %12
br label %19
19: ; preds = %18, %8
%20 = load double, double* %2
ret double %20
}

LLVM IR (-O2):
define double @ceil(double %0) {
%2 = fptosi double %0 to i32
%3 = fcmp ogt double %0, 0.000000e+00
br i1 %3, label %4, label %7
4: ; preds = %1
%5 = add nsw i32 %2, 1
%6 = sitofp i32 %5 to double
br label %11
7: ; preds = %1
%8 = fcmp olt double %0, 0.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %7
%10 = sitofp i32 %2 to double
br label %11
11: ; preds = %7, %9, %4
%12 = phi double [ %6, %4 ], [ %10, %9 ], [ %0, %7 ]
ret double %12
}
int rb_isgraph(int c) { return '!' <= c && c <= '\x7e'; }


x86 assembly (clang, -O0):
<rb_isgraph>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
mov    $0x21,%ecx
cmp    -0x4(%rbp),%ecx
mov    %al,-0x5(%rbp)
jg     1124 <rb_isgraph+0x24>
cmpl   $0x7e,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rb_isgraph>:
add    $0xffffffdf,%edi
xor    %eax,%eax
cmp    $0x5e,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @rb_isgraph(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 33, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sle i32 %6, 126
br label %8
8: ; preds = %5, %1
%9 = phi i1 [ false, %1 ], [ %7, %5 ]
%10 = zext i1 %9 to i32
ret i32 %10
}

LLVM IR (-O2):
define i32 @rb_isgraph(i32 %0) {
%2 = add i32 %0, -33
%3 = icmp ult i32 %2, 94
%4 = zext i1 %3 to i32
ret i32 %4
}
char *strcpy(char *dst, const char *src) {
  char *r = dst;
  while ((*dst++ = *src++))
    ;
  return r;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
float rand_float(int const);
float rand_sign();
float rand_signfloat(const int range) {
  return rand_float(range) * rand_sign();
}


x86 assembly (clang, -O0):
<rand_signfloat>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <rand_float@plt>
movss  %xmm0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <rand_sign@plt>
movaps %xmm0,%xmm1
movss  -0x8(%rbp),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rand_signfloat>:
push   %rax
call   1030 <rand_float@plt>
movss  %xmm0,0x4(%rsp)
xor    %eax,%eax
call   1040 <rand_sign@plt>
mulss  0x4(%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @rand_signfloat(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call float @rand_float(i32 %3)
%5 = call float (...) @rand_sign()
%6 = fmul float %4, %5
ret float %6
}

LLVM IR (-O2):
define float @rand_signfloat(i32 %0) {
%2 = tail call float @rand_float(i32 %0)
%3 = tail call float (...) @rand_sign()
%4 = fmul float %2, %3
ret float %4
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fputs(char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ putc(int, int /*<<< orphan*/ *);
void putc_entity(int ch, FILE *fp) {
  if (ch == '&')
    fputs("&amp;", fp);
  else if (ch == '<')
    fputs("&lt;", fp);
  else
    putc(ch, fp);
}


x86 assembly (clang, -O0):
<putc_entity>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x26,-0x4(%rbp)
jne    114e <putc_entity+0x2e>
mov    -0x10(%rbp),%rsi
lea    0xebc(%rip),%rdi
call   1030 <fputs@plt>
jmp    117e <putc_entity+0x5e>
cmpl   $0x3c,-0x4(%rbp)
jne    116d <putc_entity+0x4d>
mov    -0x10(%rbp),%rsi
lea    0xea3(%rip),%rdi
call   1030 <fputs@plt>
jmp    1179 <putc_entity+0x59>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1040 <putc@plt>
jmp    117e <putc_entity+0x5e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putc_entity>:
mov    %rsi,%rcx
cmp    $0x3c,%edi
je     1143 <putc_entity+0x23>
cmp    $0x26,%edi
jne    1159 <putc_entity+0x39>
lea    0xecc(%rip),%rdi
mov    $0x5,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>
lea    0xebc(%rip),%rdi
mov    $0x4,%esi
mov    $0x1,%edx
jmp    1040 <fwrite@plt>
mov    %rcx,%rsi
jmp    1030 <putc@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"&amp;\00"
@.str.1 = [5 x i8] c"&lt;\00"
define void @putc_entity(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 = icmp eq i32 %5, 38
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32*, i32** %4
%9 = call i32 @fputs(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32* %8)
br label %21
10: ; preds = %2
%11 = load i32, i32* %3
%12 = icmp eq i32 %11, 60
br i1 %12, label %13, label %16
13: ; preds = %10
%14 = load i32*, i32** %4
%15 = call i32 @fputs(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32* %14)
br label %20
16: ; preds = %10
%17 = load i32, i32* %3
%18 = load i32*, i32** %4
%19 = call i32 @putc(i32 %17, i32* %18)
br label %20
20: ; preds = %16, %13
br label %21
21: ; preds = %20, %7
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"&amp;\00"
@.str.1 = [5 x i8] c"&lt;\00"
define void @putc_entity(i32 %0, i32* nocapture %1) {
switch i32 %0, label %7 [
i32 38, label %3
i32 60, label %5
]
3: ; preds = %2
%4 = tail call i64 @fwrite(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i64 5, i64 1, i32* %1)
br label %9
5: ; preds = %2
%6 = tail call i64 @fwrite(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 4, i64 1, i32* %1)
br label %9
7: ; preds = %2
%8 = tail call i32 @putc(i32 %0, i32* %1)
br label %9
9: ; preds = %5, %7, %3
ret void
}