xunge/DecIR huggingface dataset:
/* Variables and functions */
int func();
int main() {
  int i;
  i = func();
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @func()
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
size_t fread(void *, size_t, size_t, int /*<<< orphan*/ *);
int /*<<< orphan*/ stderr;
size_t safe_fread(void *ptr, size_t size, size_t nmemb, FILE *stream) {
  size_t rc = fread(ptr, size, nmemb, stream);
  if (rc == 0) {
    fprintf(stderr, "(util) ERROR: cannot read data\n");
    exit(2);
  }
  return rc;
}


x86 assembly (clang, -O0):
<safe_fread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <fread@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
jne    118b <safe_fread+0x5b>
mov    0x2e6d(%rip),%rax
mov    (%rax),%edi
lea    0xe84(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>
mov    -0x28(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<safe_fread>:
push   %rax
call   1030 <fread@plt>
test   %rax,%rax
je     113d <safe_fread+0xd>
pop    %rcx
ret
mov    0x2e9c(%rip),%rax
mov    (%rax),%edi
lea    0xeb3(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x2,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"(util) ERROR: cannot read data\0A\00"
define i64 @safe_fread(i8* %0, i64 %1, i64 %2, i32* %3) {
%5 = alloca i8*
%6 = alloca i64
%7 = alloca i64
%8 = alloca i32*
%9 = alloca i64
store i8* %0, i8** %5
store i64 %1, i64* %6
store i64 %2, i64* %7
store i32* %3, i32** %8
%10 = load i8*, i8** %5
%11 = load i64, i64* %6
%12 = load i64, i64* %7
%13 = load i32*, i32** %8
%14 = call i64 @fread(i8* %10, i64 %11, i64 %12, i32* %13)
store i64 %14, i64* %9
%15 = load i64, i64* %9
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %4
%18 = load i32, i32* @stderr
%19 = call i32 @fprintf(i32 %18, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%20 = call i32 @exit(i32 2)
unreachable
21: ; preds = %4
%22 = load i64, i64* %9
ret i64 %22
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"(util) ERROR: cannot read data\0A\00"
define i64 @safe_fread(i8* nocapture %0, i64 %1, i64 %2, i32* nocapture %3) {
%5 = tail call i64 @fread(i8* %0, i64 %1, i64 %2, i32* %3)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = load i32, i32* @stderr
%9 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @exit(i32 2)
unreachable
11: ; preds = %4
ret i64 %5
}
/* Variables and functions */
int /*<<< orphan*/ fake_acquire_cpu(int /*<<< orphan*/);
int /*<<< orphan*/ fake_release_cpu(int /*<<< orphan*/);
int /*<<< orphan*/ get_cpu();
int /*<<< orphan*/ rcu_note_context_switch();
int cond_resched(void) {
  rcu_note_context_switch();
  fake_release_cpu(get_cpu());
  fake_acquire_cpu(get_cpu());
  return 0;
}


x86 assembly (clang, -O0):
<cond_resched>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <rcu_note_context_switch@plt>
mov    $0x0,%al
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1040 <fake_release_cpu@plt>
mov    $0x0,%al
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1050 <fake_acquire_cpu@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<cond_resched>:
push   %rax
xor    %eax,%eax
call   1030 <rcu_note_context_switch@plt>
xor    %eax,%eax
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1040 <fake_release_cpu@plt>
xor    %eax,%eax
call   1060 <get_cpu@plt>
mov    %eax,%edi
call   1050 <fake_acquire_cpu@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @cond_resched() {
%1 = call i32 (...) @rcu_note_context_switch()
%2 = call i32 (...) @get_cpu()
%3 = call i32 @fake_release_cpu(i32 %2)
%4 = call i32 (...) @get_cpu()
%5 = call i32 @fake_acquire_cpu(i32 %4)
ret i32 0
}

LLVM IR (-O2):
define i32 @cond_resched() {
%1 = tail call i32 (...) @rcu_note_context_switch()
%2 = tail call i32 (...) @get_cpu()
%3 = tail call i32 @fake_release_cpu(i32 %2)
%4 = tail call i32 (...) @get_cpu()
%5 = tail call i32 @fake_acquire_cpu(i32 %4)
ret i32 0
}
void destructor_derived_DPG_Solver_Face(struct Face *face_ptr) {
  (void)(face_ptr);
}


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

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

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

LLVM IR (-O2):
%struct.Face = type opaque
define void @destructor_derived_DPG_Solver_Face(%struct.Face* nocapture %0) {
ret void
}
unsigned int ceil_sqrt(unsigned int x) {
  unsigned int sq = 0;
  unsigned int k = 0;
  while (sq < x)
    sq += k++ << 1 | 1;
  return k;
}


x86 assembly (clang, -O0):
<ceil_sqrt>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jae    113d <ceil_sqrt+0x3d>
mov    -0xc(%rbp),%eax
mov    %eax,%ecx
add    $0x1,%ecx
mov    %ecx,-0xc(%rbp)
shl    $0x1,%eax
or     $0x1,%eax
add    -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1115 <ceil_sqrt+0x15>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ceil_sqrt>:
test   %edi,%edi
je     1120 <ceil_sqrt+0x20>
xor    %ecx,%ecx
xor    %eax,%eax
xor    %edx,%edx
nopw   0x0(%rax,%rax,1)
add    $0x1,%eax
add    %ecx,%edx
add    $0x1,%edx
add    $0x2,%ecx
cmp    %edi,%edx
jb     1110 <ceil_sqrt+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @ceil_sqrt(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %11, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = phi i32 [ %9, %3 ], [ 0, %1 ]
%6 = add i32 %4, 1
%7 = shl i32 %4, 1
%8 = add nuw i32 %5, 1
%9 = add i32 %8, %7
%10 = icmp ult i32 %9, %0
br i1 %10, label %3, label %11
11: ; preds = %3, %1
%12 = phi i32 [ 0, %1 ], [ %6, %3 ]
ret i32 %12
}
void _Z8shsFinalP8SHS_INFO(void) {}


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

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

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

LLVM IR (-O2):
define void @_Z8shsFinalP8SHS_INFO() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int __infer_nondet_int();
int vfprintf(FILE *stream, const char *format, va_list arg) {
  int res;
  FILE tmp;
  tmp = *stream;
  res = __infer_nondet_int();
  if (res < 0)
    while (1)
      ;
  return res;
}


x86 assembly (clang, -O0):
<vfprintf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jge    114a <vfprintf+0x3a>
jmp    1145 <vfprintf+0x35>
jmp    1145 <vfprintf+0x35>
mov    -0x18(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vfprintf>:
push   %rax
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
js     1120 <vfprintf+0x10>
pop    %rcx
ret
xchg   %ax,%ax
jmp    1120 <vfprintf+0x10>

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

LLVM IR (-O2):
define i32 @vfprintf(i32* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
%4 = tail call i32 (...) @__infer_nondet_int()
%5 = icmp slt i32 %4, 0
br i1 %5, label %6, label %7
6: ; preds = %3, %6
br label %6
7: ; preds = %3
ret i32 %4
}
/* Variables and functions */
int values_equal_display_error(unsigned long long const,
                               unsigned long long const);
int check_value(const unsigned long long value,
                const unsigned long long check_value_data) {
  return values_equal_display_error(value, check_value_data);
}


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

x86 assembly (clang, -O2):
<check_value>:
jmp    1030 <values_equal_display_error@plt>

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

LLVM IR (-O2):
define i32 @check_value(i64 %0, i64 %1) {
%3 = tail call i32 @values_equal_display_error(i64 %0, i64 %1)
ret i32 %3
}
void i2d_OCSP_CERTSTATUS(void) {}


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

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

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

LLVM IR (-O2):
define void @i2d_OCSP_CERTSTATUS() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct timeval {
  scalar_t__ tv_usec;
  int /*<<< orphan*/ tv_sec;
};

/* Variables and functions */
int settimeofday(struct timeval *, int /*<<< orphan*/ *);
int stime(const time_t *t) {
  struct timeval tv;
  tv.tv_sec = *t;
  tv.tv_usec = 0;
  return settimeofday(&tv, NULL);
}


x86 assembly (clang, -O0):
<stime>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <settimeofday@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stime>:
sub    $0x18,%rsp
mov    (%rdi),%eax
mov    %eax,0x10(%rsp)
movq   $0x0,0x8(%rsp)
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <settimeofday@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i32 }
define i32 @stime(i32* %0) {
%2 = alloca i32*
%3 = alloca %struct.timeval
store i32* %0, i32** %2
%4 = load i32*, i32** %2
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 1
store i32 %5, i32* %6
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %3, i32 0, i32 0
store i64 0, i64* %7
%8 = call i32 @settimeofday(%struct.timeval* %3, i32* null)
ret i32 %8
}

LLVM IR (-O2):
%struct.timeval = type { i64, i32 }
define i32 @stime(i32* nocapture %0) {
%2 = alloca %struct.timeval
%3 = bitcast %struct.timeval* %2 to i8*
%4 = load i32, i32* %0
%5 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 1
store i32 %4, i32* %5
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i64 0, i32 0
store i64 0, i64* %6
%7 = call i32 @settimeofday(%struct.timeval* %2, i32* null)
ret i32 %7
}
/* Type definitions */
struct memorycontainer {
  int dummy;
};

/* Variables and functions */
struct memorycontainer *createExpression(int, struct memorycontainer *,
                                         struct memorycontainer *);
struct memorycontainer *
createEqExpression(struct memorycontainer *expression1,
                   struct memorycontainer *expression2) {
  return createExpression(0x04, expression1, expression2);
}


x86 assembly (clang, -O0):
<createEqExpression>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    $0x4,%edi
call   1030 <createExpression@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<createEqExpression>:
mov    %rsi,%rdx
mov    %rdi,%rsi
mov    $0x4,%edi
jmp    1030 <createExpression@plt>

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

LLVM IR (-O2):
%struct.memorycontainer = type { i32 }
define %struct.memorycontainer* @createEqExpression(%struct.memorycontainer* %0, %struct.memorycontainer* %1) {
%3 = tail call %struct.memorycontainer* @createExpression(i32 4, %struct.memorycontainer* %0, %struct.memorycontainer* %1)
ret %struct.memorycontainer* %3
}
double compute_time_delay(int users, int nodes) {
  if (users < 1) {
    users = 1;
  }
  if (nodes < 1) {
    nodes = 1;
  }
  return (((double)nodes / users)) * 60;
}


x86 assembly (clang, -O0):
<compute_time_delay>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cmpl   $0x1,-0x4(%rbp)
jge    111b <compute_time_delay+0x1b>
movl   $0x1,-0x4(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    112c <compute_time_delay+0x2c>
movl   $0x1,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
cvtsi2sdl -0x4(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  0xebe(%rip),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_time_delay>:
movd   %edi,%xmm0
movd   %esi,%xmm1
punpckldq %xmm0,%xmm1
movdqa 0xeec(%rip),%xmm0
movdqa %xmm1,%xmm2
pcmpgtd %xmm0,%xmm2
pand   %xmm2,%xmm1
pandn  %xmm0,%xmm2
por    %xmm1,%xmm2
cvtdq2pd %xmm2,%xmm0
movapd %xmm0,%xmm1
unpckhpd %xmm0,%xmm1
divsd  %xmm1,%xmm0
mulsd  0xed0(%rip),%xmm0
ret

LLVM IR (-O0):
define double @compute_time_delay(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 1
br i1 %6, label %7, label %8
7: ; preds = %2
store i32 1, i32* %3
br label %8
8: ; preds = %7, %2
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 1
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 1, i32* %4
br label %12
12: ; preds = %11, %8
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to double
%15 = load i32, i32* %3
%16 = sitofp i32 %15 to double
%17 = fdiv double %14, %16
%18 = fmul double %17, 6.000000e+01
ret double %18
}

LLVM IR (-O2):
define double @compute_time_delay(i32 %0, i32 %1) {
%3 = insertelement <2 x i32> poison, i32 %1, i64 0
%4 = insertelement <2 x i32> %3, i32 %0, i64 1
%5 = icmp sgt <2 x i32> %4, <i32 1, i32 1>
%6 = select <2 x i1> %5, <2 x i32> %4, <2 x i32> <i32 1, i32 1>
%7 = sitofp <2 x i32> %6 to <2 x double>
%8 = extractelement <2 x double> %7, i64 0
%9 = extractelement <2 x double> %7, i64 1
%10 = fdiv double %8, %9
%11 = fmul double %10, 6.000000e+01
ret double %11
}
int exe$free(struct _fab *fab, void *err, void *suc) {
  printk("not implemented\n");
}


x86 assembly (clang, -O0):
<exe$free>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printk@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<exe$free>:
lea    0xee9(%rip),%rdi
xor    %eax,%eax
jmp    1030 <printk@plt>

LLVM IR (-O0):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$free"(%struct._fab* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca %struct._fab*
%6 = alloca i8*
%7 = alloca i8*
store %struct._fab* %0, %struct._fab** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
%8 = call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%9 = load i32, i32* %4
ret i32 %9
}

LLVM IR (-O2):
%struct._fab = type opaque
@.str = [17 x i8] c"not implemented\0A\00"
define i32 @"exe$free"(%struct._fab* nocapture readnone %0, i8* nocapture readnone %1, i8* nocapture readnone %2) {
%4 = tail call i32 (i8*, ...) bitcast (i32 (...)* @printk to i32 (i8*, ...)*)(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
int Problem034(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @Problem034() {
ret i32 1
}

LLVM IR (-O2):
define i32 @Problem034() {
ret i32 1
}
void tag_sanitize(char *dest, char *source) {
  while (*source != '\0') {
    if (*source != '/')
      *(dest++) = *source;
    source++;
  }
  dest[0] = '\0';
}


x86 assembly (clang, -O0):
<tag_sanitize>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1154 <tag_sanitize+0x54>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2f,%eax
je     1143 <tag_sanitize+0x43>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    110c <tag_sanitize+0xc>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<tag_sanitize>:
jmp    1114 <tag_sanitize+0x14>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0x1,%rsi
movzbl (%rsi),%eax
cmp    $0x2f,%al
je     1110 <tag_sanitize+0x10>
test   %al,%al
je     1127 <tag_sanitize+0x27>
mov    %al,(%rdi)
add    $0x1,%rdi
jmp    1110 <tag_sanitize+0x10>
movb   $0x0,(%rdi)
ret

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

LLVM IR (-O2):
define void @tag_sanitize(i8* nocapture writeonly %0, i8* nocapture %1) {
br label %3
3: ; preds = %9, %2
%4 = phi i8* [ %0, %2 ], [ %10, %9 ]
%5 = phi i8* [ %1, %2 ], [ %11, %9 ]
%6 = load i8, i8* %5
switch i8 %6, label %7 [
i8 0, label %12
i8 47, label %9
]
7: ; preds = %3
%8 = getelementptr inbounds i8, i8* %4, i64 1
store i8 %6, i8* %4
br label %9
9: ; preds = %3, %7
%10 = phi i8* [ %8, %7 ], [ %4, %3 ]
%11 = getelementptr inbounds i8, i8* %5, i64 1
br label %3
12: ; preds = %3
store i8 0, i8* %4
ret void
}
/* Type definitions */
struct timeval {
  long tv_sec;
  long tv_usec;
};

/* Variables and functions */
double difftv(struct timeval tv1, struct timeval tv2) {
  long diff_sec, diff_usec;
  double diff;
  diff_sec = tv1.tv_sec - tv2.tv_sec;
  diff_usec = tv1.tv_usec - tv2.tv_usec;
  diff = (double)diff_sec + ((double)diff_usec / 1000000.0);
  return (diff);
}


x86 assembly (clang, -O0):
<difftv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x8(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x18(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x18(%rbp),%rax
mov    %rax,-0x30(%rbp)
cvtsi2sdq -0x28(%rbp),%xmm0
cvtsi2sdq -0x30(%rbp),%xmm1
movsd  0xec0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x38(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<difftv>:
sub    %rdx,%rdi
sub    %rcx,%rsi
cvtsi2sd %rdi,%xmm1
cvtsi2sd %rsi,%xmm0
divsd  0xee8(%rip),%xmm0
addsd  %xmm1,%xmm0
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
define double @difftv(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = alloca %struct.timeval
%6 = alloca %struct.timeval
%7 = alloca i64
%8 = alloca i64
%9 = alloca double
%10 = bitcast %struct.timeval* %5 to { i64, i64 }*
%11 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 0
store i64 %0, i64* %11
%12 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %10, i32 0, i32 1
store i64 %1, i64* %12
%13 = bitcast %struct.timeval* %6 to { i64, i64 }*
%14 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %13, i32 0, i32 0
store i64 %2, i64* %14
%15 = getelementptr inbounds { i64, i64 }, { i64, i64 }* %13, i32 0, i32 1
store i64 %3, i64* %15
%16 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 0
%17 = load i64, i64* %16
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 0
%19 = load i64, i64* %18
%20 = sub nsw i64 %17, %19
store i64 %20, i64* %7
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %5, i32 0, i32 1
%22 = load i64, i64* %21
%23 = getelementptr inbounds %struct.timeval, %struct.timeval* %6, i32 0, i32 1
%24 = load i64, i64* %23
%25 = sub nsw i64 %22, %24
store i64 %25, i64* %8
%26 = load i64, i64* %7
%27 = sitofp i64 %26 to double
%28 = load i64, i64* %8
%29 = sitofp i64 %28 to double
%30 = fdiv double %29, 1.000000e+06
%31 = fadd double %27, %30
store double %31, double* %9
%32 = load double, double* %9
ret double %32
}

LLVM IR (-O2):
define double @difftv(i64 %0, i64 %1, i64 %2, i64 %3) {
%5 = sub nsw i64 %0, %2
%6 = sub nsw i64 %1, %3
%7 = sitofp i64 %5 to double
%8 = sitofp i64 %6 to double
%9 = fdiv double %8, 1.000000e+06
%10 = fadd double %9, %7
ret double %10
}
/* Type definitions */
typedef int /*<<< orphan*/ non_det;

/* Variables and functions */
int /*<<< orphan*/ klee_make_symbolic(unsigned int *, int, char *);
unsigned map2check_non_det_unsigned() {
  unsigned non_det;
  klee_make_symbolic(&non_det, sizeof(non_det), "non_det_#type");
  return non_det;
}


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

x86 assembly (clang, -O2):
<map2check_non_det_unsigned>:
push   %rax
lea    0xee8(%rip),%rdx
lea    0x4(%rsp),%rdi
mov    $0x4,%esi
call   1030 <klee_make_symbolic@plt>
mov    0x4(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [14 x i8] c"non_det_#type\00"
define i32 @map2check_non_det_unsigned() {
%1 = alloca i32
%2 = call i32 @klee_make_symbolic(i32* %1, i32 4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [14 x i8] c"non_det_#type\00"
define i32 @map2check_non_det_unsigned() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @klee_make_symbolic(i32* %1, i32 4, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%4 = load i32, i32* %1
ret i32 %4
}
/* Variables and functions */
int _func_xpath_funcs(char *, void *, int, char *);
int _func_xpath_first(char *chunk, void *data) {
  return _func_xpath_funcs(chunk, data, 4, "first()");
}


x86 assembly (clang, -O0):
<_func_xpath_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    $0x4,%edx
lea    0xecc(%rip),%rcx
call   1030 <_func_xpath_funcs@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_func_xpath_first>:
lea    0xee9(%rip),%rcx
mov    $0x4,%edx
jmp    1030 <_func_xpath_funcs@plt>

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

LLVM IR (-O2):
@.str = [8 x i8] c"first()\00"
define i32 @_func_xpath_first(i8* %0, i8* %1) {
%3 = tail call i32 @_func_xpath_funcs(i8* %0, i8* %1, i32 4, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ __VERIFIER_assert(int);
unsigned int __VERIFIER_nondet_uint();
int main(void) {
  unsigned int a = __VERIFIER_nondet_uint();
  __VERIFIER_assert(a > 1);
  return a;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x1,-0x8(%rbp)
seta   %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <__VERIFIER_assert@plt>
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1040 <__VERIFIER_nondet_uint@plt>
mov    %eax,%ebx
xor    %edi,%edi
cmp    $0x2,%eax
setae  %dil
call   1030 <__VERIFIER_assert@plt>
mov    %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
%3 = call i32 (...) @__VERIFIER_nondet_uint()
store i32 %3, i32* %2
%4 = load i32, i32* %2
%5 = icmp ugt i32 %4, 1
%6 = zext i1 %5 to i32
%7 = call i32 @__VERIFIER_assert(i32 %6)
%8 = load i32, i32* %2
ret i32 %8
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_uint()
%2 = icmp ugt i32 %1, 1
%3 = zext i1 %2 to i32
%4 = tail call i32 @__VERIFIER_assert(i32 %3)
ret i32 %1
}
int DUMMY_SetColors(struct disppal_struct *d) { return (0); }


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

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

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

LLVM IR (-O2):
%struct.disppal_struct = type opaque
define i32 @DUMMY_SetColors(%struct.disppal_struct* nocapture readnone %0) {
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ va_list;

/* Variables and functions */
int vsnprintf(char *, size_t, char const *, int /*<<< orphan*/);
int fct_vsnprintf(char *buffer, size_t buffer_len, char const *format,
                  va_list args) {
  int count = 0;
  count = vsnprintf(buffer, buffer_len, format, args);
  return count;
}


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

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

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

LLVM IR (-O2):
define i32 @fct_vsnprintf(i8* nocapture %0, i64 %1, i8* nocapture %2, i32 %3) {
%5 = tail call i32 @vsnprintf(i8* %0, i64 %1, i8* %2, i32 %3)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ rsp_read_data(void *, unsigned long, int /*<<< orphan*/);
__attribute__((deprecated("use rsp_read_data instead"))) void
read_data(void *start, unsigned long size) {
  rsp_read_data(start, size, 0);
}


x86 assembly (clang, -O0):
<read_data>:
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    %edx,%edx
call   1030 <rsp_read_data@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @read_data(i8* %0, i64 %1) {
%3 = tail call i32 @rsp_read_data(i8* %0, i64 %1, i32 0)
ret void
}
int ishexdigit(char ch) {
  return ch >= '0' && ch <= '9' || ch >= 'A' && ch <= 'F';
}


x86 assembly (clang, -O0):
<ishexdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
cmp    $0x30,%eax
jl     1129 <ishexdigit+0x29>
movsbl -0x1(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x2(%rbp)
jle    114e <ishexdigit+0x4e>
movsbl -0x1(%rbp),%ecx
xor    %eax,%eax
cmp    $0x41,%ecx
mov    %al,-0x3(%rbp)
jl     1148 <ishexdigit+0x48>
movsbl -0x1(%rbp),%eax
cmp    $0x46,%eax
setle  %al
mov    %al,-0x3(%rbp)
mov    -0x3(%rbp),%al
mov    %al,-0x2(%rbp)
mov    -0x2(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ishexdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%al
setb   %al
add    $0xbf,%dil
cmp    $0x6,%dil
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @ishexdigit(i8 signext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = sext i8 %3 to i32
%5 = icmp sge i32 %4, 48
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = icmp sle i32 %8, 57
br i1 %9, label %20, label %10
10: ; preds = %6, %1
%11 = load i8, i8* %2
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 65
br i1 %13, label %14, label %18
14: ; preds = %10
%15 = load i8, i8* %2
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 70
br label %18
18: ; preds = %14, %10
%19 = phi i1 [ false, %10 ], [ %17, %14 ]
br label %20
20: ; preds = %18, %6
%21 = phi i1 [ true, %6 ], [ %19, %18 ]
%22 = zext i1 %21 to i32
ret i32 %22
}

LLVM IR (-O2):
define i32 @ishexdigit(i8 signext %0) {
%2 = add i8 %0, -48
%3 = icmp ult i8 %2, 10
%4 = add i8 %0, -65
%5 = icmp ult i8 %4, 6
%6 = or i1 %3, %5
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ HplAtm128GeneralIOPinP__8__IO__clr();
void CC2420ControlP__CSN__clr(void) { HplAtm128GeneralIOPinP__8__IO__clr(); }


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

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

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

LLVM IR (-O2):
define void @CC2420ControlP__CSN__clr() {
%1 = tail call i32 (...) @HplAtm128GeneralIOPinP__8__IO__clr()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void observer(char *msg) { printf("%s", msg); }


x86 assembly (clang, -O0):
<observer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<observer>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
define void @observer(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %3)
ret void
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
define void @observer(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ b();
int a(void) {
  b();
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @a() {
%1 = call i32 (...) @b()
ret i32 0
}

LLVM IR (-O2):
define i32 @a() {
%1 = tail call i32 (...) @b()
ret i32 0
}
int test_imm_1Duint64_midword_mem(unsigned long long *val) {
  return ((*val >> 16) & (0x1D << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_1Duint64_midword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = lshr i64 %4, 16
%6 = and i64 %5, 29
%7 = icmp ne i64 %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_1Duint64_midword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 1900544
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ milli_delay(int);
void test_a() {
  int i = 0;
  while (1) {
    milli_delay(1000);
  }
}


x86 assembly (clang, -O0):
<test_a>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x3e8,%edi
call   1030 <milli_delay@plt>
jmp    111f <test_a+0xf>

x86 assembly (clang, -O2):
<test_a>:
push   %rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    $0x3e8,%edi
call   1030 <milli_delay@plt>
jmp    1120 <test_a+0x10>

LLVM IR (-O0):
define void @test_a() {
%1 = alloca i32
store i32 0, i32* %1
br label %2
2: ; preds = %0, %2
%3 = call i32 @milli_delay(i32 1000)
br label %2
}

LLVM IR (-O2):
define void @test_a() {
br label %1
1: ; preds = %1, %0
%2 = tail call i32 @milli_delay(i32 1000)
br label %1
}
/* Variables and functions */
int /*<<< orphan*/ posix_binary_file_delete(char *);
void ext_configuration_delete() {
  posix_binary_file_delete("kaa_configuration.bin");
}


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

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

LLVM IR (-O0):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = call i32 @posix_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"kaa_configuration.bin\00"
define void @ext_configuration_delete() {
%1 = tail call i32 @posix_binary_file_delete(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
ret void
}
struct ListNode *removeNodeByStud(struct ListNode *head,
                                  struct Studente *stud) {
  return head;
}


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

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

LLVM IR (-O0):
%struct.ListNode = type opaque
%struct.Studente = type opaque
define %struct.ListNode* @removeNodeByStud(%struct.ListNode* %0, %struct.Studente* %1) {
%3 = alloca %struct.ListNode*
%4 = alloca %struct.Studente*
store %struct.ListNode* %0, %struct.ListNode** %3
store %struct.Studente* %1, %struct.Studente** %4
%5 = load %struct.ListNode*, %struct.ListNode** %3
ret %struct.ListNode* %5
}

LLVM IR (-O2):
%struct.ListNode = type opaque
%struct.Studente = type opaque
define %struct.ListNode* @removeNodeByStud(%struct.ListNode* readnone returned %0, %struct.Studente* nocapture readnone %1) {
ret %struct.ListNode* %0
}
double biggest(double a[]) {
  double c = a[0];
  for (int i = 1; i < 4; i++) {
    while (a[i] > c) {
      c = a[i];
    }
  }
  return c;
}


x86 assembly (clang, -O0):
<biggest>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x4,-0x14(%rbp)
jge    116d <biggest+0x6d>
jmp    112b <biggest+0x2b>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
ucomisd -0x10(%rbp),%xmm0
jbe    115a <biggest+0x5a>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x10(%rbp)
jmp    112b <biggest+0x2b>
jmp    115f <biggest+0x5f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    111c <biggest+0x1c>
movsd  -0x10(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<biggest>:
movsd  0x8(%rdi),%xmm0
maxsd  (%rdi),%xmm0
movsd  0x10(%rdi),%xmm1
maxsd  %xmm0,%xmm1
movsd  0x18(%rdi),%xmm0
maxsd  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define double @biggest(double* nocapture %0) {
%2 = load double, double* %0
%3 = getelementptr inbounds double, double* %0, i64 1
%4 = load double, double* %3
%5 = fcmp ogt double %4, %2
%6 = select i1 %5, double %4, double %2
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fcmp ogt double %8, %6
%10 = select i1 %9, double %8, double %6
%11 = getelementptr inbounds double, double* %0, i64 3
%12 = load double, double* %11
%13 = fcmp ogt double %12, %10
%14 = select i1 %13, double %12, double %10
ret double %14
}
/* Type definitions */
struct btf_type {
  int dummy;
};
typedef scalar_t__ __u16;

/* Variables and functions */
scalar_t__ BTF_KIND_CONST;
scalar_t__ BTF_KIND_RESTRICT;
scalar_t__ BTF_KIND_VOLATILE;
scalar_t__ btf_kind(struct btf_type const *);
bool btf_is_mod(const struct btf_type *t) {
  __u16 kind = btf_kind(t);
  return kind == BTF_KIND_VOLATILE || kind == BTF_KIND_CONST ||
         kind == BTF_KIND_RESTRICT;
}


x86 assembly (clang, -O0):
<btf_is_mod>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <btf_kind@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
mov    0x2eb2(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
je     116f <btf_is_mod+0x5f>
mov    -0x10(%rbp),%rcx
mov    $0x1,%al
mov    0x2e91(%rip),%rdx
cmp    (%rdx),%rcx
mov    %al,-0x11(%rbp)
je     116f <btf_is_mod+0x5f>
mov    -0x10(%rbp),%rax
mov    0x2e6a(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<btf_is_mod>:
push   %rax
call   1030 <btf_kind@plt>
mov    0x2ecb(%rip),%rcx
cmp    (%rcx),%rax
sete   %cl
mov    0x2eb6(%rip),%rdx
cmp    (%rdx),%rax
sete   %dl
or     %cl,%dl
mov    0x2e97(%rip),%rcx
cmp    (%rcx),%rax
sete   %al
or     %dl,%al
movzbl %al,%eax
pop    %rcx
ret

LLVM IR (-O0):
%struct.btf_type = type { i32 }
@BTF_KIND_VOLATILE = global i64 0
@BTF_KIND_CONST = global i64 0
@BTF_KIND_RESTRICT = global i64 0
define i32 @btf_is_mod(%struct.btf_type* %0) {
%2 = alloca %struct.btf_type*
%3 = alloca i64
store %struct.btf_type* %0, %struct.btf_type** %2
%4 = load %struct.btf_type*, %struct.btf_type** %2
%5 = call i64 @btf_kind(%struct.btf_type* %4)
store i64 %5, i64* %3
%6 = load i64, i64* %3
%7 = load i64, i64* @BTF_KIND_VOLATILE
%8 = icmp eq i64 %6, %7
br i1 %8, label %17, label %9
9: ; preds = %1
%10 = load i64, i64* %3
%11 = load i64, i64* @BTF_KIND_CONST
%12 = icmp eq i64 %10, %11
br i1 %12, label %17, label %13
13: ; preds = %9
%14 = load i64, i64* %3
%15 = load i64, i64* @BTF_KIND_RESTRICT
%16 = icmp eq i64 %14, %15
br label %17
17: ; preds = %13, %9, %1
%18 = phi i1 [ true, %9 ], [ true, %1 ], [ %16, %13 ]
%19 = zext i1 %18 to i32
ret i32 %19
}

LLVM IR (-O2):
%struct.btf_type = type { i32 }
@BTF_KIND_VOLATILE = global i64 0
@BTF_KIND_CONST = global i64 0
@BTF_KIND_RESTRICT = global i64 0
define i32 @btf_is_mod(%struct.btf_type* %0) {
%2 = tail call i64 @btf_kind(%struct.btf_type* %0)
%3 = load i64, i64* @BTF_KIND_VOLATILE
%4 = icmp eq i64 %2, %3
%5 = load i64, i64* @BTF_KIND_CONST
%6 = icmp eq i64 %2, %5
%7 = select i1 %4, i1 true, i1 %6
%8 = load i64, i64* @BTF_KIND_RESTRICT
%9 = icmp eq i64 %2, %8
%10 = select i1 %7, i1 true, i1 %9
%11 = zext i1 %10 to i32
ret i32 %11
}
/* Variables and functions */
int io_con_put_char(char);
int con_put_char(char ch) { return io_con_put_char(ch); }


x86 assembly (clang, -O0):
<con_put_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%edi
call   1030 <io_con_put_char@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<con_put_char>:
jmp    1030 <io_con_put_char@plt>

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

LLVM IR (-O2):
define i32 @con_put_char(i8 signext %0) {
%2 = tail call i32 @io_con_put_char(i8 signext %0)
ret i32 %2
}
/* Type definitions */
typedef int /*<<< orphan*/ uint8_t;

/* Variables and functions */
int /*<<< orphan*/ tr_binary_to_hex(int /*<<< orphan*/ const *, char *, int);
void tr_sha1_to_hex(char *hex, const uint8_t *sha1) {
  tr_binary_to_hex(sha1, hex, 20);
}


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

x86 assembly (clang, -O2):
<tr_sha1_to_hex>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
mov    $0x14,%edx
jmp    1030 <tr_binary_to_hex@plt>

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

LLVM IR (-O2):
define void @tr_sha1_to_hex(i8* %0, i32* %1) {
%3 = tail call i32 @tr_binary_to_hex(i32* %1, i8* %0, i32 20)
ret void
}
/* Type definitions */
typedef int int64_t;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
float stdlib_strided_srange(int, float *, int);
int main() {
  float x[] = {1.0, -2.0, -3.0, 4.0, -5.0, -6.0, 7.0, 8.0};
  int64_t N = 4;
  int64_t stride = 2;
  float v = stdlib_strided_srange(N, x, stride);
  printf("range: %f\n", v);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0xed1(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xece(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xecb(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec8(%rip),%rax
mov    %rax,-0x8(%rbp)
movl   $0x4,-0x24(%rbp)
movl   $0x2,-0x28(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%edx
call   1040 <stdlib_strided_srange@plt>
movss  %xmm0,-0x2c(%rbp)
movss  -0x2c(%rbp),%xmm0
lea    0xe9e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xec9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0x4,%edi
mov    $0x2,%edx
call   1040 <stdlib_strided_srange@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.x = [8 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [11 x i8] c"range: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = bitcast [8 x float]* %1 to i8*
store i32 4, i32* %2
store i32 2, i32* %3
%6 = load i32, i32* %2
%7 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%8 = load i32, i32* %3
%9 = call float @stdlib_strided_srange(i32 %6, float* %7, i32 %8)
store float %9, float* %4
%10 = load float, float* %4
%11 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.x = [8 x float] [float 1.000000e+00, float -2.000000e+00, float -3.000000e+00, float 4.000000e+00, float -5.000000e+00, float -6.000000e+00, float 7.000000e+00, float 8.000000e+00]
@.str = [11 x i8] c"range: %f\0A\00"
define i32 @main() {
%1 = alloca [8 x float]
%2 = bitcast [8 x float]* %1 to i8*
%3 = getelementptr inbounds [8 x float], [8 x float]* %1, i64 0, i64 0
%4 = call float @stdlib_strided_srange(i32 4, float* %3, i32 2)
%5 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %4)
ret i32 0
}
/* Variables and functions */
char *app_usb_mpoint_return(unsigned short);
char *Usb_mpoint(unsigned short index) { return app_usb_mpoint_return(index); }


x86 assembly (clang, -O0):
<Usb_mpoint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edi
call   1030 <app_usb_mpoint_return@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Usb_mpoint>:
jmp    1030 <app_usb_mpoint_return@plt>

LLVM IR (-O0):
define i8* @Usb_mpoint(i16 zeroext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
%4 = call i8* @app_usb_mpoint_return(i16 zeroext %3)
ret i8* %4
}

LLVM IR (-O2):
define i8* @Usb_mpoint(i16 zeroext %0) {
%2 = tail call i8* @app_usb_mpoint_return(i16 zeroext %0)
ret i8* %2
}