xunge/DecIR huggingface dataset:
signed int f3(signed int v_a, signed int v_b) {
  signed int v_anda = v_a & -16;
  signed int v_shr = ((unsigned int)v_b) >> 8;
  signed int v_andb = v_shr & 15;
  signed int v_or = v_anda | v_andb;
  return v_or;
}


x86 assembly (clang, -O0):
<f3>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xfffffff0,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
shr    $0x8,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0x14(%rbp)
mov    -0xc(%rbp),%eax
or     -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<f3>:
and    $0xfffffff0,%edi
shr    $0x8,%esi
and    $0xf,%esi
lea    (%rsi,%rdi,1),%eax
ret

LLVM IR (-O0):
define i32 @f3(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%9 = load i32, i32* %3
%10 = and i32 %9, -16
store i32 %10, i32* %5
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
store i32 %12, i32* %6
%13 = load i32, i32* %6
%14 = and i32 %13, 15
store i32 %14, i32* %7
%15 = load i32, i32* %5
%16 = load i32, i32* %7
%17 = or i32 %15, %16
store i32 %17, i32* %8
%18 = load i32, i32* %8
ret i32 %18
}

LLVM IR (-O2):
define i32 @f3(i32 %0, i32 %1) {
%3 = and i32 %0, -16
%4 = lshr i32 %1, 8
%5 = and i32 %4, 15
%6 = or i32 %5, %3
ret i32 %6
}
decref(at) {
  register t;
  t = at;
  if ((t & ~07) == 0) {
    error("Illegal indirection");
    return (t);
  }
  return ((t >> 2) & ~07 | t & 07);
}


x86 assembly (clang, -O0):
<decref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0xfffffff8,%eax
cmp    $0x0,%eax
jne    1149 <decref+0x39>
lea    0xec9(%rip),%rdi
mov    $0x0,%al
call   1030 <error@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    115d <decref+0x4d>
mov    -0xc(%rbp),%eax
sar    $0x2,%eax
and    $0xfffffff8,%eax
mov    -0xc(%rbp),%ecx
and    $0x7,%ecx
or     %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decref>:
push   %rbx
mov    %edi,%ebx
cmp    $0x7,%edi
ja     1128 <decref+0x18>
lea    0xee1(%rip),%rdi
xor    %eax,%eax
call   1030 <error@plt>
jmp    1135 <decref+0x25>
mov    %ebx,%eax
sar    $0x2,%eax
and    $0xfffffff8,%eax
and    $0x7,%ebx
or     %eax,%ebx
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"Illegal indirection\00"
define i32 @decref(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
%5 = load i32, i32* %3
store i32 %5, i32* %4
%6 = load i32, i32* %4
%7 = and i32 %6, -8
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%11 = load i32, i32* %4
store i32 %11, i32* %2
br label %19
12: ; preds = %1
%13 = load i32, i32* %4
%14 = ashr i32 %13, 2
%15 = and i32 %14, -8
%16 = load i32, i32* %4
%17 = and i32 %16, 7
%18 = or i32 %15, %17
store i32 %18, i32* %2
br label %19
19: ; preds = %12, %9
%20 = load i32, i32* %2
ret i32 %20
}

LLVM IR (-O2):
@.str = [20 x i8] c"Illegal indirection\00"
define i32 @decref(i32 %0) {
%2 = icmp ult i32 %0, 8
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @error to i32 (i8*, ...)*)(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
br label %10
5: ; preds = %1
%6 = ashr i32 %0, 2
%7 = and i32 %6, -8
%8 = and i32 %0, 7
%9 = or i32 %7, %8
br label %10
10: ; preds = %5, %3
%11 = phi i32 [ %0, %3 ], [ %9, %5 ]
ret i32 %11
}
int suma(int a, int b, int c) { return a + b + c; }


x86 assembly (clang, -O0):
<suma>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<suma>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
ret

