xunge/DecIR huggingface dataset:
int SVN_RevNumber(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @SVN_RevNumber() {
ret i32 0
}
/* Variables and functions */
size_t strlen(const char *str) {
  size_t i;
  for (i = 0; str[i] != 0; i++)
    ;
  return i;
}


x86 assembly (clang, -O0):
<strlen>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     113b <strlen+0x3b>
jmp    112a <strlen+0x2a>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <strlen+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strlen>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <strlen+0x10>
ret

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

LLVM IR (-O2):
define i64 @strlen(i8* nocapture %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i64 [ 0, %1 ], [ %7, %2 ]
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = load i8, i8* %4
%6 = icmp eq i8 %5, 0
%7 = add i64 %3, 1
br i1 %6, label %8, label %2
8: ; preds = %2
ret i64 %3
}
/* Variables and functions */
double moonphase(double, int);
extern double moonphasebylunation(int lun, int phi) {
  double k;
  k = lun + phi / 4.0;
  return moonphase(k, phi);
}


x86 assembly (clang, -O0):
<moonphasebylunation>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
cvtsi2sdl -0x8(%rbp),%xmm1
movsd  0xed0(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%edi
call   1030 <moonphase@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<moonphasebylunation>:
cvtsi2sd %edi,%xmm1
cvtsi2sd %esi,%xmm0
mulsd  0xee0(%rip),%xmm0
addsd  %xmm1,%xmm0
mov    %esi,%edi
jmp    1030 <moonphase@plt>

LLVM IR (-O0):
define double @moonphasebylunation(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca double
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = sitofp i32 %6 to double
%8 = load i32, i32* %4
%9 = sitofp i32 %8 to double
%10 = fdiv double %9, 4.000000e+00
%11 = fadd double %7, %10
store double %11, double* %5
%12 = load double, double* %5
%13 = load i32, i32* %4
%14 = call double @moonphase(double %12, i32 %13)
ret double %14
}

LLVM IR (-O2):
define double @moonphasebylunation(i32 %0, i32 %1) {
%3 = sitofp i32 %0 to double
%4 = sitofp i32 %1 to double
%5 = fmul double %4, 2.500000e-01
%6 = fadd double %5, %3
%7 = tail call double @moonphase(double %6, i32 %1)
ret double %7
}
long unsigned int getStringLength(const char *___st___, char ___tm___) {
  long unsigned int ___cn___ = 0;
  while (*(___st___ + ___cn___) != ___tm___) {
    ___cn___++;
  }
  return ___cn___;
}


x86 assembly (clang, -O0):
<getStringLength>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
je     113f <getStringLength+0x3f>
mov    -0x18(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x18(%rbp)
jmp    1116 <getStringLength+0x16>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getStringLength>:
mov    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
mov    %rax,%rcx
add    $0x1,%rax
cmp    %sil,0x1(%rdi,%rcx,1)
jne    1110 <getStringLength+0x10>
ret

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

LLVM IR (-O2):
define i64 @getStringLength(i8* nocapture %0, i8 signext %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i64 [ 0, %2 ], [ %8, %3 ]
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %1
%8 = add i64 %4, 1
br i1 %7, label %9, label %3
9: ; preds = %3
ret i64 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int const, int const, int const);
void multiply_numbers(const int a, const int b) {
  ((void)0);
  if ((a * b) == 777) {
    ((void)0);
  }
  printf("%d * %d = %d\n", a, b, a * b);
}


x86 assembly (clang, -O0):
<multiply_numbers>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
imul   -0x8(%rbp),%eax
cmp    $0x309,%eax
jne    1135 <multiply_numbers+0x25>
jmp    1135 <multiply_numbers+0x25>
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0x4(%rbp),%ecx
imul   -0x8(%rbp),%ecx
lea    0xeb7(%rip),%rdi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<multiply_numbers>:
mov    %esi,%edx
mov    %edi,%esi
mov    %edx,%ecx
imul   %edi,%ecx
lea    0xee0(%rip),%rdi
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"%d * %d = %d\0A\00"
define void @multiply_numbers(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 = mul nsw i32 %5, %6
%8 = icmp eq i32 %7, 777
br i1 %8, label %9, label %10
9: ; preds = %2
br label %10
10: ; preds = %9, %2
%11 = load i32, i32* %3
%12 = load i32, i32* %4
%13 = load i32, i32* %3
%14 = load i32, i32* %4
%15 = mul nsw i32 %13, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %11, i32 %12, i32 %15)
ret void
}

LLVM IR (-O2):
@.str = [14 x i8] c"%d * %d = %d\0A\00"
define void @multiply_numbers(i32 %0, i32 %1) {
%3 = mul nsw i32 %1, %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0), i32 %0, i32 %1, i32 %3)
ret void
}
/* Variables and functions */
scalar_t__ isspace(char const);
const char *skip_white(const char *line) {
  while (*line && isspace(*line))
    line++;
  return line;
}


