xunge/DecIR huggingface dataset:
void foo407() {}


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

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

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

LLVM IR (-O2):
define void @foo407() {
ret void
}
/* Type definitions */
struct winsize {
  int dummy;
};
struct termios {
  int dummy;
};

/* Variables and functions */
int forkpty(int *, char *, struct termios *, struct winsize *);
int _ForkptyX(int *pty, char *name, void *mode, void *size) {
  int pid;
  pid = forkpty(pty, name, (struct termios *)mode, (struct winsize *)size);
  return pid;
}


x86 assembly (clang, -O0):
<_ForkptyX>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
call   1030 <forkpty@plt>
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ForkptyX>:
jmp    1030 <forkpty@plt>

LLVM IR (-O0):
%struct.termios = type { i32 }
%struct.winsize = type { i32 }
define i32 @_ForkptyX(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = alloca i32*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i32
store i32* %0, i32** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i8* %3, i8** %8
%10 = load i32*, i32** %5
%11 = load i8*, i8** %6
%12 = load i8*, i8** %7
%13 = bitcast i8* %12 to %struct.termios*
%14 = load i8*, i8** %8
%15 = bitcast i8* %14 to %struct.winsize*
%16 = call i32 @forkpty(i32* %10, i8* %11, %struct.termios* %13, %struct.winsize* %15)
store i32 %16, i32* %9
%17 = load i32, i32* %9
ret i32 %17
}

LLVM IR (-O2):
%struct.termios = type { i32 }
%struct.winsize = type { i32 }
define i32 @_ForkptyX(i32* %0, i8* %1, i8* %2, i8* %3) {
%5 = bitcast i8* %2 to %struct.termios*
%6 = bitcast i8* %3 to %struct.winsize*
%7 = tail call i32 @forkpty(i32* %0, i8* %1, %struct.termios* %5, %struct.winsize* %6)
ret i32 %7
}
void systick_handler(void) {}


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

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

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

LLVM IR (-O2):
define void @systick_handler() {
ret void
}
unsigned int GetCallerEFlags(void) {
  unsigned long flags;
  asm volatile("pushf; pop %0" : "=r"(flags));
  return flags;
}


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

x86 assembly (clang, -O2):
<GetCallerEFlags>:
pushf
pop    %rax
ret

