xunge/DecIR huggingface dataset:
/* Variables and functions */
double vector_magnitude_3d(double *);
int /*<<< orphan*/ vector_subtract_3d(double const *, double const *, double *);
double vector_dist_3d(const double v1[3], const double v2[3]) {
  double v[3];
  vector_subtract_3d(v1, v2, v);
  return vector_magnitude_3d(v);
}


x86 assembly (clang, -O0):
<vector_dist_3d>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1040 <vector_subtract_3d@plt>
lea    -0x30(%rbp),%rdi
call   1030 <vector_magnitude_3d@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vector_dist_3d>:
push   %rbx
sub    $0x20,%rsp
mov    %rsp,%rbx
mov    %rbx,%rdx
call   1040 <vector_subtract_3d@plt>
mov    %rbx,%rdi
call   1030 <vector_magnitude_3d@plt>
add    $0x20,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define double @vector_dist_3d(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
%5 = alloca [3 x double]
store double* %0, double** %3
store double* %1, double** %4
%6 = load double*, double** %3
%7 = load double*, double** %4
%8 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%9 = call i32 @vector_subtract_3d(double* %6, double* %7, double* %8)
%10 = getelementptr inbounds [3 x double], [3 x double]* %5, i64 0, i64 0
%11 = call double @vector_magnitude_3d(double* %10)
ret double %11
}

LLVM IR (-O2):
define double @vector_dist_3d(double* %0, double* %1) {
%3 = alloca [3 x double]
%4 = bitcast [3 x double]* %3 to i8*
%5 = getelementptr inbounds [3 x double], [3 x double]* %3, i64 0, i64 0
%6 = call i32 @vector_subtract_3d(double* %0, double* %1, double* %5)
%7 = call double @vector_magnitude_3d(double* %5)
ret double %7
}
int dlpi_detach(int fd) { return -1; }


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

x86 assembly (clang, -O2):
<dlpi_detach>:
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @dlpi_detach(i32 %0) {
ret i32 -1
}
void insert_string(char *dst, char *str_to_add, int *i) {
  int j = 0;
  do {
    dst[*i] = str_to_add[j];
  } while ((*i)++, j++, str_to_add[j] != '\0');
}


