xunge/DecIR huggingface dataset:
/* Type definitions */
typedef int uint8_t;
typedef int uint32_t;

/* Variables and functions */
uint32_t strmap_make_mask(uint32_t A, uint32_t B) {
  uint8_t diff;
  diff = A ^ B;
  diff |= diff >> 1;
  diff |= diff >> 2;
  diff |= diff >> 4;
  return (diff & ~(diff >> 1)) ^ 255;
}


x86 assembly (clang, -O0):
<strmap_make_mask>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    -0x4(%rbp),%eax
xor    -0x8(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x1,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x2,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x4,%eax
or     -0xc(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
mov    -0xc(%rbp),%ecx
sar    $0x1,%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
xor    $0xff,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strmap_make_mask>:
xor    %esi,%edi
mov    %edi,%eax
sar    %eax
or     %edi,%eax
mov    %eax,%ecx
sar    $0x2,%ecx
or     %eax,%ecx
mov    %ecx,%edx
sar    $0x4,%edx
or     %ecx,%edx
mov    %edx,%eax
sar    %eax
not    %eax
and    %edx,%eax
xor    $0xff,%eax
ret

LLVM IR (-O0):
define i32 @strmap_make_mask(i32 %0, i32 %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
store i32 %0, i32* %3
store i32 %1, i32* %4
%6 = load i32, i32* %3
%7 = load i32, i32* %4
%8 = xor i32 %6, %7
store i32 %8, i32* %5
%9 = load i32, i32* %5
%10 = ashr i32 %9, 1
%11 = load i32, i32* %5
%12 = or i32 %11, %10
store i32 %12, i32* %5
%13 = load i32, i32* %5
%14 = ashr i32 %13, 2
%15 = load i32, i32* %5
%16 = or i32 %15, %14
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = ashr i32 %17, 4
%19 = load i32, i32* %5
%20 = or i32 %19, %18
store i32 %20, i32* %5
%21 = load i32, i32* %5
%22 = load i32, i32* %5
%23 = ashr i32 %22, 1
%24 = xor i32 %23, -1
%25 = and i32 %21, %24
%26 = xor i32 %25, 255
ret i32 %26
}

LLVM IR (-O2):
define i32 @strmap_make_mask(i32 %0, i32 %1) {
%3 = xor i32 %1, %0
%4 = ashr i32 %3, 1
%5 = or i32 %4, %3
%6 = ashr i32 %5, 2
%7 = or i32 %6, %5
%8 = ashr i32 %7, 4
%9 = or i32 %8, %7
%10 = ashr i32 %9, 1
%11 = xor i32 %10, -1
%12 = and i32 %9, %11
%13 = xor i32 %12, 255
ret i32 %13
}
void pthread_once() {}


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

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

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

LLVM IR (-O2):
define void @pthread_once() {
ret void
}
int f(char *restrict x) { return x[0]; }


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

x86 assembly (clang, -O2):
<f>:
movsbl (%rdi),%eax
ret

LLVM IR (-O0):
define i32 @f(i8* noalias %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = load i8*, i8** %2
%4 = getelementptr inbounds i8, i8* %3, i64 0
%5 = load i8, i8* %4
%6 = sext i8 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @f(i8* noalias nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
ret i32 %3
}
void omap_iommu_debugfs_remove(struct omap_iommu *obj) {}


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

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

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

LLVM IR (-O2):
%struct.omap_iommu = type opaque
define void @omap_iommu_debugfs_remove(%struct.omap_iommu* nocapture %0) {
ret void
}
/* Type definitions */
typedef int /*<<< orphan*/ str;

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int);
void func(char str[100]) { printf("%d\n", sizeof(str) == 8); }


x86 assembly (clang, -O0):
<func>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xedd(%rip),%rdi
mov    $0x1,%esi
call   1030 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<func>:
lea    0xee9(%rip),%rdi
mov    $0x1,%esi
jmp    1030 <printf@plt>

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

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
define void @func(i8* nocapture readnone %0) {
%2 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 1)
ret void
}
/* Variables and functions */
int baz();
int main() {
  int foobar = baz();
  return 0;
}


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

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

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

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @baz()
ret i32 0
}
void rop3_1_1_1(unsigned char *D, unsigned char S, unsigned char T) {
  unsigned char stk1;
  unsigned char stk2;
  stk2 = T | S;
  stk1 = *D | stk2;
  stk1 = ~stk1;
  *D = (stk1 & (~S) & (~T)) | (*D & S) | (*D & T);
}


