xunge/DecIR huggingface dataset:
int seqno_compare(unsigned short s1, unsigned short s2) {
  if (s1 == s2)
    return 0;
  else
    return ((s2 - s1) & 0x8000) ? 1 : -1;
}


x86 assembly (clang, -O0):
<seqno_compare>:
push   %rbp
mov    %rsp,%rbp
mov    %si,%ax
mov    %di,%cx
mov    %cx,-0x6(%rbp)
mov    %ax,-0x8(%rbp)
movzwl -0x6(%rbp),%eax
movzwl -0x8(%rbp),%ecx
cmp    %ecx,%eax
jne    112e <seqno_compare+0x2e>
movl   $0x0,-0x4(%rbp)
jmp    1151 <seqno_compare+0x51>
movzwl -0x8(%rbp),%edx
movzwl -0x6(%rbp),%eax
sub    %eax,%edx
and    $0x8000,%edx
mov    $0xffffffff,%eax
mov    $0x1,%ecx
cmp    $0x0,%edx
cmovne %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<seqno_compare>:
xor    %eax,%eax
cmp    %di,%si
je     1117 <seqno_compare+0x17>
sub    %edi,%esi
and    $0x8000,%esi
cmp    $0x1,%esi
sbb    %eax,%eax
or     $0x1,%eax
ret

LLVM IR (-O0):
define i32 @seqno_compare(i16 zeroext %0, i16 zeroext %1) {
%3 = alloca i32
%4 = alloca i16
%5 = alloca i16
store i16 %0, i16* %4
store i16 %1, i16* %5
%6 = load i16, i16* %4
%7 = zext i16 %6 to i32
%8 = load i16, i16* %5
%9 = zext i16 %8 to i32
%10 = icmp eq i32 %7, %9
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %3
br label %22
12: ; preds = %2
%13 = load i16, i16* %5
%14 = zext i16 %13 to i32
%15 = load i16, i16* %4
%16 = zext i16 %15 to i32
%17 = sub nsw i32 %14, %16
%18 = and i32 %17, 32768
%19 = icmp ne i32 %18, 0
%20 = zext i1 %19 to i64
%21 = select i1 %19, i32 1, i32 -1
store i32 %21, i32* %3
br label %22
22: ; preds = %12, %11
%23 = load i32, i32* %3
ret i32 %23
}

