xunge/DecIR huggingface dataset:
char *strcpy(char *dest, const char *src) {
  char *odest = dest;
  for (; *src; src++, dest++) {
    *dest = *src;
  }
  *dest = '\0';
  return odest;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     114a <strcpy+0x4a>
mov    -0x10(%rbp),%rax
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1114 <strcpy+0x14>
mov    -0x8(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
mov    (%rsi),%cl
mov    %rdi,%rdx
test   %cl,%cl
je     1131 <strcpy+0x31>
add    $0x1,%rsi
mov    %rax,%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %cl,(%rdx)
add    $0x1,%rdx
movzbl (%rsi),%ecx
add    $0x1,%rsi
test   %cl,%cl
jne    1120 <strcpy+0x20>
movb   $0x0,(%rdx)
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* returned writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %13, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %11, %5 ], [ %3, %2 ]
%7 = phi i8* [ %10, %5 ], [ %0, %2 ]
%8 = phi i8* [ %9, %5 ], [ %1, %2 ]
store i8 %6, i8* %7
%9 = getelementptr inbounds i8, i8* %8, i64 1
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %9
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %5
13: ; preds = %5, %2
%14 = phi i8* [ %0, %2 ], [ %10, %5 ]
store i8 0, i8* %14
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ dread_ascfile(char const *, double *, double *, int *,
                                 double *);
void DREAD_ASCFILE_C_(const char *name, double *t0, double *dt, int *n,
                      double *data) {
  dread_ascfile(name, t0, dt, n, data);
}


x86 assembly (clang, -O0):
<DREAD_ASCFILE_C_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
call   1030 <dread_ascfile@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DREAD_ASCFILE_C_>:
jmp    1030 <dread_ascfile@plt>

LLVM IR (-O0):
define void @DREAD_ASCFILE_C_(i8* %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = alloca i8*
%7 = alloca double*
%8 = alloca double*
%9 = alloca i32*
%10 = alloca double*
store i8* %0, i8** %6
store double* %1, double** %7
store double* %2, double** %8
store i32* %3, i32** %9
store double* %4, double** %10
%11 = load i8*, i8** %6
%12 = load double*, double** %7
%13 = load double*, double** %8
%14 = load i32*, i32** %9
%15 = load double*, double** %10
%16 = call i32 @dread_ascfile(i8* %11, double* %12, double* %13, i32* %14, double* %15)
ret void
}

LLVM IR (-O2):
define void @DREAD_ASCFILE_C_(i8* %0, double* %1, double* %2, i32* %3, double* %4) {
%6 = tail call i32 @dread_ascfile(i8* %0, double* %1, double* %2, i32* %3, double* %4)
ret void
}
void classic_loop(int n) {
  int i = 0;
  while (i < n) {
    i++;
  }
}


x86 assembly (clang, -O0):
<classic_loop>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1128 <classic_loop+0x28>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <classic_loop+0xe>
pop    %rbp
ret

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

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

LLVM IR (-O2):
define void @classic_loop(i32 %0) {
ret void
}
long distance_sq_0(long x1, long y1, long z1, long w1, long x2, long y2,
                   long z2, long w2) {
  long xd, yd, zd, wd;
  xd = (x1 - x2);
  yd = (y1 - y2);
  zd = (z1 - z2);
  wd = (w1 - w2);
  return xd * xd + yd * yd + zd * zd + wd * wd;
}


x86 assembly (clang, -O0):
<distance_sq_0>:
push   %rbp
mov    %rsp,%rbp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x8(%rbp),%rax
sub    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x10(%rbp),%rax
sub    -0x30(%rbp),%rax
mov    %rax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
sub    0x10(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x20(%rbp),%rax
sub    0x18(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x38(%rbp),%rax
imul   -0x38(%rbp),%rax
mov    -0x40(%rbp),%rcx
imul   -0x40(%rbp),%rcx
add    %rcx,%rax
mov    -0x48(%rbp),%rcx
imul   -0x48(%rbp),%rcx
add    %rcx,%rax
mov    -0x50(%rbp),%rcx
imul   -0x50(%rbp),%rcx
add    %rcx,%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<distance_sq_0>:
sub    %r8,%rdi
sub    0x8(%rsp),%rdx
sub    0x10(%rsp),%rcx
sub    %r9,%rsi
imul   %rdi,%rdi
imul   %rsi,%rsi
lea    (%rsi,%rdi,1),%rax
imul   %rdx,%rdx
add    %rdx,%rax
imul   %rcx,%rcx
add    %rcx,%rax
ret

LLVM IR (-O0):
define i64 @distance_sq_0(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7) {
%9 = alloca i64
%10 = alloca i64
%11 = alloca i64
%12 = alloca i64
%13 = alloca i64
%14 = alloca i64
%15 = alloca i64
%16 = alloca i64
%17 = alloca i64
%18 = alloca i64
%19 = alloca i64
%20 = alloca i64
store i64 %0, i64* %9
store i64 %1, i64* %10
store i64 %2, i64* %11
store i64 %3, i64* %12
store i64 %4, i64* %13
store i64 %5, i64* %14
store i64 %6, i64* %15
store i64 %7, i64* %16
%21 = load i64, i64* %9
%22 = load i64, i64* %13
%23 = sub nsw i64 %21, %22
store i64 %23, i64* %17
%24 = load i64, i64* %10
%25 = load i64, i64* %14
%26 = sub nsw i64 %24, %25
store i64 %26, i64* %18
%27 = load i64, i64* %11
%28 = load i64, i64* %15
%29 = sub nsw i64 %27, %28
store i64 %29, i64* %19
%30 = load i64, i64* %12
%31 = load i64, i64* %16
%32 = sub nsw i64 %30, %31
store i64 %32, i64* %20
%33 = load i64, i64* %17
%34 = load i64, i64* %17
%35 = mul nsw i64 %33, %34
%36 = load i64, i64* %18
%37 = load i64, i64* %18
%38 = mul nsw i64 %36, %37
%39 = add nsw i64 %35, %38
%40 = load i64, i64* %19
%41 = load i64, i64* %19
%42 = mul nsw i64 %40, %41
%43 = add nsw i64 %39, %42
%44 = load i64, i64* %20
%45 = load i64, i64* %20
%46 = mul nsw i64 %44, %45
%47 = add nsw i64 %43, %46
ret i64 %47
}

LLVM IR (-O2):
define i64 @distance_sq_0(i64 %0, i64 %1, i64 %2, i64 %3, i64 %4, i64 %5, i64 %6, i64 %7) {
%9 = sub nsw i64 %0, %4
%10 = sub nsw i64 %1, %5
%11 = sub nsw i64 %2, %6
%12 = sub nsw i64 %3, %7
%13 = mul nsw i64 %9, %9
%14 = mul nsw i64 %10, %10
%15 = add nuw nsw i64 %14, %13
%16 = mul nsw i64 %11, %11
%17 = add nuw nsw i64 %15, %16
%18 = mul nsw i64 %12, %12
%19 = add nuw nsw i64 %17, %18
ret i64 %19
}
/* Variables and functions */
int /*<<< orphan*/ ngen(char *, char *, int);
void cginclb(int a) { ngen("%s\t%d(%%ebp)", "incb", a); }


x86 assembly (clang, -O0):
<cginclb>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edx
lea    0xedb(%rip),%rdi
lea    0xee1(%rip),%rsi
call   1030 <ngen@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cginclb>:
mov    %edi,%edx
lea    0xee7(%rip),%rdi
lea    0xeed(%rip),%rsi
jmp    1030 <ngen@plt>

LLVM IR (-O0):
@.str = [13 x i8] c"%s\09%d(%%ebp)\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cginclb(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %3)
ret void
}

LLVM IR (-O2):
@.str = [13 x i8] c"%s\09%d(%%ebp)\00"
@.str.1 = [5 x i8] c"incb\00"
define void @cginclb(i32 %0) {
%2 = tail call i32 @ngen(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i32 %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void gsize_free(void *g) { free(g); }


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

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

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

LLVM IR (-O2):
define void @gsize_free(i8* nocapture %0) {
%2 = tail call i32 @free(i8* %0)
ret void
}
/* Variables and functions */
int lrand48();
int gen_number(int range) { return lrand48() % range; }


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

x86 assembly (clang, -O2):
<gen_number>:
push   %rbx
mov    %edi,%ebx
xor    %eax,%eax
call   1030 <lrand48@plt>
cltd
idiv   %ebx
mov    %edx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @gen_number(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @lrand48()
%4 = load i32, i32* %2
%5 = srem i32 %3, %4
ret i32 %5
}

LLVM IR (-O2):
define i32 @gen_number(i32 %0) {
%2 = tail call i32 (...) @lrand48()
%3 = srem i32 %2, %0
ret i32 %3
}
/* Variables and functions */
int hDoubleToLongBits(double);
int hIsFinite(double d) {
  return (hDoubleToLongBits(d) & 0x7ff0000000000000ll) < 0x7ff0000000000000ll;
}


x86 assembly (clang, -O0):
<hIsFinite>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <hDoubleToLongBits@plt>
cltq
movabs $0x7ff0000000000000,%rcx
and    %rcx,%rax
movabs $0x7ff0000000000000,%rcx
cmp    %rcx,%rax
setl   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hIsFinite>:
push   %rax
call   1030 <hDoubleToLongBits@plt>
movslq %eax,%rcx
not    %rcx
movabs $0x7ff0000000000000,%rdx
xor    %eax,%eax
test   %rdx,%rcx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
define i32 @hIsFinite(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @hDoubleToLongBits(double %3)
%5 = sext i32 %4 to i64
%6 = and i64 %5, 9218868437227405312
%7 = icmp slt i64 %6, 9218868437227405312
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @hIsFinite(double %0) {
%2 = tail call i32 @hDoubleToLongBits(double %0)
%3 = sext i32 %2 to i64
%4 = and i64 %3, 9218868437227405312
%5 = icmp ne i64 %4, 9218868437227405312
%6 = zext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ getenv(char *);
int yesno(int /*<<< orphan*/);
bool is_verbose(void) { return yesno(getenv("EINFO_VERBOSE")); }


x86 assembly (clang, -O0):
<is_verbose>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
call   1040 <yesno@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_verbose>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <getenv@plt>
mov    %eax,%edi
pop    %rax
jmp    1040 <yesno@plt>

LLVM IR (-O0):
@.str = [14 x i8] c"EINFO_VERBOSE\00"
define i32 @is_verbose() {
%1 = call i32 @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @yesno(i32 %1)
ret i32 %2
}

LLVM IR (-O2):
@.str = [14 x i8] c"EINFO_VERBOSE\00"
define i32 @is_verbose() {
%1 = tail call i32 @getenv(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @yesno(i32 %1)
ret i32 %2
}
int test_imm_9Buint16_reg(unsigned short val) {
  return ((val) & (-0x9B << 0)) ? -20 : -40;
}


x86 assembly (clang, -O0):
<test_imm_9Buint16_reg>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movzwl -0x2(%rbp),%edx
and    $0xffffff65,%edx
mov    $0xffffffd8,%eax
mov    $0xffffffec,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_imm_9Buint16_reg>:
test   $0xff65,%edi
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @test_imm_9Buint16_reg(i16 zeroext %0) {
%2 = and i16 %0, -155
%3 = icmp eq i16 %2, 0
%4 = select i1 %3, i32 -40, i32 -20
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int);
int /*<<< orphan*/ scanf(char *, int, int);
main() {
  int x, y, z;
  scanf("%d %d", x, y);
  z = x - y;
  printf("%d minus %d = %d\n", x, y, z);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xecb(%rip),%rdi
call   1040 <scanf@plt>
mov    -0x4(%rbp),%eax
sub    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    -0xc(%rbp),%ecx
lea    0xeb3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [18 x i8] c"%d minus %d = %d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = load i32, i32* %1
%5 = load i32, i32* %2
%6 = call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %4, i32 %5)
%7 = load i32, i32* %1
%8 = load i32, i32* %2
%9 = sub nsw i32 %7, %8
store i32 %9, i32* %3
%10 = load i32, i32* %1
%11 = load i32, i32* %2
%12 = load i32, i32* %3
%13 = call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 %10, i32 %11, i32 %12)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%d %d\00"
@.str.1 = [18 x i8] c"%d minus %d = %d\0A\00"
define i32 @main() {
%1 = tail call i32 @scanf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 undef, i32 undef)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.1, i64 0, i64 0), i32 undef, i32 undef, i32 undef)
ret i32 0
}
int my_str_isnum(char *str) {
  int i;
  i = 0;
  while (str[i] != '\0') {
    if (!(str[i] >= '0' && str[i] <= '9'))
      return (0);
    i++;
  }
  return (1);
}


x86 assembly (clang, -O0):
<my_str_isnum>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <my_str_isnum+0x68>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     114e <my_str_isnum+0x4e>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    115a <my_str_isnum+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    116f <my_str_isnum+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    110f <my_str_isnum+0xf>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_str_isnum>:
mov    (%rdi),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1123 <my_str_isnum+0x23>
add    $0x1,%rdi
nop
add    $0xd0,%cl
cmp    $0xa,%cl
jae    1124 <my_str_isnum+0x24>
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <my_str_isnum+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @my_str_isnum(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %8
4: ; preds = %8
%5 = getelementptr inbounds i8, i8* %0, i64 %13
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %14, label %8
8: ; preds = %1, %4
%9 = phi i64 [ %13, %4 ], [ 0, %1 ]
%10 = phi i8 [ %6, %4 ], [ %2, %1 ]
%11 = add i8 %10, -48
%12 = icmp ult i8 %11, 10
%13 = add nuw i64 %9, 1
br i1 %12, label %4, label %14
14: ; preds = %8, %4, %1
%15 = phi i32 [ 1, %1 ], [ 1, %4 ], [ 0, %8 ]
ret i32 %15
}
float f_sin_xx_6(float xx) {
  return 0.7853981633974483 +
         xx * (-0.08074544390600076 +
               xx * (0.002490020287907521 + xx * (-3.596176288784333e-05)));
}


x86 assembly (clang, -O0):
<f_sin_xx_6>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x4(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0x4(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
movsd  0xee4(%rip),%xmm3
mulsd  %xmm3,%xmm2
movsd  0xee0(%rip),%xmm3
addsd  %xmm3,%xmm2
mulsd  %xmm2,%xmm1
movsd  0xec0(%rip),%xmm2
addsd  %xmm2,%xmm1
mulsd  %xmm1,%xmm0
movsd  0xea8(%rip),%xmm1
addsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<f_sin_xx_6>:
cvtss2sd %xmm0,%xmm0
movsd  0xef4(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xef0(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xeec(%rip),%xmm1
mulsd  %xmm0,%xmm1
addsd  0xee8(%rip),%xmm1
xorps  %xmm0,%xmm0
cvtsd2ss %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @f_sin_xx_6(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = load float, float* %2
%6 = fpext float %5 to double
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = call double @llvm.fmuladd.f64(double %8, double 0xBF02DAB4C39AA380, double 0x3F6465F3767E7A93)
%10 = call double @llvm.fmuladd.f64(double %6, double %9, double 0xBFB4ABBBC0E09525)
%11 = call double @llvm.fmuladd.f64(double %4, double %10, double 0x3FE921FB54442D18)
%12 = fptrunc double %11 to float
ret float %12
}

LLVM IR (-O2):
define float @f_sin_xx_6(float %0) {
%2 = fpext float %0 to double
%3 = tail call double @llvm.fmuladd.f64(double %2, double 0xBF02DAB4C39AA380, double 0x3F6465F3767E7A93)
%4 = tail call double @llvm.fmuladd.f64(double %2, double %3, double 0xBFB4ABBBC0E09525)
%5 = tail call double @llvm.fmuladd.f64(double %2, double %4, double 0x3FE921FB54442D18)
%6 = fptrunc double %5 to float
ret float %6
}
/* Type definitions */
struct device {
  int dummy;
};

/* Variables and functions */
int io373b_read_regs(struct device *, unsigned short, unsigned char *, int);
int io373b_read_reg(struct device *io373b_dev, unsigned short reg,
                    unsigned char *p_1byte) {
  return io373b_read_regs(io373b_dev, reg, p_1byte, 1);
}


x86 assembly (clang, -O0):
<io373b_read_reg>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xa(%rbp),%ax
mov    -0x18(%rbp),%rdx
mov    $0x1,%ecx
movzwl %ax,%esi
call   1030 <io373b_read_regs@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<io373b_read_reg>:
mov    $0x1,%ecx
jmp    1030 <io373b_read_regs@plt>

LLVM IR (-O0):
%struct.device = type { i32 }
define i32 @io373b_read_reg(%struct.device* %0, i16 zeroext %1, i8* %2) {
%4 = alloca %struct.device*
%5 = alloca i16
%6 = alloca i8*
store %struct.device* %0, %struct.device** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%7 = load %struct.device*, %struct.device** %4
%8 = load i16, i16* %5
%9 = load i8*, i8** %6
%10 = call i32 @io373b_read_regs(%struct.device* %7, i16 zeroext %8, i8* %9, i32 1)
ret i32 %10
}

LLVM IR (-O2):
%struct.device = type { i32 }
define i32 @io373b_read_reg(%struct.device* %0, i16 zeroext %1, i8* %2) {
%4 = tail call i32 @io373b_read_regs(%struct.device* %0, i16 zeroext %1, i8* %2, i32 1)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ cdecl_func__getopt(int /*<<< orphan*/);
int /*<<< orphan*/ getopt;
void cdecl_expr__getopt() { cdecl_func__getopt(getopt); }


x86 assembly (clang, -O0):
<cdecl_expr__getopt>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ecd(%rip),%rax
mov    (%rax),%edi
call   1030 <cdecl_func__getopt@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<cdecl_expr__getopt>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%edi
jmp    1030 <cdecl_func__getopt@plt>

LLVM IR (-O0):
@getopt = global i32 0
define void @cdecl_expr__getopt() {
%1 = load i32, i32* @getopt
%2 = call i32 @cdecl_func__getopt(i32 %1)
ret void
}

LLVM IR (-O2):
@getopt = global i32 0
define void @cdecl_expr__getopt() {
%1 = load i32, i32* @getopt
%2 = tail call i32 @cdecl_func__getopt(i32 %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ setClientId(int, int);
void setup_rjh(int rjh___0) {
  {
    { setClientId(rjh___0, rjh___0); }
    return;
  }
}


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

x86 assembly (clang, -O2):
<setup_rjh>:
mov    %edi,%esi
jmp    1030 <setClientId@plt>

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

LLVM IR (-O2):
define void @setup_rjh(i32 %0) {
%2 = tail call i32 @setClientId(i32 %0, i32 %0)
ret void
}
int postop() {}


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

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

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

LLVM IR (-O2):
define i32 @postop() {
ret i32 undef
}
/* Variables and functions */
int strlen(char *);
char *get_key_end(char *line) {
  char *result = line + strlen(line) - 6 - 2;
  while (*result != ' ')
    --result;
  return result;
}


x86 assembly (clang, -O0):
<get_key_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
add    $0xfffffffffffffffa,%rax
add    $0xfffffffffffffffe,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1166 <get_key_end+0x56>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1145 <get_key_end+0x35>
mov    -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_key_end>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
cltq
add    %rbx,%rax
add    $0xfffffffffffffff8,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
cmpb   $0x20,(%rax)
lea    -0x1(%rax),%rax
jne    1130 <get_key_end+0x20>
add    $0x1,%rax
pop    %rbx
ret

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

LLVM IR (-O2):
define i8* @get_key_end(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = getelementptr inbounds i8, i8* %4, i64 -6
%6 = getelementptr inbounds i8, i8* %5, i64 -2
br label %7
7: ; preds = %7, %1
%8 = phi i8* [ %6, %1 ], [ %11, %7 ]
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 32
%11 = getelementptr inbounds i8, i8* %8, i64 -1
br i1 %10, label %12, label %7
12: ; preds = %7
ret i8* %8
}
void exit(int exit_code) {
  while (1)
    ;
}


x86 assembly (clang, -O0):
<exit>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
jmp    1107 <exit+0x7>

x86 assembly (clang, -O2):
<exit>:
jmp    1100 <exit>

LLVM IR (-O0):
define void @exit(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
br label %3
3: ; preds = %1, %3
br label %3
}

LLVM IR (-O2):
define void @exit(i32 %0) {
br label %2
2: ; preds = %1, %2
br label %2
}
void extract_write_word(unsigned char *addr, unsigned int value) {
  addr[0] = (value >> 0) & 0xff;
  addr[1] = (value >> 8) & 0xff;
  addr[2] = (value >> 16) & 0xff;
}


x86 assembly (clang, -O0):
<extract_write_word>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%eax
shr    $0x0,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
mov    -0xc(%rbp),%eax
shr    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0xc(%rbp),%eax
shr    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,0x2(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<extract_write_word>:
mov    %esi,%eax
mov    %al,(%rdi)
mov    %ah,0x1(%rdi)
shr    $0x10,%eax
mov    %al,0x2(%rdi)
ret

LLVM IR (-O0):
define void @extract_write_word(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = lshr i32 %5, 0
%7 = and i32 %6, 255
%8 = trunc i32 %7 to i8
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 0
store i8 %8, i8* %10
%11 = load i32, i32* %4
%12 = lshr i32 %11, 8
%13 = and i32 %12, 255
%14 = trunc i32 %13 to i8
%15 = load i8*, i8** %3
%16 = getelementptr inbounds i8, i8* %15, i64 1
store i8 %14, i8* %16
%17 = load i32, i32* %4
%18 = lshr i32 %17, 16
%19 = and i32 %18, 255
%20 = trunc i32 %19 to i8
%21 = load i8*, i8** %3
%22 = getelementptr inbounds i8, i8* %21, i64 2
store i8 %20, i8* %22
ret void
}

LLVM IR (-O2):
define void @extract_write_word(i8* nocapture writeonly %0, i32 %1) {
%3 = trunc i32 %1 to i8
store i8 %3, i8* %0
%4 = lshr i32 %1, 8
%5 = trunc i32 %4 to i8
%6 = getelementptr inbounds i8, i8* %0, i64 1
store i8 %5, i8* %6
%7 = lshr i32 %1, 16
%8 = trunc i32 %7 to i8
%9 = getelementptr inbounds i8, i8* %0, i64 2
store i8 %8, i8* %9
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ uint32_t;

/* Variables and functions */
int /*<<< orphan*/ pigpio_command(int, int, int /*<<< orphan*/,
                                  int /*<<< orphan*/, int);
uint32_t get_hardware_revision(int pi) {
  return pigpio_command(pi, 17, 0, 0, 1);
}


x86 assembly (clang, -O0):
<get_hardware_revision>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
mov    $0x11,%esi
xor    %ecx,%ecx
mov    $0x1,%r8d
mov    %ecx,%edx
call   1030 <pigpio_command@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_hardware_revision>:
mov    $0x11,%esi
xor    %edx,%edx
xor    %ecx,%ecx
mov    $0x1,%r8d
jmp    1030 <pigpio_command@plt>

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

LLVM IR (-O2):
define i32 @get_hardware_revision(i32 %0) {
%2 = tail call i32 @pigpio_command(i32 %0, i32 17, i32 0, i32 0, i32 1)
ret i32 %2
}
/* Variables and functions */
size_t libretro_dummy_retro_get_memory_size(unsigned id) {
  (void)id;
  return 0;
}


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

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

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

LLVM IR (-O2):
define i64 @libretro_dummy_retro_get_memory_size(i32 %0) {
ret i64 0
}
/* Forward declarations */
typedef struct TYPE_4__ TYPE_2__;
typedef struct TYPE_3__ TYPE_1__;

/* Type definitions */
struct TYPE_3__ {
  scalar_t__ type;
};
struct TYPE_4__ {
  TYPE_1__ xselection;
};
typedef TYPE_2__ XEvent;

/* Variables and functions */
int get_XEvent_xselection_type(void *_p) {
  return (int)((XEvent *)_p)->xselection.type;
}


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

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

LLVM IR (-O0):
%struct.TYPE_4__ = type { %struct.TYPE_3__ }
%struct.TYPE_3__ = type { i64 }
define i32 @get_XEvent_xselection_type(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = bitcast i8* %3 to %struct.TYPE_4__*
%5 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %4, i32 0, i32 0
%6 = getelementptr inbounds %struct.TYPE_3__, %struct.TYPE_3__* %5, i32 0, i32 0
%7 = load i64, i64* %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @get_XEvent_xselection_type(i8* nocapture %0) {
%2 = bitcast i8* %0 to i64*
%3 = load i64, i64* %2
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ stdout;
int header_end(void) {
  putchar('\n');
  fflush(stdout);
  return 0;
}


x86 assembly (clang, -O0):
<header_end>:
push   %rbp
mov    %rsp,%rbp
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2eab(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<header_end>:
push   %rax
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    0x2eae(%rip),%rax
mov    (%rax),%edi
call   1040 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stdout = global i32 0
define i32 @header_end() {
%1 = call i32 @putchar(i8 signext 10)
%2 = load i32, i32* @stdout
%3 = call i32 @fflush(i32 %2)
ret i32 0
}

LLVM IR (-O2):
@stdout = global i32 0
define i32 @header_end() {
%1 = tail call i32 @putchar(i8 signext 10)
%2 = load i32, i32* @stdout
%3 = tail call i32 @fflush(i32 %2)
ret i32 0
}
void htexts_(width, height) float *width, *height;
{ htextsize(*width, *height); }


x86 assembly (clang, -O0):
<htexts_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movss  (%rax),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x10(%rbp),%rax
movss  (%rax),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1030 <htextsize@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<htexts_>:
movss  (%rdi),%xmm0
cvtss2sd %xmm0,%xmm0
movss  (%rsi),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
jmp    1030 <htextsize@plt>

LLVM IR (-O0):
define void @htexts_(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
store float* %0, float** %3
store float* %1, float** %4
%5 = load float*, float** %3
%6 = load float, float* %5
%7 = fpext float %6 to double
%8 = load float*, float** %4
%9 = load float, float* %8
%10 = fpext float %9 to double
%11 = call i32 (double, double, ...) bitcast (i32 (...)* @htextsize to i32 (double, double, ...)*)(double %7, double %10)
ret void
}

LLVM IR (-O2):
define void @htexts_(float* nocapture %0, float* nocapture %1) {
%3 = load float, float* %0
%4 = fpext float %3 to double
%5 = load float, float* %1
%6 = fpext float %5 to double
%7 = tail call i32 (double, double, ...) bitcast (i32 (...)* @htextsize to i32 (double, double, ...)*)(double %4, double %6)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ EnterHook();
int /*<<< orphan*/ StopShowBuf();
void BufEnterHook() {
  StopShowBuf();
  EnterHook();
}


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

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

LLVM IR (-O0):
define void @BufEnterHook() {
%1 = call i32 (...) @StopShowBuf()
%2 = call i32 (...) @EnterHook()
ret void
}

LLVM IR (-O2):
define void @BufEnterHook() {
%1 = tail call i32 (...) @StopShowBuf()
%2 = tail call i32 (...) @EnterHook()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ test(int);
int main() {
  test(5);
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @test(i32 5)
ret i32 0
}
/* Variables and functions */
void *sat_realloc2(void *, size_t, size_t);
void *sat_extend_resize(void *buf, size_t len, size_t size, size_t block) {
  if (len)
    buf = sat_realloc2(buf, (len + block) & ~block, size);
  return buf;
}


x86 assembly (clang, -O0):
<sat_extend_resize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpq   $0x0,-0x10(%rbp)
je     1157 <sat_extend_resize+0x47>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
add    -0x20(%rbp),%rsi
mov    -0x20(%rbp),%rax
xor    $0xffffffffffffffff,%rax
and    %rax,%rsi
mov    -0x18(%rbp),%rdx
call   1030 <sat_realloc2@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sat_extend_resize>:
test   %rsi,%rsi
je     1126 <sat_extend_resize+0x16>
add    %rcx,%rsi
not    %rcx
and    %rsi,%rcx
mov    %rcx,%rsi
jmp    1030 <sat_realloc2@plt>
mov    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @sat_extend_resize(i8* %0, i64 %1, i64 %2, i64 %3) {
%5 = icmp eq i64 %1, 0
br i1 %5, label %11, label %6
6: ; preds = %4
%7 = add i64 %3, %1
%8 = xor i64 %3, -1
%9 = and i64 %7, %8
%10 = tail call i8* @sat_realloc2(i8* %0, i64 %9, i64 %2)
br label %11
11: ; preds = %6, %4
%12 = phi i8* [ %10, %6 ], [ %0, %4 ]
ret i8* %12
}
void mdrv_dload_set_softload(int bSoftLoad) { return; }


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

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

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

LLVM IR (-O2):
define void @mdrv_dload_set_softload(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ bomb(char *);
extern int do_spawn() { bomb("do_spawn"); }


x86 assembly (clang, -O0):
<do_spawn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xee1(%rip),%rdi
call   1030 <bomb@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_spawn>:
lea    0xee9(%rip),%rdi
jmp    1030 <bomb@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"do_spawn\00"
define i32 @do_spawn() {
%1 = alloca i32
%2 = call i32 @bomb(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* %1
ret i32 %3
}

LLVM IR (-O2):
@.str = [9 x i8] c"do_spawn\00"
define i32 @do_spawn() {
%1 = tail call i32 @bomb(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
ret i32 undef
}
__attribute__((always_)) void zone_span_writelock(struct zone *zone) {}


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

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

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

LLVM IR (-O2):
%struct.zone = type opaque
define void @zone_span_writelock(%struct.zone* nocapture %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main() {
  char t[4];
  t[0] = 0;
  t[1] = 1;
  t[2] = 0;
  t[3] = 0;
  char *z1 = t;
  void *z2 = z1;
  unsigned int *pi = z2;
  if (*pi != 256) {
    printf("UNSAFE\n");
    goto ERROR;
  }
  printf("SAFE\n");
  return (0);
ERROR:
  return (-1);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movb   $0x0,-0x8(%rbp)
movb   $0x1,-0x7(%rbp)
movb   $0x0,-0x6(%rbp)
movb   $0x0,-0x5(%rbp)
lea    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmpl   $0x100,(%rax)
je     1168 <main+0x58>
lea    0xea2(%rip),%rdi
call   1030 <printf@plt>
jmp    1180 <main+0x70>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1187 <main+0x77>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

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

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

LLVM IR (-O2):
@str = [5 x i8] c"SAFE\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void foo(int i, ...) {
  __builtin_va_list ap;
  __builtin_va_start(ap, i);
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
test   %al,%al
je     1136 <foo+0x36>
movaps %xmm0,-0xa0(%rbp)
movaps %xmm1,-0x90(%rbp)
movaps %xmm2,-0x80(%rbp)
movaps %xmm3,-0x70(%rbp)
movaps %xmm4,-0x60(%rbp)
movaps %xmm5,-0x50(%rbp)
movaps %xmm6,-0x40(%rbp)
movaps %xmm7,-0x30(%rbp)
mov    %r9,-0xa8(%rbp)
mov    %r8,-0xb0(%rbp)
mov    %rcx,-0xb8(%rbp)
mov    %rdx,-0xc0(%rbp)
mov    %rsi,-0xc8(%rbp)
mov    %edi,-0x4(%rbp)
lea    -0xd0(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movl   $0x30,-0x1c(%rbp)
movl   $0x8,-0x20(%rbp)
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
sub    $0x48,%rsp
mov    %rsi,-0x78(%rsp)
mov    %rdx,-0x70(%rsp)
mov    %rcx,-0x68(%rsp)
mov    %r8,-0x60(%rsp)
mov    %r9,-0x58(%rsp)
test   %al,%al
je     1148 <foo+0x48>
movaps %xmm0,-0x50(%rsp)
movaps %xmm1,-0x40(%rsp)
movaps %xmm2,-0x30(%rsp)
movaps %xmm3,-0x20(%rsp)
movaps %xmm4,-0x10(%rsp)
movaps %xmm5,(%rsp)
movaps %xmm6,0x10(%rsp)
movaps %xmm7,0x20(%rsp)
add    $0x48,%rsp
ret

LLVM IR (-O0):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @foo(i32 %0, ...) {
%2 = alloca i32
%3 = alloca [1 x %struct.__va_list_tag]
store i32 %0, i32* %2
%4 = getelementptr inbounds [1 x %struct.__va_list_tag], [1 x %struct.__va_list_tag]* %3, i64 0, i64 0
%5 = bitcast %struct.__va_list_tag* %4 to i8*
ret void
}

LLVM IR (-O2):
%struct.__va_list_tag = type { i32, i32, i8*, i8* }
define void @foo(i32 %0, ...) {
%2 = alloca [1 x %struct.__va_list_tag]
%3 = bitcast [1 x %struct.__va_list_tag]* %2 to i8*
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __set_file_attribute(int *);
int *malloc(int);
int socket(int namespace, int style, int protocol) {
  int *ret = malloc(sizeof(int));
  if (ret) {
    __set_file_attribute(ret);
    if (ret < (int *)1)
      while (1)
        ;
    return (long)(ret - 1);
  }
  return -1;
}


x86 assembly (clang, -O0):
<socket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x4,%edi
call   1030 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
je     117c <socket+0x5c>
mov    -0x18(%rbp),%rdi
call   1040 <__set_file_attribute@plt>
mov    $0x1,%eax
cmp    %rax,-0x18(%rbp)
jae    116c <socket+0x4c>
jmp    1167 <socket+0x47>
jmp    1167 <socket+0x47>
mov    -0x18(%rbp),%rax
add    $0xfffffffffffffffc,%rax
mov    %eax,-0x4(%rbp)
jmp    1183 <socket+0x63>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<socket>:
push   %rbx
mov    $0x4,%edi
call   1030 <malloc@plt>
test   %rax,%rax
je     1142 <socket+0x22>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <__set_file_attribute@plt>
test   %rbx,%rbx
jne    1149 <socket+0x29>
jmp    1140 <socket+0x20>
mov    $0xffffffff,%eax
pop    %rbx
ret
lea    -0x4(%rbx),%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = alloca i32
%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
%9 = call i32* @malloc(i32 4)
store i32* %9, i32** %8
%10 = load i32*, i32** %8
%11 = icmp ne i32* %10, null
br i1 %11, label %12, label %24
12: ; preds = %3
%13 = load i32*, i32** %8
%14 = call i32 @__set_file_attribute(i32* %13)
%15 = load i32*, i32** %8
%16 = icmp ult i32* %15, inttoptr (i64 1 to i32*)
br i1 %16, label %17, label %19
17: ; preds = %12
br label %18
18: ; preds = %17, %18
br label %18
19: ; preds = %12
%20 = load i32*, i32** %8
%21 = getelementptr inbounds i32, i32* %20, i64 -1
%22 = ptrtoint i32* %21 to i64
%23 = trunc i64 %22 to i32
store i32 %23, i32* %4
br label %25
24: ; preds = %3
store i32 -1, i32* %4
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @socket(i32 %0, i32 %1, i32 %2) {
%4 = tail call i32* @malloc(i32 4)
%5 = icmp eq i32* %4, null
br i1 %5, label %14, label %6
6: ; preds = %3
%7 = tail call i32 @__set_file_attribute(i32* %4)
%8 = icmp ult i32* %4, inttoptr (i64 1 to i32*)
br i1 %8, label %9, label %10
9: ; preds = %6, %9
br label %9
10: ; preds = %6
%11 = getelementptr inbounds i32, i32* %4, i64 -1
%12 = ptrtoint i32* %11 to i64
%13 = trunc i64 %12 to i32
br label %14
14: ; preds = %3, %10
%15 = phi i32 [ %13, %10 ], [ -1, %3 ]
ret i32 %15
}
void ctl_file_name(char *name) {}


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

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

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

LLVM IR (-O2):
define void @ctl_file_name(i8* nocapture %0) {
ret void
}
/* Type definitions */
struct phyloTree {
  int dummy;
};

/* Variables and functions */
struct phyloTree *newEdge(struct phyloTree *, struct phyloTree *);
struct phyloTree *phyloAddEdge(struct phyloTree *parent,
                               struct phyloTree *child) {
  return newEdge(parent, child);
}


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

x86 assembly (clang, -O2):
<phyloAddEdge>:
jmp    1030 <newEdge@plt>

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

LLVM IR (-O2):
%struct.phyloTree = type { i32 }
define %struct.phyloTree* @phyloAddEdge(%struct.phyloTree* %0, %struct.phyloTree* %1) {
%3 = tail call %struct.phyloTree* @newEdge(%struct.phyloTree* %0, %struct.phyloTree* %1)
ret %struct.phyloTree* %3
}