xunge/DecIR huggingface dataset:
/* Variables and functions */
int sprintf(char *, char const *, char const *);
scalar_t__ strlen(char const *);
scalar_t__ xmalloc(scalar_t__);
int asprintf(char **out, const char *fmt, const char *str) {
  *out = (char *)xmalloc(strlen(fmt) + strlen(str) - 1);
  return sprintf(*out, fmt, str);
}


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

x86 assembly (clang, -O2):
<asprintf>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
mov    %rdx,%r14
mov    %rsi,%rbx
mov    %rdi,%r15
mov    %rsi,%rdi
call   1030 <strlen@plt>
mov    %rax,%r12
mov    %r14,%rdi
call   1030 <strlen@plt>
lea    (%r12,%rax,1),%rdi
add    $0xffffffffffffffff,%rdi
call   1040 <xmalloc@plt>
mov    %rax,(%r15)
mov    %rax,%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1050 <sprintf@plt>

LLVM IR (-O0):
define i32 @asprintf(i8** %0, i8* %1, i8* %2) {
%4 = alloca i8**
%5 = alloca i8*
%6 = alloca i8*
store i8** %0, i8*** %4
store i8* %1, i8** %5
store i8* %2, i8** %6
%7 = load i8*, i8** %5
%8 = call i64 @strlen(i8* %7)
%9 = load i8*, i8** %6
%10 = call i64 @strlen(i8* %9)
%11 = add nsw i64 %8, %10
%12 = sub nsw i64 %11, 1
%13 = call i64 @xmalloc(i64 %12)
%14 = inttoptr i64 %13 to i8*
%15 = load i8**, i8*** %4
store i8* %14, i8** %15
%16 = load i8**, i8*** %4
%17 = load i8*, i8** %16
%18 = load i8*, i8** %5
%19 = load i8*, i8** %6
%20 = call i32 @sprintf(i8* %17, i8* %18, i8* %19)
ret i32 %20
}

LLVM IR (-O2):
define i32 @asprintf(i8** nocapture writeonly %0, i8* nocapture %1, i8* %2) {
%4 = tail call i64 @strlen(i8* dereferenceable(1) %1)
%5 = tail call i64 @strlen(i8* dereferenceable(1) %2)
%6 = add i64 %4, -1
%7 = add i64 %6, %5
%8 = tail call i64 @xmalloc(i64 %7)
%9 = inttoptr i64 %8 to i8*
store i8* %9, i8** %0
%10 = tail call i32 @sprintf(i8* dereferenceable(1) %9, i8* dereferenceable(1) %1, i8* %2)
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ sleep(int);
int main(int c, char **v) {
  sleep(10);
  return 1;
}


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    $0xa,%edi
call   1030 <sleep@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 @sleep(i32 10)
ret i32 1
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @sleep(i32 10)
ret i32 1
}
/* Variables and functions */
int /*<<< orphan*/ test_open_dir();
int /*<<< orphan*/ test_ufile_api();
int /*<<< orphan*/ test_ufile_reader();
int main(int argc, char **argv) {
  (void)argc;
  (void)argv;
  test_ufile_api();
  test_ufile_reader();
  test_open_dir();
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <test_ufile_api@plt>
xor    %eax,%eax
call   1050 <test_ufile_reader@plt>
xor    %eax,%eax
call   1040 <test_open_dir@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 i32, i32* %4
%7 = load i8**, i8*** %5
%8 = call i32 (...) @test_ufile_api()
%9 = call i32 (...) @test_ufile_reader()
%10 = call i32 (...) @test_open_dir()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_ufile_api()
%4 = tail call i32 (...) @test_ufile_reader()
%5 = tail call i32 (...) @test_open_dir()
ret i32 0
}
int test_imm_9Euint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x9E << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_9Euint64_lowword_mem(i64* %0) {
%2 = alloca i64*
store i64* %0, i64** %2
%3 = load i64*, i64** %2
%4 = load i64, i64* %3
%5 = and i64 %4, 158
%6 = icmp ne i64 %5, 0
%7 = zext i1 %6 to i64
%8 = select i1 %6, i32 -20, i32 -40
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_imm_9Euint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 158
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ debug(char *, ...);
int G94_f(char *s) {
  debug("G94_f(const char *s) is not yet implemented!\n");
  debug("%s\n", s);
  return 1;
}


x86 assembly (clang, -O0):
<G94_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    -0x8(%rbp),%rsi
lea    0xef9(%rip),%rdi
mov    $0x0,%al
call   1030 <debug@plt>
mov    $0x1,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<G94_f>:
push   %rbx
mov    %rdi,%rbx
lea    0xee5(%rip),%rdi
xor    %eax,%eax
call   1030 <debug@plt>
lea    0xf05(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1030 <debug@plt>
mov    $0x1,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [46 x i8] c"G94_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G94_f(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%4 = load i8*, i8** %2
%5 = call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %4)
ret i32 1
}