LLVM IR (-O0):
define i32 @GetCallerEFlags() {
%1 = alloca i64
%2 = call i64 asm sideeffect "pushf; pop $0", "=r,~{dirflag},~{fpsr},~{flags}"()
store i64 %2, i64* %1
%3 = load i64, i64* %1
%4 = trunc i64 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @GetCallerEFlags() {
%1 = tail call i64 asm sideeffect "pushf; pop $0", "=r,~{dirflag},~{fpsr},~{flags}"()
%2 = trunc i64 %1 to i32
ret i32 %2
}
int long_log2(unsigned long x) {
  int r = 0;
  for (x >>= 1; x > 0; x >>= 1)
    r++;
  return r;
}


x86 assembly (clang, -O0):
<long_log2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jbe    1140 <long_log2+0x40>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
shr    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111b <long_log2+0x1b>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<long_log2>:
xor    %eax,%eax
cmp    $0x2,%rdi
jb     111f <long_log2+0x1f>
xor    %eax,%eax
mov    %rdi,%rcx
nopl   (%rax)
shr    %rcx
add    $0x1,%eax
cmp    $0x3,%rdi
mov    %rcx,%rdi
ja     1110 <long_log2+0x10>
ret

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

LLVM IR (-O2):
define i32 @long_log2(i64 %0) {
%2 = icmp ult i64 %0, 2
br i1 %2, label %9, label %3
3: ; preds = %1, %3
%4 = phi i32 [ %7, %3 ], [ 0, %1 ]
%5 = phi i64 [ %6, %3 ], [ %0, %1 ]
%6 = lshr i64 %5, 1
%7 = add nuw nsw i32 %4, 1
%8 = icmp ult i64 %5, 4
br i1 %8, label %9, label %3
9: ; preds = %3, %1
%10 = phi i32 [ 0, %1 ], [ %7, %3 ]
ret i32 %10
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int solcon_clear_quaddobl_solutions(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc(397, a, b, c);
  return fail;
}


x86 assembly (clang, -O0):
<solcon_clear_quaddobl_solutions>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x18d,%edi
call   1030 <_ada_use_c2phc@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<solcon_clear_quaddobl_solutions>:
mov    $0x18d,%edi
jmp    1030 <_ada_use_c2phc@plt>

LLVM IR (-O0):
define i32 @solcon_clear_quaddobl_solutions() {
%1 = alloca i32*
%2 = alloca i32*
%3 = alloca i32
%4 = alloca double*
%5 = load i32*, i32** %1
%6 = load i32*, i32** %2
%7 = load double*, double** %4
%8 = call i32 @_ada_use_c2phc(i32 397, i32* %5, i32* %6, double* %7)
store i32 %8, i32* %3
%9 = load i32, i32* %3
ret i32 %9
}

LLVM IR (-O2):
define i32 @solcon_clear_quaddobl_solutions() {
%1 = tail call i32 @_ada_use_c2phc(i32 397, i32* undef, i32* undef, double* undef)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ accumulate(int);
int main(int argc, const char *argv[]) {
  accumulate((int)argv[1]);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%edi
call   1030 <accumulate@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = load i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = ptrtoint i8* %8 to i32
%10 = call i32 @accumulate(i32 %9)
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = ptrtoint i8* %4 to i64
%6 = trunc i64 %5 to i32
%7 = tail call i32 @accumulate(i32 %6)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void print_indent(int indent) {
  int i;
  for (i = 0; i < indent; i++)
    printf(" ");
}


x86 assembly (clang, -O0):
<print_indent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <print_indent+0x38>
lea    0xecb(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <print_indent+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_indent>:
push   %rbx
test   %edi,%edi
jle    112f <print_indent+0x1f>
mov    %edi,%ebx
nopw   0x0(%rax,%rax,1)
mov    $0x20,%edi
call   1030 <putchar@plt>
add    $0xffffffff,%ebx
jne    1120 <print_indent+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @print_indent(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @putchar(i32 32)
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
int algorithm(int n) {
  int i = 0;
  int S = 0;
  for (i = 1; i <= n; i++) {
    S += i;
  }
  return S;
}


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

x86 assembly (clang, -O2):
<algorithm>:
test   %edi,%edi
jle    1118 <algorithm+0x18>
lea    -0x1(%rdi),%eax
lea    -0x2(%rdi),%ecx
imul   %rax,%rcx
shr    %rcx
lea    (%rcx,%rdi,2),%eax
add    $0xffffffff,%eax
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @algorithm(i32 %0) {
%2 = icmp slt i32 %0, 1
br i1 %2, label %14, label %3
3: ; preds = %1
%4 = shl nuw i32 %0, 1
%5 = add nsw i32 %0, -1
%6 = zext i32 %5 to i33
%7 = add nsw i32 %0, -2
%8 = zext i32 %7 to i33
%9 = mul i33 %6, %8
%10 = lshr i33 %9, 1
%11 = trunc i33 %10 to i32
%12 = add i32 %4, %11
%13 = add i32 %12, -1
br label %14
14: ; preds = %3, %1
%15 = phi i32 [ 0, %1 ], [ %13, %3 ]
ret i32 %15
}
int compressed_int_lc(unsigned char buf[]) {
  int i = 0;
  while ((buf[i] & 128) != 0)
    i++;
  return (i + 1);
}


x86 assembly (clang, -O0):
<compressed_int_lc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     1137 <compressed_int_lc+0x37>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <compressed_int_lc+0xf>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compressed_int_lc>:
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x0,(%rdi,%rax,1)
lea    0x1(%rax),%rax
js     1110 <compressed_int_lc+0x10>
ret

LLVM IR (-O0):
define i32 @compressed_int_lc(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %13, %1
%5 = load i8*, i8** %2
%6 = load i32, i32* %3
%7 = sext i32 %6 to i64
%8 = getelementptr inbounds i8, i8* %5, i64 %7
%9 = load i8, i8* %8
%10 = zext i8 %9 to i32
%11 = and i32 %10, 128
%12 = icmp ne i32 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %4
%14 = load i32, i32* %3
%15 = add nsw i32 %14, 1
store i32 %15, i32* %3
br label %4
16: ; preds = %4
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
ret i32 %18
}

LLVM IR (-O2):
define i32 @compressed_int_lc(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ %7, %2 ], [ 0, %1 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp sgt i8 %5, -1
%7 = add nuw i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nuw nsw i32 %9, 1
ret i32 %10
}
/* Variables and functions */
int parse_ll(char *, long long *);
int parse_seq(char *tok, long long *seq) {
  int ret;
  long long llval;
  ret = parse_ll(tok, &llval);
  if (ret == 0 && llval >= 0) {
    *seq = llval;
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<parse_seq>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x28(%rbp),%rsi
call   1030 <parse_ll@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    115c <parse_seq+0x4c>
cmpq   $0x0,-0x28(%rbp)
jl     115c <parse_seq+0x4c>
mov    -0x28(%rbp),%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1163 <parse_seq+0x53>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parse_seq>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
lea    0x8(%rsp),%rsi
call   1030 <parse_ll@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
test   %ecx,%ecx
jne    113c <parse_seq+0x2c>
mov    0x8(%rsp),%rcx
test   %rcx,%rcx
js     113c <parse_seq+0x2c>
mov    %rcx,(%rbx)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @parse_seq(i8* %0, i64* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i64*
%6 = alloca i32
%7 = alloca i64
store i8* %0, i8** %4
store i64* %1, i64** %5
%8 = load i8*, i8** %4
%9 = call i32 @parse_ll(i8* %8, i64* %7)
store i32 %9, i32* %6
%10 = load i32, i32* %6
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %18
12: ; preds = %2
%13 = load i64, i64* %7
%14 = icmp sge i64 %13, 0
br i1 %14, label %15, label %18
15: ; preds = %12
%16 = load i64, i64* %7
%17 = load i64*, i64** %5
store i64 %16, i64* %17
store i32 0, i32* %3
br label %19
18: ; preds = %12, %2
store i32 -1, i32* %3
br label %19
19: ; preds = %18, %15
%20 = load i32, i32* %3
ret i32 %20
}

LLVM IR (-O2):
define i32 @parse_seq(i8* %0, i64* nocapture writeonly %1) {
%3 = alloca i64
%4 = bitcast i64* %3 to i8*
%5 = call i32 @parse_ll(i8* %0, i64* %3)
%6 = icmp eq i32 %5, 0
%7 = load i64, i64* %3
%8 = icmp sgt i64 %7, -1
%9 = select i1 %6, i1 %8, i1 false
br i1 %9, label %10, label %11
10: ; preds = %2
store i64 %7, i64* %1
br label %11
11: ; preds = %2, %10
%12 = phi i32 [ 0, %10 ], [ -1, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ Assert_real(int, char *, int, char *);
scalar_t__ isascii(int);
void t_isascii_0xd2() {
  Assert_real((isascii(210) == 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_isascii.c",
              1055, ("isascii should be 0 for 0xd2"));
}


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

x86 assembly (clang, -O2):
<t_isascii_0xd2>:
push   %rax
mov    $0xd2,%edi
call   1030 <isascii@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
lea    0xec5(%rip),%rsi
lea    0xf66(%rip),%rcx
mov    $0x41f,%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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd2\00"
define void @t_isascii_0xd2() {
%1 = call i64 @isascii(i32 210)
%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 1055, 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_isascii.c\00"
@.str.1 = [29 x i8] c"isascii should be 0 for 0xd2\00"
define void @t_isascii_0xd2() {
%1 = tail call i64 @isascii(i32 210)
%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 1055, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0))
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, unsigned int, unsigned int, unsigned int);
void decode(unsigned int msr) {
  unsigned int multiplier;
  unsigned int mv;
  multiplier = ((msr >> 8) & 0xFF);
  mv = (((msr & 0xFF) * 16) + 700);
  printf("0x%x means multiplier %d @ %d mV\n", msr, multiplier, mv);
}


x86 assembly (clang, -O0):
<decode>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %eax,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xff,%eax
shl    $0x4,%eax
add    $0x2bc,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb4(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<decode>:
mov    %edi,%eax
movzbl %ah,%edx
movzbl %al,%ecx
shl    $0x4,%ecx
add    $0x2bc,%ecx
lea    0xed8(%rip),%rdi
mov    %eax,%esi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"0x%x means multiplier %d @ %d mV\0A\00"
define void @decode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %2
%5 = load i32, i32* %2
%6 = lshr i32 %5, 8
%7 = and i32 %6, 255
store i32 %7, i32* %3
%8 = load i32, i32* %2
%9 = and i32 %8, 255
%10 = mul i32 %9, 16
%11 = add i32 %10, 700
store i32 %11, i32* %4
%12 = load i32, i32* %2
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %12, i32 %13, i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [34 x i8] c"0x%x means multiplier %d @ %d mV\0A\00"
define void @decode(i32 %0) {
%2 = lshr i32 %0, 8
%3 = and i32 %2, 255
%4 = shl i32 %0, 4
%5 = and i32 %4, 4080
%6 = add nuw nsw i32 %5, 700
%7 = tail call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %3, i32 %6)
ret void
}
void quat_identity(float *dst) {
  dst[0] = 0;
  dst[1] = 0;
  dst[2] = 0;
  dst[3] = 1;
}


x86 assembly (clang, -O0):
<quat_identity>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x4(%rax)
mov    -0x8(%rbp),%rax
xorps  %xmm0,%xmm0
movss  %xmm0,0x8(%rax)
mov    -0x8(%rbp),%rax
movss  0xec9(%rip),%xmm0
movss  %xmm0,0xc(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<quat_identity>:
movaps 0xef9(%rip),%xmm0
movups %xmm0,(%rdi)
ret

LLVM IR (-O0):
define void @quat_identity(float* %0) {
%2 = alloca float*
store float* %0, float** %2
%3 = load float*, float** %2
%4 = getelementptr inbounds float, float* %3, i64 0
store float 0.000000e+00, float* %4
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 1
store float 0.000000e+00, float* %6
%7 = load float*, float** %2
%8 = getelementptr inbounds float, float* %7, i64 2
store float 0.000000e+00, float* %8
%9 = load float*, float** %2
%10 = getelementptr inbounds float, float* %9, i64 3
store float 1.000000e+00, float* %10
ret void
}

LLVM IR (-O2):
define void @quat_identity(float* nocapture writeonly %0) {
%2 = bitcast float* %0 to <4 x float>*
store <4 x float> <float 0.000000e+00, float 0.000000e+00, float 0.000000e+00, float 1.000000e+00>, <4 x float>* %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
void cag_free_str_str(void *x) {
  static struct str_str {
    char *key;
    char *data;
  } * y;
  y = x;
  free(y->key);
  free(y->data);
}


x86 assembly (clang, -O0):
<cag_free_str_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,0x2f09(%rip)
mov    0x2f02(%rip),%rax
mov    (%rax),%rdi
call   1030 <free@plt>
mov    0x2ef3(%rip),%rax
mov    0x8(%rax),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cag_free_str_str>:
push   %rbx
mov    %rdi,%rbx
mov    %rdi,0x2f15(%rip)
mov    (%rdi),%rdi
call   1030 <free@plt>
mov    0x8(%rbx),%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.str_str = type { i8*, i8* }
@cag_free_str_str.y = internal global %struct.str_str* null
define void @cag_free_str_str(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.str_str*
store %struct.str_str* %4, %struct.str_str** @cag_free_str_str.y
%5 = load %struct.str_str*, %struct.str_str** @cag_free_str_str.y
%6 = getelementptr inbounds %struct.str_str, %struct.str_str* %5, i32 0, i32 0
%7 = load i8*, i8** %6
%8 = call i32 @free(i8* %7)
%9 = load %struct.str_str*, %struct.str_str** @cag_free_str_str.y
%10 = getelementptr inbounds %struct.str_str, %struct.str_str* %9, i32 0, i32 1
%11 = load i8*, i8** %10
%12 = call i32 @free(i8* %11)
ret void
}

LLVM IR (-O2):
%struct.str_str = type { i8*, i8* }
@cag_free_str_str.y = internal unnamed_addr global %struct.str_str* null
define void @cag_free_str_str(i8* %0) {
store i8* %0, i8** bitcast (%struct.str_str** @cag_free_str_str.y to i8**)
%2 = bitcast i8* %0 to i8**
%3 = load i8*, i8** %2
%4 = tail call i32 @free(i8* %3)
%5 = getelementptr inbounds i8, i8* %0, i64 8
%6 = bitcast i8* %5 to i8**
%7 = load i8*, i8** %6
%8 = tail call i32 @free(i8* %7)
ret void
}
/* Variables and functions */
int is_divisible(int, int);
bool is_divisible_by_3(int number) { return is_divisible(number, 3); }


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

x86 assembly (clang, -O2):
<is_divisible_by_3>:
mov    $0x3,%esi
jmp    1030 <is_divisible@plt>

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

LLVM IR (-O2):
define i32 @is_divisible_by_3(i32 %0) {
%2 = tail call i32 @is_divisible(i32 %0, i32 3)
ret i32 %2
}
void protocol_textline_endclient(struct client *c) {}


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

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

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

LLVM IR (-O2):
%struct.client = type opaque
define void @protocol_textline_endclient(%struct.client* nocapture %0) {
ret void
}
int getDayCode(int year) {
  int fday;
  fday = (((year - 1) * 365 + (year - 1) / 4 - (year - 1) / 100 +
           (year - 1) / 400) +
          1) %
         7;
  return fday;
}


x86 assembly (clang, -O0):
<getDayCode>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
imul   $0x16d,%eax,%eax
mov    %eax,-0x14(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
sub    $0x1,%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x1,%eax
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getDayCode>:
lea    -0x1(%rdi),%eax
imul   $0x16d,%eax,%ecx
add    $0x2,%edi
test   %eax,%eax
cmovns %eax,%edi
sar    $0x2,%edi
add    %ecx,%edi
cltq
imul   $0xffffffffae147ae1,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
sar    $0x5,%ecx
add    %edx,%ecx
add    %edi,%ecx
imul   $0x51eb851f,%rax,%rax
mov    %rax,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rax
sar    $0x7,%eax
add    %edx,%eax
lea    (%rcx,%rax,1),%edx
add    $0x1,%edx
add    %eax,%ecx
movslq %edx,%rax
imul   $0xffffffff92492493,%rax,%rax
shr    $0x20,%rax
add    %ecx,%eax
add    $0x1,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
add    $0x1,%eax
ret

LLVM IR (-O0):
define i32 @getDayCode(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = sub nsw i32 %4, 1
%6 = mul nsw i32 %5, 365
%7 = load i32, i32* %2
%8 = sub nsw i32 %7, 1
%9 = sdiv i32 %8, 4
%10 = add nsw i32 %6, %9
%11 = load i32, i32* %2
%12 = sub nsw i32 %11, 1
%13 = sdiv i32 %12, 100
%14 = sub nsw i32 %10, %13
%15 = load i32, i32* %2
%16 = sub nsw i32 %15, 1
%17 = sdiv i32 %16, 400
%18 = add nsw i32 %14, %17
%19 = add nsw i32 %18, 1
%20 = srem i32 %19, 7
store i32 %20, i32* %3
%21 = load i32, i32* %3
ret i32 %21
}

LLVM IR (-O2):
define i32 @getDayCode(i32 %0) {
%2 = add nsw i32 %0, -1
%3 = mul nsw i32 %2, 365
%4 = sdiv i32 %2, 4
%5 = sdiv i32 %2, -100
%6 = sdiv i32 %2, 400
%7 = add nsw i32 %4, 1
%8 = add i32 %7, %3
%9 = add i32 %8, %5
%10 = add i32 %9, %6
%11 = srem i32 %10, 7
ret i32 %11
}
void swap(int array[], int left, int right) {
  int temp;
  temp = array[left];
  array[left] = array[right];
  array[right] = temp;
}


x86 assembly (clang, -O0):
<swap>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
pop    %rbp
ret

x86 assembly (clang, -O2):
<swap>:
movslq %esi,%rax
mov    (%rdi,%rax,4),%ecx
movslq %edx,%rdx
mov    (%rdi,%rdx,4),%esi
mov    %esi,(%rdi,%rax,4)
mov    %ecx,(%rdi,%rdx,4)
ret

LLVM IR (-O0):
define void @swap(i32* %0, i32 %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %5
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i32, i32* %8, i64 %10
%12 = load i32, i32* %11
store i32 %12, i32* %7
%13 = load i32*, i32** %4
%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 = load i32*, i32** %4
%19 = load i32, i32* %5
%20 = sext i32 %19 to i64
%21 = getelementptr inbounds i32, i32* %18, i64 %20
store i32 %17, i32* %21
%22 = load i32, i32* %7
%23 = load i32*, i32** %4
%24 = load i32, i32* %6
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds i32, i32* %23, i64 %25
store i32 %22, i32* %26
ret void
}

LLVM IR (-O2):
define void @swap(i32* nocapture %0, i32 %1, i32 %2) {
%4 = sext i32 %1 to i64
%5 = getelementptr inbounds i32, i32* %0, i64 %4
%6 = load i32, i32* %5
%7 = sext i32 %2 to i64
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
store i32 %9, i32* %5
store i32 %6, i32* %8
ret void
}
int sum(int n) { return n * (n + 1) / 2; }


x86 assembly (clang, -O0):
<sum>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
pop    %rbp
ret

x86 assembly (clang, -O2):
<sum>:
lea    0x1(%rdi),%ecx
imul   %edi,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
ret

LLVM IR (-O0):
define i32 @sum(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = load i32, i32* %2
%5 = add nsw i32 %4, 1
%6 = mul nsw i32 %3, %5
%7 = sdiv i32 %6, 2
ret i32 %7
}

LLVM IR (-O2):
define i32 @sum(i32 %0) {
%2 = add nsw i32 %0, 1
%3 = mul nsw i32 %2, %0
%4 = sdiv i32 %3, 2
ret i32 %4
}
/* Variables and functions */
char *malloc(int);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int strlen(char *);
char *get_db_filename(char *prefix, char *extension) {
  int data_len = strlen(prefix);
  int ext_len = strlen(extension);
  char *fname = malloc((data_len + ext_len + 1) * sizeof(char));
  strcpy(fname, prefix);
  strcat(fname, extension);
  return fname;
}


x86 assembly (clang, -O0):
<get_db_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,-0x18(%rbp)
mov    -0x14(%rbp),%eax
add    -0x18(%rbp),%eax
add    $0x1,%eax
cltq
shl    $0x0,%rax
mov    %eax,%edi
call   1050 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1060 <strcat@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_db_filename>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%r12
call   1040 <strlen@plt>
mov    %eax,%r15d
mov    %r14,%rdi
call   1040 <strlen@plt>
lea    (%r15,%rax,1),%edi
add    $0x1,%edi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r12,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1060 <strcat@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define i8* @get_db_filename(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%8 = load i8*, i8** %3
%9 = call i32 @strlen(i8* %8)
store i32 %9, i32* %5
%10 = load i8*, i8** %4
%11 = call i32 @strlen(i8* %10)
store i32 %11, i32* %6
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = add nsw i32 %12, %13
%15 = add nsw i32 %14, 1
%16 = sext i32 %15 to i64
%17 = mul i64 %16, 1
%18 = trunc i64 %17 to i32
%19 = call i8* @malloc(i32 %18)
store i8* %19, i8** %7
%20 = load i8*, i8** %7
%21 = load i8*, i8** %3
%22 = call i32 @strcpy(i8* %20, i8* %21)
%23 = load i8*, i8** %7
%24 = load i8*, i8** %4
%25 = call i32 @strcat(i8* %23, i8* %24)
%26 = load i8*, i8** %7
ret i8* %26
}

LLVM IR (-O2):
define i8* @get_db_filename(i8* %0, i8* %1) {
%3 = tail call i32 @strlen(i8* %0)
%4 = tail call i32 @strlen(i8* %1)
%5 = add i32 %3, 1
%6 = add i32 %5, %4
%7 = tail call i8* @malloc(i32 %6)
%8 = tail call i32 @strcpy(i8* %7, i8* %0)
%9 = tail call i32 @strcat(i8* %7, i8* %1)
ret i8* %7
}
float limat_mix(float value0, float value1, float mix) {
  return (1.0f - mix) * value0 + mix * value1;
}


x86 assembly (clang, -O0):
<limat_mix>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  0xee5(%rip),%xmm0
subss  -0xc(%rbp),%xmm0
movss  -0x4(%rbp),%xmm2
movss  -0xc(%rbp),%xmm1
mulss  -0x8(%rbp),%xmm1
mulss  %xmm2,%xmm0
addss  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<limat_mix>:
movss  0xef8(%rip),%xmm3
subss  %xmm2,%xmm3
mulss  %xmm2,%xmm1
mulss  %xmm3,%xmm0
addss  %xmm1,%xmm0
ret

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

LLVM IR (-O2):
define float @limat_mix(float %0, float %1, float %2) {
%4 = fsub float 1.000000e+00, %2
%5 = fmul float %1, %2
%6 = tail call float @llvm.fmuladd.f32(float %4, float %0, float %5)
ret float %6
}
/* Variables and functions */
int count(int);
int main() { return count(10000); }


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

x86 assembly (clang, -O2):
<main>:
mov    $0x2710,%edi
jmp    1030 <count@plt>

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @count(i32 10000)
ret i32 %1
}
int Compare(int a, int b) {
  if (a > b)
    return 1;
  else if (a < b)
    return -1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<Compare>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jle    1122 <Compare+0x22>
movl   $0x1,-0x4(%rbp)
jmp    1141 <Compare+0x41>
mov    -0x8(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113a <Compare+0x3a>
movl   $0xffffffff,-0x4(%rbp)
jmp    1141 <Compare+0x41>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<Compare>:
xor    %ecx,%ecx
cmp    %esi,%edi
setl   %cl
neg    %ecx
cmp    %esi,%edi
mov    $0x1,%eax
cmovle %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @Compare(i32 %0, i32 %1) {
%3 = icmp sgt i32 %0, %1
%4 = icmp slt i32 %0, %1
%5 = sext i1 %4 to i32
%6 = select i1 %3, i32 1, i32 %5
ret i32 %6
}
void toe_neigh_update(struct neighbour *neigh) {}


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

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

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

LLVM IR (-O2):
%struct.neighbour = type opaque
define void @toe_neigh_update(%struct.neighbour* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ e_abs();
int /*<<< orphan*/ e_bit();
void e_bit_abs() {
  e_abs();
  e_bit();
}


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

x86 assembly (clang, -O2):
<e_bit_abs>:
push   %rax
xor    %eax,%eax
call   1040 <e_abs@plt>
xor    %eax,%eax
pop    %rcx
jmp    1030 <e_bit@plt>

LLVM IR (-O0):
define void @e_bit_abs() {
%1 = call i32 (...) @e_abs()
%2 = call i32 (...) @e_bit()
ret void
}

LLVM IR (-O2):
define void @e_bit_abs() {
%1 = tail call i32 (...) @e_abs()
%2 = tail call i32 (...) @e_bit()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int main() {
  float x;
  int y = 7;
  int z = 3;
  x = (y / (float)z);
  printf("Result=%f\n", x);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x7,-0x8(%rbp)
movl   $0x3,-0xc(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
cvtsi2ssl -0xc(%rbp),%xmm1
divss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [11 x i8] c"Result=%f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca i32
%3 = alloca i32
store i32 7, i32* %2
store i32 3, i32* %3
%4 = load i32, i32* %2
%5 = sitofp i32 %4 to float
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to float
%8 = fdiv float %5, %7
store float %8, float* %1
%9 = load float, float* %1
%10 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [11 x i8] c"Result=%f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0), float 0x4002AAAAA0000000)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ free_s(void *);
void stbi_image_free(void *retval_from_stbi_load) {
  free_s(retval_from_stbi_load);
}


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

x86 assembly (clang, -O2):
<stbi_image_free>:
jmp    1030 <free_s@plt>

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

LLVM IR (-O2):
define void @stbi_image_free(i8* %0) {
%2 = tail call i32 @free_s(i8* %0)
ret void
}
int super_written_barrier(struct bio *bio, unsigned int bytes_done, int error) {
  int a;
  return a;
}


x86 assembly (clang, -O0):
<super_written_barrier>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x14(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
%struct.bio = type opaque
define i32 @super_written_barrier(%struct.bio* %0, i32 %1, i32 %2) {
%4 = alloca %struct.bio*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store %struct.bio* %0, %struct.bio** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%8 = load i32, i32* %7
ret i32 %8
}

LLVM IR (-O2):
%struct.bio = type opaque
define i32 @super_written_barrier(%struct.bio* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 undef
}
/* Variables and functions */
int /*<<< orphan*/ __cut_assert(char *, int, char *, char *, int);
int sum(int, int);
void __CUT__Sum(void) {
  __cut_assert("/scratch/repos/new/home/jordi_armengol_estape/c-scraper/"
               "outputs/2022-01-22/02-19-57/repos/AskDrCatcher/cut-2.4/refs/"
               "heads/master/docs/tutorials/sergei_gnezdov/TestCompute.c",
               7, "Check sum", "3 == sum(1,2)", 3 == sum(1, 2));
}


x86 assembly (clang, -O0):
<__CUT__Sum>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
mov    %eax,%ecx
mov    $0x3,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%r8d
lea    0xeb4(%rip),%rdi
mov    $0x7,%esi
lea    0xf55(%rip),%rdx
lea    0xf58(%rip),%rcx
call   1040 <__cut_assert@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__CUT__Sum>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
call   1030 <sum@plt>
xor    %r8d,%r8d
cmp    $0x3,%eax
sete   %r8b
lea    0xebf(%rip),%rdi
lea    0xf65(%rip),%rdx
lea    0xf68(%rip),%rcx
mov    $0x7,%esi
pop    %rax
jmp    1040 <__cut_assert@plt>

LLVM IR (-O0):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AskDrCatcher/cut-2.4/refs/heads/master/docs/tutorials/sergei_gnezdov/TestCompute.c\00"
@.str.1 = [10 x i8] c"Check sum\00"
@.str.2 = [14 x i8] c"3 == sum(1,2)\00"
define void @__CUT__Sum() {
%1 = call i32 @sum(i32 1, i32 2)
%2 = icmp eq i32 3, %1
%3 = zext i1 %2 to i32
%4 = call i32 @__cut_assert(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [173 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/AskDrCatcher/cut-2.4/refs/heads/master/docs/tutorials/sergei_gnezdov/TestCompute.c\00"
@.str.1 = [10 x i8] c"Check sum\00"
@.str.2 = [14 x i8] c"3 == sum(1,2)\00"
define void @__CUT__Sum() {
%1 = tail call i32 @sum(i32 1, i32 2)
%2 = icmp eq i32 %1, 3
%3 = zext i1 %2 to i32
%4 = tail call i32 @__cut_assert(i8* getelementptr inbounds ([173 x i8], [173 x i8]* @.str, i64 0, i64 0), i32 7, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %3)
ret void
}
/* Variables and functions */
int bar();
int original_foo() { return 1 + bar(); }


x86 assembly (clang, -O0):
<original_foo>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <bar@plt>
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<original_foo>:
push   %rax
xor    %eax,%eax
call   1030 <bar@plt>
add    $0x1,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @original_foo() {
%1 = call i32 (...) @bar()
%2 = add nsw i32 1, %1
ret i32 %2
}

LLVM IR (-O2):
define i32 @original_foo() {
%1 = tail call i32 (...) @bar()
%2 = add nsw i32 %1, 1
ret i32 %2
}
/* Type definitions */
struct xylo {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ free(struct xylo *);
int /*<<< orphan*/ term_xylo(struct xylo *);
void free_xylo(struct xylo *xylo) {
  term_xylo(xylo);
  free(xylo);
}


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

x86 assembly (clang, -O2):
<free_xylo>:
push   %rbx
mov    %rdi,%rbx
call   1040 <term_xylo@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.xylo = type { i32 }
define void @free_xylo(%struct.xylo* %0) {
%2 = alloca %struct.xylo*
store %struct.xylo* %0, %struct.xylo** %2
%3 = load %struct.xylo*, %struct.xylo** %2
%4 = call i32 @term_xylo(%struct.xylo* %3)
%5 = load %struct.xylo*, %struct.xylo** %2
%6 = call i32 @free(%struct.xylo* %5)
ret void
}

LLVM IR (-O2):
%struct.xylo = type { i32 }
define void @free_xylo(%struct.xylo* %0) {
%2 = tail call i32 @term_xylo(%struct.xylo* %0)
%3 = tail call i32 @free(%struct.xylo* %0)
ret void
}
/* Variables and functions */
void *calloc(int, size_t);
int /*<<< orphan*/ usleep(int);
void *wait_calloc(size_t len) {
  void *ret;
  do {
    ret = calloc(1, len);
    if (!ret)
      usleep(10000);
  } while (!ret);
  return ret;
}


x86 assembly (clang, -O0):
<wait_calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1153 <wait_calloc+0x33>
mov    $0x2710,%edi
call   1040 <usleep@plt>
jmp    1158 <wait_calloc+0x38>
cmpq   $0x0,-0x10(%rbp)
setne  %al
xor    $0xff,%al
test   $0x1,%al
jne    112c <wait_calloc+0xc>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wait_calloc>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0x1,%edi
mov    %rbx,%rsi
call   1030 <calloc@plt>
test   %rax,%rax
jne    114e <wait_calloc+0x2e>
mov    $0x2710,%edi
call   1040 <usleep@plt>
jmp    1130 <wait_calloc+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @wait_calloc(i64 %0) {
%2 = tail call i8* @calloc(i32 1, i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1, %4
%5 = tail call i32 @usleep(i32 10000)
%6 = tail call i8* @calloc(i32 1, i64 %0)
%7 = icmp eq i8* %6, null
br i1 %7, label %4, label %8
8: ; preds = %4, %1
%9 = phi i8* [ %2, %1 ], [ %6, %4 ]
ret i8* %9
}
float __wasm_float_max_f32(float lhs, float rhs) {
  if (lhs != lhs)
    return lhs;
  if (rhs != rhs)
    return rhs;
  return lhs > rhs ? lhs : rhs;
}


x86 assembly (clang, -O0):
<__wasm_float_max_f32>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x8(%rbp)
movss  %xmm1,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
ucomiss -0x8(%rbp),%xmm0
jne    1128 <__wasm_float_max_f32+0x28>
jp     1128 <__wasm_float_max_f32+0x28>
jmp    1137 <__wasm_float_max_f32+0x37>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1192 <__wasm_float_max_f32+0x92>
movss  -0xc(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jne    1151 <__wasm_float_max_f32+0x51>
jp     1151 <__wasm_float_max_f32+0x51>
jmp    1160 <__wasm_float_max_f32+0x60>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
jmp    1192 <__wasm_float_max_f32+0x92>
movss  -0x8(%rbp),%xmm0
ucomiss -0xc(%rbp),%xmm0
jbe    117e <__wasm_float_max_f32+0x7e>
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    1188 <__wasm_float_max_f32+0x88>
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<__wasm_float_max_f32>:
ucomiss %xmm0,%xmm0
jp     110e <__wasm_float_max_f32+0xe>
ucomiss %xmm1,%xmm1
jp     110f <__wasm_float_max_f32+0xf>
maxss  %xmm1,%xmm0
ret
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @__wasm_float_max_f32(float %0, float %1) {
%3 = alloca float
%4 = alloca float
%5 = alloca float
store float %0, float* %4
store float %1, float* %5
%6 = load float, float* %4
%7 = load float, float* %4
%8 = fcmp une float %6, %7
br i1 %8, label %9, label %11
9: ; preds = %2
%10 = load float, float* %4
store float %10, float* %3
br label %27
11: ; preds = %2
%12 = load float, float* %5
%13 = load float, float* %5
%14 = fcmp une float %12, %13
br i1 %14, label %15, label %17
15: ; preds = %11
%16 = load float, float* %5
store float %16, float* %3
br label %27
17: ; preds = %11
%18 = load float, float* %4
%19 = load float, float* %5
%20 = fcmp ogt float %18, %19
br i1 %20, label %21, label %23
21: ; preds = %17
%22 = load float, float* %4
br label %25
23: ; preds = %17
%24 = load float, float* %5
br label %25
25: ; preds = %23, %21
%26 = phi float [ %22, %21 ], [ %24, %23 ]
store float %26, float* %3
br label %27
27: ; preds = %25, %15, %9
%28 = load float, float* %3
ret float %28
}

LLVM IR (-O2):
define float @__wasm_float_max_f32(float %0, float %1) {
%3 = fcmp uno float %0, 0.000000e+00
br i1 %3, label %9, label %4
4: ; preds = %2
%5 = fcmp uno float %1, 0.000000e+00
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = fcmp ogt float %0, %1
%8 = select i1 %7, float %0, float %1
br label %9
9: ; preds = %4, %2, %6
%10 = phi float [ %8, %6 ], [ %0, %2 ], [ %1, %4 ]
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ std_err(char *);
badblock() {
  std_err("Usage: mknod name b major minor size_in_blocks\n");
  exit(1);
}


x86 assembly (clang, -O0):
<badblock>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<badblock>:
push   %rax
lea    0xed8(%rip),%rdi
call   1040 <std_err@plt>
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
@.str = [48 x i8] c"Usage: mknod name b major minor size_in_blocks\0A\00"
define i32 @badblock() {
%1 = call i32 @std_err(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [48 x i8] c"Usage: mknod name b major minor size_in_blocks\0A\00"
define i32 @badblock() {
%1 = tail call i32 @std_err(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @exit(i32 1)
unreachable
}