xunge/DecIR huggingface dataset:
/* Variables and functions */
unsigned int toint(int /*<<< orphan*/);
unsigned int ctoi(char *s) {
  unsigned int sum = 0;
  while (*s) {
    sum = sum * 10 + toint(*s++);
  }
  return sum;
}


x86 assembly (clang, -O0):
<ctoi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     115d <ctoi+0x4d>
imul   $0xa,-0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%edi
call   1030 <toint@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
jmp    1123 <ctoi+0x13>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ctoi>:
push   %r14
push   %rbx
push   %rax
mov    (%rdi),%cl
test   %cl,%cl
je     114d <ctoi+0x3d>
mov    %rdi,%rbx
add    $0x1,%rbx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rax,%rax,4),%r14d
movsbl %cl,%edi
call   1030 <toint@plt>
lea    (%rax,%r14,2),%eax
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1130 <ctoi+0x20>
jmp    114f <ctoi+0x3f>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i32 @ctoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %13, %4 ], [ %2, %1 ]
%6 = phi i32 [ %12, %4 ], [ 0, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 10
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = tail call i32 @toint(i32 %10)
%12 = add i32 %11, %8
%13 = load i8, i8* %9
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 0, %1 ], [ %12, %4 ]
ret i32 %16
}
int test_imm_A6uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0xA6 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A6uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 166
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char, double);
double sqrt(double);
int main() {
  double f = 9.99;
  f = sqrt(f);
  printf("%c%f\n", ' ', f);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef0(%rip),%rdi
movsd  0xee0(%rip),%xmm0
mov    $0x20,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%c%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca double
store i32 0, i32* %1
store double 9.990000e+00, double* %2
%3 = load double, double* %2
%4 = call double @sqrt(double %3)
store double %4, double* %2
%5 = load double, double* %2
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 32, double %5)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%c%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8 signext 32, double 0x4009491B0CE92840)
ret i32 0
}
/* Type definitions */
typedef int clock_t;

/* Variables and functions */
int clock();
long currentTimeMillis() {
  clock_t t1;
  t1 = clock();
  return t1 / 1000;
}


x86 assembly (clang, -O0):
<currentTimeMillis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <clock@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x3e8,%ecx
cltd
idiv   %ecx
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<currentTimeMillis>:
push   %rax
xor    %eax,%eax
call   1030 <clock@plt>
cltq
imul   $0x10624dd3,%rax,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x26,%rax
add    %ecx,%eax
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i64 @currentTimeMillis() {
%1 = alloca i32
%2 = call i32 (...) @clock()
store i32 %2, i32* %1
%3 = load i32, i32* %1
%4 = sdiv i32 %3, 1000
%5 = sext i32 %4 to i64
ret i64 %5
}

