xunge/DecIR huggingface dataset:
int isign(int a) { return a < 0 ? -1 : !!a; }


x86 assembly (clang, -O0):
<isign>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    111e <isign+0x1e>
mov    $0xffffffff,%eax
mov    %eax,-0x8(%rbp)
jmp    1131 <isign+0x31>
cmpl   $0x0,-0x4(%rbp)
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isign>:
xor    %ecx,%ecx
test   %edi,%edi
setne  %cl
mov    $0xffffffff,%eax
cmovns %ecx,%eax
ret

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

LLVM IR (-O2):
define i32 @isign(i32 %0) {
%2 = icmp ne i32 %0, 0
%3 = zext i1 %2 to i32
%4 = icmp sgt i32 %0, -1
%5 = select i1 %4, i32 %3, i32 -1
ret i32 %5
}
/* Type definitions */
typedef scalar_t__ clock_t;

/* Variables and functions */
double CLOCKS_PER_SEC;
scalar_t__ clock();
int /*<<< orphan*/ printf(char *, char const *, double);
void stop_watch(clock_t watch, const char *name) {
  printf("\n%s took %f seconds.\n", name,
         (double)(clock() - watch) / CLOCKS_PER_SEC);
}


x86 assembly (clang, -O0):
<stop_watch>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <clock@plt>
mov    -0x18(%rbp),%rsi
sub    -0x8(%rbp),%rax
cvtsi2sd %rax,%xmm0
mov    0x2e95(%rip),%rax
divsd  (%rax),%xmm0
lea    0xea2(%rip),%rdi
call   1040 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stop_watch>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
xor    %eax,%eax
call   1030 <clock@plt>
sub    %rbx,%rax
cvtsi2sd %rax,%xmm0
mov    0x2ea8(%rip),%rax
divsd  (%rax),%xmm0
lea    0xeb5(%rip),%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <printf@plt>

LLVM IR (-O0):
@.str = [22 x i8] c"\0A%s took %f seconds.\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @stop_watch(i64 %0, i8* %1) {
%3 = alloca i64
%4 = alloca i8*
store i64 %0, i64* %3
store i8* %1, i8** %4
%5 = load i8*, i8** %4
%6 = call i64 (...) @clock()
%7 = load i64, i64* %3
%8 = sub nsw i64 %6, %7
%9 = sitofp i64 %8 to double
%10 = load double, double* @CLOCKS_PER_SEC
%11 = fdiv double %9, %10
%12 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %5, double %11)
ret void
}

LLVM IR (-O2):
@.str = [22 x i8] c"\0A%s took %f seconds.\0A\00"
@CLOCKS_PER_SEC = global double 0.000000e+00
define void @stop_watch(i64 %0, i8* %1) {
%3 = tail call i64 (...) @clock()
%4 = sub nsw i64 %3, %0
%5 = sitofp i64 %4 to double
%6 = load double, double* @CLOCKS_PER_SEC
%7 = fdiv double %5, %6
%8 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), i8* %1, double %7)
ret void
}
void strrep(char *s, char f, char t) {
  int i;
  for (i = 0; s[i] != '\0'; i++) {
    if (s[i] == f) {
      s[i] = t;
    }
  }
}


x86 assembly (clang, -O0):
<strrep>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1168 <strrep+0x68>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
movsbl -0x9(%rbp),%ecx
cmp    %ecx,%eax
jne    1155 <strrep+0x55>
mov    -0xa(%rbp),%dl
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
jmp    115a <strrep+0x5a>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    111a <strrep+0x1a>
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrep>:
mov    (%rdi),%al
test   %al,%al
je     1125 <strrep+0x25>
add    $0x1,%rdi
jmp    111b <strrep+0x1b>
nopl   0x0(%rax)
movzbl (%rdi),%eax
add    $0x1,%rdi
test   %al,%al
je     1125 <strrep+0x25>
cmp    %sil,%al
jne    1110 <strrep+0x10>
mov    %dl,-0x1(%rdi)
jmp    1110 <strrep+0x10>
ret

LLVM IR (-O0):
define void @strrep(i8* %0, i8 signext %1, i8 signext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i32
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
store i32 0, i32* %7
br label %8
8: ; preds = %33, %3
%9 = load i8*, i8** %4
%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 = sext i8 %13 to i32
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %36
16: ; preds = %8
%17 = load i8*, i8** %4
%18 = load i32, i32* %7
%19 = sext i32 %18 to i64
%20 = getelementptr inbounds i8, i8* %17, i64 %19
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = load i8, i8* %5
%24 = sext i8 %23 to i32
%25 = icmp eq i32 %22, %24
br i1 %25, label %26, label %32
26: ; preds = %16
%27 = load i8, i8* %6
%28 = load i8*, i8** %4
%29 = load i32, i32* %7
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8, i8* %28, i64 %30
store i8 %27, i8* %31
br label %32
32: ; preds = %26, %16
br label %33
33: ; preds = %32
%34 = load i32, i32* %7
%35 = add nsw i32 %34, 1
store i32 %35, i32* %7
br label %8
36: ; preds = %8
ret void
}

