xunge/DecIR huggingface dataset:
unsigned JSHash(char *str) {
  unsigned hash = 1315423911;
  while (*str)
    hash ^= ((hash << 5) + (*str++) + (hash >> 2));
  return (hash & 0x7fffffff);
}


x86 assembly (clang, -O0):
<JSHash>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x4e67c6a7,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1149 <JSHash+0x49>
mov    -0xc(%rbp),%eax
shl    $0x5,%eax
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
movsbl (%rcx),%ecx
add    %ecx,%eax
mov    -0xc(%rbp),%ecx
shr    $0x2,%ecx
add    %ecx,%eax
xor    -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
jmp    110f <JSHash+0xf>
mov    -0xc(%rbp),%eax
and    $0x7fffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<JSHash>:
mov    (%rdi),%cl
test   %cl,%cl
je     1134 <JSHash+0x34>
add    $0x1,%rdi
mov    $0x4e67c6a7,%eax
nop
mov    %eax,%edx
mov    %eax,%esi
shl    $0x5,%esi
movsbl %cl,%ecx
shr    $0x2,%eax
add    %esi,%eax
add    %ecx,%eax
xor    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <JSHash+0x10>
and    $0x7fffffff,%eax
ret
mov    $0x4e67c6a7,%eax
ret

LLVM IR (-O0):
define i32 @JSHash(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
store i8* %0, i8** %2
store i32 1315423911, 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 %21
8: ; preds = %4
%9 = load i32, i32* %3
%10 = shl i32 %9, 5
%11 = load i8*, i8** %2
%12 = getelementptr inbounds i8, i8* %11, i32 1
store i8* %12, i8** %2
%13 = load i8, i8* %11
%14 = sext i8 %13 to i32
%15 = add i32 %10, %14
%16 = load i32, i32* %3
%17 = lshr i32 %16, 2
%18 = add i32 %15, %17
%19 = load i32, i32* %3
%20 = xor i32 %19, %18
store i32 %20, i32* %3
br label %4
21: ; preds = %4
%22 = load i32, i32* %3
%23 = and i32 %22, 2147483647
ret i32 %23
}

