xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int /*<<< orphan*/ i2d_of_void;
typedef int /*<<< orphan*/ NETSCAPE_CERT_SEQUENCE;
typedef int /*<<< orphan*/ BIO;

/* Variables and functions */
int PEM_ASN1_write_bio(int /*<<< orphan*/ *, int /*<<< orphan*/,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                       int /*<<< orphan*/, int /*<<< orphan*/ *,
                       int /*<<< orphan*/ *);
int /*<<< orphan*/ PEM_STRING_X509;
scalar_t__ i2d_NETSCAPE_CERT_SEQUENCE;
int PEM_write_bio_NETSCAPE_CERT_SEQUENCE(BIO *bp, NETSCAPE_CERT_SEQUENCE *x) {
  return PEM_ASN1_write_bio((i2d_of_void *)i2d_NETSCAPE_CERT_SEQUENCE,
                            PEM_STRING_X509, bp, x, NULL, NULL, 0, NULL, NULL);
}


x86 assembly (clang, -O0):
<PEM_write_bio_NETSCAPE_CERT_SEQUENCE>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2eb9(%rip),%rax
mov    (%rax),%rdi
mov    0x2eb7(%rip),%rax
mov    (%rax),%esi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
xor    %eax,%eax
mov    %eax,%r9d
xor    %eax,%eax
mov    %r9,%r8
movl   $0x0,(%rsp)
movq   $0x0,0x8(%rsp)
movq   $0x0,0x10(%rsp)
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<PEM_write_bio_NETSCAPE_CERT_SEQUENCE>:
sub    $0x18,%rsp
mov    %rsi,%rcx
mov    %rdi,%rdx
mov    0x2ebf(%rip),%rax
mov    (%rax),%rdi
mov    0x2ebd(%rip),%rax
mov    (%rax),%esi
xorps  %xmm0,%xmm0
movups %xmm0,0x8(%rsp)
movl   $0x0,(%rsp)
xor    %r8d,%r8d
xor    %r9d,%r9d
call   1030 <PEM_ASN1_write_bio@plt>
add    $0x18,%rsp
ret