LLVM IR (-O0):
define i32 @suma(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 = load i32, i32* %5
%9 = add nsw i32 %7, %8
%10 = load i32, i32* %6
%11 = add nsw i32 %9, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @suma(i32 %0, i32 %1, i32 %2) {
%4 = add nsw i32 %1, %0
%5 = add nsw i32 %4, %2
ret i32 %5
}
void test2() {
  void (*b)(int arg, const char *format, ...) __attribute__((__sentinel__));
  void (*z)(int arg, const char *format, ...) __attribute__((__sentinel__(2)));
  void (*y)(int arg, const char *format, ...) __attribute__((__sentinel__(5)));
  b(1, "%s", (void *)0);
  b(1, "%s", 0);
  z(1, "%s", 4, 1, 0);
  z(1, "%s", (void *)0, 1, 0);
  y(1, "%s", 1, 2, 3, 4, 5, 6, 7);
  y(1, "%s", (void *)0, 3, 4, 5, 6, 7);
}


x86 assembly (clang, -O0):
<test2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    $0x1,%edi
lea    0xeec(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x0,%al
call   *-0x8(%rbp)
mov    $0x1,%edi
lea    0xed7(%rip),%rsi
xor    %edx,%edx
mov    $0x0,%al
call   *-0x8(%rbp)
mov    $0x1,%ecx
lea    0xec4(%rip),%rsi
mov    $0x4,%edx
xor    %r8d,%r8d
mov    %ecx,%edi
mov    $0x0,%al
call   *-0x10(%rbp)
mov    $0x1,%ecx
lea    0xea9(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
xor    %r8d,%r8d
mov    %ecx,%edi
mov    $0x0,%al
call   *-0x10(%rbp)
mov    $0x1,%edx
lea    0xe8f(%rip),%rsi
mov    $0x2,%ecx
mov    $0x3,%r8d
mov    $0x4,%r9d
mov    %edx,%edi
movl   $0x5,(%rsp)
movl   $0x6,0x8(%rsp)
movl   $0x7,0x10(%rsp)
mov    $0x0,%al
call   *-0x18(%rbp)
mov    $0x1,%edi
lea    0xe54(%rip),%rsi
xor    %eax,%eax
mov    %eax,%edx
mov    $0x3,%ecx
mov    $0x4,%r8d
mov    $0x5,%r9d
movl   $0x6,(%rsp)
movl   $0x7,0x8(%rsp)
mov    $0x0,%al
call   *-0x18(%rbp)
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @test2() {
%1 = alloca void (i32, i8*, ...)*
%2 = alloca void (i32, i8*, ...)*
%3 = alloca void (i32, i8*, ...)*
%4 = load void (i32, i8*, ...)*, void (i32, i8*, ...)** %1
%5 = load void (i32, i8*, ...)*, void (i32, i8*, ...)** %1
%6 = load void (i32, i8*, ...)*, void (i32, i8*, ...)** %2
%7 = load void (i32, i8*, ...)*, void (i32, i8*, ...)** %2
%8 = load void (i32, i8*, ...)*, void (i32, i8*, ...)** %3
%9 = load void (i32, i8*, ...)*, void (i32, i8*, ...)** %3
ret void
}

LLVM IR (-O2):
/* Variables and functions */
int /*<<< orphan*/ memmove(char *, char *, scalar_t__);
scalar_t__ strlen(char *);
void strpop(char *s, int idx) {
  memmove(&s[idx], &s[idx + 1], strlen(s) - idx);
}


x86 assembly (clang, -O0):
<strpop>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    %rax,%rdx
movslq -0xc(%rbp),%rax
sub    %rax,%rdx
call   1040 <memmove@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strpop>:
push   %r15
push   %r14
push   %rbx
movslq %esi,%rbx
lea    (%rdi,%rbx,1),%r15
lea    (%rdi,%rbx,1),%r14
add    $0x1,%r14
call   1030 <strlen@plt>
sub    %rbx,%rax
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rax,%rdx
pop    %rbx
pop    %r14
pop    %r15
jmp    1040 <memmove@plt>

LLVM IR (-O0):
define void @strpop(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 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8*, i8** %3
%10 = load i32, i32* %4
%11 = add nsw i32 %10, 1
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds i8, i8* %9, i64 %12
%14 = load i8*, i8** %3
%15 = call i64 @strlen(i8* %14)
%16 = load i32, i32* %4
%17 = sext i32 %16 to i64
%18 = sub nsw i64 %15, %17
%19 = call i32 @memmove(i8* %8, i8* %13, i64 %18)
ret void
}

LLVM IR (-O2):
define void @strpop(i8* %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = add nsw i32 %1, 1
%6 = sext i32 %5 to i64
%7 = getelementptr inbounds i8, i8* %0, i64 %6
%8 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%9 = sub nsw i64 %8, %3
%10 = tail call i32 @memmove(i8* %4, i8* %7, i64 %9)
ret void
}
int Quadrado(int a, int b) {
  while (b > 1) {
    return a * Quadrado(a, b - 1);
  }
}


x86 assembly (clang, -O0):
<Quadrado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpl   $0x1,-0xc(%rbp)
jle    1147 <Quadrado+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
sub    $0x1,%esi
call   1030 <Quadrado@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @Quadrado(i32 %0, i32 %1) {
ret i32 0
}
/* Type definitions */
struct parameters_example_struct {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ setGlobalInt(int);
void invoke_parameters_example(struct parameters_example_struct *aBlock,
                               int param) {
  { setGlobalInt(param); }
}


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

x86 assembly (clang, -O2):
<invoke_parameters_example>:
mov    %esi,%edi
jmp    1030 <setGlobalInt@plt>

LLVM IR (-O0):
%struct.parameters_example_struct = type { i32 }
define void @invoke_parameters_example(%struct.parameters_example_struct* %0, i32 %1) {
%3 = alloca %struct.parameters_example_struct*
%4 = alloca i32
store %struct.parameters_example_struct* %0, %struct.parameters_example_struct** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = call i32 @setGlobalInt(i32 %5)
ret void
}

LLVM IR (-O2):
%struct.parameters_example_struct = type { i32 }
define void @invoke_parameters_example(%struct.parameters_example_struct* nocapture readnone %0, i32 %1) {
%3 = tail call i32 @setGlobalInt(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ GetStream();
void lex_analyze_init(void) { GetStream(); }


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

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

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

LLVM IR (-O2):
define void @lex_analyze_init() {
%1 = tail call i32 (...) @GetStream()
ret void
}
/* Type definitions */
struct timespec {
  scalar_t__ tv_nsec;
  scalar_t__ tv_sec;
};

/* Variables and functions */
double convert_time_to_sec(struct timespec *tv) {
  double elapsed_time =
      ((double)(tv->tv_sec)) + (((double)(tv->tv_nsec)) / 1.0e9);
  return elapsed_time;
}


x86 assembly (clang, -O0):
<convert_time_to_sec>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cvtsi2sdq 0x8(%rax),%xmm0
mov    -0x8(%rbp),%rax
cvtsi2sdq (%rax),%xmm1
movsd  0xedd(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_time_to_sec>:
cvtsi2sdq 0x8(%rdi),%xmm1
cvtsi2sdq (%rdi),%xmm0
divsd  0xeed(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timespec = type { i64, i64 }
define double @convert_time_to_sec(%struct.timespec* %0) {
%2 = alloca %struct.timespec*
%3 = alloca double
store %struct.timespec* %0, %struct.timespec** %2
%4 = load %struct.timespec*, %struct.timespec** %2
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %4, i32 0, i32 1
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = load %struct.timespec*, %struct.timespec** %2
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i64, i64* %9
%11 = sitofp i64 %10 to double
%12 = fdiv double %11, 1.000000e+09
%13 = fadd double %7, %12
store double %13, double* %3
%14 = load double, double* %3
ret double %14
}

LLVM IR (-O2):
%struct.timespec = type { i64, i64 }
define double @convert_time_to_sec(%struct.timespec* nocapture %0) {
%2 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%3 = load i64, i64* %2
%4 = sitofp i64 %3 to double
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%6 = load i64, i64* %5
%7 = sitofp i64 %6 to double
%8 = fdiv double %7, 1.000000e+09
%9 = fadd double %8, %4
ret double %9
}
/* Variables and functions */
int /*<<< orphan*/ multi_scope();
int /*<<< orphan*/ nested_parallel();
int /*<<< orphan*/ single_scope();
int main(int argc, char **argv) {
  single_scope();
  multi_scope();
  nested_parallel();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <single_scope@plt>
mov    $0x0,%al
call   1050 <multi_scope@plt>
mov    $0x0,%al
call   1030 <nested_parallel@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @single_scope()
%7 = call i32 (...) @multi_scope()
%8 = call i32 (...) @nested_parallel()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @single_scope()
%4 = tail call i32 (...) @multi_scope()
%5 = tail call i32 (...) @nested_parallel()
ret i32 0
}
void c_pomp_parallel_begin_(struct ompregdescr *r) { (void)0; }


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

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

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

LLVM IR (-O2):
%struct.ompregdescr = type opaque
define void @c_pomp_parallel_begin_(%struct.ompregdescr* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ ircproto_privmsg(char *, char *);
void finish() { ircproto_privmsg("#bots", "Farewell."); }


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

x86 assembly (clang, -O2):
<finish>:
lea    0xee9(%rip),%rdi
lea    0xee8(%rip),%rsi
jmp    1030 <ircproto_privmsg@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"#bots\00"
@.str.1 = [10 x i8] c"Farewell.\00"
define void @finish() {
%1 = call i32 @ircproto_privmsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"#bots\00"
@.str.1 = [10 x i8] c"Farewell.\00"
define void @finish() {
%1 = tail call i32 @ircproto_privmsg(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0))
ret void
}
float findxfrom_vi_vf_a(float vi, float vf, float a) {
  return ((vf * vf) - vi * vi) / (2 * a);
}


x86 assembly (clang, -O0):
<findxfrom_vi_vf_a>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
movss  -0x8(%rbp),%xmm2
movss  -0x4(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
movss  0xebc(%rip),%xmm1
mulss  -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<findxfrom_vi_vf_a>:
mulss  %xmm0,%xmm0
mulss  %xmm1,%xmm1
subss  %xmm0,%xmm1
addss  %xmm2,%xmm2
divss  %xmm2,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @findxfrom_vi_vf_a(float %0, float %1, float %2) {
%4 = alloca float
%5 = alloca float
%6 = alloca float
store float %0, float* %4
store float %1, float* %5
store float %2, float* %6
%7 = load float, float* %5
%8 = load float, float* %5
%9 = load float, float* %4
%10 = load float, float* %4
%11 = fmul float %9, %10
%12 = fneg float %11
%13 = call float @llvm.fmuladd.f32(float %7, float %8, float %12)
%14 = load float, float* %6
%15 = fmul float 2.000000e+00, %14
%16 = fdiv float %13, %15
ret float %16
}

LLVM IR (-O2):
define float @findxfrom_vi_vf_a(float %0, float %1, float %2) {
%4 = fneg float %0
%5 = fmul float %4, %0
%6 = tail call float @llvm.fmuladd.f32(float %1, float %1, float %5)
%7 = fmul float %2, 2.000000e+00
%8 = fdiv float %6, %7
ret float %8
}
void yyerror(const char *str) {}


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

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

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

LLVM IR (-O2):
define void @yyerror(i8* nocapture %0) {
ret void
}
/* Type definitions */
typedef int uint8_t;

/* Variables and functions */
char toHexChar(uint8_t c) { return c < 10 ? c + '0' : c - 10 + 'a'; }


x86 assembly (clang, -O0):
<toHexChar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0xa,-0x4(%rbp)
jge    111f <toHexChar+0x1f>
mov    -0x4(%rbp),%eax
add    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    112b <toHexChar+0x2b>
mov    -0x4(%rbp),%eax
sub    $0xa,%eax
add    $0x61,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<toHexChar>:
lea    0x57(%rdi),%ecx
lea    0x30(%rdi),%eax
cmp    $0xa,%edi
cmovge %ecx,%eax
ret

LLVM IR (-O0):
define signext i8 @toHexChar(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp slt i32 %3, 10
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = add nsw i32 %6, 48
br label %12
8: ; preds = %1
%9 = load i32, i32* %2
%10 = sub nsw i32 %9, 10
%11 = add nsw i32 %10, 97
br label %12
12: ; preds = %8, %5
%13 = phi i32 [ %7, %5 ], [ %11, %8 ]
%14 = trunc i32 %13 to i8
ret i8 %14
}

LLVM IR (-O2):
define signext i8 @toHexChar(i32 %0) {
%2 = icmp slt i32 %0, 10
%3 = select i1 %2, i32 48, i32 87
%4 = add nsw i32 %3, %0
%5 = trunc i32 %4 to i8
ret i8 %5
}
/* Variables and functions */
int /*<<< orphan*/ test(int, int);
int main(void) {
  test(1, 2);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <test@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 1, i32 2)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ memcpy(void *, void *, size_t);
int strlen(char const *);
void *xmalloc(size_t);
char *xstrdup(const char *str) {
  size_t len = strlen(str) + 1;
  void *new = xmalloc(len);
  memcpy(new, (void *)str, len);
  return (char *)new;
}


x86 assembly (clang, -O0):
<xstrdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
add    $0x1,%eax
cltq
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <xmalloc@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <memcpy@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xstrdup>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r14
call   1030 <strlen@plt>
add    $0x1,%eax
movslq %eax,%r15
mov    %r15,%rdi
call   1040 <xmalloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1050 <memcpy@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @xstrdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i8*
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i32 @strlen(i8* %5)
%7 = add nsw i32 %6, 1
%8 = sext i32 %7 to i64
store i64 %8, i64* %3
%9 = load i64, i64* %3
%10 = call i8* @xmalloc(i64 %9)
store i8* %10, i8** %4
%11 = load i8*, i8** %4
%12 = load i8*, i8** %2
%13 = load i64, i64* %3
%14 = call i32 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = load i8*, i8** %4
ret i8* %15
}

LLVM IR (-O2):
define i8* @xstrdup(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = add nsw i32 %2, 1
%4 = sext i32 %3 to i64
%5 = tail call i8* @xmalloc(i64 %4)
%6 = tail call i32 @memcpy(i8* %5, i8* %0, i64 %4)
ret i8* %5
}
int test_imm_B0int8_mem(signed char *val) {
  return ((*val) & (-0xB0 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_B0int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff50,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_B0int8_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, -176
%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_B0int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -176
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void I2CMasterEnable(uint32_t ui32Base) {
  ;
  (*((volatile unsigned long *)(ui32Base + 0x00000020))) |= 0x00000010;
}


x86 assembly (clang, -O0):
<I2CMasterEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%rcx
or     $0x10,%rcx
mov    %rcx,0x20(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<I2CMasterEnable>:
orq    $0x10,0x20(%rdi)
ret

LLVM IR (-O0):
define void @I2CMasterEnable(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = add nsw i64 %3, 32
%5 = inttoptr i64 %4 to i64*
%6 = load volatile i64, i64* %5
%7 = or i64 %6, 16
store volatile i64 %7, i64* %5
ret void
}

LLVM IR (-O2):
define void @I2CMasterEnable(i64 %0) {
%2 = add nsw i64 %0, 32
%3 = inttoptr i64 %2 to i64*
%4 = load volatile i64, i64* %3
%5 = or i64 %4, 16
store volatile i64 %5, i64* %3
ret void
}
/* Variables and functions */
char getTexChar();
int /*<<< orphan*/ ungetTexChar(char);
void skipSpaces(void) {
  char c;
  while ((c = getTexChar()) && c == ' ') {
  }
  ungetTexChar(c);
}


x86 assembly (clang, -O0):
<skipSpaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <getTexChar@plt>
mov    %al,-0x1(%rbp)
movsbl %al,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x2(%rbp)
je     1150 <skipSpaces+0x30>
movsbl -0x1(%rbp),%eax
cmp    $0x20,%eax
sete   %al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
test   $0x1,%al
jne    1160 <skipSpaces+0x40>
jmp    1165 <skipSpaces+0x45>
jmp    1128 <skipSpaces+0x8>
movsbl -0x1(%rbp),%edi
call   1030 <ungetTexChar@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skipSpaces>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
xor    %eax,%eax
call   1040 <getTexChar@plt>
cmp    $0x20,%al
je     1130 <skipSpaces+0x10>
movsbl %al,%edi
pop    %rax
jmp    1030 <ungetTexChar@plt>

LLVM IR (-O0):
define void @skipSpaces() {
%1 = alloca i8
br label %2
2: ; preds = %12, %0
%3 = call signext i8 (...) @getTexChar()
store i8 %3, i8* %1
%4 = sext i8 %3 to i32
%5 = icmp ne i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %2
%7 = load i8, i8* %1
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 32
br label %10
10: ; preds = %6, %2
%11 = phi i1 [ false, %2 ], [ %9, %6 ]
br i1 %11, label %12, label %13
12: ; preds = %10
br label %2
13: ; preds = %10
%14 = load i8, i8* %1
%15 = call i32 @ungetTexChar(i8 signext %14)
ret void
}

LLVM IR (-O2):
define void @skipSpaces() {
br label %1
1: ; preds = %1, %0
%2 = tail call signext i8 (...) @getTexChar()
%3 = icmp eq i8 %2, 32
br i1 %3, label %1, label %4
4: ; preds = %1
%5 = tail call i32 @ungetTexChar(i8 signext %2)
ret void
}
/* Variables and functions */
double sin(double);
double sinc(double x) {
  double res;
  if (x == 0.)
    res = 1.;
  else {
    res = 3.1415926539 * x;
    res = sin(res) / res;
  }
  return res;
}


x86 assembly (clang, -O0):
<sinc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1147 <sinc+0x37>
jp     1147 <sinc+0x37>
movsd  0xecb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    116d <sinc+0x5d>
movsd  0xeb1(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sin@plt>
divsd  -0x10(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sinc>:
push   %rax
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    1127 <sinc+0x17>
jp     1127 <sinc+0x17>
movsd  0xedb(%rip),%xmm0
pop    %rax
ret
mulsd  0xed9(%rip),%xmm0
movsd  %xmm0,(%rsp)
call   1030 <sin@plt>
divsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @sinc(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
%4 = load double, double* %2
%5 = fcmp oeq double %4, 0.000000e+00
br i1 %5, label %6, label %7
6: ; preds = %1
store double 1.000000e+00, double* %3
br label %14
7: ; preds = %1
%8 = load double, double* %2
%9 = fmul double 0x400921FB544ED5B4, %8
store double %9, double* %3
%10 = load double, double* %3
%11 = call double @sin(double %10)
%12 = load double, double* %3
%13 = fdiv double %11, %12
store double %13, double* %3
br label %14
14: ; preds = %7, %6
%15 = load double, double* %3
ret double %15
}

LLVM IR (-O2):
define double @sinc(double %0) {
%2 = fcmp oeq double %0, 0.000000e+00
br i1 %2, label %7, label %3
3: ; preds = %1
%4 = fmul double %0, 0x400921FB544ED5B4
%5 = tail call double @sin(double %4)
%6 = fdiv double %5, %4
br label %7
7: ; preds = %1, %3
%8 = phi double [ %6, %3 ], [ 1.000000e+00, %1 ]
ret double %8
}
int sum(int n1, int n2, int n3, int n4, int n5, int n6, int n7) {
  return n1 + n2 + n3 + n4 + n5 + n6 + n7;
}


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    0x10(%rbp),%eax
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    %r8d,-0x14(%rbp)
mov    %r9d,-0x18(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
add    -0xc(%rbp),%eax
add    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    (%rdi,%rsi,1),%eax
add    %edx,%eax
add    %ecx,%eax
add    %r8d,%eax
add    %r9d,%eax
add    0x8(%rsp),%eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
store i32 %0, i32* %8
store i32 %1, i32* %9
store i32 %2, i32* %10
store i32 %3, i32* %11
store i32 %4, i32* %12
store i32 %5, i32* %13
store i32 %6, i32* %14
%15 = load i32, i32* %8
%16 = load i32, i32* %9
%17 = add nsw i32 %15, %16
%18 = load i32, i32* %10
%19 = add nsw i32 %17, %18
%20 = load i32, i32* %11
%21 = add nsw i32 %19, %20
%22 = load i32, i32* %12
%23 = add nsw i32 %21, %22
%24 = load i32, i32* %13
%25 = add nsw i32 %23, %24
%26 = load i32, i32* %14
%27 = add nsw i32 %25, %26
ret i32 %27
}

LLVM IR (-O2):
define i32 @sum(i32 %0, i32 %1, i32 %2, i32 %3, i32 %4, i32 %5, i32 %6) {
%8 = add nsw i32 %1, %0
%9 = add nsw i32 %8, %2
%10 = add nsw i32 %9, %3
%11 = add nsw i32 %10, %4
%12 = add nsw i32 %11, %5
%13 = add nsw i32 %12, %6
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ stub_state_post_print(void *);
int /*<<< orphan*/ stub_state_pre_print(void *);
int stub_read_nil(void *data) {
  stub_state_pre_print(data);
  printf("nil");
  stub_state_post_print(data);
  return 0;
}


x86 assembly (clang, -O0):
<stub_read_nil>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <stub_state_pre_print@plt>
lea    0xeb4(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <stub_state_post_print@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stub_read_nil>:
push   %rbx
mov    %rdi,%rbx
call   1050 <stub_state_pre_print@plt>
lea    0xec0(%rip),%rdi
call   1040 <printf@plt>
mov    %rbx,%rdi
call   1030 <stub_state_post_print@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"nil\00"
define i32 @stub_read_nil(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @stub_state_pre_print(i8* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @stub_state_post_print(i8* %6)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"nil\00"
define i32 @stub_read_nil(i8* %0) {
%2 = tail call i32 @stub_state_pre_print(i8* %0)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @stub_state_post_print(i8* %0)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ O_RDONLY;
int /*<<< orphan*/ close(int);
int open(char *, int /*<<< orphan*/);
int /*<<< orphan*/ read(int, char *, int);
char get_SW2(void) {
  char buf[2];
  int SW2;
  SW2 = open("/dev/rtswitch2", O_RDONLY);
  read(SW2, buf, 2);
  close(SW2);
  return buf[0];
}


x86 assembly (clang, -O0):
<get_SW2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    0x2ea9(%rip),%rax
mov    (%rax),%esi
lea    0xeb8(%rip),%rdi
call   1050 <open@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x2(%rbp),%rsi
mov    $0x2,%edx
call   1040 <read@plt>
mov    -0x8(%rbp),%edi
call   1030 <close@plt>
movsbl -0x2(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_SW2>:
push   %rbx
sub    $0x10,%rsp
mov    0x2eac(%rip),%rax
mov    (%rax),%esi
lea    0xebb(%rip),%rdi
call   1050 <open@plt>
mov    %eax,%ebx
lea    0xe(%rsp),%rsi
mov    %eax,%edi
mov    $0x2,%edx
call   1040 <read@plt>
mov    %ebx,%edi
call   1030 <close@plt>
mov    0xe(%rsp),%al
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [15 x i8] c"/dev/rtswitch2\00"
@O_RDONLY = global i32 0
define signext i8 @get_SW2() {
%1 = alloca [2 x i8]
%2 = alloca i32
%3 = load i32, i32* @O_RDONLY
%4 = call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%7 = call i32 @read(i32 %5, i8* %6, i32 2)
%8 = load i32, i32* %2
%9 = call i32 @close(i32 %8)
%10 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%11 = load i8, i8* %10
ret i8 %11
}

LLVM IR (-O2):
@.str = [15 x i8] c"/dev/rtswitch2\00"
@O_RDONLY = global i32 0
define signext i8 @get_SW2() {
%1 = alloca [2 x i8]
%2 = getelementptr inbounds [2 x i8], [2 x i8]* %1, i64 0, i64 0
%3 = load i32, i32* @O_RDONLY
%4 = tail call i32 @open(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0), i32 %3)
%5 = call i32 @read(i32 %4, i8* %2, i32 2)
%6 = tail call i32 @close(i32 %4)
%7 = load i8, i8* %2
ret i8 %7
}
/* Type definitions */
struct st_root {
  int dummy;
};
struct st_node {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct st_node *);
struct st_node *st_rm_string(struct st_root *, char *);
int cli_rm_cmd(struct st_root *root, char *cmd) {
  struct st_node *node;
  node = st_rm_string(root, cmd);
  if (!node)
    return -1;
  free(node);
  return 0;
}


x86 assembly (clang, -O0):
<cli_rm_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <st_rm_string@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1158 <cli_rm_cmd+0x38>
movl   $0xffffffff,-0x4(%rbp)
jmp    1168 <cli_rm_cmd+0x48>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cli_rm_cmd>:
push   %rax
call   1040 <st_rm_string@plt>
test   %rax,%rax
je     1137 <cli_rm_cmd+0x17>
mov    %rax,%rdi
call   1030 <free@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0xffffffff,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.st_root = type { i32 }
%struct.st_node = type { i32 }
define i32 @cli_rm_cmd(%struct.st_root* %0, i8* %1) {
%3 = alloca i32
%4 = alloca %struct.st_root*
%5 = alloca i8*
%6 = alloca %struct.st_node*
store %struct.st_root* %0, %struct.st_root** %4
store i8* %1, i8** %5
%7 = load %struct.st_root*, %struct.st_root** %4
%8 = load i8*, i8** %5
%9 = call %struct.st_node* @st_rm_string(%struct.st_root* %7, i8* %8)
store %struct.st_node* %9, %struct.st_node** %6
%10 = load %struct.st_node*, %struct.st_node** %6
%11 = icmp ne %struct.st_node* %10, null
br i1 %11, label %13, label %12
12: ; preds = %2
store i32 -1, i32* %3
br label %16
13: ; preds = %2
%14 = load %struct.st_node*, %struct.st_node** %6
%15 = call i32 @free(%struct.st_node* %14)
store i32 0, i32* %3
br label %16
16: ; preds = %13, %12
%17 = load i32, i32* %3
ret i32 %17
}

LLVM IR (-O2):
%struct.st_root = type { i32 }
%struct.st_node = type { i32 }
define i32 @cli_rm_cmd(%struct.st_root* %0, i8* %1) {
%3 = tail call %struct.st_node* @st_rm_string(%struct.st_root* %0, i8* %1)
%4 = icmp eq %struct.st_node* %3, null
br i1 %4, label %7, label %5
5: ; preds = %2
%6 = tail call i32 @free(%struct.st_node* %3)
br label %7
7: ; preds = %2, %5
%8 = phi i32 [ 0, %5 ], [ -1, %2 ]
ret i32 %8
}
/* Type definitions */
typedef void *realloc;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void *debug_realloc(void *ptr, const size_t size, const char *file,
                    const int line) {
  printf("%s:%d: realloc(%p", file, line, ptr);
  void *rptr = (realloc)(ptr, size);
  printf(", %d)=%p\n", (int)size, rptr);
  return rptr;
}


x86 assembly (clang, -O0):
<debug_realloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xec7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %eax,%esi
mov    -0x28(%rbp),%rdx
lea    0xeb9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<debug_realloc>:
push   %rbx
mov    %rsi,%rbx
mov    %rdi,%rax
lea    0xee2(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %rax,%rcx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xede(%rip),%rdi
mov    %ebx,%esi
mov    %rbx,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"%s:%d: realloc(%p\00"
@.str.1 = [10 x i8] c", %d)=%p\0A\00"
define i8* @debug_realloc(i8* %0, i64 %1, i8* %2, i32 %3) {
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %0)
%6 = inttoptr i64 %1 to i8*
%7 = trunc i64 %1 to i32
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %7, i8* %6)
ret i8* %6
}
/* Variables and functions */
int /*<<< orphan*/ OPENSSL_free(char *);
void str_free(char *s) { OPENSSL_free(s); }


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

x86 assembly (clang, -O2):
<str_free>:
jmp    1030 <OPENSSL_free@plt>

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

LLVM IR (-O2):
define void @str_free(i8* %0) {
%2 = tail call i32 @OPENSSL_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ config_cmd(unsigned char, unsigned int, unsigned int);
int /*<<< orphan*/ outb(unsigned char, int);
int /*<<< orphan*/ outl(int /*<<< orphan*/, int);
void pcibios_write_config_byte(unsigned char bus, unsigned devfn,
                               unsigned where, unsigned char value) {
  outl(config_cmd(bus, devfn, where), 0xCF8);
  outb(value, 0xCFC + (where & 3));
}


x86 assembly (clang, -O0):
<pcibios_write_config_byte>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %cl,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %al,-0xd(%rbp)
mov    -0x1(%rbp),%al
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
movzbl %al,%edi
call   1050 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1040 <outl@plt>
mov    -0xd(%rbp),%al
mov    -0xc(%rbp),%esi
and    $0x3,%esi
add    $0xcfc,%esi
movzbl %al,%edi
call   1030 <outb@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pcibios_write_config_byte>:
push   %rbp
push   %rbx
push   %rax
mov    %ecx,%ebx
mov    %edx,%ebp
call   1050 <config_cmd@plt>
mov    %eax,%edi
mov    $0xcf8,%esi
call   1040 <outl@plt>
or     $0xcfc,%ebp
and    $0xcff,%ebp
mov    %ebx,%edi
mov    %ebp,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <outb@plt>

LLVM IR (-O0):
define void @pcibios_write_config_byte(i8 zeroext %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = alloca i8
%6 = alloca i32
%7 = alloca i32
%8 = alloca i8
store i8 %0, i8* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i8 %3, i8* %8
%9 = load i8, i8* %5
%10 = load i32, i32* %6
%11 = load i32, i32* %7
%12 = call i32 @config_cmd(i8 zeroext %9, i32 %10, i32 %11)
%13 = call i32 @outl(i32 %12, i32 3320)
%14 = load i8, i8* %8
%15 = load i32, i32* %7
%16 = and i32 %15, 3
%17 = add i32 3324, %16
%18 = call i32 @outb(i8 zeroext %14, i32 %17)
ret void
}

LLVM IR (-O2):
define void @pcibios_write_config_byte(i8 zeroext %0, i32 %1, i32 %2, i8 zeroext %3) {
%5 = tail call i32 @config_cmd(i8 zeroext %0, i32 %1, i32 %2)
%6 = tail call i32 @outl(i32 %5, i32 3320)
%7 = and i32 %2, 3
%8 = or i32 %7, 3324
%9 = tail call i32 @outb(i8 zeroext %3, i32 %8)
ret void
}
/* Variables and functions */
int strlen(char *);
int str_guessbase(char *input) {
  if (strlen(input) > 2 && input[0] == '0' && input[1] == 'x') {
    return 16;
  } else {
    return 10;
  }
}


x86 assembly (clang, -O0):
<str_guessbase>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
cmp    $0x2,%eax
jle    115b <str_guessbase+0x4b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jne    115b <str_guessbase+0x4b>
mov    -0x10(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x78,%eax
jne    115b <str_guessbase+0x4b>
movl   $0x10,-0x4(%rbp)
jmp    1162 <str_guessbase+0x52>
movl   $0xa,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<str_guessbase>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cmp    $0x3,%eax
jl     112e <str_guessbase+0x1e>
cmpb   $0x30,(%rbx)
jne    112e <str_guessbase+0x1e>
mov    $0x10,%eax
cmpb   $0x78,0x1(%rbx)
je     1133 <str_guessbase+0x23>
mov    $0xa,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @str_guessbase(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 2
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 48
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %0, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 120
br i1 %10, label %12, label %11
11: ; preds = %7, %4, %1
br label %12
12: ; preds = %7, %11
%13 = phi i32 [ 10, %11 ], [ 16, %7 ]
ret i32 %13
}
int main(void) {
  int a;
  &a + 1;
  int b[2];
  (b + 2);
  int c;
  &c;
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [2 x i32]
%4 = alloca i32
store i32 0, i32* %1
%5 = getelementptr inbounds i32, i32* %2, i64 1
%6 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
%7 = getelementptr inbounds i32, i32* %6, i64 2
ret i32 0
}

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


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

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

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

LLVM IR (-O2):
define void @lu_abort() {
%1 = tail call i32 (...) @abort_()
ret void
}
unsigned hash(const char *s) {
  unsigned n;
  for (n = 0; *s; s++)
    n = (n * 33) + *s;
  return n % (1UL << 11);
}


x86 assembly (clang, -O0):
<hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113d <hash+0x3d>
imul   $0x21,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <hash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7ff,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <hash+0x2d>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash+0x10>
and    $0x7ff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %16, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i32 [ %10, %4 ], [ 0, %1 ]
%7 = phi i8* [ %11, %4 ], [ %0, %1 ]
%8 = mul i32 %6, 33
%9 = sext i8 %5 to i32
%10 = add i32 %8, %9
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %11
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4
%15 = and i32 %10, 2047
br label %16
16: ; preds = %14, %1
%17 = phi i32 [ 0, %1 ], [ %15, %14 ]
ret i32 %17
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x52() {
  Assert_real((isprint(82)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              415, ("isprint should be 1 for R"));
}


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

x86 assembly (clang, -O2):
<t_isprint_0x52>:
push   %rax
mov    $0x52,%edi
call   1030 <isprint@plt>
lea    0xece(%rip),%rsi
lea    0xf6f(%rip),%rcx
mov    %eax,%edi
mov    $0x19f,%edx
pop    %rax
jmp    1040 <Assert_real@plt>

LLVM IR (-O0):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for R\00"
define void @t_isprint_0x52() {
%1 = call i32 @isprint(i32 82)
%2 = call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for R\00"
define void @t_isprint_0x52() {
%1 = tail call i32 @isprint(i32 82)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 415, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}