xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pcg32_boundedrand(int /*<<< orphan*/);
uint32_t __attribute__((no)) ranged_random_pcg32_boundedrand(uint32_t range) {
  return pcg32_boundedrand(range);
}


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

x86 assembly (clang, -O2):
<ranged_random_pcg32_boundedrand>:
jmp    1030 <pcg32_boundedrand@plt>

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

LLVM IR (-O2):
define i32 @ranged_random_pcg32_boundedrand(i32 %0) {
%2 = tail call i32 @pcg32_boundedrand(i32 %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ perror(char *);
void *realloc(void *, size_t);
void *xrealloc(void *ptr, size_t size) {
  void *ret;
  ret = realloc(ptr, size);
  if (!ret)
    perror("realloc");
  return (ret);
}


x86 assembly (clang, -O0):
<xrealloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <realloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1158 <xrealloc+0x38>
lea    0xead(%rip),%rdi
call   1040 <perror@plt>
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrealloc>:
push   %rbx
call   1030 <realloc@plt>
mov    %rax,%rbx
test   %rax,%rax
je     1133 <xrealloc+0x13>
mov    %rbx,%rax
pop    %rbx
ret
lea    0xec6(%rip),%rdi
call   1040 <perror@plt>
jmp    112e <xrealloc+0xe>

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

LLVM IR (-O2):
@.str = [8 x i8] c"realloc\00"
define noalias i8* @xrealloc(i8* nocapture %0, i64 %1) {
%3 = tail call i8* @realloc(i8* %0, i64 %1)
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %7
5: ; preds = %2
%6 = tail call i32 @perror(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %7
7: ; preds = %5, %2
ret i8* %3
}
int comp_float(const void *i, const void *j) {
  if (*(float *)i < *(float *)j)
    return -1;
  else if (*(float *)i > *(float *)j)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<comp_float>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
mov    -0x18(%rbp),%rax
movss  (%rax),%xmm0
ucomiss %xmm1,%xmm0
jbe    1131 <comp_float+0x31>
movl   $0xffffffff,-0x4(%rbp)
jmp    1159 <comp_float+0x59>
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x18(%rbp),%rax
ucomiss (%rax),%xmm0
jbe    1152 <comp_float+0x52>
movl   $0x1,-0x4(%rbp)
jmp    1159 <comp_float+0x59>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<comp_float>:
movss  (%rdi),%xmm0
movss  (%rsi),%xmm1
xor    %ecx,%ecx
ucomiss %xmm1,%xmm0
seta   %cl
ucomiss %xmm0,%xmm1
mov    $0xffffffff,%eax
cmovbe %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @comp_float(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to float*
%4 = load float, float* %3
%5 = bitcast i8* %1 to float*
%6 = load float, float* %5
%7 = fcmp olt float %4, %6
%8 = fcmp ogt float %4, %6
%9 = zext i1 %8 to i32
%10 = select i1 %7, i32 -1, i32 %9
ret i32 %10
}
void ScaleSamples_NEON() {}


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

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

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

LLVM IR (-O2):
define void @ScaleSamples_NEON() {
ret void
}
/* Variables and functions */
double exp(double);
char *gettext(char *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ scanf(char *, double *);
double Exponencial(double x) {
  printf(gettext("Enter a number: "));
  scanf("%lf", &x);
  return (exp(x));
}


x86 assembly (clang, -O0):
<Exponencial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
lea    0xeac(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xea9(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movsd  -0x8(%rbp),%xmm0
call   1050 <exp@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Exponencial>:
push   %rax
movsd  %xmm0,(%rsp)
lea    0xeb3(%rip),%rdi
call   1030 <gettext@plt>
mov    %rax,%rdi
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    %rsp,%rsi
call   1060 <scanf@plt>
movsd  (%rsp),%xmm0
call   1050 <exp@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Exponencial(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @printf(i8* %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @exp(double %6)
ret double %7
}

LLVM IR (-O2):
@.str = [17 x i8] c"Enter a number: \00"
@.str.1 = [4 x i8] c"%lf\00"
define double @Exponencial(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = tail call i8* @gettext(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%4 = tail call i32 @printf(i8* dereferenceable(1) %3)
%5 = call i32 @scanf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), double* %2)
%6 = load double, double* %2
%7 = call double @exp(double %6)
ret double %7
}
/* Variables and functions */
int Random();
int Equilikely(int a, int b) { return (a + (int)((b - a + 1) * Random())); }


x86 assembly (clang, -O0):
<Equilikely>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <Random@plt>
mov    -0x10(%rbp),%ecx
mov    %eax,%edx
mov    -0xc(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Equilikely>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebx
sub    %edi,%esi
lea    0x1(%rsi),%ebp
xor    %eax,%eax
call   1030 <Random@plt>
imul   %ebp,%eax
add    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @Equilikely(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %3
%6 = load i32, i32* %4
%7 = load i32, i32* %3
%8 = sub nsw i32 %6, %7
%9 = add nsw i32 %8, 1
%10 = call i32 (...) @Random()
%11 = mul nsw i32 %9, %10
%12 = add nsw i32 %5, %11
ret i32 %12
}

LLVM IR (-O2):
define i32 @Equilikely(i32 %0, i32 %1) {
%3 = sub i32 1, %0
%4 = add i32 %3, %1
%5 = tail call i32 (...) @Random()
%6 = mul nsw i32 %5, %4
%7 = add nsw i32 %6, %0
ret i32 %7
}
/* Variables and functions */
size_t strlen(char *);
void strlen_constant_Good() {
  int a[10];
  char *s = "hello";
  a[strlen(s)] = 0;
}


x86 assembly (clang, -O0):
<strlen_constant_Good>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
lea    0xee1(%rip),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rdi
call   1030 <strlen@plt>
movl   $0x0,-0x30(%rbp,%rax,4)
add    $0x40,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
define void @strlen_constant_Good() {
%1 = alloca [10 x i32]
%2 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %2
%3 = load i8*, i8** %2
%4 = call i64 @strlen(i8* %3)
%5 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 %4
store i32 0, i32* %5
ret void
}

LLVM IR (-O2):
define void @strlen_constant_Good() {
ret void
}
/* Variables and functions */
int close(int);
int /*<<< orphan*/ err_die(char *, char const *, int /*<<< orphan*/);
int /*<<< orphan*/ errno;
int /*<<< orphan*/ strerror(int /*<<< orphan*/);
void data_close(int data_fd, const char *data_file) {
  if ((close(data_fd)) == -1)
    err_die("could not close data file %s: %s", data_file, strerror(errno));
}


x86 assembly (clang, -O0):
<data_close>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <close@plt>
cmp    $0xffffffff,%eax
jne    1178 <data_close+0x48>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    0x2e81(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
mov    -0x18(%rbp),%rsi
mov    %eax,%edx
lea    0xe8d(%rip),%rdi
call   1040 <err_die@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<data_close>:
push   %rbx
mov    %rsi,%rbx
call   1030 <close@plt>
cmp    $0xffffffff,%eax
je     1140 <data_close+0x10>
pop    %rbx
ret
mov    0x2e99(%rip),%rax
mov    (%rax),%edi
call   1050 <strerror@plt>
lea    0xeab(%rip),%rdi
mov    %rbx,%rsi
mov    %eax,%edx
pop    %rbx
jmp    1040 <err_die@plt>

LLVM IR (-O0):
@.str = [33 x i8] c"could not close data file %s: %s\00"
@errno = global i32 0
define void @data_close(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = call i32 @close(i32 %5)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %13
8: ; preds = %2
%9 = load i8*, i8** %4
%10 = load i32, i32* @errno
%11 = call i32 @strerror(i32 %10)
%12 = call i32 @err_die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %9, i32 %11)
br label %13
13: ; preds = %8, %2
ret void
}

LLVM IR (-O2):
@.str = [33 x i8] c"could not close data file %s: %s\00"
@errno = global i32 0
define void @data_close(i32 %0, i8* %1) {
%3 = tail call i32 @close(i32 %0)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %9
5: ; preds = %2
%6 = load i32, i32* @errno
%7 = tail call i32 @strerror(i32 %6)
%8 = tail call i32 @err_die(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %7)
br label %9
9: ; preds = %5, %2
ret void
}
/* Variables and functions */
int atoi(char *);
int /*<<< orphan*/ gets(char *);
int /*<<< orphan*/ printf(char const *);
int selectUserInt(const char *msg) {
  char val[8] = {0};
  printf("\n\n");
  printf(msg);
  gets(val);
  return atoi(val);
}


x86 assembly (clang, -O0):
<selectUserInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    -0x10(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1040 <memset@plt>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1030 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <gets@plt>
lea    -0x10(%rbp),%rdi
call   1060 <atoi@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<selectUserInt>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
movq   $0x0,0x8(%rsp)
lea    0xea8(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
call   1040 <printf@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   1050 <gets@plt>
mov    %rbx,%rdi
call   1060 <atoi@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
@str = [2 x i8] c"\0A\00"
define i32 @selectUserInt(i8* nocapture %0) {
%2 = alloca i64
%3 = bitcast i64* %2 to i8*
store i64 0, i64* %2
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%5 = tail call i32 @printf(i8* dereferenceable(1) %0)
%6 = call i32 @gets(i8* %3)
%7 = call i32 @atoi(i8* %3)
ret i32 %7
}
/* Variables and functions */
int _Print(int /*<<< orphan*/, int *);
int kprintf(const char *format, ...) {
  register int *varg = (int *)(&format);
  return _Print(0, varg);
}


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

x86 assembly (clang, -O2):
<kprintf>:
push   %rax
mov    %rdi,(%rsp)
mov    %rsp,%rsi
xor    %edi,%edi
call   1030 <_Print@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @kprintf(i8* %0, ...) {
%2 = alloca i8*
%3 = alloca i32*
store i8* %0, i8** %2
%4 = bitcast i8** %2 to i32*
store i32* %4, i32** %3
%5 = load i32*, i32** %3
%6 = call i32 @_Print(i32 0, i32* %5)
ret i32 %6
}

LLVM IR (-O2):
define i32 @kprintf(i8* %0, ...) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = bitcast i8** %2 to i32*
%4 = call i32 @_Print(i32 0, i32* %3)
ret i32 %4
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ read_unixtstamp(char *, int *);
void test_zero_padding() {
  char *str = "1234.1000";
  uint64_t dest;
  read_unixtstamp(str, &dest);
  assert((dest / 1000000000) == 1234 && (dest % 1000000000) == 100000000);
}


x86 assembly (clang, -O0):
<test_zero_padding>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xed1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0xc(%rbp),%rsi
call   1040 <read_unixtstamp@plt>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
xor    %eax,%eax
cmp    $0x4d2,%ecx
mov    %al,-0xd(%rbp)
jne    1175 <test_zero_padding+0x55>
mov    -0xc(%rbp),%eax
mov    $0x3b9aca00,%ecx
cltd
idiv   %ecx
cmp    $0x5f5e100,%edx
sete   %al
mov    %al,-0xd(%rbp)
mov    -0xd(%rbp),%al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_zero_padding>:
push   %rax
lea    0xed8(%rip),%rdi
lea    0x4(%rsp),%rsi
call   1040 <read_unixtstamp@plt>
xor    %edi,%edi
call   1030 <assert@plt>
pop    %rax
ret

LLVM IR (-O0):
@.str = [10 x i8] c"1234.1000\00"
define void @test_zero_padding() {
%1 = alloca i8*
%2 = alloca i32
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @read_unixtstamp(i8* %3, i32* %2)
%5 = load i32, i32* %2
%6 = sdiv i32 %5, 1000000000
%7 = icmp eq i32 %6, 1234
br i1 %7, label %8, label %12
8: ; preds = %0
%9 = load i32, i32* %2
%10 = srem i32 %9, 1000000000
%11 = icmp eq i32 %10, 100000000
br label %12
12: ; preds = %8, %0
%13 = phi i1 [ false, %0 ], [ %11, %8 ]
%14 = zext i1 %13 to i32
%15 = call i32 @assert(i32 %14)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"1234.1000\00"
define void @test_zero_padding() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
%3 = call i32 @read_unixtstamp(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32* %1)
%4 = call i32 @assert(i32 0)
ret void
}
/* Variables and functions */
int rand();
int random_number() {
  int n;
  n = rand() % 10;
  return n;
}


x86 assembly (clang, -O0):
<random_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <rand@plt>
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<random_number>:
push   %rax
xor    %eax,%eax
call   1030 <rand@plt>
cltq
imul   $0x66666667,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    (%rcx,%rcx,4),%ecx
sub    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @random_number() {
%1 = alloca i32
%2 = call i32 (...) @rand()
%3 = srem i32 %2, 10
store i32 %3, i32* %1
%4 = load i32, i32* %1
ret i32 %4
}

LLVM IR (-O2):
define i32 @random_number() {
%1 = tail call i32 (...) @rand()
%2 = srem i32 %1, 10
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ SelectionSort();
int /*<<< orphan*/ assert(int);
int main(void) {
  int array[5], i;
  for (i = 5 - 1; i >= 0; i--)
    array[i] = i;
  SelectionSort();
  for (i = 0; i < 5; i++)
    assert(array[i] == i);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x4,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
jl     1159 <main+0x39>
mov    -0x24(%rbp),%ecx
movslq -0x24(%rbp),%rax
mov    %ecx,-0x20(%rbp,%rax,4)
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x24(%rbp)
jmp    1136 <main+0x16>
mov    $0x0,%al
call   1030 <SelectionSort@plt>
movl   $0x0,-0x24(%rbp)
cmpl   $0x5,-0x24(%rbp)
jge    1197 <main+0x77>
movslq -0x24(%rbp),%rax
mov    -0x20(%rbp,%rax,4),%eax
cmp    -0x24(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1167 <main+0x47>
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca [5 x i32]
%3 = alloca i32
store i32 0, i32* %1
store i32 4, i32* %3
br label %4
4: ; preds = %12, %0
%5 = load i32, i32* %3
%6 = icmp sge i32 %5, 0
br i1 %6, label %7, label %15
7: ; preds = %4
%8 = load i32, i32* %3
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %10
store i32 %8, i32* %11
br label %12
12: ; preds = %7
%13 = load i32, i32* %3
%14 = add nsw i32 %13, -1
store i32 %14, i32* %3
br label %4
15: ; preds = %4
%16 = call i32 (...) @SelectionSort()
store i32 0, i32* %3
br label %17
17: ; preds = %29, %15
%18 = load i32, i32* %3
%19 = icmp slt i32 %18, 5
br i1 %19, label %20, label %32
20: ; preds = %17
%21 = load i32, i32* %3
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [5 x i32], [5 x i32]* %2, i64 0, i64 %22
%24 = load i32, i32* %23
%25 = load i32, i32* %3
%26 = icmp eq i32 %24, %25
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
br label %29
29: ; preds = %20
%30 = load i32, i32* %3
%31 = add nsw i32 %30, 1
store i32 %31, i32* %3
br label %17
32: ; preds = %17
%33 = load i32, i32* %1
ret i32 %33
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @SelectionSort()
%2 = tail call i32 @assert(i32 1)
%3 = tail call i32 @assert(i32 1)
%4 = tail call i32 @assert(i32 1)
%5 = tail call i32 @assert(i32 1)
%6 = tail call i32 @assert(i32 1)
ret i32 0
}
float sht1x_get_temperature(void *sht1x_address) {
  float temperature;
  temperature = -40.1 + *((volatile int *)sht1x_address + 2) * 0.01;
  return (temperature);
}


x86 assembly (clang, -O0):
<sht1x_get_temperature>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%eax
cvtsi2sd %eax,%xmm0
movsd  0xee5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0xee1(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<sht1x_get_temperature>:
cvtsi2sdl 0x8(%rdi),%xmm0
mulsd  0xef3(%rip),%xmm0
addsd  0xef3(%rip),%xmm0
cvtsd2ss %xmm0,%xmm0
ret

LLVM IR (-O0):
define float @sht1x_get_temperature(i8* %0) {
%2 = alloca i8*
%3 = alloca float
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = bitcast i8* %4 to i32*
%6 = getelementptr inbounds i32, i32* %5, i64 2
%7 = load volatile i32, i32* %6
%8 = sitofp i32 %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 1.000000e-02, double -4.010000e+01)
%10 = fptrunc double %9 to float
store float %10, float* %3
%11 = load float, float* %3
ret float %11
}

LLVM IR (-O2):
define float @sht1x_get_temperature(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 8
%3 = bitcast i8* %2 to i32*
%4 = load volatile i32, i32* %3
%5 = sitofp i32 %4 to double
%6 = tail call double @llvm.fmuladd.f64(double %5, double 1.000000e-02, double -4.010000e+01)
%7 = fptrunc double %6 to float
ret float %7
}
void gtk_tree_view_expand_all() {}


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

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

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

LLVM IR (-O2):
define void @gtk_tree_view_expand_all() {
ret void
}
long atou(str)
char *str;
{
  unsigned long value;
  for (value = 0; (isdigit((*str))); ++str)
    value = value * 10 + *str - '0';
  return *str ? -1L : value;
}


x86 assembly (clang, -O0):
<atou>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
je     1162 <atou+0x52>
imul   $0xa,-0x10(%rbp),%rax
mov    -0x8(%rbp),%rcx
movsbq (%rcx),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1124 <atou+0x14>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1182 <atou+0x72>
mov    $0xffffffffffffffff,%rax
mov    %rax,-0x18(%rbp)
jmp    118a <atou+0x7a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<atou>:
movsbl (%rdi),%eax
mov    %eax,%ecx
add    $0xffffffd0,%ecx
cmp    $0x9,%ecx
ja     1143 <atou+0x43>
add    $0x1,%rdi
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    (%rcx,%rcx,4),%rcx
movsbq %al,%rax
lea    (%rax,%rcx,2),%rcx
add    $0xffffffffffffffd0,%rcx
movsbl (%rdi),%eax
mov    %eax,%edx
add    $0xffffffd0,%edx
add    $0x1,%rdi
cmp    $0xa,%edx
jb     1120 <atou+0x20>
jmp    1145 <atou+0x45>
xor    %ecx,%ecx
neg    %al
sbb    %rax,%rax
or     %rcx,%rax
ret

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

LLVM IR (-O2):
define i64 @atou(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -48
%5 = icmp ult i32 %4, 10
br i1 %5, label %6, label %19
6: ; preds = %1, %6
%7 = phi i8 [ %15, %6 ], [ %2, %1 ]
%8 = phi i64 [ %13, %6 ], [ 0, %1 ]
%9 = phi i8* [ %14, %6 ], [ %0, %1 ]
%10 = mul i64 %8, 10
%11 = sext i8 %7 to i64
%12 = add i64 %10, -48
%13 = add i64 %12, %11
%14 = getelementptr inbounds i8, i8* %9, i64 1
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = add nsw i32 %16, -48
%18 = icmp ult i32 %17, 10
br i1 %18, label %6, label %19
19: ; preds = %6, %1
%20 = phi i64 [ 0, %1 ], [ %13, %6 ]
%21 = phi i8 [ %2, %1 ], [ %15, %6 ]
%22 = icmp eq i8 %21, 0
%23 = select i1 %22, i64 %20, i64 -1
ret i64 %23
}
/* Type definitions */
typedef int uint64_t;

/* Variables and functions */
int compareUint64_t(const void *a, const void *b) {
  return (*(uint64_t *)a) - (*(uint64_t *)b);
}


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

x86 assembly (clang, -O2):
<compareUint64_t>:
mov    (%rdi),%eax
sub    (%rsi),%eax
ret

LLVM IR (-O0):
define i32 @compareUint64_t(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = bitcast i8* %5 to i32*
%7 = load i32, i32* %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to i32*
%10 = load i32, i32* %9
%11 = sub nsw i32 %7, %10
ret i32 %11
}

LLVM IR (-O2):
define i32 @compareUint64_t(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to i32*
%4 = load i32, i32* %3
%5 = bitcast i8* %1 to i32*
%6 = load i32, i32* %5
%7 = sub nsw i32 %4, %6
ret i32 %7
}
int is_printable(int character) {
  if (character > 127)
    return 0;
  if (character == 127)
    return 0;
  if (character < ' ') {
    if (character == 10 || character == 13)
      return 1;
    if (character == 9)
      return 1;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<is_printable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x7f,-0x8(%rbp)
jle    111d <is_printable+0x1d>
movl   $0x0,-0x4(%rbp)
jmp    1186 <is_printable+0x86>
cmpl   $0x7f,-0x8(%rbp)
jne    1133 <is_printable+0x33>
movl   $0x0,-0x4(%rbp)
jmp    1186 <is_printable+0x86>
cmpl   $0x20,-0x8(%rbp)
jge    117f <is_printable+0x7f>
cmpl   $0xa,-0x8(%rbp)
je     1151 <is_printable+0x51>
cmpl   $0xd,-0x8(%rbp)
jne    115d <is_printable+0x5d>
movl   $0x1,-0x4(%rbp)
jmp    1186 <is_printable+0x86>
cmpl   $0x9,-0x8(%rbp)
jne    1173 <is_printable+0x73>
movl   $0x1,-0x4(%rbp)
jmp    1186 <is_printable+0x86>
movl   $0x0,-0x4(%rbp)
jmp    1186 <is_printable+0x86>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_printable>:
xor    %eax,%eax
cmp    $0x7e,%edi
jg     112b <is_printable+0x2b>
mov    $0x1,%eax
cmp    $0x1f,%edi
jg     112b <is_printable+0x2b>
add    $0xfffffff7,%edi
mov    $0x0,%eax
cmp    $0x4,%edi
ja     112b <is_printable+0x2b>
movslq %edi,%rax
lea    0xed8(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

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

LLVM IR (-O2):
@switch.table.is_printable = [5 x i32] [i32 1, i32 1, i32 0, i32 0, i32 1]
define i32 @is_printable(i32 %0) {
%2 = icmp sgt i32 %0, 126
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp slt i32 %0, 32
br i1 %4, label %5, label %12
5: ; preds = %3
%6 = add i32 %0, -9
%7 = icmp ult i32 %6, 5
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds [5 x i32], [5 x i32]* @switch.table.is_printable, i64 0, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %5, %8, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ %11, %8 ], [ 0, %5 ]
ret i32 %13
}
/* Variables and functions */
int __VERIFIER_nondet_int();
int main() {
  int x;
  int y;
  x = __VERIFIER_nondet_int();
  y = __VERIFIER_nondet_int();
  if (y <= x) {
    while (x >= 0) {
      x = x - y;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jg     1161 <main+0x51>
jmp    1144 <main+0x34>
cmpl   $0x0,-0x8(%rbp)
jl     115c <main+0x4c>
mov    -0x8(%rbp),%eax
sub    -0xc(%rbp),%eax
mov    %eax,-0x8(%rbp)
jmp    1144 <main+0x34>
jmp    1161 <main+0x51>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1030 <__VERIFIER_nondet_int@plt>
test   %ebx,%ebx
js     1134 <main+0x24>
cmp    %ebx,%eax
jg     1134 <main+0x24>
nopl   0x0(%rax)
sub    %eax,%ebx
jns    1130 <main+0x20>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @__VERIFIER_nondet_int()
%2 = tail call i32 (...) @__VERIFIER_nondet_int()
%3 = icmp sle i32 %2, %1
%4 = icmp sgt i32 %1, -1
%5 = and i1 %4, %3
br i1 %5, label %6, label %10
6: ; preds = %0, %6
%7 = phi i32 [ %8, %6 ], [ %1, %0 ]
%8 = sub nsw i32 %7, %2
%9 = icmp sgt i32 %8, -1
br i1 %9, label %6, label %10
10: ; preds = %6, %0
ret i32 0
}
signed int signedint_ignoring_shortint(signed int x, short int y) { return x; }


x86 assembly (clang, -O0):
<signedint_ignoring_shortint>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %edi,-0x4(%rbp)
mov    %ax,-0x6(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<signedint_ignoring_shortint>:
mov    %edi,%eax
ret

LLVM IR (-O0):
define i32 @signedint_ignoring_shortint(i32 %0, i16 signext %1) {
%3 = alloca i32
%4 = alloca i16
store i32 %0, i32* %3
store i16 %1, i16* %4
%5 = load i32, i32* %3
ret i32 %5
}

LLVM IR (-O2):
define i32 @signedint_ignoring_shortint(i32 returned %0, i16 signext %1) {
ret i32 %0
}
/* Variables and functions */
void lim_outc(char c, size_t *pos, char *buf, size_t bufsz) {
  if (*pos < bufsz) {
    buf[*pos] = c;
  }
  *pos += 1;
}


x86 assembly (clang, -O0):
<lim_outc>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
cmp    -0x20(%rbp),%rax
jae    1138 <lim_outc+0x38>
mov    -0x1(%rbp),%dl
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
mov    (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x10(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<lim_outc>:
mov    (%rsi),%rax
cmp    %rcx,%rax
jae    110f <lim_outc+0xf>
mov    %dil,(%rdx,%rax,1)
mov    (%rsi),%rax
add    $0x1,%rax
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @lim_outc(i8 signext %0, i64* nocapture %1, i8* nocapture writeonly %2, i64 %3) {
%5 = load i64, i64* %1
%6 = icmp ult i64 %5, %3
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = getelementptr inbounds i8, i8* %2, i64 %5
store i8 %0, i8* %8
%9 = load i64, i64* %1
br label %10
10: ; preds = %7, %4
%11 = phi i64 [ %9, %7 ], [ %5, %4 ]
%12 = add i64 %11, 1
store i64 %12, i64* %1
ret void
}
/* Variables and functions */
void *wmalloc(size_t);
void *wcalloc(size_t count, size_t size) {
  void *p = wmalloc(size * count);
  return p;
}


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

x86 assembly (clang, -O2):
<wcalloc>:
imul   %rsi,%rdi
jmp    1030 <wmalloc@plt>

LLVM IR (-O0):
define i8* @wcalloc(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
%5 = alloca i8*
store i64 %0, i64* %3
store i64 %1, i64* %4
%6 = load i64, i64* %4
%7 = load i64, i64* %3
%8 = mul i64 %6, %7
%9 = call i8* @wmalloc(i64 %8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
ret i8* %10
}

LLVM IR (-O2):
define i8* @wcalloc(i64 %0, i64 %1) {
%3 = mul i64 %1, %0
%4 = tail call i8* @wmalloc(i64 %3)
ret i8* %4
}
/* Variables and functions */
int get_byte(unsigned char *);
int get_word(unsigned char *s) { return get_byte(s) * 256 + get_byte(s + 2); }


x86 assembly (clang, -O0):
<get_word>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <get_byte@plt>
shl    $0x8,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1030 <get_byte@plt>
mov    %eax,%ecx
mov    -0xc(%rbp),%eax
add    %ecx,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_word>:
push   %rbp
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1030 <get_byte@plt>
mov    %eax,%ebp
shl    $0x8,%ebp
add    $0x2,%rbx
mov    %rbx,%rdi
call   1030 <get_byte@plt>
add    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define i32 @get_word(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @get_byte(i8* %3)
%5 = mul nsw i32 %4, 256
%6 = load i8*, i8** %2
%7 = getelementptr inbounds i8, i8* %6, i64 2
%8 = call i32 @get_byte(i8* %7)
%9 = add nsw i32 %5, %8
ret i32 %9
}

LLVM IR (-O2):
define i32 @get_word(i8* %0) {
%2 = tail call i32 @get_byte(i8* %0)
%3 = shl nsw i32 %2, 8
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = tail call i32 @get_byte(i8* %4)
%6 = add nsw i32 %3, %5
ret i32 %6
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;
typedef int /*<<< orphan*/ digest;

/* Variables and functions */
int /*<<< orphan*/ MD5hash(int /*<<< orphan*/ *, int /*<<< orphan*/ *, int);
uint32_t rnd(void *buffer) {
  uint32_t *digest = (uint32_t *)buffer;
  if (!digest)
    return (0);
  MD5hash(digest, digest, sizeof(digest));
  return (digest[0]);
}


x86 assembly (clang, -O0):
<rnd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    113b <rnd+0x2b>
movl   $0x0,-0x4(%rbp)
jmp    1156 <rnd+0x46>
mov    -0x18(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    $0x8,%edx
call   1030 <MD5hash@plt>
mov    -0x18(%rbp),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rnd>:
test   %rdi,%rdi
je     112a <rnd+0x1a>
push   %rbx
mov    %rdi,%rbx
mov    %rdi,%rsi
mov    $0x8,%edx
call   1030 <MD5hash@plt>
mov    (%rbx),%eax
pop    %rbx
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @rnd(i8* %0) {
%2 = bitcast i8* %0 to i32*
%3 = icmp eq i8* %0, null
br i1 %3, label %7, label %4
4: ; preds = %1
%5 = tail call i32 @MD5hash(i32* %2, i32* %2, i32 8)
%6 = load i32, i32* %2
br label %7
7: ; preds = %1, %4
%8 = phi i32 [ %6, %4 ], [ 0, %1 ]
ret i32 %8
}
void caller_with_value_site_never_called1() {}


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

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

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

LLVM IR (-O2):
define void @caller_with_value_site_never_called1() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test_dictree();
int /*<<< orphan*/ test_list();
int /*<<< orphan*/ test_listmap();
int /*<<< orphan*/ test_str();
int main(int argc, char **argv) {
  test_dictree();
  test_list();
  test_listmap();
  test_str();
  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   1040 <test_dictree@plt>
mov    $0x0,%al
call   1050 <test_list@plt>
mov    $0x0,%al
call   1060 <test_listmap@plt>
mov    $0x0,%al
call   1030 <test_str@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_dictree@plt>
xor    %eax,%eax
call   1050 <test_list@plt>
xor    %eax,%eax
call   1060 <test_listmap@plt>
xor    %eax,%eax
call   1030 <test_str@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 = call i32 (...) @test_dictree()
%7 = call i32 (...) @test_list()
%8 = call i32 (...) @test_listmap()
%9 = call i32 (...) @test_str()
ret i32 0
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @test_dictree()
%4 = tail call i32 (...) @test_list()
%5 = tail call i32 (...) @test_listmap()
%6 = tail call i32 (...) @test_str()
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ register_sip_function_list();
void sip_init() { register_sip_function_list(); }


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

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

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

LLVM IR (-O2):
define void @sip_init() {
%1 = tail call i32 (...) @register_sip_function_list()
ret void
}
/* Variables and functions */
void glmCompMult3fv(float out[3], const float x[3], const float y[3]) {
  for (size_t i = 0; i < 3; ++i)
    out[i] = x[i] * y[i];
}


x86 assembly (clang, -O0):
<glmCompMult3fv>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x3,-0x20(%rbp)
jae    115b <glmCompMult3fv+0x5b>
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x20(%rbp),%rcx
mulss  (%rax,%rcx,4),%xmm0
mov    -0x8(%rbp),%rax
mov    -0x20(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <glmCompMult3fv+0x18>
pop    %rbp
ret

x86 assembly (clang, -O2):
<glmCompMult3fv>:
movss  (%rsi),%xmm0
mulss  (%rdx),%xmm0
movss  %xmm0,(%rdi)
movss  0x4(%rsi),%xmm0
mulss  0x4(%rdx),%xmm0
movss  %xmm0,0x4(%rdi)
movss  0x8(%rsi),%xmm0
mulss  0x8(%rdx),%xmm0
movss  %xmm0,0x8(%rdi)
ret

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

LLVM IR (-O2):
define void @glmCompMult3fv(float* nocapture writeonly %0, float* nocapture %1, float* nocapture %2) {
%4 = load float, float* %1
%5 = load float, float* %2
%6 = fmul float %4, %5
store float %6, float* %0
%7 = getelementptr inbounds float, float* %1, i64 1
%8 = load float, float* %7
%9 = getelementptr inbounds float, float* %2, i64 1
%10 = load float, float* %9
%11 = fmul float %8, %10
%12 = getelementptr inbounds float, float* %0, i64 1
store float %11, float* %12
%13 = getelementptr inbounds float, float* %1, i64 2
%14 = load float, float* %13
%15 = getelementptr inbounds float, float* %2, i64 2
%16 = load float, float* %15
%17 = fmul float %14, %16
%18 = getelementptr inbounds float, float* %0, i64 2
store float %17, float* %18
ret void
}
/* Variables and functions */
int /*<<< orphan*/ call6k();
void call6j(unsigned long ul) {
  ul = ul;
  call6k();
}


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

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

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

LLVM IR (-O2):
define void @call6j(i64 %0) {
%2 = tail call i32 (...) @call6k()
ret void
}
/* Variables and functions */
scalar_t__ strcmp(char *, char *);
int equal_string(void *s1, void *s2) {
  char *s1S = (char *)s1;
  char *s2S = (char *)s2;
  if (strcmp(s1S, s2S) == 0) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<equal_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1153 <equal_string+0x43>
movl   $0x1,-0x4(%rbp)
jmp    115a <equal_string+0x4a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<equal_string>:
push   %rax
call   1030 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
sete   %cl
mov    %ecx,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @equal_string(i8* %0, i8* %1) {
%3 = tail call i64 @strcmp(i8* %0, i8* %1)
%4 = icmp eq i64 %3, 0
%5 = zext i1 %4 to i32
ret i32 %5
}
int *test3(int *a) { return a - 1; }


x86 assembly (clang, -O0):
<test3>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0xfffffffffffffffc,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test3>:
lea    -0x4(%rdi),%rax
ret

LLVM IR (-O0):
define i32* @test3(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = getelementptr inbounds i32, i32* %3, i64 -1
ret i32* %4
}

LLVM IR (-O2):
define i32* @test3(i32* readnone %0) {
%2 = getelementptr inbounds i32, i32* %0, i64 -1
ret i32* %2
}
/* Variables and functions */
double atof(char *);
int /*<<< orphan*/ getline(char *, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  char numb[100];
  while (1) {
    getline(numb, 100);
    printf("%f\n", atof(numb));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
lea    -0x70(%rbp),%rdi
call   1030 <atof@plt>
lea    0xea3(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    %rsp,%rbx
lea    0xebf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
mov    $0x64,%esi
call   1050 <getline@plt>
mov    %rbx,%rdi
call   1030 <atof@plt>
mov    %r14,%rdi
call   1040 <printf@plt>
jmp    1150 <main+0x20>

LLVM IR (-O0):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
store i32 0, i32* %1
br label %3
3: ; preds = %0, %3
%4 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%5 = call i32 @getline(i8* %4, i32 100)
%6 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 0
%7 = call double @atof(i8* %6)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %7)
br label %3
}

LLVM IR (-O2):
@.str = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
br label %3
3: ; preds = %3, %0
%4 = call i32 @getline(i8* %2, i32 100)
%5 = call double @atof(i8* %2)
%6 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %5)
br label %3
}
int k_setpag(void) { return 0; }


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

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

LLVM IR (-O0):
define i32 @k_setpag() {
ret i32 0
}

LLVM IR (-O2):
define i32 @k_setpag() {
ret i32 0
}
void kasan_cache_shrink(struct kmem_cache *cache) {}


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

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

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

LLVM IR (-O2):
%struct.kmem_cache = type opaque
define void @kasan_cache_shrink(%struct.kmem_cache* nocapture %0) {
ret void
}