xunge/DecIR huggingface dataset:
void sumify(int *x, int *sum) { *sum += *x; }


x86 assembly (clang, -O0):
<sumify>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
pop    %rbp
ret

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

LLVM IR (-O0):
define void @sumify(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* %5
%7 = load i32*, i32** %4
%8 = load i32, i32* %7
%9 = add nsw i32 %8, %6
store i32 %9, i32* %7
ret void
}

LLVM IR (-O2):
define void @sumify(i32* nocapture %0, i32* nocapture %1) {
%3 = load i32, i32* %0
%4 = load i32, i32* %1
%5 = add nsw i32 %4, %3
store i32 %5, i32* %1
ret void
}
/* Type definitions */
struct timezone {
  int dummy;
};
struct timeval {
  unsigned long long tv_sec;
  long long tv_usec;
};

/* Variables and functions */
int /*<<< orphan*/ gettimeofday(struct timeval *, struct timezone *);
long long get_time() {
  struct timeval tp;
  struct timezone tz;
  gettimeofday(&tp, &tz);
  return tp.tv_sec * 1000000ull + tp.tv_usec;
}


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

x86 assembly (clang, -O2):
<get_time>:
sub    $0x18,%rsp
lea    0x8(%rsp),%rdi
mov    %rsp,%rsi
call   1030 <gettimeofday@plt>
imul   $0xf4240,0x8(%rsp),%rax
add    0x10(%rsp),%rax
add    $0x18,%rsp
ret

LLVM IR (-O0):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i64 @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%4 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 0
%5 = load i64, i64* %4
%6 = mul i64 %5, 1000000
%7 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i32 0, i32 1
%8 = load i64, i64* %7
%9 = add i64 %6, %8
ret i64 %9
}

LLVM IR (-O2):
%struct.timeval = type { i64, i64 }
%struct.timezone = type { i32 }
define i64 @get_time() {
%1 = alloca %struct.timeval
%2 = alloca %struct.timezone
%3 = bitcast %struct.timeval* %1 to i8*
%4 = bitcast %struct.timezone* %2 to i8*
%5 = call i32 @gettimeofday(%struct.timeval* %1, %struct.timezone* %2)
%6 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
%7 = load i64, i64* %6
%8 = mul i64 %7, 1000000
%9 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
%10 = load i64, i64* %9
%11 = add i64 %8, %10
ret i64 %11
}
int compare_doubles(const void *p, const void *q) {
  double x = *(const double *)p;
  double y = *(const double *)q;
  int ret;
  if (x == y) {
    ret = 0;
  } else {
    ret = (x < y) ? -1 : 1;
  }
  return ret;
}


x86 assembly (clang, -O0):
<compare_doubles>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0x10(%rbp),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  -0x18(%rbp),%xmm0
ucomisd -0x20(%rbp),%xmm0
jne    1148 <compare_doubles+0x48>
jp     1148 <compare_doubles+0x48>
movl   $0x0,-0x24(%rbp)
jmp    1166 <compare_doubles+0x66>
movsd  -0x18(%rbp),%xmm1
movsd  -0x20(%rbp),%xmm0
mov    $0x1,%eax
mov    $0xffffffff,%ecx
ucomisd %xmm1,%xmm0
cmova  %ecx,%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<compare_doubles>:
movsd  (%rdi),%xmm0
movsd  (%rsi),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
setbe  %cl
xor    %eax,%eax
ucomisd %xmm1,%xmm0
lea    -0x1(%rcx,%rcx,1),%ecx
cmovne %ecx,%eax
cmovp  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @compare_doubles(i8* nocapture %0, i8* nocapture %1) {
%3 = bitcast i8* %0 to double*
%4 = load double, double* %3
%5 = bitcast i8* %1 to double*
%6 = load double, double* %5
%7 = fcmp oeq double %4, %6
%8 = fcmp olt double %4, %6
%9 = select i1 %8, i32 -1, i32 1
%10 = select i1 %7, i32 0, i32 %9
ret i32 %10
}
/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
scalar_t__ isspace(char);
void skip_spaces(char **pos) {
  assert(pos != NULL);
  for (; isspace(**pos); (*pos)++)
    ;
}