x86 assembly (clang, -O0):
<skip_white>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%ecx
xor    %eax,%eax
cmp    $0x0,%ecx
mov    %al,-0x9(%rbp)
je     1147 <skip_white+0x37>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
setne  %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
test   $0x1,%al
jne    1157 <skip_white+0x47>
jmp    1168 <skip_white+0x58>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <skip_white+0xc>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_white>:
push   %rbx
mov    %rdi,%rbx
mov    (%rdi),%al
test   %al,%al
je     1139 <skip_white+0x29>
nopw   0x0(%rax,%rax,1)
movsbl %al,%edi
call   1030 <isspace@plt>
test   %rax,%rax
je     1139 <skip_white+0x29>
movzbl 0x1(%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <skip_white+0x10>
mov    %rbx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @skip_white(i8* %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %9
%5 = phi i8 [ %11, %9 ], [ %2, %1 ]
%6 = phi i8* [ %10, %9 ], [ %0, %1 ]
%7 = tail call i64 @isspace(i8 signext %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %4
%10 = getelementptr inbounds i8, i8* %6, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %9, %1
%14 = phi i8* [ %0, %1 ], [ %10, %9 ], [ %6, %4 ]
ret i8* %14
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void ez_def_mutex_destroy(void *_mutex) {
  free(_mutex);
  _mutex = ((void *)0);
}


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

x86 assembly (clang, -O2):
<ez_def_mutex_destroy>:
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @ez_def_mutex_destroy(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Type definitions */
struct PdSocket {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_SNDBUF;
int pd_socket_int_option(struct PdSocket *, int /*<<< orphan*/,
                         int /*<<< orphan*/, int);
int pd_socket_send_buffer(struct PdSocket *sock, int size) {
  return pd_socket_int_option(sock, SOL_SOCKET, SO_SNDBUF, size);
}


x86 assembly (clang, -O0):
<pd_socket_send_buffer>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
mov    0x2ebe(%rip),%rax
mov    (%rax),%esi
mov    0x2ead(%rip),%rax
mov    (%rax),%edx
mov    -0xc(%rbp),%ecx
call   1030 <pd_socket_int_option@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<pd_socket_send_buffer>:
mov    %esi,%ecx
mov    0x2ecf(%rip),%rax
mov    (%rax),%esi
mov    0x2ebe(%rip),%rax
mov    (%rax),%edx
jmp    1030 <pd_socket_int_option@plt>

LLVM IR (-O0):
%struct.PdSocket = type { i32 }
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
define i32 @pd_socket_send_buffer(%struct.PdSocket* %0, i32 %1) {
%3 = alloca %struct.PdSocket*
%4 = alloca i32
store %struct.PdSocket* %0, %struct.PdSocket** %3
store i32 %1, i32* %4
%5 = load %struct.PdSocket*, %struct.PdSocket** %3
%6 = load i32, i32* @SOL_SOCKET
%7 = load i32, i32* @SO_SNDBUF
%8 = load i32, i32* %4
%9 = call i32 @pd_socket_int_option(%struct.PdSocket* %5, i32 %6, i32 %7, i32 %8)
ret i32 %9
}

LLVM IR (-O2):
%struct.PdSocket = type { i32 }
@SOL_SOCKET = global i32 0
@SO_SNDBUF = global i32 0
define i32 @pd_socket_send_buffer(%struct.PdSocket* %0, i32 %1) {
%3 = load i32, i32* @SOL_SOCKET
%4 = load i32, i32* @SO_SNDBUF
%5 = tail call i32 @pd_socket_int_option(%struct.PdSocket* %0, i32 %3, i32 %4, i32 %1)
ret i32 %5
}
int stdbl(val, p)
double val;
register char *p;
{
  union {
    double rval;
    char sval[8];
  } x;
  char *q;
  int i;
  x.rval = val;
  q = x.sval;
  p += 8;
  for (i = 0; i < 8; i++)
    *--p = *q++;
  return (0);
}


x86 assembly (clang, -O0):
<stdbl>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
mov    %rdi,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
lea    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
cmpl   $0x8,-0x24(%rbp)
jge    116d <stdbl+0x6d>
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x20(%rbp)
mov    (%rax),%cl
mov    -0x10(%rbp),%rax
mov    %rax,%rdx
add    $0xffffffffffffffff,%rdx
mov    %rdx,-0x10(%rbp)
mov    %cl,-0x1(%rax)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1132 <stdbl+0x32>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<stdbl>:
movq   %xmm0,%rax
bswap  %rax
mov    %rax,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @stdbl(double %0, i8* nocapture writeonly %1) {
%3 = bitcast double %0 to i64
%4 = trunc i64 %3 to i8
%5 = getelementptr inbounds i8, i8* %1, i64 7
store i8 %4, i8* %5
%6 = lshr i64 %3, 8
%7 = trunc i64 %6 to i8
%8 = getelementptr inbounds i8, i8* %1, i64 6
store i8 %7, i8* %8
%9 = lshr i64 %3, 16
%10 = trunc i64 %9 to i8
%11 = getelementptr inbounds i8, i8* %1, i64 5
store i8 %10, i8* %11
%12 = lshr i64 %3, 24
%13 = trunc i64 %12 to i8
%14 = getelementptr inbounds i8, i8* %1, i64 4
store i8 %13, i8* %14
%15 = lshr i64 %3, 32
%16 = trunc i64 %15 to i8
%17 = getelementptr inbounds i8, i8* %1, i64 3
store i8 %16, i8* %17
%18 = lshr i64 %3, 40
%19 = trunc i64 %18 to i8
%20 = getelementptr inbounds i8, i8* %1, i64 2
store i8 %19, i8* %20
%21 = lshr i64 %3, 48
%22 = trunc i64 %21 to i8
%23 = getelementptr inbounds i8, i8* %1, i64 1
store i8 %22, i8* %23
%24 = lshr i64 %3, 56
%25 = trunc i64 %24 to i8
store i8 %25, i8* %1
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fisher(int, int, int, int, double *, double *, double *);
double fisher0(int a, int b, int c, int d) {
  double p_left = 0;
  double p_right = 0;
  double p_twotail = 0;
  fisher(a, b, c, d, &p_left, &p_right, &p_twotail);
  return p_left;
}


x86 assembly (clang, -O0):
<fisher0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x20(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    -0x18(%rbp),%r8
lea    -0x20(%rbp),%r9
lea    -0x28(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <fisher@plt>
movsd  -0x18(%rbp),%xmm0
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fisher0>:
sub    $0x28,%rsp
movq   $0x0,0x10(%rsp)
movq   $0x0,0x20(%rsp)
movq   $0x0,0x18(%rsp)
lea    0x18(%rsp),%rax
mov    %rax,(%rsp)
lea    0x10(%rsp),%r8
lea    0x20(%rsp),%r9
call   1030 <fisher@plt>
movsd  0x10(%rsp),%xmm0
add    $0x28,%rsp
ret

LLVM IR (-O0):
define double @fisher0(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
store double 0.000000e+00, double* %9
store double 0.000000e+00, double* %10
store double 0.000000e+00, double* %11
%12 = load i32, i32* %5
%13 = load i32, i32* %6
%14 = load i32, i32* %7
%15 = load i32, i32* %8
%16 = call i32 @fisher(i32 %12, i32 %13, i32 %14, i32 %15, double* %9, double* %10, double* %11)
%17 = load double, double* %9
ret double %17
}

LLVM IR (-O2):
define double @fisher0(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = bitcast double* %5 to i8*
store double 0.000000e+00, double* %5
%9 = bitcast double* %6 to i8*
store double 0.000000e+00, double* %6
%10 = bitcast double* %7 to i8*
store double 0.000000e+00, double* %7
%11 = call i32 @fisher(i32 %0, i32 %1, i32 %2, i32 %3, double* %5, double* %6, double* %7)
%12 = load double, double* %5
ret double %12
}
/* Variables and functions */
int /*<<< orphan*/ read(int /*<<< orphan*/, char *, int);
int getch(void) {
  char ch;
  read(0, &ch, 1);
  return ch;
}


x86 assembly (clang, -O0):
<getch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
lea    -0x1(%rbp),%rsi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl -0x1(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getch>:
push   %rax
lea    0x7(%rsp),%rsi
xor    %edi,%edi
mov    $0x1,%edx
call   1030 <read@plt>
movsbl 0x7(%rsp),%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getch() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
ret i32 %4
}

LLVM IR (-O2):
define i32 @getch() {
%1 = alloca i8
%2 = call i32 @read(i32 0, i8* %1, i32 1)
%3 = load i8, i8* %1
%4 = sext i8 %3 to i32
ret i32 %4
}
void autorun_devices(int x) { return; }


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

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

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

LLVM IR (-O2):
define void @autorun_devices(i32 %0) {
ret void
}
void quick_sort(int *head) {}


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

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

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

LLVM IR (-O2):
define void @quick_sort(i32* nocapture %0) {
ret void
}
int iscntrl(int c) {
  return (((c) <= (0x1f)) && ((c) >= (0x00))) || (c == 0x7f);
}


x86 assembly (clang, -O0):
<iscntrl>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x1f,-0x4(%rbp)
jg     1120 <iscntrl+0x20>
mov    $0x1,%al
cmpl   $0x0,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jge    112a <iscntrl+0x2a>
cmpl   $0x7f,-0x4(%rbp)
sete   %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<iscntrl>:
cmp    $0x20,%edi
setb   %al
cmp    $0x7f,%edi
sete   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @iscntrl(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = icmp sle i32 %3, 31
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* %2
%7 = icmp sge i32 %6, 0
br i1 %7, label %11, label %8
8: ; preds = %5, %1
%9 = load i32, i32* %2
%10 = icmp eq i32 %9, 127
br label %11
11: ; preds = %8, %5
%12 = phi i1 [ true, %5 ], [ %10, %8 ]
%13 = zext i1 %12 to i32
ret i32 %13
}

LLVM IR (-O2):
define i32 @iscntrl(i32 %0) {
%2 = icmp ult i32 %0, 32
%3 = icmp eq i32 %0, 127
%4 = or i1 %2, %3
%5 = zext i1 %4 to i32
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ uint16_t;
struct udphdr {
  int /*<<< orphan*/ dest;
  int /*<<< orphan*/ source;
};

/* Variables and functions */
void *prot_read_udp(void *data, uint16_t *src_port, uint16_t *dst_port) {
  const struct udphdr *udp = data;
  *src_port = udp->source;
  *dst_port = udp->dest;
  return data + sizeof(*udp);
}


x86 assembly (clang, -O0):
<prot_read_udp>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
mov    0x4(%rax),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x20(%rbp),%rax
mov    (%rax),%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x8(%rbp),%rax
add    $0x8,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<prot_read_udp>:
mov    0x4(%rdi),%eax
mov    %eax,(%rsi)
mov    (%rdi),%eax
mov    %eax,(%rdx)
lea    0x8(%rdi),%rax
ret

LLVM IR (-O0):
%struct.udphdr = type { i32, i32 }
define i8* @prot_read_udp(i8* %0, i32* %1, i32* %2) {
%4 = alloca i8*
%5 = alloca i32*
%6 = alloca i32*
%7 = alloca %struct.udphdr*
store i8* %0, i8** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%8 = load i8*, i8** %4
%9 = bitcast i8* %8 to %struct.udphdr*
store %struct.udphdr* %9, %struct.udphdr** %7
%10 = load %struct.udphdr*, %struct.udphdr** %7
%11 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %10, i32 0, i32 1
%12 = load i32, i32* %11
%13 = load i32*, i32** %5
store i32 %12, i32* %13
%14 = load %struct.udphdr*, %struct.udphdr** %7
%15 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %14, i32 0, i32 0
%16 = load i32, i32* %15
%17 = load i32*, i32** %6
store i32 %16, i32* %17
%18 = load i8*, i8** %4
%19 = getelementptr i8, i8* %18, i64 8
ret i8* %19
}

LLVM IR (-O2):
define i8* @prot_read_udp(i8* %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2) {
%4 = getelementptr inbounds i8, i8* %0, i64 4
%5 = bitcast i8* %4 to i32*
%6 = load i32, i32* %5
store i32 %6, i32* %1
%7 = bitcast i8* %0 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %2
%9 = getelementptr i8, i8* %0, i64 8
ret i8* %9
}
void r2(register float *a) {
  register float t1, t2;
  t1 = a[0] + a[1];
  t2 = a[0] - a[1];
  a[0] = t1 * 2;
  a[1] = t2 * 2;
}


x86 assembly (clang, -O0):
<r2>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
addss  0x4(%rax),%xmm0
movss  %xmm0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0x8(%rbp),%rax
subss  0x4(%rax),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xec4(%rip),%xmm0
mulss  -0xc(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,(%rax)
movss  0xeaf(%rip),%xmm0
mulss  -0x10(%rbp),%xmm0
mov    -0x8(%rbp),%rax
movss  %xmm0,0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<r2>:
movss  (%rdi),%xmm0
movss  0x4(%rdi),%xmm1
movaps %xmm0,%xmm2
addss  %xmm1,%xmm2
subss  %xmm1,%xmm0
addss  %xmm2,%xmm2
movss  %xmm2,(%rdi)
addss  %xmm0,%xmm0
movss  %xmm0,0x4(%rdi)
ret

LLVM IR (-O0):
define void @r2(float* %0) {
%2 = alloca float*
%3 = alloca float
%4 = alloca float
store float* %0, float** %2
%5 = load float*, float** %2
%6 = getelementptr inbounds float, float* %5, i64 0
%7 = load float, float* %6
%8 = load float*, float** %2
%9 = getelementptr inbounds float, float* %8, i64 1
%10 = load float, float* %9
%11 = fadd float %7, %10
store float %11, float* %3
%12 = load float*, float** %2
%13 = getelementptr inbounds float, float* %12, i64 0
%14 = load float, float* %13
%15 = load float*, float** %2
%16 = getelementptr inbounds float, float* %15, i64 1
%17 = load float, float* %16
%18 = fsub float %14, %17
store float %18, float* %4
%19 = load float, float* %3
%20 = fmul float %19, 2.000000e+00
%21 = load float*, float** %2
%22 = getelementptr inbounds float, float* %21, i64 0
store float %20, float* %22
%23 = load float, float* %4
%24 = fmul float %23, 2.000000e+00
%25 = load float*, float** %2
%26 = getelementptr inbounds float, float* %25, i64 1
store float %24, float* %26
ret void
}

LLVM IR (-O2):
define void @r2(float* nocapture %0) {
%2 = load float, float* %0
%3 = getelementptr inbounds float, float* %0, i64 1
%4 = load float, float* %3
%5 = fadd float %2, %4
%6 = fsub float %2, %4
%7 = fmul float %5, 2.000000e+00
store float %7, float* %0
%8 = fmul float %6, 2.000000e+00
store float %8, float* %3
ret void
}
int GO_abs(int n) {
  if (n < 0)
    n = -n;
  return n;
}


x86 assembly (clang, -O0):
<GO_abs>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1119 <GO_abs+0x19>
xor    %eax,%eax
sub    -0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

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

LLVM IR (-O2):
define i32 @GO_abs(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
ret i32 %2
}
unsigned long int __infer_nondet_unsigned_long_int() {
  unsigned long int ret;
  return ret;
}


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

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

LLVM IR (-O0):
define i64 @__infer_nondet_unsigned_long_int() {
%1 = alloca i64
%2 = load i64, i64* %1
ret i64 %2
}

LLVM IR (-O2):
define i64 @__infer_nondet_unsigned_long_int() {
ret i64 undef
}
/* Variables and functions */
int _ada_use_c2phc(int, int *, int *, double *);
int syscon_degree_of_dobldobl_polynomial(int k, int *d) {
  int fail;
  double *c;
  fail = _ada_use_c2phc(339, &k, d, c);
  return fail;
}


x86 assembly (clang, -O0):
<syscon_degree_of_dobldobl_polynomial>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    $0x153,%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_degree_of_dobldobl_polynomial>:
push   %rax
mov    %rsi,%rdx
mov    %edi,0x4(%rsp)
lea    0x4(%rsp),%rsi
mov    $0x153,%edi
call   1030 <_ada_use_c2phc@plt>
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @syscon_degree_of_dobldobl_polynomial(i32 %0, i32* %1) {
%3 = alloca i32
store i32 %0, i32* %3
%4 = call i32 @_ada_use_c2phc(i32 339, i32* %3, i32* %1, double* undef)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ PAGE_RemoveAllObjects();
int /*<<< orphan*/ _show_page();
void PAGE_TrimInit(int page) {
  (void)page;
  PAGE_RemoveAllObjects();
  _show_page();
}


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

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

LLVM IR (-O0):
define void @PAGE_TrimInit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 (...) @PAGE_RemoveAllObjects()
%5 = call i32 (...) @_show_page()
ret void
}

LLVM IR (-O2):
define void @PAGE_TrimInit(i32 %0) {
%2 = tail call i32 (...) @PAGE_RemoveAllObjects()
%3 = tail call i32 (...) @_show_page()
ret void
}
/* Type definitions */
typedef int uint32_t;

/* Variables and functions */
void uDMAChannelEnable(uint32_t ui32ChannelNum) {
  ;
  (*((volatile uint32_t *)(0x400FF028))) = 1 << (ui32ChannelNum & 0x1f);
}


x86 assembly (clang, -O0):
<uDMAChannelEnable>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%ecx
and    $0x1f,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,%ecx
mov    $0x400ff028,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<uDMAChannelEnable>:
mov    %edi,%ecx
mov    $0x1,%eax
shl    %cl,%eax
mov    %eax,0x400ff028
ret

LLVM IR (-O0):
define void @uDMAChannelEnable(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = and i32 %3, 31
%5 = shl i32 1, %4
store volatile i32 %5, i32* inttoptr (i64 1074786344 to i32*)
ret void
}

LLVM IR (-O2):
define void @uDMAChannelEnable(i32 %0) {
%2 = and i32 %0, 31
%3 = shl nuw i32 1, %2
store volatile i32 %3, i32* inttoptr (i64 1074786344 to i32*)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ output_chars(char const *const, int /*<<< orphan*/ *,
                                int /*<<< orphan*/, int const);
int /*<<< orphan*/ strlen(char const *const);
void output_string(const char *const s, const bool utf8) {
  assert(s != NULL);
  output_chars(s, NULL, strlen(s), utf8);
}


x86 assembly (clang, -O0):
<output_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%edx
mov    -0xc(%rbp),%ecx
xor    %eax,%eax
mov    %eax,%esi
call   1030 <output_chars@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<output_string>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
mov    %ebp,%ecx
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <output_chars@plt>

LLVM IR (-O0):
define void @output_string(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i8*, i8** %3
%6 = icmp ne i8* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load i8*, i8** %3
%10 = load i8*, i8** %3
%11 = call i32 @strlen(i8* %10)
%12 = load i32, i32* %4
%13 = call i32 @output_chars(i8* %9, i32* null, i32 %11, i32 %12)
ret void
}

LLVM IR (-O2):
define void @output_string(i8* %0, i32 %1) {
%3 = icmp ne i8* %0, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @strlen(i8* %0)
%7 = tail call i32 @output_chars(i8* %0, i32* null, i32 %6, i32 %1)
ret void
}
void g_queue_pop_tail_link() {}


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

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

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

LLVM IR (-O2):
define void @g_queue_pop_tail_link() {
ret void
}
/* Variables and functions */
int _ada_use_c2phc4c(int, int *, int *, double *, int /*<<< orphan*/);
int create_dobldobl_Laurent_cascade_homotopy(void) {
  int *a, *b, fail;
  double *c;
  fail = _ada_use_c2phc4c(790, a, b, c, 0);
  return fail;
}


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

x86 assembly (clang, -O2):
<create_dobldobl_Laurent_cascade_homotopy>:
mov    $0x316,%edi
xor    %r8d,%r8d
jmp    1030 <_ada_use_c2phc4c@plt>

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

LLVM IR (-O2):
define i32 @create_dobldobl_Laurent_cascade_homotopy() {
%1 = tail call i32 @_ada_use_c2phc4c(i32 790, i32* undef, i32* undef, double* undef, i32 0)
ret i32 %1
}
float get_float(string, length)
char *string;
int length;
{
  char buffer[256];
  float val;
  strncpy(buffer, string, length);
  buffer[length] = '\0';
  sscanf(buffer, "%f", &val);
  return (val);
}


x86 assembly (clang, -O0):
<get_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0xc(%rbp),%rdx
call   1030 <strncpy@plt>
movslq -0xc(%rbp),%rax
movb   $0x0,-0x110(%rbp,%rax,1)
lea    -0x110(%rbp),%rdi
lea    0xea0(%rip),%rsi
lea    -0x114(%rbp),%rdx
mov    $0x0,%al
call   1040 <sscanf@plt>
movss  -0x114(%rbp),%xmm0
ff
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_float>:
push   %r14
push   %rbx
sub    $0x118,%rsp
mov    %rdi,%rax
movslq %esi,%rbx
lea    0x10(%rsp),%r14
mov    %r14,%rdi
mov    %rax,%rsi
mov    %rbx,%rdx
call   1030 <strncpy@plt>
movb   $0x0,0x10(%rsp,%rbx,1)
lea    0xeb1(%rip),%rsi
lea    0xc(%rsp),%rdx
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <sscanf@plt>
movss  0xc(%rsp),%xmm0
add    $0x118,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%f\00"
define float @get_float(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [256 x i8]
%6 = alloca float
store i8* %0, i8** %3
store i32 %1, i32* %4
%7 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%8 = load i8*, i8** %3
%9 = load i32, i32* %4
%10 = sext i32 %9 to i64
%11 = call i8* @strncpy(i8* %7, i8* %8, i64 %10)
%12 = load i32, i32* %4
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %13
store i8 0, i8* %14
%15 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%16 = call i32 (i8*, i8*, ...) @sscanf(i8* %15, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %6)
%17 = load float, float* %6
ret float %17
}

LLVM IR (-O2):
@.str = [3 x i8] c"%f\00"
define float @get_float(i8* nocapture %0, i32 %1) {
%3 = alloca [256 x i8]
%4 = alloca float
%5 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 0
%6 = bitcast float* %4 to i8*
%7 = sext i32 %1 to i64
%8 = call i8* @strncpy(i8* %5, i8* %0, i64 %7)
%9 = getelementptr inbounds [256 x i8], [256 x i8]* %3, i64 0, i64 %7
store i8 0, i8* %9
%10 = call i32 (i8*, i8*, ...) @sscanf(i8* %5, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), float* %4)
%11 = load float, float* %4
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *);
int /*<<< orphan*/ squeeze_alt(char *, char *);
int main(void) {
  char str[8] = "testing";
  char _str[15] = "tetttttttttsi";
  squeeze_alt(str, _str);
  printf("string after squeezing - \'%s\'\n", str);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0xc(%rbp)
mov    0xee6(%rip),%rax
mov    %rax,-0x1b(%rbp)
mov    0xee4(%rip),%eax
mov    %eax,-0x13(%rbp)
mov    0xede(%rip),%ax
mov    %ax,-0xf(%rbp)
mov    0xed6(%rip),%al
mov    %al,-0xd(%rbp)
lea    -0xc(%rbp),%rdi
lea    -0x1b(%rbp),%rsi
call   1040 <squeeze_alt@plt>
lea    -0xc(%rbp),%rsi
lea    0xe8e(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
sub    $0x20,%rsp
movabs $0x676e6974736574,%rax
mov    %rax,0x8(%rsp)
movabs $0x697374747474,%rax
mov    %rax,0x17(%rsp)
movabs $0x7474747474746574,%rax
74 74 74
mov    %rax,0x10(%rsp)
lea    0x8(%rsp),%rbx
lea    0x10(%rsp),%rsi
mov    %rbx,%rdi
call   1040 <squeeze_alt@plt>
lea    0xea4(%rip),%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.str = [8 x i8] c"testing\00"
@__const.main._str = [15 x i8] c"tetttttttttsi\00\00"
@.str = [31 x i8] c"string after squeezing - '%s'\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [8 x i8]
%3 = alloca [15 x i8]
store i32 0, i32* %1
%4 = bitcast [8 x i8]* %2 to i8*
%5 = bitcast [15 x i8]* %3 to i8*
%6 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%7 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%8 = call i32 @squeeze_alt(i8* %6, i8* %7)
%9 = getelementptr inbounds [8 x i8], [8 x i8]* %2, i64 0, i64 0
%10 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@__const.main._str = [15 x i8] c"tetttttttttsi\00\00"
@.str = [31 x i8] c"string after squeezing - '%s'\0A\00"
define i32 @main() {
%1 = alloca i64
%2 = alloca [15 x i8]
%3 = bitcast i64* %1 to i8*
store i64 29113321805538676, i64* %1
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i32 @squeeze_alt(i8* %3, i8* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0), i8* %3)
ret i32 0
}
int getval(int i, int j) {
  int amval = (i + j) * (i + j + 1) / 2;
  if ((i + j) % 2 == 0) {
    amval = amval + j + 1;
  } else {
    amval = amval + i + 1;
  }
  return amval;
}


x86 assembly (clang, -O0):
<getval>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
add    $0x1,%ecx
imul   %ecx,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
add    -0x8(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
jne    114f <getval+0x4f>
mov    -0xc(%rbp),%eax
add    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    115b <getval+0x5b>
mov    -0xc(%rbp),%eax
add    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getval>:
lea    (%rsi,%rdi,1),%eax
test   $0x1,%al
lea    0x1(%rsi,%rdi,1),%ecx
cmove  %esi,%edi
imul   %eax,%ecx
mov    %ecx,%eax
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
add    %edi,%eax
add    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @getval(i32 %0, i32 %1) {
%3 = add nsw i32 %1, %0
%4 = and i32 %3, 1
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 %1, i32 %0
%7 = add nsw i32 %3, 1
%8 = mul nsw i32 %7, %3
%9 = sdiv i32 %8, 2
%10 = add i32 %6, 1
%11 = add i32 %10, %9
ret i32 %11
}
/* Variables and functions */
int strlen(char const *);
int string_length(const char *str) { return (str == NULL ? -1 : strlen(str)); }


x86 assembly (clang, -O0):
<string_length>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1134 <string_length+0x24>
mov    $0xffffffff,%eax
mov    %eax,-0xc(%rbp)
jmp    1140 <string_length+0x30>
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<string_length>:
test   %rdi,%rdi
je     111a <string_length+0xa>
jmp    1030 <strlen@plt>
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
define i32 @string_length(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = icmp eq i8* %3, null
br i1 %4, label %5, label %6
5: ; preds = %1
br label %9
6: ; preds = %1
%7 = load i8*, i8** %2
%8 = call i32 @strlen(i8* %7)
br label %9
9: ; preds = %6, %5
%10 = phi i32 [ -1, %5 ], [ %8, %6 ]
ret i32 %10
}

LLVM IR (-O2):
define i32 @string_length(i8* %0) {
%2 = icmp eq i8* %0, null
br i1 %2, label %5, label %3
3: ; preds = %1
%4 = tail call i32 @strlen(i8* %0)
br label %5
5: ; preds = %1, %3
%6 = phi i32 [ %4, %3 ], [ -1, %1 ]
ret i32 %6
}
/* Variables and functions */
double cos(double);
double hl_math_cos(double a) { return cos(a); }


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

x86 assembly (clang, -O2):
<hl_math_cos>:
jmp    1030 <cos@plt>

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

LLVM IR (-O2):
define double @hl_math_cos(double %0) {
%2 = tail call double @cos(double %0)
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void memfree(void *ptr) {
  *(int *)ptr = 0xfefefefe;
  free(ptr);
}


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

x86 assembly (clang, -O2):
<memfree>:
movl   $0xfefefefe,(%rdi)
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @memfree(i8* nocapture %0) {
%2 = bitcast i8* %0 to i32*
store i32 -16843010, i32* %2
%3 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int login() {
  printf("{ \"type\" : \"login\" , \"action\" : \"ws.login();\" }");
  return 0;
}


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

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

LLVM IR (-O0):
@.str = [48 x i8] c"{ \22type\22 : \22login\22 , \22action\22 : \22ws.login();\22 }\00"
define i32 @login() {
%1 = call i32 @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [48 x i8] c"{ \22type\22 : \22login\22 , \22action\22 : \22ws.login();\22 }\00"
define i32 @login() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
scalar_t__ memcpy(char *, char const *, size_t);
scalar_t__ psync_malloc(int);
char *psync_strndup(const char *str, size_t len) {
  char *ptr;
  ptr =
      (char *)memcpy((char *)psync_malloc(sizeof(char) * (len + 1)), str, len);
  ptr[len] = 0;
  return ptr;
}


x86 assembly (clang, -O0):
<psync_strndup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
shl    $0x0,%rax
mov    %eax,%edi
call   1030 <psync_malloc@plt>
mov    %rax,%rdi
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1040 <memcpy@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    -0x10(%rbp),%rcx
movb   $0x0,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<psync_strndup>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
lea    0x1(%rsi),%edi
call   1030 <psync_malloc@plt>
mov    %rax,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1040 <memcpy@plt>
movb   $0x0,(%rax,%rbx,1)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @psync_strndup(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 i64, i64* %4
%7 = add i64 %6, 1
%8 = mul i64 1, %7
%9 = trunc i64 %8 to i32
%10 = call i64 @psync_malloc(i32 %9)
%11 = inttoptr i64 %10 to i8*
%12 = load i8*, i8** %3
%13 = load i64, i64* %4
%14 = call i64 @memcpy(i8* %11, i8* %12, i64 %13)
%15 = inttoptr i64 %14 to i8*
store i8* %15, i8** %5
%16 = load i8*, i8** %5
%17 = load i64, i64* %4
%18 = getelementptr inbounds i8, i8* %16, i64 %17
store i8 0, i8* %18
%19 = load i8*, i8** %5
ret i8* %19
}

LLVM IR (-O2):
define i8* @psync_strndup(i8* %0, i64 %1) {
%3 = trunc i64 %1 to i32
%4 = add i32 %3, 1
%5 = tail call i64 @psync_malloc(i32 %4)
%6 = inttoptr i64 %5 to i8*
%7 = tail call i64 @memcpy(i8* %6, i8* %0, i64 %1)
%8 = inttoptr i64 %7 to i8*
%9 = getelementptr inbounds i8, i8* %8, i64 %1
store i8 0, i8* %9
ret i8* %8
}
int add1(int c, int d, int *e) {
  *e = c + d;
  return 0;
}


x86 assembly (clang, -O0):
<add1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    -0x4(%rbp),%ecx
add    -0x8(%rbp),%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<add1>:
add    %esi,%edi
mov    %edi,(%rdx)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @add1(i32 %0, i32 %1, i32* nocapture writeonly %2) {
%4 = add nsw i32 %1, %0
store i32 %4, i32* %2
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *);
void usage(void) {
  printf("Usage:\n");
  printf(" db_unhide <database in> <database out> <tihm number>\n");
  exit(1);
}


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

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

LLVM IR (-O0):
@.str = [8 x i8] c"Usage:\0A\00"
@.str.1 = [55 x i8] c" db_unhide <database in> <database out> <tihm number>\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@str = [7 x i8] c"Usage:\00"
@str.2 = [54 x i8] c" db_unhide <database in> <database out> <tihm number>\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 1)
unreachable
}