LLVM IR (-O0):
@i2d_NETSCAPE_CERT_SEQUENCE = global i64 0
@PEM_STRING_X509 = global i32 0
define i32 @PEM_write_bio_NETSCAPE_CERT_SEQUENCE(i32* %0, i32* %1) {
%3 = alloca i32*
%4 = alloca i32*
store i32* %0, i32** %3
store i32* %1, i32** %4
%5 = load i64, i64* @i2d_NETSCAPE_CERT_SEQUENCE
%6 = inttoptr i64 %5 to i32*
%7 = load i32, i32* @PEM_STRING_X509
%8 = load i32*, i32** %3
%9 = load i32*, i32** %4
%10 = call i32 @PEM_ASN1_write_bio(i32* %6, i32 %7, i32* %8, i32* %9, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %10
}

LLVM IR (-O2):
@i2d_NETSCAPE_CERT_SEQUENCE = global i64 0
@PEM_STRING_X509 = global i32 0
define i32 @PEM_write_bio_NETSCAPE_CERT_SEQUENCE(i32* %0, i32* %1) {
%3 = load i64, i64* @i2d_NETSCAPE_CERT_SEQUENCE
%4 = inttoptr i64 %3 to i32*
%5 = load i32, i32* @PEM_STRING_X509
%6 = tail call i32 @PEM_ASN1_write_bio(i32* %4, i32 %5, i32* %0, i32* %1, i32* null, i32* null, i32 0, i32* null, i32* null)
ret i32 %6
}
/* Type definitions */
typedef int in_addr_t;

/* Variables and functions */
int inet_addr(char const *);
int checkSubnet(const char *ipAddress, const char *desiredNetwork,
                const char *subnet) {
  in_addr_t ip, net, mask;
  ip = inet_addr(ipAddress);
  net = inet_addr(desiredNetwork);
  mask = inet_addr(subnet);
  if ((ip & mask) == net) {
    return 1;
  } else {
    return 0;
  }
}


x86 assembly (clang, -O0):
<checkSubnet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,-0x24(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,-0x28(%rbp)
mov    -0x20(%rbp),%rdi
call   1030 <inet_addr@plt>
mov    %eax,-0x2c(%rbp)
mov    -0x24(%rbp),%eax
and    -0x2c(%rbp),%eax
cmp    -0x28(%rbp),%eax
jne    1163 <checkSubnet+0x53>
movl   $0x1,-0x4(%rbp)
jmp    116a <checkSubnet+0x5a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<checkSubnet>:
push   %rbp
push   %r14
push   %rbx
mov    %rdx,%r14
mov    %rsi,%rbx
call   1030 <inet_addr@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <inet_addr@plt>
mov    %eax,%ebx
mov    %r14,%rdi
call   1030 <inet_addr@plt>
and    %ebp,%eax
xor    %ecx,%ecx
cmp    %ebx,%eax
sete   %cl
mov    %ecx,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @checkSubnet(i8* %0, i8* %1, i8* %2) {
%4 = tail call i32 @inet_addr(i8* %0)
%5 = tail call i32 @inet_addr(i8* %1)
%6 = tail call i32 @inet_addr(i8* %2)
%7 = and i32 %6, %4
%8 = icmp eq i32 %7, %5
%9 = zext i1 %8 to i32
ret i32 %9
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
int main(void) {
  printf("Current line_num is %d\n", 5);
  printf("Now redefine __LINE__ as %d\n", 100);
  printf("Current line_num is %d\n", 101);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeda(%rip),%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xee1(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
lea    0xeb8(%rip),%rdi
mov    $0x65,%esi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xee8(%rip),%rbx
mov    %rbx,%rdi
mov    $0x5,%esi
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x64,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x65,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [24 x i8] c"Current line_num is %d\0A\00"
@.str.1 = [29 x i8] c"Now redefine __LINE__ as %d\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5)
%3 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 100)
%4 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 101)
ret i32 0
}

LLVM IR (-O2):
@.str = [24 x i8] c"Current line_num is %d\0A\00"
@.str.1 = [29 x i8] c"Now redefine __LINE__ as %d\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i32 100)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0), i32 101)
ret i32 0
}
/* Variables and functions */
double bot_mod2pi(double);
double bot_mod2pi_ref(double ref, double vin) {
  return ref + bot_mod2pi(vin - ref);
}


x86 assembly (clang, -O0):
<bot_mod2pi_ref>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x8(%rbp),%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x10(%rbp),%xmm0
subsd  -0x8(%rbp),%xmm0
call   1030 <bot_mod2pi@plt>
movaps %xmm0,%xmm1
movsd  -0x18(%rbp),%xmm0
addsd  %xmm1,%xmm0
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<bot_mod2pi_ref>:
push   %rax
movsd  %xmm0,(%rsp)
subsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1030 <bot_mod2pi@plt>
addsd  (%rsp),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define double @bot_mod2pi_ref(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 = load double, double* %3
%8 = fsub double %6, %7
%9 = call double @bot_mod2pi(double %8)
%10 = fadd double %5, %9
ret double %10
}

LLVM IR (-O2):
define double @bot_mod2pi_ref(double %0, double %1) {
%3 = fsub double %1, %0
%4 = tail call double @bot_mod2pi(double %3)
%5 = fadd double %4, %0
ret double %5
}
/* Variables and functions */
void stub1(long long, char);
void testClosureLLBrV(void (*closure)(long long, char), long long a1, char a2) {
  if (closure != NULL)
    (*closure)(a1, a2);
}


x86 assembly (clang, -O0):
<testClosureLLBrV>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %dl,%al
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     112e <testClosureLLBrV+0x2e>
mov    -0x8(%rbp),%rax
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   *%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testClosureLLBrV>:
test   %rdi,%rdi
je     1112 <testClosureLLBrV+0x12>
mov    %rdi,%rax
movsbl %dl,%ecx
mov    %rsi,%rdi
mov    %ecx,%esi
jmp    *%rax
ret

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

LLVM IR (-O2):
define void @testClosureLLBrV(void (i64, i8)* %0, i64 %1, i8 signext %2) {
%4 = icmp eq void (i64, i8)* %0, null
br i1 %4, label %6, label %5
5: ; preds = %3
tail call void %0(i64 %1, i8 signext %2)
br label %6
6: ; preds = %5, %3
ret void
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int pa_convert_size() {
  printf("NOT IMPLEMENTED:"
         "pa_convert_size"
         "\n");
}


x86 assembly (clang, -O0):
<pa_convert_size>:
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_convert_size>:
lea    0xee9(%rip),%rdi
jmp    1030 <puts@plt>

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

LLVM IR (-O2):
@str = [32 x i8] c"NOT IMPLEMENTED:pa_convert_size\00"
define i32 @pa_convert_size() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str, i64 0, i64 0))
ret i32 undef
}
int exact_square(int number) {
  int i = 0;
  for (i = 0; i < number; i++) {
    if ((i * i) == number) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<exact_square>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1150 <exact_square+0x50>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    113d <exact_square+0x3d>
movl   $0x1,-0x4(%rbp)
jmp    1157 <exact_square+0x57>
jmp    1142 <exact_square+0x42>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1115 <exact_square+0x15>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<exact_square>:
xor    %eax,%eax
test   %edi,%edi
jle    1128 <exact_square+0x28>
cs nopw 0x0(%rax,%rax,1)
mov    %eax,%ecx
imul   %eax,%ecx
cmp    %edi,%ecx
je     1123 <exact_square+0x23>
add    $0x1,%eax
cmp    %eax,%edi
jne    1110 <exact_square+0x10>
xor    %eax,%eax
ret
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @exact_square(i32 %0) {
%2 = icmp sgt i32 %0, 0
br i1 %2, label %5, label %10
3: ; preds = %5
%4 = icmp eq i32 %9, %0
br i1 %4, label %10, label %5
5: ; preds = %1, %3
%6 = phi i32 [ %9, %3 ], [ 0, %1 ]
%7 = mul nsw i32 %6, %6
%8 = icmp eq i32 %7, %0
%9 = add nuw nsw i32 %6, 1
br i1 %8, label %10, label %3
10: ; preds = %5, %3, %1
%11 = phi i32 [ 0, %1 ], [ 0, %3 ], [ 1, %5 ]
ret i32 %11
}
unsigned xrop3_3_0_1(unsigned char s, unsigned char t) {
  unsigned D = 0x00ff;
  unsigned S = ((unsigned)s << 8) | s;
  unsigned T = ((unsigned)t << 8) | t;
  unsigned stk1;
  stk1 = T | S;
  stk1 = ~stk1;
  return (stk1 & S) | (stk1 & (~T)) | (T & (~S) & D);
}


x86 assembly (clang, -O0):
<xrop3_3_0_1>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %dil,%cl
mov    %cl,-0x1(%rbp)
mov    %al,-0x2(%rbp)
movl   $0xff,-0x8(%rbp)
movzbl -0x1(%rbp),%eax
shl    $0x8,%eax
movzbl -0x1(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0xc(%rbp)
movzbl -0x2(%rbp),%eax
shl    $0x8,%eax
movzbl -0x2(%rbp),%ecx
or     %ecx,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
or     -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    $0xffffffff,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
and    -0xc(%rbp),%eax
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x10(%rbp),%ecx
mov    -0xc(%rbp),%edx
xor    $0xffffffff,%edx
and    %edx,%ecx
and    -0x8(%rbp),%ecx
or     %ecx,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<xrop3_3_0_1>:
mov    %edi,%eax
shl    $0x8,%eax
or     %edi,%eax
mov    %esi,%ecx
shl    $0x8,%ecx
or     %esi,%ecx
or     %eax,%ecx
not    %ecx
not    %eax
and    %esi,%eax
or     %ecx,%eax
ret

LLVM IR (-O0):
define i32 @xrop3_3_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
store i8 %0, i8* %3
store i8 %1, i8* %4
store i32 255, i32* %5
%9 = load i8, i8* %3
%10 = zext i8 %9 to i32
%11 = shl i32 %10, 8
%12 = load i8, i8* %3
%13 = zext i8 %12 to i32
%14 = or i32 %11, %13
store i32 %14, i32* %6
%15 = load i8, i8* %4
%16 = zext i8 %15 to i32
%17 = shl i32 %16, 8
%18 = load i8, i8* %4
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
store i32 %20, i32* %7
%21 = load i32, i32* %7
%22 = load i32, i32* %6
%23 = or i32 %21, %22
store i32 %23, i32* %8
%24 = load i32, i32* %8
%25 = xor i32 %24, -1
store i32 %25, i32* %8
%26 = load i32, i32* %8
%27 = load i32, i32* %6
%28 = and i32 %26, %27
%29 = load i32, i32* %8
%30 = load i32, i32* %7
%31 = xor i32 %30, -1
%32 = and i32 %29, %31
%33 = or i32 %28, %32
%34 = load i32, i32* %7
%35 = load i32, i32* %6
%36 = xor i32 %35, -1
%37 = and i32 %34, %36
%38 = load i32, i32* %5
%39 = and i32 %37, %38
%40 = or i32 %33, %39
ret i32 %40
}

LLVM IR (-O2):
define i32 @xrop3_3_0_1(i8 zeroext %0, i8 zeroext %1) {
%3 = zext i8 %0 to i32
%4 = mul nuw nsw i32 %3, 257
%5 = zext i8 %1 to i32
%6 = mul nuw nsw i32 %5, 257
%7 = or i32 %6, %4
%8 = xor i32 %7, -1
%9 = xor i32 %4, -1
%10 = and i32 %9, %5
%11 = or i32 %10, %8
ret i32 %11
}
void IntIfClkAutoGateSet(void) {
  (*((volatile unsigned int *)((0x48200000) + (0x10)))) |= (0x00000001u);
}


x86 assembly (clang, -O0):
<IntIfClkAutoGateSet>:
push   %rbp
mov    %rsp,%rbp
mov    $0x48200010,%eax
mov    (%rax),%ecx
or     $0x1,%ecx
mov    $0x48200010,%eax
mov    %ecx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<IntIfClkAutoGateSet>:
orl    $0x1,0x48200010
01
ret

LLVM IR (-O0):
define void @IntIfClkAutoGateSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}

LLVM IR (-O2):
define void @IntIfClkAutoGateSet() {
%1 = load volatile i32, i32* inttoptr (i64 1210056720 to i32*)
%2 = or i32 %1, 1
store volatile i32 %2, i32* inttoptr (i64 1210056720 to i32*)
ret void
}
/* Variables and functions */
int atoi(char *);
char *index(char *, char);
int /*<<< orphan*/ printf(char *, int);
void skel(char *buff) {
  char *p = buff;
  while (1) {
    printf("%d\n", atoi(p));
    if ((p = index(p, ' ')) == NULL) {
      break;
    } else
      p++;
  }
}


x86 assembly (clang, -O0):
<skel>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
call   1050 <atoi@plt>
mov    %eax,%esi
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    $0x20,%esi
call   1040 <index@plt>
mov    %rax,-0x10(%rbp)
cmp    $0x0,%rax
jne    117c <skel+0x4c>
jmp    118d <skel+0x5d>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1144 <skel+0x14>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<skel>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec2(%rip),%r14
xchg   %ax,%ax
mov    %rbx,%rdi
call   1050 <atoi@plt>
mov    %r14,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
mov    %rbx,%rdi
mov    $0x20,%esi
call   1040 <index@plt>
lea    0x1(%rax),%rbx
test   %rax,%rax
jne    1140 <skel+0x10>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @skel(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %8, %2 ]
%4 = tail call i32 @atoi(i8* %3)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %4)
%6 = tail call i8* @index(i8* %3, i8 signext 32)
%7 = icmp eq i8* %6, null
%8 = getelementptr inbounds i8, i8* %6, i64 1
br i1 %7, label %9, label %2
9: ; preds = %2
ret void
}
char *RCSid() {
  return RCSid("$Id: color.c,v 1.98.2.3 2013/03/10 18:23:59 broeker Exp $");
}