LLVM IR (-O2):
define i64 @currentTimeMillis() {
%1 = tail call i32 (...) @clock()
%2 = sdiv i32 %1, 1000
%3 = sext i32 %2 to i64
ret i64 %3
}
int test_imm_A1uint16_mem(unsigned short *val) {
  return ((*val) & (0xA1 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A1uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 161
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
void mp2vseqx_set_frameraten(uint8_t *p_mp2vseqx, uint8_t i_frameraten) {
  p_mp2vseqx[9] &= 0x9f;
  p_mp2vseqx[9] |= (i_frameraten << 5) & 0x60;
}


x86 assembly (clang, -O0):
<mp2vseqx_set_frameraten>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    0x24(%rax),%ecx
and    $0x9f,%ecx
mov    %ecx,0x24(%rax)
mov    -0xc(%rbp),%ecx
shl    $0x5,%ecx
and    $0x60,%ecx
mov    -0x8(%rbp),%rax
or     0x24(%rax),%ecx
mov    %ecx,0x24(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<mp2vseqx_set_frameraten>:
mov    $0x9f,%eax
and    0x24(%rdi),%eax
shl    $0x5,%esi
and    $0x60,%esi
or     %eax,%esi
mov    %esi,0x24(%rdi)
ret

LLVM IR (-O0):
define void @mp2vseqx_set_frameraten(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 = getelementptr inbounds i32, i32* %5, i64 9
%7 = load i32, i32* %6
%8 = and i32 %7, 159
store i32 %8, i32* %6
%9 = load i32, i32* %4
%10 = shl i32 %9, 5
%11 = and i32 %10, 96
%12 = load i32*, i32** %3
%13 = getelementptr inbounds i32, i32* %12, i64 9
%14 = load i32, i32* %13
%15 = or i32 %14, %11
store i32 %15, i32* %13
ret void
}

LLVM IR (-O2):
define void @mp2vseqx_set_frameraten(i32* nocapture %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 9
%4 = load i32, i32* %3
%5 = and i32 %4, 159
%6 = shl i32 %1, 5
%7 = and i32 %6, 96
%8 = or i32 %5, %7
store i32 %8, i32* %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ set_io_bit(int, int);
void TOSH_MAKE_CC_FIFOP_OUTPUT() { set_io_bit(-6, 1); }


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

x86 assembly (clang, -O2):
<TOSH_MAKE_CC_FIFOP_OUTPUT>:
mov    $0xfffffffa,%edi
mov    $0x1,%esi
jmp    1030 <set_io_bit@plt>

LLVM IR (-O0):
define void @TOSH_MAKE_CC_FIFOP_OUTPUT() {
%1 = call i32 @set_io_bit(i32 -6, i32 1)
ret void
}

LLVM IR (-O2):
define void @TOSH_MAKE_CC_FIFOP_OUTPUT() {
%1 = tail call i32 @set_io_bit(i32 -6, i32 1)
ret void
}
/* Variables and functions */
bool verify_leap_years(int year) {
  bool leap = false;
  if (year % 400 == 0 || ((year % 4 == 0) && (year % 100 != 0))) {
    leap = true;
  }
  return leap;
}


x86 assembly (clang, -O0):
<verify_leap_years>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     114a <verify_leap_years+0x4a>
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    1151 <verify_leap_years+0x51>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
je     1151 <verify_leap_years+0x51>
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<verify_leap_years>:
imul   $0xc28f5c29,%edi,%eax
add    $0x51eb850,%eax
ror    $0x4,%eax
cmp    $0xa3d70b,%eax
jb     113b <verify_leap_years+0x3b>
xor    %eax,%eax
test   $0x3,%dil
jne    1140 <verify_leap_years+0x40>
movslq %edi,%rcx
imul   $0x51eb851f,%rcx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x25,%rcx
add    %edx,%ecx
imul   $0x64,%ecx,%ecx
sub    %ecx,%edi
je     1140 <verify_leap_years+0x40>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @verify_leap_years(i32 %0) {
%2 = srem i32 %0, 400
%3 = icmp eq i32 %2, 0
br i1 %3, label %10, label %4
4: ; preds = %1
%5 = and i32 %0, 3
%6 = icmp ne i32 %5, 0
%7 = srem i32 %0, 100
%8 = icmp eq i32 %7, 0
%9 = or i1 %6, %8
br i1 %9, label %11, label %10
10: ; preds = %4, %1
br label %11
11: ; preds = %10, %4
%12 = phi i32 [ 1, %10 ], [ 0, %4 ]
ret i32 %12
}
/* Variables and functions */
int INT_MAX;
int INT_MIN;
double scalbn(double, int);
double scalbln(double x, long n) {
  int in;
  in = (int)n;
  if (in != n) {
    if (n > 0)
      in = INT_MAX;
    else
      in = INT_MIN;
  }
  return (scalbn(x, in));
}


x86 assembly (clang, -O0):
<scalbln>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     1163 <scalbln+0x53>
cmpq   $0x0,-0x10(%rbp)
jle    1152 <scalbln+0x42>
mov    0x2ea0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    115e <scalbln+0x4e>
mov    0x2e87(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x14(%rbp)
jmp    1163 <scalbln+0x53>
movsd  -0x8(%rbp),%xmm0
mov    -0x14(%rbp),%edi
call   1030 <scalbn@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<scalbln>:
movslq %edi,%rax
cmp    %rdi,%rax
je     112f <scalbln+0x1f>
test   %rdi,%rdi
jle    1126 <scalbln+0x16>
mov    0x2ec4(%rip),%rax
jmp    112d <scalbln+0x1d>
mov    0x2eb3(%rip),%rax
mov    (%rax),%edi
jmp    1030 <scalbn@plt>

LLVM IR (-O0):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define double @scalbln(double %0, i64 %1) {
%3 = alloca double
%4 = alloca i64
%5 = alloca i32
store double %0, double* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = trunc i64 %6 to i32
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = sext i32 %8 to i64
%10 = load i64, i64* %4
%11 = icmp ne i64 %9, %10
br i1 %11, label %12, label %20
12: ; preds = %2
%13 = load i64, i64* %4
%14 = icmp sgt i64 %13, 0
br i1 %14, label %15, label %17
15: ; preds = %12
%16 = load i32, i32* @INT_MAX
store i32 %16, i32* %5
br label %19
17: ; preds = %12
%18 = load i32, i32* @INT_MIN
store i32 %18, i32* %5
br label %19
19: ; preds = %17, %15
br label %20
20: ; preds = %19, %2
%21 = load double, double* %3
%22 = load i32, i32* %5
%23 = call double @scalbn(double %21, i32 %22)
ret double %23
}

LLVM IR (-O2):
@INT_MAX = global i32 0
@INT_MIN = global i32 0
define double @scalbln(double %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i64 %1, 2147483648
%5 = icmp ult i64 %4, 4294967296
br i1 %5, label %12, label %6
6: ; preds = %2
%7 = icmp sgt i64 %1, 0
br i1 %7, label %8, label %10
8: ; preds = %6
%9 = load i32, i32* @INT_MAX
br label %12
10: ; preds = %6
%11 = load i32, i32* @INT_MIN
br label %12
12: ; preds = %8, %10, %2
%13 = phi i32 [ %9, %8 ], [ %11, %10 ], [ %3, %2 ]
%14 = tail call double @scalbn(double %0, i32 %13)
ret double %14
}
/* Type definitions */
struct roff_node {
  int dummy;
};
struct roff_meta {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ font_push(char);
int pre_li(const struct roff_meta *meta, struct roff_node *n) {
  font_push('R');
  return 1;
}


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

x86 assembly (clang, -O2):
<pre_li>:
push   %rax
mov    $0x52,%edi
call   1030 <font_push@plt>
mov    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
define i32 @pre_li(%struct.roff_meta* %0, %struct.roff_node* %1) {
%3 = alloca %struct.roff_meta*
%4 = alloca %struct.roff_node*
store %struct.roff_meta* %0, %struct.roff_meta** %3
store %struct.roff_node* %1, %struct.roff_node** %4
%5 = call i32 @font_push(i8 signext 82)
ret i32 1
}

LLVM IR (-O2):
%struct.roff_meta = type { i32 }
%struct.roff_node = type { i32 }
define i32 @pre_li(%struct.roff_meta* nocapture readnone %0, %struct.roff_node* nocapture readnone %1) {
%3 = tail call i32 @font_push(i8 signext 82)
ret i32 1
}
int test_imm_64int64_lowword_reg(long long val) {
  return ((val) & (0x64 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_64int64_lowword_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdx
and    $0x64,%rdx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%rdx
cmovne %ecx,%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @test_imm_64int64_lowword_reg(i64 %0) {
%2 = and i64 %0, 100
%3 = icmp eq i64 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_stream_get_context() {
  printf("NOT IMPLEMENTED:"
         "pa_stream_get_context"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [38 x i8] c"NOT IMPLEMENTED:pa_stream_get_context\00"
define i32 @pa_stream_get_context() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int test_imm_27uint16_mem(unsigned short *val) {
  return ((*val) & (0x27 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_27uint16_mem(i16* nocapture %0) {
%2 = load i16, i16* %0
%3 = and i16 %2, 39
%4 = icmp eq i16 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ output_byte(char);
void gen_comment(void) { output_byte(';'); }


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

x86 assembly (clang, -O2):
<gen_comment>:
mov    $0x3b,%edi
jmp    1030 <output_byte@plt>

LLVM IR (-O0):
define void @gen_comment() {
%1 = call i32 @output_byte(i8 signext 59)
ret void
}

LLVM IR (-O2):
define void @gen_comment() {
%1 = tail call i32 @output_byte(i8 signext 59)
ret void
}
int test_imm_5Dint8_mem(signed char *val) {
  return ((*val) & (0x5D << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_5Dint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 93
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
void byte_reverse_float(float *fnum) {
  union {
    unsigned int i;
    float f;
  } x;
  x.f = *fnum;
  x.i = (((x.i & 0x000000ffU) << 24) | ((x.i & 0x0000ff00U) << 8) |
         ((x.i & 0x00ff0000U) >> 8) | ((x.i & 0xff000000U) >> 24));
  *fnum = x.f;
}


x86 assembly (clang, -O0):
<byte_reverse_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xff,%eax
shl    $0x18,%eax
mov    -0x10(%rbp),%ecx
and    $0xff00,%ecx
shl    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0xff0000,%ecx
shr    $0x8,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
and    $0xff000000,%ecx
shr    $0x18,%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
%union.anon = type { i32 }
define void @byte_reverse_float(float* %0) {
%2 = alloca float*
%3 = alloca %union.anon
store float* %0, float** %2
%4 = load float*, float** %2
%5 = load float, float* %4
%6 = bitcast %union.anon* %3 to float*
store float %5, float* %6
%7 = bitcast %union.anon* %3 to i32*
%8 = load i32, i32* %7
%9 = and i32 %8, 255
%10 = shl i32 %9, 24
%11 = bitcast %union.anon* %3 to i32*
%12 = load i32, i32* %11
%13 = and i32 %12, 65280
%14 = shl i32 %13, 8
%15 = or i32 %10, %14
%16 = bitcast %union.anon* %3 to i32*
%17 = load i32, i32* %16
%18 = and i32 %17, 16711680
%19 = lshr i32 %18, 8
%20 = or i32 %15, %19
%21 = bitcast %union.anon* %3 to i32*
%22 = load i32, i32* %21
%23 = and i32 %22, -16777216
%24 = lshr i32 %23, 24
%25 = or i32 %20, %24
%26 = bitcast %union.anon* %3 to i32*
store i32 %25, i32* %26
%27 = bitcast %union.anon* %3 to float*
%28 = load float, float* %27
%29 = load float*, float** %2
store float %28, float* %29
ret void
}

LLVM IR (-O2):
define void @byte_reverse_float(float* nocapture %0) {
%2 = bitcast float* %0 to i32*
%3 = load i32, i32* %2
%4 = tail call i32 @llvm.bswap.i32(i32 %3)
store i32 %4, i32* %2
ret void
}
double logistic_map(double x, double a) { return a * x * (1 - x); }


x86 assembly (clang, -O0):
<logistic_map>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xee0(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<logistic_map>:
mulsd  %xmm0,%xmm1
movsd  0xef4(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @logistic_map(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = load double, double* %3
%9 = fsub double 1.000000e+00, %8
%10 = fmul double %7, %9
ret double %10
}

LLVM IR (-O2):
define double @logistic_map(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fsub double 1.000000e+00, %0
%5 = fmul double %4, %3
ret double %5
}
/* Variables and functions */
int /*<<< orphan*/ nrerror(char *);
void usage(void) {
  nrerror("usage: RNAeval  [-T temp] [-4] [-d[0|1|2]] [-e e_set] [-logML] [-P "
          "paramfile] [-circ] [-v]");
}


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

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

LLVM IR (-O0):
@.str = [91 x i8] c"usage: RNAeval [-T temp] [-4] [-d[0|1|2]] [-e e_set] [-logML] [-P paramfile] [-circ] [-v]\00"
define void @usage() {
%1 = call i32 @nrerror(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [91 x i8] c"usage: RNAeval [-T temp] [-4] [-d[0|1|2]] [-e e_set] [-logML] [-P paramfile] [-circ] [-v]\00"
define void @usage() {
%1 = tail call i32 @nrerror(i8* getelementptr inbounds ([91 x i8], [91 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ xfree(void *);
void free_test_data_v(void **ptr) {
  do {
    xfree(*ptr);
    (*ptr) = NULL;
  } while (0);
}


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

x86 assembly (clang, -O2):
<free_test_data_v>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%rdi
call   1030 <xfree@plt>
movq   $0x0,(%rbx)
pop    %rbx
ret

LLVM IR (-O0):
define void @free_test_data_v(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
br label %3
3: ; preds = %1
%4 = load i8**, i8*** %2
%5 = load i8*, i8** %4
%6 = call i32 @xfree(i8* %5)
%7 = load i8**, i8*** %2
store i8* null, i8** %7
br label %8
8: ; preds = %3
ret void
}

LLVM IR (-O2):
define void @free_test_data_v(i8** nocapture %0) {
%2 = load i8*, i8** %0
%3 = tail call i32 @xfree(i8* %2)
store i8* null, i8** %0
ret void
}
/* Variables and functions */
int /*<<< orphan*/ gen_call(char *);
int /*<<< orphan*/ gen_pop();
void gen_greater_or_equal(void) {
  gen_pop();
  gen_call("_ge");
}


x86 assembly (clang, -O0):
<gen_greater_or_equal>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <gen_pop@plt>
lea    0xece(%rip),%rdi
call   1040 <gen_call@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<gen_greater_or_equal>:
push   %rax
xor    %eax,%eax
call   1030 <gen_pop@plt>
lea    0xed1(%rip),%rdi
pop    %rax
jmp    1040 <gen_call@plt>

LLVM IR (-O0):
@.str = [4 x i8] c"_ge\00"
define void @gen_greater_or_equal() {
%1 = call i32 (...) @gen_pop()
%2 = call i32 @gen_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [4 x i8] c"_ge\00"
define void @gen_greater_or_equal() {
%1 = tail call i32 (...) @gen_pop()
%2 = tail call i32 @gen_call(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void FatalError(void) {
  printf("There was a fatal error, exiting\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [34 x i8] c"There was a fatal error, exiting\0A\00"
define void @FatalError() {
%1 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [33 x i8] c"There was a fatal error, exiting\00"
define void @FatalError() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
uint64_t rotl_64h(long dummy, uint64_t x) { return (x << 16) | (x >> 48); }


x86 assembly (clang, -O0):
<rotl_64h>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x10,%eax
mov    -0xc(%rbp),%edx
mov    $0x30,%ecx
sar    %cl,%edx
mov    %edx,%ecx
or     %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @rotl_64h(i64 %0, i32 %1) {
%3 = alloca i64
%4 = alloca i32
store i64 %0, i64* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = shl i32 %5, 16
%7 = load i32, i32* %4
%8 = ashr i32 %7, 48
%9 = or i32 %6, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @rotl_64h(i64 %0, i32 %1) {
ret i32 poison
}
/* Type definitions */
struct timeval {
  int tv_sec;
  unsigned long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
unsigned long rudp_curr_time() {
  struct timeval tv;
  gettimeofday(&tv, NULL);
  return 1000000 * tv.tv_sec + tv.tv_usec;
}


x86 assembly (clang, -O0):
<rudp_curr_time>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    -0x10(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
imul   $0xf4240,-0x10(%rbp),%eax
cltq
add    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rudp_curr_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
movslq 0x8(%rsp),%rax
imul   $0xf4240,%rax,%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
define i64 @rudp_curr_time() {
%1 = alloca %struct.timeval
%2 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%3 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%4 = load i32, i32* %3
%5 = mul nsw i32 1000000, %4
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
define i64 @rudp_curr_time() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i32 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%5 = load i32, i32* %4
%6 = mul nsw i32 %5, 1000000
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load i64, i64* %8
%10 = add i64 %9, %7
ret i64 %10
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
typedef int /*<<< orphan*/ string;
typedef int /*<<< orphan*/ ssize_t;

/* Variables and functions */
int snprintf(char *, int, char *, int /*<<< orphan*/);
int /*<<< orphan*/ writen_ni(int, char *, int);
ssize_t dsu_setUnixTime(int fd, time_t cur_time) {
  char string[250];
  int len;
  len = snprintf(string, sizeof(string), "setUnixTime %lu\r\n", cur_time);
  return (writen_ni(fd, string, len));
}


x86 assembly (clang, -O0):
<dsu_setUnixTime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%ecx
mov    $0xfa,%esi
lea    0xeb9(%rip),%rdx
call   1030 <snprintf@plt>
mov    %eax,-0x114(%rbp)
mov    -0x4(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    -0x114(%rbp),%edx
call   1040 <writen_ni@plt>
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dsu_setUnixTime>:
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %esi,%ecx
mov    %edi,%ebx
lea    0xecb(%rip),%rdx
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0xfa,%esi
call   1030 <snprintf@plt>
mov    %ebx,%edi
mov    %r14,%rsi
mov    %eax,%edx
call   1040 <writen_ni@plt>
add    $0x108,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [18 x i8] c"setUnixTime %lu\0D\0A\00"
define i32 @dsu_setUnixTime(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca [250 x i8]
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%8 = load i32, i32* %4
%9 = call i32 @snprintf(i8* %7, i32 250, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %8)
store i32 %9, i32* %6
%10 = load i32, i32* %3
%11 = getelementptr inbounds [250 x i8], [250 x i8]* %5, i64 0, i64 0
%12 = load i32, i32* %6
%13 = call i32 @writen_ni(i32 %10, i8* %11, i32 %12)
ret i32 %13
}

LLVM IR (-O2):
@.str = [18 x i8] c"setUnixTime %lu\0D\0A\00"
define i32 @dsu_setUnixTime(i32 %0, i32 %1) {
%3 = alloca [250 x i8]
%4 = getelementptr inbounds [250 x i8], [250 x i8]* %3, i64 0, i64 0
%5 = call i32 @snprintf(i8* %4, i32 250, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %1)
%6 = call i32 @writen_ni(i32 %0, i8* %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ show_usage();
int /*<<< orphan*/ sync();
extern int sync_main(int argc, char **argv) {
  if (argc > 1 && **(argv + 1) == '-')
    show_usage();
  sync();
  return (EXIT_SUCCESS);
}


x86 assembly (clang, -O0):
<sync_main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x1,-0x4(%rbp)
jle    1154 <sync_main+0x34>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1154 <sync_main+0x34>
mov    $0x0,%al
call   1040 <show_usage@plt>
mov    $0x0,%al
call   1030 <sync@plt>
mov    0x2e7e(%rip),%rax
mov    (%rax),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sync_main>:
push   %rax
cmp    $0x2,%edi
jl     1136 <sync_main+0x16>
mov    0x8(%rsi),%rax
cmpb   $0x2d,(%rax)
jne    1136 <sync_main+0x16>
xor    %eax,%eax
call   1040 <show_usage@plt>
xor    %eax,%eax
call   1030 <sync@plt>
mov    0x2e9c(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
define i32 @sync_main(i32 %0, i8** nocapture %1) {
%3 = icmp sgt i32 %0, 1
br i1 %3, label %4, label %11
4: ; preds = %2
%5 = getelementptr inbounds i8*, i8** %1, i64 1
%6 = load i8*, i8** %5
%7 = load i8, i8* %6
%8 = icmp eq i8 %7, 45
br i1 %8, label %9, label %11
9: ; preds = %4
%10 = tail call i32 (...) @show_usage()
br label %11
11: ; preds = %9, %4, %2
%12 = tail call i32 (...) @sync()
%13 = load i32, i32* @EXIT_SUCCESS
ret i32 %13
}
/* Variables and functions */
scalar_t__ string_dup(char *);
void *miscstringhook_copy(void *hook) {
  if (hook) {
    return (void *)string_dup((char *)hook);
  }
  return NULL;
}


x86 assembly (clang, -O0):
<miscstringhook_copy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1139 <miscstringhook_copy+0x29>
mov    -0x10(%rbp),%rdi
call   1030 <string_dup@plt>
mov    %rax,-0x8(%rbp)
jmp    1141 <miscstringhook_copy+0x31>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<miscstringhook_copy>:
test   %rdi,%rdi
je     1120 <miscstringhook_copy+0x10>
push   %rax
call   1030 <string_dup@plt>
add    $0x8,%rsp
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i8* @miscstringhook_copy(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8*, i8** %3
%8 = call i64 @string_dup(i8* %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %2
br label %11
10: ; preds = %1
store i8* null, i8** %2
br label %11
11: ; preds = %10, %6
%12 = load i8*, i8** %2
ret i8* %12
}

LLVM IR (-O2):
define i8* @miscstringhook_copy(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %6, label %3
3: ; preds = %1
%4 = tail call i64 @string_dup(i8* %0)
%5 = inttoptr i64 %4 to i8*
br label %6
6: ; preds = %1, %3
%7 = phi i8* [ %5, %3 ], [ null, %1 ]
ret i8* %7
}
void vla_typedef_multi(int x, int y) { typedef int VLA[x][y]; }


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

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

LLVM IR (-O0):
define void @vla_typedef_multi(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 = zext i32 %5 to i64
%7 = load i32, i32* %4
%8 = zext i32 %7 to i64
ret void
}

LLVM IR (-O2):
define void @vla_typedef_multi(i32 %0, i32 %1) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __get_cpuid(int, unsigned int *, unsigned int *,
                               unsigned int *, unsigned int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ vector_2_x();
int main() {
  unsigned int eax, ebx, ecx, edx;
  if (!__get_cpuid(1, &eax, &ebx, &ecx, &edx))
    return 0;
  if (ecx & (1 << 28))
    vector_2_x();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1,%edi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
lea    -0x14(%rbp),%r8
call   1040 <__get_cpuid@plt>
cmp    $0x0,%eax
jne    116a <main+0x3a>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret
mov    -0x10(%rbp),%eax
and    $0x10000000,%eax
cmp    $0x0,%eax
je     1182 <main+0x52>
mov    $0x0,%al
call   1030 <vector_2_x@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
lea    0x14(%rsp),%rsi
lea    0x10(%rsp),%rdx
lea    0x8(%rsp),%rcx
lea    0xc(%rsp),%r8
mov    $0x1,%edi
call   1040 <__get_cpuid@plt>
test   %eax,%eax
jne    115d <main+0x2d>
xor    %eax,%eax
add    $0x18,%rsp
ret
testb  $0x10,0xb(%rsp)
je     116b <main+0x3b>
xor    %eax,%eax
call   1030 <vector_2_x@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 0, i32* %1
%6 = call i32 @__get_cpuid(i32 1, i32* %2, i32* %3, i32* %4, i32* %5)
%7 = icmp ne i32 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %0
ret i32 0
9: ; preds = %0
%10 = load i32, i32* %4
%11 = and i32 %10, 268435456
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 (...) @vector_2_x()
br label %15
15: ; preds = %13, %9
%16 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
%9 = call i32 @__get_cpuid(i32 1, i32* %1, i32* %2, i32* %3, i32* %4)
%10 = icmp eq i32 %9, 0
br i1 %10, label %11, label %12
11: ; preds = %0
ret i32 0
12: ; preds = %0
%13 = load i32, i32* %3
%14 = and i32 %13, 268435456
%15 = icmp eq i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %12
%17 = call i32 (...) @vector_2_x()
br label %18
18: ; preds = %16, %12
%19 = call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ PositionStateHandle();
int /*<<< orphan*/ UAVObjLogging(int /*<<< orphan*/);
void PositionStateLogging() { UAVObjLogging(PositionStateHandle()); }


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

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

LLVM IR (-O0):
define void @PositionStateLogging() {
%1 = call i32 (...) @PositionStateHandle()
%2 = call i32 @UAVObjLogging(i32 %1)
ret void
}

LLVM IR (-O2):
define void @PositionStateLogging() {
%1 = tail call i32 (...) @PositionStateHandle()
%2 = tail call i32 @UAVObjLogging(i32 %1)
ret void
}
/* Variables and functions */
unsigned int crc16_update(unsigned int, int /*<<< orphan*/);
unsigned int crc16(unsigned char *buf, unsigned int len) {
  unsigned int i, crc;
  for (i = 0, crc = 0; i < len; i++)
    crc = crc16_update(crc, *buf++);
  return crc;
}


x86 assembly (clang, -O0):
<crc16>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jae    1164 <crc16+0x54>
mov    -0x14(%rbp),%edi
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%esi
call   1030 <crc16_update@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    112d <crc16+0x1d>
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<crc16>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
je     1147 <crc16+0x37>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl (%r14,%rbx,1),%esi
mov    %eax,%edi
call   1030 <crc16_update@plt>
add    $0x1,%rbx
cmp    %ebx,%r15d
jne    1130 <crc16+0x20>
jmp    1149 <crc16+0x39>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @crc16(i8* nocapture %0, i32 %1) {
%3 = icmp eq i32 %1, 0
br i1 %3, label %14, label %4
4: ; preds = %2, %4
%5 = phi i32 [ %11, %4 ], [ 0, %2 ]
%6 = phi i32 [ %12, %4 ], [ 0, %2 ]
%7 = phi i8* [ %8, %4 ], [ %0, %2 ]
%8 = getelementptr inbounds i8, i8* %7, i64 1
%9 = load i8, i8* %7
%10 = zext i8 %9 to i32
%11 = tail call i32 @crc16_update(i32 %5, i32 %10)
%12 = add nuw i32 %6, 1
%13 = icmp eq i32 %12, %1
br i1 %13, label %14, label %4
14: ; preds = %4, %2
%15 = phi i32 [ 0, %2 ], [ %11, %4 ]
ret i32 %15
}
void gpio_sdhc_inactive(int module) {}


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

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

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

LLVM IR (-O2):
define void @gpio_sdhc_inactive(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ spiInit();
void SPI_Enc28j60_Init(void) { spiInit(); }


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

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

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

LLVM IR (-O2):
define void @SPI_Enc28j60_Init() {
%1 = tail call i32 (...) @spiInit()
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ SubkeyGeneration(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ WhiteningKeyGeneration(int /*<<< orphan*/ *,
                                          int /*<<< orphan*/ *);
void RunEncryptionKeySchedule(uint8_t *key, uint8_t *roundKeys) {
  WhiteningKeyGeneration(key, roundKeys);
  SubkeyGeneration(key, &roundKeys[8]);
}


x86 assembly (clang, -O0):
<RunEncryptionKeySchedule>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <WhiteningKeyGeneration@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    $0x20,%rsi
call   1030 <SubkeyGeneration@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @RunEncryptionKeySchedule(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 @WhiteningKeyGeneration(i32* %5, i32* %6)
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = getelementptr inbounds i32, i32* %9, i64 8
%11 = call i32 @SubkeyGeneration(i32* %8, i32* %10)
ret void
}

LLVM IR (-O2):
define void @RunEncryptionKeySchedule(i32* %0, i32* %1) {
%3 = tail call i32 @WhiteningKeyGeneration(i32* %0, i32* %1)
%4 = getelementptr inbounds i32, i32* %1, i64 8
%5 = tail call i32 @SubkeyGeneration(i32* %0, i32* %4)
ret void
}
int stopMotors() {
  BCLMarkFunc(__PRETTY_FUNCTION__, __FUNCTION__);
  moveWithSpeed(0, 0);
  return 0;
}


x86 assembly (clang, -O0):
<stopMotors>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
lea    0xedf(%rip),%rsi
mov    $0x0,%al
call   1040 <BCLMarkFunc@plt>
xor    %esi,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1030 <moveWithSpeed@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopMotors>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0xee2(%rip),%rsi
xor    %eax,%eax
call   1040 <BCLMarkFunc@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <moveWithSpeed@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@__PRETTY_FUNCTION__.stopMotors = [17 x i8] c"int stopMotors()\00"
@__FUNCTION__.stopMotors = [11 x i8] c"stopMotors\00"
define i32 @stopMotors() {
%1 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @BCLMarkFunc to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__PRETTY_FUNCTION__.stopMotors, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.stopMotors, i64 0, i64 0))
%2 = call i32 (i32, i32, ...) bitcast (i32 (...)* @moveWithSpeed to i32 (i32, i32, ...)*)(i32 0, i32 0)
ret i32 0
}

LLVM IR (-O2):
@__PRETTY_FUNCTION__.stopMotors = [17 x i8] c"int stopMotors()\00"
@__FUNCTION__.stopMotors = [11 x i8] c"stopMotors\00"
define i32 @stopMotors() {
%1 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @BCLMarkFunc to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @__PRETTY_FUNCTION__.stopMotors, i64 0, i64 0), i8* getelementptr inbounds ([11 x i8], [11 x i8]* @__FUNCTION__.stopMotors, i64 0, i64 0))
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @moveWithSpeed to i32 (i32, i32, ...)*)(i32 0, i32 0)
ret i32 0
}
/* Type definitions */
typedef int int16_t;

/* Variables and functions */
int /*<<< orphan*/ st_NewTrashDust(int, int, int);
void st_NewTrashDustAreaArgs(int16_t x, int16_t y, int ot) {
  st_NewTrashDust(x >> 4, y >> 4, ot);
}


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

x86 assembly (clang, -O2):
<st_NewTrashDustAreaArgs>:
sar    $0x4,%edi
sar    $0x4,%esi
jmp    1030 <st_NewTrashDust@plt>

LLVM IR (-O0):
define void @st_NewTrashDustAreaArgs(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %4
%8 = ashr i32 %7, 4
%9 = load i32, i32* %5
%10 = ashr i32 %9, 4
%11 = load i32, i32* %6
%12 = call i32 @st_NewTrashDust(i32 %8, i32 %10, i32 %11)
ret void
}

LLVM IR (-O2):
define void @st_NewTrashDustAreaArgs(i32 %0, i32 %1, i32 %2) {
%4 = ashr i32 %0, 4
%5 = ashr i32 %1, 4
%6 = tail call i32 @st_NewTrashDust(i32 %4, i32 %5, i32 %2)
ret void
}