LLVM IR (-O2):
define void @strrep(i8* nocapture %0, i8 signext %1, i8 signext %2) {
%4 = load i8, i8* %0
%5 = icmp eq i8 %4, 0
br i1 %5, label %17, label %6
6: ; preds = %3, %12
%7 = phi i64 [ %13, %12 ], [ 0, %3 ]
%8 = phi i8 [ %15, %12 ], [ %4, %3 ]
%9 = phi i8* [ %14, %12 ], [ %0, %3 ]
%10 = icmp eq i8 %8, %1
br i1 %10, label %11, label %12
11: ; preds = %6
store i8 %2, i8* %9
br label %12
12: ; preds = %6, %11
%13 = add nuw i64 %7, 1
%14 = getelementptr inbounds i8, i8* %0, i64 %13
%15 = load i8, i8* %14
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %6
17: ; preds = %12, %3
ret void
}
/* Variables and functions */
double strtod(char *, char **);
double __attribute__((weak)) fio_atof(char **pstr) {
  return strtod((char *)*pstr, (char **)pstr);
}


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

x86 assembly (clang, -O2):
<fio_atof>:
mov    %rdi,%rsi
mov    (%rdi),%rdi
jmp    1030 <strtod@plt>

LLVM IR (-O0):
define weak double @fio_atof(i8** %0) {
%2 = alloca i8**
store i8** %0, i8*** %2
%3 = load i8**, i8*** %2
%4 = load i8*, i8** %3
%5 = load i8**, i8*** %2
%6 = call double @strtod(i8* %4, i8** %5)
ret double %6
}