x86 assembly (clang, -O0):
<RCSid>:
push   %rbp
mov    %rsp,%rbp
lea    0xee5(%rip),%rdi
mov    $0x0,%al
call   1030 <RCSid@plt>
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [58 x i8] c"$Id: color.c,v 1.98.2.3 2013/03/10 18:23:59 broeker Exp $\00"
define i8* @RCSid() {
%1 = call i8* (i8*, ...) bitcast (i8* ()* @RCSid to i8* (i8*, ...)*)(i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0))
ret i8* %1
}

LLVM IR (-O2):
define noalias i8* @RCSid() {
br label %1
1: ; preds = %1, %0
br label %1
}
float simplexnoise1234_grad1(int hash, float x) {
  int h = hash & 15;
  float grad = 1.0f + (h & 7);
  if (h & 8)
    grad = -grad;
  return (grad * x);
}


x86 assembly (clang, -O0):
<simplexnoise1234_grad1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0xf,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm1
movss  0xed9(%rip),%xmm0
addss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xc(%rbp),%eax
and    $0x8,%eax
cmp    $0x0,%eax
je     1156 <simplexnoise1234_grad1+0x56>
movss  -0x10(%rbp),%xmm0
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
mulss  -0x8(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<simplexnoise1234_grad1>:
mov    %edi,%eax
and    $0x7,%eax
cvtsi2ss %eax,%xmm1
addss  0xeef(%rip),%xmm1
test   $0x8,%dil
je     111e <simplexnoise1234_grad1+0x1e>
xorps  0xef2(%rip),%xmm1
mulss  %xmm0,%xmm1
movaps %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @simplexnoise1234_grad1(i32 %0, float %1) {
%3 = alloca i32
%4 = alloca float
%5 = alloca i32
%6 = alloca float
store i32 %0, i32* %3
store float %1, float* %4
%7 = load i32, i32* %3
%8 = and i32 %7, 15
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = and i32 %9, 7
%11 = sitofp i32 %10 to float
%12 = fadd float 1.000000e+00, %11
store float %12, float* %6
%13 = load i32, i32* %5
%14 = and i32 %13, 8
%15 = icmp ne i32 %14, 0
br i1 %15, label %16, label %19
16: ; preds = %2
%17 = load float, float* %6
%18 = fneg float %17
store float %18, float* %6
br label %19
19: ; preds = %16, %2
%20 = load float, float* %6
%21 = load float, float* %4
%22 = fmul float %20, %21
ret float %22
}

LLVM IR (-O2):
define float @simplexnoise1234_grad1(i32 %0, float %1) {
%3 = and i32 %0, 7
%4 = sitofp i32 %3 to float
%5 = fadd float %4, 1.000000e+00
%6 = and i32 %0, 8
%7 = icmp eq i32 %6, 0
%8 = fneg float %5
%9 = select i1 %7, float %5, float %8
%10 = fmul float %9, %1
ret float %10
}
void RandomFunc(unsigned long input[1], unsigned long output[1]) {
  unsigned long state[1];
  unsigned long local1;
  {
    state[0UL] = (input[0UL] + 914778474UL) - 981234615UL;
    local1 = 0UL;
    while (local1 < 1UL) {
      state[0UL] = state[local1] + state[0UL];
      local1++;
    }
    output[0UL] = (state[0UL] + 964964849UL) - 1156823440UL;
  }
}


x86 assembly (clang, -O0):
<RandomFunc>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    (%rax),%rax
add    $0x3686696a,%rax
sub    $0x3a7c73b7,%rax
mov    %rax,-0x18(%rbp)
movq   $0x0,-0x20(%rbp)
cmpq   $0x1,-0x20(%rbp)
jae    1158 <RandomFunc+0x58>
mov    -0x20(%rbp),%rax
mov    -0x18(%rbp,%rax,8),%rax
add    -0x18(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x20(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x20(%rbp)
jmp    112b <RandomFunc+0x2b>
mov    -0x18(%rbp),%rcx
add    $0x398431f1,%rcx
sub    $0x44f3b990,%rcx
mov    -0x10(%rbp),%rax
mov    %rcx,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<RandomFunc>:
mov    (%rdi),%rax
add    %rax,%rax
add    $0xffffffffeca463c7,%rax
mov    %rax,(%rsi)
ret

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

LLVM IR (-O2):
define void @RandomFunc(i64* nocapture %0, i64* nocapture writeonly %1) {
%3 = load i64, i64* %0
%4 = shl i64 %3, 1
%5 = add i64 %4, -324770873
store i64 %5, i64* %1
ret void
}
float inv_sqrt(float x) {
  float xhalf = 0.5f * x;
  int i = *(int *)&x;
  i = 0x5f375a86 - (i >> 1);
  x = *(float *)&i;
  x = x * (1.5f - xhalf * x * x);
  return x;
}


x86 assembly (clang, -O0):
<inv_sqrt>:
push   %rbp
mov    %rsp,%rbp
movss  %xmm0,-0x4(%rbp)
movss  0xef3(%rip),%xmm0
mulss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
mov    -0x4(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
mov    $0x5f375a86,%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
movss  -0x8(%rbp),%xmm1
mulss  -0x4(%rbp),%xmm1
movss  -0x4(%rbp),%xmm2
movd   %xmm1,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm1
mulss  %xmm2,%xmm1
movss  0xe98(%rip),%xmm2
addss  %xmm2,%xmm1
mulss  %xmm1,%xmm0
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<inv_sqrt>:
movd   %xmm0,%eax
sar    %eax
mov    $0x5f375a86,%ecx
sub    %eax,%ecx
movd   %ecx,%xmm1
mulss  0xee7(%rip),%xmm0
mulss  %xmm1,%xmm0
mulss  %xmm1,%xmm0
addss  0xedb(%rip),%xmm0
mulss  %xmm1,%xmm0
ret

LLVM IR (-O0):
define float @inv_sqrt(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca i32
store float %0, float* %2
%5 = load float, float* %2
%6 = fmul float 5.000000e-01, %5
store float %6, float* %3
%7 = bitcast float* %2 to i32*
%8 = load i32, i32* %7
store i32 %8, i32* %4
%9 = load i32, i32* %4
%10 = ashr i32 %9, 1
%11 = sub nsw i32 1597463174, %10
store i32 %11, i32* %4
%12 = bitcast i32* %4 to float*
%13 = load float, float* %12
store float %13, float* %2
%14 = load float, float* %2
%15 = load float, float* %3
%16 = load float, float* %2
%17 = fmul float %15, %16
%18 = load float, float* %2
%19 = fneg float %17
%20 = call float @llvm.fmuladd.f32(float %19, float %18, float 1.500000e+00)
%21 = fmul float %14, %20
store float %21, float* %2
%22 = load float, float* %2
ret float %22
}

LLVM IR (-O2):
define float @inv_sqrt(float %0) {
%2 = bitcast float %0 to i32
%3 = ashr i32 %2, 1
%4 = sub nsw i32 1597463174, %3
%5 = bitcast i32 %4 to float
%6 = fmul float %0, -5.000000e-01
%7 = fmul float %6, %5
%8 = tail call float @llvm.fmuladd.f32(float %7, float %5, float 1.500000e+00)
%9 = fmul float %8, %5
ret float %9
}
/* Type definitions */
struct stat {
  int /*<<< orphan*/ st_mode;
};

/* Variables and functions */
int S_ISDIR(int /*<<< orphan*/);
int /*<<< orphan*/ stat(char *, struct stat *);
int isDirectory(char *fileName) {
  struct stat s;
  stat(fileName, &s);
  return S_ISDIR(s.st_mode);
}


x86 assembly (clang, -O0):
<isDirectory>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <stat@plt>
mov    -0x10(%rbp),%edi
call   1030 <S_ISDIR@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isDirectory>:
push   %rax
mov    %rsp,%rsi
call   1040 <stat@plt>
mov    (%rsp),%edi
pop    %rax
jmp    1030 <S_ISDIR@plt>

LLVM IR (-O0):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* %0) {
%2 = alloca i8*
%3 = alloca %struct.stat
store i8* %0, i8** %2
%4 = load i8*, i8** %2
%5 = call i32 @stat(i8* %4, %struct.stat* %3)
%6 = getelementptr inbounds %struct.stat, %struct.stat* %3, i32 0, i32 0
%7 = load i32, i32* %6
%8 = call i32 @S_ISDIR(i32 %7)
ret i32 %8
}

LLVM IR (-O2):
%struct.stat = type { i32 }
define i32 @isDirectory(i8* nocapture %0) {
%2 = alloca %struct.stat
%3 = bitcast %struct.stat* %2 to i8*
%4 = call i32 @stat(i8* %0, %struct.stat* %2)
%5 = getelementptr inbounds %struct.stat, %struct.stat* %2, i64 0, i32 0
%6 = load i32, i32* %5
%7 = tail call i32 @S_ISDIR(i32 %6)
ret i32 %7
}
int lm_data_size_dlm(void) { return -1; }


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

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

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

LLVM IR (-O2):
define i32 @lm_data_size_dlm() {
ret i32 -1
}
int rsa_multip_cap(int bits) {
  int cap = 5;
  if (bits < 1024)
    cap = 2;
  else if (bits < 4096)
    cap = 3;
  else if (bits < 8192)
    cap = 4;
  if (cap > 5)
    cap = 5;
  return cap;
}


x86 assembly (clang, -O0):
<rsa_multip_cap>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
cmpl   $0x400,-0x4(%rbp)
jge    1127 <rsa_multip_cap+0x27>
movl   $0x2,-0x8(%rbp)
jmp    115e <rsa_multip_cap+0x5e>
cmpl   $0x1000,-0x4(%rbp)
jge    1140 <rsa_multip_cap+0x40>
movl   $0x3,-0x8(%rbp)
jmp    1159 <rsa_multip_cap+0x59>
cmpl   $0x2000,-0x4(%rbp)
jge    1154 <rsa_multip_cap+0x54>
movl   $0x4,-0x8(%rbp)
jmp    1159 <rsa_multip_cap+0x59>
jmp    115e <rsa_multip_cap+0x5e>
cmpl   $0x5,-0x8(%rbp)
jle    116f <rsa_multip_cap+0x6f>
movl   $0x5,-0x8(%rbp)
mov    -0x8(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<rsa_multip_cap>:
mov    $0x2,%eax
cmp    $0x400,%edi
jl     1128 <rsa_multip_cap+0x28>
mov    $0x3,%eax
cmp    $0x1000,%edi
jb     1128 <rsa_multip_cap+0x28>
cmp    $0x2000,%edi
mov    $0x5,%eax
sbb    $0x0,%eax
ret

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

LLVM IR (-O2):
define i32 @rsa_multip_cap(i32 %0) {
%2 = icmp slt i32 %0, 1024
br i1 %2, label %8, label %3
3: ; preds = %1
%4 = icmp ult i32 %0, 4096
br i1 %4, label %8, label %5
5: ; preds = %3
%6 = icmp ult i32 %0, 8192
%7 = select i1 %6, i32 4, i32 5
br label %8
8: ; preds = %5, %3, %1
%9 = phi i32 [ 2, %1 ], [ 3, %3 ], [ %7, %5 ]
ret i32 %9
}
int check_prime(int num) {
  int i = 1;
  if (num == 1)
    return (0);
  for (i = 2; i < num; i = i + 1) {
    if (num % i == 0)
      return (0);
  }
  return (1);
}


x86 assembly (clang, -O0):
<check_prime>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
cmpl   $0x1,-0x8(%rbp)
jne    1124 <check_prime+0x24>
movl   $0x0,-0x4(%rbp)
jmp    116d <check_prime+0x6d>
movl   $0x2,-0xc(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1166 <check_prime+0x66>
mov    -0x8(%rbp),%eax
cltd
idivl  -0xc(%rbp)
cmp    $0x0,%edx
jne    1153 <check_prime+0x53>
movl   $0x0,-0x4(%rbp)
jmp    116d <check_prime+0x6d>
jmp    1158 <check_prime+0x58>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    112b <check_prime+0x2b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<check_prime>:
xor    %ecx,%ecx
cmp    $0x1,%edi
jne    110a <check_prime+0xa>
mov    %ecx,%eax
ret
cmp    $0x3,%edi
jl     1130 <check_prime+0x30>
mov    $0x2,%esi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %edi,%eax
cltd
idiv   %esi
test   %edx,%edx
je     1107 <check_prime+0x7>
add    $0x1,%esi
cmp    %esi,%edi
jne    1120 <check_prime+0x20>
mov    $0x1,%eax
ret

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

LLVM IR (-O2):
define i32 @check_prime(i32 %0) {
%2 = icmp eq i32 %0, 1
br i1 %2, label %12, label %3
3: ; preds = %1
%4 = icmp sgt i32 %0, 2
br i1 %4, label %7, label %12
5: ; preds = %7
%6 = icmp eq i32 %11, %0
br i1 %6, label %12, label %7
7: ; preds = %3, %5
%8 = phi i32 [ %11, %5 ], [ 2, %3 ]
%9 = srem i32 %0, %8
%10 = icmp eq i32 %9, 0
%11 = add nuw nsw i32 %8, 1
br i1 %10, label %12, label %5
12: ; preds = %7, %5, %3, %1
%13 = phi i32 [ 0, %1 ], [ 1, %3 ], [ 0, %7 ], [ 1, %5 ]
ret i32 %13
}
/* Variables and functions */
int /*<<< orphan*/ abort();
int __attribute__((no, noclone)) foo(char *p) {
  int h = 0;
  do {
    if (*p == '\0')
      break;
    ++h;
    if (p == 0)
      abort();
    ++p;
  } while (1);
  return h;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
jne    1138 <foo+0x28>
jmp    116e <foo+0x5e>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1153 <foo+0x43>
mov    $0x0,%al
call   1030 <abort@plt>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    $0x1,%al
test   $0x1,%al
jne    1123 <foo+0x13>
jmp    116e <foo+0x5e>
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
cmpb   $0x0,(%rdi)
je     111c <foo+0x1c>
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
cmpb   $0x0,0x1(%rdi,%rax,1)
lea    0x1(%rax),%rax
jne    1110 <foo+0x10>
ret
xor    %eax,%eax
ret

LLVM IR (-O0):
define i32 @foo(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 i8*, i8** %2
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
%8 = icmp eq i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %4
br label %21
10: ; preds = %4
%11 = load i32, i32* %3
%12 = add nsw i32 %11, 1
store i32 %12, i32* %3
%13 = load i8*, i8** %2
%14 = icmp eq i8* %13, null
br i1 %14, label %15, label %17
15: ; preds = %10
%16 = call i32 (...) @abort()
unreachable
17: ; preds = %10
%18 = load i8*, i8** %2
%19 = getelementptr inbounds i8, i8* %18, i32 1
store i8* %19, i8** %2
br label %20
20: ; preds = %17
br i1 true, label %4, label %21
21: ; preds = %20, %9
%22 = load i32, i32* %3
ret i32 %22
}

LLVM IR (-O2):
define i32 @foo(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %11, label %4
4: ; preds = %1, %4
%5 = phi i32 [ %7, %4 ], [ 0, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = add nuw nsw i32 %5, 1
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = load i8, i8* %8
%10 = icmp eq i8 %9, 0
br i1 %10, label %11, label %4
11: ; preds = %4, %1
%12 = phi i32 [ 0, %1 ], [ %7, %4 ]
ret i32 %12
}
int test_imm_94uint8_mem(unsigned char *val) {
  return ((*val) & (-0x94 << 0)) ? -20 : -40;
}


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

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

LLVM IR (-O0):
define i32 @test_imm_94uint8_mem(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = load i8, i8* %3
%5 = zext i8 %4 to i32
%6 = and i32 %5, -148
%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_94uint8_mem(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = and i8 %2, 108
%4 = icmp eq i8 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
int tegra_cpu_speedo_mv(void) { return 1250; }


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

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

LLVM IR (-O0):
define i32 @tegra_cpu_speedo_mv() {
ret i32 1250
}

LLVM IR (-O2):
define i32 @tegra_cpu_speedo_mv() {
ret i32 1250
}
int main() {
  int nums[] = {5, 6, 7, 8};
  int *pointer = &nums[0];
  printf("%u\n%u\n%i", pointer, nums[0], *pointer);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xed7(%rip),%rax
mov    %rax,-0x18(%rbp)
lea    -0x20(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x28(%rbp),%rax
mov    (%rax),%ecx
lea    0xebf(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x18,%rsp
movaps 0xee5(%rip),%xmm0
movaps %xmm0,(%rsp)
lea    0xeea(%rip),%rdi
mov    %rsp,%rsi
mov    $0x5,%edx
mov    $0x5,%ecx
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
ret

LLVM IR (-O0):
@__const.main.nums = [4 x i32] [i32 5, i32 6, i32 7, i32 8]
@.str = [9 x i8] c"%u\0A%u\0A%i\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [4 x i32]
%3 = alloca i32*
store i32 0, i32* %1
%4 = bitcast [4 x i32]* %2 to i8*
%5 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
store i32* %5, i32** %3
%6 = load i32*, i32** %3
%7 = getelementptr inbounds [4 x i32], [4 x i32]* %2, i64 0, i64 0
%8 = load i32, i32* %7
%9 = load i32*, i32** %3
%10 = load i32, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %6, i32 %8, i32 %10)
ret i32 0
}

LLVM IR (-O2):
@__const.main.nums = [4 x i32] [i32 5, i32 6, i32 7, i32 8]
@.str = [9 x i8] c"%u\0A%u\0A%i\00"
define i32 @main() {
%1 = alloca [4 x i32]
%2 = bitcast [4 x i32]* %1 to i8*
%3 = getelementptr inbounds [4 x i32], [4 x i32]* %1, i64 0, i64 0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), i32* %3, i32 5, i32 5)
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char *argv[]) {
  printf("This is a \"pre/bin\" target.\n");
  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)
lea    0xed3(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
@.str = [29 x i8] c"This is a \22pre/bin\22 target.\0A\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 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [28 x i8] c"This is a \22pre/bin\22 target.\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
ret i32 0
}
void rv2ext_exp() {}


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

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

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

LLVM IR (-O2):
define void @rv2ext_exp() {
ret void
}
double scale_h2(double x, double y, double z) { return 1.0; }


x86 assembly (clang, -O0):
<scale_h2>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  %xmm2,-0x18(%rbp)
movsd  0xee5(%rip),%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<scale_h2>:
movsd  0xef8(%rip),%xmm0
ret

LLVM IR (-O0):
define double @scale_h2(double %0, double %1, double %2) {
%4 = alloca double
%5 = alloca double
%6 = alloca double
store double %0, double* %4
store double %1, double* %5
store double %2, double* %6
ret double 1.000000e+00
}

LLVM IR (-O2):
define double @scale_h2(double %0, double %1, double %2) {
ret double 1.000000e+00
}
double rightlog(double x, double r) { return (r * x * x * (1.0 - x)); }


x86 assembly (clang, -O0):
<rightlog>:
push   %rbp
mov    %rsp,%rbp
movsd  %xmm0,-0x8(%rbp)
movsd  %xmm1,-0x10(%rbp)
movsd  -0x10(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
mulsd  -0x8(%rbp),%xmm0
movsd  0xedb(%rip),%xmm1
subsd  -0x8(%rbp),%xmm1
mulsd  %xmm1,%xmm0
pop    %rbp
ret

x86 assembly (clang, -O2):
<rightlog>:
mulsd  %xmm0,%xmm1
mulsd  %xmm0,%xmm1
movsd  0xef0(%rip),%xmm2
subsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movapd %xmm2,%xmm0
ret

LLVM IR (-O0):
define double @rightlog(double %0, double %1) {
%3 = alloca double
%4 = alloca double
store double %0, double* %3
store double %1, double* %4
%5 = load double, double* %4
%6 = load double, double* %3
%7 = fmul double %5, %6
%8 = load double, double* %3
%9 = fmul double %7, %8
%10 = load double, double* %3
%11 = fsub double 1.000000e+00, %10
%12 = fmul double %9, %11
ret double %12
}

LLVM IR (-O2):
define double @rightlog(double %0, double %1) {
%3 = fmul double %0, %1
%4 = fmul double %3, %0
%5 = fsub double 1.000000e+00, %0
%6 = fmul double %5, %4
ret double %6
}
/* Variables and functions */
int /*<<< orphan*/ Teapot_LowLevel_BindVertexBufferObject();
int /*<<< orphan*/ Teapot_LowLevel_EnableVertexAttributes(int, int);
void Teapot_LowLevel_BindVertexBufferObjectAndEnableVertexAttributes(
    int enableVertexAttribArray, int enableNormalAttribArray) {
  Teapot_LowLevel_EnableVertexAttributes(enableVertexAttribArray,
                                         enableNormalAttribArray);
  Teapot_LowLevel_BindVertexBufferObject();
}


x86 assembly (clang, -O0):
<Teapot_LowLevel_BindVertexBufferObjectAndEnableVertexAttributes>:
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 <Teapot_LowLevel_EnableVertexAttributes@plt>
mov    $0x0,%al
call   1040 <Teapot_LowLevel_BindVertexBufferObject@plt>
add    $0x10,%rsp
pop    %rbp
ret

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

LLVM IR (-O0):
define void @Teapot_LowLevel_BindVertexBufferObjectAndEnableVertexAttributes(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 @Teapot_LowLevel_EnableVertexAttributes(i32 %5, i32 %6)
%8 = call i32 (...) @Teapot_LowLevel_BindVertexBufferObject()
ret void
}

LLVM IR (-O2):
define void @Teapot_LowLevel_BindVertexBufferObjectAndEnableVertexAttributes(i32 %0, i32 %1) {
%3 = tail call i32 @Teapot_LowLevel_EnableVertexAttributes(i32 %0, i32 %1)
%4 = tail call i32 (...) @Teapot_LowLevel_BindVertexBufferObject()
ret void
}
__typeof__(strnlen(1, (void *)1)) test_strnlen_199(void) {
  return strnlen(1, (void *)1);
}


x86 assembly (clang, -O0):
<test_strnlen_199>:
push   %rbp
mov    %rsp,%rbp
mov    $0x1,%edi
mov    $0x1,%esi
mov    $0x0,%al
call   1030 <strnlen@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strnlen_199>:
mov    $0x1,%esi
mov    $0x1,%edi
xor    %eax,%eax
jmp    1030 <strnlen@plt>

LLVM IR (-O0):
define i32 @test_strnlen_199() {
%1 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @strnlen to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}

LLVM IR (-O2):
define i32 @test_strnlen_199() {
%1 = tail call i32 (i32, i8*, ...) bitcast (i32 (...)* @strnlen to i32 (i32, i8*, ...)*)(i32 1, i8* inttoptr (i64 1 to i8*))
ret i32 %1
}
char parser_UpCase(char c) {
  if (c >= 'a' && c <= 'z')
    return (c - 32);
  else
    return c;
}


x86 assembly (clang, -O0):
<parser_UpCase>:
push   %rbp
mov    %rsp,%rbp
mov    %dil,%al
mov    %al,-0x2(%rbp)
movsbl -0x2(%rbp),%eax
cmp    $0x61,%eax
jl     1133 <parser_UpCase+0x33>
movsbl -0x2(%rbp),%eax
cmp    $0x7a,%eax
jg     1133 <parser_UpCase+0x33>
movsbl -0x2(%rbp),%eax
sub    $0x20,%eax
mov    %al,-0x1(%rbp)
jmp    1139 <parser_UpCase+0x39>
mov    -0x2(%rbp),%al
mov    %al,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define signext i8 @parser_UpCase(i8 signext %0) {
%2 = alloca i8
%3 = alloca i8
store i8 %0, i8* %3
%4 = load i8, i8* %3
%5 = sext i8 %4 to i32
%6 = icmp sge i32 %5, 97
br i1 %6, label %7, label %16
7: ; preds = %1
%8 = load i8, i8* %3
%9 = sext i8 %8 to i32
%10 = icmp sle i32 %9, 122
br i1 %10, label %11, label %16
11: ; preds = %7
%12 = load i8, i8* %3
%13 = sext i8 %12 to i32
%14 = sub nsw i32 %13, 32
%15 = trunc i32 %14 to i8
store i8 %15, i8* %2
br label %18
16: ; preds = %7, %1
%17 = load i8, i8* %3
store i8 %17, i8* %2
br label %18
18: ; preds = %16, %11
%19 = load i8, i8* %2
ret i8 %19
}

LLVM IR (-O2):
define signext i8 @parser_UpCase(i8 signext %0) {
%2 = add i8 %0, -97
%3 = icmp ult i8 %2, 26
%4 = add i8 %0, -32
%5 = select i1 %3, i8 %4, i8 %0
ret i8 %5
}
int security_sock_rcv_skb(struct sock *sk, struct sk_buff *skb) { return 0; }


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

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

LLVM IR (-O0):
%struct.sock = type opaque
%struct.sk_buff = type opaque
define i32 @security_sock_rcv_skb(%struct.sock* %0, %struct.sk_buff* %1) {
%3 = alloca %struct.sock*
%4 = alloca %struct.sk_buff*
store %struct.sock* %0, %struct.sock** %3
store %struct.sk_buff* %1, %struct.sk_buff** %4
ret i32 0
}

LLVM IR (-O2):
%struct.sock = type opaque
%struct.sk_buff = type opaque
define i32 @security_sock_rcv_skb(%struct.sock* nocapture readnone %0, %struct.sk_buff* nocapture readnone %1) {
ret i32 0
}
/* Type definitions */
struct vmallocator {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vmallocator_alloc_aligned(struct vmallocator *, size_t);
void *vmallocator_ofs2mem(struct vmallocator *, int /*<<< orphan*/);
void *vmallocator_allocptr_aligned(struct vmallocator *v, size_t s) {
  return vmallocator_ofs2mem(v, vmallocator_alloc_aligned(v, s));
}


x86 assembly (clang, -O0):
<vmallocator_allocptr_aligned>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <vmallocator_alloc_aligned@plt>
mov    -0x18(%rbp),%rdi
mov    %eax,%esi
call   1040 <vmallocator_ofs2mem@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<vmallocator_allocptr_aligned>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vmallocator_alloc_aligned@plt>
mov    %rbx,%rdi
mov    %eax,%esi
pop    %rbx
jmp    1040 <vmallocator_ofs2mem@plt>

LLVM IR (-O0):
%struct.vmallocator = type { i32 }
define i8* @vmallocator_allocptr_aligned(%struct.vmallocator* %0, i64 %1) {
%3 = alloca %struct.vmallocator*
%4 = alloca i64
store %struct.vmallocator* %0, %struct.vmallocator** %3
store i64 %1, i64* %4
%5 = load %struct.vmallocator*, %struct.vmallocator** %3
%6 = load %struct.vmallocator*, %struct.vmallocator** %3
%7 = load i64, i64* %4
%8 = call i32 @vmallocator_alloc_aligned(%struct.vmallocator* %6, i64 %7)
%9 = call i8* @vmallocator_ofs2mem(%struct.vmallocator* %5, i32 %8)
ret i8* %9
}

LLVM IR (-O2):
%struct.vmallocator = type { i32 }
define i8* @vmallocator_allocptr_aligned(%struct.vmallocator* %0, i64 %1) {
%3 = tail call i32 @vmallocator_alloc_aligned(%struct.vmallocator* %0, i64 %1)
%4 = tail call i8* @vmallocator_ofs2mem(%struct.vmallocator* %0, i32 %3)
ret i8* %4
}