x86 assembly (clang, -O0):
<rop3_1_1_1>:
push   %rbp
mov    %rsp,%rbp
mov    %dl,%al
mov    %sil,%cl
mov    %rdi,-0x8(%rbp)
mov    %cl,-0x9(%rbp)
mov    %al,-0xa(%rbp)
movzbl -0xa(%rbp),%eax
movzbl -0x9(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xc(%rbp)
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
movzbl -0xc(%rbp),%ecx
or     %ecx,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
xor    $0xffffffff,%eax
mov    %al,-0xb(%rbp)
movzbl -0xb(%rbp),%eax
movzbl -0x9(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
movzbl -0xa(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0x9(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%ecx
movzbl -0xa(%rbp),%edx
and    %edx,%ecx
or     %ecx,%eax
mov    %al,%cl
mov    -0x8(%rbp),%rax
mov    %cl,(%rax)
pop    %rbp
ret

x86 assembly (clang, -O2):
<rop3_1_1_1>:
mov    %edx,%eax
or     %sil,%al
mov    (%rdi),%cl
or     %cl,%al
not    %al
and    %cl,%sil
and    %dl,%cl
or     %sil,%cl
or     %al,%cl
mov    %cl,(%rdi)
ret

LLVM IR (-O0):
define void @rop3_1_1_1(i8* %0, i8 zeroext %1, i8 zeroext %2) {
%4 = alloca i8*
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
store i8 %2, i8* %6
%9 = load i8, i8* %6
%10 = zext i8 %9 to i32
%11 = load i8, i8* %5
%12 = zext i8 %11 to i32
%13 = or i32 %10, %12
%14 = trunc i32 %13 to i8
store i8 %14, i8* %8
%15 = load i8*, i8** %4
%16 = load i8, i8* %15
%17 = zext i8 %16 to i32
%18 = load i8, i8* %8
%19 = zext i8 %18 to i32
%20 = or i32 %17, %19
%21 = trunc i32 %20 to i8
store i8 %21, i8* %7
%22 = load i8, i8* %7
%23 = zext i8 %22 to i32
%24 = xor i32 %23, -1
%25 = trunc i32 %24 to i8
store i8 %25, i8* %7
%26 = load i8, i8* %7
%27 = zext i8 %26 to i32
%28 = load i8, i8* %5
%29 = zext i8 %28 to i32
%30 = xor i32 %29, -1
%31 = and i32 %27, %30
%32 = load i8, i8* %6
%33 = zext i8 %32 to i32
%34 = xor i32 %33, -1
%35 = and i32 %31, %34
%36 = load i8*, i8** %4
%37 = load i8, i8* %36
%38 = zext i8 %37 to i32
%39 = load i8, i8* %5
%40 = zext i8 %39 to i32
%41 = and i32 %38, %40
%42 = or i32 %35, %41
%43 = load i8*, i8** %4
%44 = load i8, i8* %43
%45 = zext i8 %44 to i32
%46 = load i8, i8* %6
%47 = zext i8 %46 to i32
%48 = and i32 %45, %47
%49 = or i32 %42, %48
%50 = trunc i32 %49 to i8
%51 = load i8*, i8** %4
store i8 %50, i8* %51
ret void
}

LLVM IR (-O2):
define void @rop3_1_1_1(i8* nocapture %0, i8 zeroext %1, i8 zeroext %2) {
%4 = or i8 %2, %1
%5 = load i8, i8* %0
%6 = or i8 %4, %5
%7 = xor i8 %6, -1
%8 = and i8 %5, %1
%9 = or i8 %8, %7
%10 = and i8 %5, %2
%11 = or i8 %9, %10
store i8 %11, i8* %0
ret void
}
int test() {
  int i = 1;
  if ((i == 1 ? 2 : 3) != 2)
    return 1;
  return 0;
}


x86 assembly (clang, -O0):
<test>:
push   %rbp
mov    %rsp,%rbp
movl   $0x1,-0x8(%rbp)
mov    -0x8(%rbp),%edx
mov    $0x3,%eax
mov    $0x2,%ecx
cmp    $0x1,%edx
cmove  %ecx,%eax
cmp    $0x2,%eax
je     1133 <test+0x33>
movl   $0x1,-0x4(%rbp)
jmp    113a <test+0x3a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

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

LLVM IR (-O0):
define i32 @test() {
%1 = alloca i32
%2 = alloca i32
store i32 1, i32* %2
%3 = load i32, i32* %2
%4 = icmp eq i32 %3, 1
%5 = zext i1 %4 to i64
%6 = select i1 %4, i32 2, i32 3
%7 = icmp ne i32 %6, 2
br i1 %7, label %8, label %9
8: ; preds = %0
store i32 1, i32* %1
br label %10
9: ; preds = %0
store i32 0, i32* %1
br label %10
10: ; preds = %9, %8
%11 = load i32, i32* %1
ret i32 %11
}

LLVM IR (-O2):
define i32 @test() {
ret i32 0
}
long decimalToBinary(long n) {
  int remainder;
  long binary = 0, i = 1;
  while (n != 0) {
    remainder = n % 2;
    n = n / 2;
    binary = binary + (remainder * i);
    i = i * 10;
  }
  return binary;
}


x86 assembly (clang, -O0):
<decimalToBinary>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movq   $0x0,-0x18(%rbp)
movq   $0x1,-0x20(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     116a <decimalToBinary+0x6a>
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %edx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   -0x20(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
imul   $0xa,-0x20(%rbp),%rax
mov    %rax,-0x20(%rbp)
jmp    1118 <decimalToBinary+0x18>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<decimalToBinary>:
test   %rdi,%rdi
je     1146 <decimalToBinary+0x46>
mov    $0x1,%ecx
xor    %eax,%eax
nopl   0x0(%rax)
mov    %rdi,%rdx
shr    $0x3f,%rdx
add    %rdi,%rdx
mov    %rdx,%r8
sar    %r8
and    $0xfffffffffffffffe,%rdx
mov    %rdi,%rsi
sub    %rdx,%rsi
imul   %rcx,%rsi
add    %rsi,%rax
add    %rcx,%rcx
lea    (%rcx,%rcx,4),%rcx
add    $0x1,%rdi
cmp    $0x2,%rdi
mov    %r8,%rdi
ja     1110 <decimalToBinary+0x10>
ret
xor    %eax,%eax
ret

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

LLVM IR (-O2):
define i64 @decimalToBinary(i64 %0) {
%2 = icmp eq i64 %0, 0
br i1 %2, label %14, label %3
3: ; preds = %1, %3
%4 = phi i64 [ %11, %3 ], [ 1, %1 ]
%5 = phi i64 [ %10, %3 ], [ 0, %1 ]
%6 = phi i64 [ %8, %3 ], [ %0, %1 ]
%7 = srem i64 %6, 2
%8 = sdiv i64 %6, 2
%9 = mul nsw i64 %4, %7
%10 = add nsw i64 %9, %5
%11 = mul nsw i64 %4, 10
%12 = add i64 %6, 1
%13 = icmp ult i64 %12, 3
br i1 %13, label %14, label %3
14: ; preds = %3, %1
%15 = phi i64 [ 0, %1 ], [ %10, %3 ]
ret i64 %15
}
int get_romsize(int n) {
  if (n <= 0x8)
    return 32768 << n;
  else if (n == 0x52)
    return 32768 * 36;
  else if (n == 0x53)
    return 32768 * 40;
  else if (n == 0x54)
    return 32768 * 46;
  else
    return 0;
}


x86 assembly (clang, -O0):
<get_romsize>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x8(%rbp)
cmpl   $0x8,-0x8(%rbp)
jg     1123 <get_romsize+0x23>
mov    -0x8(%rbp),%ecx
mov    $0x8000,%eax
shl    %cl,%eax
mov    %eax,-0x4(%rbp)
jmp    116c <get_romsize+0x6c>
cmpl   $0x52,-0x8(%rbp)
jne    1139 <get_romsize+0x39>
movl   $0x120000,-0x4(%rbp)
jmp    116c <get_romsize+0x6c>
cmpl   $0x53,-0x8(%rbp)
jne    114f <get_romsize+0x4f>
movl   $0x140000,-0x4(%rbp)
jmp    116c <get_romsize+0x6c>
cmpl   $0x54,-0x8(%rbp)
jne    1165 <get_romsize+0x65>
movl   $0x170000,-0x4(%rbp)
jmp    116c <get_romsize+0x6c>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<get_romsize>:
cmp    $0x8,%edi
jg     110f <get_romsize+0xf>
mov    $0x8000,%eax
mov    %edi,%ecx
shl    %cl,%eax
ret
add    $0xffffffae,%edi
xor    %eax,%eax
cmp    $0x2,%edi
ja     1126 <get_romsize+0x26>
movslq %edi,%rax
lea    0xedd(%rip),%rcx
mov    (%rcx,%rax,4),%eax
ret

LLVM IR (-O0):
define i32 @get_romsize(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %3
%4 = load i32, i32* %3
%5 = icmp sle i32 %4, 8
br i1 %5, label %6, label %9
6: ; preds = %1
%7 = load i32, i32* %3
%8 = shl i32 32768, %7
store i32 %8, i32* %2
br label %22
9: ; preds = %1
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 82
br i1 %11, label %12, label %13
12: ; preds = %9
store i32 1179648, i32* %2
br label %22
13: ; preds = %9
%14 = load i32, i32* %3
%15 = icmp eq i32 %14, 83
br i1 %15, label %16, label %17
16: ; preds = %13
store i32 1310720, i32* %2
br label %22
17: ; preds = %13
%18 = load i32, i32* %3
%19 = icmp eq i32 %18, 84
br i1 %19, label %20, label %21
20: ; preds = %17
store i32 1507328, i32* %2
br label %22
21: ; preds = %17
store i32 0, i32* %2
br label %22
22: ; preds = %21, %20, %16, %12, %6
%23 = load i32, i32* %2
ret i32 %23
}

LLVM IR (-O2):
@switch.table.get_romsize = [3 x i32] [i32 1179648, i32 1310720, i32 1507328]
define i32 @get_romsize(i32 %0) {
%2 = icmp slt i32 %0, 9
br i1 %2, label %3, label %5
3: ; preds = %1
%4 = shl nuw nsw i32 32768, %0
br label %12
5: ; preds = %1
%6 = add i32 %0, -82
%7 = icmp ult i32 %6, 3
br i1 %7, label %8, label %12
8: ; preds = %5
%9 = sext i32 %6 to i64
%10 = getelementptr inbounds [3 x i32], [3 x i32]* @switch.table.get_romsize, i64 0, i64 %9
%11 = load i32, i32* %10
br label %12
12: ; preds = %5, %8, %3
%13 = phi i32 [ %4, %3 ], [ %11, %8 ], [ 0, %5 ]
ret i32 %13
}
unsigned long b_string_find_char(unsigned char *str, unsigned char chr) {
  unsigned long pos;
  asm volatile("call 0x00100078" : "=a"(pos) : "a"(chr), "S"(str));
  return pos;
}


x86 assembly (clang, -O0):
<b_string_find_char>:
push   %rbp
mov    %rsp,%rbp
mov    %sil,%al
mov    %rdi,-0x8(%rbp)
mov    %al,-0x9(%rbp)
mov    -0x9(%rbp),%al
mov    -0x8(%rbp),%rsi
call   100078 <completed.0+0xfc058>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<b_string_find_char>:
mov    %esi,%eax
mov    %rdi,%rsi
call   100078 <completed.0+0xfc058>
ret

LLVM IR (-O0):
define i64 @b_string_find_char(i8* %0, i8 zeroext %1) {
%3 = alloca i8*
%4 = alloca i8
%5 = alloca i64
store i8* %0, i8** %3
store i8 %1, i8* %4
%6 = load i8, i8* %4
%7 = load i8*, i8** %3
%8 = call i64 asm sideeffect "call 0x00100078", "={ax},{ax},{si},~{dirflag},~{fpsr},~{flags}"(i8 %6, i8* %7)
store i64 %8, i64* %5
%9 = load i64, i64* %5
ret i64 %9
}

LLVM IR (-O2):
define i64 @b_string_find_char(i8* %0, i8 zeroext %1) {
%3 = tail call i64 asm sideeffect "call 0x00100078", "={ax},{ax},{si},~{dirflag},~{fpsr},~{flags}"(i8 %1, i8* %0)
ret i64 %3
}
/* Type definitions */
typedef int /*<<< orphan*/ sigset_t;

/* Variables and functions */
int /*<<< orphan*/ SIG_BLOCK;
int /*<<< orphan*/ sigaddset(int /*<<< orphan*/ *, int);
int /*<<< orphan*/ sigemptyset(int /*<<< orphan*/ *);
int /*<<< orphan*/ sigprocmask(int /*<<< orphan*/, int /*<<< orphan*/ *,
                               int /*<<< orphan*/ *);
void sig_block(int sig) {
  sigset_t ss;
  sigemptyset(&ss);
  sigaddset(&ss, sig);
  sigprocmask(SIG_BLOCK, &ss, (sigset_t *)0);
}


x86 assembly (clang, -O0):
<sig_block>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
lea    -0x8(%rbp),%rdi
call   1040 <sigemptyset@plt>
mov    -0x4(%rbp),%esi
lea    -0x8(%rbp),%rdi
call   1050 <sigaddset@plt>
mov    0x2e89(%rip),%rax
mov    (%rax),%edi
lea    -0x8(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%edx
call   1030 <sigprocmask@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<sig_block>:
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebx
lea    0x4(%rsp),%r14
mov    %r14,%rdi
call   1040 <sigemptyset@plt>
mov    %r14,%rdi
mov    %ebx,%esi
call   1050 <sigaddset@plt>
mov    0x2e8c(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %edx,%edx
call   1030 <sigprocmask@plt>
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@SIG_BLOCK = global i32 0
define void @sig_block(i32 %0) {
%2 = alloca i32
%3 = alloca i32
store i32 %0, i32* %2
%4 = call i32 @sigemptyset(i32* %3)
%5 = load i32, i32* %2
%6 = call i32 @sigaddset(i32* %3, i32 %5)
%7 = load i32, i32* @SIG_BLOCK
%8 = call i32 @sigprocmask(i32 %7, i32* %3, i32* null)
ret void
}

LLVM IR (-O2):
@SIG_BLOCK = global i32 0
define void @sig_block(i32 %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
%4 = call i32 @sigemptyset(i32* %2)
%5 = call i32 @sigaddset(i32* %2, i32 %0)
%6 = load i32, i32* @SIG_BLOCK
%7 = call i32 @sigprocmask(i32 %6, i32* %2, i32* null)
ret void
}
/* Variables and functions */
int /*<<< orphan*/ __environ;
int execve(char const *, char *const *, int /*<<< orphan*/);
int execv(const char *path, char *const argv[]) {
  return execve(path, argv, __environ);
}


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

x86 assembly (clang, -O2):
<execv>:
mov    0x2ee1(%rip),%rax
mov    (%rax),%edx
jmp    1030 <execve@plt>

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

LLVM IR (-O2):
@__environ = global i32 0
define i32 @execv(i8* %0, i8** %1) {
%3 = load i32, i32* @__environ
%4 = tail call i32 @execve(i8* %0, i8** %1, i32 %3)
ret i32 %4
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
void help() { printf("Help from another file"); }


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

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

LLVM IR (-O0):
@.str = [23 x i8] c"Help from another file\00"
define void @help() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [23 x i8] c"Help from another file\00"
define void @help() {
%1 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
ret void
}
char *strcpy(char *restrict dst, const char *restrict src) {
  char *ret = dst;
  while (*dst++ = *src++)
    ;
  return ret;
}


x86 assembly (clang, -O0):
<strcpy>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    -0x8(%rbp),%rcx
mov    %rcx,%rdx
add    $0x1,%rdx
mov    %rdx,-0x8(%rbp)
mov    %al,(%rcx)
cmp    $0x0,%al
je     1143 <strcpy+0x43>
jmp    1114 <strcpy+0x14>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strcpy>:
mov    %rdi,%rax
xor    %ecx,%ecx
cs nopw 0x0(%rax,%rax,1)
nop
movzbl (%rsi,%rcx,1),%edx
mov    %dl,(%rax,%rcx,1)
add    $0x1,%rcx
test   %dl,%dl
jne    1110 <strcpy+0x10>
ret

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

LLVM IR (-O2):
define i8* @strcpy(i8* noalias returned writeonly %0, i8* noalias nocapture %1) {
br label %3
3: ; preds = %3, %2
%4 = phi i8* [ %1, %2 ], [ %6, %3 ]
%5 = phi i8* [ %0, %2 ], [ %8, %3 ]
%6 = getelementptr inbounds i8, i8* %4, i64 1
%7 = load i8, i8* %4
%8 = getelementptr inbounds i8, i8* %5, i64 1
store i8 %7, i8* %5
%9 = icmp eq i8 %7, 0
br i1 %9, label %10, label %3
10: ; preds = %3
ret i8* %0
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc, char **argv) {
  printf("Hello"
         " "
         "World"
         "\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 = [13 x i8] c"Hello World\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 ([13 x i8], [13 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [12 x i8] c"Hello World\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str, i64 0, i64 0))
ret i32 0
}
/* Variables and functions */
int /*<<< orphan*/ printenv();
int /*<<< orphan*/ printf(char *);
void testprintenv(void) {
  printf("printenv () produces:\n");
  printenv();
}


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

x86 assembly (clang, -O2):
<testprintenv>:
push   %rax
lea    0xed8(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
pop    %rcx
jmp    1040 <printenv@plt>

LLVM IR (-O0):
@.str = [23 x i8] c"printenv () produces:\0A\00"
define void @testprintenv() {
%1 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str, i64 0, i64 0))
%2 = call i32 (...) @printenv()
ret void
}

LLVM IR (-O2):
@str = [22 x i8] c"printenv () produces:\00"
define void @testprintenv() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 (...) @printenv()
ret void
}
int test1(int a) { return (a ^ 6) == 2; }


x86 assembly (clang, -O0):
<test1>:
push   %rbp
mov    %rsp,%rbp
mov    %edi,-0x4(%rbp)
mov    -0x4(%rbp),%eax
xor    $0x6,%eax
cmp    $0x2,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test1>:
xor    %eax,%eax
cmp    $0x4,%edi
sete   %al
ret

LLVM IR (-O0):
define i32 @test1(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = xor i32 %3, 6
%5 = icmp eq i32 %4, 2
%6 = zext i1 %5 to i32
ret i32 %6
}

LLVM IR (-O2):
define i32 @test1(i32 %0) {
%2 = icmp eq i32 %0, 4
%3 = zext i1 %2 to i32
ret i32 %3
}
/* Variables and functions */
int /*<<< orphan*/ xx(char *, char *, int, int, int /*<<< orphan*/,
                      int /*<<< orphan*/);
void x2(char *pattern, char *str, int from, int to) {
  xx(pattern, str, from, to, 0, 0);
}


x86 assembly (clang, -O0):
<x2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x18(%rbp),%ecx
xor    %r9d,%r9d
mov    %r9d,%r8d
call   1030 <xx@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<x2>:
xor    %r8d,%r8d
xor    %r9d,%r9d
jmp    1030 <xx@plt>

LLVM IR (-O0):
define void @x2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i32
%8 = alloca i32
store i8* %0, i8** %5
store i8* %1, i8** %6
store i32 %2, i32* %7
store i32 %3, i32* %8
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = load i32, i32* %7
%12 = load i32, i32* %8
%13 = call i32 @xx(i8* %9, i8* %10, i32 %11, i32 %12, i32 0, i32 0)
ret void
}

LLVM IR (-O2):
define void @x2(i8* %0, i8* %1, i32 %2, i32 %3) {
%5 = tail call i32 @xx(i8* %0, i8* %1, i32 %2, i32 %3, i32 0, i32 0)
ret void
}
/* Type definitions */
typedef float uint8_t;

/* Variables and functions */
float powf(float, float);
float note_to_frequency(uint8_t note) {
  return 440.0f * powf(2.0f, (note - 69.0f) / 12.0f);
}


x86 assembly (clang, -O0):
<note_to_frequency>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm1
movss  0xee2(%rip),%xmm0
subss  %xmm0,%xmm1
movss  0xed2(%rip),%xmm0
divss  %xmm0,%xmm1
movss  0xec2(%rip),%xmm0
call   1030 <powf@plt>
movaps %xmm0,%xmm1
movss  0xeae(%rip),%xmm0
mulss  %xmm1,%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<note_to_frequency>:
push   %rax
addss  0xee7(%rip),%xmm0
divss  0xee3(%rip),%xmm0
call   1030 <exp2f@plt>
mulss  0xeda(%rip),%xmm0
pop    %rax
ret

LLVM IR (-O0):
define float @note_to_frequency(float %0) {
%2 = alloca float
store float %0, float* %2
%3 = load float, float* %2
%4 = fsub float %3, 6.900000e+01
%5 = fdiv float %4, 1.200000e+01
%6 = call float @powf(float 2.000000e+00, float %5)
%7 = fmul float 4.400000e+02, %6
ret float %7
}

LLVM IR (-O2):
define float @note_to_frequency(float %0) {
%2 = fadd float %0, -6.900000e+01
%3 = fdiv float %2, 1.200000e+01
%4 = tail call float @exp2f(float %3)
%5 = fmul float %4, 4.400000e+02
ret float %5
}
void test96_Test_targetInit__I() {}


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

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

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

LLVM IR (-O2):
define void @test96_Test_targetInit__I() {
ret void
}
void foo(int *p, int n) {
  int i;
  for (i = 0; i < n; ++i)
    p[i] = 0;
}


x86 assembly (clang, -O0):
<foo>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    113b <foo+0x3b>
mov    -0x8(%rbp),%rax
movslq -0x10(%rbp),%rcx
movl   $0x0,(%rax,%rcx,4)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1112 <foo+0x12>
pop    %rbp
ret

x86 assembly (clang, -O2):
<foo>:
test   %esi,%esi
jle    1126 <foo+0x16>
push   %rax
mov    %esi,%edx
shl    $0x2,%rdx
xor    %esi,%esi
call   1030 <memset@plt>
add    $0x8,%rsp
ret

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

LLVM IR (-O2):
define void @foo(i32* nocapture writeonly %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %8
4: ; preds = %2
%5 = bitcast i32* %0 to i8*
%6 = zext i32 %1 to i64
%7 = shl nuw nsw i64 %6, 2
br label %8
8: ; preds = %4, %2
ret void
}
char *strrchr(const char *string, int c) {
  char *last_found;
  while (*string) {
    if (*string == c) {
      last_found = (char *)string;
    }
    string++;
  }
  return last_found;
}


x86 assembly (clang, -O0):
<strrchr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    -0x8(%rbp),%rax
cmpb   $0x0,(%rax)
je     1141 <strrchr+0x41>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    -0xc(%rbp),%eax
jne    1130 <strrchr+0x30>
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    110b <strrchr+0xb>
mov    -0x18(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<strrchr>:
mov    (%rdi),%cl
test   %cl,%cl
je     1125 <strrchr+0x25>
cs nopw 0x0(%rax,%rax,1)
movsbl %cl,%ecx
cmp    %esi,%ecx
cmove  %rdi,%rax
movzbl 0x1(%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <strrchr+0x10>
ret

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

LLVM IR (-O2):
define i8* @strrchr(i8* %0, i32 %1) {
%3 = load i8, i8* %0
%4 = icmp eq i8 %3, 0
br i1 %4, label %15, label %5
5: ; preds = %2, %5
%6 = phi i8 [ %13, %5 ], [ %3, %2 ]
%7 = phi i8* [ %11, %5 ], [ undef, %2 ]
%8 = phi i8* [ %12, %5 ], [ %0, %2 ]
%9 = sext i8 %6 to i32
%10 = icmp eq i32 %9, %1
%11 = select i1 %10, i8* %8, i8* %7
%12 = getelementptr inbounds i8, i8* %8, i64 1
%13 = load i8, i8* %12
%14 = icmp eq i8 %13, 0
br i1 %14, label %15, label %5
15: ; preds = %5, %2
%16 = phi i8* [ undef, %2 ], [ %11, %5 ]
ret i8* %16
}
/* Variables and functions */
int blist_iter_can_has(void) { return 1; }


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

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

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

LLVM IR (-O2):
define i32 @blist_iter_can_has() {
ret i32 1
}
/* Type definitions */
typedef int /*<<< orphan*/ DES_cblock;

/* Variables and functions */
scalar_t__ DES_is_weak_key(int /*<<< orphan*/ *);
int /*<<< orphan*/ DES_set_odd_parity(int /*<<< orphan*/ *);
int RAND_priv_bytes(unsigned char *, int);
int DES_random_key(DES_cblock *ret) {
  do {
    if (RAND_priv_bytes((unsigned char *)ret, sizeof(DES_cblock)) != 1)
      return 0;
  } while (DES_is_weak_key(ret));
  DES_set_odd_parity(ret);
  return 1;
}


x86 assembly (clang, -O0):
<DES_random_key>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rdi
mov    $0x4,%esi
call   1030 <RAND_priv_bytes@plt>
cmp    $0x1,%eax
je     115f <DES_random_key+0x2f>
movl   $0x0,-0x4(%rbp)
jmp    1187 <DES_random_key+0x57>
jmp    1164 <DES_random_key+0x34>
mov    -0x10(%rbp),%rdi
call   1040 <DES_is_weak_key@plt>
cmp    $0x0,%rax
jne    113c <DES_random_key+0xc>
mov    -0x10(%rbp),%rdi
call   1050 <DES_set_odd_parity@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<DES_random_key>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %rbx,%rdi
mov    $0x4,%esi
call   1030 <RAND_priv_bytes@plt>
cmp    $0x1,%eax
jne    116e <DES_random_key+0x3e>
mov    %rbx,%rdi
call   1040 <DES_is_weak_key@plt>
test   %rax,%rax
jne    1140 <DES_random_key+0x10>
mov    %rbx,%rdi
call   1050 <DES_set_odd_parity@plt>
mov    $0x1,%eax
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
define i32 @DES_random_key(i32* %0) {
%2 = bitcast i32* %0 to i8*
br label %3
3: ; preds = %6, %1
%4 = tail call i32 @RAND_priv_bytes(i8* %2, i32 4)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %11
6: ; preds = %3
%7 = tail call i64 @DES_is_weak_key(i32* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %9, label %3
9: ; preds = %6
%10 = tail call i32 @DES_set_odd_parity(i32* %0)
br label %11
11: ; preds = %3, %9
%12 = phi i32 [ 1, %9 ], [ 0, %3 ]
ret i32 %12
}
void fc22(int n) {
  {
    typedef int(*b)[n];
    goto a;
    {
      typedef int(*c)[n];
      0;
    }
    {
      typedef int(*d)[n];
      0;
    }
  a:;
    typedef int(*e)[n];
    0;
  };
  {
    typedef int(*f)[n];
    {
      typedef int(*g)[n];
      0;
    };
    {
      typedef int(*h)[n];
      0;
    };
    ;
    typedef int(*i)[n];
    0;
  };
  ;
  typedef int(*j)[n];
  0;
}


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

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

LLVM IR (-O0):
define void @fc22(i32 %0) {
%2 = alloca i32
store i32 %0, i32* %2
%3 = load i32, i32* %2
%4 = zext i32 %3 to i64
br label %10
5: ; No predecessors!
%6 = load i32, i32* %2
%7 = zext i32 %6 to i64
%8 = load i32, i32* %2
%9 = zext i32 %8 to i64
br label %10
10: ; preds = %5, %1
%11 = load i32, i32* %2
%12 = zext i32 %11 to i64
%13 = load i32, i32* %2
%14 = zext i32 %13 to i64
%15 = load i32, i32* %2
%16 = zext i32 %15 to i64
%17 = load i32, i32* %2
%18 = zext i32 %17 to i64
%19 = load i32, i32* %2
%20 = zext i32 %19 to i64
%21 = load i32, i32* %2
%22 = zext i32 %21 to i64
ret void
}

LLVM IR (-O2):
define void @fc22(i32 %0) {
ret void
}
/* Variables and functions */
int /*<<< orphan*/ SystemSettingsHandle();
int /*<<< orphan*/ UAVObjUpdated(int /*<<< orphan*/);
void SystemSettingsUpdated() { UAVObjUpdated(SystemSettingsHandle()); }


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

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

LLVM IR (-O0):
define void @SystemSettingsUpdated() {
%1 = call i32 (...) @SystemSettingsHandle()
%2 = call i32 @UAVObjUpdated(i32 %1)
ret void
}

LLVM IR (-O2):
define void @SystemSettingsUpdated() {
%1 = tail call i32 (...) @SystemSettingsHandle()
%2 = tail call i32 @UAVObjUpdated(i32 %1)
ret void
}
/* Variables and functions */
int EXIT_SUCCESS;
int /*<<< orphan*/ printf(char *);
int main() {
  printf("Konnichiwa :D\n");
  return EXIT_SUCCESS;
}


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

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

LLVM IR (-O0):
@.str = [15 x i8] c"Konnichiwa :D\0A\00"
@EXIT_SUCCESS = global i32 0
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%3 = load i32, i32* @EXIT_SUCCESS
ret i32 %3
}

LLVM IR (-O2):
@EXIT_SUCCESS = global i32 0
@str = [14 x i8] c"Konnichiwa :D\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @str, i64 0, i64 0))
%2 = load i32, i32* @EXIT_SUCCESS
ret i32 %2
}
/* Variables and functions */
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
void usage() {
  printf("Usage: getbound <gridfile> [-c] [-i {DD|CO}] [-r] [-v]\n");
  printf("Try \"getbound -h\" for more information\n");
  exit(0);
}


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

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

LLVM IR (-O0):
@.str = [56 x i8] c"Usage: getbound <gridfile> [-c] [-i {DD|CO}] [-r] [-v]\0A\00"
@.str.1 = [40 x i8] c"Try \22getbound -h\22 for more information\0A\00"
define void @usage() {
%1 = call i32 @printf(i8* getelementptr inbounds ([56 x i8], [56 x i8]* @.str, i64 0, i64 0))
%2 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.1, i64 0, i64 0))
%3 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@str = [55 x i8] c"Usage: getbound <gridfile> [-c] [-i {DD|CO}] [-r] [-v]\00"
@str.2 = [39 x i8] c"Try \22getbound -h\22 for more information\00"
define void @usage() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([55 x i8], [55 x i8]* @str, i64 0, i64 0))
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.2, i64 0, i64 0))
%3 = tail call i32 @exit(i32 0)
unreachable
}
/* Type definitions */
typedef enum E { ____Placeholder_E } E;

/* Variables and functions */
int /*<<< orphan*/ PR8694(int *);
void crash(enum E *e) { PR8694(e); }


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

x86 assembly (clang, -O2):
<crash>:
jmp    1030 <PR8694@plt>

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

LLVM IR (-O2):
define void @crash(i32* %0) {
%2 = tail call i32 @PR8694(i32* %0)
ret void
}
/* Type definitions */
typedef scalar_t__ uint16_t;
typedef int /*<<< orphan*/ int16_t;

/* Variables and functions */
int16_t InsSequenceDiff(uint16_t a, uint16_t b) { return (int16_t)(a - b); }


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

x86 assembly (clang, -O2):
<InsSequenceDiff>:
mov    %rdi,%rax
sub    %esi,%eax
ret

LLVM IR (-O0):
define i32 @InsSequenceDiff(i64 %0, i64 %1) {
%3 = alloca i64
%4 = alloca i64
store i64 %0, i64* %3
store i64 %1, i64* %4
%5 = load i64, i64* %3
%6 = load i64, i64* %4
%7 = sub nsw i64 %5, %6
%8 = trunc i64 %7 to i32
ret i32 %8
}

LLVM IR (-O2):
define i32 @InsSequenceDiff(i64 %0, i64 %1) {
%3 = sub nsw i64 %0, %1
%4 = trunc i64 %3 to i32
ret i32 %4
}
/* Type definitions */
struct vec3 {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ vec3_max(float *, float *, float *);
__attribute__((always_)) struct vec3 *
psvec3_max(struct vec3 *result, struct vec3 *a, struct vec3 *b) {
  vec3_max((float *)result, (float *)a, (float *)b);
  return result;
}


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

x86 assembly (clang, -O2):
<psvec3_max>:
push   %rbx
mov    %rdi,%rbx
call   1030 <vec3_max@plt>
mov    %rbx,%rax
pop    %rbx
ret

LLVM IR (-O0):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_max(%struct.vec3* %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = alloca %struct.vec3*
%5 = alloca %struct.vec3*
%6 = alloca %struct.vec3*
store %struct.vec3* %0, %struct.vec3** %4
store %struct.vec3* %1, %struct.vec3** %5
store %struct.vec3* %2, %struct.vec3** %6
%7 = load %struct.vec3*, %struct.vec3** %4
%8 = bitcast %struct.vec3* %7 to float*
%9 = load %struct.vec3*, %struct.vec3** %5
%10 = bitcast %struct.vec3* %9 to float*
%11 = load %struct.vec3*, %struct.vec3** %6
%12 = bitcast %struct.vec3* %11 to float*
%13 = call i32 @vec3_max(float* %8, float* %10, float* %12)
%14 = load %struct.vec3*, %struct.vec3** %4
ret %struct.vec3* %14
}

LLVM IR (-O2):
%struct.vec3 = type { i32 }
define %struct.vec3* @psvec3_max(%struct.vec3* returned %0, %struct.vec3* %1, %struct.vec3* %2) {
%4 = bitcast %struct.vec3* %0 to float*
%5 = bitcast %struct.vec3* %1 to float*
%6 = bitcast %struct.vec3* %2 to float*
%7 = tail call i32 @vec3_max(float* %4, float* %5, float* %6)
ret %struct.vec3* %0
}
const char *mz_version(void) { return "10.0.0"; }


x86 assembly (clang, -O0):
<mz_version>:
push   %rbp
mov    %rsp,%rbp
lea    0xef5(%rip),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<mz_version>:
lea    0xef9(%rip),%rax
ret

LLVM IR (-O0):
@.str = [7 x i8] c"10.0.0\00"
define i8* @mz_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}

LLVM IR (-O2):
@.str = [7 x i8] c"10.0.0\00"
define i8* @mz_version() {
ret i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0)
}
char *AdvanceToBlank(char *ptr) {
  while (*ptr != ' ') {
    ptr++;
  }
  return (ptr);
}


x86 assembly (clang, -O0):
<AdvanceToBlank>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x20,%eax
je     1129 <AdvanceToBlank+0x29>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    1108 <AdvanceToBlank+0x8>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<AdvanceToBlank>:
mov    %rdi,%rax
add    $0xffffffffffffffff,%rax
nopw   0x0(%rax,%rax,1)
cmpb   $0x20,0x1(%rax)
lea    0x1(%rax),%rax
jne    1110 <AdvanceToBlank+0x10>
ret

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

LLVM IR (-O2):
define i8* @AdvanceToBlank(i8* %0) {
br label %2
2: ; preds = %2, %1
%3 = phi i8* [ %0, %1 ], [ %6, %2 ]
%4 = load i8, i8* %3
%5 = icmp eq i8 %4, 32
%6 = getelementptr inbounds i8, i8* %3, i64 1
br i1 %5, label %7, label %2
7: ; preds = %2
ret i8* %3
}
/* Variables and functions */
int /*<<< orphan*/ printf(char *);
int main(int argc __attribute__((unused)),
         char **argv __attribute__((unused))) {
  printf("This is only a dummy\n"
         "libdmconfig and dm_sample must be compiled with the "
         "LIBDMCONFIG_DEBUG macro\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 = [98 x i8] c"This is only a dummy\0Alibdmconfig and dm_sample must be compiled with the LIBDMCONFIG_DEBUG macro\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 ([98 x i8], [98 x i8]* @.str, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@str = [97 x i8] c"This is only a dummy\0Alibdmconfig and dm_sample must be compiled with the LIBDMCONFIG_DEBUG macro\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([97 x i8], [97 x i8]* @str, i64 0, i64 0))
ret i32 0
}
int test_imm_07uint64_lowword_mem(unsigned long long *val) {
  return ((*val) & (0x07 << 0)) ? -20 : -40;
}


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

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

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

LLVM IR (-O2):
define i32 @test_imm_07uint64_lowword_mem(i64* nocapture %0) {
%2 = load i64, i64* %0
%3 = and i64 %2, 7
%4 = icmp eq i64 %3, 0
%5 = select i1 %4, i32 -40, i32 -20
ret i32 %5
}
unsigned int hash_string(const void *_str) {
  const char *str = _str;
  unsigned int hash = 5381;
  char c;
  while ((c = *str++)) {
    hash = ((hash << 5) + hash) + c;
  }
  return hash;
}


x86 assembly (clang, -O0):
<hash_string>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
movl   $0x1505,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x15(%rbp)
cmp    $0x0,%al
je     114a <hash_string+0x4a>
mov    -0x14(%rbp),%eax
shl    $0x5,%eax
add    -0x14(%rbp),%eax
movsbl -0x15(%rbp),%ecx
add    %ecx,%eax
mov    %eax,-0x14(%rbp)
jmp    1117 <hash_string+0x17>
mov    -0x14(%rbp),%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<hash_string>:
mov    (%rdi),%cl
test   %cl,%cl
je     1128 <hash_string+0x28>
add    $0x1,%rdi
mov    $0x1505,%eax
nop
mov    %eax,%edx
shl    $0x5,%edx
add    %eax,%edx
movsbl %cl,%eax
add    %edx,%eax
movzbl (%rdi),%ecx
add    $0x1,%rdi
test   %cl,%cl
jne    1110 <hash_string+0x10>
ret
mov    $0x1505,%eax
ret

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

LLVM IR (-O2):
define i32 @hash_string(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 0
br i1 %3, label %14, label %4
4: ; preds = %1, %4
%5 = phi i8 [ %12, %4 ], [ %2, %1 ]
%6 = phi i8* [ %8, %4 ], [ %0, %1 ]
%7 = phi i32 [ %11, %4 ], [ 5381, %1 ]
%8 = getelementptr inbounds i8, i8* %6, i64 1
%9 = mul i32 %7, 33
%10 = sext i8 %5 to i32
%11 = add i32 %9, %10
%12 = load i8, i8* %8
%13 = icmp eq i8 %12, 0
br i1 %13, label %14, label %4
14: ; preds = %4, %1
%15 = phi i32 [ 5381, %1 ], [ %11, %4 ]
ret i32 %15
}
/* Variables and functions */
int /*<<< orphan*/ stop();
void stop_moving() { stop(); }


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

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

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

LLVM IR (-O2):
define void @stop_moving() {
%1 = tail call i32 (...) @stop()
ret void
}
double Swhitenoise(double x) { return 1; }


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

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

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

LLVM IR (-O2):
define double @Swhitenoise(double %0) {
ret double 1.000000e+00
}