LLVM IR (-O2):
define i32 @JSHash(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %19, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %15, %4 ], [ %2, %1 ]
%6 = phi i32 [ %14, %4 ], [ 1315423911, %1 ]
%7 = phi i8* [ %9, %4 ], [ %0, %1 ]
%8 = shl i32 %6, 5
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = sext i8 %5 to i32
%11 = lshr i32 %6, 2
%12 = add i32 %11, %8
%13 = add i32 %12, %10
%14 = xor i32 %13, %6
%15 = load i8, i8* %9
%16 = icmp eq i8 %15, 0
br i1 %16, label %17, label %4
17: ; preds = %4
%18 = and i32 %14, 2147483647
br label %19
19: ; preds = %17, %1
%20 = phi i32 [ 1315423911, %1 ], [ %18, %17 ]
ret i32 %20
}
int islower(int ch) {
  if (ch >= 0x61 && ch <= 0x7A)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<islower>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     1127 <islower+0x27>
cmpl   $0x7a,-0x8(%rbp)
jg     1127 <islower+0x27>
movl   $0x1,-0x4(%rbp)
jmp    112e <islower+0x2e>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<islower>:
add    $0xffffff9f,%edi
xor    %eax,%eax
cmp    $0x1a,%edi
setb   %al
ret

LLVM IR (-O0):
define i32 @islower(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %10
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %10
9: ; preds = %6
store i32 1, i32* %2
br label %11
10: ; preds = %6, %1
store i32 0, i32* %2
br label %11
11: ; preds = %10, %9
%12 = load i32, i32* %2
ret i32 %12
}

LLVM IR (-O2):
define i32 @islower(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = zext i1 %3 to i32
ret i32 %4
}
void array_test_fail(int *a, int n) { a[-1] = 0; }


x86 assembly (clang, -O0):
<array_test_fail>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movl   $0x0,-0x4(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<array_test_fail>:
movl   $0x0,-0x4(%rdi)
ret

LLVM IR (-O0):
define void @array_test_fail(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 = getelementptr inbounds i32, i32* %5, i64 -1
store i32 0, i32* %6
ret void
}

LLVM IR (-O2):
define void @array_test_fail(i32* nocapture writeonly %0, i32 %1) {
%3 = getelementptr inbounds i32, i32* %0, i64 -1
store i32 0, i32* %3
ret void
}
/* Variables and functions */
scalar_t__ get_interval(double *, int const, double);
int test1() {
  const int nt = 4;
  double t[] = {0.0, 1.0, 2.0, 3.0};
  double treq = 0.5;
  int i = -2;
  i = (int)get_interval(t, nt, treq);
  return (i == 0);
}


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
movl   $0x4,-0x4(%rbp)
mov    0xeea(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xee7(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xee4(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xee1(%rip),%rax
mov    %rax,-0x18(%rbp)
movsd  0xead(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
movl   $0xfffffffe,-0x3c(%rbp)
lea    -0x30(%rbp),%rdi
movsd  -0x38(%rbp),%xmm0
mov    $0x4,%esi
call   1030 <get_interval@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
sub    $0x28,%rsp
movaps 0xf05(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xee9(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    %rsp,%rdi
movsd  0xeca(%rip),%xmm0
mov    $0x4,%esi
call   1030 <get_interval@plt>
xor    %ecx,%ecx
test   %eax,%eax
sete   %cl
mov    %ecx,%eax
add    $0x28,%rsp
ret

LLVM IR (-O0):
@__const.test1.t = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00]
define i32 @test1() {
%1 = alloca i32
%2 = alloca [4 x double]
%3 = alloca double
%4 = alloca i32
store i32 4, i32* %1
%5 = bitcast [4 x double]* %2 to i8*
store double 5.000000e-01, double* %3
store i32 -2, i32* %4
%6 = getelementptr inbounds [4 x double], [4 x double]* %2, i64 0, i64 0
%7 = load double, double* %3
%8 = call i64 @get_interval(double* %6, i32 4, double %7)
%9 = trunc i64 %8 to i32
store i32 %9, i32* %4
%10 = load i32, i32* %4
%11 = icmp eq i32 %10, 0
%12 = zext i1 %11 to i32
ret i32 %12
}

LLVM IR (-O2):
@__const.test1.t = [4 x double] [double 0.000000e+00, double 1.000000e+00, double 2.000000e+00, double 3.000000e+00]
define i32 @test1() {
%1 = alloca [4 x double]
%2 = bitcast [4 x double]* %1 to i8*
%3 = getelementptr inbounds [4 x double], [4 x double]* %1, i64 0, i64 0
%4 = call i64 @get_interval(double* %3, i32 4, double 5.000000e-01)
%5 = trunc i64 %4 to i32
%6 = icmp eq i32 %5, 0
%7 = zext i1 %6 to i32
ret i32 %7
}
/* Variables and functions */
unsigned long strtoul(char const *, int /*<<< orphan*/ *, int);
size_t IcsStrToSize(char const *str) {
  unsigned long ulsize;
  size_t size;
  ulsize = strtoul(str, NULL, 10);
  size = (size_t)ulsize;
  return size;
}


x86 assembly (clang, -O0):
<IcsStrToSize>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
mov    $0xa,%edx
call   1030 <strtoul@plt>
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<IcsStrToSize>:
xor    %esi,%esi
mov    $0xa,%edx
jmp    1030 <strtoul@plt>

LLVM IR (-O0):
define i64 @IcsStrToSize(i8* %0) {
%2 = alloca i8*
%3 = alloca i64
%4 = alloca i64
store i8* %0, i8** %2
%5 = load i8*, i8** %2
%6 = call i64 @strtoul(i8* %5, i32* null, i32 10)
store i64 %6, i64* %3
%7 = load i64, i64* %3
store i64 %7, i64* %4
%8 = load i64, i64* %4
ret i64 %8
}

LLVM IR (-O2):
define i64 @IcsStrToSize(i8* nocapture %0) {
%2 = tail call i64 @strtoul(i8* nocapture %0, i32* null, i32 10)
ret i64 %2
}
/* Variables and functions */
unsigned int mk_rnd_ipv4(int);
unsigned int mk_rnd_south_american_ipv4(void) { return mk_rnd_ipv4(200); }


x86 assembly (clang, -O0):
<mk_rnd_south_american_ipv4>:
push   %rbp
mov    %rsp,%rbp
mov    $0xc8,%edi
call   1030 <mk_rnd_ipv4@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<mk_rnd_south_american_ipv4>:
mov    $0xc8,%edi
jmp    1030 <mk_rnd_ipv4@plt>

LLVM IR (-O0):
define i32 @mk_rnd_south_american_ipv4() {
%1 = call i32 @mk_rnd_ipv4(i32 200)
ret i32 %1
}

LLVM IR (-O2):
define i32 @mk_rnd_south_american_ipv4() {
%1 = tail call i32 @mk_rnd_ipv4(i32 200)
ret i32 %1
}
/* Variables and functions */
int /*<<< orphan*/ putchar(int);
main() {
  int i = 65;
  char c;
  c = i++;
  i = c;
  putchar(i);
}


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

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 65, i32* %1
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = trunc i32 %3 to i8
store i8 %5, i8* %2
%6 = load i8, i8* %2
%7 = sext i8 %6 to i32
store i32 %7, i32* %1
%8 = load i32, i32* %1
%9 = call i32 @putchar(i32 %8)
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 @putchar(i32 65)
ret i32 0
}
/* Variables and functions */
int write_block(int, int, int, int /*<<< orphan*/);
int motor1(int direction, int speed) {
  return write_block(111, direction, speed, 0);
}


x86 assembly (clang, -O0):
<motor1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%esi
mov    -0x8(%rbp),%edx
mov    $0x6f,%edi
xor    %ecx,%ecx
call   1030 <write_block@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<motor1>:
mov    %esi,%edx
mov    %edi,%esi
mov    $0x6f,%edi
xor    %ecx,%ecx
jmp    1030 <write_block@plt>

LLVM IR (-O0):
define i32 @motor1(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 @write_block(i32 111, i32 %5, i32 %6, i32 0)
ret i32 %7
}

LLVM IR (-O2):
define i32 @motor1(i32 %0, i32 %1) {
%3 = tail call i32 @write_block(i32 111, i32 %0, i32 %1, i32 0)
ret i32 %3
}
int ehnlc_toupper(int c) {
  if (c >= 'a' && c <= 'z') {
    return 'A' + (c - 'a');
  }
  return c;
}


x86 assembly (clang, -O0):
<ehnlc_toupper>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x61,-0x8(%rbp)
jl     112c <ehnlc_toupper+0x2c>
cmpl   $0x7a,-0x8(%rbp)
jg     112c <ehnlc_toupper+0x2c>
mov    -0x8(%rbp),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %eax,-0x4(%rbp)
jmp    1132 <ehnlc_toupper+0x32>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<ehnlc_toupper>:
lea    -0x61(%rdi),%ecx
lea    -0x20(%rdi),%eax
cmp    $0x1a,%ecx
cmovae %edi,%eax
ret

LLVM IR (-O0):
define i32 @ehnlc_toupper(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sge i32 %4, 97
br i1 %5, label %6, label %13
6: ; preds = %1
%7 = load i32, i32* %3
%8 = icmp sle i32 %7, 122
br i1 %8, label %9, label %13
9: ; preds = %6
%10 = load i32, i32* %3
%11 = sub nsw i32 %10, 97
%12 = add nsw i32 65, %11
store i32 %12, i32* %2
br label %15
13: ; preds = %6, %1
%14 = load i32, i32* %3
store i32 %14, i32* %2
br label %15
15: ; preds = %13, %9
%16 = load i32, i32* %2
ret i32 %16
}

LLVM IR (-O2):
define i32 @ehnlc_toupper(i32 %0) {
%2 = add i32 %0, -97
%3 = icmp ult i32 %2, 26
%4 = add nsw i32 %0, -32
%5 = select i1 %3, i32 %4, i32 %0
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ int64_t;

/* Variables and functions */
char *strn(int /*<<< orphan*/, int);
char *str(int64_t k) { return strn(k, 1); }


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

x86 assembly (clang, -O2):
<str>:
mov    $0x1,%esi
jmp    1030 <strn@plt>

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

LLVM IR (-O2):
define i8* @str(i32 %0) {
%2 = tail call i8* @strn(i32 %0, i32 1)
ret i8* %2
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, char *, int /*<<< orphan*/, int, int);
void version(char *name) { printf("%s version %d.%d.%d\n", name, 0, 4, 6); }


x86 assembly (clang, -O0):
<version>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xed9(%rip),%rdi
xor    %edx,%edx
mov    $0x4,%ecx
mov    $0x6,%r8d
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<version>:
mov    %rdi,%rsi
lea    0xee6(%rip),%rdi
xor    %edx,%edx
mov    $0x4,%ecx
mov    $0x6,%r8d
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %3, i32 0, i32 4, i32 6)
ret void
}

LLVM IR (-O2):
@.str = [21 x i8] c"%s version %d.%d.%d\0A\00"
define void @version(i8* %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), i8* %0, i32 0, i32 4, i32 6)
ret void
}
int Fib1(int n, int *counter) {
  (*counter)++;
  if (n < 2) {
    return n;
  } else {
    return Fib1(n - 1, counter) + Fib1(n - 2, counter);
  }
}


x86 assembly (clang, -O0):
<Fib1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%ecx
add    $0x1,%ecx
mov    %ecx,(%rax)
cmpl   $0x2,-0x8(%rbp)
jge    113f <Fib1+0x2f>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    116a <Fib1+0x5a>
mov    -0x8(%rbp),%edi
sub    $0x1,%edi
mov    -0x10(%rbp),%rsi
call   1030 <Fib1@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%edi
sub    $0x2,%edi
mov    -0x10(%rbp),%rsi
call   1030 <Fib1@plt>
mov    %eax,%ecx
mov    -0x14(%rbp),%eax
add    %ecx,%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Fib1>:
push   %rbp
push   %r14
push   %rbx
addl   $0x1,(%rsi)
mov    %edi,%ebx
xor    %ebp,%ebp
cmp    $0x2,%edi
jge    1124 <Fib1+0x14>
mov    %ebx,%ecx
jmp    114b <Fib1+0x3b>
mov    %rsi,%r14
xor    %ebp,%ebp
nopl   0x0(%rax)
lea    -0x1(%rbx),%edi
mov    %r14,%rsi
call   1030 <Fib1@plt>
lea    -0x2(%rbx),%ecx
add    %eax,%ebp
addl   $0x1,(%r14)
cmp    $0x3,%ebx
mov    %ecx,%ebx
ja     1130 <Fib1+0x20>
add    %ecx,%ebp
mov    %ebp,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @Fib1(i32 %0, i32* %1) {
%3 = load i32, i32* %1
%4 = add nsw i32 %3, 1
store i32 %4, i32* %1
%5 = icmp slt i32 %0, 2
br i1 %5, label %16, label %6
6: ; preds = %2, %6
%7 = phi i32 [ %11, %6 ], [ %0, %2 ]
%8 = phi i32 [ %12, %6 ], [ 0, %2 ]
%9 = add nsw i32 %7, -1
%10 = tail call i32 @Fib1(i32 %9, i32* %1)
%11 = add nsw i32 %7, -2
%12 = add nsw i32 %10, %8
%13 = load i32, i32* %1
%14 = add nsw i32 %13, 1
store i32 %14, i32* %1
%15 = icmp ult i32 %7, 4
br i1 %15, label %16, label %6
16: ; preds = %6, %2
%17 = phi i32 [ 0, %2 ], [ %12, %6 ]
%18 = phi i32 [ %0, %2 ], [ %11, %6 ]
%19 = add nsw i32 %18, %17
ret i32 %19
}
void initOut(double y[494]) {
  int i;
  for (i = 0; i < 494; i++) {
    y[i] = 0;
  }
}


x86 assembly (clang, -O0):
<initOut>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x1ee,-0xc(%rbp)
jge    113a <initOut+0x3a>
mov    -0x8(%rbp),%rax
movslq -0xc(%rbp),%rcx
xorps  %xmm0,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    110f <initOut+0xf>
pop    %rbp
ret

x86 assembly (clang, -O2):
<initOut>:
push   %rax
mov    $0xf70,%edx
xor    %esi,%esi
call   1030 <memset@plt>
pop    %rax
ret

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

LLVM IR (-O2):
define void @initOut(double* nocapture writeonly %0) {
%2 = bitcast double* %0 to i8*
ret void
}
void T32_INT1_IRQHandler(void) {
  while (1) {
  }
}


x86 assembly (clang, -O0):
<T32_INT1_IRQHandler>:
push   %rbp
mov    %rsp,%rbp
jmp    1109 <T32_INT1_IRQHandler+0x9>
jmp    1109 <T32_INT1_IRQHandler+0x9>

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

LLVM IR (-O0):
define void @T32_INT1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}

LLVM IR (-O2):
define void @T32_INT1_IRQHandler() {
br label %1
1: ; preds = %0, %1
br label %1
}
/* Variables and functions */
int core9_safe(char const *);
int U_EMRCHORD_safe(const char *record) { return (core9_safe(record)); }


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

x86 assembly (clang, -O2):
<U_EMRCHORD_safe>:
jmp    1030 <core9_safe@plt>

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

LLVM IR (-O2):
define i32 @U_EMRCHORD_safe(i8* %0) {
%2 = tail call i32 @core9_safe(i8* %0)
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ dcl_ac(char);
int /*<<< orphan*/ dcl_ad(double);
int /*<<< orphan*/ dcl_af(float);
int /*<<< orphan*/ dcl_ai(int);
int /*<<< orphan*/ dcl_all(long long);
int /*<<< orphan*/ dcl_ap(void *);
int /*<<< orphan*/ dcl_as(short);
int /*<<< orphan*/ dcl_av();
void test_1(void) {
  dcl_av();
  dcl_ac((char)1);
  dcl_as((short)2);
  dcl_ai((int)3);
  dcl_all((long long)4);
  dcl_af((float)5);
  dcl_ad((double)6);
  dcl_ap((void *)0);
}


x86 assembly (clang, -O0):
<test_1>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1070 <dcl_av@plt>
mov    $0x1,%edi
call   1090 <dcl_ac@plt>
mov    $0x2,%edi
call   1080 <dcl_as@plt>
mov    $0x3,%edi
call   10a0 <dcl_ai@plt>
mov    $0x4,%edi
call   1030 <dcl_all@plt>
movss  0xe4d(%rip),%xmm0
call   1040 <dcl_af@plt>
movsd  0xe38(%rip),%xmm0
call   1050 <dcl_ad@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1060 <dcl_ap@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_1>:
push   %rax
xor    %eax,%eax
call   1070 <dcl_av@plt>
mov    $0x1,%edi
call   1090 <dcl_ac@plt>
mov    $0x2,%edi
call   1080 <dcl_as@plt>
mov    $0x3,%edi
call   10a0 <dcl_ai@plt>
mov    $0x4,%edi
call   1030 <dcl_all@plt>
movss  0xe48(%rip),%xmm0
call   1040 <dcl_af@plt>
movsd  0xe43(%rip),%xmm0
call   1050 <dcl_ad@plt>
xor    %edi,%edi
pop    %rax
jmp    1060 <dcl_ap@plt>

LLVM IR (-O0):
define void @test_1() {
%1 = call i32 (...) @dcl_av()
%2 = call i32 @dcl_ac(i8 signext 1)
%3 = call i32 @dcl_as(i16 signext 2)
%4 = call i32 @dcl_ai(i32 3)
%5 = call i32 @dcl_all(i64 4)
%6 = call i32 @dcl_af(float 5.000000e+00)
%7 = call i32 @dcl_ad(double 6.000000e+00)
%8 = call i32 @dcl_ap(i8* null)
ret void
}

LLVM IR (-O2):
define void @test_1() {
%1 = tail call i32 (...) @dcl_av()
%2 = tail call i32 @dcl_ac(i8 signext 1)
%3 = tail call i32 @dcl_as(i16 signext 2)
%4 = tail call i32 @dcl_ai(i32 3)
%5 = tail call i32 @dcl_all(i64 4)
%6 = tail call i32 @dcl_af(float 5.000000e+00)
%7 = tail call i32 @dcl_ad(double 6.000000e+00)
%8 = tail call i32 @dcl_ap(i8* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
int main(void) {
  char ch;
  printf("Please entrt a character.\n");
  scanf("%c", &ch);
  printf("The code for %c is %d.\n", ch, ch);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
lea    -0x5(%rbp),%rsi
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%esi
movsbl -0x5(%rbp),%edx
lea    0xec2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee3(%rip),%rdi
call   1030 <puts@plt>
lea    0xebc(%rip),%rdi
lea    0x7(%rsp),%rsi
call   1050 <scanf@plt>
movsbl 0x7(%rsp),%edx
lea    0xea9(%rip),%rdi
mov    %edx,%esi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [27 x i8] c"Please entrt a character.\0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [24 x i8] c"The code for %c is %d.\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
store i32 0, i32* %1
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = sext i8 %5 to i32
%7 = load i8, i8* %2
%8 = sext i8 %7 to i32
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %6, i32 %8)
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [24 x i8] c"The code for %c is %d.\0A\00"
@str = [26 x i8] c"Please entrt a character.\00"
define i32 @main() {
%1 = alloca i8
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str, i64 0, i64 0))
%3 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%4 = load i8, i8* %1
%5 = sext i8 %4 to i32
%6 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.2, i64 0, i64 0), i32 %5, i32 %5)
ret i32 0
}
int reverse(int x) {
  long new = 0;
  while (x != 0) {
    new = new * 10 + (x % 10);
    x /= 10;
  }
  if (new > 1024 * 1024 * 1024 * 2 - 1 || new < -1024 * 1024 * 1024 * 2)
    return 0;
  return (int)new;
}


x86 assembly (clang, -O0):
<reverse>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x8(%rbp)
je     114e <reverse+0x4e>
imul   $0xa,-0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    -0x18(%rbp),%rax
movslq %edx,%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8(%rbp)
jmp    110f <reverse+0xf>
cmpq   $0x7fffffff,-0x10(%rbp)
7f
jg     116a <reverse+0x6a>
cmpq   $0xffffffff80000000,-0x10(%rbp)
80
jge    1176 <reverse+0x76>
movl   $0x0,-0x4(%rbp)
jmp    117d <reverse+0x7d>
mov    -0x10(%rbp),%rax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<reverse>:
xor    %r8d,%r8d
xor    %edx,%edx
test   %edi,%edi
je     1144 <reverse+0x44>
nopl   0x0(%rax)
lea    (%rdx,%rdx,4),%rax
movslq %edi,%rsi
imul   $0x66666667,%rsi,%rdi
mov    %rdi,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rdi
add    %edx,%edi
lea    (%rdi,%rdi,1),%edx
lea    (%rdx,%rdx,4),%edx
mov    %esi,%ecx
sub    %edx,%ecx
movslq %ecx,%rcx
lea    (%rcx,%rax,2),%rdx
add    $0x9,%esi
cmp    $0x12,%esi
ja     1110 <reverse+0x10>
movslq %edx,%rax
cmp    %rdx,%rax
cmovne %r8d,%eax
ret

LLVM IR (-O0):
define i32 @reverse(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i64
store i32 %0, i32* %3
store i64 0, i64* %4
br label %5
5: ; preds = %8, %1
%6 = load i32, i32* %3
%7 = icmp ne i32 %6, 0
br i1 %7, label %8, label %17
8: ; preds = %5
%9 = load i64, i64* %4
%10 = mul nsw i64 %9, 10
%11 = load i32, i32* %3
%12 = srem i32 %11, 10
%13 = sext i32 %12 to i64
%14 = add nsw i64 %10, %13
store i64 %14, i64* %4
%15 = load i32, i32* %3
%16 = sdiv i32 %15, 10
store i32 %16, i32* %3
br label %5
17: ; preds = %5
%18 = load i64, i64* %4
%19 = icmp sgt i64 %18, 2147483647
br i1 %19, label %23, label %20
20: ; preds = %17
%21 = load i64, i64* %4
%22 = icmp slt i64 %21, -2147483648
br i1 %22, label %23, label %24
23: ; preds = %20, %17
store i32 0, i32* %2
br label %27
24: ; preds = %20
%25 = load i64, i64* %4
%26 = trunc i64 %25 to i32
store i32 %26, i32* %2
br label %27
27: ; preds = %24, %23
%28 = load i32, i32* %2
ret i32 %28
}

LLVM IR (-O2):
define i32 @reverse(i32 %0) {
%2 = icmp eq i32 %0, 0
br i1 %2, label %13, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %9, %3 ], [ 0, %1 ]
%5 = phi i32 [ %10, %3 ], [ %0, %1 ]
%6 = mul nsw i64 %4, 10
%7 = srem i32 %5, 10
%8 = sext i32 %7 to i64
%9 = add nsw i64 %6, %8
%10 = sdiv i32 %5, 10
%11 = add i32 %5, 9
%12 = icmp ult i32 %11, 19
br i1 %12, label %13, label %3
13: ; preds = %3, %1
%14 = phi i64 [ 0, %1 ], [ %9, %3 ]
%15 = add i64 %14, -2147483648
%16 = icmp ult i64 %15, -4294967296
%17 = trunc i64 %14 to i32
%18 = select i1 %16, i32 0, i32 %17
ret i32 %18
}
int test_isNotEqual(int x, int y) { return x != y; }