LLVM IR (-O2):
define weak double @fio_atof(i8** %0) {
%2 = load i8*, i8** %0
%3 = tail call double @strtod(i8* %2, i8** %0)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
void jsoo_extract_bool() { exit(1); }


x86 assembly (clang, -O0):
<jsoo_extract_bool>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
call   1030 <exit@plt>

x86 assembly (clang, -O2):
<jsoo_extract_bool>:
push   %rax
mov    $0x1,%edi
call   1030 <exit@plt>

LLVM IR (-O0):
define void @jsoo_extract_bool() {
%1 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
define void @jsoo_extract_bool() {
%1 = tail call i32 @exit(i32 1)
unreachable
}
void gtk_alignment_get_padding() {}


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

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

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

LLVM IR (-O2):
define void @gtk_alignment_get_padding() {
ret void
}
/* Variables and functions */
int numcmp(char *, char *);
int numcmp_reverse(char *s1, char *s2) { return (-1) * numcmp(s1, s2); }


x86 assembly (clang, -O0):
<numcmp_reverse>:
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 <numcmp@plt>
imul   $0xffffffff,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<numcmp_reverse>:
push   %rax
call   1030 <numcmp@plt>
neg    %eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @numcmp_reverse(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
store i8* %1, i8** %4
%5 = load i8*, i8** %3
%6 = load i8*, i8** %4
%7 = call i32 @numcmp(i8* %5, i8* %6)
%8 = mul nsw i32 -1, %7
ret i32 %8
}

LLVM IR (-O2):
define i32 @numcmp_reverse(i8* %0, i8* %1) {
%3 = tail call i32 @numcmp(i8* %0, i8* %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
int HashString(char *s) {
  int v = 0;
  while (*s) {
    v += *s;
    s++;
  }
  return v;
}


x86 assembly (clang, -O0):
<HashString>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     113a <HashString+0x3a>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
add    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110f <HashString+0xf>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<HashString>:
mov    (%rdi),%cl
test   %cl,%cl
je     1121 <HashString+0x21>
add    $0x1,%rdi
xor    %eax,%eax
nopl   0x0(%rax)
movsbl %cl,%ecx
add    %ecx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <HashString+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i32 @HashString(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %13, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %11, %4 ], [ %2, %1 ]
%6 = phi i32 [ %9, %4 ], [ 0, %1 ]
%7 = phi i8* [ %10, %4 ], [ %0, %1 ]
%8 = sext i8 %5 to i32
%9 = add nsw i32 %6, %8
%10 = getelementptr inbounds i8, i8* %7, i64 1
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, 0
br i1 %12, label %13, label %4
13: ; preds = %4, %1
%14 = phi i32 [ 0, %1 ], [ %9, %4 ]
ret i32 %14
}
/* Variables and functions */
int /*<<< orphan*/ cs2(double);
double pow(int /*<<< orphan*/, double);
double cs(double x) { return pow(cs2(x), .5); }


x86 assembly (clang, -O0):
<cs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
call   1030 <cs2@plt>
mov    %eax,%edi
movsd  0xebf(%rip),%xmm0
call   1040 <pow@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<cs>:
push   %rax
call   1030 <cs2@plt>
movsd  0xed2(%rip),%xmm0
mov    %eax,%edi
pop    %rax
jmp    1040 <pow@plt>

LLVM IR (-O0):
define double @cs(double %0) {
%2 = alloca double
store double %0, double* %2
%3 = load double, double* %2
%4 = call i32 @cs2(double %3)
%5 = call double @pow(i32 %4, double 5.000000e-01)
ret double %5
}

LLVM IR (-O2):
define double @cs(double %0) {
%2 = tail call i32 @cs2(double %0)
%3 = tail call double @pow(i32 %2, double 5.000000e-01)
ret double %3
}
int main() {
  int i;
  i = 2;
  i++;
  return 1 + 2;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0x2,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    $0x3,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 2, i32* %2
%3 = load i32, i32* %2
%4 = add nsw i32 %3, 1
store i32 %4, i32* %2
ret i32 3
}

LLVM IR (-O2):
define i32 @main() {
ret i32 3
}
/* Variables and functions */
double tan(double);
double d_tan(double *x) { return (tan(*x)); }


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

x86 assembly (clang, -O2):
<d_tan>:
movsd  (%rdi),%xmm0
jmp    1030 <tan@plt>

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

LLVM IR (-O2):
define double @d_tan(double* nocapture %0) {
%2 = load double, double* %0
%3 = tail call double @tan(double %2)
ret double %3
}
/* Variables and functions */
int EXP(int, int);
int getBit(int x, int i) {
  int banger = EXP(2, i);
  if (x & banger)
    return 1;
  else
    return 0;
}


x86 assembly (clang, -O0):
<getBit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x2,%edi
call   1030 <EXP@plt>
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
and    -0x10(%rbp),%eax
cmp    $0x0,%eax
je     1149 <getBit+0x39>
movl   $0x1,-0x4(%rbp)
jmp    1150 <getBit+0x40>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getBit>:
push   %rbx
mov    %edi,%ebx
mov    $0x2,%edi
call   1030 <EXP@plt>
xor    %ecx,%ecx
test   %ebx,%eax
setne  %cl
mov    %ecx,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @getBit(i32 %0, i32 %1) {
%3 = tail call i32 @EXP(i32 2, i32 %1)
%4 = and i32 %3, %0
%5 = icmp ne i32 %4, 0
%6 = zext i1 %5 to i32
ret i32 %6
}
void MasterServer_Debug_OnChange(void) {}


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

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

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

LLVM IR (-O2):
define void @MasterServer_Debug_OnChange() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ fflush(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, void *, void *);
int expect_vap(void *expected, void *ret) {
  printf("\tVAP Expected 0x%x, Got 0x%x\n", expected, ret);
  fflush(NULL);
  if (ret == expected) {
    return 0;
  }
  return -1;
}


x86 assembly (clang, -O0):
<expect_vap>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1040 <fflush@plt>
mov    -0x18(%rbp),%rax
cmp    -0x10(%rbp),%rax
jne    1167 <expect_vap+0x47>
movl   $0x0,-0x4(%rbp)
jmp    116e <expect_vap+0x4e>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect_vap>:
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
lea    0xecf(%rip),%rdi
mov    %rbx,%rsi
mov    %r14,%rdx
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <fflush@plt>
xor    %eax,%eax
cmp    %rbx,%r14
setne  %al
neg    %eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [30 x i8] c"\09VAP Expected 0x%x, Got 0x%x\0A\00"
define i32 @expect_vap(i8* %0, i8* %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8*
store i8* %0, i8** %4
store i8* %1, i8** %5
%6 = load i8*, i8** %4
%7 = load i8*, i8** %5
%8 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %6, i8* %7)
%9 = call i32 @fflush(i32* null)
%10 = load i8*, i8** %5
%11 = load i8*, i8** %4
%12 = icmp eq i8* %10, %11
br i1 %12, label %13, label %14
13: ; preds = %2
store i32 0, i32* %3
br label %15
14: ; preds = %2
store i32 -1, i32* %3
br label %15
15: ; preds = %14, %13
%16 = load i32, i32* %3
ret i32 %16
}

LLVM IR (-O2):
@.str = [30 x i8] c"\09VAP Expected 0x%x, Got 0x%x\0A\00"
define i32 @expect_vap(i8* %0, i8* %1) {
%3 = tail call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), i8* %0, i8* %1)
%4 = tail call i32 @fflush(i32* null)
%5 = icmp ne i8* %1, %0
%6 = sext i1 %5 to i32
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ return_to_prog();
void returnFromException() { return_to_prog(); }


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

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

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

LLVM IR (-O2):
define void @returnFromException() {
%1 = tail call i32 (...) @return_to_prog()
ret void
}
/* Variables and functions */
int /*<<< orphan*/ cont_init();
int /*<<< orphan*/ do_fact();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int main(int argc, char *argv[]) {
  cont_init();
  do_fact();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    $0x0,%al
call   1040 <cont_init@plt>
mov    $0x0,%al
call   1030 <do_fact@plt>
xor    %edi,%edi
call   1050 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <cont_init@plt>
xor    %eax,%eax
call   1030 <do_fact@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%6 = call i32 (...) @cont_init()
%7 = call i32 (...) @do_fact()
%8 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 (...) @cont_init()
%4 = tail call i32 (...) @do_fact()
%5 = tail call i32 @exit(i32 0)
unreachable
}
char *print_tag(char *name_ptr, char *end, const char *tag) {
  while (name_ptr < end && *tag)
    *name_ptr++ = *tag++;
  return name_ptr;
}


x86 assembly (clang, -O0):
<print_tag>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    -0x8(%rbp),%rcx
xor    %eax,%eax
cmp    -0x10(%rbp),%rcx
mov    %al,-0x19(%rbp)
jae    1133 <print_tag+0x33>
mov    -0x18(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
test   $0x1,%al
jne    1143 <print_tag+0x43>
jmp    116a <print_tag+0x6a>
mov    -0x18(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x18(%rbp)
mov    (%rax),%cl
mov    -0x8(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %cl,(%rax)
jmp    1110 <print_tag+0x10>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_tag>:
mov    %rdi,%rax
cmp    %rsi,%rdi
jae    112b <print_tag+0x2b>
mov    %rsi,%r8
sub    %rax,%r8
xor    %edi,%edi
movzbl (%rdx,%rdi,1),%ecx
test   %cl,%cl
je     1128 <print_tag+0x28>
mov    %cl,(%rax,%rdi,1)
add    $0x1,%rdi
cmp    %rdi,%r8
jne    1110 <print_tag+0x10>
mov    %rsi,%rax
ret
add    %rdi,%rax
ret

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

LLVM IR (-O2):
define i8* @print_tag(i8* writeonly %0, i8* readnone %1, i8* nocapture %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %19
5: ; preds = %3
%6 = ptrtoint i8* %1 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = getelementptr i8, i8* %0, i64 %8
br label %10
10: ; preds = %5, %15
%11 = phi i8* [ %16, %15 ], [ %2, %5 ]
%12 = phi i8* [ %17, %15 ], [ %0, %5 ]
%13 = load i8, i8* %11
%14 = icmp eq i8 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %10
%16 = getelementptr inbounds i8, i8* %11, i64 1
%17 = getelementptr inbounds i8, i8* %12, i64 1
store i8 %13, i8* %12
%18 = icmp eq i8* %17, %9
br i1 %18, label %19, label %10
19: ; preds = %10, %15, %3
%20 = phi i8* [ %0, %3 ], [ %9, %15 ], [ %12, %10 ]
ret i8* %20
}
void old_style_handler_new(int signo) {}


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

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

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

LLVM IR (-O2):
define void @old_style_handler_new(i32 %0) {
ret void
}
char *getPageTable(char *segmentOff) {
  static char pageTO[5] = {'\0'};
  int i;
  for (i = 0; i < 4; ++i) {
    pageTO[i] = segmentOff[i];
  }
  return pageTO;
}


x86 assembly (clang, -O0):
<getPageTable>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x4,-0xc(%rbp)
jge    1140 <getPageTable+0x40>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
movslq -0xc(%rbp),%rcx
lea    0x2ef2(%rip),%rax
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <getPageTable+0xf>
lea    0x2eda(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<getPageTable>:
mov    (%rdi),%al
mov    %al,0x2f19(%rip)
lea    0x2f12(%rip),%rax
mov    0x1(%rdi),%cl
mov    %cl,0x2f0a(%rip)
mov    0x2(%rdi),%cl
mov    %cl,0x2f02(%rip)
mov    0x3(%rdi),%cl
mov    %cl,0x2efa(%rip)
ret

LLVM IR (-O0):
@getPageTable.pageTO = internal global [5 x i8] zeroinitializer
define i8* @getPageTable(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 0, i32* %3
br label %4
4: ; preds = %16, %1
%5 = load i32, i32* %3
%6 = icmp slt i32 %5, 4
br i1 %6, label %7, label %19
7: ; preds = %4
%8 = load i8*, i8** %2
%9 = load i32, i32* %3
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8, i8* %8, i64 %10
%12 = load i8, i8* %11
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [5 x i8], [5 x i8]* @getPageTable.pageTO, i64 0, i64 %14
store i8 %12, i8* %15
br label %16
16: ; preds = %7
%17 = load i32, i32* %3
%18 = add nsw i32 %17, 1
store i32 %18, i32* %3
br label %4
19: ; preds = %4
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getPageTable.pageTO, i64 0, i64 0)
}

LLVM IR (-O2):
@getPageTable.pageTO = internal global [5 x i8] zeroinitializer
define i8* @getPageTable(i8* nocapture %0) {
%2 = load i8, i8* %0
store i8 %2, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getPageTable.pageTO, i64 0, i64 0)
%3 = getelementptr inbounds i8, i8* %0, i64 1
%4 = load i8, i8* %3
store i8 %4, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getPageTable.pageTO, i64 0, i64 1)
%5 = getelementptr inbounds i8, i8* %0, i64 2
%6 = load i8, i8* %5
store i8 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getPageTable.pageTO, i64 0, i64 2)
%7 = getelementptr inbounds i8, i8* %0, i64 3
%8 = load i8, i8* %7
store i8 %8, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getPageTable.pageTO, i64 0, i64 3)
ret i8* getelementptr inbounds ([5 x i8], [5 x i8]* @getPageTable.pageTO, i64 0, i64 0)
}
/* Variables and functions */
int /*<<< orphan*/ free(void *);
void runtime_free(void *that, void *a) { free(a); }


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