LLVM IR (-O2):
@.str = [46 x i8] c"G94_f(const char *s) is not yet implemented!\0A\00"
@.str.1 = [4 x i8] c"%s\0A\00"
define i32 @G94_f(i8* %0) {
%2 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 (i8*, ...) @debug(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %0)
ret i32 1
}
void __VERIFIER_assume(int expression) {
  if (!expression) {
  LOOP:
    goto LOOP;
  };
  return;
}


x86 assembly (clang, -O0):
<__VERIFIER_assume>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <__VERIFIER_assume+0x1b>
jmp    1116 <__VERIFIER_assume+0x16>
jmp    1116 <__VERIFIER_assume+0x16>
pop    %rbp
ret

x86 assembly (clang, -O2):
<__VERIFIER_assume>:
test   %edi,%edi
je     1110 <__VERIFIER_assume+0x10>
ret
cs nopw 0x0(%rax,%rax,1)
nop
jmp    1110 <__VERIFIER_assume+0x10>

LLVM IR (-O0):
define void @__VERIFIER_assume(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp ne i32 %3, 0
br i1 %4, label %7, label %5
5: ; preds = %1
br label %6
6: ; preds = %6, %5
br label %6
7: ; preds = %1
ret void
}

LLVM IR (-O2):
define void @__VERIFIER_assume(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %3, label %4
3: ; preds = %1, %3
br label %3
4: ; preds = %1
ret void
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_initialize_number_of_quaddobl_polynomials(int length) {
  int *b, fail;
  double *c;
  fail = _ada_use_c2phc(383, &length, b, c);
  return fail;
}


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

x86 assembly (clang, -O2):
<syscon_initialize_number_of_quaddobl_polynomials>:
push   %rax
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x17f,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_initialize_number_of_quaddobl_polynomials(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 @_ada_use_c2phc(i32 383, i32* %2, i32* undef, double* undef)
ret i32 %3
}
int ft_isalpha(int c) {
  if ((c >= 65 && c <= 90) || (c >= 97 && c <= 122))
    return (1);
  else
    return (0);
}


x86 assembly (clang, -O0):
<ft_isalpha>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x41,-0x8(%rbp)
jl     111b <ft_isalpha+0x1b>
cmpl   $0x5a,-0x8(%rbp)
jle    112f <ft_isalpha+0x2f>
cmpl   $0x61,-0x8(%rbp)
jl     113b <ft_isalpha+0x3b>
cmpl   $0x7a,-0x8(%rbp)
jg     113b <ft_isalpha+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <ft_isalpha+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ft_isalpha>:
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @ft_isalpha(i32 %0) {
%2 = and i32 %0, -33
%3 = add i32 %2, -65
%4 = icmp ult i32 %3, 26
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Variables and functions */
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char const *, int);
char *gif_filename(char *fn, int size) {
  const char _gif_ending[5] = {0x2e, 0x67, 0x69, 0x66, 0x00};
  char *newfile = (char *)malloc(size + 5);
  memcpy(newfile, fn, size);
  memcpy(&newfile[size], _gif_ending, 5);
  return newfile;
}


x86 assembly (clang, -O0):
<gif_filename>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x11(%rbp)
mov    0xec6(%rip),%al
mov    %al,-0xd(%rbp)
mov    -0xc(%rbp),%edi
add    $0x5,%edi
call   1040 <malloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    -0xc(%rbp),%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rdi
movslq -0xc(%rbp),%rax
add    %rax,%rdi
lea    -0x11(%rbp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    -0x20(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gif_filename>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
mov    %esi,%ebx
mov    %rdi,%r14
movb   $0x0,0xc(%rsp)
movl   $0x6669672e,0x8(%rsp)
66
lea    0x5(%rbx),%edi
call   1040 <malloc@plt>
mov    %rax,%r15
mov    %rax,%rdi
mov    %r14,%rsi
mov    %ebx,%edx
call   1030 <memcpy@plt>
movslq %ebx,%rdi
add    %r15,%rdi
lea    0x8(%rsp),%rsi
mov    $0x5,%edx
call   1030 <memcpy@plt>
mov    %r15,%rax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.gif_filename._gif_ending = [5 x i8] c".gif\00"
define i8* @gif_filename(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [5 x i8]
%6 = alloca i8*
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = bitcast [5 x i8]* %5 to i8*
%8 = load i32, i32* %4
%9 = add nsw i32 %8, 5
%10 = call i64 @malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
store i8* %11, i8** %6
%12 = load i8*, i8** %6
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = call i32 @memcpy(i8* %12, i8* %13, i32 %14)
%16 = load i8*, i8** %6
%17 = load i32, i32* %4
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = getelementptr inbounds [5 x i8], [5 x i8]* %5, i64 0, i64 0
%21 = call i32 @memcpy(i8* %19, i8* %20, i32 5)
%22 = load i8*, i8** %6
ret i8* %22
}

LLVM IR (-O2):
@__const.gif_filename._gif_ending = [5 x i8] c".gif\00"
define i8* @gif_filename(i8* %0, i32 %1) {
%3 = alloca [5 x i8]
%4 = getelementptr inbounds [5 x i8], [5 x i8]* %3, i64 0, i64 0
%5 = add nsw i32 %1, 5
%6 = tail call i64 @malloc(i32 %5)
%7 = inttoptr i64 %6 to i8*
%8 = tail call i32 @memcpy(i8* %7, i8* %0, i32 %1)
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds i8, i8* %7, i64 %9
%11 = call i32 @memcpy(i8* %10, i8* %4, i32 5)
ret i8* %7
}
long asc(const long *w, long len) {
  long acc = 0;
  for (; len > 1; len--, w++) {
    if (*w < *(w + 1))
      acc++;
  }
  return acc;
}


x86 assembly (clang, -O0):
<asc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
cmpq   $0x1,-0x10(%rbp)
jle    1162 <asc+0x62>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
mov    -0x8(%rbp),%rcx
cmp    0x8(%rcx),%rax
jge    1140 <asc+0x40>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1145 <asc+0x45>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <asc+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<asc>:
cmp    $0x2,%rsi
jl     1140 <asc+0x40>
mov    (%rdi),%rcx
add    $0x1,%rsi
add    $0x8,%rdi
xor    %eax,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    (%rdi),%r8
xor    %edx,%edx
cmp    %r8,%rcx
setl   %dl
add    %rdx,%rax
add    $0xffffffffffffffff,%rsi
add    $0x8,%rdi
mov    %r8,%rcx
cmp    $0x2,%rsi
ja     1120 <asc+0x20>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @asc(i64* nocapture %0, i64 %1) {
%3 = icmp sgt i64 %1, 1
br i1 %3, label %4, label %18
4: ; preds = %2
%5 = load i64, i64* %0
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ %12, %6 ], [ %5, %4 ]
%8 = phi i64 [ %15, %6 ], [ 0, %4 ]
%9 = phi i64 [ %16, %6 ], [ %1, %4 ]
%10 = phi i64* [ %11, %6 ], [ %0, %4 ]
%11 = getelementptr inbounds i64, i64* %10, i64 1
%12 = load i64, i64* %11
%13 = icmp slt i64 %7, %12
%14 = zext i1 %13 to i64
%15 = add nuw nsw i64 %8, %14
%16 = add nsw i64 %9, -1
%17 = icmp ugt i64 %9, 2
br i1 %17, label %6, label %18
18: ; preds = %6, %2
%19 = phi i64 [ 0, %2 ], [ %15, %6 ]
ret i64 %19
}
void __dmemory_init(int level, char *file, int line) {}


x86 assembly (clang, -O0):
<__dmemory_init>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @__dmemory_init(i32 %0, i8* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i32
store i32 %0, i32* %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret void
}

LLVM IR (-O2):
define void @__dmemory_init(i32 %0, i8* nocapture %1, i32 %2) {
ret void
}
void nseel_asm_cos_end(void) {}


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

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

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

LLVM IR (-O2):
define void @nseel_asm_cos_end() {
ret void
}
unsigned long _kd_map_hash(char *key) {
  int i;
  unsigned long hashed_key = 5381;
  for (i = 0; key[i] != '\0'; i++) {
    hashed_key = ((hashed_key << 5) + hashed_key) + key[i];
  }
  return hashed_key;
}


x86 assembly (clang, -O0):
<_kd_map_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     115a <_kd_map_hash+0x5a>
mov    -0x18(%rbp),%rax
shl    $0x5,%rax
add    -0x18(%rbp),%rax
mov    -0x8(%rbp),%rcx
movslq -0xc(%rbp),%rdx
movsbq (%rcx,%rdx,1),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <_kd_map_hash+0x17>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_kd_map_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112d <_kd_map_hash+0x2d>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movsbq %cl,%rax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <_kd_map_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @_kd_map_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %11, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i64 [ %10, %4 ], [ 5381, %1 ]
%8 = mul i64 %7, 33
%9 = sext i8 %6 to i64
%10 = add i64 %8, %9
%11 = add nuw nsw i64 %5, 1
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i64 [ 5381, %1 ], [ %10, %4 ]
ret i64 %16
}
double __attribute__((no, noclone)) foo(unsigned int x) {
  return (double)(float)(x | 0xffff0000);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
or     $0xffff0000,%eax
cvtsi2ss %rax,%xmm0
cvtss2sd %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
or     $0xffff0000,%edi
cvtsi2ss %rdi,%xmm0
cvtss2sd %xmm0,%xmm0
ret

LLVM IR (-O0):
define double @foo(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = or i32 %3, -65536
%5 = uitofp i32 %4 to float
%6 = fpext float %5 to double
ret double %6
}

LLVM IR (-O2):
define double @foo(i32 %0) {
%2 = or i32 %0, -65536
%3 = uitofp i32 %2 to float
%4 = fpext float %3 to double
ret double %4
}
char int_to_leds_m$leds$yellow_toggle(void) {
  char result;
  result = leds$leds$yellow_toggle();
  return result;
}


x86 assembly (clang, -O0):
<int_to_leds_m$leds$yellow_toggle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <leds$leds$yellow_toggle@plt>
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<int_to_leds_m$leds$yellow_toggle>:
push   %rax
xor    %eax,%eax
call   1030 <leds$leds$yellow_toggle@plt>
pop    %rcx
ret

LLVM IR (-O0):
define signext i8 @"int_to_leds_m$leds$yellow_toggle"() {
%1 = alloca i8
%2 = call i32 (...) @"leds$leds$yellow_toggle"()
%3 = trunc i32 %2 to i8
store i8 %3, i8* %1
%4 = load i8, i8* %1
ret i8 %4
}

LLVM IR (-O2):
define signext i8 @"int_to_leds_m$leds$yellow_toggle"() {
%1 = tail call i32 (...) @"leds$leds$yellow_toggle"()
%2 = trunc i32 %1 to i8
ret i8 %2
}
int is_cu_tag(int t) {
  if (t == 0x11 || t == 0x3c || t == 0x3d || t == 0x41) {
    return 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<is_cu_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x11,-0x8(%rbp)
je     112f <is_cu_tag+0x2f>
cmpl   $0x3c,-0x8(%rbp)
je     112f <is_cu_tag+0x2f>
cmpl   $0x3d,-0x8(%rbp)
je     112f <is_cu_tag+0x2f>
cmpl   $0x41,-0x8(%rbp)
jne    113b <is_cu_tag+0x3b>
movl   $0x1,-0x4(%rbp)
jmp    1142 <is_cu_tag+0x42>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_cu_tag>:
add    $0xffffffef,%edi
cmp    $0x30,%edi
ja     111e <is_cu_tag+0x1e>
mov    $0x1,%eax
movabs $0x1180000000001,%rcx
bt     %rdi,%rcx
jae    111e <is_cu_tag+0x1e>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @is_cu_tag(i32 %0) {
switch i32 %0, label %2 [
i32 65, label %3
i32 61, label %3
i32 60, label %3
i32 17, label %3
]
2: ; preds = %1
br label %3
3: ; preds = %1, %1, %1, %1, %2
%4 = phi i32 [ 0, %2 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ], [ 1, %1 ]
ret i32 %4
}
/* Variables and functions */
scalar_t__ strcmp(char *, char const *);
char *strstr(char const *, char const *);
int substring_search_match(const char *haystack, const char *needle) {
  char *strstr_result;
  if ((strstr_result = strstr(haystack, needle)) != NULL) {
    if (strcmp(strstr_result, haystack) == 0) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<substring_search_match>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <strstr@plt>
mov    %rax,-0x20(%rbp)
cmp    $0x0,%rax
je     1173 <substring_search_match+0x53>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    116e <substring_search_match+0x4e>
movl   $0x1,-0x4(%rbp)
jmp    117a <substring_search_match+0x5a>
jmp    1173 <substring_search_match+0x53>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<substring_search_match>:
push   %rbx
mov    %rdi,%rbx
call   1040 <strstr@plt>
test   %rax,%rax
je     113e <substring_search_match+0x1e>
mov    %rax,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1142 <substring_search_match+0x22>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @substring_search_match(i8* %0, i8* nocapture %1) {
%3 = tail call i8* @strstr(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %8, label %5
5: ; preds = %2
%6 = tail call i64 @strcmp(i8* %3, i8* %0)
%7 = icmp eq i64 %6, 0
br i1 %7, label %9, label %8
8: ; preds = %5, %2
br label %9
9: ; preds = %5, %8
%10 = phi i32 [ 0, %8 ], [ 1, %5 ]
ret i32 %10
}
/* Variables and functions */
scalar_t__ sqr(double);
double sqrt(scalar_t__);
double module(double x, double y) {
  double m;
  m = sqrt(sqr(x) + sqr(y));
  return (m);
}


x86 assembly (clang, -O0):
<module>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <sqr@plt>
mov    %rax,-0x20(%rbp)
movsd  -0x10(%rbp),%xmm0
call   1030 <sqr@plt>
mov    -0x20(%rbp),%rdi
add    %rax,%rdi
call   1040 <sqrt@plt>
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<module>:
push   %rbx
sub    $0x10,%rsp
movsd  %xmm1,0x8(%rsp)
call   1030 <sqr@plt>
mov    %rax,%rbx
movsd  0x8(%rsp),%xmm0
call   1030 <sqr@plt>
add    %rax,%rbx
mov    %rbx,%rdi
add    $0x10,%rsp
pop    %rbx
jmp    1040 <sqrt@plt>

LLVM IR (-O0):
define double @module(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca double
store double %0, double* %3
store double %1, double* %4
%6 = load double, double* %3
%7 = call i64 @sqr(double %6)
%8 = load double, double* %4
%9 = call i64 @sqr(double %8)
%10 = add nsw i64 %7, %9
%11 = call double @sqrt(i64 %10)
store double %11, double* %5
%12 = load double, double* %5
ret double %12
}

LLVM IR (-O2):
define double @module(double %0, double %1) {
%3 = tail call i64 @sqr(double %0)
%4 = tail call i64 @sqr(double %1)
%5 = add nsw i64 %4, %3
%6 = tail call double @sqrt(i64 %5)
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void usage(void) {
  fprintf(stderr, "usage: factor [-h] [value ...]\n");
  exit(1);
}


x86 assembly (clang, -O0):
<usage>:
push   %rbp
mov    %rsp,%rbp
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<usage>:
push   %rax
mov    0x2eb8(%rip),%rax
mov    (%rax),%edi
lea    0xecf(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [32 x i8] c"usage: factor [-h] [value ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [32 x i8] c"usage: factor [-h] [value ...]\0A\00"
define void @usage() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
void f4(int size) {
  char src[10];
  if (size > 0)
    memset(src, 0, size);
}


x86 assembly (clang, -O0):
<f4>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jle    1133 <f4+0x23>
lea    -0xe(%rbp),%rdi
mov    -0x4(%rbp),%edx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<f4>:
test   %edi,%edi
jle    112a <f4+0x1a>
sub    $0x18,%rsp
mov    %edi,%edx
lea    0xe(%rsp),%rdi
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
define void @f4(i32 %0) {
%2 = alloca i32
%3 = alloca [10 x i8]
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = icmp sgt i32 %4, 0
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%8 = load i32, i32* %2
%9 = call i32 @memset(i8* %7, i32 0, i32 %8)
br label %10
10: ; preds = %6, %1
ret void
}

LLVM IR (-O2):
define void @f4(i32 %0) {
%2 = alloca [10 x i8]
%3 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%4 = icmp sgt i32 %0, 0
br i1 %4, label %5, label %7
5: ; preds = %1
%6 = call i32 @memset(i8* %3, i32 0, i32 %0)
br label %7
7: ; preds = %5, %1
ret void
}
/* Variables and functions */
double Slater_2S_3S(double, double, double);
double Slater_3S_2S(double rij, double xii, double xij) {
  return Slater_2S_3S(rij, xij, xii);
}


x86 assembly (clang, -O0):
<Slater_3S_2S>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
movsd  -0x10(%rbp),%xmm2
call   1030 <Slater_2S_3S@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Slater_3S_2S>:
movaps %xmm1,%xmm3
movaps %xmm2,%xmm1
movaps %xmm3,%xmm2
jmp    1030 <Slater_2S_3S@plt>

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

LLVM IR (-O2):
define double @Slater_3S_2S(double %0, double %1, double %2) {
%4 = tail call double @Slater_2S_3S(double %0, double %2, double %1)
ret double %4
}
/* Variables and functions */
int /*<<< orphan*/ varClearAll();
void progExecuteCLR(void *vp) { varClearAll(); }


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

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

LLVM IR (-O0):
define void @progExecuteCLR(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 (...) @varClearAll()
ret void
}

LLVM IR (-O2):
define void @progExecuteCLR(i8* nocapture readnone %0) {
%2 = tail call i32 (...) @varClearAll()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
void print(int *list, int len) {
  int c;
  for (c = 0; c < len; c++) {
    printf("%d ", list[c]);
  }
  printf("\n");
}


x86 assembly (clang, -O0):
<print>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    1159 <print+0x49>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xebc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1126 <print+0x16>
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print>:
push   %r15
push   %r14
push   %r12
push   %rbx
push   %rax
test   %esi,%esi
jle    1157 <print+0x37>
mov    %rdi,%r15
mov    %esi,%r12d
lea    0xec7(%rip),%r14
xor    %ebx,%ebx
nopl   0x0(%rax,%rax,1)
mov    (%r15,%rbx,4),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    1140 <print+0x20>
mov    $0xa,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
jmp    1030 <putchar@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d \00"
define void @print(i32* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %13
4: ; preds = %2
%5 = zext i32 %1 to i64
br label %6
6: ; preds = %4, %6
%7 = phi i64 [ 0, %4 ], [ %11, %6 ]
%8 = getelementptr inbounds i32, i32* %0, i64 %7
%9 = load i32, i32* %8
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %9)
%11 = add nuw nsw i64 %7, 1
%12 = icmp eq i64 %11, %5
br i1 %12, label %13, label %6
13: ; preds = %6, %2
%14 = tail call i32 @putchar(i32 10)
ret void
}
/* Variables and functions */
int pop();
int /*<<< orphan*/ push(int);
void divide() {
  int divisor = pop();
  int dividend = pop();
  push(dividend / divisor);
}


x86 assembly (clang, -O0):
<divide>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <pop@plt>
mov    %eax,-0x4(%rbp)
mov    $0x0,%al
call   1030 <pop@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cltd
idivl  -0x4(%rbp)
mov    %eax,%edi
call   1040 <push@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<divide>:
push   %rbx
xor    %eax,%eax
call   1030 <pop@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <pop@plt>
cltd
idiv   %ebx
mov    %eax,%edi
pop    %rbx
jmp    1040 <push@plt>

LLVM IR (-O0):
define void @divide() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @pop()
store i32 %3, i32* %1
%4 = call i32 (...) @pop()
store i32 %4, i32* %2
%5 = load i32, i32* %2
%6 = load i32, i32* %1
%7 = sdiv i32 %5, %6
%8 = call i32 @push(i32 %7)
ret void
}

LLVM IR (-O2):
define void @divide() {
%1 = tail call i32 (...) @pop()
%2 = tail call i32 (...) @pop()
%3 = sdiv i32 %2, %1
%4 = tail call i32 @push(i32 %3)
ret void
}
void foo795() {}


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

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

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

LLVM IR (-O2):
define void @foo795() {
ret void
}
/* Type definitions */
typedef char *uint64_t;

/* Variables and functions */
uint64_t processor_cycles(void) {
  uint64_t cycles;
  asm volatile("rdtsc"
               "\n\t"
               "shl     $32, %%rdx"
               "\n\t"
               "or      %%rdx, %%rax"
               : "=a"(cycles)
               :
               : "%rdx", "cc");
  return cycles;
}


x86 assembly (clang, -O0):
<processor_cycles>:
push   %rbp
mov    %rsp,%rbp
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<processor_cycles>:
rdtsc
shl    $0x20,%rdx
or     %rdx,%rax
ret

LLVM IR (-O0):
define i8* @processor_cycles() {
%1 = alloca i8*
%2 = call i8* asm sideeffect "rdtsc\0A\09shl $$32, %rdx\0A\09or %rdx, %rax", "={ax},~{rdx},~{cc},~{dirflag},~{fpsr},~{flags}"()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
ret i8* %3
}

LLVM IR (-O2):
define i8* @processor_cycles() {
%1 = tail call i8* asm sideeffect "rdtsc\0A\09shl $$32, %rdx\0A\09or %rdx, %rax", "={ax},~{rdx},~{cc},~{dirflag},~{fpsr},~{flags}"()
ret i8* %1
}
void send_metric(int mem_value) {}


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

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

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

LLVM IR (-O2):
define void @send_metric(i32 %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ bool_t;

/* Variables and functions */
int /*<<< orphan*/ TRUE;
bool_t _xdr_void(void) { return (TRUE); }


x86 assembly (clang, -O0):
<_xdr_void>:
push   %rbp
mov    %rsp,%rbp
mov    0x2edd(%rip),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<_xdr_void>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%eax
ret

LLVM IR (-O0):
@TRUE = global i32 0
define i32 @_xdr_void() {
%1 = load i32, i32* @TRUE
ret i32 %1
}

LLVM IR (-O2):
@TRUE = global i32 0
define i32 @_xdr_void() {
%1 = load i32, i32* @TRUE
ret i32 %1
}
/* Type definitions */
struct sbuf {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ sbuf_ltrim(struct sbuf *);
int /*<<< orphan*/ sbuf_rtrim(struct sbuf *);
void sbuf_trim(struct sbuf *s) {
  sbuf_ltrim(s);
  sbuf_rtrim(s);
}


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

x86 assembly (clang, -O2):
<sbuf_trim>:
push   %rbx
mov    %rdi,%rbx
call   1030 <sbuf_ltrim@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <sbuf_rtrim@plt>

LLVM IR (-O0):
%struct.sbuf = type { i32 }
define void @sbuf_trim(%struct.sbuf* %0) {
%2 = alloca %struct.sbuf*
store %struct.sbuf* %0, %struct.sbuf** %2
%3 = load %struct.sbuf*, %struct.sbuf** %2
%4 = call i32 @sbuf_ltrim(%struct.sbuf* %3)
%5 = load %struct.sbuf*, %struct.sbuf** %2
%6 = call i32 @sbuf_rtrim(%struct.sbuf* %5)
ret void
}

LLVM IR (-O2):
%struct.sbuf = type { i32 }
define void @sbuf_trim(%struct.sbuf* %0) {
%2 = tail call i32 @sbuf_ltrim(%struct.sbuf* %0)
%3 = tail call i32 @sbuf_rtrim(%struct.sbuf* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *malloc(size_t);
int /*<<< orphan*/ stderr;
void *my_malloc(size_t size) {
  void *outptr = malloc(size);
  if (outptr == NULL) {
    fprintf(stderr, "CUTE: out of memory!\n");
    exit(1);
  }
  return outptr;
}


x86 assembly (clang, -O0):
<my_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1173 <my_malloc+0x43>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
lea    0xe9c(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@stderr = global i32 0
@.str = [22 x i8] c"CUTE: out of memory!\0A\00"
define i8* @my_malloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp eq i8* %6, null
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = load i32, i32* @stderr
%10 = call i32 @fprintf(i32 %9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @exit(i32 1)
unreachable
12: ; preds = %1
%13 = load i8*, i8** %3
ret i8* %13
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [22 x i8] c"CUTE: out of memory!\0A\00"
define noalias i8* @my_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %4, label %8
4: ; preds = %1
%5 = load i32, i32* @stderr
%6 = tail call i32 @fprintf(i32 %5, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %1
ret i8* %2
}
/* Variables and functions */
int elapsedTime(int, int);
double downloadSpeed(int time, int startTime, double bytes) {
  int mtime = elapsedTime(time, startTime);
  double result = bytes / mtime;
  return result;
}


x86 assembly (clang, -O0):
<downloadSpeed>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
movsd  %xmm0,-0x10(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <elapsedTime@plt>
mov    %eax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
cvtsi2sdl -0x14(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x20(%rbp),%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<downloadSpeed>:
push   %rax
movsd  %xmm0,(%rsp)
call   1030 <elapsedTime@plt>
cvtsi2sd %eax,%xmm1
movsd  (%rsp),%xmm0
divsd  %xmm1,%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @downloadSpeed(i32 %0, i32 %1, double %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca double
%7 = alloca i32
%8 = alloca double
store i32 %0, i32* %4
store i32 %1, i32* %5
store double %2, double* %6
%9 = load i32, i32* %4
%10 = load i32, i32* %5
%11 = call i32 @elapsedTime(i32 %9, i32 %10)
store i32 %11, i32* %7
%12 = load double, double* %6
%13 = load i32, i32* %7
%14 = sitofp i32 %13 to double
%15 = fdiv double %12, %14
store double %15, double* %8
%16 = load double, double* %8
ret double %16
}

LLVM IR (-O2):
define double @downloadSpeed(i32 %0, i32 %1, double %2) {
%4 = tail call i32 @elapsedTime(i32 %0, i32 %1)
%5 = sitofp i32 %4 to double
%6 = fdiv double %2, %5
ret double %6
}
/* Type definitions */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int EOF;
int __infer_nondet_int();
int ungetc(int c, FILE *stream) {
  int n;
  FILE tmp;
  tmp = *stream;
  n = __infer_nondet_int();
  if (n)
    return c;
  else
    return EOF;
}


x86 assembly (clang, -O0):
<ungetc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <__infer_nondet_int@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1147 <ungetc+0x37>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1153 <ungetc+0x43>
mov    0x2e9a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ungetc>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <__infer_nondet_int@plt>
test   %eax,%eax
jne    1127 <ungetc+0x17>
mov    0x2ec3(%rip),%rax
mov    (%rax),%ebx
mov    %ebx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@EOF = global i32 0
define i32 @ungetc(i32 %0, i32* nocapture readnone %1) {
%3 = tail call i32 (...) @__infer_nondet_int()
%4 = icmp eq i32 %3, 0
%5 = load i32, i32* @EOF
%6 = select i1 %4, i32 %5, i32 %0
ret i32 %6
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
uint32_t rte_sched_min_val_2_u32(uint32_t x, uint32_t y) {
  return (x < y) ? x : y;
}


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

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

LLVM IR (-O0):
define i64 @rte_sched_min_val_2_u32(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 slt 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 @rte_sched_min_val_2_u32(i64 %0, i64 %1) {
%3 = icmp slt i64 %0, %1
%4 = select i1 %3, i64 %0, i64 %1
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ bckH_calcTick();
int /*<<< orphan*/ bckH_nextTick();
int /*<<< orphan*/ gen_nextTick(double);
int /*<<< orphan*/ part_calcTick();
int /*<<< orphan*/ part_initTick();
int /*<<< orphan*/ part_nextTick(double);
void sim_next_step(void) {
  gen_nextTick(0.1);
  part_initTick();
  bckH_calcTick();
  part_calcTick();
  part_nextTick(0.1);
  bckH_nextTick();
}


x86 assembly (clang, -O0):
<sim_next_step>:
push   %rbp
mov    %rsp,%rbp
movsd  0xe94(%rip),%xmm0
call   1050 <gen_nextTick@plt>
mov    $0x0,%al
call   1040 <part_initTick@plt>
mov    $0x0,%al
call   1030 <bckH_calcTick@plt>
mov    $0x0,%al
call   1070 <part_calcTick@plt>
movsd  0xe72(%rip),%xmm0
call   1060 <part_nextTick@plt>
mov    $0x0,%al
call   1080 <bckH_nextTick@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<sim_next_step>:
push   %rax
movsd  0xe97(%rip),%xmm0
call   1050 <gen_nextTick@plt>
xor    %eax,%eax
call   1040 <part_initTick@plt>
xor    %eax,%eax
call   1030 <bckH_calcTick@plt>
xor    %eax,%eax
call   1070 <part_calcTick@plt>
movsd  0xe75(%rip),%xmm0
call   1060 <part_nextTick@plt>
xor    %eax,%eax
pop    %rcx
jmp    1080 <bckH_nextTick@plt>

LLVM IR (-O0):
define void @sim_next_step() {
%1 = call i32 @gen_nextTick(double 1.000000e-01)
%2 = call i32 (...) @part_initTick()
%3 = call i32 (...) @bckH_calcTick()
%4 = call i32 (...) @part_calcTick()
%5 = call i32 @part_nextTick(double 1.000000e-01)
%6 = call i32 (...) @bckH_nextTick()
ret void
}

LLVM IR (-O2):
define void @sim_next_step() {
%1 = tail call i32 @gen_nextTick(double 1.000000e-01)
%2 = tail call i32 (...) @part_initTick()
%3 = tail call i32 (...) @bckH_calcTick()
%4 = tail call i32 (...) @part_calcTick()
%5 = tail call i32 @part_nextTick(double 1.000000e-01)
%6 = tail call i32 (...) @bckH_nextTick()
ret void
}
/* Variables and functions */
void *memalign(size_t, size_t);
void *aligned_alloc(size_t alignment, size_t size) {
  return memalign(alignment, size);
}


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

x86 assembly (clang, -O2):
<aligned_alloc>:
jmp    1030 <memalign@plt>

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

LLVM IR (-O2):
define noalias i8* @aligned_alloc(i64 %0, i64 %1) {
%3 = tail call i8* @memalign(i64 %0, i64 %1)
ret i8* %3
}
foobar() {
  struct a {
    double k;
  } l;
}


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

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

LLVM IR (-O0):
%struct.a = type { double }
define i32 @foobar() {
%1 = alloca i32
%2 = alloca %struct.a
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @foobar() {
ret i32 undef
}