xunge/DecIR huggingface dataset:
int atoi(char *str) {
  int res = 0;
  for (int i = 0; str[i] != '\0'; ++i) {
    res = res * 10 + str[i] - '0';
  }
  return res;
}


x86 assembly (clang, -O0):
<atoi>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1151 <atoi+0x51>
imul   $0xa,-0xc(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movsbl (%rcx,%rdx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1116 <atoi+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<atoi>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <atoi+0x28>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
lea    (%rax,%rax,4),%eax
lea    (%rcx,%rax,2),%eax
add    $0xffffffd0,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <atoi+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @atoi(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %4, label %6
4: ; preds = %6, %1
%5 = phi i32 [ 0, %1 ], [ %13, %6 ]
ret i32 %5
6: ; preds = %1, %6
%7 = phi i64 [ %14, %6 ], [ 0, %1 ]
%8 = phi i8 [ %16, %6 ], [ %2, %1 ]
%9 = phi i32 [ %13, %6 ], [ 0, %1 ]
%10 = sext i8 %8 to i32
%11 = mul nsw i32 %9, 10
%12 = add i32 %11, -48
%13 = add i32 %12, %10
%14 = add nuw nsw i64 %7, 1
%15 = getelementptr inbounds i8, i8* %0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %4, label %6
}
/* Variables and functions */
int /*<<< orphan*/ remover(long long *, long long);
void decrease(long long int index, long long int change, long long int A[]) {
  A[index] -= change;
  remover(A, index);
}


x86 assembly (clang, -O0):
<decrease>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
mov    (%rax,%rcx,8),%rdx
sub    %rsi,%rdx
mov    %rdx,(%rax,%rcx,8)
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <remover@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decrease>:
mov    %rdi,%rax
sub    %rsi,(%rdx,%rdi,8)
mov    %rdx,%rdi
mov    %rax,%rsi
jmp    1030 <remover@plt>

LLVM IR (-O0):
define void @decrease(i64 %0, i64 %1, i64* %2) {
%4 = alloca i64
%5 = alloca i64
%6 = alloca i64*
store i64 %0, i64* %4
store i64 %1, i64* %5
store i64* %2, i64** %6
%7 = load i64, i64* %5
%8 = load i64*, i64** %6
%9 = load i64, i64* %4
%10 = getelementptr inbounds i64, i64* %8, i64 %9
%11 = load i64, i64* %10
%12 = sub nsw i64 %11, %7
store i64 %12, i64* %10
%13 = load i64*, i64** %6
%14 = load i64, i64* %4
%15 = call i32 @remover(i64* %13, i64 %14)
ret void
}

LLVM IR (-O2):
define void @decrease(i64 %0, i64 %1, i64* %2) {
%4 = getelementptr inbounds i64, i64* %2, i64 %0
%5 = load i64, i64* %4
%6 = sub nsw i64 %5, %1
store i64 %6, i64* %4
%7 = tail call i32 @remover(i64* %2, i64 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ abort();
double random_u16();
int random_range(int low, int high) {
  int range = high - low;
  if (range > 32767) {
    abort();
  }
  return low + (int)((random_u16() / 65536.0) * range);
}


x86 assembly (clang, -O0):
<random_range>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
cmpl   $0x7fff,-0xc(%rbp)
jle    114b <random_range+0x2b>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x4(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <random_u16@plt>
mov    -0x10(%rbp),%eax
movsd  0xe9d(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2sdl -0xc(%rbp),%xmm1
mulsd  %xmm1,%xmm0
cvttsd2si %xmm0,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_range>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
sub    %edi,%ebp
cmp    $0x8000,%ebp
jge    1155 <random_range+0x35>
mov    %edi,%ebx
xor    %eax,%eax
call   1040 <random_u16@plt>
mulsd  0xec0(%rip),%xmm0
cvtsi2sd %ebp,%xmm1
mulsd  %xmm0,%xmm1
cvttsd2si %xmm1,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
xor    %eax,%eax
call   1030 <abort@plt>

LLVM IR (-O0):
define i32 @random_range(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = icmp sgt i32 %9, 32767
br i1 %10, label %11, label %13
11: ; preds = %2
%12 = call i32 (...) @abort()
unreachable
13: ; preds = %2
%14 = load i32, i32* %3
%15 = call double (...) @random_u16()
%16 = fdiv double %15, 6.553600e+04
%17 = load i32, i32* %5
%18 = sitofp i32 %17 to double
%19 = fmul double %16, %18
%20 = fptosi double %19 to i32
%21 = add nsw i32 %14, %20
ret i32 %21
}

LLVM IR (-O2):
define i32 @random_range(i32 %0, i32 %1) {
%3 = sub nsw i32 %1, %0
%4 = icmp sgt i32 %3, 32767
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 (...) @abort()
unreachable
7: ; preds = %2
%8 = tail call double (...) @random_u16()
%9 = fmul double %8, 0x3EF0000000000000
%10 = sitofp i32 %3 to double
%11 = fmul double %9, %10
%12 = fptosi double %11 to i32
%13 = add nsw i32 %12, %0
ret i32 %13
}
compare(a, b) char **a, **b;
{ return (wordcomp(*a, *b)); }


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

x86 assembly (clang, -O2):
<compare>:
mov    (%rdi),%rdi
mov    (%rsi),%rsi
xor    %eax,%eax
jmp    1030 <wordcomp@plt>

LLVM IR (-O0):
define i32 @compare(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** %5
%7 = load i8**, i8*** %4
%8 = load i8*, i8** %7
%9 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wordcomp to i32 (i8*, i8*, ...)*)(i8* %6, i8* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @compare(i8** nocapture %0, i8** nocapture %1) {
%3 = load i8*, i8** %0
%4 = load i8*, i8** %1
%5 = tail call i32 (i8*, i8*, ...) bitcast (i32 (...)* @wordcomp to i32 (i8*, i8*, ...)*)(i8* %3, i8* %4)
ret i32 %5
}
/* Type definitions */
struct timespec {
  int tv_sec;
  scalar_t__ tv_nsec;
};
typedef scalar_t__ int64_t;

/* Variables and functions */
int64_t time_diff(struct timespec *lhs, struct timespec *rhs) {
  return (lhs->tv_sec - rhs->tv_sec) * 1000000000 +
         (lhs->tv_nsec - rhs->tv_nsec);
}


x86 assembly (clang, -O0):
<time_diff>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    -0x10(%rbp),%rcx
sub    (%rcx),%eax
imul   $0x3b9aca00,%eax,%eax
cltq
mov    -0x8(%rbp),%rcx
mov    0x8(%rcx),%rcx
mov    -0x10(%rbp),%rdx
sub    0x8(%rdx),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<time_diff>:
movslq (%rdi),%rax
movslq (%rsi),%rcx
sub    %rcx,%rax
imul   $0x3b9aca00,%rax,%rcx
mov    0x8(%rdi),%rax
sub    0x8(%rsi),%rax
add    %rcx,%rax
ret

LLVM IR (-O0):
%struct.timespec = type { i32, i64 }
define i64 @time_diff(%struct.timespec* %0, %struct.timespec* %1) {
%3 = alloca %struct.timespec*
%4 = alloca %struct.timespec*
store %struct.timespec* %0, %struct.timespec** %3
store %struct.timespec* %1, %struct.timespec** %4
%5 = load %struct.timespec*, %struct.timespec** %3
%6 = getelementptr inbounds %struct.timespec, %struct.timespec* %5, i32 0, i32 0
%7 = load i32, i32* %6
%8 = load %struct.timespec*, %struct.timespec** %4
%9 = getelementptr inbounds %struct.timespec, %struct.timespec* %8, i32 0, i32 0
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
%12 = mul nsw i32 %11, 1000000000
%13 = sext i32 %12 to i64
%14 = load %struct.timespec*, %struct.timespec** %3
%15 = getelementptr inbounds %struct.timespec, %struct.timespec* %14, i32 0, i32 1
%16 = load i64, i64* %15
%17 = load %struct.timespec*, %struct.timespec** %4
%18 = getelementptr inbounds %struct.timespec, %struct.timespec* %17, i32 0, i32 1
%19 = load i64, i64* %18
%20 = sub nsw i64 %16, %19
%21 = add nsw i64 %13, %20
ret i64 %21
}

LLVM IR (-O2):
%struct.timespec = type { i32, i64 }
define i64 @time_diff(%struct.timespec* nocapture %0, %struct.timespec* nocapture %1) {
%3 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 0
%4 = load i32, i32* %3
%5 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 0
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
%8 = mul nsw i32 %7, 1000000000
%9 = sext i32 %8 to i64
%10 = getelementptr inbounds %struct.timespec, %struct.timespec* %0, i64 0, i32 1
%11 = load i64, i64* %10
%12 = getelementptr inbounds %struct.timespec, %struct.timespec* %1, i64 0, i32 1
%13 = load i64, i64* %12
%14 = sub i64 %11, %13
%15 = add nsw i64 %14, %9
ret i64 %15
}
__attribute__((weak)) void __reset_handler_hook(void) {}


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

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

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

LLVM IR (-O2):
define weak void @__reset_handler_hook() {
ret void
}
void VP8DspInitNEON(void) {}


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

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

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

LLVM IR (-O2):
define void @VP8DspInitNEON() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ date_get_now_date_yyyy_mm_dd(int);
char *timlib_yyyymmdd_to_oracle_format(int /*<<< orphan*/);
char *date_get_now_date_oracle_format(int utc_offset) {
  char *oracle_format;
  oracle_format = timlib_yyyymmdd_to_oracle_format(
      date_get_now_date_yyyy_mm_dd(utc_offset));
  return oracle_format;
}


x86 assembly (clang, -O0):
<date_get_now_date_oracle_format>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <date_get_now_date_yyyy_mm_dd@plt>
mov    %eax,%edi
call   1040 <timlib_yyyymmdd_to_oracle_format@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<date_get_now_date_oracle_format>:
push   %rax
call   1030 <date_get_now_date_yyyy_mm_dd@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <timlib_yyyymmdd_to_oracle_format@plt>

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

LLVM IR (-O2):
define i8* @date_get_now_date_oracle_format(i32 %0) {
%2 = tail call i32 @date_get_now_date_yyyy_mm_dd(i32 %0)
%3 = tail call i8* @timlib_yyyymmdd_to_oracle_format(i32 %2)
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ hsv_to_rgb_floats(float *, float *);
int hsv2rgb(float *y, float *x, int n) {
  assert(n == 3);
  hsv_to_rgb_floats(y, x);
  return 3;
}


x86 assembly (clang, -O0):
<hsv2rgb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
cmpl   $0x3,-0x14(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <hsv_to_rgb_floats@plt>
mov    $0x3,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hsv2rgb>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %edi,%edi
cmp    $0x3,%edx
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <hsv_to_rgb_floats@plt>
mov    $0x3,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i32 @hsv2rgb(float* %0, float* %1, i32 %2) {
%4 = alloca float*
%5 = alloca float*
%6 = alloca i32
store float* %0, float** %4
store float* %1, float** %5
store i32 %2, i32* %6
%7 = load i32, i32* %6
%8 = icmp eq i32 %7, 3
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = load float*, float** %4
%12 = load float*, float** %5
%13 = call i32 @hsv_to_rgb_floats(float* %11, float* %12)
ret i32 3
}

LLVM IR (-O2):
define i32 @hsv2rgb(float* %0, float* %1, i32 %2) {
%4 = icmp eq i32 %2, 3
%5 = zext i1 %4 to i32
%6 = tail call i32 @assert(i32 %5)
%7 = tail call i32 @hsv_to_rgb_floats(float* %0, float* %1)
ret i32 3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void faire_combi(char *str, char *tmp, int len, int ind) {
  int i;
  if (ind >= len)
    printf("%s\n", tmp);
  return;
  for (i = 0; i < len; i++) {
    if (str[i] == -1)
      continue;
    tmp[ind] = str[i];
    str[i] = -1;
    faire_combi(str, tmp, len, ind + 1);
    str[i] = tmp[ind];
  }
}


x86 assembly (clang, -O0):
<faire_combi>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jl     1142 <faire_combi+0x32>
mov    -0x10(%rbp),%rsi
lea    0xec3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<faire_combi>:
cmp    %edx,%ecx
jge    1115 <faire_combi+0x5>
ret
lea    0xee4(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define void @faire_combi(i8* nocapture readnone %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp slt i32 %3, %2
br i1 %5, label %8, label %6
6: ; preds = %4
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %1)
br label %8
8: ; preds = %6, %4
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_flist_push() {
  printf("NOT IMPLEMENTED:"
         "pa_flist_push"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [30 x i8] c"NOT IMPLEMENTED:pa_flist_push\00"
define i32 @pa_flist_push() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
void CEq(const volatile void *e1, const volatile void *e2, const char *why,
         const char *text, const char *file, int line, const char *func) {
  if (!(e1 == e2) || 0) {
    deputy_fail_mayreturn(why, text, file, line, func);
  };
}


x86 assembly (clang, -O0):
<CEq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9d,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
je     115c <CEq+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
mov    -0x2c(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    $0x0,%al
call   1030 <deputy_fail_mayreturn@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CEq>:
cmp    %rsi,%rdi
je     1130 <CEq+0x20>
mov    0x8(%rsp),%rax
mov    %rdx,%rdi
mov    %rcx,%rsi
mov    %r8,%rdx
mov    %r9d,%ecx
mov    %rax,%r8
xor    %eax,%eax
jmp    1030 <deputy_fail_mayreturn@plt>
ret

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

LLVM IR (-O2):
define void @CEq(i8* readnone %0, i8* readnone %1, i8* %2, i8* %3, i8* %4, i32 %5, i8* %6) {
%8 = icmp eq i8* %0, %1
br i1 %8, label %11, label %9
9: ; preds = %7
%10 = tail call i32 (i8*, i8*, i8*, i32, i8*, ...) bitcast (i32 (...)* @deputy_fail_mayreturn to i32 (i8*, i8*, i8*, i32, i8*, ...)*)(i8* %2, i8* %3, i8* %4, i32 %5, i8* %6)
br label %11
11: ; preds = %9, %7
ret void
}
/* Variables and functions */
int domain_to_first_cpu(int);
int cluster_to_first_cpu(int cluster, int cluster_size) {
  return domain_to_first_cpu(cluster);
}


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

x86 assembly (clang, -O2):
<cluster_to_first_cpu>:
jmp    1030 <domain_to_first_cpu@plt>

LLVM IR (-O0):
define i32 @cluster_to_first_cpu(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 = call i32 @domain_to_first_cpu(i32 %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @cluster_to_first_cpu(i32 %0, i32 %1) {
%3 = tail call i32 @domain_to_first_cpu(i32 %0)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, ...);
void succ(int *array, int elem) {
  printf("Element %d is %d \n", elem, array[elem]);
  printf("Succ element is %d \n", array[elem + 1]);
}


x86 assembly (clang, -O0):
<succ>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xecc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%rax
mov    -0xc(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
lea    0xec1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<succ>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
movslq %esi,%rbx
mov    (%rdi,%rbx,4),%edx
lea    0xedc(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x4(%r14,%rbx,4),%esi
lea    0xeda(%rip),%rdi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [19 x i8] c"Element %d is %d \0A\00"
@.str.1 = [21 x i8] c"Succ element is %d \0A\00"
define void @succ(i32* nocapture %0, i32 %1) {
%3 = sext i32 %1 to i64
%4 = getelementptr inbounds i32, i32* %0, i64 %3
%5 = load i32, i32* %4
%6 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %1, i32 %5)
%7 = add nsw i32 %1, 1
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i32, i32* %0, i64 %8
%10 = load i32, i32* %9
%11 = tail call i32 (i8*, i32, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), i32 %10)
ret void
}
void test_v2df(double *__restrict__ p, double *__restrict q) {
  p[0] = p[0] - q[0];
  p[1] = p[1] + q[1];
}


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

x86 assembly (clang, -O2):
<test_v2df>:
movupd (%rdi),%xmm0
movupd (%rsi),%xmm1
movapd %xmm0,%xmm2
subpd  %xmm1,%xmm2
addpd  %xmm1,%xmm0
movsd  %xmm2,%xmm0
movupd %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @test_v2df(double* noalias %0, double* noalias %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = getelementptr inbounds double, double* %5, i64 0
%7 = load double, double* %6
%8 = load double*, double** %4
%9 = getelementptr inbounds double, double* %8, i64 0
%10 = load double, double* %9
%11 = fsub double %7, %10
%12 = load double*, double** %3
%13 = getelementptr inbounds double, double* %12, i64 0
store double %11, double* %13
%14 = load double*, double** %3
%15 = getelementptr inbounds double, double* %14, i64 1
%16 = load double, double* %15
%17 = load double*, double** %4
%18 = getelementptr inbounds double, double* %17, i64 1
%19 = load double, double* %18
%20 = fadd double %16, %19
%21 = load double*, double** %3
%22 = getelementptr inbounds double, double* %21, i64 1
store double %20, double* %22
ret void
}

LLVM IR (-O2):
define void @test_v2df(double* noalias nocapture %0, double* noalias nocapture %1) {
%3 = bitcast double* %0 to <2 x double>*
%4 = load <2 x double>, <2 x double>* %3
%5 = bitcast double* %1 to <2 x double>*
%6 = load <2 x double>, <2 x double>* %5
%7 = fsub <2 x double> %4, %6
%8 = fadd <2 x double> %4, %6
%9 = shufflevector <2 x double> %7, <2 x double> %8, <2 x i32> <i32 0, i32 3>
%10 = bitcast double* %0 to <2 x double>*
store <2 x double> %9, <2 x double>* %10
ret void
}
double BAirplane(double b) {
  return 4 * b * b * b - 12 * b + 6 * 1.0 - 1.0 * 1.0 * 1.0;
}


x86 assembly (clang, -O0):
<BAirplane>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  0xf07(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  -0x8(%rbp),%xmm2
movsd  0xee8(%rip),%xmm1
mulsd  -0x8(%rbp),%xmm1
movq   %xmm1,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm1
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  0xeb4(%rip),%xmm1
addsd  %xmm1,%xmm0
movsd  0xea0(%rip),%xmm1
subsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<BAirplane>:
movsd  0xef8(%rip),%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
mulsd  0xeec(%rip),%xmm0
addsd  %xmm1,%xmm0
addsd  0xee8(%rip),%xmm0
addsd  0xee8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @BAirplane(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = fmul double 4.000000e+00, %3
%5 = load double, double* %2
%6 = fmul double %4, %5
%7 = load double, double* %2
%8 = load double, double* %2
%9 = fmul double 1.200000e+01, %8
%10 = fneg double %9
%11 = call double @llvm.fmuladd.f64(double %6, double %7, double %10)
%12 = fadd double %11, 6.000000e+00
%13 = fsub double %12, 1.000000e+00
ret double %13
}

LLVM IR (-O2):
define double @BAirplane(double %0) {
%2 = fmul double %0, 4.000000e+00
%3 = fmul double %2, %0
%4 = fmul double %0, -1.200000e+01
%5 = tail call double @llvm.fmuladd.f64(double %3, double %0, double %4)
%6 = fadd double %5, 6.000000e+00
%7 = fadd double %6, -1.000000e+00
ret double %7
}
/* Type definitions */
struct notifier_block {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ outb_p(unsigned char, unsigned int);
int ibwdt_notify_sys(struct notifier_block *this, unsigned long code,
                     void *unused) {
  {
    if (code == 1UL) {
      outb_p((unsigned char)0, 1089U);
    } else if (code == 2UL) {
      outb_p((unsigned char)0, 1089U);
    }
    return (0);
  }
}


x86 assembly (clang, -O0):
<ibwdt_notify_sys>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jne    1140 <ibwdt_notify_sys+0x30>
xor    %edi,%edi
mov    $0x441,%esi
call   1030 <outb_p@plt>
jmp    115c <ibwdt_notify_sys+0x4c>
cmpq   $0x2,-0x10(%rbp)
jne    1157 <ibwdt_notify_sys+0x47>
xor    %edi,%edi
mov    $0x441,%esi
call   1030 <outb_p@plt>
jmp    115c <ibwdt_notify_sys+0x4c>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ibwdt_notify_sys>:
add    $0xffffffffffffffff,%rsi
cmp    $0x1,%rsi
ja     112b <ibwdt_notify_sys+0x1b>
push   %rax
xor    %edi,%edi
mov    $0x441,%esi
call   1030 <outb_p@plt>
add    $0x8,%rsp
xor    %eax,%eax
ret

LLVM IR (-O0):
%struct.notifier_block = type { i32 }
define i32 @ibwdt_notify_sys(%struct.notifier_block* %0, i64 %1, i8* %2) {
%4 = alloca %struct.notifier_block*
%5 = alloca i64
%6 = alloca i8*
store %struct.notifier_block* %0, %struct.notifier_block** %4
store i64 %1, i64* %5
store i8* %2, i8** %6
%7 = load i64, i64* %5
%8 = icmp eq i64 %7, 1
br i1 %8, label %9, label %11
9: ; preds = %3
%10 = call i32 @outb_p(i8 zeroext 0, i32 1089)
br label %17
11: ; preds = %3
%12 = load i64, i64* %5
%13 = icmp eq i64 %12, 2
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = call i32 @outb_p(i8 zeroext 0, i32 1089)
br label %16
16: ; preds = %14, %11
br label %17
17: ; preds = %16, %9
ret i32 0
}

LLVM IR (-O2):
%struct.notifier_block = type { i32 }
define i32 @ibwdt_notify_sys(%struct.notifier_block* nocapture readnone %0, i64 %1, i8* nocapture readnone %2) {
%4 = add i64 %1, -1
%5 = icmp ult i64 %4, 2
br i1 %5, label %6, label %8
6: ; preds = %3
%7 = tail call i32 @outb_p(i8 zeroext 0, i32 1089)
br label %8
8: ; preds = %3, %6
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ is_multicast_ether_addr(void const *);
int /*<<< orphan*/ is_zero_ether_addr(void const *);
int is_valid_ether_addr(const void *addr) {
  return !is_multicast_ether_addr(addr) && !is_zero_ether_addr(addr);
}


x86 assembly (clang, -O0):
<is_valid_ether_addr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <is_multicast_ether_addr@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
jne    1159 <is_valid_ether_addr+0x39>
mov    -0x8(%rbp),%rdi
call   1040 <is_zero_ether_addr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_valid_ether_addr>:
push   %rbx
mov    %rdi,%rbx
call   1030 <is_multicast_ether_addr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
je     1133 <is_valid_ether_addr+0x13>
pop    %rbx
ret
mov    %rbx,%rdi
call   1040 <is_zero_ether_addr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
sete   %al
pop    %rbx
ret

LLVM IR (-O0):
define i32 @is_valid_ether_addr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @is_multicast_ether_addr(i8* %3)
%5 = icmp ne i32 %4, 0
br i1 %5, label %11, label %6
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @is_zero_ether_addr(i8* %7)
%9 = icmp ne i32 %8, 0
%10 = xor i1 %9, true
br label %11
11: ; preds = %6, %1
%12 = phi i1 [ false, %1 ], [ %10, %6 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @is_valid_ether_addr(i8* %0) {
%2 = tail call i32 @is_multicast_ether_addr(i8* %0)
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = tail call i32 @is_zero_ether_addr(i8* %0)
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
br label %8
8: ; preds = %4, %1
%9 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %9
}
/* Variables and functions */
void *malloc(size_t);
int /*<<< orphan*/ memfatal(char *, size_t);
void *xmalloc(size_t size) {
  void *ptr = malloc(size);
  if (!ptr)
    memfatal("malloc", size);
  return ptr;
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <xmalloc+0x34>
mov    -0x8(%rbp),%rsi
lea    0xeb1(%rip),%rdi
call   1030 <memfatal@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xmalloc>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <malloc@plt>
mov    %rax,%rbx
test   %rax,%rax
jne    1143 <xmalloc+0x23>
lea    0xec5(%rip),%rdi
mov    %r14,%rsi
call   1030 <memfatal@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [7 x i8] c"malloc\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %11, label %8
8: ; preds = %1
%9 = load i64, i64* %2
%10 = call i32 @memfatal(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %9)
br label %11
11: ; preds = %8, %1
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
@.str = [7 x i8] c"malloc\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %6
4: ; preds = %1
%5 = tail call i32 @memfatal(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i64 %0)
br label %6
6: ; preds = %4, %1
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf_verbose(char *);
void *pa_simple_new(void) {
  printf_verbose("pa_simple_new(...) = BLOCKED;");
  return NULL;
}


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

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

LLVM IR (-O0):
@.str = [30 x i8] c"pa_simple_new(...) = BLOCKED;\00"
define i8* @pa_simple_new() {
%1 = call i32 @printf_verbose(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i8* null
}

LLVM IR (-O2):
@.str = [30 x i8] c"pa_simple_new(...) = BLOCKED;\00"
define noalias i8* @pa_simple_new() {
%1 = tail call i32 @printf_verbose(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0))
ret i8* null
}
/* Variables and functions */
int /*<<< orphan*/ HplMsp430GeneralIOP__30__IO__set();
void Msp430GpioC__4__HplGeneralIO__set(void) {
  HplMsp430GeneralIOP__30__IO__set();
}


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

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

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

LLVM IR (-O2):
define void @Msp430GpioC__4__HplGeneralIO__set() {
%1 = tail call i32 (...) @HplMsp430GeneralIOP__30__IO__set()
ret void
}
long long smax2(long long a, long long b) { return a ^ ((a ^ b) & -(a <= b)); }


x86 assembly (clang, -O0):
<smax2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x8(%rbp),%rcx
xor    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%rdx
cmp    -0x10(%rbp),%rdx
setle  %dl
and    $0x1,%dl
movzbl %dl,%esi
xor    %edx,%edx
sub    %esi,%edx
movslq %edx,%rdx
and    %rdx,%rcx
xor    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<smax2>:
mov    %rsi,%rax
cmp    %rsi,%rdi
cmovg  %rdi,%rax
ret

LLVM IR (-O0):
define i64 @smax2(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* %3
%7 = load i64, i64* %4
%8 = xor i64 %6, %7
%9 = load i64, i64* %3
%10 = load i64, i64* %4
%11 = icmp sle i64 %9, %10
%12 = zext i1 %11 to i32
%13 = sub nsw i32 0, %12
%14 = sext i32 %13 to i64
%15 = and i64 %8, %14
%16 = xor i64 %5, %15
ret i64 %16
}

LLVM IR (-O2):
define i64 @smax2(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isupper(int);
void t_isupper_0x9b() {
  Assert_real((isupper(155) == 0),
              "/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_isupper.c",
              780, ("isupper should be 0 for 0x9b"));
}


x86 assembly (clang, -O0):
<t_isupper_0x9b>:
push   %rbp
mov    %rsp,%rbp
mov    $0x9b,%edi
call   1030 <isupper@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
lea    0xebf(%rip),%rsi
mov    $0x30c,%edx
lea    0xf5b(%rip),%rcx
call   1040 <Assert_real@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<t_isupper_0x9b>:
push   %rax
mov    $0x9b,%edi
call   1030 <isupper@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x30c,%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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9b\00"
define void @t_isupper_0x9b() {
%1 = call i64 @isupper(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([29 x i8], [29 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_isupper.c\00"
@.str.1 = [29 x i8] c"isupper should be 0 for 0x9b\00"
define void @t_isupper_0x9b() {
%1 = tail call i64 @isupper(i32 155)
%2 = icmp eq i64 %1, 0
%3 = zext i1 %2 to i32
%4 = tail call i32 @Assert_real(i32 %3, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 780, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
double cbrt(double);
double radius_from_volume(double radius_polar, double radius_equatorial) {
  return cbrt(radius_polar * radius_equatorial * radius_equatorial);
}


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

x86 assembly (clang, -O2):
<radius_from_volume>:
mulsd  %xmm1,%xmm0
mulsd  %xmm1,%xmm0
jmp    1030 <cbrt@plt>

LLVM IR (-O0):
define double @radius_from_volume(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %3
%6 = load double, double* %4
%7 = fmul double %5, %6
%8 = load double, double* %4
%9 = fmul double %7, %8
%10 = call double @cbrt(double %9)
ret double %10
}

LLVM IR (-O2):
define double @radius_from_volume(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fmul double %3, %1
%5 = tail call double @cbrt(double %4)
ret double %5
}
/* Variables and functions */
char *tokenParser(char *, char *, int, char *);
char *emblParser(char *header) {
  return tokenParser(header, " \t", 1, "emblParser");
}


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

x86 assembly (clang, -O2):
<emblParser>:
lea    0xee9(%rip),%rsi
lea    0xee5(%rip),%rcx
mov    $0x1,%edx
jmp    1030 <tokenParser@plt>

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

LLVM IR (-O2):
@.str = [3 x i8] c" \09\00"
@.str.1 = [11 x i8] c"emblParser\00"
define i8* @emblParser(i8* %0) {
%2 = tail call i8* @tokenParser(i8* %0, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 1, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
ret i8* %2
}
/* Variables and functions */
int rand();
int getTortoiseMove() {
  int randomNum = rand() % 1000;
  if (randomNum >= 500)
    return 3;
  else if (randomNum >= 200)
    return -6;
  else
    return 1;
}


x86 assembly (clang, -O0):
<getTortoiseMove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0x3e8,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
cmpl   $0x1f4,-0x8(%rbp)
jl     1143 <getTortoiseMove+0x33>
movl   $0x3,-0x4(%rbp)
jmp    1163 <getTortoiseMove+0x53>
cmpl   $0xc8,-0x8(%rbp)
jl     115c <getTortoiseMove+0x4c>
movl   $0xfffffffa,-0x4(%rbp)
jmp    1163 <getTortoiseMove+0x53>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getTortoiseMove>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x10624dd3,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x26,%rcx
add    %edx,%ecx
imul   $0x3e8,%ecx,%ecx
sub    %ecx,%eax
cmp    $0xc8,%eax
mov    $0xfffffffa,%ecx
mov    $0x1,%edx
cmovge %ecx,%edx
cmp    $0x1f4,%eax
mov    $0x3,%eax
cmovl  %edx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getTortoiseMove() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @rand()
%4 = srem i32 %3, 1000
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = icmp sge i32 %5, 500
br i1 %6, label %7, label %8
7: ; preds = %0
store i32 3, i32* %1
br label %13
8: ; preds = %0
%9 = load i32, i32* %2
%10 = icmp sge i32 %9, 200
br i1 %10, label %11, label %12
11: ; preds = %8
store i32 -6, i32* %1
br label %13
12: ; preds = %8
store i32 1, i32* %1
br label %13
13: ; preds = %12, %11, %7
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @getTortoiseMove() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 1000
%3 = icmp sgt i32 %2, 499
%4 = icmp sgt i32 %2, 199
%5 = select i1 %4, i32 -6, i32 1
%6 = select i1 %3, i32 3, i32 %5
ret i32 %6
}
/* Variables and functions */
unsigned int f33(unsigned int);
unsigned int f34(unsigned int a) { return f33(f33(a)); }


x86 assembly (clang, -O0):
<f34>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <f33@plt>
mov    %eax,%edi
call   1030 <f33@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f34>:
push   %rax
call   1030 <f33@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <f33@plt>

LLVM IR (-O0):
define i32 @f34(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @f33(i32 %3)
%5 = call i32 @f33(i32 %4)
ret i32 %5
}

LLVM IR (-O2):
define i32 @f34(i32 %0) {
%2 = tail call i32 @f33(i32 %0)
%3 = tail call i32 @f33(i32 %2)
ret i32 %3
}
/* Variables and functions */
int print(char **, int *);
int stringf(char *out, const char *format, ...) {
  int *varg = (int *)(char *)(&format);
  return print(&out, varg);
}


x86 assembly (clang, -O0):
<stringf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rsi
lea    -0x8(%rbp),%rdi
call   1030 <print@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stringf>:
sub    $0x18,%rsp
mov    %rdi,0x10(%rsp)
mov    %rsi,0x8(%rsp)
lea    0x10(%rsp),%rdi
lea    0x8(%rsp),%rsi
call   1030 <print@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define i32 @stringf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32*
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = bitcast i8** %4 to i8*
%7 = bitcast i8* %6 to i32*
store i32* %7, i32** %5
%8 = load i32*, i32** %5
%9 = call i32 @print(i8** %3, i32* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @stringf(i8* %0, i8* %1, ...) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = bitcast i8** %4 to i32*
%6 = call i32 @print(i8** %3, i32* %5)
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ puts(char *);
void example() { puts("example called"); }


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"example called\00"
define void @example() {
%1 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [15 x i8] c"example called\00"
define void @example() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
ret void
}
int pthread_noop_access(void *ptr) { return *(volatile char *)ptr; }


x86 assembly (clang, -O0):
<pthread_noop_access>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%al
movsbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<pthread_noop_access>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @pthread_noop_access(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load volatile i8, i8* %3
%5 = sext i8 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @pthread_noop_access(i8* %0) {
%2 = load volatile i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
void foo136(int p) {}


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

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

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

LLVM IR (-O2):
define void @foo136(i32 %0) {
ret void
}
void default_vector_free(void *element) { (void)element; }


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

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

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

LLVM IR (-O2):
define void @default_vector_free(i8* nocapture %0) {
ret void
}
int g(int x, int y) { return 42; }


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

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

LLVM IR (-O0):
define i32 @g(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
ret i32 42
}

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

/* Variables and functions */
int /*<<< orphan*/ ascii_length(char *);
unsigned int message_putbuffer(struct message_data *, int /*<<< orphan*/,
                               char *, unsigned int);
unsigned int message_putstring(struct message_data *data, char *string,
                               unsigned int offset) {
  return message_putbuffer(data, ascii_length(string), string, offset);
}


x86 assembly (clang, -O0):
<message_putstring>:
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,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <ascii_length@plt>
mov    -0x20(%rbp),%rdi
mov    %eax,%esi
mov    -0x10(%rbp),%rdx
mov    -0x14(%rbp),%ecx
call   1030 <message_putbuffer@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<message_putstring>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %rsi,%rbx
mov    %rdi,%rbp
mov    %rsi,%rdi
call   1040 <ascii_length@plt>
mov    %rbp,%rdi
mov    %eax,%esi
mov    %rbx,%rdx
mov    %r14d,%ecx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <message_putbuffer@plt>

LLVM IR (-O0):
%struct.message_data = type { i32 }
define i32 @message_putstring(%struct.message_data* %0, i8* %1, i32 %2) {
%4 = alloca %struct.message_data*
%5 = alloca i8*
%6 = alloca i32
store %struct.message_data* %0, %struct.message_data** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%7 = load %struct.message_data*, %struct.message_data** %4
%8 = load i8*, i8** %5
%9 = call i32 @ascii_length(i8* %8)
%10 = load i8*, i8** %5
%11 = load i32, i32* %6
%12 = call i32 @message_putbuffer(%struct.message_data* %7, i32 %9, i8* %10, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
%struct.message_data = type { i32 }
define i32 @message_putstring(%struct.message_data* %0, i8* %1, i32 %2) {
%4 = tail call i32 @ascii_length(i8* %1)
%5 = tail call i32 @message_putbuffer(%struct.message_data* %0, i32 %4, i8* %1, i32 %2)
ret i32 %5
}