x86 assembly (clang, -O0):
<test_isNotEqual>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
setne  %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_isNotEqual>:
xor    %eax,%eax
cmp    %esi,%edi
setne  %al
ret

LLVM IR (-O0):
define i32 @test_isNotEqual(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 = icmp ne i32 %5, %6
%8 = zext i1 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @test_isNotEqual(i32 %0, i32 %1) {
%3 = icmp ne i32 %0, %1
%4 = zext i1 %3 to i32
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ mlVectorCopy(float *, float *);
int /*<<< orphan*/ mlVectorMultMatrixTo(float *, float const *, float *);
void mlVectorMultMatrix(float *a, const float *b) {
  float result[3];
  mlVectorMultMatrixTo(a, b, result);
  mlVectorCopy(result, a);
}


x86 assembly (clang, -O0):
<mlVectorMultMatrix>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
lea    -0x1c(%rbp),%rdx
call   1030 <mlVectorMultMatrixTo@plt>
lea    -0x1c(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <mlVectorCopy@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<mlVectorMultMatrix>:
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
lea    0xc(%rsp),%r14
mov    %r14,%rdx
call   1030 <mlVectorMultMatrixTo@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
call   1040 <mlVectorCopy@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define void @mlVectorMultMatrix(float* %0, float* %1) {
%3 = alloca float*
%4 = alloca float*
%5 = alloca [3 x float]
store float* %0, float** %3
store float* %1, float** %4
%6 = load float*, float** %3
%7 = load float*, float** %4
%8 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%9 = call i32 @mlVectorMultMatrixTo(float* %6, float* %7, float* %8)
%10 = getelementptr inbounds [3 x float], [3 x float]* %5, i64 0, i64 0
%11 = load float*, float** %3
%12 = call i32 @mlVectorCopy(float* %10, float* %11)
ret void
}

LLVM IR (-O2):
define void @mlVectorMultMatrix(float* %0, float* %1) {
%3 = alloca [3 x float]
%4 = bitcast [3 x float]* %3 to i8*
%5 = getelementptr inbounds [3 x float], [3 x float]* %3, i64 0, i64 0
%6 = call i32 @mlVectorMultMatrixTo(float* %0, float* %1, float* %5)
%7 = call i32 @mlVectorCopy(float* %5, float* %0)
ret void
}
int security_task_setgroups(struct group_info *group_info) { return 0; }


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

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

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

LLVM IR (-O2):
%struct.group_info = type opaque
define i32 @security_task_setgroups(%struct.group_info* nocapture readnone %0) {
ret i32 0
}
void _TFC4Blog8Categoryg10identifierSS() {}


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

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

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

LLVM IR (-O2):
define void @_TFC4Blog8Categoryg10identifierSS() {
ret void
}
int main() {
  int i = 13;
  int result = 10;
  switch (i) {
  case 0:
    result = 5;
    break;
  case 1:
    result = 8;
    break;
  case 2:
    result = 9;
    break;
  case 3:
    result = 2;
    break;
  default:
    result = 13;
  }
  return result;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
movl   $0x0,-0x4(%rbp)
movl   $0xd,-0x8(%rbp)
movl   $0xa,-0xc(%rbp)
mov    -0x8(%rbp),%eax
mov    %rax,-0x18(%rbp)
sub    $0x3,%rax
ja     116e <main+0x6e>
mov    -0x18(%rbp),%rax
lea    0xecb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0x5,-0xc(%rbp)
jmp    1175 <main+0x75>
movl   $0x8,-0xc(%rbp)
jmp    1175 <main+0x75>
movl   $0x9,-0xc(%rbp)
jmp    1175 <main+0x75>
movl   $0x2,-0xc(%rbp)
jmp    1175 <main+0x75>
movl   $0xd,-0xc(%rbp)
mov    -0xc(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
store i32 0, i32* %1
store i32 13, i32* %2
store i32 10, i32* %3
%4 = load i32, i32* %2
switch i32 %4, label %9 [
i32 0, label %5
i32 1, label %6
i32 2, label %7
i32 3, label %8
]
5: ; preds = %0
store i32 5, i32* %3
br label %10
6: ; preds = %0
store i32 8, i32* %3
br label %10
7: ; preds = %0
store i32 9, i32* %3
br label %10
8: ; preds = %0
store i32 2, i32* %3
br label %10
9: ; preds = %0
store i32 13, i32* %3
br label %10
10: ; preds = %9, %8, %7, %6, %5
%11 = load i32, i32* %3
ret i32 %11
}

LLVM IR (-O2):
define i32 @main() {
ret i32 13
}
int test_imm_A5int8_mem(signed char *val) {
  return ((*val) & (-0xA5 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_A5int8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = and i32 %3, -165
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i32 -40, i32 -20
ret i32 %6
}
/* Variables and functions */
int /*<<< orphan*/ term_putchar(char);
int putchar(int ic) {
  char c = (char)ic;
  term_putchar(c);
  return c;
}


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)
movsbl -0x5(%rbp),%edi
call   1030 <term_putchar@plt>
movsbl -0x5(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<putchar>:
push   %rbx
movsbl %dil,%ebx
mov    %ebx,%edi
call   1030 <term_putchar@plt>
mov    %ebx,%eax
pop    %rbx
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 = load i8, i8* %3
%7 = call i32 @term_putchar(i8 signext %6)
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
ret i32 %9
}

LLVM IR (-O2):
define i32 @putchar(i32 %0) {
%2 = trunc i32 %0 to i8
%3 = tail call i32 @term_putchar(i8 signext %2)
%4 = shl i32 %0, 24
%5 = ashr exact i32 %4, 24
ret i32 %5
}
/* Type definitions */
typedef int /*<<< orphan*/ mode_t;

/* Variables and functions */
int chmod(char const *, int /*<<< orphan*/);
__attribute__((__weak__, __always___)) int softboundcets_chmod(const char *path,
                                                               mode_t mode) {
  return chmod(path, mode);
}


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

x86 assembly (clang, -O2):
<softboundcets_chmod>:
jmp    1030 <chmod@plt>

LLVM IR (-O0):
define weak i32 @softboundcets_chmod(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 @chmod(i8* %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define weak i32 @softboundcets_chmod(i8* %0, i32 %1) {
%3 = tail call i32 @chmod(i8* %0, i32 %1)
ret i32 %3
}
double jac_pendulum_sq(double x) { return x * x; }


x86 assembly (clang, -O0):
<jac_pendulum_sq>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<jac_pendulum_sq>:
mulsd  %xmm0,%xmm0
ret

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

LLVM IR (-O2):
define double @jac_pendulum_sq(double %0) {
%2 = fmul double %0, %0
ret double %2
}
/* Variables and functions */
int /*<<< orphan*/ EINVAL;
int /*<<< orphan*/ errno;
int kill(int pid, int sig) {
  errno = EINVAL;
  return -1;
}


x86 assembly (clang, -O0):
<kill>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    0x2ec7(%rip),%rax
mov    (%rax),%ecx
mov    0x2ec6(%rip),%rax
mov    %ecx,(%rax)
mov    $0xffffffff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<kill>:
mov    0x2ed1(%rip),%rax
mov    (%rax),%eax
mov    0x2ed0(%rip),%rcx
mov    %eax,(%rcx)
mov    $0xffffffff,%eax
ret

LLVM IR (-O0):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%5 = load i32, i32* @EINVAL
store i32 %5, i32* @errno
ret i32 -1
}

LLVM IR (-O2):
@EINVAL = global i32 0
@errno = global i32 0
define i32 @kill(i32 %0, i32 %1) {
%3 = load i32, i32* @EINVAL
store i32 %3, i32* @errno
ret i32 -1
}
/* Variables and functions */
int /*<<< orphan*/ hwtimer_adjust_rt_ratio(double);
void native_rtc_adjust_clock(double clock_correction) {
  hwtimer_adjust_rt_ratio(clock_correction);
}


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

x86 assembly (clang, -O2):
<native_rtc_adjust_clock>:
jmp    1030 <hwtimer_adjust_rt_ratio@plt>

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

LLVM IR (-O2):
define void @native_rtc_adjust_clock(double %0) {
%2 = tail call i32 @hwtimer_adjust_rt_ratio(double %0)
ret void
}
/* Type definitions */
struct xdg_popup {
  int dummy;
};
struct wl_proxy {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ wl_proxy_set_user_data(struct wl_proxy *, void *);
void xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data) {
  wl_proxy_set_user_data((struct wl_proxy *)xdg_popup, user_data);
}


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

x86 assembly (clang, -O2):
<xdg_popup_set_user_data>:
jmp    1030 <wl_proxy_set_user_data@plt>

LLVM IR (-O0):
%struct.xdg_popup = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_popup_set_user_data(%struct.xdg_popup* %0, i8* %1) {
%3 = alloca %struct.xdg_popup*
%4 = alloca i8*
store %struct.xdg_popup* %0, %struct.xdg_popup** %3
store i8* %1, i8** %4
%5 = load %struct.xdg_popup*, %struct.xdg_popup** %3
%6 = bitcast %struct.xdg_popup* %5 to %struct.wl_proxy*
%7 = load i8*, i8** %4
%8 = call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %6, i8* %7)
ret void
}

LLVM IR (-O2):
%struct.xdg_popup = type { i32 }
%struct.wl_proxy = type { i32 }
define void @xdg_popup_set_user_data(%struct.xdg_popup* %0, i8* %1) {
%3 = bitcast %struct.xdg_popup* %0 to %struct.wl_proxy*
%4 = tail call i32 @wl_proxy_set_user_data(%struct.wl_proxy* %3, i8* %1)
ret void
}
int itemcount(char *s) {
  int cnt = 1;
  int pos = 0;
  while (s[pos] != '\0')
    if (s[pos++] == ',')
      cnt++;
  return cnt;
}


x86 assembly (clang, -O0):
<itemcount>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1158 <itemcount+0x58>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x10(%rbp)
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2c,%eax
jne    1153 <itemcount+0x53>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1116 <itemcount+0x16>
mov    -0xc(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<itemcount>:
mov    (%rdi),%cl
test   %cl,%cl
je     1126 <itemcount+0x26>
add    $0x1,%rdi
mov    $0x1,%eax
nop
xor    %edx,%edx
cmp    $0x2c,%cl
sete   %dl
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <itemcount+0x10>
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @itemcount(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %15, label %4
4: ; preds = %1, %4
%5 = phi i64 [ %8, %4 ], [ 0, %1 ]
%6 = phi i8 [ %13, %4 ], [ %2, %1 ]
%7 = phi i32 [ %11, %4 ], [ 1, %1 ]
%8 = add nuw nsw i64 %5, 1
%9 = icmp eq i8 %6, 44
%10 = zext i1 %9 to i32
%11 = add nuw nsw i32 %7, %10
%12 = getelementptr inbounds i8, i8* %0, i64 %8
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %4
15: ; preds = %4, %1
%16 = phi i32 [ 1, %1 ], [ %11, %4 ]
ret i32 %16
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_memblockq_rewind() {
  printf("NOT IMPLEMENTED:"
         "pa_memblockq_rewind"
         "\n");
}


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

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

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

LLVM IR (-O2):
@str = [36 x i8] c"NOT IMPLEMENTED:pa_memblockq_rewind\00"
define i32 @pa_memblockq_rewind() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
/* Type definitions */
typedef int /*<<< orphan*/ __m64;

/* Variables and functions */
int /*<<< orphan*/ _mm_packs_pi16(int /*<<< orphan*/, int /*<<< orphan*/);
__m64 test_mm_packs_pi16(__m64 a, __m64 b) { return _mm_packs_pi16(a, b); }


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

x86 assembly (clang, -O2):
<test_mm_packs_pi16>:
jmp    1030 <_mm_packs_pi16@plt>

LLVM IR (-O0):
define i32 @test_mm_packs_pi16(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 @_mm_packs_pi16(i32 %5, i32 %6)
ret i32 %7
}

LLVM IR (-O2):
define i32 @test_mm_packs_pi16(i32 %0, i32 %1) {
%3 = tail call i32 @_mm_packs_pi16(i32 %0, i32 %1)
ret i32 %3
}
void Cyc_BansheeIf_register_toplevel_cvar(void *cvar) { ; }


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

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

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

LLVM IR (-O2):
define void @Cyc_BansheeIf_register_toplevel_cvar(i8* nocapture %0) {
ret void
}
/* Variables and functions */
char *malloc(scalar_t__);
int /*<<< orphan*/ strcpy(char *, char const *);
scalar_t__ strlen(char const *);
char *_strdup(const char *s) {
  char *d = malloc(strlen(s) + 1);
  if (d == NULL)
    return NULL;
  strcpy(d, s);
  return d;
}


x86 assembly (clang, -O0):
<_strdup>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %rax,%rdi
add    $0x1,%rdi
call   1050 <malloc@plt>
mov    %rax,-0x18(%rbp)
cmpq   $0x0,-0x18(%rbp)
jne    116d <_strdup+0x3d>
movq   $0x0,-0x8(%rbp)
jmp    1182 <_strdup+0x52>
mov    -0x18(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcpy@plt>
mov    -0x18(%rbp),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define i8* @_strdup(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = call i64 @strlen(i8* %5)
%7 = add nsw i64 %6, 1
%8 = call i8* @malloc(i64 %7)
store i8* %8, i8** %4
%9 = load i8*, i8** %4
%10 = icmp eq i8* %9, null
br i1 %10, label %11, label %12
11: ; preds = %1
store i8* null, i8** %2
br label %17
12: ; preds = %1
%13 = load i8*, i8** %4
%14 = load i8*, i8** %3
%15 = call i32 @strcpy(i8* %13, i8* %14)
%16 = load i8*, i8** %4
store i8* %16, i8** %2
br label %17
17: ; preds = %12, %11
%18 = load i8*, i8** %2
ret i8* %18
}

LLVM IR (-O2):
define i8* @_strdup(i8* %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = add nsw i64 %2, 1
%4 = tail call i8* @malloc(i64 %3)
%5 = icmp eq i8* %4, null
br i1 %5, label %8, label %6
6: ; preds = %1
%7 = tail call i32 @strcpy(i8* %4, i8* %0)
br label %8
8: ; preds = %1, %6
ret i8* %4
}
/* Type definitions */
struct SN_env {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ SN_close_env(struct SN_env *);
extern void portuguese_UTF_8_close_env(struct SN_env *z) { SN_close_env(z); }


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

x86 assembly (clang, -O2):
<portuguese_UTF_8_close_env>:
jmp    1030 <SN_close_env@plt>

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

LLVM IR (-O2):
%struct.SN_env = type { i32 }
define void @portuguese_UTF_8_close_env(%struct.SN_env* %0) {
%2 = tail call i32 @SN_close_env(%struct.SN_env* %0)
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ DIR;

/* Variables and functions */
int dirfd(int /*<<< orphan*/ *);
__attribute__((__weak__, __always___)) int softboundmpx_dirfd(DIR *dirp) {
  return dirfd(dirp);
}


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

x86 assembly (clang, -O2):
<softboundmpx_dirfd>:
jmp    1030 <dirfd@plt>

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

LLVM IR (-O2):
define weak i32 @softboundmpx_dirfd(i32* %0) {
%2 = tail call i32 @dirfd(i32* %0)
ret i32 %2
}
/* Variables and functions */
scalar_t__ get_word(char *);
char *get_forward_ptr(char *p) { return (char *)get_word(p + 4); }


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

x86 assembly (clang, -O2):
<get_forward_ptr>:
add    $0x4,%rdi
jmp    1030 <get_word@plt>

LLVM IR (-O0):
define i8* @get_forward_ptr(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 4
%5 = call i64 @get_word(i8* %4)
%6 = inttoptr i64 %5 to i8*
ret i8* %6
}

LLVM IR (-O2):
define i8* @get_forward_ptr(i8* %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 4
%3 = tail call i64 @get_word(i8* %2)
%4 = inttoptr i64 %3 to i8*
ret i8* %4
}
/* Variables and functions */
int /*<<< orphan*/ test_card_compare_all();
int /*<<< orphan*/ test_deck_draw();
int /*<<< orphan*/ test_deck_sort();
int main() {
  test_card_compare_all();
  test_deck_sort();
  test_deck_draw();
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
mov    $0x0,%al
call   1040 <test_card_compare_all@plt>
mov    $0x0,%al
call   1030 <test_deck_sort@plt>
mov    $0x0,%al
call   1050 <test_deck_draw@plt>
xor    %eax,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1040 <test_card_compare_all@plt>
xor    %eax,%eax
call   1030 <test_deck_sort@plt>
xor    %eax,%eax
call   1050 <test_deck_draw@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @main() {
%1 = call i32 (...) @test_card_compare_all()
%2 = call i32 (...) @test_deck_sort()
%3 = call i32 (...) @test_deck_draw()
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @test_card_compare_all()
%2 = tail call i32 (...) @test_deck_sort()
%3 = tail call i32 (...) @test_deck_draw()
ret i32 0
}