xunge/DecIR huggingface dataset:
/* Variables and functions */
int max_int(int, int);
int maximum_int(int xs[], int n) {
  int mx = 0;
  for (int i = 0; i < n; i++)
    mx = max_int(mx, xs[i]);
  return mx;
}


x86 assembly (clang, -O0):
<maximum_int>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    115d <maximum_int+0x4d>
mov    -0x10(%rbp),%edi
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
call   1030 <max_int@plt>
mov    %eax,-0x10(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    112d <maximum_int+0x1d>
mov    -0x10(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<maximum_int>:
push   %r15
push   %r14
push   %rbx
test   %esi,%esi
jle    1146 <maximum_int+0x36>
mov    %rdi,%r14
mov    %esi,%r15d
xor    %ebx,%ebx
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%r14,%rbx,4),%esi
mov    %eax,%edi
call   1030 <max_int@plt>
add    $0x1,%rbx
cmp    %rbx,%r15
jne    1130 <maximum_int+0x20>
jmp    1148 <maximum_int+0x38>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i32 @maximum_int(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %8
6: ; preds = %8, %2
%7 = phi i32 [ 0, %2 ], [ %13, %8 ]
ret i32 %7
8: ; preds = %4, %8
%9 = phi i64 [ 0, %4 ], [ %14, %8 ]
%10 = phi i32 [ 0, %4 ], [ %13, %8 ]
%11 = getelementptr inbounds i32, i32* %0, i64 %9
%12 = load i32, i32* %11
%13 = tail call i32 @max_int(i32 %10, i32 %12)
%14 = add nuw nsw i64 %9, 1
%15 = icmp eq i64 %14, %5
br i1 %15, label %6, label %8
}
/* Variables and functions */
unsigned int *memcpy(unsigned int *, unsigned int *, int);
unsigned int *umemcpy(unsigned int *dest, unsigned int *src, int count) {
  return memcpy(dest, src, count * sizeof(unsigned int));
}


x86 assembly (clang, -O0):
<umemcpy>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x14(%rbp),%rax
shl    $0x2,%rax
mov    %eax,%edx
call   1030 <memcpy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<umemcpy>:
shl    $0x2,%edx
jmp    1030 <memcpy@plt>

LLVM IR (-O0):
define i32* @umemcpy(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%7 = load i32*, i32** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %6
%10 = sext i32 %9 to i64
%11 = mul i64 %10, 4
%12 = trunc i64 %11 to i32
%13 = call i32* @memcpy(i32* %7, i32* %8, i32 %12)
ret i32* %13
}

LLVM IR (-O2):
define i32* @umemcpy(i32* %0, i32* %1, i32 %2) {
%4 = shl i32 %2, 2
%5 = tail call i32* @memcpy(i32* %0, i32* %1, i32 %4)
ret i32* %5
}
/* Variables and functions */
int __infer_nondet_int();
int ilogbf(float x) { return __infer_nondet_int(); }


x86 assembly (clang, -O0):
<ilogbf>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @ilogbf(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = call i32 (...) @__infer_nondet_int()
ret i32 %3
}

LLVM IR (-O2):
define i32 @ilogbf(float %0) {
%2 = tail call i32 (...) @__infer_nondet_int()
ret i32 %2
}
int okn_tsm_rot_y(struct okn_tsm *t, float y) { return 1; }


x86 assembly (clang, -O0):
<okn_tsm_rot_y>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
mov    $0x1,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_y(%struct.okn_tsm* %0, float %1) {
%3 = alloca %struct.okn_tsm*
%4 = alloca float
store %struct.okn_tsm* %0, %struct.okn_tsm** %3
store float %1, float* %4
ret i32 1
}

LLVM IR (-O2):
%struct.okn_tsm = type opaque
define i32 @okn_tsm_rot_y(%struct.okn_tsm* nocapture readnone %0, float %1) {
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int my_patch(int a) { printf("my_patch: %d\n", a); }


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

x86 assembly (clang, -O2):
<my_patch>:
mov    %edi,%esi
lea    0xee7(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [14 x i8] c"my_patch: %d\0A\00"
define i32 @my_patch(i32 %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0)
ret i32 undef
}
void splash(int k) { return; }


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

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

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

LLVM IR (-O2):
define void @splash(i32 %0) {
ret void
}
int tcm_decision(int level, int sample) {
  int x, xs;
  x = (sample + (7 * 128) - (level << 8)) >> 10;
  xs = (((x << 2) + level - 2) << 8) + 128;
  return xs;
}


x86 assembly (clang, -O0):
<tcm_decision>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x380,%eax
mov    -0x4(%rbp),%ecx
shl    $0x8,%ecx
sub    %ecx,%eax
sar    $0xa,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shl    $0x2,%eax
add    -0x4(%rbp),%eax
sub    $0x2,%eax
shl    $0x8,%eax
add    $0x80,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcm_decision>:
shl    $0x8,%edi
sub    %edi,%esi
add    $0x380,%esi
and    $0xfffffc00,%esi
lea    (%rdi,%rsi,1),%eax
add    $0xfffffe80,%eax
ret

LLVM IR (-O0):
define i32 @tcm_decision(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%7 = load i32, i32* %4
%8 = add nsw i32 %7, 896
%9 = load i32, i32* %3
%10 = shl i32 %9, 8
%11 = sub nsw i32 %8, %10
%12 = ashr i32 %11, 10
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = shl i32 %13, 2
%15 = load i32, i32* %3
%16 = add nsw i32 %14, %15
%17 = sub nsw i32 %16, 2
%18 = shl i32 %17, 8
%19 = add nsw i32 %18, 128
store i32 %19, i32* %6
%20 = load i32, i32* %6
ret i32 %20
}

LLVM IR (-O2):
define i32 @tcm_decision(i32 %0, i32 %1) {
%3 = add nsw i32 %1, 896
%4 = mul i32 %0, -256
%5 = add i32 %3, %4
%6 = shl i32 %0, 8
%7 = and i32 %5, -1024
%8 = add i32 %6, -384
%9 = add i32 %8, %7
ret i32 %9
}
/* Variables and functions */
char *basename(char *);
char *strdup(char *);
char *strrchr(char *, char);
char *filename_no_ext(char *str) {
  if (str == NULL)
    return NULL;
  char *name = basename(str);
  char *retstr = strdup(name);
  char *lastdot = strrchr(retstr, '.');
  if (lastdot != NULL)
    *lastdot = '\0';
  return retstr;
}


x86 assembly (clang, -O0):
<filename_no_ext>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1154 <filename_no_ext+0x24>
movq   $0x0,-0x8(%rbp)
jmp    119a <filename_no_ext+0x6a>
mov    -0x10(%rbp),%rdi
call   1040 <basename@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1050 <strdup@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x28(%rbp)
cmpq   $0x0,-0x28(%rbp)
je     1192 <filename_no_ext+0x62>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<filename_no_ext>:
push   %rbx
test   %rdi,%rdi
je     115d <filename_no_ext+0x2d>
call   1040 <basename@plt>
mov    %rax,%rdi
call   1050 <strdup@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    $0x2e,%esi
call   1030 <strrchr@plt>
test   %rax,%rax
je     115f <filename_no_ext+0x2f>
movb   $0x0,(%rax)
jmp    115f <filename_no_ext+0x2f>
xor    %ebx,%ebx
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @filename_no_ext(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
store i8* %0, i8** %3
%7 = load i8*, i8** %3
%8 = icmp eq i8* %7, null
br i1 %8, label %9, label %10
9: ; preds = %1
store i8* null, i8** %2
br label %23
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i8* @basename(i8* %11)
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i8* @strdup(i8* %13)
store i8* %14, i8** %5
%15 = load i8*, i8** %5
%16 = call i8* @strrchr(i8* %15, i8 signext 46)
store i8* %16, i8** %6
%17 = load i8*, i8** %6
%18 = icmp ne i8* %17, null
br i1 %18, label %19, label %21
19: ; preds = %10
%20 = load i8*, i8** %6
store i8 0, i8* %20
br label %21
21: ; preds = %19, %10
%22 = load i8*, i8** %5
store i8* %22, i8** %2
br label %23
23: ; preds = %21, %9
%24 = load i8*, i8** %2
ret i8* %24
}

LLVM IR (-O2):
define i8* @filename_no_ext(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %9, label %3
3: ; preds = %1
%4 = tail call i8* @basename(i8* %0)
%5 = tail call i8* @strdup(i8* %4)
%6 = tail call i8* @strrchr(i8* dereferenceable(1) %5, i8 signext 46)
%7 = icmp eq i8* %6, null
br i1 %7, label %9, label %8
8: ; preds = %3
store i8 0, i8* %6
br label %9
9: ; preds = %3, %8, %1
%10 = phi i8* [ null, %1 ], [ %5, %8 ], [ %5, %3 ]
ret i8* %10
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int /*<<< orphan*/ scanf(char *, int *);
int main() {
  int a, n;
  scanf("%d", &n);
  a = n;
  a = a * n;
  printf("\n%d", a);
  a = 0;
  a = n;
  a = a * n * n;
  printf("\n%d", a);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xecb(%rip),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <scanf@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x8(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
imul   -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x10,%rsp
lea    0xed5(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1040 <scanf@plt>
mov    0xc(%rsp),%esi
imul   %esi,%esi
lea    0xebc(%rip),%rbx
mov    %rbx,%rdi
call   1030 <printf@plt>
mov    0xc(%rsp),%eax
mov    %eax,%esi
imul   %eax,%esi
imul   %eax,%esi
mov    %rbx,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
@.str.1 = [4 x i8] c"\0A%d\00"
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = load i32, i32* %1
%5 = mul nsw i32 %4, %4
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %5)
%7 = load i32, i32* %1
%8 = mul nsw i32 %7, %7
%9 = mul nsw i32 %8, %7
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %9)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ dll_func();
int main() {
  dll_func();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @dll_func()
ret i32 0
}
/* Variables and functions */
double compute_slopes_(double *, double *);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ set_snan(double *);
int main() {
  double x, y, z;
  set_snan(&x);
  y = 1.0;
  z = compute_slopes_(&x, &y);
  printf("slope is %24.15f\n", z);
  z = compute_slopes_(&y, &x);
  printf("slope is %24.15f\n", z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x8(%rbp),%rdi
call   1040 <set_snan@plt>
movsd  0xeb7(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
lea    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1050 <compute_slopes_@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe9c(%rip),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <compute_slopes_@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
lea    0xe79(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <set_snan@plt>
movabs $0x3ff0000000000000,%rax
mov    %rax,(%rsp)
mov    %rsp,%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <compute_slopes_@plt>
lea    0xe97(%rip),%r15
mov    %r15,%rdi
call   1030 <printf@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1050 <compute_slopes_@plt>
mov    %r15,%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [18 x i8] c"slope is %24.15f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = alloca double
%4 = call i32 @set_snan(double* %1)
store double 1.000000e+00, double* %2
%5 = call double @compute_slopes_(double* %1, double* %2)
store double %5, double* %3
%6 = load double, double* %3
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double @compute_slopes_(double* %2, double* %1)
store double %8, double* %3
%9 = load double, double* %3
%10 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [18 x i8] c"slope is %24.15f\0A\00"
define i32 @main() {
%1 = alloca double
%2 = alloca double
%3 = bitcast double* %1 to i8*
%4 = bitcast double* %2 to i8*
%5 = call i32 @set_snan(double* %1)
store double 1.000000e+00, double* %2
%6 = call double @compute_slopes_(double* %1, double* %2)
%7 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %6)
%8 = call double @compute_slopes_(double* %2, double* %1)
%9 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), double %8)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ rdump();
void test_special_cases() {
  printf("\nrdump: (should print nothing)\n");
  rdump();
}


x86 assembly (clang, -O0):
<test_special_cases>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <rdump@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_special_cases>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <rdump@plt>

LLVM IR (-O0):
@.str = [32 x i8] c"\0Ardump: (should print nothing)\0A\00"
define void @test_special_cases() {
%1 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @rdump()
ret void
}

LLVM IR (-O2):
@str = [31 x i8] c"\0Ardump: (should print nothing)\00"
define void @test_special_cases() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @rdump()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
void show_help(void) {
  printf("Usage: %s [OPTION]\n\n     true does nothing, successfully \n     "
         "command line arguments are ignored \n\n     -h, --help\t\tdisplay "
         "this help\n     -V, --version\tdisplay version information\n\n     "
         "Report bugs to <bulliver@gmail.com>\n",
         "true");
}


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

x86 assembly (clang, -O2):
<show_help>:
lea    0xee9(%rip),%rdi
lea    0xfc3(%rip),%rsi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [225 x i8] c"Usage: %s [OPTION]\0A\0A true does nothing, successfully \0A command line arguments are ignored \0A\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"true\00"
define void @show_help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [225 x i8] c"Usage: %s [OPTION]\0A\0A true does nothing, successfully \0A command line arguments are ignored \0A\0A -h, --help\09\09display this help\0A -V, --version\09display version information\0A\0A Report bugs to <bulliver@gmail.com>\0A\00"
@.str.1 = [5 x i8] c"true\00"
define void @show_help() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([225 x i8], [225 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
ret void
}
unsigned xrop3_184_0_0(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  unsigned stk2;
  unsigned stk3;
  stk3 = D ^ T;
  stk2 = S & stk3;
  stk1 = T ^ stk2;
  return stk1;
}


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

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

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

LLVM IR (-O2):
define i32 @xrop3_184_0_0(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = xor i32 %6, 255
%8 = and i32 %7, %4
%9 = xor i32 %8, %6
ret i32 %9
}
/* Variables and functions */
double exp(double);
double db2mag(double dB) {
  const double DB_2_LOG = 0.11512925464970228420089957273422;
  return exp(dB * DB_2_LOG);
}


x86 assembly (clang, -O0):
<db2mag>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  0xedb(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xece(%rip),%xmm0
mulsd  -0x8(%rbp),%xmm0
call   1030 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<db2mag>:
mulsd  0xee8(%rip),%xmm0
jmp    1030 <exp@plt>

LLVM IR (-O0):
define double @db2mag(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %2
store double 0x3FBD791C5F888822, double* %3
%4 = load double, double* %2
%5 = fmul double %4, 0x3FBD791C5F888822
%6 = call double @exp(double %5)
ret double %6
}

LLVM IR (-O2):
define double @db2mag(double %0) {
%2 = fmul double %0, 0x3FBD791C5F888822
%3 = tail call double @exp(double %2)
ret double %3
}
int foo2(value)
unsigned long long value;
{
  register const unsigned long long constant = 0xc000000080000000LL;
  if (value < constant)
    return 1;
  else
    return 2;
}


x86 assembly (clang, -O0):
<foo2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movabs $0xc000000080000000,%rax
mov    %rax,-0x18(%rbp)
movabs $0xc000000080000000,%rax
cmp    %rax,-0x10(%rbp)
jae    1136 <foo2+0x36>
movl   $0x1,-0x4(%rbp)
jmp    113d <foo2+0x3d>
movl   $0x2,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo2>:
movabs $0xc000000080000000,%rax
cmp    %rax,%rdi
mov    $0x2,%eax
sbb    $0x0,%eax
ret

LLVM IR (-O0):
define i32 @foo2(i64 %0) {
%2 = alloca i32
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 -4611686016279904256, i64* %4
%5 = load i64, i64* %3
%6 = icmp ult i64 %5, -4611686016279904256
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 1, i32* %2
br label %9
8: ; preds = %1
store i32 2, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @foo2(i64 %0) {
%2 = icmp ult i64 %0, -4611686016279904256
%3 = select i1 %2, i32 1, i32 2
ret i32 %3
}
/* Variables and functions */
int printf(char *, char const *);
int CommonOutput(const char *str) { return printf("%s\n", str); }


x86 assembly (clang, -O0):
<CommonOutput>:
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):
<CommonOutput>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%s\0A\00"
define i32 @CommonOutput(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %0)
ret i32 %2
}
extern int TakeUint16(unsigned short x) {
  if (x == 0xFFFE)
    return 11;
  return 0;
}


x86 assembly (clang, -O0):
<TakeUint16>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x6(%rbp)
movzwl -0x6(%rbp),%eax
cmp    $0xfffe,%eax
jne    1126 <TakeUint16+0x26>
movl   $0xb,-0x4(%rbp)
jmp    112d <TakeUint16+0x2d>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<TakeUint16>:
xor    %ecx,%ecx
cmp    $0xfffe,%di
mov    $0xb,%eax
cmovne %ecx,%eax
ret

LLVM IR (-O0):
define i32 @TakeUint16(i16 zeroext %0) {
%2 = alloca i32
%3 = alloca i16
store i16 %0, i16* %3
%4 = load i16, i16* %3
%5 = zext i16 %4 to i32
%6 = icmp eq i32 %5, 65534
br i1 %6, label %7, label %8
7: ; preds = %1
store i32 11, i32* %2
br label %9
8: ; preds = %1
store i32 0, i32* %2
br label %9
9: ; preds = %8, %7
%10 = load i32, i32* %2
ret i32 %10
}

LLVM IR (-O2):
define i32 @TakeUint16(i16 zeroext %0) {
%2 = icmp eq i16 %0, -2
%3 = select i1 %2, i32 11, i32 0
ret i32 %3
}
void foo_2_2_2_2_2_1_2_1_1() {}


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

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

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

LLVM IR (-O2):
define void @foo_2_2_2_2_2_1_2_1_1() {
ret void
}
int isspace(int c) { return c == ' '; }


x86 assembly (clang, -O0):
<isspace>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x20,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isspace>:
xor    %eax,%eax
cmp    $0x20,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @isspace(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 32
%5 = zext i1 %4 to i32
ret i32 %5
}

LLVM IR (-O2):
define i32 @isspace(i32 %0) {
%2 = icmp eq i32 %0, 32
%3 = zext i1 %2 to i32
ret i32 %3
}
long long test_di(long long a) {
  return (a << 19) | ((unsigned long long)a >> 45);
}


x86 assembly (clang, -O0):
<test_di>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
shl    $0x13,%rax
mov    -0x8(%rbp),%rcx
shr    $0x2d,%rcx
or     %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_di>:
mov    %rdi,%rax
rol    $0x13,%rax
ret

LLVM IR (-O0):
define i64 @test_di(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = shl i64 %3, 19
%5 = load i64, i64* %2
%6 = lshr i64 %5, 45
%7 = or i64 %4, %6
ret i64 %7
}

LLVM IR (-O2):
define i64 @test_di(i64 %0) {
%2 = tail call i64 @llvm.fshl.i64(i64 %0, i64 %0, i64 19)
ret i64 %2
}
/* Type definitions */
struct menu {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ conf_load();
void handle_f7(int *key, struct menu *current_item) {
  conf_load();
  return;
}


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

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

LLVM IR (-O0):
%struct.menu = type { i32 }
define void @handle_f7(i32* %0, %struct.menu* %1) {
%3 = alloca i32*
%4 = alloca %struct.menu*
store i32* %0, i32** %3
store %struct.menu* %1, %struct.menu** %4
%5 = call i32 (...) @conf_load()
ret void
}

LLVM IR (-O2):
%struct.menu = type { i32 }
define void @handle_f7(i32* nocapture readnone %0, %struct.menu* nocapture readnone %1) {
%3 = tail call i32 (...) @conf_load()
ret void
}
/* Type definitions */
struct UPnPService {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void RNDResponseSink_ConnectionManager_ConnectionComplete(
    struct UPnPService *Service, int ErrorCode, void *User) {
  printf("RND Invoke Response: "
         "ConnectionManager/ConnectionComplete[ErrorCode:%d]()\r\n",
         ErrorCode);
}


x86 assembly (clang, -O0):
<RNDResponseSink_ConnectionManager_ConnectionComplete>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0xc(%rbp),%esi
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: ConnectionManager/ConnectionComplete[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ConnectionManager_ConnectionComplete(%struct.UPnPService* %0, i32 %1, i8* %2) {
%4 = alloca %struct.UPnPService*
%5 = alloca i32
%6 = alloca i8*
store %struct.UPnPService* %0, %struct.UPnPService** %4
store i32 %1, i32* %5
store i8* %2, i8** %6
%7 = load i32, i32* %5
%8 = call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %7)
ret void
}

LLVM IR (-O2):
%struct.UPnPService = type { i32 }
@.str = [76 x i8] c"RND Invoke Response: ConnectionManager/ConnectionComplete[ErrorCode:%d]()\0D\0A\00"
define void @RNDResponseSink_ConnectionManager_ConnectionComplete(%struct.UPnPService* nocapture readnone %0, i32 %1, i8* nocapture readnone %2) {
%4 = tail call i32 @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str, i64 0, i64 0), i32 %1)
ret void
}
int printf(const char *_format, ...) { return (0); }


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

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

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

LLVM IR (-O2):
define i32 @printf(i8* nocapture readnone %0, ...) {
ret i32 0
}
void capturing2capturingPosahead_rv_endCapturing() {}


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

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

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

LLVM IR (-O2):
define void @capturing2capturingPosahead_rv_endCapturing() {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ time_t;
struct tm {
  int tm_year;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct tm *);
struct tm *getLocalTime(int /*<<< orphan*/ *);
int getYear() {
  struct tm *mytime;
  int year = 0;
  mytime = getLocalTime((time_t *)NULL);
  year = mytime->tm_year;
  free(mytime);
  return year;
}


x86 assembly (clang, -O0):
<getYear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0xc(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <getLocalTime@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getYear>:
push   %rbx
xor    %edi,%edi
call   1040 <getLocalTime@plt>
mov    (%rax),%ebx
mov    %rax,%rdi
call   1030 <free@plt>
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
%struct.tm = type { i32 }
define i32 @getYear() {
%1 = tail call %struct.tm* @getLocalTime(i32* null)
%2 = getelementptr inbounds %struct.tm, %struct.tm* %1, i64 0, i32 0
%3 = load i32, i32* %2
%4 = tail call i32 @free(%struct.tm* %1)
ret i32 %3
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t lfs1_max(uint32_t a, uint32_t b) { return (a > b) ? a : b; }


x86 assembly (clang, -O0):
<lfs1_max>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jle    1127 <lfs1_max+0x27>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    112f <lfs1_max+0x2f>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

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

LLVM IR (-O0):
define i64 @lfs1_max(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 = icmp sgt i64 %5, %6
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = load i64, i64* %3
br label %12
10: ; preds = %2
%11 = load i64, i64* %4
br label %12
12: ; preds = %10, %8
%13 = phi i64 [ %9, %8 ], [ %11, %10 ]
ret i64 %13
}

LLVM IR (-O2):
define i64 @lfs1_max(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
int __test_and_set_bit(int nr, volatile unsigned long *addr) {
  int oldbit;
  __asm__("btsl %2,%1\n\tsbbl %0,%0"
          : "=r"(oldbit), "=m"((*(volatile long *)addr))
          : "Ir"(nr));
  return oldbit;
}


x86 assembly (clang, -O0):
<__test_and_set_bit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    -0x4(%rbp),%ecx
bts    %ecx,(%rax)
sbb    %eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<__test_and_set_bit>:
bts    %edi,(%rsi)
sbb    %eax,%eax
ret

LLVM IR (-O0):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = alloca i32
%4 = alloca i64*
%5 = alloca i32
store i32 %0, i32* %3
store i64* %1, i64** %4
%6 = load i64*, i64** %4
%7 = load i32, i32* %3
%8 = call i32 asm "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %6, i32 %7)
store i32 %8, i32* %5
%9 = load i32, i32* %5
ret i32 %9
}

LLVM IR (-O2):
define i32 @__test_and_set_bit(i32 %0, i64* %1) {
%3 = tail call i32 asm "btsl $2,$1\0A\09sbbl $0,$0", "=r,=*m,Ir,~{dirflag},~{fpsr},~{flags}"(i64* elementtype(i64) %1, i32 %0)
ret i32 %3
}
/* Variables and functions */
int cbuf(int, int, int);
cbuf18(int f, int n) { return (cbuf(f, n, 18)); }


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

x86 assembly (clang, -O2):
<cbuf18>:
mov    $0x12,%edx
jmp    1030 <cbuf@plt>

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

LLVM IR (-O2):
define i32 @cbuf18(i32 %0, i32 %1) {
%3 = tail call i32 @cbuf(i32 %0, i32 %1, i32 18)
ret i32 %3
}
/* Variables and functions */
long long g(int);
long long sequence(int n) { return g(n); }


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

x86 assembly (clang, -O2):
<sequence>:
jmp    1030 <g@plt>

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

LLVM IR (-O2):
define i64 @sequence(i32 %0) {
%2 = tail call i64 @g(i32 %0)
ret i64 %2
}
double quantum_char2double(unsigned char *buf) {
  double *d = (double *)buf;
  return *d;
}


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

x86 assembly (clang, -O2):
<quantum_char2double>:
movsd  (%rdi),%xmm0
ret

LLVM IR (-O0):
define double @quantum_char2double(i8* %0) {
%2 = alloca i8*
%3 = alloca double*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to double*
store double* %5, double** %3
%6 = load double*, double** %3
%7 = load double, double* %6
ret double %7
}

LLVM IR (-O2):
define double @quantum_char2double(i8* nocapture %0) {
%2 = bitcast i8* %0 to double*
%3 = load double, double* %2
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int /*<<< orphan*/, char *, int, char *);
int /*<<< orphan*/ isprint(int);
void t_isprint_0x69() {
  Assert_real((isprint(105)),
              "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
              "2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/"
              "dg/z88dk/test/suites/ctype/test_isprint.c",
              530, ("isprint should be 1 for i"));
}


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

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

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

LLVM IR (-O2):
@.str = [168 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/bitfixer/bitfixer/refs/heads/master/dg/z88dk/test/suites/ctype/test_isprint.c\00"
@.str.1 = [26 x i8] c"isprint should be 1 for i\00"
define void @t_isprint_0x69() {
%1 = tail call i32 @isprint(i32 105)
%2 = tail call i32 @Assert_real(i32 %1, i8* getelementptr inbounds ([168 x i8], [168 x i8]* @.str, i64 0, i64 0), i32 530, i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
ret void
}
void ssh_glue_read(struct WindRec *tw, unsigned char *st, short cnt) {}


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

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

LLVM IR (-O0):
%struct.WindRec = type opaque
define void @ssh_glue_read(%struct.WindRec* %0, i8* %1, i16 signext %2) {
%4 = alloca %struct.WindRec*
%5 = alloca i8*
%6 = alloca i16
store %struct.WindRec* %0, %struct.WindRec** %4
store i8* %1, i8** %5
store i16 %2, i16* %6
ret void
}

LLVM IR (-O2):
%struct.WindRec = type opaque
define void @ssh_glue_read(%struct.WindRec* nocapture %0, i8* nocapture %1, i16 signext %2) {
ret void
}
/* Variables and functions */
char *findname(unsigned long, char const *);
char const *strdec(unsigned long);
char const *strdefint(unsigned long number, char const *prefix) {
  char const *name;
  name = findname(number, prefix);
  if (name)
    return name;
  return strdec(number);
}


x86 assembly (clang, -O0):
<strdefint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <findname@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     1159 <strdefint+0x39>
mov    -0x20(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    1166 <strdefint+0x46>
mov    -0x10(%rbp),%rdi
call   1040 <strdec@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strdefint>:
push   %rbx
mov    %rdi,%rbx
call   1030 <findname@plt>
test   %rax,%rax
je     1130 <strdefint+0x10>
pop    %rbx
ret
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <strdec@plt>

LLVM IR (-O0):
define i8* @strdefint(i64 %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i64
%5 = alloca i8*
%6 = alloca i8*
store i64 %0, i64* %4
store i8* %1, i8** %5
%7 = load i64, i64* %4
%8 = load i8*, i8** %5
%9 = call i8* @findname(i64 %7, i8* %8)
store i8* %9, i8** %6
%10 = load i8*, i8** %6
%11 = icmp ne i8* %10, null
br i1 %11, label %12, label %14
12: ; preds = %2
%13 = load i8*, i8** %6
store i8* %13, i8** %3
br label %17
14: ; preds = %2
%15 = load i64, i64* %4
%16 = call i8* @strdec(i64 %15)
store i8* %16, i8** %3
br label %17
17: ; preds = %14, %12
%18 = load i8*, i8** %3
ret i8* %18
}

LLVM IR (-O2):
define i8* @strdefint(i64 %0, i8* %1) {
%3 = tail call i8* @findname(i64 %0, i8* %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i8* @strdec(i64 %0)
br label %7
7: ; preds = %2, %5
%8 = phi i8* [ %6, %5 ], [ %3, %2 ]
ret i8* %8
}
/* Variables and functions */
unsigned long file_new_internal(unsigned long, int, unsigned long *, int);
unsigned long int file_new_thunk(unsigned long int self, int argc,
                                 unsigned long int *argv) {
  return file_new_internal(self, argc, argv, 1);
}


x86 assembly (clang, -O0):
<file_new_thunk>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
call   1030 <file_new_internal@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<file_new_thunk>:
mov    $0x1,%ecx
jmp    1030 <file_new_internal@plt>

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

LLVM IR (-O2):
define i64 @file_new_thunk(i64 %0, i32 %1, i64* %2) {
%4 = tail call i64 @file_new_internal(i64 %0, i32 %1, i64* %2, i32 1)
ret i64 %4
}
/* Type definitions */
struct timeval {
  double tv_sec;
  double tv_usec;
};

/* Variables and functions */
scalar_t__ gettimeofday(struct timeval *, int /*<<< orphan*/ *);
double rdz_now() {
  struct timeval tv;
  if (gettimeofday(&tv, NULL) != 0)
    return 0.0;
  return 1000.0 * tv.tv_sec + tv.tv_usec / 1000.0;
}


x86 assembly (clang, -O0):
<rdz_now>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
lea    -0x18(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <gettimeofday@plt>
cmp    $0x0,%rax
je     113c <rdz_now+0x2c>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1167 <rdz_now+0x57>
movsd  -0x18(%rbp),%xmm0
movsd  -0x10(%rbp),%xmm1
movsd  0xeb2(%rip),%xmm2
divsd  %xmm2,%xmm1
movsd  0xea6(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rdz_now>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
xor    %esi,%esi
call   1030 <gettimeofday@plt>
test   %rax,%rax
je     112d <rdz_now+0x1d>
xorps  %xmm0,%xmm0
add    $0x18,%rsp
ret
movsd  0x10(%rsp),%xmm1
movsd  0xec5(%rip),%xmm0
divsd  %xmm0,%xmm1
mulsd  0x8(%rsp),%xmm0
addsd  %xmm1,%xmm0
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { double, double }
define double @rdz_now() {
%1 = alloca double
%2 = alloca %struct.timeval
%3 = call i64 @gettimeofday(%struct.timeval* %2, i32* null)
%4 = icmp ne i64 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store double 0.000000e+00, double* %1
br label %13
6: ; preds = %0
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
%8 = load double, double* %7
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
%10 = load double, double* %9
%11 = fdiv double %10, 1.000000e+03
%12 = call double @llvm.fmuladd.f64(double 1.000000e+03, double %8, double %11)
store double %12, double* %1
br label %13
13: ; preds = %6, %5
%14 = load double, double* %1
ret double %14
}

LLVM IR (-O2):
%struct.timeval = type { double, double }
define double @rdz_now() {
%1 = alloca %struct.timeval
%2 = bitcast %struct.timeval* %1 to i8*
%3 = call i64 @gettimeofday(%struct.timeval* %1, i32* null)
%4 = icmp eq i64 %3, 0
br i1 %4, label %5, label %12
5: ; preds = %0
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load double, double* %6
%8 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%9 = load double, double* %8
%10 = fdiv double %9, 1.000000e+03
%11 = tail call double @llvm.fmuladd.f64(double %7, double 1.000000e+03, double %10)
br label %12
12: ; preds = %0, %5
%13 = phi double [ %11, %5 ], [ 0.000000e+00, %0 ]
ret double %13
}
/* Variables and functions */
int /*<<< orphan*/ reHeapElement(int *, int *, double *, int, int);
int /*<<< orphan*/ swap(int *, int *, int, int);
void pushHeap(int *p, int *q, double *v, int length, int i) {
  swap(p, q, i, length + 1);
  reHeapElement(p, q, v, length + 1, length + 1);
  return;
}


x86 assembly (clang, -O0):
<pushHeap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    %r8d,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
call   1040 <swap@plt>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
add    $0x1,%ecx
mov    -0x1c(%rbp),%r8d
add    $0x1,%r8d
call   1030 <reHeapElement@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pushHeap>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%r15
mov    %rdi,%rbx
lea    0x1(%rcx),%ebp
mov    %r8d,%edx
mov    %ebp,%ecx
call   1040 <swap@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
mov    %ebp,%ecx
mov    %ebp,%r8d
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <reHeapElement@plt>

LLVM IR (-O0):
define void @pushHeap(i32* %0, i32* %1, double* %2, i32 %3, i32 %4) {
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca double*
%9 = alloca i32
%10 = alloca i32
store i32* %0, i32** %6
store i32* %1, i32** %7
store double* %2, double** %8
store i32 %3, i32* %9
store i32 %4, i32* %10
%11 = load i32*, i32** %6
%12 = load i32*, i32** %7
%13 = load i32, i32* %10
%14 = load i32, i32* %9
%15 = add nsw i32 %14, 1
%16 = call i32 @swap(i32* %11, i32* %12, i32 %13, i32 %15)
%17 = load i32*, i32** %6
%18 = load i32*, i32** %7
%19 = load double*, double** %8
%20 = load i32, i32* %9
%21 = add nsw i32 %20, 1
%22 = load i32, i32* %9
%23 = add nsw i32 %22, 1
%24 = call i32 @reHeapElement(i32* %17, i32* %18, double* %19, i32 %21, i32 %23)
ret void
}

LLVM IR (-O2):
define void @pushHeap(i32* %0, i32* %1, double* %2, i32 %3, i32 %4) {
%6 = add nsw i32 %3, 1
%7 = tail call i32 @swap(i32* %0, i32* %1, i32 %4, i32 %6)
%8 = tail call i32 @reHeapElement(i32* %0, i32* %1, double* %2, i32 %6, i32 %6)
ret void
}
void hw_startmotor() {}


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

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

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

LLVM IR (-O2):
define void @hw_startmotor() {
ret void
}