xunge/DecIR huggingface dataset:
int test_imm_A9int64_lowword_mem(long long *val) {
  return ((*val) & (0xA9 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_A9int64_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, 169
%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_A9int64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 169
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
scalar_t__ EOF;
int EXIT_FAILURE;
scalar_t__ puts(char *);
int main(void) {
  if (puts("Hello, world!") == EOF)
    return EXIT_FAILURE;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
call   1030 <puts@plt>
mov    0x2eb6(%rip),%rcx
cmp    (%rcx),%rax
jne    1147 <main+0x37>
mov    0x2e96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
call   1030 <puts@plt>
mov    %rax,%rcx
mov    0x2ec1(%rip),%rdx
xor    %eax,%eax
cmp    (%rdx),%rcx
jne    1137 <main+0x27>
mov    0x2ea3(%rip),%rax
mov    (%rax),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"Hello, world!\00"
@EOF = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i64 @puts(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i64, i64* @EOF
%4 = icmp eq i64 %2, %3
br i1 %4, label %5, label %7
5: ; preds = %0
%6 = load i32, i32* @EXIT_FAILURE
store i32 %6, i32* %1
br label %7
7: ; preds = %5, %0
%8 = load i32, i32* %1
ret i32 %8
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello, world!\00"
@EOF = global i64 0
@EXIT_FAILURE = global i32 0
define i32 @main() {
%1 = tail call i64 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = load i64, i64* @EOF
%3 = icmp eq i64 %1, %2
%4 = load i32, i32* @EXIT_FAILURE
%5 = select i1 %3, i32 %4, i32 0
ret i32 %5
}
const char *Rz_zlibVersion() { return "1.2.8"; }


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

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

LLVM IR (-O0):
@.str = [6 x i8] c"1.2.8\00"
define i8* @Rz_zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [6 x i8] c"1.2.8\00"
define i8* @Rz_zlibVersion() {
ret i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0)
}
int test_imm_97uint8_reg(unsigned char val) {
  return ((val) & (-0x97 << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_97uint8_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%edx
and    $0xffffff69,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test_imm_97uint8_reg(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, -151
%6 = icmp ne i32 %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_97uint8_reg(i8 zeroext %0) {
%2 = and i8 %0, 105
%3 = icmp eq i8 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
double mixed_add(int a, float b) { return a + b; }


x86 assembly (clang, -O0):
<mixed_add>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
addss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<mixed_add>:
cvtsi2ss %edi,%xmm1
addss  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtss2sd %xmm1,%xmm0
ret

LLVM IR (-O0):
define double @mixed_add(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = load float, float* %4
%8 = fadd float %6, %7
%9 = fpext float %8 to double
ret double %9
}

LLVM IR (-O2):
define double @mixed_add(i32 %0, float %1) {
%3 = sitofp i32 %0 to float
%4 = fadd float %3, %1
%5 = fpext float %4 to double
ret double %5
}
void read_cb(struct bufferevent *incoming, void *arg) {}


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

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

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

LLVM IR (-O2):
%struct.bufferevent = type opaque
define void @read_cb(%struct.bufferevent* nocapture %0, i8* nocapture %1) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ ofl_flow_removed_reason_print(int /*<<< orphan*/ *,
                                                 int /*<<< orphan*/);
int /*<<< orphan*/ *open_memstream(char **, size_t *);
char *ofl_flow_removed_reason_to_string(uint8_t reason) {
  char *str;
  size_t str_size;
  FILE *stream = open_memstream(&str, &str_size);
  ofl_flow_removed_reason_print(stream, reason);
  fclose(stream);
  return str;
}


x86 assembly (clang, -O0):
<ofl_flow_removed_reason_to_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x10(%rbp),%rdi
lea    -0x18(%rbp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x4(%rbp),%esi
call   1050 <ofl_flow_removed_reason_print@plt>
mov    -0x20(%rbp),%rdi
call   1040 <fclose@plt>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ofl_flow_removed_reason_to_string>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %edi,%ebp
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <open_memstream@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %ebp,%esi
call   1050 <ofl_flow_removed_reason_print@plt>
mov    %rbx,%rdi
call   1040 <fclose@plt>
mov    0x8(%rsp),%rax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i8* @ofl_flow_removed_reason_to_string(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i32*
store i32 %0, i32* %2
%6 = call i32* @open_memstream(i8** %3, i64* %4)
store i32* %6, i32** %5
%7 = load i32*, i32** %5
%8 = load i32, i32* %2
%9 = call i32 @ofl_flow_removed_reason_print(i32* %7, i32 %8)
%10 = load i32*, i32** %5
%11 = call i32 @fclose(i32* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @ofl_flow_removed_reason_to_string(i32 %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = bitcast i8** %2 to i8*
%5 = bitcast i64* %3 to i8*
%6 = call i32* @open_memstream(i8** %2, i64* %3)
%7 = call i32 @ofl_flow_removed_reason_print(i32* %6, i32 %0)
%8 = call i32 @fclose(i32* %6)
%9 = load i8*, i8** %2
ret i8* %9
}
unsigned long rolx(unsigned long word, unsigned int shift, unsigned int x) {
  return (word << shift) | (word >> (x - shift));
}


x86 assembly (clang, -O0):
<rolx>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
shl    %cl,%rax
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%ecx
sub    -0xc(%rbp),%ecx
mov    %ecx,%ecx
shr    %cl,%rdx
mov    %rdx,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rolx>:
mov    %esi,%ecx
mov    %rdi,%rax
shl    %cl,%rax
sub    %esi,%edx
mov    %edx,%ecx
shr    %cl,%rdi
or     %rdi,%rax
ret

LLVM IR (-O0):
define i64 @rolx(i64 %0, i32 %1, i32 %2) {
%4 = alloca i64
%5 = alloca i32
%6 = alloca i32
store i64 %0, i64* %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i64, i64* %4
%8 = load i32, i32* %5
%9 = zext i32 %8 to i64
%10 = shl i64 %7, %9
%11 = load i64, i64* %4
%12 = load i32, i32* %6
%13 = load i32, i32* %5
%14 = sub i32 %12, %13
%15 = zext i32 %14 to i64
%16 = lshr i64 %11, %15
%17 = or i64 %10, %16
ret i64 %17
}

LLVM IR (-O2):
define i64 @rolx(i64 %0, i32 %1, i32 %2) {
%4 = zext i32 %1 to i64
%5 = shl i64 %0, %4
%6 = sub i32 %2, %1
%7 = zext i32 %6 to i64
%8 = lshr i64 %0, %7
%9 = or i64 %8, %5
ret i64 %9
}
void barrier(void) { __asm__ __volatile__("" ::: "memory"); }


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

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

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

LLVM IR (-O2):
define void @barrier() {
tail call void asm sideeffect "", "~{memory},~{dirflag},~{fpsr},~{flags}"()
ret void
}
void f(int x, ...) {}


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

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

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

LLVM IR (-O2):
define void @f(i32 %0, ...) {
ret void
}
/* Variables and functions */
long strtol(char const *, char **, int);
long str_const_to_l(char const *str, char const **ppz, int base) {
  return strtol(str, (char **)ppz, base);
}


x86 assembly (clang, -O0):
<str_const_to_l>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
call   1030 <strtol@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_const_to_l>:
jmp    1030 <strtol@plt>

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

LLVM IR (-O2):
define i64 @str_const_to_l(i8* %0, i8** nocapture %1, i32 %2) {
%4 = tail call i64 @strtol(i8* %0, i8** %1, i32 %2)
ret i64 %4
}
float hit503x(int adc, float T) {
  return ((((float)adc) / 1023 - 0.1515) / 0.00636) / (1.0546 - 0.00216 * T);
}


x86 assembly (clang, -O0):
<hit503x>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
cvtsi2ssl -0x4(%rbp),%xmm0
movss  0xf07(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeef(%rip),%xmm1
subsd  %xmm1,%xmm0
movsd  0xedb(%rip),%xmm1
divsd  %xmm1,%xmm0
movss  -0x8(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0xeb6(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0xeb2(%rip),%xmm2
addsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hit503x>:
cvtsi2ss %edi,%xmm1
divss  0xef4(%rip),%xmm1
cvtss2sd %xmm1,%xmm1
addsd  0xef0(%rip),%xmm1
divsd  0xef0(%rip),%xmm1
cvtss2sd %xmm0,%xmm0
mulsd  0xeec(%rip),%xmm0
addsd  0xeec(%rip),%xmm0
divsd  %xmm0,%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @hit503x(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%5 = load i32, i32* %3
%6 = sitofp i32 %5 to float
%7 = fdiv float %6, 1.023000e+03
%8 = fpext float %7 to double
%9 = fsub double %8, 1.515000e-01
%10 = fdiv double %9, 6.360000e-03
%11 = load float, float* %4
%12 = fpext float %11 to double
%13 = call double @llvm.fmuladd.f64(double -2.160000e-03, double %12, double 1.054600e+00)
%14 = fdiv double %10, %13
%15 = fptrunc double %14 to float
ret float %15
}

LLVM IR (-O2):
define float @hit503x(i32 %0, float %1) {
%3 = sitofp i32 %0 to float
%4 = fdiv float %3, 1.023000e+03
%5 = fpext float %4 to double
%6 = fadd double %5, -1.515000e-01
%7 = fdiv double %6, 6.360000e-03
%8 = fpext float %1 to double
%9 = tail call double @llvm.fmuladd.f64(double %8, double -2.160000e-03, double 1.054600e+00)
%10 = fdiv double %7, %9
%11 = fptrunc double %10 to float
ret float %11
}
int POW(int iDepth) {
  int i = 0, iAnswer = 1;
  for (i = 0; i < iDepth; i++) {
    iAnswer *= 2;
  }
  return iAnswer;
}


x86 assembly (clang, -O0):
<POW>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    113f <POW+0x3f>
mov    -0xc(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    111c <POW+0x1c>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<POW>:
test   %edi,%edi
jle    1118 <POW+0x18>
lea    -0x1(%rdi),%eax
mov    %edi,%ecx
and    $0x7,%ecx
cmp    $0x7,%eax
jae    111e <POW+0x1e>
mov    $0x1,%eax
jmp    1138 <POW+0x38>
mov    $0x1,%eax
ret
and    $0xfffffff8,%edi
mov    $0x1,%eax
cs nopw 0x0(%rax,%rax,1)
shl    $0x8,%eax
add    $0xfffffff8,%edi
jne    1130 <POW+0x30>
test   %ecx,%ecx
je     1147 <POW+0x47>
nopl   0x0(%rax)
add    %eax,%eax
add    $0xffffffff,%ecx
jne    1140 <POW+0x40>
ret

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

LLVM IR (-O2):
define i32 @POW(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %25
3: ; preds = %1
%4 = add i32 %0, -1
%5 = and i32 %0, 7
%6 = icmp ult i32 %4, 7
br i1 %6, label %15, label %7
7: ; preds = %3
%8 = and i32 %0, -8
br label %9
9: ; preds = %9, %7
%10 = phi i32 [ 1, %7 ], [ %12, %9 ]
%11 = phi i32 [ 0, %7 ], [ %13, %9 ]
%12 = shl i32 %10, 8
%13 = add i32 %11, 8
%14 = icmp eq i32 %13, %8
br i1 %14, label %15, label %9
15: ; preds = %9, %3
%16 = phi i32 [ undef, %3 ], [ %12, %9 ]
%17 = phi i32 [ 1, %3 ], [ %12, %9 ]
%18 = icmp eq i32 %5, 0
br i1 %18, label %25, label %19
19: ; preds = %15, %19
%20 = phi i32 [ %22, %19 ], [ %17, %15 ]
%21 = phi i32 [ %23, %19 ], [ 0, %15 ]
%22 = shl nsw i32 %20, 1
%23 = add i32 %21, 1
%24 = icmp eq i32 %23, %5
br i1 %24, label %25, label %19
25: ; preds = %15, %19, %1
%26 = phi i32 [ 1, %1 ], [ %16, %15 ], [ %22, %19 ]
ret i32 %26
}
/* Type definitions */
struct dirent {
  char *d_name;
};

/* Variables and functions */
int select_nodots(const struct dirent *d) {
  if (d->d_name[0] != '.') {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<select_nodots>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%eax
cmp    $0x2e,%eax
je     1127 <select_nodots+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <select_nodots+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<select_nodots>:
mov    (%rdi),%rcx
xor    %eax,%eax
cmpb   $0x2e,(%rcx)
setne  %al
ret

LLVM IR (-O0):
%struct.dirent = type { i8* }
define i32 @select_nodots(%struct.dirent* %0) {
%2 = alloca i32
%3 = alloca %struct.dirent*
store %struct.dirent* %0, %struct.dirent** %3
%4 = load %struct.dirent*, %struct.dirent** %3
%5 = getelementptr inbounds %struct.dirent, %struct.dirent* %4, i32 0, i32 0
%6 = load i8*, i8** %5
%7 = getelementptr inbounds i8, i8* %6, i64 0
%8 = load i8, i8* %7
%9 = sext i8 %8 to i32
%10 = icmp ne i32 %9, 46
br i1 %10, label %11, label %12
11: ; preds = %1
store i32 1, i32* %2
br label %13
12: ; preds = %1
store i32 0, i32* %2
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %2
ret i32 %14
}

LLVM IR (-O2):
%struct.dirent = type { i8* }
define i32 @select_nodots(%struct.dirent* nocapture %0) {
%2 = getelementptr inbounds %struct.dirent, %struct.dirent* %0, i64 0, i32 0
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = icmp ne i8 %4, 46
%6 = zext i1 %5 to i32
ret i32 %6
}
unsigned xrop3_169_1_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  stk2 = T | S;
  stk1 = D ^ stk2;
  stk1 = ~stk1;
  return (stk1 & (~S)) | (D & S);
}


x86 assembly (clang, -O0):
<xrop3_169_1_0>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
xor    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    -0xc(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%ecx
and    -0xc(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_169_1_0>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %eax,%ecx
xor    $0xffffff00,%ecx
not    %eax
and    %ecx,%eax
or     %edi,%eax
ret

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

LLVM IR (-O2):
define i32 @xrop3_169_1_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -256
%9 = xor i32 %4, -1
%10 = and i32 %8, %9
%11 = or i32 %10, %3
ret i32 %11
}
int get_num_bytes(int num_bases) {
  int num_bytes = num_bases / 4;
  if (num_bases % 4 > 0) {
    num_bytes++;
  }
  return num_bytes;
}


x86 assembly (clang, -O0):
<get_num_bytes>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jle    1132 <get_num_bytes+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_num_bytes>:
lea    0x3(%rdi),%ecx
test   %edi,%edi
cmovns %edi,%ecx
sar    $0x2,%ecx
xor    %eax,%eax
test   $0x80000003,%edi
setg   %al
add    %ecx,%eax
ret

LLVM IR (-O0):
define i32 @get_num_bytes(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sdiv i32 %4, 4
store i32 %5, i32* %3
%6 = load i32, i32* %2
%7 = srem i32 %6, 4
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %12
12: ; preds = %9, %1
%13 = load i32, i32* %3
ret i32 %13
}

LLVM IR (-O2):
define i32 @get_num_bytes(i32 %0) {
%2 = sdiv i32 %0, 4
%3 = and i32 %0, -2147483645
%4 = icmp sgt i32 %3, 0
%5 = zext i1 %4 to i32
%6 = add nsw i32 %2, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ SEEK_END;
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int /*<<< orphan*/,
                         int /*<<< orphan*/);
long ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ rewind(int /*<<< orphan*/ *);
long int fsize(FILE *fp) {
  fseek(fp, 0, SEEK_END);
  long int size = ftell(fp);
  rewind(fp);
  return size;
}


x86 assembly (clang, -O0):
<fsize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ea1(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    -0x8(%rbp),%rdi
call   1040 <ftell@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <rewind@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsize>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    0x2eaa(%rip),%rax
mov    (%rax),%edx
xor    %esi,%esi
call   1050 <fseek@plt>
mov    %rbx,%rdi
call   1040 <ftell@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <rewind@plt>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SEEK_END = global i32 0
define i64 @fsize(i32* %0) {
%2 = alloca i32*
%3 = alloca i64
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* @SEEK_END
%6 = call i32 @fseek(i32* %4, i32 0, i32 %5)
%7 = load i32*, i32** %2
%8 = call i64 @ftell(i32* %7)
store i64 %8, i64* %3
%9 = load i32*, i32** %2
%10 = call i32 @rewind(i32* %9)
%11 = load i64, i64* %3
ret i64 %11
}

LLVM IR (-O2):
@SEEK_END = global i32 0
define i64 @fsize(i32* nocapture %0) {
%2 = load i32, i32* @SEEK_END
%3 = tail call i32 @fseek(i32* %0, i32 0, i32 %2)
%4 = tail call i64 @ftell(i32* %0)
%5 = tail call i32 @rewind(i32* %0)
ret i64 %4
}
void reverse(char *a, int len) {
  int i = 0;
  char tmp;
  len--;
  while (i < len) {
    tmp = a[i];
    a[i] = a[len];
    a[len] = tmp;
    i++;
    len--;
  }
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1170 <reverse+0x70>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x11(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x11(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    -0xc(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    111b <reverse+0x1b>
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
cmp    $0x2,%esi
jl     1131 <reverse+0x31>
mov    %esi,%eax
add    $0xfffffffffffffffe,%rax
xor    %ecx,%ecx
nopl   (%rax)
movzbl (%rdi,%rcx,1),%esi
movzbl 0x1(%rdi,%rax,1),%edx
mov    %dl,(%rdi,%rcx,1)
mov    %sil,0x1(%rdi,%rax,1)
add    $0x1,%rcx
lea    -0x1(%rax),%rdx
cmp    %rax,%rcx
mov    %rdx,%rax
jl     1110 <reverse+0x10>
ret

LLVM IR (-O0):
define void @reverse(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%7 = load i32, i32* %4
%8 = add nsw i32 %7, -1
store i32 %8, i32* %4
br label %9
9: ; preds = %13, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %37
13: ; preds = %9
%14 = load i8*, i8** %3
%15 = load i32, i32* %5
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds i8, i8* %14, i64 %16
%18 = load i8, i8* %17
store i8 %18, i8* %6
%19 = load i8*, i8** %3
%20 = load i32, i32* %4
%21 = sext i32 %20 to i64
%22 = getelementptr inbounds i8, i8* %19, i64 %21
%23 = load i8, i8* %22
%24 = load i8*, i8** %3
%25 = load i32, i32* %5
%26 = sext i32 %25 to i64
%27 = getelementptr inbounds i8, i8* %24, i64 %26
store i8 %23, i8* %27
%28 = load i8, i8* %6
%29 = load i8*, i8** %3
%30 = load i32, i32* %4
%31 = sext i32 %30 to i64
%32 = getelementptr inbounds i8, i8* %29, i64 %31
store i8 %28, i8* %32
%33 = load i32, i32* %5
%34 = add nsw i32 %33, 1
store i32 %34, i32* %5
%35 = load i32, i32* %4
%36 = add nsw i32 %35, -1
store i32 %36, i32* %4
br label %9
37: ; preds = %9
ret void
}

LLVM IR (-O2):
define void @reverse(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 1
br i1 %3, label %4, label %17
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i64 %5, -1
br label %7
7: ; preds = %4, %7
%8 = phi i64 [ 0, %4 ], [ %14, %7 ]
%9 = phi i64 [ %6, %4 ], [ %15, %7 ]
%10 = getelementptr inbounds i8, i8* %0, i64 %8
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 %9
%13 = load i8, i8* %12
store i8 %13, i8* %10
store i8 %11, i8* %12
%14 = add nuw nsw i64 %8, 1
%15 = add nsw i64 %9, -1
%16 = icmp slt i64 %14, %15
br i1 %16, label %7, label %17
17: ; preds = %7, %2
ret void
}
/* Type definitions */
struct suffix_mult {
  int dummy;
};

/* Variables and functions */
int xatoll_range_sfx(char const *, int, int, struct suffix_mult const *);
int xatoi_range_sfx(const char *str, int l, int u,
                    const struct suffix_mult *sfx) {
  return xatoll_range_sfx(str, l, u, sfx);
}


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

x86 assembly (clang, -O2):
<xatoi_range_sfx>:
jmp    1030 <xatoll_range_sfx@plt>

LLVM IR (-O0):
%struct.suffix_mult = type { i32 }
define i32 @xatoi_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3) {
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.suffix_mult*
store i8* %0, i8** %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store %struct.suffix_mult* %3, %struct.suffix_mult** %8
%9 = load i8*, i8** %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = load %struct.suffix_mult*, %struct.suffix_mult** %8
%13 = call i32 @xatoll_range_sfx(i8* %9, i32 %10, i32 %11, %struct.suffix_mult* %12)
ret i32 %13
}

LLVM IR (-O2):
%struct.suffix_mult = type { i32 }
define i32 @xatoi_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3) {
%5 = tail call i32 @xatoll_range_sfx(i8* %0, i32 %1, i32 %2, %struct.suffix_mult* %3)
ret i32 %5
}
double test2(double x) { return __builtin_pow(x, 4. / 3.); }


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xed6(%rip),%xmm1
call   1030 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test2>:
movsd  0xee8(%rip),%xmm1
jmp    1030 <pow@plt>

LLVM IR (-O0):
define double @test2(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call double @pow(double %3, double 0x3FF5555555555555)
ret double %4
}

LLVM IR (-O2):
define double @test2(double %0) {
%2 = tail call double @pow(double %0, double 0x3FF5555555555555)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ gmove_G2L_1a4t_bc();
int /*<<< orphan*/ gmove_G2L_4a4t_bc();
int main() {
  gmove_G2L_1a4t_bc();
  gmove_G2L_4a4t_bc();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @gmove_G2L_1a4t_bc()
%2 = tail call i32 (...) @gmove_G2L_4a4t_bc()
ret i32 0
}
float fsub32(float x, float y) { return x - y; }


x86 assembly (clang, -O0):
<fsub32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
subss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<fsub32>:
subss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @fsub32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
store float %0, float* %3
store float %1, float* %4
%5 = load float, float* %3
%6 = load float, float* %4
%7 = fsub float %5, %6
ret float %7
}

LLVM IR (-O2):
define float @fsub32(float %0, float %1) {
%3 = fsub float %0, %1
ret float %3
}
/* Variables and functions */
int getline(char *, int);
int /*<<< orphan*/ printf(char *, char *);
main() {
  int len;
  char line[1000];
  while ((len = getline(line, 1000)) > 0)
    if (len > 81)
      printf("%s", line);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x3f0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x3f0(%rbp),%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jle    1171 <main+0x51>
cmpl   $0x51,-0x8(%rbp)
jle    116c <main+0x4c>
lea    -0x3f0(%rbp),%rsi
lea    0xe99(%rip),%rdi
call   1030 <printf@plt>
jmp    1132 <main+0x12>
xor    %eax,%eax
add    $0x3f0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x3e8,%rsp
mov    %rsp,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
lea    0xebe(%rip),%r14
mov    %rsp,%rbx
jmp    1161 <main+0x41>
nopw   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1040 <getline@plt>
test   %eax,%eax
jle    1173 <main+0x53>
cmp    $0x52,%eax
jb     1150 <main+0x30>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
jmp    1150 <main+0x30>
xor    %eax,%eax
add    $0x3e8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define i32 @main() {
%1 = alloca [1000 x i8]
%2 = getelementptr inbounds [1000 x i8], [1000 x i8]* %1, i64 0, i64 0
%3 = call i32 @getline(i8* %2, i32 1000)
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %13
5: ; preds = %0, %10
%6 = phi i32 [ %11, %10 ], [ %3, %0 ]
%7 = icmp ugt i32 %6, 81
br i1 %7, label %8, label %10
8: ; preds = %5
%9 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %10
10: ; preds = %8, %5
%11 = call i32 @getline(i8* %2, i32 1000)
%12 = icmp sgt i32 %11, 0
br i1 %12, label %5, label %13
13: ; preds = %10, %0
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
unsigned short ehrpwm_read(int /*<<< orphan*/, int);
int ehrpwm_tb_read_counter(uint8_t module, unsigned short *val) {
  *val = ehrpwm_read(module, 0x8);
  return 0;
}


x86 assembly (clang, -O0):
<ehrpwm_tb_read_counter>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x8,%esi
call   1030 <ehrpwm_read@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%rax
mov    %cx,(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehrpwm_tb_read_counter>:
push   %rbx
mov    %rsi,%rbx
mov    $0x8,%esi
call   1030 <ehrpwm_read@plt>
mov    %ax,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @ehrpwm_tb_read_counter(i32 %0, i16* nocapture writeonly %1) {
%3 = tail call zeroext i16 @ehrpwm_read(i32 %0, i32 8)
store i16 %3, i16* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(void) {
  printf("MBEDTLS_ENTROPY_C and/or "
         "MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or "
         "MBEDTLS_NET_C and/or MBEDTLS_CTR_DRBG_C and/or not defined.\n");
  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>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [136 x i8] c"MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or MBEDTLS_NET_C and/or MBEDTLS_CTR_DRBG_C and/or not defined.\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([136 x i8], [136 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [135 x i8] c"MBEDTLS_ENTROPY_C and/or MBEDTLS_SSL_TLS_C and/or MBEDTLS_SSL_CLI_C and/or MBEDTLS_NET_C and/or MBEDTLS_CTR_DRBG_C and/or not defined.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([135 x i8], [135 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ test_deque_add_at_case1();
int /*<<< orphan*/ test_deque_add_at_case2();
int /*<<< orphan*/ test_deque_add_at_case3();
int /*<<< orphan*/ test_deque_add_at_case4();
int /*<<< orphan*/ test_deque_add_at_case5();
void test_deque_add_at() {
  test_deque_add_at_case1();
  test_deque_add_at_case2();
  test_deque_add_at_case3();
  test_deque_add_at_case4();
  test_deque_add_at_case5();
}


x86 assembly (clang, -O0):
<test_deque_add_at>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_deque_add_at_case1@plt>
mov    $0x0,%al
call   1060 <test_deque_add_at_case2@plt>
mov    $0x0,%al
call   1030 <test_deque_add_at_case3@plt>
mov    $0x0,%al
call   1070 <test_deque_add_at_case4@plt>
mov    $0x0,%al
call   1050 <test_deque_add_at_case5@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_deque_add_at>:
push   %rax
xor    %eax,%eax
call   1040 <test_deque_add_at_case1@plt>
xor    %eax,%eax
call   1060 <test_deque_add_at_case2@plt>
xor    %eax,%eax
call   1030 <test_deque_add_at_case3@plt>
xor    %eax,%eax
call   1070 <test_deque_add_at_case4@plt>
xor    %eax,%eax
pop    %rcx
jmp    1050 <test_deque_add_at_case5@plt>

LLVM IR (-O0):
define void @test_deque_add_at() {
%1 = call i32 (...) @test_deque_add_at_case1()
%2 = call i32 (...) @test_deque_add_at_case2()
%3 = call i32 (...) @test_deque_add_at_case3()
%4 = call i32 (...) @test_deque_add_at_case4()
%5 = call i32 (...) @test_deque_add_at_case5()
ret void
}

LLVM IR (-O2):
define void @test_deque_add_at() {
%1 = tail call i32 (...) @test_deque_add_at_case1()
%2 = tail call i32 (...) @test_deque_add_at_case2()
%3 = tail call i32 (...) @test_deque_add_at_case3()
%4 = tail call i32 (...) @test_deque_add_at_case4()
%5 = tail call i32 (...) @test_deque_add_at_case5()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ strlen(char *);
int /*<<< orphan*/ write(int, char *, int /*<<< orphan*/);
void usage() {
  write(
      2,
      "Usage: waitmax [-s SIGNUM] MAXTIME PROGRAM [ARGS...]\n"
      "\n"
      "Execute PROGRAM as a subprocess. If PROGRAM does not exit before "
      "MAXTIME\n"
      "seconds, it will be killed with SIGTERM or an alternative signal.\n"
      "\n"
      "   -s kill with SIGNUM on timeout\n"
      "   -h this help\n"
      "   -V show version an exit\n\n",
      strlen(
          "Usage: waitmax [-s SIGNUM] MAXTIME PROGRAM [ARGS...]\n"
          "\n"
          "Execute PROGRAM as a subprocess. If PROGRAM does not exit before "
          "MAXTIME\n"
          "seconds, it will be killed with SIGTERM or an alternative signal.\n"
          "\n"
          "   -s kill with SIGNUM on timeout\n"
          "   -h this help\n"
          "   -V show version an exit\n\n"));
  ;
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
lea    0xec5(%rip),%rdi
call   1040 <strlen@plt>
mov    %eax,%edx
mov    $0x2,%edi
lea    0xeb2(%rip),%rsi
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rbx
lea    0xec8(%rip),%rbx
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x2,%edi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <write@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [273 x i8] c"Usage: waitmax [-s SIGNUM] MAXTIME PROGRAM [ARGS...]\0A\0AExecute PROGRAM as a subprocess. If PROGRAM does not exit before MAXTIME\0Aseconds, it will be killed with SIGTERM or an alternative signal.\0A\0A -s kill with SIGNUM on timeout\0A -h this help\0A -V show version an exit\0A\0A\00"
define void @usage() {
%1 = call i32 @strlen(i8* getelementptr inbounds ([273 x i8], [273 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @write(i32 2, i8* getelementptr inbounds ([273 x i8], [273 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [273 x i8] c"Usage: waitmax [-s SIGNUM] MAXTIME PROGRAM [ARGS...]\0A\0AExecute PROGRAM as a subprocess. If PROGRAM does not exit before MAXTIME\0Aseconds, it will be killed with SIGTERM or an alternative signal.\0A\0A -s kill with SIGNUM on timeout\0A -h this help\0A -V show version an exit\0A\0A\00"
define void @usage() {
%1 = tail call i32 @strlen(i8* getelementptr inbounds ([273 x i8], [273 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @write(i32 2, i8* getelementptr inbounds ([273 x i8], [273 x i8]* @.str, i64 0, i64 0), i32 %1)
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int sjhashNoCase(char const *, int);
int strHash(const void *pKey, int nKey) {
  return sjhashNoCase((const char *)pKey, nKey);
}


x86 assembly (clang, -O0):
<strHash>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1030 <sjhashNoCase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strHash>:
jmp    1030 <sjhashNoCase@plt>

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

LLVM IR (-O2):
define i32 @strHash(i8* %0, i32 %1) {
%3 = tail call i32 @sjhashNoCase(i8* %0, i32 %1)
ret i32 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fwrite(unsigned char *, int, int, int /*<<< orphan*/ *);
void putbyte(FILE *outf, unsigned char val) {
  unsigned char buf[1];
  buf[0] = val;
  fwrite(buf, 1, 1, outf);
}


x86 assembly (clang, -O0):
<putbyte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    %al,-0xa(%rbp)
lea    -0xa(%rbp),%rdi
mov    -0x8(%rbp),%rcx
mov    $0x1,%edx
mov    %edx,%esi
call   1030 <fwrite@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putbyte>:
mov    %rdi,%rax
movsbl %sil,%edi
mov    %rax,%rsi
jmp    1030 <fputc@plt>

LLVM IR (-O0):
define void @putbyte(i32* %0, i8 zeroext %1) {
%3 = alloca i32*
%4 = alloca i8
%5 = alloca [1 x i8]
store i32* %0, i32** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
store i8 %6, i8* %7
%8 = getelementptr inbounds [1 x i8], [1 x i8]* %5, i64 0, i64 0
%9 = load i32*, i32** %3
%10 = call i32 @fwrite(i8* %8, i32 1, i32 1, i32* %9)
ret void
}

LLVM IR (-O2):
define void @putbyte(i32* nocapture %0, i8 zeroext %1) {
%3 = sext i8 %1 to i32
%4 = tail call i32 @fputc(i32 %3, i32* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  int t[2];
  t[0] = 1;
  t[1] = 0;
  printf("%d", t[t[t[t[t[0]]]]]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x8(%rbp)
movslq -0xc(%rbp),%rax
movslq -0xc(%rbp,%rax,4),%rax
movslq -0xc(%rbp,%rax,4),%rax
movslq -0xc(%rbp,%rax,4),%rax
mov    -0xc(%rbp,%rax,4),%esi
lea    0xeb5(%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
mov    $0x1,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1)
ret i32 0
}
/* Type definitions */
struct timespec {
  int dummy;
};
typedef int /*<<< orphan*/ clockid_t;

/* Variables and functions */
int /*<<< orphan*/ SYS_clock_gettime;
int syscall(int /*<<< orphan*/, int /*<<< orphan*/, struct timespec *);
int clock_gettime(clockid_t clk_id, struct timespec *tp) {
  return syscall(SYS_clock_gettime, clk_id, tp);
}


x86 assembly (clang, -O0):
<clock_gettime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eca(%rip),%rax
mov    (%rax),%edi
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
call   1030 <syscall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clock_gettime>:
mov    %rsi,%rdx
mov    %edi,%esi
mov    0x2ed4(%rip),%rax
mov    (%rax),%edi
jmp    1030 <syscall@plt>

LLVM IR (-O0):
%struct.timespec = type { i32 }
@SYS_clock_gettime = global i32 0
define i32 @clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = alloca i32
%4 = alloca %struct.timespec*
store i32 %0, i32* %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load i32, i32* @SYS_clock_gettime
%6 = load i32, i32* %3
%7 = load %struct.timespec*, %struct.timespec** %4
%8 = call i32 @syscall(i32 %5, i32 %6, %struct.timespec* %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.timespec = type { i32 }
@SYS_clock_gettime = global i32 0
define i32 @clock_gettime(i32 %0, %struct.timespec* %1) {
%3 = load i32, i32* @SYS_clock_gettime
%4 = tail call i32 @syscall(i32 %3, i32 %0, %struct.timespec* %1)
ret i32 %4
}
void setval(vp, val) struct var *vp;
char *val;
{ nameval(vp, val, (char *)0); }


x86 assembly (clang, -O0):
<setval>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   1030 <nameval@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<setval>:
xor    %edx,%edx
xor    %eax,%eax
jmp    1030 <nameval@plt>

LLVM IR (-O0):
%struct.var = type opaque
define void @setval(%struct.var* %0, i8* %1) {
%3 = alloca %struct.var*
%4 = alloca i8*
store %struct.var* %0, %struct.var** %3
store i8* %1, i8** %4
%5 = load %struct.var*, %struct.var** %3
%6 = load i8*, i8** %4
%7 = call i32 (%struct.var*, i8*, i8*, ...) bitcast (i32 (...)* @nameval to i32 (%struct.var*, i8*, i8*, ...)*)(%struct.var* %5, i8* %6, i8* null)
ret void
}

LLVM IR (-O2):
%struct.var = type opaque
define void @setval(%struct.var* %0, i8* %1) {
%3 = tail call i32 (%struct.var*, i8*, i8*, ...) bitcast (i32 (...)* @nameval to i32 (%struct.var*, i8*, i8*, ...)*)(%struct.var* %0, i8* %1, i8* null)
ret void
}
void atomic_swap_int(volatile int *dst, int val, int *res) {
  __asm __volatile("xchgl %2, %1; movl %2, %0"
                   : "=m"(*res)
                   : "m"(*dst), "r"(val)
                   : "memory");
}


x86 assembly (clang, -O0):
<atomic_swap_int>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    -0xc(%rbp),%edx
xchg   %edx,(%rcx)
mov    %edx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<atomic_swap_int>:
xchg   %esi,(%rdi)
mov    %esi,(%rdx)
ret

LLVM IR (-O0):
define void @atomic_swap_int(i32* %0, i32 %1, i32* %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32*
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32* %2, i32** %6
%7 = load i32*, i32** %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
ret void
}

LLVM IR (-O2):
define void @atomic_swap_int(i32* %0, i32 %1, i32* %2) {
tail call void asm sideeffect "xchgl $2, $1; movl $2, $0", "=*m,*m,r,~{memory},~{dirflag},~{fpsr},~{flags}"(i32* elementtype(i32) %2, i32* elementtype(i32) %0, i32 %1)
ret void
}
void jump_label_unlock(void) {}


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

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

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

LLVM IR (-O2):
define void @jump_label_unlock() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ native_restore_fl(unsigned long);
void arch_local_irq_restore(unsigned long flags) { native_restore_fl(flags); }


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

x86 assembly (clang, -O2):
<arch_local_irq_restore>:
jmp    1030 <native_restore_fl@plt>

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

LLVM IR (-O2):
define void @arch_local_irq_restore(i64 %0) {
%2 = tail call i32 @native_restore_fl(i64 %0)
ret void
}