x86 assembly (clang, -O0):
<insert_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x8(%rbp),%rax
mov    -0x18(%rbp),%rcx
movslq (%rcx),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0x18(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
jne    1117 <insert_string+0x17>
pop    %rbp
ret

x86 assembly (clang, -O2):
<insert_string>:
mov    (%rsi),%cl
mov    (%rdx),%eax
add    $0x1,%rsi
nopl   0x0(%rax,%rax,1)
cltq
mov    %cl,(%rdi,%rax,1)
mov    (%rdx),%eax
add    $0x1,%eax
mov    %eax,(%rdx)
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1110 <insert_string+0x10>
ret

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

LLVM IR (-O2):
define void @insert_string(i8* nocapture writeonly %0, i8* nocapture %1, i32* nocapture %2) {
%4 = load i8, i8* %1
%5 = load i32, i32* %2
br label %6
6: ; preds = %6, %3
%7 = phi i32 [ %13, %6 ], [ %5, %3 ]
%8 = phi i8 [ %16, %6 ], [ %4, %3 ]
%9 = phi i64 [ %14, %6 ], [ 0, %3 ]
%10 = sext i32 %7 to i64
%11 = getelementptr inbounds i8, i8* %0, i64 %10
store i8 %8, i8* %11
%12 = load i32, i32* %2
%13 = add nsw i32 %12, 1
store i32 %13, i32* %2
%14 = add nuw nsw i64 %9, 1
%15 = getelementptr inbounds i8, i8* %1, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, 0
br i1 %17, label %18, label %6
18: ; preds = %6
ret void
}
/* Variables and functions */
void *calloc(int, unsigned int);
void *Mem_AlignedAlloc(unsigned int align, unsigned int size) {
  void *newmem;
  newmem = calloc(1, size + align);
  if (newmem == NULL)
    return NULL;
  return (void *)((unsigned int)newmem + ((unsigned int)newmem % align));
}


x86 assembly (clang, -O0):
<Mem_AlignedAlloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0xc(%rbp)
mov    %esi,-0x10(%rbp)
mov    -0x10(%rbp),%esi
add    -0xc(%rbp),%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    114a <Mem_AlignedAlloc+0x3a>
movq   $0x0,-0x8(%rbp)
jmp    1165 <Mem_AlignedAlloc+0x55>
mov    -0x18(%rbp),%rax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%rax
xor    %edx,%edx
divl   -0xc(%rbp)
mov    -0x1c(%rbp),%eax
add    %edx,%eax
mov    %eax,%eax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Mem_AlignedAlloc>:
push   %rbx
mov    %edi,%ebx
add    %edi,%esi
mov    $0x1,%edi
call   1030 <calloc@plt>
test   %rax,%rax
je     1131 <Mem_AlignedAlloc+0x21>
mov    %rax,%rcx
xor    %edx,%edx
div    %ebx
mov    %edx,%eax
add    %ecx,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i8* @Mem_AlignedAlloc(i32 %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 %0, i32* %4
store i32 %1, i32* %5
%7 = load i32, i32* %5
%8 = load i32, i32* %4
%9 = add i32 %7, %8
%10 = call i8* @calloc(i32 1, i32 %9)
store i8* %10, i8** %6
%11 = load i8*, i8** %6
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %14
13: ; preds = %2
store i8* null, i8** %3
br label %24
14: ; preds = %2
%15 = load i8*, i8** %6
%16 = ptrtoint i8* %15 to i32
%17 = load i8*, i8** %6
%18 = ptrtoint i8* %17 to i32
%19 = load i32, i32* %4
%20 = urem i32 %18, %19
%21 = add i32 %16, %20
%22 = zext i32 %21 to i64
%23 = inttoptr i64 %22 to i8*
store i8* %23, i8** %3
br label %24
24: ; preds = %14, %13
%25 = load i8*, i8** %3
ret i8* %25
}

LLVM IR (-O2):
define i8* @Mem_AlignedAlloc(i32 %0, i32 %1) {
%3 = add i32 %1, %0
%4 = tail call i8* @calloc(i32 1, i32 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %13, label %6
6: ; preds = %2
%7 = ptrtoint i8* %4 to i64
%8 = trunc i64 %7 to i32
%9 = urem i32 %8, %0
%10 = add i32 %9, %8
%11 = zext i32 %10 to i64
%12 = inttoptr i64 %11 to i8*
br label %13
13: ; preds = %2, %6
%14 = phi i8* [ %12, %6 ], [ null, %2 ]
ret i8* %14
}
/* Variables and functions */
void munmap(void *addr, size_t length) {}


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

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

LLVM IR (-O0):
define void @munmap(i8* %0, i64 %1) {
%3 = alloca i8*
%4 = alloca i64
store i8* %0, i8** %3
store i64 %1, i64* %4
ret void
}

LLVM IR (-O2):
define void @munmap(i8* nocapture %0, i64 %1) {
ret void
}
void loadKTMConfig() {}


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

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

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

LLVM IR (-O2):
define void @loadKTMConfig() {
ret void
}
void pause(void) { asm volatile("pause"); }


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

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

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

LLVM IR (-O2):
define void @pause() {
tail call void asm sideeffect "pause", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
char *calloc(num, size)
unsigned num, size;
{ return ((char *)MemZeroAlloc((int)(num * size))); }


x86 assembly (clang, -O0):
<calloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
imul   -0x8(%rbp),%edi
mov    $0x0,%al
call   1030 <MemZeroAlloc@plt>
cltq
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<calloc>:
push   %rax
imul   %esi,%edi
xor    %eax,%eax
call   1030 <MemZeroAlloc@plt>
cltq
pop    %rcx
ret

LLVM IR (-O0):
define i8* @calloc(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 i32 %5, %6
%8 = call i32 (i32, ...) bitcast (i32 (...)* @MemZeroAlloc to i32 (i32, ...)*)(i32 %7)
%9 = sext i32 %8 to i64
%10 = inttoptr i64 %9 to i8*
ret i8* %10
}

LLVM IR (-O2):
define i8* @calloc(i32 %0, i32 %1) {
%3 = mul i32 %1, %0
%4 = tail call i32 (i32, ...) bitcast (i32 (...)* @MemZeroAlloc to i32 (i32, ...)*)(i32 %3)
%5 = sext i32 %4 to i64
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}
double hexinput(a, b)
double a, b;
{
  union {
    double d;
    unsigned short i[4];
  } u;
  unsigned long l;
  l = a;
  u.i[3] = l >> 16;
  u.i[2] = l;
  l = b;
  u.i[1] = l >> 16;
  u.i[0] = l;
  return (u.d);
}


x86 assembly (clang, -O0):
<hexinput>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  0xee5(%rip),%xmm2
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x1e(%rbp),%ax
mov    %ax,-0x12(%rbp)
mov    -0x20(%rbp),%ax
mov    %ax,-0x14(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps %xmm0,%xmm1
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rcx
cvttsd2si %xmm0,%rax
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %rdx,%rcx
or     %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
shr    $0x10,%rax
mov    %ax,-0x16(%rbp)
mov    -0x20(%rbp),%rax
mov    %ax,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexinput>:
movsd  0xef8(%rip),%xmm2
cvttsd2si %xmm0,%rax
subsd  %xmm2,%xmm0
cvttsd2si %xmm0,%rcx
mov    %rax,%rdx
sar    $0x3f,%rdx
and    %ecx,%edx
or     %edx,%eax
cvttsd2si %xmm1,%rcx
shl    $0x20,%rax
subsd  %xmm2,%xmm1
cvttsd2si %xmm1,%rdx
mov    %rcx,%rsi
sar    $0x3f,%rsi
and    %rdx,%rsi
or     %rcx,%rsi
movzwl %si,%ecx
and    $0xffff0000,%esi
or     %rax,%rsi
or     %rsi,%rcx
movq   %rcx,%xmm0
ret

LLVM IR (-O0):
%union.anon = type { double }
define double @hexinput(double %0, double %1) {
%3 = alloca double
%4 = alloca double
%5 = alloca %union.anon
%6 = alloca i64
store double %0, double* %3
store double %1, double* %4
%7 = load double, double* %3
%8 = fptoui double %7 to i64
store i64 %8, i64* %6
%9 = load i64, i64* %6
%10 = lshr i64 %9, 16
%11 = trunc i64 %10 to i16
%12 = bitcast %union.anon* %5 to [4 x i16]*
%13 = getelementptr inbounds [4 x i16], [4 x i16]* %12, i64 0, i64 3
store i16 %11, i16* %13
%14 = load i64, i64* %6
%15 = trunc i64 %14 to i16
%16 = bitcast %union.anon* %5 to [4 x i16]*
%17 = getelementptr inbounds [4 x i16], [4 x i16]* %16, i64 0, i64 2
store i16 %15, i16* %17
%18 = load double, double* %4
%19 = fptoui double %18 to i64
store i64 %19, i64* %6
%20 = load i64, i64* %6
%21 = lshr i64 %20, 16
%22 = trunc i64 %21 to i16
%23 = bitcast %union.anon* %5 to [4 x i16]*
%24 = getelementptr inbounds [4 x i16], [4 x i16]* %23, i64 0, i64 1
store i16 %22, i16* %24
%25 = load i64, i64* %6
%26 = trunc i64 %25 to i16
%27 = bitcast %union.anon* %5 to [4 x i16]*
%28 = getelementptr inbounds [4 x i16], [4 x i16]* %27, i64 0, i64 0
store i16 %26, i16* %28
%29 = bitcast %union.anon* %5 to double*
%30 = load double, double* %29
ret double %30
}

LLVM IR (-O2):
define double @hexinput(double %0, double %1) {
%3 = fptoui double %0 to i64
%4 = shl i64 %3, 32
%5 = fptoui double %1 to i64
%6 = and i64 %5, 4294901760
%7 = or i64 %6, %4
%8 = and i64 %5, 65535
%9 = or i64 %7, %8
%10 = bitcast i64 %9 to double
ret double %10
}
void lgtd_lifx_gateway_deallocate_tag_id(struct lgtd_lifx_gateway *gw,
                                         int tag_id) {
  (void)gw;
  (void)tag_id;
}


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

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

LLVM IR (-O0):
%struct.lgtd_lifx_gateway = type opaque
define void @lgtd_lifx_gateway_deallocate_tag_id(%struct.lgtd_lifx_gateway* %0, i32 %1) {
%3 = alloca %struct.lgtd_lifx_gateway*
%4 = alloca i32
store %struct.lgtd_lifx_gateway* %0, %struct.lgtd_lifx_gateway** %3
store i32 %1, i32* %4
%5 = load %struct.lgtd_lifx_gateway*, %struct.lgtd_lifx_gateway** %3
%6 = load i32, i32* %4
ret void
}

LLVM IR (-O2):
%struct.lgtd_lifx_gateway = type opaque
define void @lgtd_lifx_gateway_deallocate_tag_id(%struct.lgtd_lifx_gateway* nocapture %0, i32 %1) {
ret void
}
/* Variables and functions */
int memcmp(char *, char *, int);
int uwsgi_startswith(char *src, char *what, int wlen) {
  return memcmp(what, src, wlen);
}


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

x86 assembly (clang, -O2):
<uwsgi_startswith>:
mov    %rdi,%rax
mov    %rsi,%rdi
mov    %rax,%rsi
jmp    1030 <memcmp@plt>

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

LLVM IR (-O2):
define i32 @uwsgi_startswith(i8* %0, i8* %1, i32 %2) {
%4 = tail call i32 @memcmp(i8* %1, i8* %0, i32 %2)
ret i32 %4
}
void curs_nocbreak(void) {}


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

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

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

LLVM IR (-O2):
define void @curs_nocbreak() {
ret void
}
void snoopResultToString(unsigned int SnoopResult, int *post, char *strres) {
  if (SnoopResult == 0) {
    strres = "No Hit";
  } else if (SnoopResult == 1) {
    strres = "Hit";
    post = 1;
  } else if (SnoopResult == 2) {
    strres = "Hit";
    post = 1;
  } else {
    strres = "Unknown";
  }
}


x86 assembly (clang, -O0):
<snoopResultToString>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    1129 <snoopResultToString+0x29>
lea    0xee0(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    1184 <snoopResultToString+0x84>
cmpl   $0x1,-0x4(%rbp)
jne    114c <snoopResultToString+0x4c>
lea    0xec9(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    117f <snoopResultToString+0x7f>
cmpl   $0x2,-0x4(%rbp)
jne    116f <snoopResultToString+0x6f>
lea    0xea6(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    $0x1,%eax
mov    %rax,-0x10(%rbp)
jmp    117a <snoopResultToString+0x7a>
lea    0xe91(%rip),%rax
mov    %rax,-0x18(%rbp)
jmp    117f <snoopResultToString+0x7f>
jmp    1184 <snoopResultToString+0x84>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @snoopResultToString(i32 %0, i32* nocapture %1, i8* nocapture %2) {
ret void
}
/* Variables and functions */
int rand();
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int dado() {
  int Ndado;
  Ndado = 0;
  srand(time(NULL));
  do {
    Ndado = rand() % 7;
  } while (Ndado == 0);
  return Ndado;
}


x86 assembly (clang, -O0):
<dado>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
mov    $0x0,%al
call   1050 <rand@plt>
mov    $0x7,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     114f <dado+0x1f>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<dado>:
push   %rax
xor    %edi,%edi
call   1040 <time@plt>
mov    %eax,%edi
call   1030 <srand@plt>
nop
xor    %eax,%eax
call   1050 <rand@plt>
movslq %eax,%rcx
imul   $0xffffffff92492493,%rcx,%rax
shr    $0x20,%rax
add    %ecx,%eax
mov    %eax,%edx
shr    $0x1f,%edx
sar    $0x2,%eax
add    %edx,%eax
lea    0x0(,%rax,8),%edx
sub    %edx,%eax
add    %ecx,%eax
je     1140 <dado+0x10>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @dado() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @time(i32* null)
%3 = call i32 @srand(i32 %2)
br label %4
4: ; preds = %7, %0
%5 = call i32 (...) @rand()
%6 = srem i32 %5, 7
store i32 %6, i32* %1
br label %7
7: ; preds = %4
%8 = load i32, i32* %1
%9 = icmp eq i32 %8, 0
br i1 %9, label %4, label %10
10: ; preds = %7
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @dado() {
%1 = tail call i32 @time(i32* null)
%2 = tail call i32 @srand(i32 %1)
br label %3
3: ; preds = %3, %0
%4 = tail call i32 (...) @rand()
%5 = srem i32 %4, 7
%6 = icmp eq i32 %5, 0
br i1 %6, label %3, label %7
7: ; preds = %3
ret i32 %5
}
int putimage_(data, npix, nrast)
float data[];
int *npix, *nrast;
{ return (put_image(data, *npix, *nrast)); }


x86 assembly (clang, -O0):
<putimage_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rax
mov    (%rax),%esi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
mov    $0x0,%al
call   1030 <put_image@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putimage_>:
mov    (%rsi),%esi
mov    (%rdx),%edx
xor    %eax,%eax
jmp    1030 <put_image@plt>

LLVM IR (-O0):
define i32 @putimage_(float* %0, i32* %1, i32* %2) {
%4 = alloca float*
%5 = alloca i32*
%6 = alloca i32*
store float* %0, float** %4
store i32* %1, i32** %5
store i32* %2, i32** %6
%7 = load float*, float** %4
%8 = load i32*, i32** %5
%9 = load i32, i32* %8
%10 = load i32*, i32** %6
%11 = load i32, i32* %10
%12 = call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @put_image to i32 (float*, i32, i32, ...)*)(float* %7, i32 %9, i32 %11)
ret i32 %12
}

LLVM IR (-O2):
define i32 @putimage_(float* %0, i32* nocapture %1, i32* nocapture %2) {
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = tail call i32 (float*, i32, i32, ...) bitcast (i32 (...)* @put_image to i32 (float*, i32, i32, ...)*)(float* %0, i32 %4, i32 %5)
ret i32 %6
}
/* Variables and functions */
int f(int, int, int, int, int, int, int, int);
int /*<<< orphan*/ printf(char *, int);
main() { printf("%d\n", f(1, 2, 3, 4, 5, 6, 7, 8)); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
movl   $0x7,(%rsp)
movl   $0x8,0x8(%rsp)
call   1030 <f@plt>
mov    %eax,%esi
lea    0xe9b(%rip),%rdi
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0x1,%edi
mov    $0x2,%esi
mov    $0x3,%edx
mov    $0x4,%ecx
mov    $0x5,%r8d
mov    $0x6,%r9d
push   $0x8
push   $0x7
call   1030 <f@plt>
add    $0x10,%rsp
lea    0xeab(%rip),%rdi
mov    %eax,%esi
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
%2 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = tail call i32 @f(i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %1)
ret i32 0
}
int foo(void) {
  int a[2], c[2];
  int *ap = &a[0];
  int *bp = &a[0];
  int *cp = &c[0];
#pragma omp parallel for
  for (unsigned int idx = 0; idx < 2; idx++) {
    ap[idx] = 1;
    bp[idx] = 2;
    cp[idx] = ap[idx];
  }
  return *cp;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
lea    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x2,-0x2c(%rbp)
jae    116b <foo+0x6b>
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movl   $0x1,(%rax,%rcx,4)
mov    -0x20(%rbp),%rax
mov    -0x2c(%rbp),%ecx
movl   $0x2,(%rax,%rcx,4)
mov    -0x18(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    (%rax,%rcx,4),%edx
mov    -0x28(%rbp),%rax
mov    -0x2c(%rbp),%ecx
mov    %edx,(%rax,%rcx,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1123 <foo+0x23>
mov    -0x28(%rbp),%rax
mov    (%rax),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
mov    $0x2,%eax
ret

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

LLVM IR (-O2):
define i32 @foo() {
ret i32 2
}
char *BaseName(fname)
char *fname;
{
  char *basname;
  basname = (char *)strrchr(fname, '/');
  if (!basname)
    basname = fname;
  else
    basname++;
  return basname;
}


x86 assembly (clang, -O0):
<BaseName>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x2f,%esi
call   1030 <strrchr@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1146 <BaseName+0x36>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
jmp    1152 <BaseName+0x42>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<BaseName>:
push   %rbx
mov    %rdi,%rbx
mov    $0x2f,%esi
call   1030 <strrchr@plt>
lea    0x1(%rax),%rcx
test   %rax,%rax
cmove  %rbx,%rcx
mov    %rcx,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @BaseName(i8* %0) {
%2 = tail call i8* @strrchr(i8* dereferenceable(1) %0, i32 47)
%3 = icmp eq i8* %2, null
%4 = getelementptr inbounds i8, i8* %2, i64 1
%5 = select i1 %3, i8* %0, i8* %4
ret i8* %5
}
int msm_spm_get_vdd(unsigned int cpu) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @msm_spm_get_vdd(i32 %0) {
ret i32 0
}
/* Type definitions */
struct colHash {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ freez(struct colHash **);
void colHashFree(struct colHash **pEl) { freez(pEl); }


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

x86 assembly (clang, -O2):
<colHashFree>:
jmp    1030 <freez@plt>

LLVM IR (-O0):
%struct.colHash = type { i32 }
define void @colHashFree(%struct.colHash** %0) {
%2 = alloca %struct.colHash**
store %struct.colHash** %0, %struct.colHash*** %2
%3 = load %struct.colHash**, %struct.colHash*** %2
%4 = call i32 @freez(%struct.colHash** %3)
ret void
}

LLVM IR (-O2):
%struct.colHash = type { i32 }
define void @colHashFree(%struct.colHash** %0) {
%2 = tail call i32 @freez(%struct.colHash** %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ add_command(unsigned int *, int, int);
int /*<<< orphan*/ ipfw_init(int, char **, unsigned int, char const *,
                             unsigned int);
scalar_t__ optind;
int ipfw_replace(int args, char **arglist, const char *chain,
                 unsigned int rulenum) {
  unsigned int command = 0;
  add_command(&command, 0x0008U, 0x0000U);
  ipfw_init(args, arglist, command, chain, rulenum);
  optind = 0;
  return (0);
}


x86 assembly (clang, -O0):
<ipfw_replace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    -0x20(%rbp),%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x18(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <ipfw_init@plt>
mov    0x2e7d(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ipfw_replace>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %edi,%ebx
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rdi
mov    $0x8,%esi
xor    %edx,%edx
call   1040 <add_command@plt>
mov    0x4(%rsp),%edx
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %r15,%rcx
mov    %r14d,%r8d
call   1030 <ipfw_init@plt>
mov    0x2e82(%rip),%rax
movq   $0x0,(%rax)
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@optind = global i64 0
define i32 @ipfw_replace(i32 %0, i8** %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i8**
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
store i32 %0, i32* %5
store i8** %1, i8*** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
store i32 0, i32* %9
%10 = call i32 @add_command(i32* %9, i32 8, i32 0)
%11 = load i32, i32* %5
%12 = load i8**, i8*** %6
%13 = load i32, i32* %9
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = call i32 @ipfw_init(i32 %11, i8** %12, i32 %13, i8* %14, i32 %15)
store i64 0, i64* @optind
ret i32 0
}

LLVM IR (-O2):
@optind = global i64 0
define i32 @ipfw_replace(i32 %0, i8** %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = bitcast i32* %5 to i8*
store i32 0, i32* %5
%7 = call i32 @add_command(i32* %5, i32 8, i32 0)
%8 = load i32, i32* %5
%9 = call i32 @ipfw_init(i32 %0, i8** %1, i32 %8, i8* %2, i32 %3)
store i64 0, i64* @optind
ret i32 0
}
/* Type definitions */
typedef scalar_t__ uint32_t;

/* Variables and functions */
void stub1(uint32_t);
int main(void) {
  ((void (*)(uint32_t ui32Config))(
      (uint32_t *)(((uint32_t *)0x01000010)[13]))[23])(0x04C00000 | 0x00000000 |
                                                       0x00000000 | 0x00000540);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x1000010,%eax
mov    0x68(%rax),%rax
mov    $0x4c00540,%edi
call   *0xb8(%rax)
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x1000078,%rax
01
mov    $0x4c00540,%edi
call   *0xb8(%rax)
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = load i64, i64* getelementptr inbounds (i64, i64* inttoptr (i64 16777232 to i64*), i64 13)
%3 = inttoptr i64 %2 to i64*
%4 = getelementptr inbounds i64, i64* %3, i64 23
%5 = load i64, i64* %4
%6 = inttoptr i64 %5 to void (i64)*
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = load i64, i64* inttoptr (i64 16777336 to i64*)
%2 = inttoptr i64 %1 to i64*
%3 = getelementptr inbounds i64, i64* %2, i64 23
%4 = load i64, i64* %3
%5 = inttoptr i64 %4 to void (i64)*
tail call void %5(i64 79693120)
ret i32 0
}
/* Variables and functions */
int etp_init(void (*)(), void (*)());
int eio_init(void (*want_poll)(void), void (*done_poll)(void)) {
  return etp_init(want_poll, done_poll);
}


x86 assembly (clang, -O0):
<eio_init>:
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 <etp_init@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<eio_init>:
jmp    1030 <etp_init@plt>

LLVM IR (-O0):
define i32 @eio_init(void ()* %0, void ()* %1) {
%3 = alloca void ()*
%4 = alloca void ()*
store void ()* %0, void ()** %3
store void ()* %1, void ()** %4
%5 = load void ()*, void ()** %3
%6 = bitcast void ()* %5 to void (...)*
%7 = load void ()*, void ()** %4
%8 = bitcast void ()* %7 to void (...)*
%9 = call i32 @etp_init(void (...)* %6, void (...)* %8)
ret i32 %9
}

LLVM IR (-O2):
define i32 @eio_init(void ()* %0, void ()* %1) {
%3 = bitcast void ()* %0 to void (...)*
%4 = bitcast void ()* %1 to void (...)*
%5 = tail call i32 @etp_init(void (...)* %3, void (...)* %4)
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ EXIT_FAILURE;
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ perror(char const *);
void die_if(int error, const char *msg) {
  if (error) {
    perror(msg);
    exit(EXIT_FAILURE);
  }
}


x86 assembly (clang, -O0):
<die_if>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x0,-0x4(%rbp)
je     1150 <die_if+0x30>
mov    -0x10(%rbp),%rdi
call   1030 <perror@plt>
mov    0x2e97(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<die_if>:
test   %edi,%edi
jne    1125 <die_if+0x5>
ret
push   %rax
mov    %rsi,%rdi
call   1030 <perror@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@EXIT_FAILURE = global i32 0
define void @die_if(i32 %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
store i32 %0, i32* %3
store i8* %1, i8** %4
%5 = load i32, i32* %3
%6 = icmp ne i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %2
%8 = load i8*, i8** %4
%9 = call i32 @perror(i8* %8)
%10 = load i32, i32* @EXIT_FAILURE
%11 = call i32 @exit(i32 %10)
unreachable
12: ; preds = %2
ret void
}

LLVM IR (-O2):
@EXIT_FAILURE = global i32 0
define void @die_if(i32 %0, i8* nocapture %1) {
%3 = icmp eq i32 %0, 0
br i1 %3, label %8, label %4
4: ; preds = %2
%5 = tail call i32 @perror(i8* %1)
%6 = load i32, i32* @EXIT_FAILURE
%7 = tail call i32 @exit(i32 %6)
unreachable
8: ; preds = %2
ret void
}
/* Variables and functions */
float lgammaf_r(float, int *);
float gammaf_r(float x, int *signgamp) { return lgammaf_r(x, signgamp); }


x86 assembly (clang, -O0):
<gammaf_r>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
mov    %rdi,-0x10(%rbp)
movss  -0x4(%rbp),%xmm0
mov    -0x10(%rbp),%rdi
call   1030 <lgammaf_r@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gammaf_r>:
jmp    1030 <lgammaf_r@plt>

LLVM IR (-O0):
define float @gammaf_r(float %0, i32* %1) {
%3 = alloca float
%4 = alloca i32*
store float %0, float* %3
store i32* %1, i32** %4
%5 = load float, float* %3
%6 = load i32*, i32** %4
%7 = call float @lgammaf_r(float %5, i32* %6)
ret float %7
}

LLVM IR (-O2):
define float @gammaf_r(float %0, i32* %1) {
%3 = tail call float @lgammaf_r(float %0, i32* %1)
ret float %3
}
/* Variables and functions */
int prompt_for_int(char *, int /*<<< orphan*/, int);
int prompt_for_account(void) {
  return prompt_for_int("Enter an account number to edit (0-9 or q): ", 0, 10);
}


x86 assembly (clang, -O0):
<prompt_for_account>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
xor    %esi,%esi
mov    $0xa,%edx
call   1030 <prompt_for_int@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<prompt_for_account>:
lea    0xee9(%rip),%rdi
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <prompt_for_int@plt>

LLVM IR (-O0):
@.str = [45 x i8] c"Enter an account number to edit (0-9 or q): \00"
define i32 @prompt_for_account() {
%1 = call i32 @prompt_for_int(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 0, i32 10)
ret i32 %1
}

LLVM IR (-O2):
@.str = [45 x i8] c"Enter an account number to edit (0-9 or q): \00"
define i32 @prompt_for_account() {
%1 = tail call i32 @prompt_for_int(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str, i64 0, i64 0), i32 0, i32 10)
ret i32 %1
}
void RTErrInfoAllocEx(void) {}


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

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

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

LLVM IR (-O2):
define void @RTErrInfoAllocEx() {
ret void
}
int dst_isleapyear(int year) {
  return ((year % 4) == 0) && (((year % 100) != 0) || ((year % 400) == 0));
}


x86 assembly (clang, -O0):
<dst_isleapyear>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    $0x4,%ecx
cltd
idiv   %ecx
xor    %eax,%eax
cmp    $0x0,%edx
mov    %al,-0x5(%rbp)
jne    1153 <dst_isleapyear+0x53>
mov    -0x4(%rbp),%eax
mov    $0x64,%ecx
cltd
idiv   %ecx
mov    $0x1,%al
cmp    $0x0,%edx
mov    %al,-0x6(%rbp)
jne    114d <dst_isleapyear+0x4d>
mov    -0x4(%rbp),%eax
mov    $0x190,%ecx
cltd
idiv   %ecx
cmp    $0x0,%edx
sete   %al
mov    %al,-0x6(%rbp)
mov    -0x6(%rbp),%al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dst_isleapyear>:
xor    %eax,%eax
test   $0x3,%dil
je     1109 <dst_isleapyear+0x9>
ret
imul   $0xc28f5c29,%edi,%ecx
add    $0x51eb850,%ecx
mov    %ecx,%edx
ror    $0x2,%edx
mov    $0x1,%eax
cmp    $0x28f5c28,%edx
ja     1108 <dst_isleapyear+0x8>
ror    $0x4,%ecx
xor    %eax,%eax
cmp    $0xa3d70b,%ecx
setb   %al
ret

LLVM IR (-O0):
define i32 @dst_isleapyear(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = srem i32 %3, 4
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %16
6: ; preds = %1
%7 = load i32, i32* %2
%8 = srem i32 %7, 100
%9 = icmp ne i32 %8, 0
br i1 %9, label %14, label %10
10: ; preds = %6
%11 = load i32, i32* %2
%12 = srem i32 %11, 400
%13 = icmp eq i32 %12, 0
br label %14
14: ; preds = %10, %6
%15 = phi i1 [ true, %6 ], [ %13, %10 ]
br label %16
16: ; preds = %14, %1
%17 = phi i1 [ false, %1 ], [ %15, %14 ]
%18 = zext i1 %17 to i32
ret i32 %18
}

LLVM IR (-O2):
define i32 @dst_isleapyear(i32 %0) {
%2 = and i32 %0, 3
%3 = icmp eq i32 %2, 0
br i1 %3, label %4, label %11
4: ; preds = %1
%5 = srem i32 %0, 100
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %11
7: ; preds = %4
%8 = srem i32 %0, 400
%9 = icmp eq i32 %8, 0
%10 = zext i1 %9 to i32
br label %11
11: ; preds = %4, %7, %1
%12 = phi i32 [ 0, %1 ], [ 1, %4 ], [ %10, %7 ]
ret i32 %12
}
/* Type definitions */
typedef int uid_t;

/* Variables and functions */
int getuid();
int test(void) {
  uid_t uid;
  uid = getuid();
  return uid;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getuid@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = call i32 (...) @getuid()
store i32 %2, i32* %1
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
define i32 @test() {
%1 = tail call i32 (...) @getuid()
ret i32 %1
}
/* Variables and functions */
int MPI_Add_error_code(int, int *);
int MPI_Add_error_string(int, char *);
int PyMPI_MSMPI_MPI_Add_error_code(int errorclass, int *errorcode) {
  int ierr;
  char errstr[1] = {0};
  ierr = MPI_Add_error_code(errorclass, errorcode);
  if (ierr)
    return ierr;
  return MPI_Add_error_string(*errorcode, errstr);
}


x86 assembly (clang, -O0):
<PyMPI_MSMPI_MPI_Add_error_code>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x15(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1040 <memset@plt>
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1030 <MPI_Add_error_code@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
je     1173 <PyMPI_MSMPI_MPI_Add_error_code+0x43>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1185 <PyMPI_MSMPI_MPI_Add_error_code+0x55>
mov    -0x10(%rbp),%rax
mov    (%rax),%edi
lea    -0x15(%rbp),%rsi
call   1050 <MPI_Add_error_string@plt>
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PyMPI_MSMPI_MPI_Add_error_code>:
push   %rbx
sub    $0x10,%rsp
mov    %rsi,%rbx
movb   $0x0,0xf(%rsp)
call   1030 <MPI_Add_error_code@plt>
test   %eax,%eax
jne    1142 <PyMPI_MSMPI_MPI_Add_error_code+0x22>
mov    (%rbx),%edi
lea    0xf(%rsp),%rsi
call   1040 <MPI_Add_error_string@plt>
add    $0x10,%rsp
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @PyMPI_MSMPI_MPI_Add_error_code(i32 %0, i32* %1) {
%3 = alloca [1 x i8]
%4 = getelementptr inbounds [1 x i8], [1 x i8]* %3, i64 0, i64 0
store i8 0, i8* %4
%5 = tail call i32 @MPI_Add_error_code(i32 %0, i32* %1)
%6 = icmp eq i32 %5, 0
br i1 %6, label %7, label %10
7: ; preds = %2
%8 = load i32, i32* %1
%9 = call i32 @MPI_Add_error_string(i32 %8, i8* %4)
br label %10
10: ; preds = %2, %7
%11 = phi i32 [ %9, %7 ], [ %5, %2 ]
ret i32 %11
}
/* Variables and functions */
scalar_t__ foo(int /*<<< orphan*/);
int main(void) { 1 + foo(0); }


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1030 <foo@plt>
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = call i64 @foo(i32 0)
%2 = add nsw i64 1, %1
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i64 @foo(i32 0)
ret i32 0
}
double uc(unsigned char *p) { return (double)*p; }


x86 assembly (clang, -O0):
<uc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
cvtsi2sd %eax,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<uc>:
movzbl (%rdi),%eax
cvtsi2sd %eax,%xmm0
ret

LLVM IR (-O0):
define double @uc(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = uitofp i8 %4 to double
ret double %5
}

LLVM IR (-O2):
define double @uc(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = uitofp i8 %2 to double
ret double %3
}
/* Type definitions */
typedef int /*<<< orphan*/ u_long;

/* Variables and functions */
int /*<<< orphan*/ LOG_ERR;
int /*<<< orphan*/ exit(int);
void *malloc(size_t);
int /*<<< orphan*/ syslog(int /*<<< orphan*/, char *, int /*<<< orphan*/);
void *xmalloc(size_t siz) {
  void *p = malloc(siz);
  if (p)
    return (p);
  syslog(LOG_ERR, "malloc: failed to get %lu bytes", (u_long)siz);
  exit(1);
}


x86 assembly (clang, -O0):
<xmalloc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <malloc@plt>
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     115e <xmalloc+0x2e>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret
mov    0x2e73(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rax
mov    %eax,%edx
lea    0xe8c(%rip),%rsi
call   1040 <syslog@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<xmalloc>:
push   %rbx
mov    %rdi,%rbx
call   1030 <malloc@plt>
test   %rax,%rax
je     1140 <xmalloc+0x10>
pop    %rbx
ret
mov    0x2e91(%rip),%rax
mov    (%rax),%edi
lea    0xeb0(%rip),%rsi
mov    %ebx,%edx
call   1040 <syslog@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@LOG_ERR = global i32 0
@.str = [32 x i8] c"malloc: failed to get %lu bytes\00"
define i8* @xmalloc(i64 %0) {
%2 = alloca i64
%3 = alloca i8*
store i64 %0, i64* %2
%4 = load i64, i64* %2
%5 = call i8* @malloc(i64 %4)
store i8* %5, i8** %3
%6 = load i8*, i8** %3
%7 = icmp ne i8* %6, null
br i1 %7, label %8, label %10
8: ; preds = %1
%9 = load i8*, i8** %3
ret i8* %9
10: ; preds = %1
%11 = load i32, i32* @LOG_ERR
%12 = load i64, i64* %2
%13 = trunc i64 %12 to i32
%14 = call i32 @syslog(i32 %11, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %13)
%15 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@LOG_ERR = global i32 0
@.str = [32 x i8] c"malloc: failed to get %lu bytes\00"
define noalias i8* @xmalloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
%3 = icmp eq i8* %2, null
br i1 %3, label %5, label %4
4: ; preds = %1
ret i8* %2
5: ; preds = %1
%6 = load i32, i32* @LOG_ERR
%7 = trunc i64 %0 to i32
%8 = tail call i32 @syslog(i32 %6, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = tail call i32 @exit(i32 1)
unreachable
}
int ip6cp_receive_proto_reject(struct lcp_context *context) {
  context = context;
  return 0;
}


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

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

LLVM IR (-O0):
%struct.lcp_context = type opaque
define i32 @ip6cp_receive_proto_reject(%struct.lcp_context* %0) {
%2 = alloca %struct.lcp_context*
store %struct.lcp_context* %0, %struct.lcp_context** %2
%3 = load %struct.lcp_context*, %struct.lcp_context** %2
store %struct.lcp_context* %3, %struct.lcp_context** %2
ret i32 0
}

LLVM IR (-O2):
%struct.lcp_context = type opaque
define i32 @ip6cp_receive_proto_reject(%struct.lcp_context* nocapture readnone %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ fun_one(int *);
int main(void) {
  int a = 10;
  fun_one(&a);
  return 0;
}


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

x86 assembly (clang, -O2):
<main>:
push   %rax
movl   $0xa,0x4(%rsp)
lea    0x4(%rsp),%rdi
call   1030 <fun_one@plt>
xor    %eax,%eax
pop    %rcx
ret

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

LLVM IR (-O2):
define i32 @main() {
%1 = alloca i32
%2 = bitcast i32* %1 to i8*
store i32 10, i32* %1
%3 = call i32 @fun_one(i32* %1)
ret i32 0
}
void *mgsl_get_text_ptr(void) {
  { return ((void *)(&mgsl_get_text_ptr)); }
}


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

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

LLVM IR (-O0):
define i8* @mgsl_get_text_ptr() {
ret i8* bitcast (i8* ()* @mgsl_get_text_ptr to i8*)
}

LLVM IR (-O2):
define i8* @mgsl_get_text_ptr() {
ret i8* bitcast (i8* ()* @mgsl_get_text_ptr to i8*)
}
int av_pause(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @av_pause() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ srand(int);
void random_seed(int seed) { srand(seed); }


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

x86 assembly (clang, -O2):
<random_seed>:
jmp    1030 <srand@plt>

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

LLVM IR (-O2):
define void @random_seed(i32 %0) {
%2 = tail call i32 @srand(i32 %0)
ret void
}
int _open(const char *name, int flags, int mode) { return -1; }


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

x86 assembly (clang, -O2):
<_open>:
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
define i32 @_open(i8* nocapture readnone %0, i32 %1, i32 %2) {
ret i32 -1
}
short printing_id(short dropping_id) { return dropping_id; }


x86 assembly (clang, -O0):
<printing_id>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movswl -0x2(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i16 @printing_id(i16 signext %0) {
%2 = alloca i16
store i16 %0, i16* %2
%3 = load i16, i16* %2
ret i16 %3
}

LLVM IR (-O2):
define signext i16 @printing_id(i16 returned signext %0) {
ret i16 %0
}