x86 assembly (clang, -O0):
<skip_spaces>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
cmpq   $0x0,-0x8(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
movsbl (%rax),%edi
call   1030 <isspace@plt>
cmp    $0x0,%rax
je     116f <skip_spaces+0x4f>
jmp    115c <skip_spaces+0x3c>
mov    -0x8(%rbp),%rax
mov    (%rax),%rcx
add    $0x1,%rcx
mov    %rcx,(%rax)
jmp    113e <skip_spaces+0x1e>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skip_spaces>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1040 <assert@plt>
mov    (%rbx),%rax
movsbl (%rax),%edi
nopl   0x0(%rax,%rax,1)
call   1030 <isspace@plt>
test   %rax,%rax
je     115a <skip_spaces+0x3a>
mov    (%rbx),%rax
lea    0x1(%rax),%rcx
mov    %rcx,(%rbx)
movsbl 0x1(%rax),%edi
jmp    1140 <skip_spaces+0x20>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @skip_spaces(i8** %0) {
%2 = icmp ne i8** %0, null
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = load i8*, i8** %0
%6 = load i8, i8* %5
%7 = tail call i64 @isspace(i8 signext %6)
%8 = icmp eq i64 %7, 0
br i1 %8, label %15, label %9
9: ; preds = %1, %9
%10 = load i8*, i8** %0
%11 = getelementptr inbounds i8, i8* %10, i64 1
store i8* %11, i8** %0
%12 = load i8, i8* %11
%13 = tail call i64 @isspace(i8 signext %12)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %9
15: ; preds = %9, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ addition_1(char *);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char *argv[]) {
  char *host;
  if (argc < 2) {
    printf("usage: %s server_host\n", argv[0]);
    exit(1);
  }
  host = argv[1];
  addition_1(host);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    116d <main+0x3d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1040 <addition_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
cmp    $0x1,%edi
jg     114f <main+0x1f>
mov    (%rsi),%rsi
lea    0xec0(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
mov    0x8(%rsi),%rdi
call   1040 <addition_1@plt>
xor    %edi,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@.str = [23 x i8] c"usage: %s server_host\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = load i8*, i8** %1
%6 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = getelementptr inbounds i8*, i8** %1, i64 1
%10 = load i8*, i8** %9
%11 = tail call i32 @addition_1(i8* %10)
%12 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int /*<<< orphan*/ __m256i;

/* Variables and functions */
int /*<<< orphan*/ _mm256_add_epi32(int /*<<< orphan*/ const,
                                    int /*<<< orphan*/ const);
int /*<<< orphan*/ _mm256_srai_epi32(int /*<<< orphan*/ const, int const);
__m256i mm256_round_epi32(const __m256i *const src,
                          const __m256i *const half_depth, const int depth) {
  const __m256i nearest_src = _mm256_add_epi32(*src, *half_depth);
  return _mm256_srai_epi32(nearest_src, depth);
}


x86 assembly (clang, -O0):
<mm256_round_epi32>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
call   1040 <_mm256_add_epi32@plt>
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1030 <_mm256_srai_epi32@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mm256_round_epi32>:
push   %rbx
mov    %edx,%ebx
mov    (%rdi),%edi
mov    (%rsi),%esi
call   1040 <_mm256_add_epi32@plt>
mov    %eax,%edi
mov    %ebx,%esi
pop    %rbx
jmp    1030 <_mm256_srai_epi32@plt>

LLVM IR (-O0):
define i32 @mm256_round_epi32(i32* %0, i32* %1, i32 %2) {
%4 = alloca i32*
%5 = alloca i32*
%6 = alloca i32
%7 = alloca i32
store i32* %0, i32** %4
store i32* %1, i32** %5
store i32 %2, i32* %6
%8 = load i32*, i32** %4
%9 = load i32, i32* %8
%10 = load i32*, i32** %5
%11 = load i32, i32* %10
%12 = call i32 @_mm256_add_epi32(i32 %9, i32 %11)
store i32 %12, i32* %7
%13 = load i32, i32* %7
%14 = load i32, i32* %6
%15 = call i32 @_mm256_srai_epi32(i32 %13, i32 %14)
ret i32 %15
}

LLVM IR (-O2):
define i32 @mm256_round_epi32(i32* nocapture %0, i32* nocapture %1, i32 %2) {
%4 = load i32, i32* %0
%5 = load i32, i32* %1
%6 = tail call i32 @_mm256_add_epi32(i32 %4, i32 %5)
%7 = tail call i32 @_mm256_srai_epi32(i32 %6, i32 %2)
ret i32 %7
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Hello World/n");
  return (0);
}


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

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

LLVM IR (-O0):
@.str = [14 x i8] c"Hello World/n\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str = [14 x i8] c"Hello World/n\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
void *malloc(size_t);
void *rpl_malloc(size_t n) {
  if (0 == n) {
    n = 1;
  }
  return malloc(n);
}


x86 assembly (clang, -O0):
<rpl_malloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
xor    %eax,%eax
cmp    -0x8(%rbp),%rax
jne    1130 <rpl_malloc+0x20>
movq   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rpl_malloc>:
test   %rdi,%rdi
mov    $0x1,%eax
cmove  %rax,%rdi
jmp    1030 <malloc@plt>

LLVM IR (-O0):
define i8* @rpl_malloc(i64 %0) {
%2 = alloca i64
store i64 %0, i64* %2
%3 = load i64, i64* %2
%4 = icmp eq i64 0, %3
br i1 %4, label %5, label %6
5: ; preds = %1
store i64 1, i64* %2
br label %6
6: ; preds = %5, %1
%7 = load i64, i64* %2
%8 = call i8* @malloc(i64 %7)
ret i8* %8
}

LLVM IR (-O2):
define noalias i8* @rpl_malloc(i64 %0) {
%2 = icmp eq i64 %0, 0
%3 = select i1 %2, i64 1, i64 %0
%4 = tail call i8* @malloc(i64 %3)
ret i8* %4
}
int util_str_len(char *p) {
  int i = 0;
  while (*(p++) != '\0')
    i++;
  return i;
}


x86 assembly (clang, -O0):
<util_str_len>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1138 <util_str_len+0x38>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <util_str_len+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<util_str_len>:
cmpb   $0x0,(%rdi)
je     111c <util_str_len+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <util_str_len+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @util_str_len(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8* [ %7, %4 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = add nuw nsw i32 %5, 1
%9 = load i8, i8* %7
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %8, %4 ]
ret i32 %12
}
/* Variables and functions */
scalar_t__ abs(int);
float distance_between_two_points(int xStart, int yStart, int xDestination,
                                  int yDestination) {
  return (float)(abs(xStart - xDestination) + abs(yStart - yDestination));
}


x86 assembly (clang, -O0):
<distance_between_two_points>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %edx,-0xc(%rbp)
mov    %ecx,-0x10(%rbp)
mov    -0x4(%rbp),%edi
sub    -0xc(%rbp),%edi
call   1030 <abs@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
sub    -0x10(%rbp),%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
add    %rcx,%rax
cvtsi2ss %rax,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_between_two_points>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%r14d
mov    %esi,%ebp
sub    %edx,%edi
call   1030 <abs@plt>
mov    %rax,%rbx
sub    %r14d,%ebp
mov    %ebp,%edi
call   1030 <abs@plt>
add    %rbx,%rax
cvtsi2ss %rax,%xmm0
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define float @distance_between_two_points(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %7
%11 = sub nsw i32 %9, %10
%12 = call i64 @abs(i32 %11)
%13 = load i32, i32* %6
%14 = load i32, i32* %8
%15 = sub nsw i32 %13, %14
%16 = call i64 @abs(i32 %15)
%17 = add nsw i64 %12, %16
%18 = sitofp i64 %17 to float
ret float %18
}

LLVM IR (-O2):
define float @distance_between_two_points(i32 %0, i32 %1, i32 %2, i32 %3) {
%5 = sub nsw i32 %0, %2
%6 = tail call i64 @abs(i32 %5)
%7 = sub nsw i32 %1, %3
%8 = tail call i64 @abs(i32 %7)
%9 = add nsw i64 %8, %6
%10 = sitofp i64 %9 to float
ret float %10
}
/* Variables and functions */
int /*<<< orphan*/ default_isr_handler();
__attribute__((weak)) void gpioe_isr_handler(void) { default_isr_handler(); }


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

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

LLVM IR (-O0):
define weak void @gpioe_isr_handler() {
%1 = call i32 (...) @default_isr_handler()
ret void
}

LLVM IR (-O2):
define weak void @gpioe_isr_handler() {
%1 = tail call i32 (...) @default_isr_handler()
ret void
}
/* Variables and functions */
int read(int, short *, int);
int read_int2_array(int f, short *iarray, int n) {
  int nread = read(f, iarray, n * 2);
  if (nread <= 0)
    return 0;
  return nread / 2;
}


x86 assembly (clang, -O0):
<read_int2_array>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
shl    $0x1,%edx
call   1030 <read@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     114d <read_int2_array+0x3d>
movl   $0x0,-0x4(%rbp)
jmp    115b <read_int2_array+0x4b>
mov    -0x18(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<read_int2_array>:
push   %rax
add    %edx,%edx
call   1030 <read@plt>
test   %eax,%eax
jle    1127 <read_int2_array+0x17>
mov    %eax,%ecx
shr    $0x1f,%eax
add    %ecx,%eax
sar    %eax
pop    %rcx
ret
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @read_int2_array(i32 %0, i16* %1, i32 %2) {
%4 = alloca i32
%5 = alloca i32
%6 = alloca i16*
%7 = alloca i32
%8 = alloca i32
store i32 %0, i32* %5
store i16* %1, i16** %6
store i32 %2, i32* %7
%9 = load i32, i32* %5
%10 = load i16*, i16** %6
%11 = load i32, i32* %7
%12 = mul nsw i32 %11, 2
%13 = call i32 @read(i32 %9, i16* %10, i32 %12)
store i32 %13, i32* %8
%14 = load i32, i32* %8
%15 = icmp sle i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %3
store i32 0, i32* %4
br label %20
17: ; preds = %3
%18 = load i32, i32* %8
%19 = sdiv i32 %18, 2
store i32 %19, i32* %4
br label %20
20: ; preds = %17, %16
%21 = load i32, i32* %4
ret i32 %21
}

LLVM IR (-O2):
define i32 @read_int2_array(i32 %0, i16* nocapture %1, i32 %2) {
%4 = shl nsw i32 %2, 1
%5 = tail call i32 @read(i32 %0, i16* %1, i32 %4)
%6 = sdiv i32 %5, 2
%7 = icmp sgt i32 %5, 0
%8 = select i1 %7, i32 %6, i32 0
ret i32 %8
}
double a_Hep(t)
double t;
{
  if (t > 0.0) {
    return 1.5e-10 * pow(t, -0.6353);
  }
  return 0.0;
}


x86 assembly (clang, -O0):
<a_Hep>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jbe    115a <a_Hep+0x4a>
movsd  -0x10(%rbp),%xmm0
movsd  0xecc(%rip),%xmm1
call   1030 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xeb4(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x8(%rbp)
jmp    1162 <a_Hep+0x52>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<a_Hep>:
movapd %xmm0,%xmm2
xorpd  %xmm0,%xmm0
ucomisd %xmm0,%xmm2
jbe    113c <a_Hep+0x2c>
push   %rax
movsd  0xed9(%rip),%xmm1
movapd %xmm2,%xmm0
call   1030 <pow@plt>
mulsd  0xed0(%rip),%xmm0
add    $0x8,%rsp
ret

LLVM IR (-O0):
define double @a_Hep(double %0) {
%2 = alloca double
%3 = alloca double
store double %0, double* %3
%4 = load double, double* %3
%5 = fcmp ogt double %4, 0.000000e+00
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load double, double* %3
%8 = call double @pow(double %7, double -6.353000e-01)
%9 = fmul double 1.500000e-10, %8
store double %9, double* %2
br label %11
10: ; preds = %1
store double 0.000000e+00, double* %2
br label %11
11: ; preds = %10, %6
%12 = load double, double* %2
ret double %12
}

LLVM IR (-O2):
define double @a_Hep(double %0) {
%2 = fcmp ogt double %0, 0.000000e+00
br i1 %2, label %3, label %6
3: ; preds = %1
%4 = tail call double @pow(double %0, double -6.353000e-01)
%5 = fmul double %4, 1.500000e-10
br label %6
6: ; preds = %1, %3
%7 = phi double [ %5, %3 ], [ 0.000000e+00, %1 ]
ret double %7
}
char *strrchr(const char *pString, int character) {
  char *p = 0;
  while (*pString != 0) {
    if (*pString++ == character) {
      p = (char *)pString;
    }
  }
  return p;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     114b <strrchr+0x4b>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1146 <strrchr+0x46>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
jmp    1113 <strrchr+0x13>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <strrchr+0x25>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %12, %5 ], [ null, %2 ]
%8 = phi i8* [ %10, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = getelementptr inbounds i8, i8* %8, i64 1
%11 = icmp eq i32 %9, %1
%12 = select i1 %11, i8* %10, i8* %7
%13 = load i8, i8* %10
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ null, %2 ], [ %12, %5 ]
ret i8* %16
}
int packet_parse(struct packet_t *p, void *data, int length) { return 0; }


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

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

LLVM IR (-O0):
%struct.packet_t = type opaque
define i32 @packet_parse(%struct.packet_t* %0, i8* %1, i32 %2) {
%4 = alloca %struct.packet_t*
%5 = alloca i8*
%6 = alloca i32
store %struct.packet_t* %0, %struct.packet_t** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
ret i32 0
}

LLVM IR (-O2):
%struct.packet_t = type opaque
define i32 @packet_parse(%struct.packet_t* nocapture readnone %0, i8* nocapture readnone %1, i32 %2) {
ret i32 0
}
/* Type definitions */
struct usb_hcd {
  int dummy;
};
struct platform_device {
  int dummy;
};
struct device {
  int dummy;
};

/* Variables and functions */
struct usb_hcd *dev_get_drvdata(struct device *);
struct platform_device *to_platform_device(struct device *);
int /*<<< orphan*/ usb_hcd_ppc_soc_remove(struct usb_hcd *,
                                          struct platform_device *);
int ohci_hcd_ppc_soc_drv_remove(struct device *dev) {
  struct platform_device *pdev = to_platform_device(dev);
  struct usb_hcd *hcd = dev_get_drvdata(dev);
  usb_hcd_ppc_soc_remove(hcd, pdev);
  return 0;
}


x86 assembly (clang, -O0):
<ohci_hcd_ppc_soc_drv_remove>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <to_platform_device@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <dev_get_drvdata@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <usb_hcd_ppc_soc_remove@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ohci_hcd_ppc_soc_drv_remove>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1050 <to_platform_device@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <dev_get_drvdata@plt>
mov    %rax,%rdi
mov    %r14,%rsi
call   1040 <usb_hcd_ppc_soc_remove@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.device = type { i32 }
%struct.platform_device = type { i32 }
%struct.usb_hcd = type { i32 }
define i32 @ohci_hcd_ppc_soc_drv_remove(%struct.device* %0) {
%2 = alloca %struct.device*
%3 = alloca %struct.platform_device*
%4 = alloca %struct.usb_hcd*
store %struct.device* %0, %struct.device** %2
%5 = load %struct.device*, %struct.device** %2
%6 = call %struct.platform_device* @to_platform_device(%struct.device* %5)
store %struct.platform_device* %6, %struct.platform_device** %3
%7 = load %struct.device*, %struct.device** %2
%8 = call %struct.usb_hcd* @dev_get_drvdata(%struct.device* %7)
store %struct.usb_hcd* %8, %struct.usb_hcd** %4
%9 = load %struct.usb_hcd*, %struct.usb_hcd** %4
%10 = load %struct.platform_device*, %struct.platform_device** %3
%11 = call i32 @usb_hcd_ppc_soc_remove(%struct.usb_hcd* %9, %struct.platform_device* %10)
ret i32 0
}

LLVM IR (-O2):
%struct.device = type { i32 }
%struct.platform_device = type { i32 }
%struct.usb_hcd = type { i32 }
define i32 @ohci_hcd_ppc_soc_drv_remove(%struct.device* %0) {
%2 = tail call %struct.platform_device* @to_platform_device(%struct.device* %0)
%3 = tail call %struct.usb_hcd* @dev_get_drvdata(%struct.device* %0)
%4 = tail call i32 @usb_hcd_ppc_soc_remove(%struct.usb_hcd* %3, %struct.platform_device* %2)
ret i32 0
}
/* Variables and functions */
int Add(int, int);
int /*<<< orphan*/ printf(char *, int);
int main() {
  printf("%d", Add(15, 32));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0xf,%edi
mov    $0x20,%esi
call   1040 <Add@plt>
mov    %eax,%esi
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xf,%edi
mov    $0x20,%esi
call   1040 <Add@plt>
lea    0xec9(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @Add(i32 15, i32 32)
%3 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %2)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%d\00"
define i32 @main() {
%1 = tail call i32 @Add(i32 15, i32 32)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ _clear_error_stack();
int _connect_host(char const *, unsigned short, int);
int connect_host(const char *hostname, unsigned short port, int force_family) {
  { _clear_error_stack(); };
  return (_connect_host(hostname, port, force_family));
}


x86 assembly (clang, -O0):
<connect_host>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   1030 <_clear_error_stack@plt>
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x10(%rbp),%edx
movzwl %ax,%esi
call   1040 <_connect_host@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<connect_host>:
push   %rbp
push   %r14
push   %rbx
mov    %edx,%r14d
mov    %esi,%ebp
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <_clear_error_stack@plt>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
pop    %rbx
pop    %r14
pop    %rbp
jmp    1040 <_connect_host@plt>

LLVM IR (-O0):
define i32 @connect_host(i8* %0, i16 zeroext %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i32
store i8* %0, i8** %4
store i16 %1, i16* %5
store i32 %2, i32* %6
%7 = call i32 (...) @_clear_error_stack()
%8 = load i8*, i8** %4
%9 = load i16, i16* %5
%10 = load i32, i32* %6
%11 = call i32 @_connect_host(i8* %8, i16 zeroext %9, i32 %10)
ret i32 %11
}

LLVM IR (-O2):
define i32 @connect_host(i8* %0, i16 zeroext %1, i32 %2) {
%4 = tail call i32 (...) @_clear_error_stack()
%5 = tail call i32 @_connect_host(i8* %0, i16 zeroext %1, i32 %2)
ret i32 %5
}
int test_imm_F7int8_mem(signed char *val) {
  return ((*val) & (-0xF7 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_F7int8_mem>:
movsbl (%rdi),%eax
test   $0xffffff09,%eax
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_F7int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -247
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int min(int, int *);
int /*<<< orphan*/ printf(char *, int);
int main() {
  int vetor[10] = {0, 1, 2, 3, -5, -6, 0, 1, 65, 100};
  printf("Minimo: %d\n", min(10, vetor));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x30(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x28,%edx
call   1050 <memcpy@plt>
lea    -0x30(%rbp),%rsi
mov    $0xa,%edi
call   1040 <min@plt>
mov    %eax,%esi
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x28,%rsp
mov    0xef5(%rip),%rax
mov    %rax,0x20(%rsp)
movaps 0xed9(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xebd(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rsi
mov    $0xa,%edi
call   1040 <min@plt>
lea    0xecd(%rip),%rdi
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.main.vetor = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 -5, i32 -6, i32 0, i32 1, i32 65, i32 100]
@.str = [12 x i8] c"Minimo: %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i32]
store i32 0, i32* %1
%3 = bitcast [10 x i32]* %2 to i8*
%4 = getelementptr inbounds [10 x i32], [10 x i32]* %2, i64 0, i64 0
%5 = call i32 @min(i32 10, i32* %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %5)
ret i32 0
}

LLVM IR (-O2):
@__const.main.vetor = [10 x i32] [i32 0, i32 1, i32 2, i32 3, i32 -5, i32 -6, i32 0, i32 1, i32 65, i32 100]
@.str = [12 x i8] c"Minimo: %d\0A\00"
define i32 @main() {
%1 = alloca [10 x i32]
%2 = bitcast [10 x i32]* %1 to i8*
%3 = getelementptr inbounds [10 x i32], [10 x i32]* %1, i64 0, i64 0
%4 = call i32 @min(i32 10, i32* %3)
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i32 %4)
ret i32 0
}
double compute_mean(const double *times) {
  int i;
  double sum = 0;
  for (i = 0; i < 5; ++i) {
    sum += times[i];
  }
  return sum / 5;
}


x86 assembly (clang, -O0):
<compute_mean>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x5,-0xc(%rbp)
jge    1146 <compute_mean+0x46>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x18(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1117 <compute_mean+0x17>
movsd  -0x18(%rbp),%xmm0
movsd  0xead(%rip),%xmm1
divsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<compute_mean>:
xorpd  %xmm0,%xmm0
addsd  (%rdi),%xmm0
addsd  0x8(%rdi),%xmm0
addsd  0x10(%rdi),%xmm0
addsd  0x18(%rdi),%xmm0
addsd  0x20(%rdi),%xmm0
divsd  0xedc(%rip),%xmm0
ret

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

LLVM IR (-O2):
define double @compute_mean(double* nocapture %0) {
%2 = load double, double* %0
%3 = fadd double %2, 0.000000e+00
%4 = getelementptr inbounds double, double* %0, i64 1
%5 = load double, double* %4
%6 = fadd double %3, %5
%7 = getelementptr inbounds double, double* %0, i64 2
%8 = load double, double* %7
%9 = fadd double %6, %8
%10 = getelementptr inbounds double, double* %0, i64 3
%11 = load double, double* %10
%12 = fadd double %9, %11
%13 = getelementptr inbounds double, double* %0, i64 4
%14 = load double, double* %13
%15 = fadd double %12, %14
%16 = fdiv double %15, 5.000000e+00
ret double %16
}
void ac_clear(void) {}


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

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

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

LLVM IR (-O2):
define void @ac_clear() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, float);
int /*<<< orphan*/ scanf(char *, float *, float *);
int main() {
  float time, speed;
  scanf("%f %f", &time, &speed);
  printf("%.3f\n", ((speed * time) / 12.0));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xed2(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
call   1040 <scanf@plt>
movss  -0xc(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xea7(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xea6(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xedc(%rip),%rdi
lea    0x4(%rsp),%rsi
mov    %rsp,%rdx
call   1040 <scanf@plt>
movss  (%rsp),%xmm0
mulss  0x4(%rsp),%xmm0
divss  0xeb8(%rip),%xmm0
lea    0xebb(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"%f %f\00"
@.str.1 = [6 x i8] c"%.3f\0A\00"
define i32 @main() {
%1 = alloca float
%2 = alloca float
%3 = bitcast float* %1 to i8*
%4 = bitcast float* %2 to i8*
%5 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float* %1, float* %2)
%6 = load float, float* %2
%7 = load float, float* %1
%8 = fmul float %6, %7
%9 = fdiv float %8, 1.200000e+01
%10 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float %9)
ret i32 0
}
/* Type definitions */
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int /*<<< orphan*/ *BIO_new(int /*<<< orphan*/);
int /*<<< orphan*/ BIO_s_socket();
int /*<<< orphan*/ BIO_set_fd(int /*<<< orphan*/ *, int, int);
BIO *BIO_new_socket(int fd, int close_flag) {
  BIO *ret;
  ret = BIO_new(BIO_s_socket());
  if (ret == NULL)
    return (NULL);
  BIO_set_fd(ret, fd, close_flag);
  return (ret);
}


x86 assembly (clang, -O0):
<BIO_new_socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    $0x0,%al
call   1030 <BIO_s_socket@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    1168 <BIO_new_socket+0x38>
movq   $0x0,-0x8(%rbp)
jmp    117f <BIO_new_socket+0x4f>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <BIO_set_fd@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BIO_new_socket>:
push   %rbp
push   %r14
push   %rbx
mov    %esi,%r14d
mov    %edi,%ebp
xor    %eax,%eax
call   1030 <BIO_s_socket@plt>
mov    %eax,%edi
call   1040 <BIO_new@plt>
mov    %rax,%rbx
test   %rax,%rax
je     115c <BIO_new_socket+0x2c>
mov    %rbx,%rdi
mov    %ebp,%esi
mov    %r14d,%edx
call   1050 <BIO_set_fd@plt>
mov    %rbx,%rax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32* @BIO_new_socket(i32 %0, i32 %1) {
%3 = tail call i32 (...) @BIO_s_socket()
%4 = tail call i32* @BIO_new(i32 %3)
%5 = icmp eq i32* %4, null
br i1 %5, label %8, label %6
6: ; preds = %2
%7 = tail call i32 @BIO_set_fd(i32* %4, i32 %0, i32 %1)
br label %8
8: ; preds = %2, %6
ret i32* %4
}
/* Type definitions */
struct stream {
  int dummy;
};

/* Variables and functions */
int decode_long_address(unsigned char const *, struct stream *);
int decode_long_address_32bit_is1(const unsigned char *pkt,
                                  struct stream *stream) {
  return decode_long_address(pkt, stream);
}


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

x86 assembly (clang, -O2):
<decode_long_address_32bit_is1>:
jmp    1030 <decode_long_address@plt>

LLVM IR (-O0):
%struct.stream = type { i32 }
define i32 @decode_long_address_32bit_is1(i8* %0, %struct.stream* %1) {
%3 = alloca i8*
%4 = alloca %struct.stream*
store i8* %0, i8** %3
store %struct.stream* %1, %struct.stream** %4
%5 = load i8*, i8** %3
%6 = load %struct.stream*, %struct.stream** %4
%7 = call i32 @decode_long_address(i8* %5, %struct.stream* %6)
ret i32 %7
}

LLVM IR (-O2):
%struct.stream = type { i32 }
define i32 @decode_long_address_32bit_is1(i8* %0, %struct.stream* %1) {
%3 = tail call i32 @decode_long_address(i8* %0, %struct.stream* %1)
ret i32 %3
}
/* Variables and functions */
int putenv(char *);
int _tputenv(char *envstring) { return putenv(envstring); }


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

x86 assembly (clang, -O2):
<_tputenv>:
jmp    1030 <putenv@plt>

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

LLVM IR (-O2):
define i32 @_tputenv(i8* %0) {
%2 = tail call i32 @putenv(i8* %0)
ret i32 %2
}
int isxdigit(int a) {
  unsigned int ua = (unsigned int)a;
  return ((ua - '0') < 10) || ((ua - 'a') < 6) || ((ua - 'A') < 6);
}


x86 assembly (clang, -O0):
<isxdigit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%ecx
sub    $0x30,%ecx
mov    $0x1,%al
cmp    $0xa,%ecx
mov    %al,-0x9(%rbp)
jb     1144 <isxdigit+0x44>
mov    -0x8(%rbp),%ecx
sub    $0x61,%ecx
mov    $0x1,%al
cmp    $0x6,%ecx
mov    %al,-0x9(%rbp)
jb     1144 <isxdigit+0x44>
mov    -0x8(%rbp),%eax
sub    $0x41,%eax
cmp    $0x6,%eax
setb   %al
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isxdigit>:
lea    -0x30(%rdi),%eax
cmp    $0xa,%eax
setb   %al
and    $0xffffffdf,%edi
add    $0xffffffbf,%edi
cmp    $0x6,%edi
setb   %cl
or     %al,%cl
movzbl %cl,%eax
ret

LLVM IR (-O0):
define i32 @isxdigit(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = load i32, i32* %2
store i32 %4, i32* %3
%5 = load i32, i32* %3
%6 = sub i32 %5, 48
%7 = icmp ult i32 %6, 10
br i1 %7, label %16, label %8
8: ; preds = %1
%9 = load i32, i32* %3
%10 = sub i32 %9, 97
%11 = icmp ult i32 %10, 6
br i1 %11, label %16, label %12
12: ; preds = %8
%13 = load i32, i32* %3
%14 = sub i32 %13, 65
%15 = icmp ult i32 %14, 6
br label %16
16: ; preds = %12, %8, %1
%17 = phi i1 [ true, %8 ], [ true, %1 ], [ %15, %12 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @isxdigit(i32 %0) {
%2 = add i32 %0, -48
%3 = icmp ult i32 %2, 10
%4 = and i32 %0, -33
%5 = add i32 %4, -65
%6 = icmp ult i32 %5, 6
%7 = or i1 %3, %6
%8 = zext i1 %7 to i32
ret i32 %8
}
/* Variables and functions */
long megahal_expmem();
long cnt_bytes() { return megahal_expmem(); }


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

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

LLVM IR (-O0):
define i64 @cnt_bytes() {
%1 = call i64 (...) @megahal_expmem()
ret i64 %1
}

LLVM IR (-O2):
define i64 @cnt_bytes() {
%1 = tail call i64 (...) @megahal_expmem()
ret i64 %1
}
void EVP_PKEY_save_parameters(void) {}


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

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

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

LLVM IR (-O2):
define void @EVP_PKEY_save_parameters() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ print_n2n_version();
int /*<<< orphan*/ printf(char *);
void help() {
  print_n2n_version();
  printf("supernode -l <listening port> [-v] [-h]\n");
  exit(0);
}


x86 assembly (clang, -O0):
<help>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1030 <print_n2n_version@plt>
lea    0xebe(%rip),%rdi
call   1040 <printf@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<help>:
push   %rax
xor    %eax,%eax
call   1040 <print_n2n_version@plt>
lea    0xec1(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [41 x i8] c"supernode -l <listening port> [-v] [-h]\0A\00"
define void @help() {
%1 = call i32 (...) @print_n2n_version()
%2 = call i32 @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [40 x i8] c"supernode -l <listening port> [-v] [-h]\00"
define void @help() {
%1 = tail call i32 (...) @print_n2n_version()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef int volatile uint8_t;

/* Variables and functions */
int eeprom_is_ready(void) {
  return ((*(volatile uint8_t *)0x40020001) & ((uint8_t)0x01)) ? 1 : 0;
}


x86 assembly (clang, -O0):
<eeprom_is_ready>:
push   %rbp
mov    %rsp,%rbp
mov    $0x40020001,%eax
mov    (%rax),%edx
and    $0x1,%edx
xor    %eax,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @eeprom_is_ready() {
%1 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%2 = and i32 %1, 1
%3 = icmp ne i32 %2, 0
%4 = zext i1 %3 to i64
%5 = select i1 %3, i32 1, i32 0
ret i32 %5
}

LLVM IR (-O2):
define i32 @eeprom_is_ready() {
%1 = load volatile i32, i32* inttoptr (i64 1073872897 to i32*)
%2 = and i32 %1, 1
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ free(char *);
char *strdup(char *);
void c_set_string(char *v1, char *v2, void *t) {
  char *s;
  if (t) {
    s = *(char **)t;
    if (s)
      free(s);
    *(char **)t = strdup(v1);

  } else {
  }
}


x86 assembly (clang, -O0):
<c_set_string>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     1176 <c_set_string+0x56>
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
je     115e <c_set_string+0x3e>
mov    -0x20(%rbp),%rdi
call   1030 <free@plt>
mov    -0x8(%rbp),%rdi
call   1040 <strdup@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
mov    %rcx,(%rax)
jmp    117b <c_set_string+0x5b>
jmp    117b <c_set_string+0x5b>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<c_set_string>:
test   %rdx,%rdx
je     114e <c_set_string+0x2e>
push   %r14
push   %rbx
push   %rax
mov    %rdx,%rbx
mov    %rdi,%r14
mov    (%rdx),%rdi
test   %rdi,%rdi
je     113c <c_set_string+0x1c>
call   1030 <free@plt>
mov    %r14,%rdi
call   1040 <strdup@plt>
mov    %rax,(%rbx)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @c_set_string(i8* nocapture %0, i8* nocapture readnone %1, i8* %2) {
%4 = icmp eq i8* %2, null
br i1 %4, label %13, label %5
5: ; preds = %3
%6 = bitcast i8* %2 to i8**
%7 = load i8*, i8** %6
%8 = icmp eq i8* %7, null
br i1 %8, label %11, label %9
9: ; preds = %5
%10 = tail call i32 @free(i8* %7)
br label %11
11: ; preds = %9, %5
%12 = tail call i8* @strdup(i8* %0)
store i8* %12, i8** %6
br label %13
13: ; preds = %3, %11
ret void
}