LLVM IR (-O2):
define i32 @seqno_compare(i16 zeroext %0, i16 zeroext %1) {
%3 = icmp eq i16 %1, %0
br i1 %3, label %11, label %4
4: ; preds = %2
%5 = zext i16 %0 to i32
%6 = zext i16 %1 to i32
%7 = sub nsw i32 %6, %5
%8 = and i32 %7, 32768
%9 = icmp eq i32 %8, 0
%10 = select i1 %9, i32 -1, i32 1
br label %11
11: ; preds = %2, %4
%12 = phi i32 [ %10, %4 ], [ 0, %2 ]
ret i32 %12
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int /*<<< orphan*/ exit(int /*<<< orphan*/);
main() {
  int j = 1081;
  struct {
    signed int m : 11;
  } l;
  if ((l.m = j) == j)
    abort();
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x439,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    -0x10(%rbp),%cx
and    $0x7ff,%ax
and    $0xf800,%cx
or     %ax,%cx
mov    %cx,-0x10(%rbp)
shl    $0x5,%ax
sar    $0x5,%ax
cwtl
cmp    -0x8(%rbp),%eax
jne    1166 <main+0x46>
mov    $0x0,%al
call   1030 <abort@plt>
xor    %edi,%edi
call   1040 <exit@plt>

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

LLVM IR (-O0):
%struct.anon = type { i16, [2 x i8] }
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca %struct.anon
store i32 0, i32* %1
store i32 1081, i32* %2
%4 = load i32, i32* %2
%5 = bitcast %struct.anon* %3 to i16*
%6 = trunc i32 %4 to i16
%7 = load i16, i16* %5
%8 = and i16 %6, 2047
%9 = and i16 %7, -2048
%10 = or i16 %9, %8
store i16 %10, i16* %5
%11 = shl i16 %8, 5
%12 = ashr i16 %11, 5
%13 = sext i16 %12 to i32
%14 = load i32, i32* %2
%15 = icmp eq i32 %13, %14
br i1 %15, label %16, label %18
16: ; preds = %0
%17 = call i32 (...) @abort()
unreachable
18: ; preds = %0
%19 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int /*<<< orphan*/ info();
int /*<<< orphan*/ outMap(char *);
int /*<<< orphan*/ printf(char *);
void banner(char *map) {
  printf("-=[   TicTacToe by shibumi   ]=-\n");
  info();
  printf("Spielfeld:\n");
  outMap(map);
}


x86 assembly (clang, -O0):
<banner>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xebd(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1050 <info@plt>
lea    0xecc(%rip),%rdi
call   1030 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1040 <outMap@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<banner>:
push   %rbx
mov    %rdi,%rbx
lea    0xec5(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1050 <info@plt>
lea    0xed3(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1040 <outMap@plt>

LLVM IR (-O0):
@.str = [34 x i8] c"-=[ TicTacToe by shibumi ]=-\0A\00"
@.str.1 = [12 x i8] c"Spielfeld:\0A\00"
define void @banner(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = call i32 @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str, i64 0, i64 0))
%4 = call i32 (...) @info()
%5 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
%6 = load i8*, i8** %2
%7 = call i32 @outMap(i8* %6)
ret void
}

LLVM IR (-O2):
@str = [33 x i8] c"-=[ TicTacToe by shibumi ]=-\00"
@str.2 = [11 x i8] c"Spielfeld:\00"
define void @banner(i8* %0) {
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str, i64 0, i64 0))
%3 = tail call i32 (...) @info()
%4 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.2, i64 0, i64 0))
%5 = tail call i32 @outMap(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ _unsupported();
void _Unwind_Backtrace() { _unsupported(); }


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

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

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

LLVM IR (-O2):
define void @_Unwind_Backtrace() {
%1 = tail call i32 (...) @_unsupported()
ret void
}
unsigned long ht_hash(unsigned char *str) {
  unsigned long hash = 5381;
  int c;
  while (c = *str++)
    hash = ((hash << 5) + hash) + c;
  return hash;
}


x86 assembly (clang, -O0):
<ht_hash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x1505,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
je     114a <ht_hash+0x4a>
mov    -0x10(%rbp),%rax
shl    $0x5,%rax
add    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
jmp    1110 <ht_hash+0x10>
mov    -0x10(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ht_hash>:
mov    (%rdi),%cl
test   %cl,%cl
je     112c <ht_hash+0x2c>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %rax,%rdx
shl    $0x5,%rdx
add    %rax,%rdx
movzbl %cl,%eax
add    %rdx,%rax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <ht_hash+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i64 @ht_hash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i64 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i64 %7, 33
%10 = zext i8 %5 to i64
%11 = add i64 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i64 [ 5381, %1 ], [ %11, %4 ]
ret i64 %15
}
int ci_is_multithreaded(void) { return 1; }


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

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

LLVM IR (-O0):
define i32 @ci_is_multithreaded() {
ret i32 1
}

LLVM IR (-O2):
define i32 @ci_is_multithreaded() {
ret i32 1
}
int is_odd(number)
short number;
{
  int result = 0;
  result = number % 2;
  return (result);
}


x86 assembly (clang, -O0):
<is_odd>:
push   %rbp
mov    %rsp,%rbp
mov    %di,%ax
mov    %ax,-0x2(%rbp)
movl   $0x0,-0x8(%rbp)
movswl -0x2(%rbp),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_odd>:
movzwl %di,%eax
shr    $0xf,%eax
add    %edi,%eax
and    $0xfffffffe,%eax
sub    %eax,%edi
movswl %di,%eax
ret

LLVM IR (-O0):
define i32 @is_odd(i32 %0) {
%2 = alloca i16
%3 = alloca i32
%4 = trunc i32 %0 to i16
store i16 %4, i16* %2
store i32 0, i32* %3
%5 = load i16, i16* %2
%6 = sext i16 %5 to i32
%7 = srem i32 %6, 2
store i32 %7, i32* %3
%8 = load i32, i32* %3
ret i32 %8
}

LLVM IR (-O2):
define i32 @is_odd(i32 %0) {
%2 = trunc i32 %0 to i16
%3 = srem i16 %2, 2
%4 = sext i16 %3 to i32
ret i32 %4
}
void pmu_init() {}


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

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

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

LLVM IR (-O2):
define void @pmu_init() {
ret void
}
/* Variables and functions */
int strlen(char *);
char toupper(char);
char *strupr(char *s) {
  int i;
  for (i = 0; i < strlen(s); i++) {
    s[i] = toupper(s[i]);
  }
  return s;
}


x86 assembly (clang, -O0):
<strupr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
cmp    %ecx,%eax
jge    117b <strupr+0x5b>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <toupper@plt>
mov    %al,%dl
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
mov    %dl,(%rax,%rcx,1)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1133 <strupr+0x13>
mov    -0x8(%rbp),%rax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<strupr>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
call   1040 <strlen@plt>
test   %eax,%eax
jle    1161 <strupr+0x41>
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsbl (%r14,%rbx,1),%edi
call   1030 <toupper@plt>
mov    %al,(%r14,%rbx,1)
add    $0x1,%rbx
mov    %r14,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <strupr+0x20>
mov    %r14,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define i8* @strupr(i8* returned %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = icmp sgt i32 %2, 0
br i1 %3, label %4, label %13
4: ; preds = %1, %4
%5 = phi i64 [ %9, %4 ], [ 0, %1 ]
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = load i8, i8* %6
%8 = tail call signext i8 @toupper(i8 signext %7)
store i8 %8, i8* %6
%9 = add nuw nsw i64 %5, 1
%10 = tail call i32 @strlen(i8* %0)
%11 = sext i32 %10 to i64
%12 = icmp slt i64 %9, %11
br i1 %12, label %4, label %13
13: ; preds = %4, %1
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ close(int);
void sapi_inet_tcp_client_destroy(int sock) { close(sock); }


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

x86 assembly (clang, -O2):
<sapi_inet_tcp_client_destroy>:
jmp    1030 <close@plt>

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

LLVM IR (-O2):
define void @sapi_inet_tcp_client_destroy(i32 %0) {
%2 = tail call i32 @close(i32 %0)
ret void
}
/* Variables and functions */
double quagam_(double *, double *);
double cquagam(double *f, double *para) { return quagam_(f, para); }


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

x86 assembly (clang, -O2):
<cquagam>:
jmp    1030 <quagam_@plt>

LLVM IR (-O0):
define double @cquagam(double* %0, double* %1) {
%3 = alloca double*
%4 = alloca double*
store double* %0, double** %3
store double* %1, double** %4
%5 = load double*, double** %3
%6 = load double*, double** %4
%7 = call double @quagam_(double* %5, double* %6)
ret double %7
}

LLVM IR (-O2):
define double @cquagam(double* %0, double* %1) {
%3 = tail call double @quagam_(double* %0, double* %1)
ret double %3
}
/* Variables and functions */
int /*<<< orphan*/ write_call(int);
void write_call_table(void) {
  int i;
  for (i = 0; i < 80; i++)
    write_call(i);
}


x86 assembly (clang, -O0):
<write_call_table>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
cmpl   $0x50,-0x4(%rbp)
jge    113f <write_call_table+0x2f>
mov    -0x4(%rbp),%edi
call   1030 <write_call@plt>
mov    -0x4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    111f <write_call_table+0xf>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<write_call_table>:
push   %rbx
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %ebx,%edi
call   1030 <write_call@plt>
add    $0x1,%ebx
cmp    $0x50,%ebx
jne    1120 <write_call_table+0x10>
pop    %rbx
ret

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

LLVM IR (-O2):
define void @write_call_table() {
br label %1
1: ; preds = %0, %1
%2 = phi i32 [ 0, %0 ], [ %4, %1 ]
%3 = tail call i32 @write_call(i32 %2)
%4 = add nuw nsw i32 %2, 1
%5 = icmp eq i32 %4, 80
br i1 %5, label %6, label %1
6: ; preds = %1
ret void
}
int lw10(int l) {
  int i = 0;
  double d;
  if (l < 0) {
    l *= -1;
    i++;
  }
  d = (double)l;
  while ((d /= 10) >= 1)
    i++;
  return i + 1;
}


x86 assembly (clang, -O0):
<lw10>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1128 <lw10+0x28>
imul   $0xffffffff,-0x4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
cvtsi2sdl -0x4(%rbp),%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  0xec9(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
movsd  0xeb0(%rip),%xmm1
ucomisd %xmm1,%xmm0
jb     1168 <lw10+0x68>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1132 <lw10+0x32>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<lw10>:
mov    %edi,%eax
mov    %edi,%ecx
neg    %ecx
cmovs  %edi,%ecx
shr    $0x1f,%eax
cvtsi2sd %ecx,%xmm0
movsd  0xee8(%rip),%xmm1
movsd  0xee8(%rip),%xmm2
divsd  %xmm1,%xmm0
add    $0x1,%eax
ucomisd %xmm2,%xmm0
jae    1120 <lw10+0x20>
ret

LLVM IR (-O0):
define i32 @lw10(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca double
store i32 %0, i32* %2
store i32 0, i32* %3
%5 = load i32, i32* %2
%6 = icmp slt i32 %5, 0
br i1 %6, label %7, label %12
7: ; preds = %1
%8 = load i32, i32* %2
%9 = mul nsw i32 %8, -1
store i32 %9, i32* %2
%10 = load i32, i32* %3
%11 = add nsw i32 %10, 1
store i32 %11, i32* %3
br label %12
12: ; preds = %7, %1
%13 = load i32, i32* %2
%14 = sitofp i32 %13 to double
store double %14, double* %4
br label %15
15: ; preds = %19, %12
%16 = load double, double* %4
%17 = fdiv double %16, 1.000000e+01
store double %17, double* %4
%18 = fcmp oge double %17, 1.000000e+00
br i1 %18, label %19, label %22
19: ; preds = %15
%20 = load i32, i32* %3
%21 = add nsw i32 %20, 1
store i32 %21, i32* %3
br label %15
22: ; preds = %15
%23 = load i32, i32* %3
%24 = add nsw i32 %23, 1
ret i32 %24
}

LLVM IR (-O2):
define i32 @lw10(i32 %0) {
%2 = tail call i32 @llvm.abs.i32(i32 %0, i1 true)
%3 = lshr i32 %0, 31
%4 = sitofp i32 %2 to double
br label %5
5: ; preds = %5, %1
%6 = phi i32 [ %3, %1 ], [ %10, %5 ]
%7 = phi double [ %4, %1 ], [ %8, %5 ]
%8 = fdiv double %7, 1.000000e+01
%9 = fcmp ult double %8, 1.000000e+00
%10 = add nuw nsw i32 %6, 1
br i1 %9, label %11, label %5
11: ; preds = %5
ret i32 %10
}
/* Variables and functions */
char *html_substring(char *, int, char *);
int /*<<< orphan*/ printf(char *, char *);
int main(int argc, char **argv) {
  printf("%s", html_substring(argv[1], 15, "..."));
  return 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    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    $0xf,%esi
lea    0xeb9(%rip),%rdx
call   1040 <html_substring@plt>
mov    %rax,%rsi
lea    0xea7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    0x8(%rsi),%rdi
lea    0xed7(%rip),%rdx
mov    $0xf,%esi
call   1040 <html_substring@plt>
lea    0xec3(%rip),%rdi
mov    %rax,%rsi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"...\00"
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 i8**, i8*** %5
%7 = getelementptr inbounds i8*, i8** %6, i64 1
%8 = load i8*, i8** %7
%9 = call i8* @html_substring(i8* %8, i32 15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %9)
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [4 x i8] c"...\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = getelementptr inbounds i8*, i8** %1, i64 1
%4 = load i8*, i8** %3
%5 = tail call i8* @html_substring(i8* %4, i32 15, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ codeln(char *);
void vspace(int lines) {
  int i;
  for (i = 0; i < lines; i++) {
    codeln("");
  }
}


x86 assembly (clang, -O0):
<vspace>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0x4(%rbp),%eax
jge    1148 <vspace+0x38>
lea    0xecb(%rip),%rdi
call   1030 <codeln@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    1122 <vspace+0x12>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vspace>:
push   %r14
push   %rbx
push   %rax
test   %edi,%edi
jle    113d <vspace+0x2d>
mov    %edi,%ebx
lea    0xedf(%rip),%r14
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
call   1030 <codeln@plt>
add    $0xffffffff,%ebx
jne    1130 <vspace+0x20>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @vspace(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
br label %4
4: ; preds = %10, %1
%5 = load i32, i32* %3
%6 = load i32, i32* %2
%7 = icmp slt i32 %5, %6
br i1 %7, label %8, label %13
8: ; preds = %4
%9 = call i32 @codeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %10
10: ; preds = %8
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %4
13: ; preds = %4
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @vspace(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %3, label %8
3: ; preds = %1, %3
%4 = phi i32 [ %6, %3 ], [ 0, %1 ]
%5 = tail call i32 @codeln(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%6 = add nuw nsw i32 %4, 1
%7 = icmp eq i32 %6, %0
br i1 %7, label %8, label %3
8: ; preds = %3, %1
ret void
}
/* Variables and functions */
int /*<<< orphan*/ update_size();
void terminal_resized(int ignored) { update_size(); }


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

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

LLVM IR (-O0):
define void @terminal_resized(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = call i32 (...) @update_size()
ret void
}

LLVM IR (-O2):
define void @terminal_resized(i32 %0) {
%2 = tail call i32 (...) @update_size()
ret void
}
/* Variables and functions */
int writeall(int, char *, int);
int putchar(int c) {
  char cc = c;
  return writeall(1, &cc, 1);
}


x86 assembly (clang, -O0):
<putchar>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %al,-0x5(%rbp)
mov    $0x1,%edx
lea    -0x5(%rbp),%rsi
mov    %edx,%edi
call   1030 <writeall@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rax
mov    %dil,0x7(%rsp)
lea    0x7(%rsp),%rsi
mov    $0x1,%edi
mov    $0x1,%edx
call   1030 <writeall@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @putchar(i32 %0) {
%2 = alloca i32
%3 = alloca i8
store i32 %0, i32* %2
%4 = load i32, i32* %2
%5 = trunc i32 %4 to i8
store i8 %5, i8* %3
%6 = call i32 @writeall(i32 1, i8* %3, i32 1)
ret i32 %6
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = alloca i8
%3 = trunc i32 %0 to i8
store i8 %3, i8* %2
%4 = call i32 @writeall(i32 1, i8* %2, i32 1)
ret i32 %4
}
float linint(float x0, float y0, float x1, float y1, float x) {
  return (x - x0) * (y1 - y0) / (x1 - x0) + y0;
}


x86 assembly (clang, -O0):
<linint>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  %xmm1,-0x8(%rbp)
movss  %xmm2,-0xc(%rbp)
movss  %xmm3,-0x10(%rbp)
movss  %xmm4,-0x14(%rbp)
movss  -0x14(%rbp),%xmm0
subss  -0x4(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
subss  -0x8(%rbp),%xmm1
mulss  %xmm1,%xmm0
movss  -0xc(%rbp),%xmm1
subss  -0x4(%rbp),%xmm1
divss  %xmm1,%xmm0
addss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<linint>:
subss  %xmm0,%xmm4
subss  %xmm1,%xmm3
mulss  %xmm4,%xmm3
subss  %xmm0,%xmm2
divss  %xmm2,%xmm3
addss  %xmm1,%xmm3
movaps %xmm3,%xmm0
ret

LLVM IR (-O0):
define float @linint(float %0, float %1, float %2, float %3, float %4) {
%6 = alloca float
%7 = alloca float
%8 = alloca float
%9 = alloca float
%10 = alloca float
store float %0, float* %6
store float %1, float* %7
store float %2, float* %8
store float %3, float* %9
store float %4, float* %10
%11 = load float, float* %10
%12 = load float, float* %6
%13 = fsub float %11, %12
%14 = load float, float* %9
%15 = load float, float* %7
%16 = fsub float %14, %15
%17 = fmul float %13, %16
%18 = load float, float* %8
%19 = load float, float* %6
%20 = fsub float %18, %19
%21 = fdiv float %17, %20
%22 = load float, float* %7
%23 = fadd float %21, %22
ret float %23
}

LLVM IR (-O2):
define float @linint(float %0, float %1, float %2, float %3, float %4) {
%6 = fsub float %4, %0
%7 = fsub float %3, %1
%8 = fmul float %7, %6
%9 = fsub float %2, %0
%10 = fdiv float %8, %9
%11 = fadd float %10, %1
ret float %11
}
/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ stderr;
void global_deinit() { fprintf(stderr, "CTRAPS: SFI Plugin Shutdown\n"); }


x86 assembly (clang, -O0):
<global_deinit>:
push   %rbp
mov    %rsp,%rbp
mov    0x2ec5(%rip),%rax
mov    (%rax),%edi
lea    0xedc(%rip),%rsi
call   1030 <fprintf@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<global_deinit>:
mov    0x2ec9(%rip),%rax
mov    (%rax),%edi
lea    0xee0(%rip),%rsi
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
@stderr = global i32 0
@.str = [29 x i8] c"CTRAPS: SFI Plugin Shutdown\0A\00"
define void @global_deinit() {
%1 = load i32, i32* @stderr
%2 = call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [29 x i8] c"CTRAPS: SFI Plugin Shutdown\0A\00"
define void @global_deinit() {
%1 = load i32, i32* @stderr
%2 = tail call i32 @fprintf(i32 %1, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
int /*<<< orphan*/ mpack_load_u64(char const *);
int64_t mpack_load_i64(const char *p) { return (int64_t)mpack_load_u64(p); }


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

x86 assembly (clang, -O2):
<mpack_load_i64>:
jmp    1030 <mpack_load_u64@plt>

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

LLVM IR (-O2):
define i32 @mpack_load_i64(i8* %0) {
%2 = tail call i32 @mpack_load_u64(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ handle_51(int /*<<< orphan*/);
int gen_51(void) {
  handle_51(0);
  return 0;
}


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

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

LLVM IR (-O0):
define i32 @gen_51() {
%1 = call i32 @handle_51(i32 0)
ret i32 0
}

LLVM IR (-O2):
define i32 @gen_51() {
%1 = tail call i32 @handle_51(i32 0)
ret i32 0
}
int CHECK_CRDR2(unsigned char v) { return (v & 0xfc) == 0x20; }


x86 assembly (clang, -O0):
<CHECK_CRDR2>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x1(%rbp)
movzbl -0x1(%rbp),%eax
and    $0xfc,%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHECK_CRDR2>:
and    $0xfc,%dil
xor    %eax,%eax
cmp    $0x20,%dil
sete   %al
ret

LLVM IR (-O0):
define i32 @CHECK_CRDR2(i8 zeroext %0) {
%2 = alloca i8
store i8 %0, i8* %2
%3 = load i8, i8* %2
%4 = zext i8 %3 to i32
%5 = and i32 %4, 252
%6 = icmp eq i32 %5, 32
%7 = zext i1 %6 to i32
ret i32 %7
}

LLVM IR (-O2):
define i32 @CHECK_CRDR2(i8 zeroext %0) {
%2 = and i8 %0, -4
%3 = icmp eq i8 %2, 32
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int DOBLOCK(int);
void DO(int cond) {
  do {
    cond = DOBLOCK(cond);
  } while (cond);
}


x86 assembly (clang, -O0):
<DO>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%edi
call   1030 <DOBLOCK@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
jne    111b <DO+0xb>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DO>:
push   %rax
mov    %edi,%eax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %eax,%edi
call   1030 <DOBLOCK@plt>
test   %eax,%eax
jne    1120 <DO+0x10>
pop    %rax
ret

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

LLVM IR (-O2):
define void @DO(i32 %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i32 [ %0, %1 ], [ %4, %2 ]
%4 = tail call i32 @DOBLOCK(i32 %3)
%5 = icmp eq i32 %4, 0
br i1 %5, label %6, label %2
6: ; preds = %2
ret void
}
/* Variables and functions */
int /*<<< orphan*/ DymosimMessage(char *);
int /*<<< orphan*/ sprintf(char *, char *, char const *, int);
void DymosimMessageInt(const char *message, int i) {
  char textline[200];
  sprintf(textline, "%.160s %i", message, i);
  DymosimMessage(textline);
}


x86 assembly (clang, -O0):
<DymosimMessageInt>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0xe0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0xc(%rbp),%ecx
lea    0xeb9(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xe0(%rbp),%rdi
call   1030 <DymosimMessage@plt>
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DymosimMessageInt>:
push   %rbx
sub    $0xd0,%rsp
mov    %esi,%ecx
mov    %rdi,%rdx
lea    0xecc(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
call   1040 <sprintf@plt>
mov    %rbx,%rdi
call   1030 <DymosimMessage@plt>
add    $0xd0,%rsp
pop    %rbx
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%.160s %i\00"
define void @DymosimMessageInt(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca [200 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%6 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%7 = load i8*, i8** %3
%8 = load i32, i32* %4
%9 = call i32 @sprintf(i8* %6, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %7, i32 %8)
%10 = getelementptr inbounds [200 x i8], [200 x i8]* %5, i64 0, i64 0
%11 = call i32 @DymosimMessage(i8* %10)
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%.160s %i\00"
define void @DymosimMessageInt(i8* %0, i32 %1) {
%3 = alloca [200 x i8]
%4 = getelementptr inbounds [200 x i8], [200 x i8]* %3, i64 0, i64 0
%5 = call i32 @sprintf(i8* %4, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %1)
%6 = call i32 @DymosimMessage(i8* %4)
ret void
}
/* Type definitions */
typedef int uint8_t;
typedef int address;

/* Variables and functions */
int /*<<< orphan*/ tpi_write(int);
void tpi_sstcs(uint8_t data, uint8_t address) {
  tpi_write((0x80) | ((address) & (0x0F)));
  tpi_write(data);
}


x86 assembly (clang, -O0):
<tpi_sstcs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x8(%rbp),%edi
and    $0xf,%edi
or     $0x80,%edi
call   1030 <tpi_write@plt>
mov    -0x4(%rbp),%edi
call   1030 <tpi_write@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tpi_sstcs>:
push   %rbx
mov    %edi,%ebx
and    $0xf,%esi
lea    0x80(%rsi),%edi
call   1030 <tpi_write@plt>
mov    %ebx,%edi
pop    %rbx
jmp    1030 <tpi_write@plt>

LLVM IR (-O0):
define void @tpi_sstcs(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* %4
%6 = and i32 %5, 15
%7 = or i32 128, %6
%8 = call i32 @tpi_write(i32 %7)
%9 = load i32, i32* %3
%10 = call i32 @tpi_write(i32 %9)
ret void
}

LLVM IR (-O2):
define void @tpi_sstcs(i32 %0, i32 %1) {
%3 = and i32 %1, 15
%4 = or i32 %3, 128
%5 = tail call i32 @tpi_write(i32 %4)
%6 = tail call i32 @tpi_write(i32 %0)
ret void
}
int dgetc(void) {
  while ((((volatile unsigned int *)(0x49020014))[0] & 0x01) == 0)
    ;
  return ((volatile unsigned char *)(0x49020000))[0];
}


x86 assembly (clang, -O0):
<dgetc>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <dgetc+0x9>
mov    $0x49020014,%eax
mov    (%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1121 <dgetc+0x21>
jmp    1109 <dgetc+0x9>
mov    $0x49020000,%eax
mov    (%rax),%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<dgetc>:
testl  $0x1,0x49020014
je     1100 <dgetc>
movzbl 0x49020000,%eax
49
ret

LLVM IR (-O0):
define i32 @dgetc() {
br label %1
1: ; preds = %5, %0
%2 = load volatile i32, i32* inttoptr (i64 1224867860 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %1
br label %1
6: ; preds = %1
%7 = load volatile i8, i8* inttoptr (i64 1224867840 to i8*)
%8 = zext i8 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @dgetc() {
br label %1
1: ; preds = %1, %0
%2 = load volatile i32, i32* inttoptr (i64 1224867860 to i32*)
%3 = and i32 %2, 1
%4 = icmp eq i32 %3, 0
br i1 %4, label %1, label %5
5: ; preds = %1
%6 = load volatile i8, i8* inttoptr (i64 1224867840 to i8*)
%7 = zext i8 %6 to i32
ret i32 %7
}
/* Type definitions */
typedef int __u64;

/* Variables and functions */
void get_btversion(__u64 version, int *mjr, int *mnr, int *sub) {
  *mjr = (int)((version >> 16) & 0xff);
  *mnr = (int)((version >> 8) & 0xff);
  *sub = (int)((version >> 0) & 0xff);
}


x86 assembly (clang, -O0):
<get_btversion>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x4(%rbp),%ecx
sar    $0x10,%ecx
and    $0xff,%ecx
mov    -0x10(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x8,%ecx
and    $0xff,%ecx
mov    -0x18(%rbp),%rax
mov    %ecx,(%rax)
mov    -0x4(%rbp),%ecx
sar    $0x0,%ecx
and    $0xff,%ecx
mov    -0x20(%rbp),%rax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_btversion>:
push   %rbx
mov    %edi,%eax
movzbl %ah,%ebx
movzbl %al,%edi
shr    $0x10,%eax
movzbl %al,%eax
mov    %eax,(%rsi)
mov    %ebx,(%rdx)
mov    %edi,(%rcx)
pop    %rbx
ret

LLVM IR (-O0):
define void @get_btversion(i32 %0, i32* %1, i32* %2, i32* %3) {
%5 = alloca i32
%6 = alloca i32*
%7 = alloca i32*
%8 = alloca i32*
store i32 %0, i32* %5
store i32* %1, i32** %6
store i32* %2, i32** %7
store i32* %3, i32** %8
%9 = load i32, i32* %5
%10 = ashr i32 %9, 16
%11 = and i32 %10, 255
%12 = load i32*, i32** %6
store i32 %11, i32* %12
%13 = load i32, i32* %5
%14 = ashr i32 %13, 8
%15 = and i32 %14, 255
%16 = load i32*, i32** %7
store i32 %15, i32* %16
%17 = load i32, i32* %5
%18 = ashr i32 %17, 0
%19 = and i32 %18, 255
%20 = load i32*, i32** %8
store i32 %19, i32* %20
ret void
}

LLVM IR (-O2):
define void @get_btversion(i32 %0, i32* nocapture writeonly %1, i32* nocapture writeonly %2, i32* nocapture writeonly %3) {
%5 = lshr i32 %0, 16
%6 = and i32 %5, 255
store i32 %6, i32* %1
%7 = lshr i32 %0, 8
%8 = and i32 %7, 255
store i32 %8, i32* %2
%9 = and i32 %0, 255
store i32 %9, i32* %3
ret void
}
/* Variables and functions */
int bar(int x) {
  for (int y = 0; y < 10; y++) {
  }
  for (long y = 1000; y >= 0; y--) {
  }
  char *y = &x;
  return 0;
}


x86 assembly (clang, -O0):
<bar>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
cmpl   $0xa,-0x8(%rbp)
jge    112b <bar+0x2b>
jmp    111d <bar+0x1d>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    110e <bar+0xe>
movq   $0x3e8,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jl     1154 <bar+0x54>
jmp    1143 <bar+0x43>
mov    -0x10(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x10(%rbp)
jmp    1133 <bar+0x33>
lea    -0x4(%rbp),%rax
mov    %rax,-0x18(%rbp)
xor    %eax,%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @bar(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
%5 = alloca i8*
store i32 %0, i32* %2
store i32 0, i32* %3
br label %6
6: ; preds = %10, %1
%7 = load i32, i32* %3
%8 = icmp slt i32 %7, 10
br i1 %8, label %9, label %13
9: ; preds = %6
br label %10
10: ; preds = %9
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
br label %6
13: ; preds = %6
store i64 1000, i64* %4
br label %14
14: ; preds = %18, %13
%15 = load i64, i64* %4
%16 = icmp sge i64 %15, 0
br i1 %16, label %17, label %21
17: ; preds = %14
br label %18
18: ; preds = %17
%19 = load i64, i64* %4
%20 = add nsw i64 %19, -1
store i64 %20, i64* %4
br label %14
21: ; preds = %14
%22 = bitcast i32* %2 to i8*
store i8* %22, i8** %5
ret i32 0
}

LLVM IR (-O2):
define i32 @bar(i32 %0) {
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ grid_free(void *);
void grid_chunk_default_free(void *p) { grid_free(p); }


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

x86 assembly (clang, -O2):
<grid_chunk_default_free>:
jmp    1030 <grid_free@plt>

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

LLVM IR (-O2):
define void @grid_chunk_default_free(i8* %0) {
%2 = tail call i32 @grid_free(i8* %0)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void htmlSecondaryServiceCleanup(void) {
  printf("Content-type: text/plain\n\n");
  printf("htmlSecondaryServiceCleanup() start\n");
  printf("htmlSecondaryServiceCleanup() end\n");
  exit(0);
}


x86 assembly (clang, -O0):
<htmlSecondaryServiceCleanup>:
push   %rbp
mov    %rsp,%rbp
lea    0xed5(%rip),%rdi
call   1030 <printf@plt>
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<htmlSecondaryServiceCleanup>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
lea    0xee6(%rip),%rdi
call   1030 <puts@plt>
lea    0xefe(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"Content-type: text/plain\0A\0A\00"
@.str.1 = [37 x i8] c"htmlSecondaryServiceCleanup() start\0A\00"
@.str.2 = [35 x i8] c"htmlSecondaryServiceCleanup() end\0A\00"
define void @htmlSecondaryServiceCleanup() {
%1 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.2, i64 0, i64 0))
%4 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [26 x i8] c"Content-type: text/plain\0A\00"
@str.3 = [36 x i8] c"htmlSecondaryServiceCleanup() start\00"
@str.4 = [34 x i8] c"htmlSecondaryServiceCleanup() end\00"
define void @htmlSecondaryServiceCleanup() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.3, i64 0, i64 0))
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.4, i64 0, i64 0))
%4 = tail call i32 @exit(i32 0)
unreachable
}
/* Variables and functions */
int getach();
int getrq();
int getsn(void) {
  int i;
  if ((i = getach()) == 0)
    return (0);
  if (i == '(')
    return (getrq());
  else
    return (i);
}


x86 assembly (clang, -O0):
<getsn>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <getach@plt>
mov    %eax,-0x8(%rbp)
cmp    $0x0,%eax
jne    1147 <getsn+0x27>
movl   $0x0,-0x4(%rbp)
jmp    1166 <getsn+0x46>
cmpl   $0x28,-0x8(%rbp)
jne    1160 <getsn+0x40>
mov    $0x0,%al
call   1040 <getrq@plt>
mov    %eax,-0x4(%rbp)
jmp    1166 <getsn+0x46>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<getsn>:
push   %rax
xor    %eax,%eax
call   1030 <getach@plt>
cmp    $0x28,%eax
jne    1135 <getsn+0x15>
xor    %eax,%eax
pop    %rcx
jmp    1040 <getrq@plt>
pop    %rcx
ret

LLVM IR (-O0):
define i32 @getsn() {
%1 = alloca i32
%2 = alloca i32
%3 = call i32 (...) @getach()
store i32 %3, i32* %2
%4 = icmp eq i32 %3, 0
br i1 %4, label %5, label %6
5: ; preds = %0
store i32 0, i32* %1
br label %13
6: ; preds = %0
%7 = load i32, i32* %2
%8 = icmp eq i32 %7, 40
br i1 %8, label %9, label %11
9: ; preds = %6
%10 = call i32 (...) @getrq()
store i32 %10, i32* %1
br label %13
11: ; preds = %6
%12 = load i32, i32* %2
store i32 %12, i32* %1
br label %13
13: ; preds = %11, %9, %5
%14 = load i32, i32* %1
ret i32 %14
}

LLVM IR (-O2):
define i32 @getsn() {
%1 = tail call i32 (...) @getach()
%2 = icmp eq i32 %1, 40
br i1 %2, label %3, label %5
3: ; preds = %0
%4 = tail call i32 (...) @getrq()
br label %5
5: ; preds = %0, %3
%6 = phi i32 [ %4, %3 ], [ %1, %0 ]
ret i32 %6
}
/* Variables and functions */
long euler(long);
long sumTotient(long lower, long upper) {
  long sum, i;
  sum = 0;
  for (i = lower; i <= upper; i++)
    sum = sum + euler(i);
  return sum;
}


x86 assembly (clang, -O0):
<sumTotient>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x18(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rax
cmp    -0x10(%rbp),%rax
jg     116e <sumTotient+0x5e>
mov    -0x18(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <euler@plt>
mov    %rax,%rcx
mov    -0x28(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    1130 <sumTotient+0x20>
mov    -0x18(%rbp),%rax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sumTotient>:
push   %r15
push   %r14
push   %rbx
cmp    %rsi,%rdi
jle    111f <sumTotient+0xf>
xor    %r15d,%r15d
jmp    1144 <sumTotient+0x34>
mov    %rsi,%r14
mov    %rdi,%rbx
add    $0x1,%r14
xor    %r15d,%r15d
nopl   0x0(%rax)
mov    %rbx,%rdi
call   1030 <euler@plt>
add    %rax,%r15
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1130 <sumTotient+0x20>
mov    %r15,%rax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
define i64 @sumTotient(i64 %0, i64 %1) {
%3 = icmp sgt i64 %0, %1
br i1 %3, label %11, label %4
4: ; preds = %2, %4
%5 = phi i64 [ %9, %4 ], [ %0, %2 ]
%6 = phi i64 [ %8, %4 ], [ 0, %2 ]
%7 = tail call i64 @euler(i64 %5)
%8 = add nsw i64 %7, %6
%9 = add i64 %5, 1
%10 = icmp eq i64 %5, %1
br i1 %10, label %11, label %4
11: ; preds = %4, %2
%12 = phi i64 [ 0, %2 ], [ %8, %4 ]
ret i64 %12
}
/* Variables and functions */
void *memchr(const void *s, int c, size_t count) {
  const unsigned char *p = s;
  while (count--)
    if ((unsigned char)c == *p++)
      return (void *)(p - 1);
  return NULL;
}


x86 assembly (clang, -O0):
<memchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    %esi,-0x14(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,%rcx
add    $0xffffffffffffffff,%rcx
mov    %rcx,-0x20(%rbp)
cmp    $0x0,%rax
je     1166 <memchr+0x66>
mov    -0x14(%rbp),%eax
movzbl %al,%eax
mov    -0x28(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
movzbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1161 <memchr+0x61>
mov    -0x28(%rbp),%rax
add    $0xffffffffffffffff,%rax
mov    %rax,-0x8(%rbp)
jmp    116e <memchr+0x6e>
jmp    1117 <memchr+0x17>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<memchr>:
add    $0xffffffffffffffff,%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
sub    $0x1,%rdx
jb     1124 <memchr+0x24>
lea    0x1(%rdi),%rax
cmp    %sil,0x1(%rdi)
mov    %rax,%rdi
jne    1110 <memchr+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i8* @memchr(i8* %0, i32 %1, i64 %2) {
%4 = trunc i32 %1 to i8
br label %5
5: ; preds = %9, %3
%6 = phi i64 [ %2, %3 ], [ %10, %9 ]
%7 = phi i8* [ %0, %3 ], [ %11, %9 ]
%8 = icmp eq i64 %6, 0
br i1 %8, label %14, label %9
9: ; preds = %5
%10 = add i64 %6, -1
%11 = getelementptr inbounds i8, i8* %7, i64 1
%12 = load i8, i8* %7
%13 = icmp eq i8 %12, %4
br i1 %13, label %14, label %5
14: ; preds = %5, %9
%15 = phi i8* [ %7, %9 ], [ null, %5 ]
ret i8* %15
}
/* Variables and functions */
int /*<<< orphan*/ atof(char *);
int /*<<< orphan*/ wFree(char *);
char *wPopString();
int /*<<< orphan*/ wPushNumber(int /*<<< orphan*/);
void wBasVal() {
  char *string;
  string = wPopString();
  wPushNumber(atof(string));
  wFree(string);
}


x86 assembly (clang, -O0):
<wBasVal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <wPopString@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1050 <wPushNumber@plt>
mov    -0x8(%rbp),%rdi
call   1060 <wFree@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<wBasVal>:
push   %rbx
xor    %eax,%eax
call   1040 <wPopString@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1030 <atof@plt>
mov    %eax,%edi
call   1050 <wPushNumber@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1060 <wFree@plt>

LLVM IR (-O0):
define void @wBasVal() {
%1 = alloca i8*
%2 = call i8* (...) @wPopString()
store i8* %2, i8** %1
%3 = load i8*, i8** %1
%4 = call i32 @atof(i8* %3)
%5 = call i32 @wPushNumber(i32 %4)
%6 = load i8*, i8** %1
%7 = call i32 @wFree(i8* %6)
ret void
}

LLVM IR (-O2):
define void @wBasVal() {
%1 = tail call i8* (...) @wPopString()
%2 = tail call i32 @atof(i8* %1)
%3 = tail call i32 @wPushNumber(i32 %2)
%4 = tail call i32 @wFree(i8* %1)
ret void
}
/* Variables and functions */
int intcmp(int, int);
int intcmp_desc(int v1, int v2) { return intcmp(v1, v2) * -1; }


x86 assembly (clang, -O0):
<intcmp_desc>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x8(%rbp),%esi
call   1030 <intcmp@plt>
imul   $0xffffffff,%eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @intcmp_desc(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 @intcmp(i32 %5, i32 %6)
%8 = mul nsw i32 %7, -1
ret i32 %8
}

LLVM IR (-O2):
define i32 @intcmp_desc(i32 %0, i32 %1) {
%3 = tail call i32 @intcmp(i32 %0, i32 %1)
%4 = sub nsw i32 0, %3
ret i32 %4
}
/* Variables and functions */
void *malloc(size_t);
void *bi_malloc(size_t n) { return malloc(n); }


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

x86 assembly (clang, -O2):
<bi_malloc>:
jmp    1030 <malloc@plt>

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

LLVM IR (-O2):
define noalias i8* @bi_malloc(i64 %0) {
%2 = tail call i8* @malloc(i64 %0)
ret i8* %2
}