x86 assembly (clang, -O2):
<runtime_free>:
mov    %rsi,%rdi
jmp    1030 <free@plt>

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

LLVM IR (-O2):
define void @runtime_free(i8* nocapture readnone %0, i8* nocapture %1) {
%3 = tail call i32 @free(i8* %1)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ arm_arith_sub(int /*<<< orphan*/);
int /*<<< orphan*/ arm_data_imm_op();
void arm_sub_imm() { arm_arith_sub(arm_data_imm_op()); }


x86 assembly (clang, -O0):
<arm_sub_imm>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <arm_data_imm_op@plt>
mov    %eax,%edi
call   1030 <arm_arith_sub@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<arm_sub_imm>:
push   %rax
xor    %eax,%eax
call   1040 <arm_data_imm_op@plt>
mov    %eax,%edi
pop    %rax
jmp    1030 <arm_arith_sub@plt>

LLVM IR (-O0):
define void @arm_sub_imm() {
%1 = call i32 (...) @arm_data_imm_op()
%2 = call i32 @arm_arith_sub(i32 %1)
ret void
}

LLVM IR (-O2):
define void @arm_sub_imm() {
%1 = tail call i32 (...) @arm_data_imm_op()
%2 = tail call i32 @arm_arith_sub(i32 %1)
ret void
}
void gtk_box_query_child_packing() {}


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

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

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

LLVM IR (-O2):
define void @gtk_box_query_child_packing() {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ U_WMRNOTIMPLEMENTED_swap(char *, int);
void U_WMRDC_swap(char *record, int torev) {
  U_WMRNOTIMPLEMENTED_swap(record, torev);
}


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

x86 assembly (clang, -O2):
<U_WMRDC_swap>:
jmp    1030 <U_WMRNOTIMPLEMENTED_swap@plt>

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

LLVM IR (-O2):
define void @U_WMRDC_swap(i8* %0, i32 %1) {
%3 = tail call i32 @U_WMRNOTIMPLEMENTED_swap(i8* %0, i32 %1)
ret void
}
int test_imm_34int32_mem(int *val) {
  return ((*val) & (0x34 << 0)) ? -20 : -40;
}


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

x86 assembly (clang, -O2):
<test_imm_34int32_mem>:
testb  $0x34,(%rdi)
mov    $0xffffffd8,%ecx
mov    $0xffffffec,%eax
cmove  %ecx,%eax
ret

LLVM IR (-O0):
define i32 @test_imm_34int32_mem(i32* %0) {
%2 = alloca i32*
store i32* %0, i32** %2
%3 = load i32*, i32** %2
%4 = load i32, i32* %3
%5 = and i32 %4, 52
%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_34int32_mem(i32* nocapture %0) {
%2 = load i32, i32* %0
%3 = and i32 %2, 52
%4 = icmp eq i32 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
/* Variables and functions */
int /*<<< orphan*/ getFistIndexFrom(char *, char *, int /*<<< orphan*/);
int getFistIndex(char *str1, char *str2) { getFistIndexFrom(str1, str2, 0); }


x86 assembly (clang, -O0):
<getFistIndex>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
xor    %edx,%edx
call   1030 <getFistIndexFrom@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getFistIndex>:
xor    %edx,%edx
jmp    1030 <getFistIndexFrom@plt>

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

LLVM IR (-O2):
define i32 @getFistIndex(i8* %0, i8* %1) {
%3 = tail call i32 @getFistIndexFrom(i8* %0, i8* %1, i32 0)
ret i32 undef
}
void XtCreateManagedWidget() {}


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

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

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

LLVM IR (-O2):
define void @XtCreateManagedWidget() {
ret void
}
/* Variables and functions */
int test_glob();
int test_splice();
int main(void) {
  int r = 0;
  r |= test_splice();
  r |= test_glob();
  return r;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1030 <test_splice@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    $0x0,%al
call   1040 <test_glob@plt>
or     -0x8(%rbp),%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
xor    %eax,%eax
call   1030 <test_splice@plt>
mov    %eax,%ebx
xor    %eax,%eax
call   1040 <test_glob@plt>
or     %ebx,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
%3 = call i32 (...) @test_splice()
%4 = load i32, i32* %2
%5 = or i32 %4, %3
store i32 %5, i32* %2
%6 = call i32 (...) @test_glob()
%7 = load i32, i32* %2
%8 = or i32 %7, %6
store i32 %8, i32* %2
%9 = load i32, i32* %2
ret i32 %9
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_splice()
%2 = tail call i32 (...) @test_glob()
%3 = or i32 %2, %1
ret i32 %3
}
/* Type definitions */
struct ptrlist_struct {
  int dummy;
};
struct elasticarray {
  int dummy;
};

/* Variables and functions */
void *elasticarray_get(struct elasticarray *, size_t, int);
void **ptrlist_get(struct ptrlist_struct *EA, size_t pos) {
  void *rec;
  rec = elasticarray_get((struct elasticarray *)EA, pos, sizeof(void *));
  return ((void **)rec);
}


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

x86 assembly (clang, -O2):
<ptrlist_get>:
mov    $0x8,%edx
jmp    1030 <elasticarray_get@plt>

LLVM IR (-O0):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i8** @ptrlist_get(%struct.ptrlist_struct* %0, i64 %1) {
%3 = alloca %struct.ptrlist_struct*
%4 = alloca i64
%5 = alloca i8*
store %struct.ptrlist_struct* %0, %struct.ptrlist_struct** %3
store i64 %1, i64* %4
%6 = load %struct.ptrlist_struct*, %struct.ptrlist_struct** %3
%7 = bitcast %struct.ptrlist_struct* %6 to %struct.elasticarray*
%8 = load i64, i64* %4
%9 = call i8* @elasticarray_get(%struct.elasticarray* %7, i64 %8, i32 8)
store i8* %9, i8** %5
%10 = load i8*, i8** %5
%11 = bitcast i8* %10 to i8**
ret i8** %11
}

LLVM IR (-O2):
%struct.ptrlist_struct = type { i32 }
%struct.elasticarray = type { i32 }
define i8** @ptrlist_get(%struct.ptrlist_struct* %0, i64 %1) {
%3 = bitcast %struct.ptrlist_struct* %0 to %struct.elasticarray*
%4 = tail call i8* @elasticarray_get(%struct.elasticarray* %3, i64 %1, i32 8)
%5 = bitcast i8* %4 to i8**
ret i8** %5
}
/* Variables and functions */
int /*<<< orphan*/ ReflexTestData_SetResponseTime(double);
void TimerModel_SetMostRecentResponseTime(double responseTime) {
  ReflexTestData_SetResponseTime(responseTime);
}


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

x86 assembly (clang, -O2):
<TimerModel_SetMostRecentResponseTime>:
jmp    1030 <ReflexTestData_SetResponseTime@plt>

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

LLVM IR (-O2):
define void @TimerModel_SetMostRecentResponseTime(double %0) {
%2 = tail call i32 @ReflexTestData_SetResponseTime(double %0)
ret void
}
int isprint(int c) { return c >= 32 && c <= 127; }


x86 assembly (clang, -O0):
<isprint>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
xor    %eax,%eax
cmpl   $0x20,-0x4(%rbp)
mov    %al,-0x5(%rbp)
jl     1120 <isprint+0x20>
cmpl   $0x7f,-0x4(%rbp)
setle  %al
mov    %al,-0x5(%rbp)
mov    -0x5(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<isprint>:
add    $0xffffffe0,%edi
xor    %eax,%eax
cmp    $0x60,%edi
setb   %al
ret

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

LLVM IR (-O2):
define i32 @isprint(i32 %0) {
%2 = add i32 %0, -32
%3 = icmp ult i32 %2, 96
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int inc(void) { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @inc() {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ writechar(char);
void writestr(char *p) {
  while (*p) {
    writechar(*p);
    p++;
  }
}


x86 assembly (clang, -O0):
<writestr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1146 <writestr+0x36>
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <writechar@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    111c <writestr+0xc>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<writestr>:
push   %rbx
mov    (%rdi),%al
test   %al,%al
je     1133 <writestr+0x23>
mov    %rdi,%rbx
add    $0x1,%rbx
xchg   %ax,%ax
movsbl %al,%edi
call   1030 <writechar@plt>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1120 <writestr+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @writestr(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %9, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = tail call i32 @writechar(i8 signext %5)
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
ret void
}
/* Type definitions */
struct bti_node {
  int dummy;
};

/* Variables and functions */
int BTI_init(struct bti_node **n) {
  *n = NULL;
  return 0;
}


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

x86 assembly (clang, -O2):
<BTI_init>:
movq   $0x0,(%rdi)
xor    %eax,%eax
ret

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

LLVM IR (-O2):
%struct.bti_node = type { i32 }
define i32 @BTI_init(%struct.bti_node** nocapture writeonly %0) {
store %struct.bti_node* null, %struct.bti_node** %0
ret i32 0
}
/* Variables and functions */
char **__environ;
int /*<<< orphan*/ __libc_init(int, char **, char **);
void __libc_init_first(int argc, char *arg0, ...) {
  char **argv = &arg0, **envp = &argv[argc + 1];
  __environ = envp;
  __libc_init(argc, argv, envp);
}


x86 assembly (clang, -O0):
<__libc_init_first>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
movslq -0x4(%rbp),%rcx
lea    0x8(%rax,%rcx,8),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rcx
mov    0x2eb5(%rip),%rax
mov    %rcx,(%rax)
mov    -0x4(%rbp),%edi
mov    -0x18(%rbp),%rsi
mov    -0x20(%rbp),%rdx
call   1030 <__libc_init@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<__libc_init_first>:
push   %rax
mov    %rsi,(%rsp)
movslq %edi,%rdi
lea    (%rsp,%rdi,8),%rdx
add    $0x8,%rdx
mov    0x2ed1(%rip),%rax
mov    %rdx,(%rax)
mov    %rsp,%rsi
call   1030 <__libc_init@plt>
pop    %rax
ret

LLVM IR (-O0):
@__environ = global i8** null
define void @__libc_init_first(i32 %0, i8* %1, ...) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8**
%6 = alloca i8**
store i32 %0, i32* %3
store i8* %1, i8** %4
store i8** %4, i8*** %5
%7 = load i8**, i8*** %5
%8 = load i32, i32* %3
%9 = add nsw i32 %8, 1
%10 = sext i32 %9 to i64
%11 = getelementptr inbounds i8*, i8** %7, i64 %10
store i8** %11, i8*** %6
%12 = load i8**, i8*** %6
store i8** %12, i8*** @__environ
%13 = load i32, i32* %3
%14 = load i8**, i8*** %5
%15 = load i8**, i8*** %6
%16 = call i32 @__libc_init(i32 %13, i8** %14, i8** %15)
ret void
}

LLVM IR (-O2):
@__environ = global i8** null
define void @__libc_init_first(i32 %0, i8* %1, ...) {
%3 = alloca i8*
store i8* %1, i8** %3
%4 = add nsw i32 %0, 1
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8*, i8** %3, i64 %5
store i8** %6, i8*** @__environ
%7 = call i32 @__libc_init(i32 %0, i8** %3, i8** %6)
ret void
}
/* Variables and functions */
int uadecore_main(int, char **);
int main(int argc, char **argv) { return uadecore_main(argc, argv); }


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

x86 assembly (clang, -O2):
<main>:
jmp    1030 <uadecore_main@plt>

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

LLVM IR (-O2):
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i32 @uadecore_main(i32 %0, i8** %1)
ret i32 %3
}
int sock_init() { return 0; }


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

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

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

LLVM IR (-O2):
define i32 @sock_init() {
ret i32 0
}
void cpu_relax(void) { asm volatile("rep; nop"); }


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

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

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

LLVM IR (-O2):
define void @cpu_relax() {
tail call void asm sideeffect "rep; nop", "~{dirflag},~{fpsr},~{flags}"()
ret void
}
/* Variables and functions */
scalar_t__ malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char *);
scalar_t__ strlen(char *);
char *copyString(char *original) {
  char *copy = (char *)malloc(strlen(original) + 1);
  strcpy(copy, original);
  return copy;
}


x86 assembly (clang, -O0):
<copyString>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x10(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<copyString>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
lea    0x1(%rax),%rdi
call   1050 <malloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
mov    %r14,%rsi
call   1030 <strcpy@plt>
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i8* @copyString(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i64 @strlen(i8* %4)
%6 = add nsw i64 %5, 1
%7 = call i64 @malloc(i64 %6)
%8 = inttoptr i64 %7 to i8*
store i8* %8, i8** %3
%9 = load i8*, i8** %3
%10 = load i8*, i8** %2
%11 = call i32 @strcpy(i8* %9, i8* %10)
%12 = load i8*, i8** %3
ret i8* %12
}

LLVM IR (-O2):
define i8* @copyString(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i64 @malloc(i64 %3)
%5 = inttoptr i64 %4 to i8*
%6 = tail call i32 @strcpy(i8* %5, i8* %0)
ret i8* %5
}
/* Variables and functions */
int /*<<< orphan*/ GL_PROJECTION;
int /*<<< orphan*/ glLoadIdentity();
int /*<<< orphan*/ glMatrixMode(int /*<<< orphan*/);
int /*<<< orphan*/ glViewport(int /*<<< orphan*/, int /*<<< orphan*/, int, int);
int /*<<< orphan*/ gluPerspective(int, float, double, int);
void Reshape(int width, int height) {
  glViewport(0, 0, width, height);
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(45, (float)width / (float)height, 0.1, 100);
}


x86 assembly (clang, -O0):
<Reshape>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edx
mov    -0x8(%rbp),%ecx
xor    %esi,%esi
mov    %esi,%edi
call   1060 <glViewport@plt>
mov    0x2e7c(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
mov    $0x0,%al
call   1050 <glLoadIdentity@plt>
cvtsi2ssl -0x4(%rbp),%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
divss  %xmm1,%xmm0
mov    $0x2d,%edi
movsd  0xe73(%rip),%xmm1
mov    $0x64,%esi
call   1040 <gluPerspective@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Reshape>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebx
mov    %edi,%ebp
xor    %edi,%edi
xor    %esi,%esi
mov    %ebp,%edx
mov    %ebx,%ecx
call   1060 <glViewport@plt>
mov    0x2e85(%rip),%rax
mov    (%rax),%edi
call   1030 <glMatrixMode@plt>
xor    %eax,%eax
call   1050 <glLoadIdentity@plt>
cvtsi2ss %ebp,%xmm0
cvtsi2ss %ebx,%xmm1
divss  %xmm1,%xmm0
movsd  0xe83(%rip),%xmm1
mov    $0x2d,%edi
mov    $0x64,%esi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1040 <gluPerspective@plt>

LLVM IR (-O0):
@GL_PROJECTION = global i32 0
define void @Reshape(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 = call i32 @glViewport(i32 0, i32 0, i32 %5, i32 %6)
%8 = load i32, i32* @GL_PROJECTION
%9 = call i32 @glMatrixMode(i32 %8)
%10 = call i32 (...) @glLoadIdentity()
%11 = load i32, i32* %3
%12 = sitofp i32 %11 to float
%13 = load i32, i32* %4
%14 = sitofp i32 %13 to float
%15 = fdiv float %12, %14
%16 = call i32 @gluPerspective(i32 45, float %15, double 1.000000e-01, i32 100)
ret void
}

LLVM IR (-O2):
@GL_PROJECTION = global i32 0
define void @Reshape(i32 %0, i32 %1) {
%3 = tail call i32 @glViewport(i32 0, i32 0, i32 %0, i32 %1)
%4 = load i32, i32* @GL_PROJECTION
%5 = tail call i32 @glMatrixMode(i32 %4)
%6 = tail call i32 (...) @glLoadIdentity()
%7 = sitofp i32 %0 to float
%8 = sitofp i32 %1 to float
%9 = fdiv float %7, %8
%10 = tail call i32 @gluPerspective(i32 45, float %9, double 1.000000e-01, i32 100)
ret void
}
/* Variables and functions */
int strcmp(char *, char *);
int wfile_filename_compare(char *fn1, char *fn2) { return (strcmp(fn1, fn2)); }


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

x86 assembly (clang, -O2):
<wfile_filename_compare>:
jmp    1030 <strcmp@plt>

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

LLVM IR (-O2):
define i32 @wfile_filename_compare(i8* nocapture %0, i8* nocapture %1) {
%3 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(1) %1)
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char *);
int /*<<< orphan*/ stderr;
void quit(char *why) {
  fprintf(stderr, "fitblk abort: %s\n", why);
  exit(1);
}


x86 assembly (clang, -O0):
<quit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2ead(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rdx
lea    0xec0(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<quit>:
push   %rax
mov    %rdi,%rdx
mov    0x2eb5(%rip),%rax
mov    (%rax),%edi
lea    0xecc(%rip),%rsi
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [18 x i8] c"fitblk abort: %s\0A\00"
define void @quit(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i32, i32* @stderr
%4 = load i8*, i8** %2
%5 = call i32 @fprintf(i32 %3, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %4)
%6 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [18 x i8] c"fitblk abort: %s\0A\00"
define void @quit(i8* %0) {
%2 = load i32, i32* @stderr
%3 = tail call i32 @fprintf(i32 %2, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i8* %0)
%4 = tail call i32 @exit(i32 1)
unreachable
}